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
12 changes: 0 additions & 12 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -51,19 +51,7 @@ untracked.info
com.msg
Katy_test/*
KatyTest/*
PLASMOD/CHARTST/*
PLASMOD/*.DAT
PLASMOD/*.dat
PLASMOD/fort.*
PLASMOD/output_list.txt
PLASMOD/KE*
*~
lib/PLASMOD/CHARTST/*
lib/PLASMOD/*.DAT
/lib/PLASMOD/*.dat
/lib/PLASMOD/fort.*
/lib/PLASMOD/output_list.txt
/lib/PLASMOD/KE*
/utilities/run_process.conf
*.fdb_latexmk
*.fls
Expand Down
2 changes: 1 addition & 1 deletion documentation/proc-pages/fusion-devices/stellarator.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ Here $\bar{\iota}$ is the rotational transform, which is equivalent to the recip

### Gradient informed neoclassical transport checks

As no 1D solver options are available for stellarators yet (the PLASMOD module can not be called yet for stellarator-PROCESS), PROCESS prints several neoclassics parameters as obtained from the 1/$\nu$ regime.
As no 1D solver options are available for stellarators yet, PROCESS prints several neoclassics parameters as obtained from the 1/$\nu$ regime.
The two most important parameters are `q_PROCESS` and `total_q_neo_e`.
`q_PROCESS` is the heat flux that PROCESS obtaines from the 0D confinement time scalings.
`total_q_neo_e` is the estimated total neoclassical flux as obtained from the 1/$\nu$ electron transport regime, multiplied by a factor of 4 (2 for the ion contribution and another factor of 2 for the radial electrical field influence).
Expand Down
1 change: 0 additions & 1 deletion documentation/proc-pages/physics-models/plasma.md
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,6 @@ be described as 1/2-D. The relevant profile index variables are

If `ipedestal` = 1, 2 or 3 the density and temperature profiles include a pedestal.
If `ipedestal` = 1 the density and temperature profiles use the forms given below [^6].
If `ipedestal` = 2 or 3 the profiles are determined by the transport code PLASMOD.

$$\begin{aligned}
\mbox{density:} \qquad n(\rho) = \left\{
Expand Down
2 changes: 1 addition & 1 deletion documentation/proc-pages/usage/running-process.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ ORIGINAL_IN_DAT = ref_IN.DAT
* PROCESS= ../../../process.exe

* ONE line comment to be put into README.txt
COMMENT = ipedestal = 1, with other variables appropriate for running PLASMOD
COMMENT =

* Max no. iterations
NITER = 1000
Expand Down
9 changes: 0 additions & 9 deletions process/caller.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,6 @@ def call_models(self, xc):

self.models.physics.physics()

# call build subroutines again if PLASMOD used, issue #650
if ft.physics_variables.ipedestal == 3:
# Radial build
self.models.build.radialb(output=False)

# TODO: is the vertical build needed again?
# Vertical build
self.models.build.vbuild(output=False)

# startup model (not used)
# call startup(ft.constants.nout,0) ! commented-out for speed reasons

Expand Down
42 changes: 12 additions & 30 deletions process/current_drive.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,21 +256,12 @@ def cudriv(self, output: bool):
0.999, current_drive_variables.forbitloss
) # Should never be needed

if physics_variables.ipedestal != 3: # When not using PLASMOD
pnbitotfix = current_drive_variables.pinjfixmw / (
1.0e0
- current_drive_variables.forbitloss
+ current_drive_variables.forbitloss
* current_drive_variables.nbshinef
)
else:
# Netural beam power calculated by PLASMOD
pnbitotfix = current_drive_variables.pinjmw / (
1.0e0
- current_drive_variables.forbitloss
+ current_drive_variables.forbitloss
* current_drive_variables.nbshinef
)
pnbitotfix = current_drive_variables.pinjfixmw / (
1.0e0
- current_drive_variables.forbitloss
+ current_drive_variables.forbitloss
* current_drive_variables.nbshinef
)

# Shinethrough power (atoms that are not ionised) [MW]:
nbshinemwfix = pnbitotfix * current_drive_variables.nbshinef
Expand Down Expand Up @@ -478,21 +469,12 @@ def cudriv(self, output: bool):
0.999, current_drive_variables.forbitloss
) # Should never be needed

if physics_variables.ipedestal != 3: # When not using PLASMOD
current_drive_variables.pnbitot = power1 / (
1.0e0
- current_drive_variables.forbitloss
+ current_drive_variables.forbitloss
* current_drive_variables.nbshinef
)
else:
# Neutral beam power calculated by PLASMOD
current_drive_variables.pnbitot = current_drive_variables.pinjmw / (
1.0e0
- current_drive_variables.forbitloss
+ current_drive_variables.forbitloss
* current_drive_variables.nbshinef
)
current_drive_variables.pnbitot = power1 / (
1.0e0
- current_drive_variables.forbitloss
+ current_drive_variables.forbitloss
* current_drive_variables.nbshinef
)

# Shinethrough power (atoms that are not ionised) [MW]:
current_drive_variables.nbshinemw = (
Expand Down
144 changes: 8 additions & 136 deletions process/io/plot_proc.py
Original file line number Diff line number Diff line change
Expand Up @@ -800,34 +800,6 @@ def plot_nprofile(prof, demo_ranges):
# ---


def plot_plasmod_nprofile(prof, demo_ranges):
"""Function to plot plasmod density profile
Arguments:
prof --> axis object to add plot to
"""

prof.set_xlabel("r/a")
prof.set_ylabel(r"$n_{e}\cdot 10^{19} \mathrm{m}^{-3}$")
prof.set_title("Density profile")
prof.plot(pmod_r, pmod_ne, label="plasmod $n_e$")
prof.plot(pmod_r, pmod_ni, label="plasmod $n_i$")
prof.plot(pmod_r, pmod_nt, label="plasmod $n_T$")
prof.plot(pmod_r, pmod_nd, label="plasmod $n_D$")
prof.legend()

# Ranges
# ---
# DEMO : Fixed ranges for comparison
prof.set_xlim([0, 1])
if demo_ranges:
prof.set_ylim([0, 20])

# Adapatative ranges
else:
prof.set_ylim([0, prof.get_ylim()[1]])
# ---


def plot_tprofile(prof, demo_ranges):
"""Function to plot temperature profile
Arguments:
Expand Down Expand Up @@ -869,32 +841,6 @@ def plot_tprofile(prof, demo_ranges):
# ---


def plot_plasmod_tprofile(prof, demo_ranges):
"""Function to plot plasmod temperature profile
Arguments:
prof --> axis object to add plot to
"""

prof.set_xlabel("r/a")
prof.set_ylabel("$T_{e}$ [keV]")
prof.set_title("Temperature profile")
prof.plot(pmod_r, pmod_te, label="plasmod $T_e$")
prof.plot(pmod_r, pmod_ti, label="plasmod $T_i$")
prof.legend()

# Ranges
# ---
prof.set_xlim([0, 1])
# DEMO : Fixed ranges for comparison
if demo_ranges:
prof.set_ylim([0, 50])

# Adapatative ranges
else:
prof.set_ylim([0, prof.get_ylim()[1]])
# ---


def plot_qprofile(prof, demo_ranges):
"""Function to plot q profile, formula taken from Nevins bootstrap model.

Expand Down Expand Up @@ -927,31 +873,6 @@ def plot_qprofile(prof, demo_ranges):
# ---


def plot_plasmod_qprofile(prof, demo_ranges):
"""Function to plot plasmod q profile
Arguments:
prof --> axis object to add plot to
"""

prof.set_xlabel("r/a")
prof.set_ylabel("-")
prof.set_title("q profile")
prof.plot(pmod_r, pmod_q, label="plasmod $q(r/a)$")
prof.legend()

# Ranges
# ---
prof.set_xlim([0, 1])
# DEMO : Fixed ranges for comparison
if demo_ranges:
prof.set_ylim([0, 10])

# Adapatative ranges
else:
prof.set_ylim([0, prof.get_ylim()[1]])
# ---


def read_imprad_data(skiprows, data_path):
"""Function to read all data needed for creation of radiation profile

Expand Down Expand Up @@ -2443,7 +2364,6 @@ def main_plot(
fig2,
m_file_data,
scan,
plasmod=False,
imp="../data/lz_non_corona_14_elements/",
demo_ranges=False,
):
Expand All @@ -2454,7 +2374,6 @@ def main_plot(
fig2 --> figure object to add plot to.
m_file_data --> MFILE.DAT data to read
scan --> scan to read from MFILE.DAT
plasmod --> plasmod data or not
imp --> path to impurity data
"""

Expand Down Expand Up @@ -2488,26 +2407,16 @@ def main_plot(

# Plot density profiles
plot_4 = fig2.add_subplot(234) # , aspect= 0.05)
if plasmod:
plot_plasmod_nprofile(plot_4, demo_ranges)
else:
plot_nprofile(plot_4, demo_ranges)
plot_nprofile(plot_4, demo_ranges)

# Plot temperature profiles
plot_5 = fig2.add_subplot(235) # , aspect= 1/35)
if plasmod:
plot_plasmod_tprofile(plot_5, demo_ranges)
else:
plot_tprofile(plot_5, demo_ranges)
plot_tprofile(plot_5, demo_ranges)

if plasmod:
plot_6 = fig2.add_subplot(236) # , aspect=1/10)
plot_plasmod_qprofile(plot_6, demo_ranges)
else:
# plot_qprofile(plot_6)
plot_6 = fig2.add_subplot(236) # , aspect=2)
if os.path.isdir(imp):
plot_radprofile(plot_6, m_file_data, scan, imp, demo_ranges)
# plot_qprofile(plot_6)
plot_6 = fig2.add_subplot(236) # , aspect=2)
if os.path.isdir(imp):
plot_radprofile(plot_6, m_file_data, scan, imp, demo_ranges)

# plot_7 =
# plot_radprofile(plot_7)
Expand Down Expand Up @@ -2807,8 +2716,7 @@ def parse_args(args):
# Setup command line arguments
parser = argparse.ArgumentParser(
description="Produces a two page summary of the PROCESS MFILE output, using the MFILE. "
"For info contact michael.kovari@ukaea.uk or james.morris2@ukaea.uk. "
"If using PLASMOD you must specify the profile file using -m."
"For info please see https://github.com/ukaea/PROCESS?tab=readme-ov-file#contacts "
)

parser.add_argument(
Expand All @@ -2818,14 +2726,6 @@ def parse_args(args):
default="",
help="specify input/output file path",
)
parser.add_argument(
"-m",
metavar="PLASMODFILE",
type=str,
default="",
help="specify PLASMOD profile file",
)

parser.add_argument("-s", "--show", help="show plot", action="store_true")

parser.add_argument("-n", type=int, help="Which scan to plot?")
Expand Down Expand Up @@ -3005,32 +2905,6 @@ def main(args=None):
# Alpha press(keV*10^10 m^-3) -- 14
# Ion dens(10^19 m^-3) -- 15
# Poloidal flux (Wb) -- 16
if args.m != "":
global pmod_r
global pmod_ne
global pmod_te
global pmod_ti
global pmod_nd
global pmod_nt
global pmod_q
global pmod_ni

plasmod_profiles = np.loadtxt(args.m).transpose()
pmod_r = plasmod_profiles[0]
pmod_ne = plasmod_profiles[1]
pmod_te = plasmod_profiles[2]
pmod_ti = plasmod_profiles[3]
pmod_nd = plasmod_profiles[4]
pmod_nt = plasmod_profiles[5]
pmod_q = plasmod_profiles[10]
pmod_ni = plasmod_profiles[15]
pmod_switch = True
print("plasmod!")
else:
if ipedestal == 2 or ipedestal == 3:
print("\n ERROR: Specify the PLASMOD profile file using -m \n")
exit()
pmod_switch = False
# rad profile
global ssync
global bt
Expand Down Expand Up @@ -3104,9 +2978,7 @@ def main(args=None):
page2 = plt.figure(figsize=(12, 9), dpi=80)

# run main_plot
main_plot(
page1, page2, m_file, scan=scan, plasmod=pmod_switch, demo_ranges=demo_ranges
)
main_plot(page1, page2, m_file, scan=scan, demo_ranges=demo_ranges)

# with bpdf.PdfPages(args.o) as pdf:
with bpdf.PdfPages(args.f + "SUMMARY.pdf") as pdf:
Expand Down
2 changes: 1 addition & 1 deletion process/io/run_process.conf
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ ORIGINAL_IN_DAT = PROCESS_DIR/RUN_DIR/STEP_IN.DAT
* PROCESS= PROCESS_DIR/bin/process.exe

* ONE line comment to be put into README.txt
COMMENT = ipedestal = 1, with other variables appropriate for running PLASMOD
COMMENT =

* Max no. iterations
NITER = 50
Expand Down
4 changes: 0 additions & 4 deletions process/output.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,6 @@ def write(models, outfile):
# Writing the output from physics.f90 into OUT.DAT + MFILE.DAT
ft.physics_module.outplas(outfile)

# Writing
if ft.physics_variables.ipedestal == 2 or ft.physics_variables.ipedestal == 3:
ft.plasmod_module.outputplasmod(outfile)

# TODO what is this? not in caller.f90
ft.physics_module.igmarcal(outfile)

Expand Down
1 change: 0 additions & 1 deletion process/physics.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,6 @@ def physics(self):
physics_variables.vol,
)

# Profile parameters are meaningless with ipedestal=3
betat = (
physics_variables.beta
* physics_variables.btot**2
Expand Down
Loading