Conserved state Q = (rho, rhou, rhov, E). p = (gam-1)(E - 0.5rho(u^2 + v^2)) F = (rho u, rho u^2 + p, rho u v, u(E+p)) G = (rho v, rho u v, rho v^2+p, v(E+p))
Global maximum signal speed max_{i,j}( max(|u|,|v|) + c ) over interior cells.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(solver_state_2d_t), | intent(in) | :: | state |
Extract primitives (rho, u, v, p) from a 2D conserved state.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=wp), | intent(in) | :: | q(:) | |||
| real(kind=wp), | intent(in) | :: | gam | |||
| real(kind=wp), | intent(out) | :: | rho | |||
| real(kind=wp), | intent(out) | :: | u | |||
| real(kind=wp), | intent(out) | :: | v | |||
| real(kind=wp), | intent(out) | :: | p |
Compute both directional flux vectors F (x) and G (y) for state Q.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=wp), | intent(in) | :: | q(:) | |||
| real(kind=wp), | intent(out) | :: | fx(:) | |||
| real(kind=wp), | intent(out) | :: | gy(:) | |||
| real(kind=wp), | intent(in) | :: | gam |
Right-eigenvector matrix K and its inverse for the flux Jacobian in
direction dir (1 = x: eigenvalues u-c,u,u,u+c; 2 = y: v-c,v,v,v+c).
Columns of K, conserved variables Q=(rho,rho u,rho v,E):
x: [1, u-c, v, H-u c] [1, u, v, q2] [0, 0, 1, v] [1, u+c, v, H+u c]
y: [1, u, v-c, H-v c] [1, u, v, q2] [0, 1, 0, u] [1, u, v+c, H+v c]
where H=(E+p)/rho, q2=0.5*(u^2+v^2). K^{-1} via LAPACK getrf/getri.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=wp), | intent(in) | :: | q(neq2d) | |||
| integer, | intent(in) | :: | dir | |||
| real(kind=wp), | intent(out) | :: | r_mat(neq2d,neq2d) | |||
| real(kind=wp), | intent(out) | :: | r_inv(neq2d,neq2d) | |||
| real(kind=wp), | intent(in) | :: | gam |
Inverse of a 4x4 matrix via LAPACK LU (dgetrf) + inversion (dgetri).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=wp), | intent(in) | :: | a(4,4) | |||
| real(kind=wp), | intent(out) | :: | ainv(4,4) |
Return the directional Euler flux: fx for dir==1, gy for dir==2.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=wp), | intent(in) | :: | q(neq2d) | |||
| integer, | intent(in) | :: | dir | |||
| real(kind=wp), | intent(in) | :: | gam | |||
| real(kind=wp), | intent(out) | :: | f(neq2d) |
Lax-Friedrichs directional splitting: F± = ½(F ± α Q), α = |vel_dir| + c. Guarantees fp + fm == F exactly (same α applied to both halves).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=wp), | intent(in) | :: | q(neq2d) | |||
| integer, | intent(in) | :: | dir | |||
| real(kind=wp), | intent(in) | :: | gam | |||
| real(kind=wp), | intent(out) | :: | fp(neq2d) | |||
| real(kind=wp), | intent(out) | :: | fm(neq2d) |
Steger-Warming splitting: F± = R·diag(λ±)·R⁻¹·Q. Exact for the homogeneous Euler flux (F = A·Q); fp+fm == F to machine precision. Eigenvalue order: x → (u-c, u, u, u+c); y → (v-c, v, v, v+c). NOT pure: calls compute_eigensystem_2d which uses LAPACK.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=wp), | intent(in) | :: | q(neq2d) | |||
| integer, | intent(in) | :: | dir | |||
| real(kind=wp), | intent(in) | :: | gam | |||
| real(kind=wp), | intent(out) | :: | fp(neq2d) | |||
| real(kind=wp), | intent(out) | :: | fm(neq2d) |
van Leer splitting: Mach-split mass flux carrying transverse momentum.
Pressure split: p± = p(M±1)²(2∓M)/4 (subsonic); supersonic branches are
fully upwind (fp==F, fm==0 for M≥1; fp==0, fm==F for M≤-1).
Uses in (normal) and it (transverse) momentum indices to handle both
directions uniformly.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=wp), | intent(in) | :: | q(neq2d) | |||
| integer, | intent(in) | :: | dir | |||
| real(kind=wp), | intent(in) | :: | gam | |||
| real(kind=wp), | intent(out) | :: | fp(neq2d) | |||
| real(kind=wp), | intent(out) | :: | fm(neq2d) |
Contravariant flux-vector splitting along a general metric/area vector
smetric = S_xi or S_eta (size 2). Splits the CONTRAVARIANT flux
Fhat = smetric(1)F + smetric(2)G (F,G physical Euler fluxes)
into fp/fm with eigenvalues U, U, U +- c|S| where the contravariant velocity
is U = smetric(1)u + smetric(2)v and |S| = norm2(smetric).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=wp), | intent(in) | :: | q(neq2d) | |||
| real(kind=wp), | intent(in) | :: | smetric(2) | |||
| character(len=*), | intent(in) | :: | scheme | |||
| real(kind=wp), | intent(in) | :: | gam | |||
| real(kind=wp), | intent(out) | :: | fp(neq2d) | |||
| real(kind=wp), | intent(out) | :: | fm(neq2d) |
Dispatch to one of the three FVS routines by scheme name. dir=1 → x-splitting (uses F, eigenvalues u±c); dir=2 → y-splitting (uses G, v±c). scheme: 'lax_friedrichs' | 'steger_warming' | 'van_leer'. NOT pure: may call steger_warming_split_2d (which calls LAPACK).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=wp), | intent(in) | :: | q(neq2d) | |||
| integer, | intent(in) | :: | dir | |||
| character(len=*), | intent(in) | :: | scheme | |||
| real(kind=wp), | intent(in) | :: | gam | |||
| real(kind=wp), | intent(out) | :: | fp(neq2d) | |||
| real(kind=wp), | intent(out) | :: | fm(neq2d) |