Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 0 additions & 2 deletions process/core/init.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
init_impurity_radiation_module,
)
from process.data_structure.neoclassics_variables import init_neoclassics_variables
from process.data_structure.pf_power_variables import init_pf_power_variables
from process.data_structure.physics_variables import (
init_physics_module,
init_physics_variables,
Expand Down Expand Up @@ -250,7 +249,6 @@ def init_all_module_vars():
init_superconducting_tf_coil_variables()
init_tfcoil_variables()
constants.init_constants()
init_pf_power_variables()
init_rebco_variables()
init_neoclassics_variables()

Expand Down
8 changes: 2 additions & 6 deletions process/core/input.py
Original file line number Diff line number Diff line change
Expand Up @@ -668,9 +668,7 @@ def __post_init__(self):
"max_vv_stress": InputVariable(
data_structure.tfcoil_variables, float, range=(100000.0, 500000000.0)
),
"maxpoloidalpower": InputVariable(
data_structure.pf_power_variables, float, range=(0.0, 2000.0)
),
"maxpoloidalpower": InputVariable("pf_power", float, range=(0.0, 2000.0)),
"pflux_fw_rad_max": InputVariable("constraints", float, range=(0.1, 10.0)),
"mbvfac": InputVariable("buildings", float, range=(0.9, 3.0)),
"mcdriv": InputVariable("ife", float, range=(0.1, 10.0)),
Expand Down Expand Up @@ -1266,9 +1264,7 @@ def __post_init__(self):
"ireactor": InputVariable("costs", int, choices=[0, 1]),
"irefprop": InputVariable("fwbs", int, choices=[0, 1]),
"i_hcd_calculations": InputVariable("current_drive", int, choices=[0, 1]),
"i_pf_energy_storage_source": InputVariable(
data_structure.pf_power_variables, int, range=(1, 3)
),
"i_pf_energy_storage_source": InputVariable("pf_power", int, range=(1, 3)),
"istell": InputVariable("stellarator", int, range=(0, 6)),
"isthtr": InputVariable("stellarator", int, range=(1, 3)),
"istore": InputVariable("pulse", int, range=(1, 3)),
Expand Down
2 changes: 2 additions & 0 deletions process/core/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
from process.data_structure.fwbs_variables import FWBSData
from process.data_structure.heat_transport_variables import HeatTransportData
from process.data_structure.ife_variables import IFEData
from process.data_structure.pf_power_variables import PFPowerData
from process.data_structure.pfcoil_variables import PFCoilData
from process.data_structure.power_variables import PowerData
from process.data_structure.primary_pumping_variables import PrimaryPumpingData
Expand Down Expand Up @@ -59,6 +60,7 @@ class DataStructure:
power: PowerData = initialise_later
stellarator: StellaratorData = initialise_later
stellarator_config: StellaratorConfigData = initialise_later
pf_power: PFPowerData = initialise_later

def __post_init__(self):
for f in fields(self):
Expand Down
6 changes: 3 additions & 3 deletions process/core/solver/constraints.py
Original file line number Diff line number Diff line change
Expand Up @@ -1376,15 +1376,15 @@ def constraint_equation_65(constraint_registration, _data):


@ConstraintManager.register_constraint(66, "MW", "<=")
def constrain_equation_66(constraint_registration, _data):
def constrain_equation_66(constraint_registration, data):
"""Upper limit on rate of change of energy in poloidal field

maxpoloidalpower: Maximum permitted absolute rate of change of stored energy in poloidal field (MW)
peakpoloidalpower: Peak absolute rate of change of stored energy in poloidal field (MW) (11/01/16)
"""
return leq(
data_structure.pf_power_variables.peakpoloidalpower,
data_structure.pf_power_variables.maxpoloidalpower,
data.pf_power.peakpoloidalpower,
data.pf_power.maxpoloidalpower,
constraint_registration,
)

Expand Down
3 changes: 1 addition & 2 deletions process/core/solver/objectives.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
from process.core.exceptions import ProcessValueError
from process.core.model import DataStructure
from process.data_structure import (
pf_power_variables,
physics_variables,
tfcoil_variables,
)
Expand Down Expand Up @@ -70,7 +69,7 @@ def objective_function(minmax: int, data: DataStructure) -> float:
objective_metric = physics_variables.pflux_fw_neutron_mw
case 4:
objective_metric = (
tfcoil_variables.tfcmw + 1e-3 * pf_power_variables.srcktpm
tfcoil_variables.tfcmw + 1e-3 * data.pf_power.srcktpm
) / 10.0
case 5:
objective_metric = physics_variables.p_fusion_total_mw / (
Expand Down
120 changes: 48 additions & 72 deletions process/data_structure/pf_power_variables.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,80 +2,56 @@
Module containing global variables relating to the PF coil power conversion system
"""

from dataclasses import dataclass, field

import numpy as np

acptmax: float = None
"""average of currents in PF circuits (kA)"""

ensxpfm: float = None
"""maximum stored energy in the PF circuits (MJ)"""
@dataclass
class PFPowerData:
acptmax: float = 0.0
"""average of currents in PF circuits (kA)"""

ensxpfm: float = 0.0
"""maximum stored energy in the PF circuits (MJ)"""

i_pf_energy_storage_source: int = 2
"""Switch for PF coil energy storage option:
- =1 all power from MGF (motor-generator flywheel) units
- =2 all pulsed power from line
- =3 PF power from MGF, heating from line
(In fact, options 1 and 3 are not treated differently)
"""

pfckts: float = 0.0
"""number of PF coil circuits"""

spfbusl: float = 0.0
"""total PF coil circuit bus length (m)"""

spsmva: float = 0.0
"""sum of PF power supply ratings (MVA)"""

srcktpm: float = 0.0
"""sum of resistive PF coil power (kW)"""

vpfskv: float = 0.0
"""PF coil voltage (kV)"""

peakpoloidalpower: float = 0.0
"""Peak absolute rate of change of stored energy in poloidal field (MW)"""

maxpoloidalpower: float = 1000.0
"""Maximum permitted absolute rate of change of stored energy in poloidal field (MW)"""

poloidalpower: list[float] = field(default_factory=lambda: np.zeros(5))
"""Poloidal power usage at time t (MW)"""

f_p_pf_energy_store_loss: float = 0.1
"""Fraction of PF magnetic energy moved into/out of storage that is lost each time"""

f_p_pf_psu_loss: float = 0.1
"""Fraction of inductive power flow lost in the PF power supplies/converters."""

i_pf_energy_storage_source: int = None
"""Switch for PF coil energy storage option:
- =1 all power from MGF (motor-generator flywheel) units
- =2 all pulsed power from line
- =3 PF power from MGF, heating from line
(In fact, options 1 and 3 are not treated differently)
"""

pfckts: float = None
"""number of PF coil circuits"""

spfbusl: float = None
"""total PF coil circuit bus length (m)"""

spsmva: float = None
"""sum of PF power supply ratings (MVA)"""

srcktpm: float = None
"""sum of resistive PF coil power (kW)"""

vpfskv: float = None
"""PF coil voltage (kV)"""

peakpoloidalpower: float = None
"""Peak absolute rate of change of stored energy in poloidal field (MW)"""

maxpoloidalpower: float = None
"""Maximum permitted absolute rate of change of stored energy in poloidal field (MW)"""

poloidalpower: list[float] = None
"""Poloidal power usage at time t (MW)"""

f_p_pf_energy_store_loss: float = None
"""Fraction of PF magnetic energy moved into/out of storage that is lost each time"""

f_p_pf_psu_loss: float = None
"""Fraction of inductive power flow lost in the PF power supplies/converters."""


def init_pf_power_variables():
"""Initialise PF coil power variables"""
global \
acptmax, \
ensxpfm, \
i_pf_energy_storage_source, \
pfckts, \
spfbusl, \
spsmva, \
srcktpm, \
vpfskv, \
peakpoloidalpower, \
maxpoloidalpower, \
poloidalpower, \
f_p_pf_energy_store_loss, \
f_p_pf_psu_loss

acptmax = 0.0
ensxpfm = 0.0
i_pf_energy_storage_source = 2
pfckts = 0.0
spfbusl = 0.0
spsmva = 0.0
srcktpm = 0.0
vpfskv = 0.0
peakpoloidalpower = 0.0
maxpoloidalpower = 1000.0
poloidalpower = np.zeros(5)
f_p_pf_energy_store_loss = 0.1
f_p_pf_psu_loss = 0.1
CREATE_DICTS_FROM_DATACLASS = PFPowerData
21 changes: 10 additions & 11 deletions process/models/costs/costs.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
from process.core.exceptions import ProcessValueError
from process.core.model import Model
from process.data_structure import (
pf_power_variables,
physics_variables,
tfcoil_variables,
)
Expand Down Expand Up @@ -2132,7 +2131,7 @@ def acc2252(self):
# Account 225.2.2 : PF coil instrumentation and control

self.data.costs.c22522 = (
1.0e-6 * self.data.costs.ucpfic * pf_power_variables.pfckts * 30.0e0
1.0e-6 * self.data.costs.ucpfic * self.data.pf_power.pfckts * 30.0e0
)
self.data.costs.c22522 = self.data.costs.fkind * self.data.costs.c22522

Expand All @@ -2141,19 +2140,19 @@ def acc2252(self):
self.data.costs.c22523 = (
1.0e-6
* self.data.costs.ucpfb
* pf_power_variables.spfbusl
* pf_power_variables.acptmax
* self.data.pf_power.spfbusl
* self.data.pf_power.acptmax
)
self.data.costs.c22523 = self.data.costs.fkind * self.data.costs.c22523

# Account 225.2.4 : PF coil burn power supplies

if pf_power_variables.pfckts != 0.0e0: # noqa: RUF069
if self.data.pf_power.pfckts != 0.0e0: # noqa: RUF069
self.data.costs.c22524 = (
1.0e-6
* self.data.costs.ucpfbs
* pf_power_variables.pfckts
* (pf_power_variables.srcktpm / pf_power_variables.pfckts) ** 0.7e0
* self.data.pf_power.pfckts
* (self.data.pf_power.srcktpm / self.data.pf_power.pfckts) ** 0.7e0
)
else:
self.data.costs.c22524 = 0.0e0
Expand All @@ -2165,22 +2164,22 @@ def acc2252(self):
self.data.costs.c22525 = (
1.0e-6
* self.data.costs.ucpfbk
* pf_power_variables.pfckts
* (pf_power_variables.acptmax * pf_power_variables.vpfskv) ** 0.7e0
* self.data.pf_power.pfckts
* (self.data.pf_power.acptmax * self.data.pf_power.vpfskv) ** 0.7e0
)
self.data.costs.c22525 = self.data.costs.fkind * self.data.costs.c22525

# Account 225.2.6 : PF coil dump resistors

self.data.costs.c22526 = (
1.0e-6 * self.data.costs.ucpfdr1 * pf_power_variables.ensxpfm
1.0e-6 * self.data.costs.ucpfdr1 * self.data.pf_power.ensxpfm
)
self.data.costs.c22526 = self.data.costs.fkind * self.data.costs.c22526

# Account 225.2.7 : PF coil AC breakers

self.data.costs.c22527 = (
1.0e-6 * self.data.costs.ucpfcb * pf_power_variables.pfckts
1.0e-6 * self.data.costs.ucpfcb * self.data.pf_power.pfckts
)
self.data.costs.c22527 = self.data.costs.fkind * self.data.costs.c22527

Expand Down
3 changes: 1 addition & 2 deletions process/models/costs/costs_2015.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
from process.core.model import Model
from process.data_structure import (
global_variables,
pf_power_variables,
physics_variables,
tfcoil_variables,
)
Expand Down Expand Up @@ -1087,7 +1086,7 @@ def calc_remaining_subsystems(self):
# For ITER value see
# K:\Power Plant Physics and Technology\PROCESS\PROCESS documentation papers\resistive diffusion time.xmcd or pdf
self.data.costs_2015.s_k[51] = (
pf_power_variables.ensxpfm * 1.0e6 / physics_variables.t_plasma_res_diffusion
self.data.pf_power.ensxpfm * 1.0e6 / physics_variables.t_plasma_res_diffusion
)
self.data.costs_2015.s_kref[51] = 8.0e9 / 953.0e0
self.data.costs_2015.s_cost[51] = (
Expand Down
Loading
Loading