Skip to content
Snippets Groups Projects
Verified Commit 8fb20557 authored by Florian Atteneder's avatar Florian Atteneder
Browse files

implement av_recompute_substeps

parent c0b2beb1
No related branches found
No related tags found
1 merge request!149SRHD: Update cons2prim
Pipeline #6582 failed
......@@ -8,8 +8,11 @@ function make_callback(env, P::Project, isperiodic)
cbfn_hrsc(u, t) = callback_hrsc(u, t, env, P, isperiodic, P.hrsc, env.mesh)
cb_hrsc = FunctionCallback(cbfn_hrsc,
CallbackTiming(every_iteration=1,every_dt=0))
callbackset = CallbackSet(cb_equation, cb_tci, cb_hrsc)
return callbackset
if P.prms.av_recompute_substeps && P.hrsc isa AbstractArtificialViscosity
return CallbackSet(cb_equation, cb_tci), CallbackSet(cb_hrsc)
else
return CallbackSet(cb_equation, cb_tci, cb_hrsc), nothing
end
end
......@@ -129,6 +132,7 @@ end
function callback_hrsc(state_u, state_t, env, P, isperiodic, hrsc::HRSC.SmoothedArtificialViscosity, mesh)
wrap_dynamic_variables!(env.cache, state_u)
@unpack cache = env
@unpack mu, mu_m1 = get_cell_variables(cache)
@unpack smoothed_mu = get_static_variables(cache)
......
......@@ -9,8 +9,10 @@ function Project(env::Environment, prms, mesh::Mesh1d)
bernstein = BernsteinReconstruction(mesh)
av_regularization = Symbol(prms["SRHD"]["av_regularization"])
av_drag = prms["SRHD"]["av_drag"]
av_recompute_substeps = prms["SRHD"]["av_recompute_substeps"]
K, Γ = prms["SRHD"]["c2p_cold_eos_parameters"]
fixedprms = (; av_regularization, av_drag, id_smooth=prms["SRHD"]["id_smooth"],
fixedprms = (; av_regularization, av_drag, av_recompute_substeps,
id_smooth=prms["SRHD"]["id_smooth"],
bernstein, hrsc, slope_limiter_method, slope_limiter_tvb_M)
# construct Project
......@@ -41,9 +43,10 @@ function Project(env::Environment, prms, mesh::Mesh1d)
initialdata!(env, P, prms["SRHD"])
# setup callbacks
projectcb = make_callback(env, P, isperiodic(mesh))
cbs, cbs_substep = make_callback(env, P, isperiodic(mesh))
append!(env.callbacks, CallbackSet(projectcb.callbacks...))
append!(env.callbacks, cbs)
append!(env.callbacks_substep, cbs_substep)
return P, (bdryconds, ldg_bdryconds, av_bdryconds)
end
......
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