Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
6c34f15
Implementation of beta fixed point solve, based on Jon M work.
grmtrkngtn Oct 1, 2026
707589c
Revert caller.py to main
grmtrkngtn Oct 5, 2026
8e6cb33
Derive plasma beta explicitly from current plasma state
grmtrkngtn Oct 5, 2026
8dc8e88
Remove constraint 1 as it is not required
grmtrkngtn Oct 6, 2026
f01251e
Remove beta_total_vol_avg as ixc 5 as it is now calculated in physics…
grmtrkngtn Oct 6, 2026
ee85479
Tidy up removal of constraint 1
grmtrkngtn Oct 6, 2026
0b1a95b
Remove icc = 1 and ixc = 5
grmtrkngtn Oct 6, 2026
6478096
Remove icc = 1 and ixc = 5
grmtrkngtn Oct 6, 2026
c9362c1
Remove icc = 1 and ixc = 5
grmtrkngtn Oct 6, 2026
59315f5
Remove icc = 1 and ixc = 5
grmtrkngtn Oct 6, 2026
144fe7d
Remove icc = 1 and ixc = 5
grmtrkngtn Oct 6, 2026
122540b
Tidy up beta calculations into plasmabeta.run, and move beta update a…
grmtrkngtn Oct 7, 2026
7cbaa0f
Revert "Remove constraint 1 as it is not required"
grmtrkngtn Oct 7, 2026
3368eb6
Add back in descriptions for icc = 1
grmtrkngtn Oct 7, 2026
01d3e39
Remove reference to itv 5
grmtrkngtn Oct 7, 2026
b90996c
Remove references to plasma beta consistency equations
grmtrkngtn Oct 7, 2026
a6bc5b0
Update plasma_beta docs to reflect new status of icc = 1
grmtrkngtn Oct 7, 2026
d449469
Tidy up references to icc = 1 and ixc = 5
grmtrkngtn Oct 7, 2026
ed7e2af
Update process/data_structure/physics_variables.py
grmtrkngtn Oct 8, 2026
c82ac5c
Tidied up the end of solver guide to tell user to select one ixc
grmtrkngtn Oct 8, 2026
cfea93e
Removed beta_total_vol_avg as input
grmtrkngtn Oct 8, 2026
caa8643
Removed beta_total_vol_avg as input, removed density as ixc as only 1…
grmtrkngtn Oct 8, 2026
779034d
Removed beta_total_vol_avg as input file
grmtrkngtn Oct 8, 2026
6a21140
Removed beta_total_vol_avg as input
grmtrkngtn Oct 8, 2026
da86937
removed electron density as ixc to correctly form system of equations
grmtrkngtn Oct 8, 2026
b8b906a
copy latest large tokamak eval from regression test over
grmtrkngtn Oct 8, 2026
be3e518
remove icc = 1 and ixc 5 and beta_total_vol_avg
grmtrkngtn Oct 8, 2026
61bf24a
remove icc = 1 and ixc 5 and beta_total_vol_avg
grmtrkngtn Oct 8, 2026
79917aa
remove icc = 1 and ixc 5 and beta_total_vol_avg
grmtrkngtn Oct 8, 2026
55b1f4d
Update documentation/source/physics-models/plasma_beta/plasma_beta.md
grmtrkngtn Oct 8, 2026
4508b31
Moved fast alpha beta calculation into beta class
grmtrkngtn Oct 8, 2026
af9fdce
Remove ixc=5 and beta_total_vol_avg from test input files
timothy-nunn Oct 14, 2026
7dcf9c3
Temporarily remove density iteration from integration eval file
timothy-nunn Oct 14, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ $$

### Beta consistency

This constraint can be activated by stating `icc = 1` in the input file.
`beta_total_vol_avg` is calculated directly from the current plasma state and is no longer an iteration variable. Constraint 1 may be activated as an optional global consistency check or safeguard against potential non-idempotent behaviour by stating `icc = 1` in the input file.

Ensures the relationship between $\beta$, density, temperature and total magnetic field is withheld by checking the fixed input or iteration variable $\texttt{beta}$ is consistent in value with the rest of the physics parameters

