Skip to content

4233 global power imbalance output#4417

Open
mkovari wants to merge 7 commits into
mainfrom
4233-global-power-imbalance-output
Open

4233 global power imbalance output#4417
mkovari wants to merge 7 commits into
mainfrom
4233-global-power-imbalance-output

Conversation

@mkovari

@mkovari mkovari commented Jul 7, 2026

Copy link
Copy Markdown
Collaborator

This implements issue #4233. I have restored the power accounting section in the output files.
Note the powers do not balance - see issue for details.
The only changes are additional outputs.
I have merged main into this branch, but's a long time since I have made a merge request - let me know if there are any problems. I have no idea how to update the outputs of the regression tests, or if I need to do this.
I will create new issues to resolve the imbalances. Those will need to be looked at by Chris and others - for the moment I suggest any of the people on the maintainer list are sufficient.

@mkovari mkovari requested a review from a team as a code owner July 7, 2026 12:51
@mkovari mkovari linked an issue Jul 7, 2026 that may be closed by this pull request
@codecov-commenter

codecov-commenter commented Jul 7, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 85 lines in your changes missing coverage. Please review.
✅ Project coverage is 48.74%. Comparing base (1eeee1f) to head (6dec312).

Files with missing lines Patch % Lines
process/models/physics/physics.py 0.00% 85 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4417      +/-   ##
==========================================
- Coverage   48.87%   48.74%   -0.14%     
==========================================
  Files         151      151              
  Lines       29424    29505      +81     
==========================================
  Hits        14381    14381              
- Misses      15043    15124      +81     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@timothy-nunn timothy-nunn left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just some suggestions from a quick code review. Will check the calculations in another review.

Comment thread process/models/physics/physics.py Outdated
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 ########################################

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# Global power imbalance output #4233 ########################################

@mkovari mkovari Jul 8, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Row of # removed. Comment unchanged

Comment thread process/models/physics/physics.py Outdated
po.ovarre(
self.outfile,
"Plasma power imbalance (MW)",
"(p_plasma_out - p_plasma_in)",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"(p_plasma_out - p_plasma_in)",
"(p_plasma_out_subtract_p_plasma_in)",

I don't think this will be able to be indexed from the MFILE properly

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All these have been replaced by new variables:
"(p_plasma_imbalance_mw)",
etc

Comment thread process/models/physics/physics.py Outdated
if abs(p_plasma_out - p_plasma_in) > 0.1:
logger.error("Plasma power imbalance > 0.1 MW")

####################################################

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
####################################################

I know these still exist in the code but I try and keep them at a minimum

@mkovari mkovari Jul 7, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed

Comment thread process/models/physics/physics.py Outdated
Comment thread process/models/physics/physics.py Outdated
Comment thread process/models/physics/physics.py Outdated
po.ovarre(
self.outfile,
"Electric power imbalance (MW)",
"()",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you assign this an output name otherwise I suspect it will cause issues in the MFILE parsing at some point

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New variable

Comment thread process/models/physics/physics.py Outdated
po.ovarre(
self.outfile,
"Power plant overall imbalance (MW)",
"(p_plant_in_mw - p_plant_out_mw)",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"(p_plant_in_mw - p_plant_out_mw)",
"(p_plant_in_mw_subtract_p_plant_out_mw)",

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New variable

@timothy-nunn timothy-nunn self-assigned this Jul 7, 2026

@timothy-nunn timothy-nunn left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A lot of these variables are already being output in the same routine/in other models. I don't see a reason to do this twice?

Comment on lines +2331 to +2344
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 ",
)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These variables are already output above

Suggested change
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 ",
)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed. Nevertheless, we need to check that the powers balance, and there is no easy way to check that from the existing outputs. A certain amount of redundancy is not a big deal. It may be possible to slim down the rest of the output file - I can look at that, but that would be another issue.

In theory one could hide the output if it balances, and display it only if there is a discrepancy, but I don't really see the benefit.

@mkovari mkovari Jul 8, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have removed a couple of duplications.
The electric power requirements are output in a somewhat redundant way. I will look at this in a separate issue.

Comment thread process/models/physics/physics.py Outdated
Comment on lines +2352 to +2358
po.ovarre(
self.outfile,
"Net loss by synchrotron radiation (MW)",
"(p_plasma_sync_mw)",
self.data.physics.p_plasma_sync_mw,
"OP ",
)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Already output above

Suggested change
po.ovarre(
self.outfile,
"Net loss by synchrotron radiation (MW)",
"(p_plasma_sync_mw)",
self.data.physics.p_plasma_sync_mw,
"OP ",
)

Comment on lines +2374 to +2401
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 ",
)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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 ",
)

Already output above

Comment on lines +2437 to +2464
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 ",
)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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 ",
)

Already output above

Comment on lines +2465 to +2478
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 ",
)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Already output in another module

Suggested change
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 ",
)

Comment on lines +2558 to +2592
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 ",
)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Already being output in another model

Suggested change
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 ",
)

Comment on lines +2593 to +2606
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 ",
)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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 ",
)

Already being output

Comment thread process/models/physics/physics.py Outdated
Comment on lines +2629 to +2635
po.ovarre(
self.outfile,
"Gross electric output (MW)",
"(p_plant_electric_gross_mw)",
self.data.heat_transport.p_plant_electric_gross_mw,
"OP ",
)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
po.ovarre(
self.outfile,
"Gross electric output (MW)",
"(p_plant_electric_gross_mw)",
self.data.heat_transport.p_plant_electric_gross_mw,
"OP ",
)

