|
|
|
|
@ -248,7 +248,7 @@ async def create_calc_result_object(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
async def calculate_plant_eaf(
|
|
|
|
|
db_session: DbSession, simulation_id: UUID, is_default: bool
|
|
|
|
|
db_session: DbSession, simulation_id: UUID, is_default: bool, konkin_offset: Optional[int] = 0
|
|
|
|
|
):
|
|
|
|
|
"""Calculate overall plant EAF from individual node results."""
|
|
|
|
|
plant_calc_data = await get_plant_calc_result(
|
|
|
|
|
@ -268,10 +268,11 @@ async def calculate_plant_eaf(
|
|
|
|
|
plot_data=plant_plot_data.timestamp_outs
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
if is_default:
|
|
|
|
|
if konkin_offset > 0:
|
|
|
|
|
eaf_konkin = calculate_eaf_konkin(
|
|
|
|
|
plot_data=plant_plot_data.timestamp_outs,
|
|
|
|
|
periode_time=plant_calc_data.total_uptime + plant_calc_data.total_downtime
|
|
|
|
|
periode_time=int(plant_calc_data.total_uptime + plant_calc_data.total_downtime),
|
|
|
|
|
konkin_offset=konkin_offset
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
plant_calc_data.eaf_konkin = eaf_konkin
|
|
|
|
|
@ -283,4 +284,8 @@ async def calculate_plant_eaf(
|
|
|
|
|
plant_calc_data.eaf = eaf
|
|
|
|
|
plant_calc_data.derating_hours = derated_hours
|
|
|
|
|
await db_session.commit()
|
|
|
|
|
return eaf, derated_hours, efficiency_uptime
|
|
|
|
|
return eaf, derated_hours, efficiency_uptime
|
|
|
|
|
|
|
|
|
|
# async def calculate_eaf_konkin_pnat(
|
|
|
|
|
# db_session
|
|
|
|
|
# )
|