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

get sod shock tube with EV going

parent 51bfd769
No related branches found
No related tags found
2 merge requests!52improvements to ScalarEq, EulerEq, SRHD,!51Draft: Fa/wip/srhd+av
Pipeline #5801 failed
......@@ -110,11 +110,16 @@ end
function callback_hrsc(state_u, state_t, env, P, isperiodic, hrsc::HRSC.EntropyViscosity, ::Mesh1d)
@unpack cache, mesh = env
@unpack rho = get_dynamic_variables(cache)
@unpack S, Sm1, flx_S, flx_Sm1 = get_static_variables(cache)
@unpack mu, max_v = get_cell_variables(cache)
@unpack t, tm1 = get_global_variables(cache)
@unpack cache, mesh = env
@unpack rho = get_dynamic_variables(cache)
@unpack S, Sm1, flx_S, flx_Sm1, v = get_static_variables(cache)
@unpack mu, max_v = get_cell_variables(cache)
@unpack t, tm1 = get_global_variables(cache)
Npts, K = layout(mesh)
mat_max_v = reshape(view(v, :), (Npts, K))
for k = 1:K
max_v[k] = maximum(view(mat_max_v, :, k))
end
HRSC.compute_viscosity!(
mu,
rho, max_v, S, Sm1, flx_S, flx_Sm1, t[1], tm1[1],
......
......@@ -82,8 +82,8 @@ end
end
@with_signature function av_flux(eq::EulerEquation2d)
@accepts flx_rho_x, ldg_rho, flx_q, ldg_q, flx_E, ldg_E, smoothed_mu
@with_signature function av_flux(eq::EulerEquation)
@accepts flx_rho, ldg_rho, flx_q, ldg_q, flx_E, ldg_E, smoothed_mu
flx_rho += smoothed_mu * ldg_rho
flx_q += smoothed_mu * ldg_q
......@@ -256,7 +256,7 @@ end
#######################################################################
@with_signature function ldg_flux(equation::EulerEquation)
@with_signature function bak_ldg_flux(equation::EulerEquation)
@accepts State(ldg_rho, ldg_q, ldg_E), rho, q, E
flx_ldg_rho, flx_ldg_q, flx_ldg_E = rho, q, E
@returns flx_ldg_rho, flx_ldg_q, flx_ldg_E
......@@ -281,7 +281,9 @@ end
end
@with_signature function av_flux(equation::EulerEquation)
# TODO Remove this together with ldg_flux, ldg_speed, av_speed when
# moving everything to the new broadcast interface
@with_signature function bak_av_flux(equation::EulerEquation)
@accepts State(ldg_rho, ldg_q, ldg_E), smoothed_mu
flx_ldg_rho, flx_ldg_q, flx_ldg_E =
smoothed_mu * ldg_rho, smoothed_mu * ldg_q, smoothed_mu * ldg_E
......
......@@ -177,15 +177,12 @@ function rhs!(env, P::Project, hrsc::HRSC.AbstractArtificialViscosity, ::Mesh1d,
@unpack nflx_rho, nflx_q, nflx_E,
nflx_ldg_rho, nflx_ldg_q, nflx_ldg_E = get_bdry_variables(cache)
TODO()
## solve auxiliary equation: q + ∂x u = 0
broadcast_volume_2!(ldg_flux, equation, mesh)
broadcast_bdry_2!(ldg_nflux, equation, mesh)
broadcast_faces_2!(ldg_nflux, equation, mesh)
# broadcast_boundaryconditions!(central_flux, ldg_bdryconds, cache, mesh, 0.0)
compute_rhs_weak_form!(ldg_rho, flx_ldg_rho, nflx_ldg_rho, mesh)
compute_rhs_weak_form!(ldg_q, flx_ldg_q, nflx_ldg_q, mesh)
compute_rhs_weak_form!(ldg_E, flx_ldg_E, nflx_ldg_E, mesh)
compute_rhs_weak_form!(ldg_rho, rho, nflx_rho, mesh)
compute_rhs_weak_form!(ldg_q, q, nflx_q, mesh)
compute_rhs_weak_form!(ldg_E, E, nflx_E, mesh)
## compute rhs of regularized equation: ∂t u + ∂x f + ∂x μ q = 0
# broadcast_volume!(av_flux, equation, cache)
......
......@@ -10,8 +10,9 @@ function Project(env::Environment, mesh::Mesh1d, prms)
hrsc = HRSC.make_HRSC(env.mesh, prms["HRSC"])
rsolver = ApproxRiemannSolver(flux, speed, equation)
ldg_rsolver, av_rsolver = if hrsc isa AbstractArtificialViscosity
ApproxRiemannSolver(ldg_flux, ldg_speed, equation),
ApproxRiemannSolver(av_flux, av_flux, equation)
nothing, nothing
# ApproxRiemannSolver(bak_ldg_flux, ldg_speed, equation),
# ApproxRiemannSolver(bak_av_flux, av_flux, equation)
else
nothing, nothing
end
......
[EquationOfState]
eos = "idealgas"
idealgas_gamma = 1.4
[EulerEq]
bc = "from_id"
id = "sod_shock_tube"
[Mesh]
range = [ -1.0, 1.0 ]
cfl = 0.5
n = 1
k = 1000
basis = "lgl"
[Output]
every_iteration = 0
aligned_ts = [ 0.1, 0.2, 0.3, 0.4, 0.5, 0.6 ]
variables = [ "rho", "q", "E", "smoothed_mu", "S", "v" ]
[Evolution]
tend = 0.6
[Log]
progress_stdout = false
[HRSC]
method = "av"
av_method = "entropy"
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