Skip to content

Commit

Permalink
Merge pull request FusionDLS#32 from PlasmaFAIR/remove-flux-limiter
Browse files Browse the repository at this point in the history
Remove all flux limiter code
  • Loading branch information
mikekryjak authored Aug 13, 2024
2 parents facd309 + 8391e18 commit 91d003b
Show file tree
Hide file tree
Showing 9 changed files with 5 additions and 38 deletions.
2 changes: 0 additions & 2 deletions Analytic_Benchmark.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@
"radios_default = {\n",
" \"ionisation\": False, # WIP - do not use. in development\n",
" \"upstreamGrid\": True, # SET TRUE if including domain above xpoint. if true, source of divertor heat flux comes from radial transport upstream, and Tu is at the midplane. If false, heat flux simply enters at the x point as qi, and Tu is located at the x point. \n",
" \"fluxlim\": False, # WIP - do not use. if true, turns on a flux limiter with coefficient alpha\n",
"}\n",
"\n",
"#set general run parameters\n",
Expand All @@ -75,7 +74,6 @@
" \"cz0\" : 0.02, # Impurity fraction (if constant)\n",
" \n",
" \"Lfunc\": LfuncN, # impurity cooling function. More are available in AnalyticCoolingCurves.py\n",
" \"alpha\": 1000, # WIP - do not use. flux limiting alpha. Only matters if fluxlim is true\n",
"}\n"
]
},
Expand Down
2 changes: 0 additions & 2 deletions Ex. 1 - Basics.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,6 @@
"radios_default = {\n",
" \"ionisation\": False, # WIP - do not use. in development\n",
" \"upstreamGrid\": True, # SET TRUE if including domain above xpoint. if true, source of divertor heat flux comes from radial transport upstream, and Tu is at the midplane. If false, heat flux simply enters at the x point as qi, and Tu is located at the x point. \n",
" \"fluxlim\": False, # WIP - do not use. if true, turns on a flux limiter with coefficient alpha\n",
"}\n",
"\n",
"#set general run parameters\n",
Expand All @@ -232,7 +231,6 @@
" \"cz0\" : 0.02, # Impurity fraction (if constant)\n",
" \n",
" \"Lfunc\": LfuncKallenbachAr, # impurity cooling function. More are available in AnalyticCoolingCurves.py\n",
" \"alpha\": 1000, # WIP - do not use. flux limiting alpha. Only matters if fluxlim is true\n",
"}\n"
]
},
Expand Down
2 changes: 0 additions & 2 deletions Ex. 2 - Manipulating profiles.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,6 @@
"radios_default = {\n",
" \"ionisation\": False, # WIP - do not use. in development\n",
" \"upstreamGrid\": True, # SET TRUE if including domain above xpoint. if true, source of divertor heat flux comes from radial transport upstream, and Tu is at the midplane. If false, heat flux simply enters at the x point as qi, and Tu is located at the x point. \n",
" \"fluxlim\": False, # WIP - do not use. if true, turns on a flux limiter with coefficient alpha\n",
"}\n",
"\n",
"#set general run parameters\n",
Expand All @@ -154,7 +153,6 @@
" \"cz0\" : 0.02, # Impurity fraction (if constant)\n",
" \n",
" \"Lfunc\": LfuncKallenbachAr, # impurity cooling function. More are available in AnalyticCoolingCurves.py\n",
" \"alpha\": 1000, # WIP - do not use. flux limiting alpha. Only matters if fluxlim is true\n",
"}\n"
]
},
Expand Down
2 changes: 0 additions & 2 deletions Ex. 3 - Advanced post-processing.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,6 @@
"radios_default = {\n",
" \"ionisation\": False, # WIP - do not use. in development\n",
" \"upstreamGrid\": True, # SET TRUE if including domain above xpoint. if true, source of divertor heat flux comes from radial transport upstream, and Tu is at the midplane. If false, heat flux simply enters at the x point as qi, and Tu is located at the x point. \n",
" \"fluxlim\": False, # WIP - do not use. if true, turns on a flux limiter with coefficient alpha\n",
"}\n",
"\n",
"#set general run parameters\n",
Expand All @@ -169,7 +168,6 @@
" \"cz0\" : 0.02, # Impurity fraction (if constant)\n",
" \n",
" \"Lfunc\": LfuncKallenbachAr, # impurity cooling function. More are available in AnalyticCoolingCurves.py\n",
" \"alpha\": 1000, # WIP - do not use. flux limiting alpha. Only matters if fluxlim is true\n",
"}\n"
]
},
Expand Down
2 changes: 0 additions & 2 deletions Ex. 4 - Front movement sensitivity.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,6 @@
"radios_default = {\n",
" \"ionisation\": False, # WIP - do not use. in development\n",
" \"upstreamGrid\": True, # SET TRUE if including domain above xpoint. if true, source of divertor heat flux comes from radial transport upstream, and Tu is at the midplane. If false, heat flux simply enters at the x point as qi, and Tu is located at the x point. \n",
" \"fluxlim\": False, # WIP - do not use. if true, turns on a flux limiter with coefficient alpha\n",
"}\n",
"\n",
"#set general run parameters\n",
Expand All @@ -165,7 +164,6 @@
" \"cz0\" : 0.02, # Impurity fraction (if constant)\n",
" \n",
" \"Lfunc\": LfuncKallenbachAr, # impurity cooling function. More are available in AnalyticCoolingCurves.py\n",
" \"alpha\": 1000, # WIP - do not use. flux limiting alpha. Only matters if fluxlim is true\n",
"}\n"
]
},
Expand Down
2 changes: 0 additions & 2 deletions Ex. 5 - 2D parameter space scan.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,6 @@
"radios_default = {\n",
" \"ionisation\": False, # WIP - do not use. in development\n",
" \"upstreamGrid\": True, # SET TRUE if including domain above xpoint. if true, source of divertor heat flux comes from radial transport upstream, and Tu is at the midplane. If false, heat flux simply enters at the x point as qi, and Tu is located at the x point. \n",
" \"fluxlim\": False, # WIP - do not use. if true, turns on a flux limiter with coefficient alpha\n",
"}\n",
"\n",
"#set general run parameters\n",
Expand All @@ -175,7 +174,6 @@
" \"cz0\" : 0.02, # Impurity fraction (if constant)\n",
" \n",
" \"Lfunc\": LfuncKallenbachAr, # impurity cooling function. More are available in AnalyticCoolingCurves.py\n",
" \"alpha\": 1000, # WIP - do not use. flux limiting alpha. Only matters if fluxlim is true\n",
"}\n"
]
},
Expand Down
22 changes: 2 additions & 20 deletions src/fusiondls/Iterate.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,9 @@ def LengFunc(s, y, si, st):
"""

nu, Tu, cz, qradial = st.nu, st.Tu, st.cz, st.qradial
kappa0, qpllu0, alpha, radios, S, B, Xpoint, Lfunc = (
kappa0, qpllu0, radios, S, B, Xpoint, Lfunc = (
si.kappa0,
si.qpllu0,
si.alpha,
si.radios,
si.S,
si.B,
Expand Down Expand Up @@ -69,25 +68,8 @@ def LengFunc(s, y, si, st):

# working on neutral/ionisation model
# dqoverBds = dqoverBds/fieldValue
dtds = qoverB * fieldValue / (kappa0 * T ** (5 / 2))

# Flux limiter
dtds = 0
if radios["fluxlim"]:
dtds = (
qoverB
* fieldValue
/ (
kappa0 * T ** (5 / 2)
- qoverB
* fieldValue
* kappa0
* T ** (1 / 2)
/ (alpha * ne * np.sqrt(9e-31))
)
)
else:
dtds = qoverB * fieldValue / (kappa0 * T ** (5 / 2))
# return gradient of q and T
return [dqoverBds, dtds]


Expand Down
4 changes: 1 addition & 3 deletions src/fusiondls/LRBv21.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,6 @@ class SimulationInputs:
Cooling curve function, can be LfuncKallenbachx where x is Ne, Ar or N.
Lz : list
Cooling curve data: [0] contains temperatures in [eV] and [1] the corresponding cooling values in [W/m^3]
alpha : float
Heat flux limiter (WIP do not use)

Settings
~~~~~~~~~
Expand All @@ -170,7 +168,7 @@ class SimulationInputs:
timeout : float
Maximum number of iterations for each loop before warning or error
radios : dict
Contains flags for ionisation (WIP do not use), upstreamGrid (allows full flux tube) and fluxlim (WIP do not use)
Contains flags for ionisation (WIP do not use), upstreamGrid (allows full flux tube)

Geometry
~~~~~~~~~
Expand Down
5 changes: 2 additions & 3 deletions tests/test_analytic.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,15 @@ def test_analytic():
eqb = file_read(filename)
d = eqb["V10"]["ou"]

radios = {"ionisation": False, "upstreamGrid": True, "fluxlim": False}
radios = {"ionisation": False, "upstreamGrid": True}
constants = {
"gamma_sheath": 7,
"Tt": 1,
"qpllu0": 4e8,
"nu": 1e20,
"nu0": 1e20,
"cz0": 0.02,
"Lfunc": LfuncN,
"alpha": 1000,
"Lfunc": LfuncN
}

s_parallel = np.linspace(0, d["S"][d["Xpoint"] - 1], 30)
Expand Down

0 comments on commit 91d003b

Please sign in to comment.