Skip to content

Commit c3ccd3b

Browse files
committed
Post rebase changes
1 parent 931d2f9 commit c3ccd3b

File tree

4 files changed

+52
-33
lines changed

4 files changed

+52
-33
lines changed

process/caller.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,6 @@ def _call_models_once(self, xc: np.ndarray) -> None:
253253
self.models.build.run()
254254

255255
self.models.physics.physics()
256-
self.models.physics_detailed.run()
257256

258257
# Toroidal field coil model
259258

process/io/plot_proc.py

Lines changed: 47 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -12549,15 +12549,21 @@ def plot_debye_length_profile(axis, mfile_data, scan):
1254912549
for i in range(int(mfile_data.data["n_plasma_profile_elements"].get_scan(scan)))
1255012550
]
1255112551

12552+
# Convert to micrometres (1e-6 m)
12553+
len_plasma_debye_electron_profile_um = [
12554+
length * 1e6 for length in len_plasma_debye_electron_profile
12555+
]
12556+
1255212557
axis.plot(
12553-
np.linspace(0, 1, len(len_plasma_debye_electron_profile)),
12554-
len_plasma_debye_electron_profile,
12558+
np.linspace(0, 1, len(len_plasma_debye_electron_profile_um)),
12559+
len_plasma_debye_electron_profile_um,
1255512560
color="blue",
1255612561
linestyle="-",
1255712562
label=r"$\lambda_{Debye,e}$",
1255812563
)
1255912564

