-
Notifications
You must be signed in to change notification settings - Fork 21
Add pressure peaking fraction value #4483
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
2d2f72d
483064e
7027d12
1e5870c
a8bc3b3
e04910f
180c7ae
542e0ed
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -171,6 +171,11 @@ def parabolic_parameterisation(self): | |
| * (1.0 + self.data.physics.alphat) | ||
| ) | ||
|
|
||
| self.data.physics.f_temp_plasma_electron_on_axis_vol_avg = ( | ||
| self.data.physics.temp_plasma_electron_on_axis_kev | ||
| / self.data.physics.temp_plasma_electron_vol_avg_kev | ||
| ) | ||
|
|
||
| self.data.physics.nd_plasma_electron_on_axis = ( | ||
| self.data.physics.nd_plasma_electrons_vol_avg | ||
| * (1.0 + self.data.physics.alphan) | ||
|
|
@@ -237,6 +242,11 @@ def pedestal_parameterisation(self): | |
| self.teprofile.profile_integ | ||
| ) | ||
|
|
||
| self.data.physics.f_temp_plasma_electron_on_axis_vol_avg = ( | ||
| self.data.physics.temp_plasma_electron_on_axis_kev | ||
| / self.data.physics.temp_plasma_electron_vol_avg_kev | ||
| ) | ||
|
|
||
| # Scrape-off density / volume averaged density | ||
| # (Input value is used if i_plasma_pedestal = 0) | ||
|
|
||
|
|
@@ -284,6 +294,33 @@ def calculate_profile_factors(self): | |
| + self.data.physics.pres_plasma_ion_total_profile | ||
| ) | ||
|
|
||
| # Calculate pedestal and separatrix pressures for pedestal profile case | ||
| if ( | ||
| PlasmaProfileShapeType(self.data.physics.i_plasma_pedestal) | ||
| == PlasmaProfileShapeType.PEDESTAL_PROFILE | ||
| ): | ||
| # Pedestal pressure is the profile value where gradient is maximum | ||
| # (i.e the smallest negative value) | ||
| rho = self.neprofile.profile_x | ||
| pres_profile = self.data.physics.pres_plasma_thermal_total_profile | ||
| dpres_drho = np.gradient(pres_profile, rho) | ||
| # Find rho index closest to the normalized pedestal positions | ||
| pedestal_rho = np.min([ | ||
| self.data.physics.radius_plasma_pedestal_temp_norm, | ||
| self.data.physics.radius_plasma_pedestal_density_norm, | ||
| ]) | ||
| closest_idx = np.argmin(np.abs(rho - pedestal_rho)) | ||
| mask = np.zeros_like(rho, dtype=bool) | ||
| mask[closest_idx:] = True | ||
| dpres_drho_pedestal = dpres_drho[mask] | ||
| max_grad_idx_pedestal = np.argmax(dpres_drho_pedestal) | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should this use np.argmin? Since the pressure decreases with increasing radius, the steepest pedestal gradient should be the most negative value
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I found that using
|
||
| max_grad_idx = np.where(mask)[0][max_grad_idx_pedestal] | ||
| self.data.physics.pres_plasma_pedestal_thermal = pres_profile[max_grad_idx] | ||
|
|
||
| self.data.physics.pres_plasma_separatrix_thermal = ( | ||
| self.data.physics.pres_plasma_thermal_total_profile[-1] | ||
| ) | ||
|
|
||
| # Fuel ion pressure profile (Pa) | ||
| self.data.physics.pres_plasma_fuel_profile = ( | ||
| self.data.physics.nd_plasma_fuel_ions_vol_avg | ||
|
|
@@ -312,6 +349,11 @@ def calculate_profile_factors(self): | |
| * self.data.physics.temp_plasma_ion_density_weighted_kev | ||
| ) * constants.KILOELECTRON_VOLT | ||
|
|
||
| self.data.physics.f_pres_plasma_thermal_on_axis_vol_avg = ( | ||
| self.data.physics.pres_plasma_thermal_on_axis | ||
| / self.data.physics.pres_plasma_thermal_vol_avg | ||
| ) | ||
|
|
||
| # Central plasma current density (A/m²) | ||
| # Assumes a parabolic profile for the current density | ||
| self.data.physics.j_plasma_on_axis = ( | ||
|
|
||

There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe this is a real nit-pick but if it's a ratio should we use the "fraction" prefix for the variable name?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We dont really have anything else in the style guide that fits the bill.
f_still represents a dimensionless unit that is the portion of something else