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

specialize timespeed computation based on equations

parent 6c245a13
No related branches found
No related tags found
1 merge request!101Refactor GRHD project
This commit is part of merge request !101. Comments created here will be created in the context of that merge request.
......@@ -3,9 +3,8 @@
#######################################################################
function compute_maxspeed(mesh, equation)
function get_maxspeed(mesh, equation)
@unpack max_v = get_static_variables(mesh.cache)
broadcast_volume!(maxspeed, equation, mesh)
vmax = maximum(abs, max_v)
vmax_limit = 0.99999999999
if vmax > vmax_limit
......@@ -15,9 +14,16 @@ function compute_maxspeed(mesh, equation)
return vmax
end
function compute_maxspeed(::Project{:spherical1d}, equation, mesh)
broadcast_volume!(maxspeed, equation, mesh)
end
function compute_maxspeed(::Project{:rescaled_spherical1d}, equation, mesh)
broadcast_volume!(maxspeed_rescaled_spherical1d, equation, mesh)
end
function timestep(mesh, P::Project, hrsc::Maybe{HRSC.AbstractHRSC})
vmax = compute_maxspeed(mesh, P.equation)
compute_maxspeed(P, P.equation, mesh)
vmax = get_maxspeed(mesh, P.equation)
dl = min_grid_spacing(mesh)
dt = dl / (vmax * dtfactor(mesh))
return dt
......@@ -30,7 +36,8 @@ function timestep(mesh, P::Project, hrsc::HRSC.AbstractArtificialViscosity)
@unpack cache = mesh
@unpack equation = P
vmax = compute_maxspeed(mesh, P.equation)
compute_maxspeed(P, P.equation, mesh)
vmax = get_maxspeed(mesh, P.equation)
@unpack mu = get_static_variables
mumax = maximum(abs, mu)
......
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