cfs-energy / cfspopcon

POPCONs (Plasma OPerating CONtours)
https://cfspopcon.readthedocs.io/en/latest/
MIT License
22 stars 14 forks source link

Is require_P_rad_less_than_P_in unphysical? #94

Open StuartBenjamin opened 2 months ago

StuartBenjamin commented 2 months ago

Hi I'm using this popcon code to do a tearing study for ARC (MHD RPP) and I was confused by the function require_P_rad_less_than_P_in. In the SPARC prl, require_P_rad_less_than_P_in takes P_in, and P_rad and enforces P_rad <= P_in by re-writing P_rad if necessary. However P_rad is rigorously calculated based on Bremsstrahlung and Synchrotron and input impurity concentrations, while P_in is calculated from solve_energy_confinement_scaling_for_input_power which is a heuristic fit based on a database study. If P_rad > P_in, I believe P_in should be raised to get to a steady state. While this might violate the chosen energy confinement scaling, it's more physical than P_rad being reduced which fails power balance altogether.

To make sure I wasn't missing something I checked through the followup functions calc_min_P_radiation_from_fraction, calc_P_radiation_from_core_seeded_impurity, calc_core_seeded_impurity_concentration to see if they had an option to lower impurity concentration if P_rad >= P_in, but they only had the option to raise impurity concentration. Maybe I'm missing something down the line that resolves the issue but I can't see it at the moment.

I also realise we can optionally remove these points by masking calc_f_rad_core==1, however since these points fail power-balance and someone using the code might miss this issue, I think the function should be removed or replaced with require_P_in_greater_than_P_rad. What do you think?

tbody-cfs commented 2 months ago

Hi Stuart, This check was originally to make sure that we don't end up with negative SOL heat fluxes (which leads to very weird results — i.e. negative impurity concentrations, etc). Enforcing Pin > Prad probably makes more sense. Could you open a PR with this change?