Skip to content
Merged
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
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ LIST(APPEND PROCESS_SRCS
numerics.f90
scan.f90
fw.f90
current_drive.f90
hcpb.f90
pfcoil.f90
reinke_module.f90
Expand Down
1,988 changes: 1,988 additions & 0 deletions process/current_drive.py

Large diffs are not rendered by default.

7 changes: 6 additions & 1 deletion process/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
from process.dcll import DCLL
from process.blanket_library import BlanketLibrary
from process.fw import Fw
from process.current_drive import CurrentDrive
from process.impurity_radiation import initialise_imprad

from pathlib import Path
Expand Down Expand Up @@ -585,6 +586,7 @@ def __init__(self):
self.fw = Fw()
self.blanket_library = BlanketLibrary(fw=self.fw)
self.ccfe_hcpb = CCFE_HCPB(blanket_library=self.blanket_library)
self.current_drive = CurrentDrive()
self.stellarator = Stellarator(
availability=self.availability,
buildings=self.buildings,
Expand All @@ -593,9 +595,12 @@ def __init__(self):
power=self.power,
plasma_profile=self.plasma_profile,
hcpb=self.ccfe_hcpb,
current_drive=self.current_drive,
)
self.costs_2015 = Costs2015()
self.physics = Physics(plasma_profile=self.plasma_profile)
self.physics = Physics(
plasma_profile=self.plasma_profile, current_drive=self.current_drive
)
self.dcll = DCLL(blanket_library=self.blanket_library)


Expand Down
2 changes: 1 addition & 1 deletion process/output.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def write(models, outfile):
ft.physics_module.igmarcal(outfile)

# TODO what is this? Not in caller.f90?
ft.current_drive_module.cudriv(outfile, 1)
models.current_drive.cudriv(output=True)

# Pulsed reactor model
models.pulse.run(output=True)
Expand Down
6 changes: 3 additions & 3 deletions process/physics.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import numpy
import math
import process.physics_functions as physics_funcs
from process.fortran import current_drive_module
from process.fortran import constraint_variables
from process.fortran import reinke_variables
from process.fortran import reinke_module
Expand All @@ -22,9 +21,10 @@


class Physics:
def __init__(self, plasma_profile):
def __init__(self, plasma_profile, current_drive):
self.outfile = constants.nout
self.plasma_profile = plasma_profile
self.current_drive = current_drive

def physics(self):
"""
Expand Down Expand Up @@ -302,7 +302,7 @@ def physics(self):
# Auxiliary current drive power calculations

if current_drive_variables.irfcd != 0:
current_drive_module.cudriv(constants.nout, 0)
self.current_drive.cudriv(False)

# Calculate fusion power + components

Expand Down
16 changes: 13 additions & 3 deletions process/stellarator.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
physics_functions_module,
neoclassics_module,
impurity_radiation_module,
current_drive_module,
)
import process.superconductors as superconductors
import process.physics_functions as physics_funcs
Expand All @@ -54,7 +53,15 @@ class Stellarator:
"""

def __init__(
self, availability, vacuum, buildings, costs, power, plasma_profile, hcpb
self,
availability,
vacuum,
buildings,
costs,
power,
plasma_profile,
hcpb,
current_drive,
) -> None:
"""Initialises the Stellarator model's variables

Expand All @@ -70,6 +77,8 @@ def __init__(
:type plasma_profile: process.plasma_profile.PlasmaProfile
:param hcpb: a pointer to the ccfe_hcpb model, allowing use of ccfe_hcpb's variables/methods
:type hcpb: process.hcpb.CCFE_HCPB
:param current_drive: a pointer to the CurrentDrive model, allowing use of CurrentDrives's variables/methods
:type current_drive: process.current_drive.CurrentDrive
"""

self.outfile: int = constants.nout
Expand All @@ -82,6 +91,7 @@ def __init__(
self.power = power
self.plasma_profile = plasma_profile
self.hcpb = hcpb
self.current_drive = current_drive

def run(self, output: bool):
"""Routine to call the physics and engineering modules
Expand Down Expand Up @@ -4637,7 +4647,7 @@ def stheat(self, output: bool):
effnbss,
fpion,
current_drive_variables.nbshinef,
) = current_drive_module.culnbi()
) = self.current_drive.culnbi()
current_drive_variables.pnbeam = current_drive_variables.pheat * (
1 - current_drive_variables.forbitloss
)
Expand Down
Loading