From ededd0f960d56a8cd0363698886006d64e635cfa Mon Sep 17 00:00:00 2001 From: Michael Kovari Date: Tue, 7 Jul 2026 13:27:00 +0100 Subject: [PATCH 1/4] Power balances coded --- process/models/physics/physics.py | 417 ++++++++++++++++++++++++++++++ 1 file changed, 417 insertions(+) diff --git a/process/models/physics/physics.py b/process/models/physics/physics.py index 17e9a0bec7..00b354ae16 100644 --- a/process/models/physics/physics.py +++ b/process/models/physics/physics.py @@ -2298,6 +2298,423 @@ def outplas(self): if self.data.physics.i_plasma_ignited == 1: po.ocmmnt(self.outfile, " (Injected power only used for start-up phase)") + # Global power imbalance output #4233 ######################################## + po.oheadr(self.outfile, "Power accounting") + p_loss_mw = ( + self.data.current_drive.f_p_beam_orbit_loss + + self.data.current_drive.p_beam_shine_through_mw + + self.data.physics.p_fw_alpha_mw + ) + p_impurity_mw = ( + self.data.physics.p_plasma_inner_rad_mw + + self.data.physics.p_plasma_outer_rad_mw + ) + po.ocmmnt( + self.outfile, + "See Figure in https://ukaea.github.io/PROCESS/physics-models/plasma_power_balance", + ) + p_plasma_out = ( + self.data.physics.p_electron_transport_loss_mw + + self.data.physics.p_ion_transport_loss_mw + + p_loss_mw + + self.data.physics.p_plasma_sync_mw + + p_impurity_mw + ) + + p_plasma_in = ( + self.data.physics.p_alpha_total_mw + + self.data.physics.p_non_alpha_charged_mw + + self.data.current_drive.p_hcd_injected_total_mw + + self.data.physics.p_plasma_ohmic_mw + ) + po.oshead(self.outfile, "Plasma power balance across separatrix") + po.ovarre( + self.outfile, + "Net power transported by electrons (MW)", + "(p_electron_transport_loss_mw)", + self.data.physics.p_electron_transport_loss_mw, + "OP ", + ) + po.ovarre( + self.outfile, + "Net power transported by ions (MW)", + "(p_ion_transport_loss_mw)", + self.data.physics.p_ion_transport_loss_mw, + "OP ", + ) + po.ovarre( + self.outfile, + "Power lost by beam ions and unthermalised alphas (MW)", + "(p_loss_mw)", + p_loss_mw, + "OP ", + ) + po.ovarre( + self.outfile, + "Net loss by synchrotron radiation (MW)", + "(p_plasma_sync_mw)", + self.data.physics.p_plasma_sync_mw, + "OP ", + ) + po.ovarre( + self.outfile, + "Power lost by line radiation and bremsstrahlung (MW)", + "(p_impurity_mw)", + p_impurity_mw, + "OP ", + ) + po.ovarre( + self.outfile, + "Total (MW)", + "(p_plasma_out)", + p_plasma_out, + "OP ", + ) + po.oblnkl(self.outfile) + po.ovarre( + self.outfile, + "Alpha power (MW)", + "(p_alpha_total_mw)", + self.data.physics.p_alpha_total_mw, + "OP ", + ) + po.ovarre( + self.outfile, + "Power from p, 3He, T products of DD and/or D-He3 fusion (MW)", + "(p_non_alpha_charged_mw)", + self.data.physics.p_non_alpha_charged_mw, + "OP ", + ) + po.ovarre( + self.outfile, + "Injected power (MW)", + "(p_hcd_injected_total_mw)", + self.data.current_drive.p_hcd_injected_total_mw, + "OP ", + ) + po.ovarre( + self.outfile, + "Ohmic heating (MW)", + "(p_plasma_ohmic_mw)", + self.data.physics.p_plasma_ohmic_mw, + "OP ", + ) + po.ovarre( + self.outfile, + "Total (MW)", + "(p_plasma_in)", + p_plasma_in, + "OP ", + ) + po.ovarre( + self.outfile, + "Plasma power imbalance (MW)", + "(p_plasma_out - p_plasma_in)", + p_plasma_out - p_plasma_in, + "OP ", + ) + if abs(p_plasma_out - p_plasma_in) > 0.1: + logger.error("Plasma power imbalance > 0.1 MW") + + #################################################### + p_reactor_in = ( + self.data.physics.p_fusion_total_mw + + self.data.fwbs.p_blkt_multiplication_mw + + self.data.current_drive.p_hcd_injected_total_mw + + self.data.physics.p_plasma_ohmic_mw + + self.data.primary_pumping.p_fw_blkt_coolant_pump_mw + + self.data.heat_transport.p_div_coolant_pump_mw + ) + p_reactor_out = ( + self.data.heat_transport.p_plant_primary_heat_mw + + self.data.heat_transport.p_div_secondary_heat_mw + + self.data.heat_transport.p_shld_secondary_heat_mw + + self.data.fwbs.p_tf_nuclear_heat_mw + + self.data.fwbs.p_fw_hcd_nuclear_heat_mw + + self.data.fwbs.p_fw_hcd_rad_total_mw + ) + po.oshead(self.outfile, "Power balance for reactor") + po.ovarre( + self.outfile, + "Fusion power (MW)", + "(p_fusion_total_mw)", + self.data.physics.p_fusion_total_mw, + "OP ", + ) + po.ovarre( + self.outfile, + "Energy multiplication in blanket and shield (MW)", + "(p_blkt_multiplication_mw)", + self.data.fwbs.p_blkt_multiplication_mw, + "OP ", + ) + po.ovarre( + self.outfile, + "Injected power (MW)", + "(p_hcd_injected_total_mw)", + self.data.current_drive.p_hcd_injected_total_mw, + "OP ", + ) + po.ovarre( + self.outfile, + "Ohmic heating (MW)", + "(p_plasma_ohmic_mw)", + self.data.physics.p_plasma_ohmic_mw, + "OP ", + ) + po.ovarre( + self.outfile, + "Power deposited by pump in coolant for FW and blanket circuit (MW)", + "(p_fw_blkt_coolant_pump_mw)", + self.data.primary_pumping.p_fw_blkt_coolant_pump_mw, + "OP ", + ) + po.ovarre( + self.outfile, + "Power deposited by pump in coolant for divertor circuit (MW)", + "(p_div_coolant_pump_mw)", + self.data.heat_transport.p_div_coolant_pump_mw, + "OP ", + ) + po.ovarre( + self.outfile, + "Total (MW)", + "(p_reactor_in)", + p_reactor_in, + "OP ", + ) + po.oblnkl(self.outfile) + po.ovarre( + self.outfile, + "Total primary thermal power used for electricity production (MW)", + "(p_plant_primary_heat_mw)", + self.data.heat_transport.p_plant_primary_heat_mw, + "OP ", + ) + po.ovarre( + self.outfile, + "Divertor thermal power not used for electricity production (MW)", + "(p_div_secondary_heat_mw)", + self.data.heat_transport.p_div_secondary_heat_mw, + "OP ", + ) + po.ovarre( + self.outfile, + "Shield thermal power not used for electricity production (MW)", + "(p_shld_secondary_heat_mw)", + self.data.heat_transport.p_shld_secondary_heat_mw, + "OP ", + ) + po.ovarre( + self.outfile, + "Nuclear heating in TF coils (MW)", + "(p_tf_nuclear_heat_mw)", + self.data.fwbs.p_tf_nuclear_heat_mw, + "OP ", + ) + po.ovarre( + self.outfile, + "Nuclear heating in H&CD systems and diagnostics (MW)", + "(p_fw_hcd_nuclear_heat_mw)", + self.data.fwbs.p_fw_hcd_nuclear_heat_mw, + "OP ", + ) + po.ovarre( + self.outfile, + "Radiation heat deposited in H&CD systems and diagnostics (MW)", + "(p_fw_hcd_rad_total_mw)", + self.data.fwbs.p_fw_hcd_rad_total_mw, + "OP ", + ) + po.ovarre( + self.outfile, + "Total (MW)", + "(p_reactor_out)", + p_reactor_out, + "OP ", + ) + po.ovarre( + self.outfile, + "Reactor power imbalance (MW)", + "(reactor_in - reactor_out)", + p_reactor_in - p_reactor_out, + "OP ", + ) + if abs(p_reactor_in - p_reactor_out) > 0.1: + logger.error("Reactor power imbalance > 0.1 MW") + ###################################################### + po.oshead(self.outfile, "Electrical power balance") + p_electric_demand = ( + self.data.heat_transport.p_plant_electric_net_mw + + self.data.heat_transport.p_tf_electric_supplies_mw + + self.data.pf_coil.p_pf_electric_supplies_mw + + self.data.heat_transport.p_hcd_electric_total_mw + + self.data.heat_transport.p_coolant_pump_elec_total_mw + + self.data.heat_transport.vachtmw + + self.data.heat_transport.p_cryo_plant_electric_mw + + self.data.heat_transport.p_tritium_plant_electric_mw + + self.data.heat_transport.fachtmw + ) + po.ovarre( + self.outfile, + "Net electric (MW)", + "(p_plant_electric_net_mw)", + self.data.heat_transport.p_plant_electric_net_mw, + "OP ", + ) + po.ovarre( + self.outfile, + "TF coils electric power (MW)", + "(p_tf_electric_supplies_mw)", + self.data.heat_transport.p_tf_electric_supplies_mw, + "OP ", + ) + po.ovarre( + self.outfile, + "PF coils electric power (MW)", + "(p_pf_electric_supplies_mw)", + self.data.pf_coil.p_pf_electric_supplies_mw, + "OP ", + ) + po.ovarre( + self.outfile, + "Heating and current drive electric power (MW)", + "(p_hcd_electric_total_mw)", + self.data.heat_transport.p_hcd_electric_total_mw, + "OP ", + ) + po.ovarre( + self.outfile, + "Primary coolant pump electric power (MW)", + "(p_coolant_pump_elec_total_mw)", + self.data.heat_transport.p_coolant_pump_elec_total_mw, + "OP ", + ) + po.ovarre( + self.outfile, + "Vacuum pumps electric power (MW)", + "(vachtmw)", + self.data.heat_transport.vachtmw, + "OP ", + ) + po.ovarre( + self.outfile, + "Cryoplant electric power (MW)", + "(p_cryo_plant_electric_mw)", + self.data.heat_transport.p_cryo_plant_electric_mw, + "OP ", + ) + po.ovarre( + self.outfile, + "Tritium plant electric power (MW)", + "(p_tritium_plant_elec_mw)", + self.data.heat_transport.p_tritium_plant_electric_mw, + "OP ", + ) + po.ovarre( + self.outfile, + "All other internal electric power requirements (MW)", + "(fachtmw)", + self.data.heat_transport.fachtmw, + "OP ", + ) + po.ovarre( + self.outfile, + "Total (MW)", + "(p_electric_demand)", + p_electric_demand, + "OP ", + ) + po.oblnkl(self.outfile) + po.ovarre( + self.outfile, + "Gross electric output (MW)", + "(p_plant_electric_gross_mw)", + self.data.heat_transport.p_plant_electric_gross_mw, + "OP ", + ) + po.ovarre( + self.outfile, + "Electric power imbalance (MW)", + "()", + p_electric_demand - self.data.heat_transport.p_plant_electric_gross_mw, + "OP ", + ) + if ( + abs(p_electric_demand - self.data.heat_transport.p_plant_electric_gross_mw) + > 0.1 + ): + logger.error("Electric power imbalance > 0.1 MW") + ######################################################## + po.oshead(self.outfile, "Power balance for power plant") + p_plant_in_mw = ( + self.data.physics.p_fusion_total_mw + self.data.fwbs.p_blkt_multiplication_mw + ) + p_plant_out_mw = ( + self.data.heat_transport.p_plant_electric_net_mw + + self.data.power.p_turbine_loss_mw + + self.data.heat_transport.p_plant_secondary_heat_mw + ) + po.ovarre( + self.outfile, + "Fusion power (MW)", + "(p_fusion_total_mw)", + self.data.physics.p_fusion_total_mw, + "OP ", + ) + po.ovarre( + self.outfile, + "Energy multiplication in blanket and shield (MW)", + "(p_blkt_multiplication_mw)", + self.data.fwbs.p_blkt_multiplication_mw, + "OP ", + ) + po.ovarre( + self.outfile, + "Total (MW)", + "(p_nuclear_total_mw)", + p_plant_in_mw, + "OP ", + ) + po.oblnkl(self.outfile) + po.ovarre( + self.outfile, + "Net electric (MW)", + "(p_plant_electric_net_mw)", + self.data.heat_transport.p_plant_electric_net_mw, + "OP ", + ) + po.ovarre( + self.outfile, + "Heat rejected by main power conversion circuit (MW)", + "(p_turbine_loss_mw)", + self.data.power.p_turbine_loss_mw, + "OP ", + ) + po.ovarre( + self.outfile, + "Heat rejected by other circuits (secondary heat) (MW)", + "(p_plant_secondary_heat_mw)", + self.data.heat_transport.p_plant_secondary_heat_mw, + "OP ", + ) + po.ovarre( + self.outfile, + "Total (MW)", + "(p_plant_out_mw)", + p_plant_out_mw, + "OP ", + ) + po.ovarre( + self.outfile, + "Power plant overall imbalance (MW)", + "(p_plant_in_mw - p_plant_out_mw)", + p_plant_in_mw - p_plant_out_mw, + "OP ", + ) + if abs(p_plant_in_mw - p_plant_out_mw) > 0.1: + logger.error("Power plant overall imbalance > 0.1 MW") + self.exhaust.output() if self.data.stellarator.istell == 0: From f013aeaa35b9e13f22689a246d5fe033fc72e998 Mon Sep 17 00:00:00 2001 From: Michael Kovari Date: Tue, 7 Jul 2026 15:40:10 +0100 Subject: [PATCH 2/4] New variables created for the imbalances --- process/models/physics/physics.py | 33 +++++++++++++++++-------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/process/models/physics/physics.py b/process/models/physics/physics.py index 00b354ae16..351c66b5c7 100644 --- a/process/models/physics/physics.py +++ b/process/models/physics/physics.py @@ -2327,6 +2327,7 @@ def outplas(self): + self.data.current_drive.p_hcd_injected_total_mw + self.data.physics.p_plasma_ohmic_mw ) + p_plasma_imbalance_mw = p_plasma_out - p_plasma_in po.oshead(self.outfile, "Plasma power balance across separatrix") po.ovarre( self.outfile, @@ -2409,11 +2410,11 @@ def outplas(self): po.ovarre( self.outfile, "Plasma power imbalance (MW)", - "(p_plasma_out - p_plasma_in)", - p_plasma_out - p_plasma_in, + "(p_plasma_imbalance_mw)", + p_plasma_imbalance_mw, "OP ", ) - if abs(p_plasma_out - p_plasma_in) > 0.1: + if abs(p_plasma_imbalance_mw) > 0.1: logger.error("Plasma power imbalance > 0.1 MW") #################################################### @@ -2433,6 +2434,7 @@ def outplas(self): + self.data.fwbs.p_fw_hcd_nuclear_heat_mw + self.data.fwbs.p_fw_hcd_rad_total_mw ) + p_reactor_imbalance_mw = p_reactor_in - p_reactor_out po.oshead(self.outfile, "Power balance for reactor") po.ovarre( self.outfile, @@ -2536,11 +2538,11 @@ def outplas(self): po.ovarre( self.outfile, "Reactor power imbalance (MW)", - "(reactor_in - reactor_out)", - p_reactor_in - p_reactor_out, + "(p_reactor_imbalance_mw)", + p_reactor_imbalance_mw, "OP ", ) - if abs(p_reactor_in - p_reactor_out) > 0.1: + if abs(p_reactor_imbalance_mw) > 0.1: logger.error("Reactor power imbalance > 0.1 MW") ###################################################### po.oshead(self.outfile, "Electrical power balance") @@ -2555,6 +2557,9 @@ def outplas(self): + self.data.heat_transport.p_tritium_plant_electric_mw + self.data.heat_transport.fachtmw ) + p_electric_imbalance = ( + p_electric_demand - self.data.heat_transport.p_plant_electric_gross_mw + ) po.ovarre( self.outfile, "Net electric (MW)", @@ -2636,14 +2641,11 @@ def outplas(self): po.ovarre( self.outfile, "Electric power imbalance (MW)", - "()", - p_electric_demand - self.data.heat_transport.p_plant_electric_gross_mw, + "(p_electric_imbalance)", + p_electric_imbalance, "OP ", ) - if ( - abs(p_electric_demand - self.data.heat_transport.p_plant_electric_gross_mw) - > 0.1 - ): + if abs(p_electric_imbalance) > 0.1: logger.error("Electric power imbalance > 0.1 MW") ######################################################## po.oshead(self.outfile, "Power balance for power plant") @@ -2655,6 +2657,7 @@ def outplas(self): + self.data.power.p_turbine_loss_mw + self.data.heat_transport.p_plant_secondary_heat_mw ) + p_plant_imbalance_mw = p_plant_in_mw - p_plant_out_mw po.ovarre( self.outfile, "Fusion power (MW)", @@ -2708,11 +2711,11 @@ def outplas(self): po.ovarre( self.outfile, "Power plant overall imbalance (MW)", - "(p_plant_in_mw - p_plant_out_mw)", - p_plant_in_mw - p_plant_out_mw, + "(p_plant_imbalance_mw)", + p_plant_imbalance_mw, "OP ", ) - if abs(p_plant_in_mw - p_plant_out_mw) > 0.1: + if abs(p_plant_imbalance_mw) > 0.1: logger.error("Power plant overall imbalance > 0.1 MW") self.exhaust.output() From e21adc34486738909c378329bb219534bbd6fc80 Mon Sep 17 00:00:00 2001 From: Michael Kovari Date: Wed, 8 Jul 2026 11:01:49 +0100 Subject: [PATCH 3/4] Cahnges as requested by Tim. New variables created to fill in the blanks. Some duplicate outputs removed from power.py and hcpb.py --- process/models/blankets/hcpb.py | 6 ------ process/models/physics/physics.py | 24 +++++------------------- process/models/power.py | 7 ------- 3 files changed, 5 insertions(+), 32 deletions(-) diff --git a/process/models/blankets/hcpb.py b/process/models/blankets/hcpb.py index 4187fe05cb..2cba6913d3 100644 --- a/process/models/blankets/hcpb.py +++ b/process/models/blankets/hcpb.py @@ -586,12 +586,6 @@ def nuclear_heating_magnets(self, output: bool): "(p_tf_nuclear_heat_mw.)", self.data.fwbs.p_tf_nuclear_heat_mw, ) - po.ovarre( - self.outfile, - "p_fusion_total_mw", - "(p_fusion_total_mw.)", - self.data.physics.p_fusion_total_mw, - ) po.ovarre( self.outfile, "total mass of the TF coils (kg)", diff --git a/process/models/physics/physics.py b/process/models/physics/physics.py index 351c66b5c7..44f0bacec3 100644 --- a/process/models/physics/physics.py +++ b/process/models/physics/physics.py @@ -2267,20 +2267,7 @@ def outplas(self): self.data.physics.f_alpha_ion, "OP ", ) - po.ovarre( - self.outfile, - "Ion transport (MW)", - "(p_ion_transport_loss_mw)", - self.data.physics.p_ion_transport_loss_mw, - "OP ", - ) - po.ovarre( - self.outfile, - "Electron transport (MW)", - "(p_electron_transport_loss_mw)", - self.data.physics.p_electron_transport_loss_mw, - "OP ", - ) + # Ion and electron transpor are now output belowin power accounting po.ovarre( self.outfile, "Injection power to ions (MW)", @@ -2298,7 +2285,7 @@ def outplas(self): if self.data.physics.i_plasma_ignited == 1: po.ocmmnt(self.outfile, " (Injected power only used for start-up phase)") - # Global power imbalance output #4233 ######################################## + # Global power imbalance output #4233 po.oheadr(self.outfile, "Power accounting") p_loss_mw = ( self.data.current_drive.f_p_beam_orbit_loss @@ -2417,7 +2404,7 @@ def outplas(self): if abs(p_plasma_imbalance_mw) > 0.1: logger.error("Plasma power imbalance > 0.1 MW") - #################################################### + po.oshead(self.outfile, "Power balance for reactor") p_reactor_in = ( self.data.physics.p_fusion_total_mw + self.data.fwbs.p_blkt_multiplication_mw @@ -2435,7 +2422,6 @@ def outplas(self): + self.data.fwbs.p_fw_hcd_rad_total_mw ) p_reactor_imbalance_mw = p_reactor_in - p_reactor_out - po.oshead(self.outfile, "Power balance for reactor") po.ovarre( self.outfile, "Fusion power (MW)", @@ -2544,7 +2530,7 @@ def outplas(self): ) if abs(p_reactor_imbalance_mw) > 0.1: logger.error("Reactor power imbalance > 0.1 MW") - ###################################################### + po.oshead(self.outfile, "Electrical power balance") p_electric_demand = ( self.data.heat_transport.p_plant_electric_net_mw @@ -2647,7 +2633,7 @@ def outplas(self): ) if abs(p_electric_imbalance) > 0.1: logger.error("Electric power imbalance > 0.1 MW") - ######################################################## + po.oshead(self.outfile, "Power balance for power plant") p_plant_in_mw = ( self.data.physics.p_fusion_total_mw + self.data.fwbs.p_blkt_multiplication_mw diff --git a/process/models/power.py b/process/models/power.py index f118788469..478cd4ed2e 100644 --- a/process/models/power.py +++ b/process/models/power.py @@ -1410,13 +1410,6 @@ def output_plant_electric_powers(self): po.ocmmnt(self.outfile, "Turbine conversion : ") po.oblnkl(self.outfile) - po.ovarre( - self.outfile, - "Total high grade thermal power used for electricity production [MWth]", - "(p_plant_primary_heat_mw)", - self.data.heat_transport.p_plant_primary_heat_mw, - ) - po.ovarrf( self.outfile, "Thermal to electric conversion efficiency of the turbine", From b442ceb54597abd8e07c3adbbd0f93f14f2f7406 Mon Sep 17 00:00:00 2001 From: Michael Kovari Date: Fri, 10 Jul 2026 14:42:15 +0100 Subject: [PATCH 4/4] Partly Implemented some formatting suggestions. Replaced rad terms by p_plasma_out. --- process/models/physics/impurity_radiation.py | 6 +- process/models/physics/physics.py | 71 ++++++++++---------- 2 files changed, 38 insertions(+), 39 deletions(-) diff --git a/process/models/physics/impurity_radiation.py b/process/models/physics/impurity_radiation.py index f4b5363134..567a64c244 100644 --- a/process/models/physics/impurity_radiation.py +++ b/process/models/physics/impurity_radiation.py @@ -655,8 +655,10 @@ def integrate_radiation_loss_profiles(self): """Integrate the radiation loss profiles using the Simpson rule. Store the total values for each aspect of impurity radiation loss. """ - # 2.0e-6 converts from W/m^3 to MW/m^3 and also accounts for both sides of the - # plasma + # 1e-6 converts from W/m^3 to MW/m^3 + # The factor 2 below and and normalised radius profile_x above may be unexpected, but are correct: + # see github.com/ukaea/PROCESS/issues/3968#issuecomment-3491154712 + # and github.com/ukaea/PROCESS/issues/3968#issuecomment-4935567006 self.pden_impurity_rad_total_mw = 2.0e-6 * integrate.simpson( self.pden_impurity_rad_profile, x=self.plasma_profile.neprofile.profile_x, diff --git a/process/models/physics/physics.py b/process/models/physics/physics.py index 44f0bacec3..d955a9fa4e 100644 --- a/process/models/physics/physics.py +++ b/process/models/physics/physics.py @@ -2287,25 +2287,20 @@ def outplas(self): # Global power imbalance output #4233 po.oheadr(self.outfile, "Power accounting") + po.ocmmnt( + self.outfile, + "See Figure in https://ukaea.github.io/PROCESS/physics-models/plasma_power_balance", + ) p_loss_mw = ( self.data.current_drive.f_p_beam_orbit_loss + self.data.current_drive.p_beam_shine_through_mw + self.data.physics.p_fw_alpha_mw ) - p_impurity_mw = ( - self.data.physics.p_plasma_inner_rad_mw - + self.data.physics.p_plasma_outer_rad_mw - ) - po.ocmmnt( - self.outfile, - "See Figure in https://ukaea.github.io/PROCESS/physics-models/plasma_power_balance", - ) p_plasma_out = ( self.data.physics.p_electron_transport_loss_mw + self.data.physics.p_ion_transport_loss_mw + p_loss_mw - + self.data.physics.p_plasma_sync_mw - + p_impurity_mw + + self.data.physics.p_plasma_rad_mw ) p_plasma_in = ( @@ -2314,8 +2309,9 @@ def outplas(self): + self.data.current_drive.p_hcd_injected_total_mw + self.data.physics.p_plasma_ohmic_mw ) - p_plasma_imbalance_mw = p_plasma_out - p_plasma_in + p_plasma_imbalance_mw = p_plasma_in - p_plasma_out po.oshead(self.outfile, "Plasma power balance across separatrix") + po.ocmmnt(self.outfile, "IN") po.ovarre( self.outfile, "Net power transported by electrons (MW)", @@ -2339,26 +2335,20 @@ def outplas(self): ) po.ovarre( self.outfile, - "Net loss by synchrotron radiation (MW)", - "(p_plasma_sync_mw)", - self.data.physics.p_plasma_sync_mw, - "OP ", - ) - po.ovarre( - self.outfile, - "Power lost by line radiation and bremsstrahlung (MW)", - "(p_impurity_mw)", - p_impurity_mw, + "Total radiation loss, including net loss by synchrotron radiation (MW)", + "(p_plasma_rad_mw)", + self.data.physics.p_plasma_rad_mw, "OP ", ) po.ovarre( self.outfile, - "Total (MW)", + "TOTAL (MW)", "(p_plasma_out)", p_plasma_out, "OP ", ) po.oblnkl(self.outfile) + po.ocmmnt(self.outfile, "OUT") po.ovarre( self.outfile, "Alpha power (MW)", @@ -2389,7 +2379,7 @@ def outplas(self): ) po.ovarre( self.outfile, - "Total (MW)", + "TOTAL (MW)", "(p_plasma_in)", p_plasma_in, "OP ", @@ -2422,6 +2412,7 @@ def outplas(self): + self.data.fwbs.p_fw_hcd_rad_total_mw ) p_reactor_imbalance_mw = p_reactor_in - p_reactor_out + po.ocmmnt(self.outfile, "IN") po.ovarre( self.outfile, "Fusion power (MW)", @@ -2466,12 +2457,13 @@ def outplas(self): ) po.ovarre( self.outfile, - "Total (MW)", + "TOTAL (MW)", "(p_reactor_in)", p_reactor_in, "OP ", ) po.oblnkl(self.outfile) + po.ocmmnt(self.outfile, "OUT") po.ovarre( self.outfile, "Total primary thermal power used for electricity production (MW)", @@ -2516,7 +2508,7 @@ def outplas(self): ) po.ovarre( self.outfile, - "Total (MW)", + "TOTAL (MW)", "(p_reactor_out)", p_reactor_out, "OP ", @@ -2544,11 +2536,21 @@ def outplas(self): + self.data.heat_transport.fachtmw ) p_electric_imbalance = ( - p_electric_demand - self.data.heat_transport.p_plant_electric_gross_mw + self.data.heat_transport.p_plant_electric_gross_mw - p_electric_demand ) + po.ocmmnt(self.outfile, "GENERATION") po.ovarre( self.outfile, - "Net electric (MW)", + "Gross electric output (MW)", + "(p_plant_electric_gross_mw)", + self.data.heat_transport.p_plant_electric_gross_mw, + "OP ", + ) + po.oblnkl(self.outfile) + po.ocmmnt(self.outfile, "PURPOSE") + po.ovarre( + self.outfile, + "Net electric exported (MW)", "(p_plant_electric_net_mw)", self.data.heat_transport.p_plant_electric_net_mw, "OP ", @@ -2611,19 +2613,12 @@ def outplas(self): ) po.ovarre( self.outfile, - "Total (MW)", + "TOTAL (MW)", "(p_electric_demand)", p_electric_demand, "OP ", ) po.oblnkl(self.outfile) - po.ovarre( - self.outfile, - "Gross electric output (MW)", - "(p_plant_electric_gross_mw)", - self.data.heat_transport.p_plant_electric_gross_mw, - "OP ", - ) po.ovarre( self.outfile, "Electric power imbalance (MW)", @@ -2635,6 +2630,7 @@ def outplas(self): logger.error("Electric power imbalance > 0.1 MW") po.oshead(self.outfile, "Power balance for power plant") + po.ocmmnt(self.outfile, "IN") p_plant_in_mw = ( self.data.physics.p_fusion_total_mw + self.data.fwbs.p_blkt_multiplication_mw ) @@ -2660,12 +2656,13 @@ def outplas(self): ) po.ovarre( self.outfile, - "Total (MW)", + "TOTAL (MW)", "(p_nuclear_total_mw)", p_plant_in_mw, "OP ", ) po.oblnkl(self.outfile) + po.ocmmnt(self.outfile, "OUT") po.ovarre( self.outfile, "Net electric (MW)", @@ -2689,7 +2686,7 @@ def outplas(self): ) po.ovarre( self.outfile, - "Total (MW)", + "TOTAL (MW)", "(p_plant_out_mw)", p_plant_out_mw, "OP ",