Already being output

Comment on lines +2658 to +2671
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 ",
)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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 ",
)

Already being output

Comment on lines +2680 to +2700
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 ",
)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Already output in another model

Suggested change
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 ",
)

@mkovari mkovari requested a review from timothy-nunn July 9, 2026 07:41
@chris-ashe

Copy link
Copy Markdown
Collaborator

@mkovari Can I ask that this is adjusted to use the PlasmaIgnitionModel enum then I shall review

@mkovari

mkovari commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator Author

@mkovari Can I ask that this is adjusted to use the PlasmaIgnitionModel enum then I shall review

I have long been concerned about the ignited option. I have never used it and I am not sure we need it. I am not clear why this is here, for example:

        # If the device is not ignited, add the injected auxiliary power
        if PlasmaIgnitionModel(i_plasma_ignited) == PlasmaIgnitionModel.NON_IGNITED:
            p_plasma_loss_mw += p_hcd_injected_total_mw

The power should balance whether the user thinks the plasma is ignited or not.

Leaving this aside, could you clarify how and where I need to use this switch in the power accounting checks? Thanks @chris-ashe

@chris-ashe chris-ashe left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Few bits about readability and outputting. Some of the calculations are double counting. I will probably put a few spinout PR's out to increase robustness and prevent the need for multiple redundant declaration

Comment thread process/models/physics/physics.py Outdated
self.data.current_drive.p_hcd_injected_electrons_mw,
"OP ",
)
if self.data.physics.i_plasma_ignited == 1:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the ignition enums from what I have seen the ignited case will never apply any HCD power so it is never added. In reality the number should just be set to zero. See the enum instance in physics_variables.py to apply the correct enum test instead of the raw number matching

@mkovari mkovari Jul 10, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, so GitHub is showing the code above as green with + signs, indicating it has been added. In fact I didn't touch it, except for removing a couple of now-redundant outputs. My contributions start from line 2288: # Global power imbalance output #4233

In fact in the latest version of main this has already been fixed, by you.
No action (other than merging main back in).

po.ocmmnt(self.outfile, " (Injected power only used for start-up phase)")

# Global power imbalance output #4233
po.oheadr(self.outfile, "Power accounting")

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Each output should be a separate function and not nested inside of outplas() 3 of the output sections related to the total plant should be put in power.py

@mkovari mkovari Jul 10, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see any benefit in making the code more complicated by creating new functions.
I agree that the last three sections could go into power.py. However, there is also something to be said for putting these accounting checks together so it is quick and easy to review them all.
I propose no action.

Comment thread process/models/physics/physics.py Outdated
)
po.ocmmnt(
self.outfile,
"See Figure in https://ukaea.github.io/PROCESS/physics-models/plasma_power_balance",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The referenced figure is very out of date and none of the variables match, can this please be updated

@mkovari mkovari Jul 10, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes - for another day. No action.

Comment thread process/models/physics/physics.py Outdated
+ self.data.physics.p_fw_alpha_mw
)
p_impurity_mw = (
self.data.physics.p_plasma_inner_rad_mw

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that the p_plasma_inner_rad_mw contains the synchrotron contribution as we always assume it to come from just the core region. The variable p_plasma_rad_mw contains all radiation power

@mkovari mkovari Jul 10, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed it does.
I will fix this. TODO

Oddly, confinement time.py has these lines:

                        p_plasma_loss_mw
                        + self.data.physics.pden_plasma_sync_mw * vol_plasma
                        + self.data.physics.p_plasma_inner_rad_mw

which does seem to be double counting.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

+ p_impurity_mw
)

p_plasma_in = (

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The variable p_plasma_heating_total_mw contains the in-situ calculated value for the total heating power. The function calculate_total_plasma_heating_power() also exists

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed. This section functions as a kind of independent audit of the calculations elsewhere. Duplication of effort - yes. Worth doing - also yes, in my opinion.

The quantities defined here are not intended to be used anywhere else.

p_plasma_imbalance_mw = p_plasma_out - p_plasma_in
po.oshead(self.outfile, "Plasma power balance across separatrix")
po.ovarre(
self.outfile,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using po.ocmmnt() here to create subheadings for "Heating:" and "Losses:" would increase readability

@mkovari mkovari Jul 10, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will see how this looks. TODO

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All done

"(p_impurity_mw)",
p_impurity_mw,
"OP ",
)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using po.oblnkl(self.outfile) would be good to separate the total value from the summed terms for readability

@mkovari mkovari Jul 10, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will see how this looks. TODO

@mkovari mkovari Jul 10, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. I didn't separate the total but I put it in caps.

Comment thread process/models/physics/physics.py Outdated
+ 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

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be better hear to do the heating powers minus the loss power so that a returned negative value means a net loss, which makes sense

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will do. TODO

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

"(p_plasma_in)",
p_plasma_in,
"OP ",
)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using po.oblnkl(self.outfile) would be good to separate the total value from the summed terms for readability

@mkovari mkovari Jul 10, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. I put total in caps.

"(p_plasma_ohmic_mw)",
self.data.physics.p_plasma_ohmic_mw,
"OP ",
)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using po.oblnkl(self.outfile) would be good to separate the total value from the summed terms for readability

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will see how this looks. TODO

@mkovari mkovari Jul 10, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. I didn't put in a blank line but I put it in caps.

@mkovari mkovari requested a review from chris-ashe July 10, 2026 13:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Global power imbalance output

4 participants