Add power stats and generator control visibility
This commit is contained in:
@@ -201,15 +201,25 @@ class Reactor:
|
||||
self.secondary_pump_active and idx < len(self.secondary_pump_units) and self.secondary_pump_units[idx]
|
||||
for idx in range(2)
|
||||
]
|
||||
aux_demand = constants.BASE_AUX_LOAD_MW + constants.PUMP_POWER_MW * (
|
||||
sum(primary_units_active) + sum(secondary_units_active)
|
||||
)
|
||||
aux_base = constants.BASE_AUX_LOAD_MW
|
||||
aux_pump_primary = constants.PUMP_POWER_MW * sum(primary_units_active)
|
||||
aux_pump_secondary = constants.PUMP_POWER_MW * sum(secondary_units_active)
|
||||
aux_demand = aux_base + aux_pump_primary + aux_pump_secondary
|
||||
turbine_electrical = state.total_electrical_output()
|
||||
generator_power = self._step_generators(state, aux_demand, turbine_electrical, dt)
|
||||
aux_available = turbine_electrical + generator_power
|
||||
power_ratio = 1.0 if aux_demand <= 0 else min(1.0, aux_available / aux_demand)
|
||||
if aux_demand > 0 and aux_available < 0.5 * aux_demand:
|
||||
LOGGER.warning("Aux power deficit: available %.1f/%.1f MW", aux_available, aux_demand)
|
||||
state.aux_draws = {
|
||||
"base": aux_base * power_ratio,
|
||||
"primary_pumps": aux_pump_primary * power_ratio,
|
||||
"secondary_pumps": aux_pump_secondary * power_ratio,
|
||||
"total_demand": aux_demand,
|
||||
"supplied": aux_available,
|
||||
"generator_output": generator_power,
|
||||
"turbine_output": turbine_electrical,
|
||||
}
|
||||
|
||||
if self.primary_pump_active:
|
||||
total_flow = 0.0
|
||||
|
||||
Reference in New Issue
Block a user