hansec / OpenPOPCON

2 stars 3 forks source link

Z_eff / Fusion power discrepancies #8

Closed matt-pharr closed 2 months ago

matt-pharr commented 3 months ago

When reproducing the POPCON from the MANTA paper, OpenPOPCON estimates Z_eff to be twice the Z_eff in the paper for the same impurity content. Additionally, fusion power is higher in OpenPOPCON than it is in the paper. Is there a factor of 2 floating around somewhere, or does P_fusion in the paper not refer to alpha + neutron power?

nelsonand commented 2 months ago

Hi @matt-pharr, how are you seeing the Z_eff in OpenPOPCON?

I guess a first trial here should be to compare to CFSPOPCON, see if we can recover the same result with the same inputs.

matt-pharr commented 2 months ago

@nelsonand in OpenPOPCON, I am specifying Z_eff via #5. For the example, resources/examples/MANTA/POPCON_input_example.yaml, we assume 2% Helium ash; this yields Krypton concentration of 0.123115 % when requesting Z_eff = 2.26. However, the MANTA paper reports a Krypton concentration of 0.315%.

Here is the POPCON in the MANTA paper:

image

And here is the output of OpenPOPCON 2.0, using 0.123115 % Krypton: image

matt-pharr commented 2 months ago

inputs.zip Here is a zip file with the Jupyter notebook, plot settings, and input file used to generate the above plot

nelsonand commented 2 months ago

Hi @matt-pharr, when I try this I get an error: KeyError: "Key 'B_0' not found in ./resources/MANTA_zeff_example/POPCON_input_example.yaml"

I see in the .yaml that B_0 and B_coil are supposed to be interchangable:

# B_0 and B_coil can be calculated from each other. Pick one to specify:
# B_0: 11.0 # on-axis magnetic field in Tesla
# or
B_coil: 24.0 # magnetic field at the coil in Tesla

Is there something additional I need to do to complete this switch?

(The same thing happens with I_p and qstar)

nelsonand commented 2 months ago

I see - you already updated the code for https://github.com/hansec/OpenPOPCON/issues/5! Nice!

matt-pharr commented 2 months ago

Hi @nelsonand, are you using the newest version of the main branch? I merged the ability to do adjustments around when I posted this plot.

Edit: I think you sniped me there, let me know if you still have issues.

nelsonand commented 2 months ago

These lines should be commented (at least to identify what element is what): https://github.com/hansec/OpenPOPCON/blob/71b467aebec507d70655a663e2961710924c778d/src/lib/phys_lib.py#L54C1-L287

(They look right to me, upon initial inspection.)

nelsonand commented 2 months ago

A manual calculation of Zeff after running POPCON looks ok:

image

Zeff plotting code

```python # Let's calculate Zeff from the outputs to check i_params = -1 n_G_frac = 0.7 Ti_av = 13 n_G = pc.params[i_params].n_GR rho = pc.params[i_params].sqrtpsin n_average = pc.params[i_params].volume_integral(rho, pc.params[i_params].get_extprof(rho, 2))/pc.params[i_params].V n20 = n_G_frac*n_G/n_average Ti_average = pc.params[i_params].volume_integral(rho, pc.params[i_params].get_extprof(rho, 3))/pc.params[i_params].V Ti = Ti_av/Ti_average ni_prof = n20 * pc.params[i_params].extprof_ni ne = n20*pc.params[i_params].get_extprof(rho, 1)/pc.params[i_params].get_plasma_dilution(Ti/pc.params[i_params].tipeak_over_tepeak) ne_prof = n20 * pc.params[i_params].extprof_ne impfracs = pc.params[i_params].impurityfractions from src.lib import phys_lib as phys Te0 = Ti/pc.params[i_params].tipeak_over_tepeak Te_prof = Te0 * pc.params[i_params].extprof_Te Z_eff_prof = np.zeros(len(Te_prof)) for i, Te in enumerate(Te_prof): Zeffs = phys.get_Zeffs(Te) nis = impfracs*ne_prof[i] Z_eff_prof[i] = (ni_prof[i] + np.sum(nis * Zeffs**2)) / ne_prof[i] plt.plot(rho, Z_eff_prof) plt.ylabel('Z_eff') plt.xlabel('rho') ```

nelsonand commented 2 months ago

@matt-pharr I don't see any obvious errors in the Zeff coding... the MANTA plot you pasted above is quite different than what your file gets, but note also that it is conducted with fairly different assumptions... I believe they use constant H89=1.44, have different profiles (both shape and magnitude (eg. Te_core=20 instead of 40) so I'm not surprised that they are different...

matt-pharr commented 2 months ago

I see... I used the most recent profiles I could find on the slack, maybe I did the temperature averaging wrong? I will take a look. I will also see what we get with H89.

matt-pharr commented 2 months ago

@nelsonand I figured out this issue and put a solution in #17. The issue arose from my misunderstanding of the function of radiation: from my current understanding after reading N. A. Uckan and ITER Physics Group, ITER Physics Design Guidelines: 1989 is:

Implementing this pair of changes made the MANTA example match the CFSPOPCON result almost perfectly, at least compared to the previous result!

image

vs

image
matt-pharr commented 2 months ago

The radiative ARC POPCON is also recovered:

image

image