Skip to content
Snippets Groups Projects
Commit 41df2865 authored by Florian Atteneder's avatar Florian Atteneder
Browse files

GRHD: More parameters for convex hull limiter...

GRHD: More parameters for convex hull limiter (!227)

Follow up to !225

This adds two more parameters to the `GRHD` section:
- `limiter_tci_method`: the `TCI` method with which we sense smoothness of the conserved variables
- `limiter_tci_threshold`: the threshold value above an indicator value of the `TCI` triggers the limiter
parent 9a94d8cf
No related branches found
No related tags found
1 merge request!227GRHD: More parameters for convex hull limiter
Pipeline #7328 passed
......@@ -342,6 +342,19 @@ dg1d.@parameters GRHD begin
limiter_tci_log_D = false
@check limiter_tci_log_D isa Bool
"""
The TCI method with which the triggering of the limiter is controlled.
"""
limiter_tci_method = "mda"
@check limiter_tci_method in [ "mda" ]
"""
TCIs provide an indicator value in the range [0,1].
`limiter_tci_threshold` controls above which which value the limiter should activate.
"""
limiter_tci_threshold = 0.9
@check 0 < limiter_tci_threshold 1
end
......
......@@ -573,7 +573,7 @@ function callback_limiter(env, P::Project{:spherical1d}, mesh::Mesh1d{<:DGElemen
broadcast_volume!(impose_atmosphere_spherical1d, P.equation, mesh)
@unpack limiter_tci_log_D, limiter_limit_log_D = P.prms
@unpack limiter_tci_log_D, limiter_limit_log_D, limiter_tci, limiter_tci_threshold = P.prms
if limiter_tci_log_D || limiter_limit_log_D
@. log_D = log(D)
......@@ -582,13 +582,13 @@ function callback_limiter(env, P::Project{:spherical1d}, mesh::Mesh1d{<:DGElemen
K = mesh.tree.dims[1]
dg1d.enter(P.prms.workspace) do
tmp_flag = dg1d.borrow(P.prms.workspace, length(flag))
TCI.compute_indicator!(tmp_flag, limiter_tci_log_D ? log_D : D, P.tci)
TCI.compute_indicator!(tmp_flag, limiter_tci_log_D ? log_D : D, limiter_tci)
for (i,f) in enumerate(tmp_flag)
flag[i] = f > 0.9
flag[i] = f > limiter_tci_threshold
end
TCI.compute_indicator!(tmp_flag, Sr, P.tci)
TCI.compute_indicator!(tmp_flag, Sr, limiter_tci)
for (i,f) in enumerate(tmp_flag)
flag[i] = max(flag[i], f > 0.9)
flag[i] = max(flag[i], f > limiter_tci_threshold)
end
tmp_flag .= (flag .+ flag[end:-1:1])./2
flag .= tmp_flag
......
......@@ -43,6 +43,11 @@ function Project(env::Environment, prms)
limiter = prms["GRHD"]["limiter"]
limiter_limit_log_D = prms["GRHD"]["limiter_limit_log_D"]
limiter_tci_log_D = prms["GRHD"]["limiter_tci_log_D"]
limiter_tci_method = prms["GRHD"]["limiter_tci_method"]
limiter_tci_threshold = prms["GRHD"]["limiter_tci_threshold"]
limiter_tci_prms = dg1d.parameters(:TCI)
limiter_tci_prms["method"] = limiter_tci_method
limiter_tci = TCI.make_TCI(env.mesh, limiter_tci_prms)
freeze_vars = Symbol.(prms["GRHD"]["freeze_vars"])
fv_numerical_flux = prms["GRHD"]["fv_numerical_flux"]
id = prms["GRHD"]["id"]
......@@ -68,7 +73,7 @@ function Project(env::Environment, prms)
c2p_set_atmosphere_on_failure, c2p_enforce_causal_atm, c2p_enforce_atm,
av_drag, av_sensor_abslog_D, problem, freeze_vars,
V_bspline, invV_bspline, workspace, dt_min_grid_spacing,
limiter, limiter_limit_log_D, limiter_tci_log_D,
limiter, limiter_limit_log_D, limiter_tci_log_D, limiter_tci, limiter_tci_threshold,
id, bc, hrsc, fv_numerical_flux)
# construct Project
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment