Buses in the transmission system can be classified depending of the type of load that is connected into it. For a bus with only a generator connected is called a generator bus, bus with only a loads connected is called a load bus, and the reference bus is called a swing or slack bus.
In a generator bus, the voltage and output power are controlled, thus, already determined. Voltage and output power can be controlled by either increasing or decreasing the excitation voltage. Reactive power output and angle will still have to depend on the characteristic of the network.
Like wise in load bus, power and reactive power are already determined. It can be controlled by ether increasing or decreasing the load. The voltage and angle still depend on the network.
Reference bus on the, other hand, is just a reference. All of the values computed in the power flow simulation are all with respect or relative with the swing bus. Its voltage and angle can be set to any arbitrary value but, usually, at 1.0 per unit of voltage and at an angle of zero degrees.
In power flow simulation, all of the controlled variable are fixed and does not change in the whole process
But, what do we treat a bus with both generator and load connected into it?
If both generator and load is connected in a single bus, that bus must be treated as a generator bus. That’s it, power and voltage in that bus are the controlled variables. This is because the voltage, which is controlled by the generator, does not depend on the angle, which is determined by the network, unlike the reactive power of the load. Moreover, since the generator is the one that is supplying the power, it has a greater control on the behavior of the network.
Another view why we cannot treat this bus as a load bus is that we cannot sum all of the reactive power injection in that bus because the reactive power output of the generator is unknown.
For example, if a 100 MW generator at 0.95 p.u. voltage is connected in a bus together with a 200 MW and 100MVar load. In power flow simulation, it must be represented by a generator bus with -100 MW generation at 0.95 p.u. voltage. MVar cannot be determined because it is now dependent on the generator connected with it in the same bus and on the network where the bus is connecting. The generator voltage on the other hand has nothing to depend on the load connected with it.