12560-
axis.set_ylabel("Debye Length [m]")
12565+
axis.set_ylabel(r"Debye Length [$\mu$m]")
12566+
1256112567
axis.set_xlabel("$\\rho \\ [r/a]$")
1256212568
axis.grid(True, which="both", linestyle="--", alpha=0.5)
1256312569
axis.set_xlim([0, 1.025])
@@ -12678,6 +12684,7 @@ def main_plot(
1267812684
fig25,
1267912685
fig26,
1268012686
fig27,
12687+
fig28,
1268112688
m_file_data,
1268212689
scan,
1268312690
imp="../data/lz_non_corona_14_elements/",
@@ -12827,9 +12834,14 @@ def main_plot(
1282712834
plot_density_limit_comparison(fig13.add_subplot(221), m_file_data, scan)
1282812835
plot_confinement_time_comparison(fig13.add_subplot(224), m_file_data, scan)
1282912836

12837+
plot_debye_length_profile(fig14.add_subplot(232), m_file_data, scan)
12838+
plot_velocity_profile(fig14.add_subplot(233), m_file_data, scan)
12839+
plot_frequency_profile(fig14.add_subplot(212), m_file_data, scan)
12840+
plot_plasma_coloumb_logarithms(fig14.add_subplot(231), m_file_data, scan)
12841+
1283012842
# Plot poloidal cross-section
1283112843
poloidal_cross_section(
12832-
fig14.add_subplot(121, aspect="equal"),
12844+
fig15.add_subplot(121, aspect="equal"),
1283312845
m_file_data,
1283412846
scan,
1283512847
demo_ranges,
@@ -12838,81 +12850,81 @@ def main_plot(
1283812850

1283912851
# Plot toroidal cross-section
1284012852
toroidal_cross_section(
12841-
fig14.add_subplot(122, aspect="equal"),
12853+
fig15.add_subplot(122, aspect="equal"),
1284212854
m_file_data,
1284312855
scan,
1284412856
demo_ranges,
1284512857
colour_scheme,
1284612858
)
1284712859

1284812860
# Plot color key
12849-
ax17 = fig14.add_subplot(222)
12861+
ax17 = fig15.add_subplot(222)
1285012862
ax17.set_position([0.5, 0.5, 0.5, 0.5])
1285112863
color_key(ax17, m_file_data, scan, colour_scheme)
1285212864

12853-
ax18 = fig15.add_subplot(211)
12865+
ax18 = fig16.add_subplot(211)
1285412866
ax18.set_position([0.1, 0.33, 0.8, 0.6])
1285512867
plot_radial_build(ax18, m_file_data, colour_scheme)
1285612868

1285712869
# Make each axes smaller vertically to leave room for the legend
12858-
ax185 = fig16.add_subplot(211)
12870+
ax185 = fig17.add_subplot(211)
1285912871
ax185.set_position([0.1, 0.61, 0.8, 0.32])
1286012872

12861-
ax18b = fig16.add_subplot(212)
12873+
ax18b = fig17.add_subplot(212)
1286212874
ax18b.set_position([0.1, 0.13, 0.8, 0.32])
1286312875
plot_upper_vertical_build(ax185, m_file_data, colour_scheme)
1286412876
plot_lower_vertical_build(ax18b, m_file_data, colour_scheme)
1286512877

1286612878
# Can only plot WP and turn structure if superconducting coil at the moment
1286712879
if m_file_data.data["i_tf_sup"].get_scan(scan) == 1:
1286812880
# TF coil with WP
12869-
ax19 = fig17.add_subplot(221, aspect="equal")
12881+
ax19 = fig18.add_subplot(221, aspect="equal")
1287012882
ax19.set_position([
1287112883
0.025,
1287212884
0.45,
1287312885
0.5,
1287412886
0.5,
1287512887
]) # Half height, a bit wider, top left
12876-
plot_superconducting_tf_wp(ax19, m_file_data, scan, fig17)
12888+
plot_superconducting_tf_wp(ax19, m_file_data, scan, fig18)
1287712889

1287812890
# TF coil turn structure
12879-
ax20 = fig18.add_subplot(325, aspect="equal")
12891+
ax20 = fig19.add_subplot(325, aspect="equal")
1288012892
ax20.set_position([0.025, 0.5, 0.4, 0.4])
12881-
plot_tf_cable_in_conduit_turn(ax20, fig18, m_file_data, scan)
12882-
plot_205 = fig18.add_subplot(223, aspect="equal")
12893+
plot_tf_cable_in_conduit_turn(ax20, fig19, m_file_data, scan)
12894+
plot_205 = fig19.add_subplot(223, aspect="equal")
1288312895
plot_205.set_position([0.075, 0.1, 0.3, 0.3])
12884-
plot_cable_in_conduit_cable(plot_205, fig18, m_file_data, scan)
12896+
plot_cable_in_conduit_cable(plot_205, fig19, m_file_data, scan)
1288512897
else:
12886-
ax19 = fig17.add_subplot(211, aspect="equal")
12898+
ax19 = fig18.add_subplot(211, aspect="equal")
1288712899
ax19.set_position([0.06, 0.55, 0.675, 0.4])
12888-
plot_resistive_tf_wp(ax19, m_file_data, scan, fig17)
12900+
plot_resistive_tf_wp(ax19, m_file_data, scan, fig18)
1288912901

1289012902
plot_tf_coil_structure(
12891-
fig19.add_subplot(111, aspect="equal"), m_file_data, scan, colour_scheme
12903+
fig20.add_subplot(111, aspect="equal"), m_file_data, scan, colour_scheme
1289212904
)
1289312905

12894-
plot_plasma_outboard_toroidal_ripple_map(fig20, m_file_data, scan)
12906+
plot_plasma_outboard_toroidal_ripple_map(fig21, m_file_data, scan)
1289512907

12896-
axes = fig21.subplots(nrows=3, ncols=1, sharex=True).flatten()
12908+
axes = fig22.subplots(nrows=3, ncols=1, sharex=True).flatten()
1289712909
plot_tf_stress(axes)
1289812910

12899-
plot_current_profiles_over_time(fig22.add_subplot(111), m_file_data, scan)
12911+
plot_current_profiles_over_time(fig23.add_subplot(111), m_file_data, scan)
1290012912

1290112913
plot_cs_coil_structure(
12902-
fig23.add_subplot(121, aspect="equal"), fig23, m_file_data, scan
12914+
fig24.add_subplot(121, aspect="equal"), fig24, m_file_data, scan
1290312915
)
1290412916
plot_cs_turn_structure(
12905-
fig23.add_subplot(224, aspect="equal"), fig23, m_file_data, scan
12917+
fig24.add_subplot(224, aspect="equal"), fig24, m_file_data, scan
1290612918
)
1290712919

1290812920
plot_first_wall_top_down_cross_section(
12909-
fig24.add_subplot(221, aspect="equal"), m_file_data, scan
12921+
fig25.add_subplot(221, aspect="equal"), m_file_data, scan
1291012922
)
12911-
plot_first_wall_poloidal_cross_section(fig24.add_subplot(122), m_file_data, scan)
12912-
plot_fw_90_deg_pipe_bend(fig24.add_subplot(337), m_file_data, scan)
12923+
plot_first_wall_poloidal_cross_section(fig25.add_subplot(122), m_file_data, scan)
12924+
plot_fw_90_deg_pipe_bend(fig25.add_subplot(337), m_file_data, scan)
1291312925

12914-
plot_blkt_pipe_bends(fig25, m_file_data, scan)
12915-
ax_blanket = fig25.add_subplot(122, aspect="equal")
12926+
plot_blkt_pipe_bends(fig26, m_file_data, scan)
12927+
ax_blanket = fig26.add_subplot(122, aspect="equal")
1291612928
plot_blanket(ax_blanket, m_file_data, scan, colour_scheme)
1291712929
plot_firstwall(ax_blanket, m_file_data, scan, colour_scheme)
1291812930
ax_blanket.set_xlabel("Radial position [m]")
@@ -12955,13 +12967,13 @@ def main_plot(
1295512967
)
1295612968

1295712969
plot_main_power_flow(
12958-
fig26.add_subplot(111, aspect="equal"), m_file_data, scan, fig26
12970+
fig27.add_subplot(111, aspect="equal"), m_file_data, scan, fig27
1295912971
)
1296012972

12961-
ax24 = fig27.add_subplot(111)
12973+
ax24 = fig28.add_subplot(111)
1296212974
# set_position([left, bottom, width, height]) -> height ~ 0.66 => ~2/3 of page height
1296312975
ax24.set_position([0.08, 0.35, 0.84, 0.57])
12964-
plot_system_power_profiles_over_time(ax24, m_file_data, scan, fig27)
12976+
plot_system_power_profiles_over_time(ax24, m_file_data, scan, fig28)
1296512977

1296612978

1296712979
def main(args=None):
@@ -13282,6 +13294,7 @@ def main(args=None):
1328213294
page25 = plt.figure(figsize=(12, 9), dpi=80)
1328313295
page26 = plt.figure(figsize=(12, 9), dpi=80)
1328413296
page27 = plt.figure(figsize=(12, 9), dpi=80)
13297+
page28 = plt.figure(figsize=(12, 9), dpi=80)
1328513298

1328613299
# run main_plot
1328713300
main_plot(
@@ -13313,6 +13326,7 @@ def main(args=None):
1331313326
page25,
1331413327
page26,
1331513328
page27,
13329+
page28,
1331613330
m_file,
1331713331
scan=scan,
1331813332
demo_ranges=demo_ranges,
@@ -13349,6 +13363,7 @@ def main(args=None):
1334913363
pdf.savefig(page25)
1335013364
pdf.savefig(page26)
1335113365
pdf.savefig(page27)
13366+
pdf.savefig(page28)
1335213367

1335313368
# show fig if option used
1335413369
if args.show:
@@ -13382,6 +13397,7 @@ def main(args=None):
1338213397
plt.close(page25)
1338313398
plt.close(page26)
1338413399
plt.close(page27)
13400+
plt.close(page28)
1338513401

1338613402

1338713403
if __name__ == "__main__":

process/output.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@ def write(models, _outfile):
4343
# Writing the output from physics.f90 into OUT.DAT + MFILE.DAT
4444
models.physics.calculate_effective_charge_ionisation_profiles()
4545
models.physics.outplas()
46+
47+
# Detailed physics, currently only done at final point as values are not used
48+
# by any other functions
49+
models.physics_detailed.run()
4650
models.physics_detailed.output_detailed_physics()
4751

4852
# TODO what is this? Not in caller.f90?

process/physics.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9241,7 +9241,7 @@ def calculate_debroglie_wavelength(self, mass: float, velocity: float) -> float:
92419241
:returns: de Broglie wavelength in meters.
92429242
:rtype: float
92439243
"""
9244-
return constants.PLANCK_CONSTANT / (mass * velocity)
9244+
return (constants.PLANCK_CONSTANT / (2 * np.pi)) / (mass * velocity)
92459245

92469246
def calculate_plasma_frequency(
92479247
self, nd_particle: float, m_particle: float, z_particle: float

0 commit comments

Comments
 (0)