Skip to content
Snippets Groups Projects

Implement regularizations for Euler eq

Closed Florian Atteneder requested to merge fa/euler-new-regulates into main
3 files
+ 214
25
Compare changes
  • Side-by-side
  • Inline
Files
3
+ 68
0
@@ -448,3 +448,71 @@ end
@returns nflx_rho, nflx_qx, nflx_qy, nflx_E
end
# TODO Rename all methods accordingly
const mono_ldg_nflux = ldg_nflux
const mono_ldg_bdryllf = ldg_bdryllf
const mono_av_flux = av_flux
const mono_av_nflux = av_nflux
const mono_bdryllf = bdryllf
#######################################################################
# Navier-Stokes regularization #
#######################################################################
@with_signature [legacy=false] function navierstokes_u(equation::EulerEquation)
@accepts rho, q
u = q/rho
@returns u
end
@with_signature [legacy=false] function navierstokes_ldg_nflux(eq::EulerEquation)
@accepts u
@accepts [bdry] bdry_u
@accepts [bdry] nx
nflx_u = 0.5 * nx * (u + bdry_u)
@returns [bdry] nflx_u
end
@with_signature [legacy=false] function navierstokes_ldg_bdryllf(eq::EulerEquation)
@accepts u
@accepts [bdry] nx
# set exterior state to 0 according to stability analysis
# see dg-notes/tex/evm.pdf for reasoning
nflx_u = nx * u
@returns [bdry] nflx_u
end
@with_signature [legacy=false] function navierstokes_av_flux(eq::EulerEquation)
@accepts flx_q, flx_E, ldg_u, u, smoothed_mu
# μ = λ, κ = 0
G = 4 * smoothed_mu * ldg_u + smoothed_mu * ldg_u
flx_q += G
flx_E += G * u
@returns flx_q, flx_E
end
@with_signature [legacy=false] function navierstokes_av_nflux(eq::EulerEquation)
@accepts ldg_u, u, smoothed_mu
@accepts [bdry] bdry_ldg_u, bdry_u, bdry_smoothed_mu
@accepts [bdry] nflx_q, nflx_E, nx
G = 4 * smoothed_mu * ldg_u + smoothed_mu * ldg_u
bdry_G = 4 * bdry_smoothed_mu * bdry_ldg_u + bdry_smoothed_mu * bdry_ldg_u
nflx = nx*G
bdry_nflx = nx*bdry_G
nflx_q += 0.5 * (nflx + bdry_nflx)
nflx = nx*G*u
bdry_nflx = nx*bdry_G*bdry_u
nflx_E += 0.5 * (nflx + bdry_nflx)
@returns [bdry] nflx_q, nflx_E
end
Loading