|
|
|
|
@ -248,7 +248,7 @@ async def create_calc_result_object(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
async def calculate_plant_eaf(
|
|
|
|
|
db_session: DbSession, simulation_id: UUID, is_default: bool, konkin_offset: Optional[int] = 0
|
|
|
|
|
db_session: DbSession, simulation_id: UUID, mo_downtime: int, po_downtime:int, oh_interval:int
|
|
|
|
|
):
|
|
|
|
|
"""Calculate overall plant EAF from individual node results."""
|
|
|
|
|
plant_calc_data = await get_plant_calc_result(
|
|
|
|
|
@ -258,33 +258,30 @@ async def calculate_plant_eaf(
|
|
|
|
|
plant_plot_data = await get_simulation_with_plot_result(
|
|
|
|
|
db_session=db_session, simulation_id=simulation_id, node_id="plant"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
is_oh_from_aeros = (plant_calc_data.total_uptime + plant_calc_data.total_downtime) > oh_interval
|
|
|
|
|
|
|
|
|
|
seasonal_outage = (mo_downtime*24 + po_downtime*24) if is_oh_from_aeros else mo_downtime*24
|
|
|
|
|
forced_outage = (plant_calc_data.total_downtime - po_downtime*24) if is_oh_from_aeros else plant_calc_data.total_downtime
|
|
|
|
|
total_period_time = plant_calc_data.total_uptime + seasonal_outage + forced_outage
|
|
|
|
|
|
|
|
|
|
eaf, derated_hours = calculate_eaf(
|
|
|
|
|
eaf, efor, sof, edh = calculate_eaf(
|
|
|
|
|
available_hours=plant_calc_data.total_uptime,
|
|
|
|
|
period_hours=plant_calc_data.total_uptime + plant_calc_data.total_downtime,
|
|
|
|
|
actual_production=plant_calc_data.production,
|
|
|
|
|
ideal_production=plant_calc_data.ideal_production,
|
|
|
|
|
downtime_hours=plant_calc_data.total_downtime,
|
|
|
|
|
period_hours=total_period_time,
|
|
|
|
|
forced_outage_hours=forced_outage,
|
|
|
|
|
seasonal_outage_hours=seasonal_outage,
|
|
|
|
|
plot_data=plant_plot_data.timestamp_outs
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
if konkin_offset > 0:
|
|
|
|
|
eaf_konkin = calculate_eaf_konkin(
|
|
|
|
|
plot_data=plant_plot_data.timestamp_outs,
|
|
|
|
|
periode_time=int(plant_calc_data.total_uptime + plant_calc_data.total_downtime),
|
|
|
|
|
konkin_offset=konkin_offset
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
plant_calc_data.eaf_konkin = eaf_konkin
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
efficiency_uptime = plant_calc_data.total_uptime - derated_hours
|
|
|
|
|
|
|
|
|
|
plant_calc_data.total_mo_downtime = mo_downtime
|
|
|
|
|
plant_calc_data.total_po_downtime = po_downtime
|
|
|
|
|
plant_calc_data.eaf = eaf
|
|
|
|
|
plant_calc_data.derating_hours = derated_hours
|
|
|
|
|
plant_calc_data.efor = efor
|
|
|
|
|
plant_calc_data.sof = sof
|
|
|
|
|
plant_calc_data.derating_hours = edh
|
|
|
|
|
await db_session.commit()
|
|
|
|
|
return eaf, derated_hours, efficiency_uptime
|
|
|
|
|
return eaf
|
|
|
|
|
|
|
|
|
|
# async def calculate_eaf_konkin_pnat(
|
|
|
|
|
# db_session
|
|
|
|
|
|