Module with finite volume methods for fluxes
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=dp), | intent(in) | :: | u(nw_phys) | |||
| real(kind=dp), | intent(in) | :: | x(1:ndim) | |||
| integer, | intent(in) | :: | flux_dim |
Modified implementation of Koren limiter, to avoid division and the min/max functions, which can be problematic / expensive. In most literature, you have r = a / b (ratio of gradients). Then the limiter phi(r) is multiplied with b. With this implementation, you get phi(r) * b
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=dp), | intent(in) | :: | a |
Density gradient (numerator) |
||
| real(kind=dp), | intent(in) | :: | b |
Density gradient (denominator) |
Monotonised central-difference limiter with tunable beta (AMRVAC's mcbeta; beta=2 recovers the classic MC limiter, van Leer 1979)
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=dp), | intent(in) | :: | a | |||
| real(kind=dp), | intent(in) | :: | b |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=dp), | intent(in) | :: | a | |||
| real(kind=dp), | intent(in) | :: | b |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=dp), | intent(in) | :: | a | |||
| real(kind=dp), | intent(in) | :: | b |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| double precision, | intent(in) | :: | qdt | |||
| double precision, | intent(in) | :: | dtfactor | |||
| integer, | intent(in) | :: | ixImin1 | |||
| integer, | intent(in) | :: | ixImin2 | |||
| integer, | intent(in) | :: | ixImin3 | |||
| integer, | intent(in) | :: | ixImax1 | |||
| integer, | intent(in) | :: | ixImax2 | |||
| integer, | intent(in) | :: | ixImax3 | |||
| integer, | intent(in) | :: | ixOmin1 | |||
| integer, | intent(in) | :: | ixOmin2 | |||
| integer, | intent(in) | :: | ixOmin3 | |||
| integer, | intent(in) | :: | ixOmax1 | |||
| integer, | intent(in) | :: | ixOmax2 | |||
| integer, | intent(in) | :: | ixOmax3 | |||
| integer, | intent(in) | :: | idimsmin | |||
| integer, | intent(in) | :: | idimsmax | |||
| double precision, | intent(in) | :: | qtC | |||
| type(block_grid_t) | :: | bga | ||||
| double precision, | intent(in) | :: | qt | |||
| type(block_grid_t) | :: | bgb |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=dp), | intent(in) | :: | qdt | |||
| real(kind=dp), | intent(in) | :: | dtfactor | |||
| real(kind=dp), | intent(in) | :: | qtC | |||
| real(kind=dp), | intent(in) | :: | wCTprim1(nw_phys,3) | |||
| real(kind=dp), | intent(in) | :: | wCTprim2(nw_phys,3) | |||
| real(kind=dp), | intent(in) | :: | wCTprim3(nw_phys,3) | |||
| real(kind=dp), | intent(in) | :: | qt | |||
| real(kind=dp), | intent(inout) | :: | wnew(nw_phys) | |||
| real(kind=dp), | intent(in) | :: | x(1:ndim) | |||
| real(kind=dp), | intent(in) | :: | dx(1:ndim) | |||
| logical, | intent(in) | :: | qsourcesplit |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=dp), | intent(in) | :: | qdt | |||
| real(kind=dp), | intent(in) | :: | dtfactor | |||
| real(kind=dp), | intent(in) | :: | qtC | |||
| real(kind=dp), | intent(in) | :: | wCT(nw_phys) | |||
| real(kind=dp), | intent(in) | :: | wCTprim(nw_phys) | |||
| real(kind=dp), | intent(in) | :: | qt | |||
| real(kind=dp), | intent(inout) | :: | wnew(nw_phys) | |||
| real(kind=dp), | intent(in) | :: | x(1:ndim) | |||
| real(kind=dp), | intent(in) | :: | dr(ndim) | |||
| logical, | intent(in) | :: | qsourcesplit |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=dp), | intent(in) | :: | qdt | |||
| real(kind=dp), | intent(in) | :: | dtfactor | |||
| real(kind=dp), | intent(in) | :: | qtC | |||
| real(kind=dp), | intent(in) | :: | wCTprim(nw_phys,5) | |||
| real(kind=dp), | intent(in) | :: | qt | |||
| real(kind=dp), | intent(inout) | :: | wnew(nw_phys) | |||
| real(kind=dp), | intent(in) | :: | x(1:ndim) | |||
| real(kind=dp), | intent(in) | :: | dx(1:ndim) | |||
| integer, | intent(in) | :: | idir | |||
| logical, | intent(in) | :: | qsourcesplit |
Wave speed estimates: min/max acoustic bounds (Davis 1988) Reference: Toro 2010, Chapter 10.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=dp), | intent(in) | :: | uL(nw_phys) | |||
| real(kind=dp), | intent(in) | :: | uR(nw_phys) | |||
| real(kind=dp), | intent(in) | :: | xC(ndim) | |||
| integer, | intent(in) | :: | flux_dim | |||
| real(kind=dp), | intent(out) | :: | wL | |||
| real(kind=dp), | intent(out) | :: | wR |
Wave speed estimates for HLL/HLLC using Toro (2010) PVRS pressure estimate Implements Eq. (10.67)-(10.69)
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=dp), | intent(in) | :: | uL(nw_phys) | |||
| real(kind=dp), | intent(in) | :: | uR(nw_phys) | |||
| real(kind=dp), | intent(in) | :: | xC(ndim) | |||
| integer, | intent(in) | :: | flux_dim | |||
| real(kind=dp), | intent(out) | :: | sL | |||
| real(kind=dp), | intent(out) | :: | sR |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| double precision, | intent(in) | :: | qdt | |||
| double precision, | intent(in) | :: | dtfactor | |||
| integer, | intent(in) | :: | ixImin1 | |||
| integer, | intent(in) | :: | ixImin2 | |||
| integer, | intent(in) | :: | ixImin3 | |||
| integer, | intent(in) | :: | ixImax1 | |||
| integer, | intent(in) | :: | ixImax2 | |||
| integer, | intent(in) | :: | ixImax3 | |||
| integer, | intent(in) | :: | ixOmin1 | |||
| integer, | intent(in) | :: | ixOmin2 | |||
| integer, | intent(in) | :: | ixOmin3 | |||
| integer, | intent(in) | :: | ixOmax1 | |||
| integer, | intent(in) | :: | ixOmax2 | |||
| integer, | intent(in) | :: | ixOmax3 | |||
| integer, | intent(in) | :: | idimsmin | |||
| integer, | intent(in) | :: | idimsmax | |||
| double precision, | intent(in) | :: | qtC | |||
| type(block_grid_t) | :: | bga | ||||
| double precision, | intent(in) | :: | qt | |||
| type(block_grid_t) | :: | bgb |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| double precision, | intent(in) | :: | qdt | |||
| double precision, | intent(in) | :: | dtfactor | |||
| integer, | intent(in) | :: | ixImin1 | |||
| integer, | intent(in) | :: | ixImin2 | |||
| integer, | intent(in) | :: | ixImin3 | |||
| integer, | intent(in) | :: | ixImax1 | |||
| integer, | intent(in) | :: | ixImax2 | |||
| integer, | intent(in) | :: | ixImax3 | |||
| integer, | intent(in) | :: | ixOmin1 | |||
| integer, | intent(in) | :: | ixOmin2 | |||
| integer, | intent(in) | :: | ixOmin3 | |||
| integer, | intent(in) | :: | ixOmax1 | |||
| integer, | intent(in) | :: | ixOmax2 | |||
| integer, | intent(in) | :: | ixOmax3 | |||
| integer, | intent(in) | :: | idimsmin | |||
| integer, | intent(in) | :: | idimsmax | |||
| double precision, | intent(in) | :: | qtC | |||
| type(block_grid_t) | :: | bga | ||||
| double precision, | intent(in) | :: | qt | |||
| type(block_grid_t) | :: | bgb |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| double precision, | intent(in) | :: | qdt | |||
| double precision, | intent(in) | :: | dtfactor | |||
| integer, | intent(in) | :: | ixImin1 | |||
| integer, | intent(in) | :: | ixImin2 | |||
| integer, | intent(in) | :: | ixImin3 | |||
| integer, | intent(in) | :: | ixImax1 | |||
| integer, | intent(in) | :: | ixImax2 | |||
| integer, | intent(in) | :: | ixImax3 | |||
| integer, | intent(in) | :: | ixOmin1 | |||
| integer, | intent(in) | :: | ixOmin2 | |||
| integer, | intent(in) | :: | ixOmin3 | |||
| integer, | intent(in) | :: | ixOmax1 | |||
| integer, | intent(in) | :: | ixOmax2 | |||
| integer, | intent(in) | :: | ixOmax3 | |||
| integer, | intent(in) | :: | idimsmin | |||
| integer, | intent(in) | :: | idimsmax | |||
| double precision, | intent(in) | :: | qtC | |||
| type(block_grid_t) | :: | bga | ||||
| double precision, | intent(in) | :: | qt | |||
| type(block_grid_t) | :: | bgb |
Make a reconstructed primitive face state admissible before it is handed to the Riemann solver. Genuinely empty by default: a physics module without auxiliary variables and without a floor of its own needs nothing here, and the call is inlined away.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=dp), | intent(inout) | :: | u(nw_phys) |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=dp), | intent(in) | :: | u(nw_phys) | |||
| real(kind=dp), | intent(in) | :: | xC(ndim) | |||
| integer, | intent(in) | :: | flux_dim | |||
| real(kind=dp), | intent(out) | :: | flux(nw_flux) |
MUSCL reconstruction in primitive variables for two faces using a 5-point stencil. Returns uL(:,iface), uR(:,iface) for iface=1 (between cells 2-3) and iface=2 (between 3-4).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=dp), | intent(in) | :: | u(nw_phys,5) | |||
| integer, | intent(in) | :: | typelim | |||
| real(kind=dp), | intent(out) | :: | uL(nw_phys,2) | |||
| real(kind=dp), | intent(out) | :: | uR(nw_phys,2) |
MUSCL (primitive-variable) reconstruction with slope limiter; HLL two-wave approximate Riemann flux at faces. Uses estimated left/right signal speeds (Davis (1988)) for less diffusion than LLF, no contact resolution.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=dp), | intent(in) | :: | u(nw_phys,5) | |||
| real(kind=dp), | intent(in) | :: | xlocC(1:ndim,2) | |||
| integer, | intent(in) | :: | flux_dim | |||
| real(kind=dp), | intent(out) | :: | flux(nw_flux,2) | |||
| integer, | intent(in) | :: | typelim |
MUSCL (primitive-variable) reconstruction with slope limiter; HLLC approximate Riemann flux at faces. Restores the contact wave (and shear in Euler/HD), typically sharper than HLL for similar cost.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=dp), | intent(in) | :: | u(nw_phys,5) | |||
| real(kind=dp), | intent(in) | :: | xlocC(1:ndim,2) | |||
| integer, | intent(in) | :: | flux_dim | |||
| real(kind=dp), | intent(out) | :: | flux(nw_flux,2) | |||
| integer, | intent(in) | :: | typelim |
MUSCL (primitive-variable) reconstruction with slope limiter; LLF/Rusanov numerical flux at faces. Robust and diffusive; uses local max wavespeed for upwinding. Adaptive diffusion (Rempel et al. 2009) is compiled in only when FLUX_AD is defined.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=dp), | intent(in) | :: | u(nw_phys,5) | |||
| real(kind=dp), | intent(in) | :: | xlocC(1:ndim,2) | |||
| integer, | intent(in) | :: | flux_dim | |||
| real(kind=dp), | intent(out) | :: | flux(nw_flux,2) | |||
| integer, | intent(in) | :: | typelim |
One-face HLL numerical flux from primitive L/R states. takes flux_type(flux_dim,nw_flux) into account (fallback to LLF for selected variables)
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=dp), | intent(inout) | :: | uL(nw_phys) | |||
| real(kind=dp), | intent(inout) | :: | uR(nw_phys) | |||
| real(kind=dp), | intent(in) | :: | xC(ndim) | |||
| integer, | intent(in) | :: | flux_dim | |||
| real(kind=dp), | intent(out) | :: | F(nw_flux) |
One-face HLLC numerical flux from primitive L/R states (HD only). Uses scalar pressure assumption; not valid for MHD (use HLLD instead). Reference: Toro (2010), chapter 10 (Variant 2) does not yet take flux_type(flux_dim,nw_flux) into account
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=dp), | intent(inout) | :: | uL(nw_phys) | |||
| real(kind=dp), | intent(inout) | :: | uR(nw_phys) | |||
| real(kind=dp), | intent(in) | :: | xC(ndim) | |||
| integer, | intent(in) | :: | flux_dim | |||
| real(kind=dp), | intent(out) | :: | F(nw_flux) |
One-face LLF/Rusanov numerical flux from primitive L/R states. phi(nw_flux) is the adaptive-diffusion reduction factor; only present when FLUX_AD is defined.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=dp), | intent(inout) | :: | uL(nw_phys) | |||
| real(kind=dp), | intent(inout) | :: | uR(nw_phys) | |||
| real(kind=dp), | intent(in) | :: | xC(ndim) | |||
| integer, | intent(in) | :: | flux_dim | |||
| real(kind=dp), | intent(out) | :: | F(nw_flux) | |||
| real(kind=dp), | intent(in) | :: | phi(nw_flux) |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=dp), | intent(inout) | :: | u(nw_phys) |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=dp), | intent(inout) | :: | u(nw_phys) |