Expand All @@ -404,8 +404,6 @@ $$
\langle n_{\text{e}}T_{\text{e}} \rangle_{\text{V}} = \overbrace{\langle n_{\text{e}} \rangle_{\text{V}}}^{\texttt{nd_plasma_electrons_vol_avg}} \times \overbrace{\langle T_{\text{e}} \rangle_{\text{n}}}^{\texttt{temp_plasma_electron_density_weighted_kev}}
$$

**It is highly recommended to always have this constraint on as it is a global consistency checker**

----------------

### Poloidal beta and inverse aspect upper limit
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ $$
With the coefficients used to turn the temperature from $\text{keV}$ back to Joules.


We calculate the volume averaged thermal plasma pressure using the volume averaged density and the density weighted volume averaged temperature for the electrons and ions. The density weighted temperature is used as $\langle nT \rangle \neq \langle n \rangle \langle T \rangle$. This can be seen also in the [equality constraint for thermal $\beta$](../plasma_beta/plasma_beta.md#beta-consistency)
We calculate the volume averaged thermal plasma pressure using the volume averaged density and the density weighted volume averaged temperature for the electrons and ions. The density weighted temperature is used as $\langle nT \rangle \neq \langle n \rangle \langle T \rangle$.

$$
\langle p_{\text{thermal}} \rangle = \overbrace{\langle n_{\text{e}} \rangle_{\text{V}}}^{\texttt{nd_plasma_electrons_vol_avg}} \times \overbrace{\langle T_{\text{e}} \rangle_{\text{n}}}^{\texttt{temp_plasma_electron_density_weighted_kev}}\\
Expand Down
4 changes: 1 addition & 3 deletions documentation/source/solver/solver-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ A PROCESS input file will, for example, define which constraint equations are be
n_equality_constraints = 3

* Equalities
icc = 1 * Beta
icc = 2 * Global power balance
icc = 11 * Radial build

Expand Down Expand Up @@ -144,7 +143,6 @@ i_process_run_mode = -2 * evaluation mode
n_equality_constraints = 2

* Equalities
icc = 1 * Beta
icc = 2 * Global power balance

* Inequalities
Expand All @@ -160,4 +158,4 @@ ixc = 4 * temp_plasma_electron_vol_avg_kev
ixc = 6 * nd_plasma_electrons_vol_avg
...
```
The beta and plasma power balance equality constraints are recommended to ensure model consistency, and the `temp_plasma_electron_vol_avg_kev` and `nd_plasma_electrons_vol_avg` iteration variables used to solve them.
The plasma power balance equality constraint is recommended to ensure model consistency, the user may select one of `temp_plasma_electron_vol_avg_kev` and `nd_plasma_electrons_vol_avg` to solve it.
8 changes: 1 addition & 7 deletions examples/data/large_tokamak_IN.DAT
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,11 @@ i_figure_merit = 1
* Error tolerance for VMCON
epsvmc = 1e-7

n_equality_constraints = 3
n_equality_constraints = 2

* Constraint Equations - Consistency Equations *
************************************************

* Beta consistency *
*------------------*
icc = 1
ixc = 5 * beta_total_vol_avg
beta_total_vol_avg = 0.03

* Global power balance *
*----------------------*
icc = 2
Expand Down
18 changes: 10 additions & 8 deletions examples/data/large_tokamak_eval_IN.DAT
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@ i_process_run_mode = -2

*---------------Constraint Equations---------------*
* Define number of equality constraints
n_equality_constraints = 2
n_equality_constraints = 1

* Equalities
icc = 1 * Beta
icc = 2 * Global power balance

* Inequalities
Expand Down Expand Up @@ -38,7 +37,7 @@ icc = 32 * TF coil conduit stress upper limit

ixc = 4 * temp_plasma_electron_vol_avg_kev
boundu(4) = 100.0
ixc = 6 * nd_plasma_electrons_vol_avg


*---------------Cs Fatigue Variables---------------*

Expand Down Expand Up @@ -101,7 +100,7 @@ p_fusion_total_max_mw = 3000 * maximum fusion power (MW) (`constraint equation
p_div_bt_q_aspect_rmajor_max_mw = 10.0 * maximum ratio of Psep*Bt/qAR (MWT/m) (`constraint equation 68`)
t_burn_min = 7200.0 * minimum burn time (s) (KE - no longer itv;; see issue #706)
pflux_fw_neutron_max_mw = 2.0 * allowable neutron wall-load (MW/m2) (`constraint equation 8`)
f_t_alpha_energy_confinement_min = 5.0 * Lower limit on f_t_alpha_energy_confinementnt the ratio of alpha particle to energy confinement
f_t_alpha_energy_confinement_min = 5.0 * Lower limit on f_t_alpha_energy_confinement the ratio of alpha particle to energy confinement

*-------------------Constraints--------------------*

Expand Down Expand Up @@ -272,8 +271,8 @@ zref(10) = 1.0

alphan = 1.00 * density profile index
alphat = 1.45 * temperature profile index
i_alphaj = 1 * Current profile index selection (0 = user input)
aspect = 3.0 * aspect ratio (`iteration variable 1`)
beta_total_vol_avg = 0.03230408815355488 * total plasma beta (`iteration variable 5`) (calculated if stellarator)
b_plasma_toroidal_on_axis = 5.318322174644904 * toroidal field on axis (T) (`iteration variable 2`)
nd_plasma_electrons_vol_avg = 7.796223900029837e+19 * electron density (/m3) (`iteration variable 6`)
beta_norm_max = 3.0 * Troyon-like coefficient for beta scaling calculated
Expand All @@ -294,9 +293,9 @@ plasma_res_factor = 0.7 * plasma resistivity pre-factor
radius_plasma_pedestal_density_norm = 0.94 * r/a of density pedestal (`i_plasma_pedestal==1`)
radius_plasma_pedestal_temp_norm = 0.94 * r/a of temperature pedestal (`i_plasma_pedestal==1`)
tbeta = 2.0 * temperature profile index beta (`i_plasma_pedestal==1)
temp_plasma_separatrix_electron_kev = 5.5 * electron temperature of pedestal (keV) (`i_plasma_pedestal==1')
temp_plasma_pedestal_electron_kev = 5.5 * electron temperature of pedestal (keV) (`i_plasma_pedestal==1')
temp_plasma_separatrix_electron_kev = 0.1 * electron temperature at separatrix (keV) (`i_plasma_pedestal==1`) calculated if reinke
i_confinement_time = 34 * switch for energy confinement time scaling law (see description in `tauscl`)
i_confinement_time = 34 * switch for energy confinement time scaling law (see description in `labels_confinement_scalings`)
i_plasma_geometry = 0 * switch for plasma cross-sectional shape calculation;
kappa = 1.85 * plasma separatrix elongation (calculated if `i_plasma_geometry = 1-5; 7 or 9-10`)
q95 = 3.7339078193128556 * Safety factor 'near' plasma edge (`iteration variable 18`) equal to q95
Expand All @@ -307,6 +306,7 @@ i_single_null = 1 * switch for single null / double null plasma;
f_sync_reflect = 0.6 * synchrotron wall reflectivity factor
temp_plasma_electron_vol_avg_kev = 12.221383528378944 * volume averaged electron temperature (keV) (`iteration variable 4`)
triang = 0.5 * plasma separatrix triangularity (calculated if `i_plasma_geometry = 1; 3-5 or 7`)
i_ind_plasma_internal_norm = 1 * Normalised plasma internal induction selection switch (0 = user input)

*----------------------Power-----------------------*

Expand Down Expand Up @@ -375,13 +375,15 @@ t_tf_superconductor_quench = 17.97282589344206 * fast discharge time for TF co
n_tf_coils = 16 * Number of TF coils (default = 50 for stellarators); Number of TF coils outer legs for ST
tftmp = 4.75 * peak helium coolant temperature in TF coils and PF coils (K)
dr_tf_nose_case = 0.2816873221155309 * inboard TF coil case outer (non-plasma side) thickness (m) (`iteration variable 57`)
dr_tf_wp_with_insulation = 0.5153787768966674 * radial thickness of winding pack (m) (`iteration variable 140`) (issue #514)
dr_tf_wp_with_insulation = 0.5153787768966674 * radial thickness of winding pack (m) (issue #514)
dx_tf_turn_steel = 0.008012110032981922 * TF coil conduit case thickness (m) (`iteration variable 58`)
dx_tf_wp_insulation = 0.008 * Thickness of the ground insulation layer surrounding (m)
temp_cs_superconductor_margin_min = 1.5 * minimum allowable temperature margin ; CS (K)
tmargmin = 1.5 * minimum allowable temperature margin ; TFC AND CS (K)
v_tf_coil_dump_quench_max_kv = 10.0 * max voltage across TF coil during quench (kV) (`iteration variable 52`)
f_a_tf_turn_cable_space_extra_void = 0.3 * coolant fraction of TFC 'cable' (`i_tf_sup=1`); or of TFC leg (`i_tf_sup=0`)
flu_tf_neutron_fast_max = 1e22 * max fluence in the TF coil


*-----------------Times Variables------------------*

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,11 @@ i_figure_merit = 1
* Error tolerance for VMCON
epsvmc = 1e-7

n_equality_constraints = 3
n_equality_constraints = 1

* Constraint Equations - Consistency Equations *
************************************************

* Beta consistency *
*------------------*
icc = 1
ixc = 5 * beta_total_vol_avg
beta_total_vol_avg = 0.03

* Global power balance *
*----------------------*
icc = 2
Expand Down
7 changes: 1 addition & 6 deletions examples/data/large_tokamak_varyrun_IN.DAT
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,11 @@ i_figure_merit = 1
* Error tolerance for VMCON
epsvmc = 1e-7

n_equality_constraints = 3
n_equality_constraints = 2

* Constraint Equations - Consistency Equations *
************************************************

* Beta consistency *
*------------------*
icc = 1
ixc = 5 * beta_total_vol_avg
beta_total_vol_avg = 0.03

* Global power balance *
*----------------------*
Expand Down
8 changes: 1 addition & 7 deletions examples/data/scan_example_file_IN.DAT
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ epsvmc = 1e-7
* Inequality constraint tolerance
force_vmcon_inequality_tolerance = 1e-6

n_equality_constraints = 3
n_equality_constraints = 2

* Scan Variables *
******************
Expand All @@ -32,12 +32,6 @@ sweep = 10.5, 10.4, 10.3, 10.2, 10.1, 10.0
* Constraint Equations - Consistency Equations *
************************************************

* Beta consistency *
*------------------*
icc = 1
ixc = 5 * beta_total_vol_avg
beta_total_vol_avg = 0.03

* Global power balance *
*----------------------*
icc = 2
Expand Down
1 change: 0 additions & 1 deletion process/core/input.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,6 @@ def bounds(self) -> tuple[NumberType | None, NumberType | None]:
"alphat": InputVariable("physics", float, range=(0.0, 10.0)),
"aspect": InputVariable("physics", float, range=(1.001, 40.0)),
"beamfus0": InputVariable("physics", float, range=(0.01, 10.0)),
"beta_total_vol_avg": InputVariable("physics", float, range=(0.0, 1.0)),
"beta_vol_avg_max": InputVariable("physics", float, range=(0.0, 1.0)),
"beta_vol_avg_min": InputVariable("physics", float, range=(0.0, 1.0)),
"betbm0": InputVariable("physics", float, range=(0.0, 10.0)),
Expand Down
1 change: 0 additions & 1 deletion process/core/solver/iteration_variables.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ class IterationVariable:
2: IterationVariable("b_plasma_toroidal_on_axis", "physics", 0.010, 30.00),
3: IterationVariable("rmajor", "physics", 0.1, 50.00),
4: IterationVariable("temp_plasma_electron_vol_avg_kev", "physics", 5.0, 150.0),
5: IterationVariable("beta_total_vol_avg", "physics", 0.001, 1.0),

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why are we removing it as an iteration variable in this case? How would a user constraint the beta value then. We can still have this as an iteration but now without the constraint

@grmtrkngtn grmtrkngtn Oct 6, 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.

Now that beta is calculated directly from the plasma state, I don't think it makes sense for it to remain an iteration variable.

If a user wants to restrict beta, that should be done by applying a constraint to the derived beta rather than allowing the optimiser to vary beta independently of the plasma state. We already have beta upper and lower-limit constraints for this purpose.

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.

I would agree. Now that beta_total_vol_avg is calculated in the code (here) having it as an iteration variable would be incorrect at best and dangerous at worse.

The solver would set beta_total_vol_avg = x and then the code would update it to beta_total_vol_avg. = y and all of the gradients would be calculated wrt y but the solver would think they related to x, which would cause the solver to move in incorrect ways.

6: IterationVariable("nd_plasma_electrons_vol_avg", "physics", 2.0e19, 1.0e21),
7: IterationVariable("f_nd_beam_electron", "physics", 1.0e-6, 1.0),
10: IterationVariable("hfact", "physics", 0.1, 3.0),
Expand Down
5 changes: 2 additions & 3 deletions process/data_structure/numerics.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,11 +295,11 @@ class NumericsData:
]
)
"""Labels describing constraint equations (corresponding itvs)<UL>
* ( 1) Beta (consistency equation) (itv 5)
* ( 1) Beta consistency equation
* ( 2) Global power balance (consistency equation) (itv 10,1,2,3,4,6,11)
* ( 3) Ion power balance DEPRECATED (itv 10,1,2,3,4,6,11)
* ( 4) Electron power balance DEPRECATED (itv 10,1,2,3,4,6,11)
* ( 5) Density upper limit (itv 9,1,2,3,4,5,6)
* ( 5) Density upper limit (itv 9,1,2,3,4,6)
* ( 6) (Epsilon x beta poloidal) upper limit (itv 8,1,2,3,4,6)
* ( 7) Beam ion density (NBI) (consistency equation) (itv 7)
* ( 8) Neutron wall load upper limit (itv 14,1,2,3,4,6)
Expand Down Expand Up @@ -409,7 +409,6 @@ class NumericsData:
* ( 2) b_plasma_toroidal_on_axis
* ( 3) rmajor
* ( 4) temp_plasma_electron_vol_avg_kev
* ( 5) beta_total_vol_avg
* ( 6) nd_plasma_electrons_vol_avg
* ( 7) f_nd_beam_electron
* ( 8) NOT USED
Expand Down
2 changes: 1 addition & 1 deletion process/data_structure/physics_variables.py
Original file line number Diff line number Diff line change
Expand Up @@ -639,7 +639,7 @@ class PhysicsData:
"""multiplier for beam-background fusion calculation"""

beta_total_vol_avg: float = 0.042
"""Volume averaged total plasma beta (⟨β⟩) (`iteration variable 5`) (calculated if stellarator)"""
"""Volume averaged total plasma beta (⟨β⟩)"""

beta_fast_alpha: float = 0.0
"""Fast alpha beta component (β_alpha)"""
Expand Down
71 changes: 46 additions & 25 deletions process/models/physics/physics.py
Original file line number Diff line number Diff line change
Expand Up @@ -430,12 +430,6 @@ def run(self):

# ============================================

# -----------------------------------------------------
# Beta Components
# -----------------------------------------------------

self.beta.run()

# Stored thermal energies in the plasma

(
Expand Down Expand Up @@ -680,19 +674,8 @@ def run(self):
self.data.physics.f_p_alpha_plasma_deposited,
)

self.data.physics.beta_fast_alpha = self.beta.fast_alpha_beta(
b_plasma_poloidal_average=self.data.physics.b_plasma_surface_poloidal_average,
b_plasma_toroidal_on_axis=self.data.physics.b_plasma_toroidal_on_axis,
nd_plasma_electrons_vol_avg=self.data.physics.nd_plasma_electrons_vol_avg,
nd_plasma_fuel_ions_vol_avg=self.data.physics.nd_plasma_fuel_ions_vol_avg,
nd_plasma_ions_total_vol_avg=self.data.physics.nd_plasma_ions_total_vol_avg,
temp_plasma_electron_density_weighted_kev=self.data.physics.temp_plasma_electron_density_weighted_kev,
temp_plasma_ion_density_weighted_kev=self.data.physics.temp_plasma_ion_density_weighted_kev,
pden_alpha_total_vol_avg_mw=self.data.physics.pden_alpha_total_vol_avg_mw,
pden_plasma_alpha_vol_avg_mw=self.data.physics.pden_plasma_alpha_vol_avg_mw,
i_beta_fast_alpha=self.data.physics.i_beta_fast_alpha,
f_plasma_fuel_deuterium=self.data.physics.f_plasma_fuel_deuterium,
)
# Calculate beta quantities.
self.beta.run()

# Calculate ion/electron equilibration power

Expand Down Expand Up @@ -3506,6 +3489,44 @@ def run(self):
If an illegal value of i_beta_norm_max is provided.

"""
# Thermal beta is derived directly from the current plasma state.
self.data.physics.beta_thermal_vol_avg = self.calculate_plasma_beta(

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Just wondering if we could do this all tidy and just put this in the run method of the beta class?

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, I've tidied this up in the latest commits

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I cant see the thermal calc inside the beat run method its still showing as a random calc for me

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.

This should have been resolved in the latest commits.

pres_plasma=(
constants.KILOELECTRON_VOLT
* (
self.data.physics.nd_plasma_electrons_vol_avg
* self.data.physics.temp_plasma_electron_density_weighted_kev
+ self.data.physics.nd_plasma_ions_total_vol_avg
* self.data.physics.temp_plasma_ion_density_weighted_kev
)
),
b_field=self.data.physics.b_plasma_total,
)

# Fast-alpha beta is calculated here so all tokamak beta calculations are
# owned by PlasmaBeta.run(). Keep fast_alpha_beta() unchanged because it is
# also called directly by the stellarator physics model.
self.data.physics.beta_fast_alpha = self.fast_alpha_beta(
b_plasma_poloidal_average=self.data.physics.b_plasma_surface_poloidal_average,
b_plasma_toroidal_on_axis=self.data.physics.b_plasma_toroidal_on_axis,
nd_plasma_electrons_vol_avg=self.data.physics.nd_plasma_electrons_vol_avg,
nd_plasma_fuel_ions_vol_avg=self.data.physics.nd_plasma_fuel_ions_vol_avg,
nd_plasma_ions_total_vol_avg=self.data.physics.nd_plasma_ions_total_vol_avg,
temp_plasma_electron_density_weighted_kev=self.data.physics.temp_plasma_electron_density_weighted_kev,
temp_plasma_ion_density_weighted_kev=self.data.physics.temp_plasma_ion_density_weighted_kev,
pden_alpha_total_vol_avg_mw=self.data.physics.pden_alpha_total_vol_avg_mw,
pden_plasma_alpha_vol_avg_mw=self.data.physics.pden_plasma_alpha_vol_avg_mw,
i_beta_fast_alpha=self.data.physics.i_beta_fast_alpha,
f_plasma_fuel_deuterium=self.data.physics.f_plasma_fuel_deuterium,
)

# Total beta is derived from the thermal and fast-particle components.
self.data.physics.beta_total_vol_avg = (
Comment thread
timothy-nunn marked this conversation as resolved.
self.data.physics.beta_thermal_vol_avg
+ self.data.physics.beta_fast_alpha
+ self.data.physics.beta_beam
)

# -----------------------------------------------------
# Normalised Beta Limit
# -----------------------------------------------------
Expand Down Expand Up @@ -3570,6 +3591,10 @@ def run(self):
rminor=self.data.physics.rminor,
)

# -----------------------------------------------------
# Derived beta components
# -----------------------------------------------------

self.data.physics.beta_toroidal_vol_avg = (
self.data.physics.beta_total_vol_avg
* self.data.physics.b_plasma_total**2
Expand All @@ -3583,12 +3608,6 @@ def run(self):
beta=self.data.physics.beta_total_vol_avg,
)

self.data.physics.beta_thermal_vol_avg = (
self.data.physics.beta_total_vol_avg
- self.data.physics.beta_fast_alpha
- self.data.physics.beta_beam
)

self.data.physics.beta_poloidal_eps = (
self.data.physics.beta_poloidal_vol_avg * self.data.physics.eps
)
Expand All @@ -3601,6 +3620,7 @@ def run(self):
)
** 2
)

self.data.physics.beta_thermal_toroidal_vol_avg = (
self.data.physics.beta_thermal_vol_avg
* (
Expand Down Expand Up @@ -3643,6 +3663,7 @@ def run(self):
)
** 2
)

self.data.physics.beta_norm_poloidal = (
self.data.physics.beta_norm_total
* (
Expand Down
8 changes: 1 addition & 7 deletions tests/integration/data/large_tokamak_IN.DAT
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,11 @@ i_figure_merit = 1
* Error tolerance for VMCON
epsvmc = 1e-7

n_equality_constraints = 3
n_equality_constraints = 2

* Constraint Equations - Consistency Equations *
************************************************

* Beta consistency *
*------------------*
icc = 1
ixc = 5 * beta_total_vol_avg
beta_total_vol_avg = 0.03

* Global power balance *
*----------------------*
icc = 2
Expand Down
Loading
Loading