Skip to content

Commit fc2a9f7

Browse files
jcitrinTorax team
authored and
Torax team
committed
Bugfix tutorial helper function.
NBI current drive was not being updated consistently with the power in exercise 1. PiperOrigin-RevId: 744656956
1 parent 931a1df commit fc2a9f7

File tree

2 files changed

+169
-322
lines changed

2 files changed

+169
-322
lines changed

torax/tutorials/torax_tutorial_exercises.ipynb

+5-4
Original file line numberDiff line numberDiff line change
@@ -67,15 +67,15 @@
6767
"With Newton-Raphson stepper and adaptive timestep (backtracking)\n",
6868
"\"\"\"\n",
6969
"\n",
70-
"_NBI_MW_TO_A = 1/16e6 # rough estimate of NBI heating power to current drive\n",
70+
"_NBI_W_TO_MA = 1/16e6 # rough estimate of NBI heating power to current drive\n",
7171
"W_to_Ne_ratio = 0\n",
7272
"\n",
7373
"# No NBI during rampup. Rampup all NBI power between 99-100 seconds\n",
7474
"nbi_times = np.array([0, 99, 100])\n",
7575
"nbi_powers = np.array([0, 0, 33e6])\n",
76-
"nbi_cd = nbi_powers * _NBI_MW_TO_A\n",
76+
"nbi_cd = nbi_powers * _NBI_W_TO_MA\n",
7777
"\n",
78-
"# Gaussian perscription of \"NBI\" deposition profiles and fractional deposition\n",
78+
"# Gaussian prescription of \"NBI\" deposition profiles and fractional deposition\n",
7979
"r_nbi = 0.25\n",
8080
"w_nbi = 0.25\n",
8181
"el_heat_fraction = 0.66\n",
@@ -697,6 +697,7 @@
697697
" config['runtime_params']['profile_conditions']['Ip_tot'] = {0: 3, LH_transition_time: 12.5}\n",
698698
" config['sources']['electron_cyclotron_source']['gaussian_ec_total_power'] = {0: 0, LH_transition_time-1: 0, LH_transition_time: 20.0e6}\n",
699699
" config['sources']['generic_ion_el_heat_source']['Ptot'] = {0: 0, LH_transition_time-1: 0, LH_transition_time: 33.0e6}\n",
700+
" config['sources']['generic_current_source']['Iext'] = {0: 0, LH_transition_time-1: 0, LH_transition_time: 33.0e6 * _NBI_W_TO_MA}\n",
700701
" config['pedestal']['Tiped'] = {0: 0.5, LH_transition_time: 0.5, LH_transition_time+5: 3.0}\n",
701702
" config['pedestal']['Teped'] = {0: 0.5, LH_transition_time: 0.5, LH_transition_time+5: 3.0}\n",
702703
" return config\n",
@@ -773,7 +774,7 @@
773774
" if nbi_power is not None:\n",
774775
" _validate_input_dict(nbi_power, \"nbi_power\", (0.0, 33e6), \"W\")\n",
775776
" config['sources']['generic_ion_el_heat_source']['Ptot'] = nbi_power\n",
776-
" nbi_current = {time: value*_NBI_MW_TO_A for time, value in nbi_power.items()}\n",
777+
" nbi_current = {time: value*_NBI_W_TO_MA for time, value in nbi_power.items()}\n",
777778
" config['sources']['generic_current_source']['Iext'] = nbi_current\n",
778779
" if off_axis_ec_power is not None:\n",
779780
" _validate_input_dict(off_axis_ec_power, \"off_axis_ec_power\", (0.0, 40e6), \"W\")\n",

torax/tutorials/torax_tutorial_exercises_with_solutions.ipynb

+164-318
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)