twopointflux3d_ESAtmo3D_t Function

public pure function twopointflux3d_ESAtmo3D_t(this, sL, sR) result(flux)

Souza et al. (2023, JAMES) entropy-conservative two-point flux for compressible Euler in (rho, rhov, rhotheta) variables with p = p0(rhoRd*theta/p0)^gamma.

f_d(rho) = _log * f_d(rhov_i) = log * * +

* delta f_d(rhoth) = _log * f_d(Phi) = 0 (geopotential is carried, not advected)

_log is the logarithmic mean (see log_mean), the arithmetic mean. Pressure here is the total pressure; gravity is handled by the Souza non-conservative term in SourceMethod, not by a flux split.

Arguments

TypeIntentOptionalAttributesName
class(ESAtmo3D_t), intent(in) :: this
real(kind=prec), intent(in) :: sL(1:this%nvar)
real(kind=prec), intent(in) :: sR(1:this%nvar)

Return Value real(kind=prec)(1:this%nvar,1:3)


Calls

proc~~twopointflux3d_esatmo3d_t~~CallsGraph proc~twopointflux3d_esatmo3d_t twopointflux3d_ESAtmo3D_t proc~log_mean~2 log_mean proc~twopointflux3d_esatmo3d_t->proc~log_mean~2

Contents


Source Code

  pure function twopointflux3d_ESAtmo3D_t(this,sL,sR) result(flux)
    !! Souza et al. (2023, JAMES) entropy-conservative two-point flux for
    !! compressible Euler in (rho, rho*v, rho*theta) variables with
    !! p = p0*(rho*Rd*theta/p0)^gamma.
    !!
    !!   f_d(rho)     = <rho>_log * <v_d>
    !!   f_d(rho*v_i) = <rho>_log * <v_i> * <v_d> + <p> * delta_{id}
    !!   f_d(rho*th)  = <rho*theta>_log * <v_d>
    !!   f_d(Phi)     = 0  (geopotential is carried, not advected)
    !!
    !! <a>_log is the logarithmic mean (see log_mean), <a> the arithmetic
    !! mean. Pressure here is the *total* pressure; gravity is handled by
    !! the Souza non-conservative term in SourceMethod, not by a flux split.
    class(ESAtmo3D_t),intent(in) :: this
    real(prec),intent(in) :: sL(1:this%nvar)
    real(prec),intent(in) :: sR(1:this%nvar)
    real(prec) :: flux(1:this%nvar,1:3)
    ! Local
    real(prec) :: rhoL,uL,vL,wL,thetaL,pL,rthL
    real(prec) :: rhoR,uR,vR,wR,thetaR,pR,rthR
    real(prec) :: rho_log,rth_log,u_avg,v_avg,w_avg,p_avg
    real(prec) :: gamma

    gamma = this%cp/this%cv

    ! Left primitive variables
    rhoL = sL(1)
    rthL = sL(5)
    thetaL = rthL/rhoL
    uL = sL(2)/rhoL
    vL = sL(3)/rhoL
    wL = sL(4)/rhoL
    pL = this%p0*(rhoL*this%Rd*thetaL/this%p0)**gamma

    ! Right primitive variables
    rhoR = sR(1)
    rthR = sR(5)
    thetaR = rthR/rhoR
    uR = sR(2)/rhoR
    vR = sR(3)/rhoR
    wR = sR(4)/rhoR
    pR = this%p0*(rhoR*this%Rd*thetaR/this%p0)**gamma

    ! Logarithmic and arithmetic means
    rho_log = log_mean(rhoL,rhoR)
    rth_log = log_mean(rthL,rthR)
    u_avg = 0.5_prec*(uL+uR)
    v_avg = 0.5_prec*(vL+vR)
    w_avg = 0.5_prec*(wL+wR)
    p_avg = 0.5_prec*(pL+pR)

    ! x-direction flux (d=1)
    flux(1,1) = rho_log*u_avg
    flux(2,1) = rho_log*u_avg*u_avg+p_avg
    flux(3,1) = rho_log*v_avg*u_avg
    flux(4,1) = rho_log*w_avg*u_avg
    flux(5,1) = rth_log*u_avg
    flux(6,1) = 0.0_prec

    ! y-direction flux (d=2)
    flux(1,2) = rho_log*v_avg
    flux(2,2) = rho_log*u_avg*v_avg
    flux(3,2) = rho_log*v_avg*v_avg+p_avg
    flux(4,2) = rho_log*w_avg*v_avg
    flux(5,2) = rth_log*v_avg
    flux(6,2) = 0.0_prec

    ! z-direction flux (d=3)
    flux(1,3) = rho_log*w_avg
    flux(2,3) = rho_log*u_avg*w_avg
    flux(3,3) = rho_log*v_avg*w_avg
    flux(4,3) = rho_log*w_avg*w_avg+p_avg
    flux(5,3) = rth_log*w_avg
    flux(6,3) = 0.0_prec

  endfunction twopointflux3d_ESAtmo3D_t