SELF_ESAtmo3D_t Module

Entropy-conserving compressible Euler equations in 3-D with potential temperature formulation (FastEddy / atmospheric LES equation set).

Conservative variables:

U = [rho, rhou, rhov, rhow, rhotheta]

where theta is potential temperature.

Governing equations:

d(rho)/dt + div(rho * v) = 0 d(rhou)/dt + div(rhou * v) + dp/dx = 0 d(rhov)/dt + div(rhov * v) + dp/dy = 0 d(rhow)/dt + div(rhow * v) + dp/dz = -rho * g d(rhoth)/dt + div(rhoth * v) = 0

Equation of state (dry ideal gas):

p = p0 * (rho * Rd * theta / p0)^(cp/cv)

Two-point volume flux: Kennedy-Gruber (kinetic energy preserving)

Surface Riemann flux: Local Lax-Friedrichs (Rusanov)


Uses

  • module~~self_esatmo3d_t~~UsesGraph module~self_esatmo3d_t SELF_ESAtmo3D_t module~self_ecdgmodel3d SELF_ECDGModel3D module~self_esatmo3d_t->module~self_ecdgmodel3d module~self_mappedscalar_3d~2 SELF_MappedScalar_3D module~self_esatmo3d_t->module~self_mappedscalar_3d~2 module~self_boundaryconditions SELF_BoundaryConditions module~self_esatmo3d_t->module~self_boundaryconditions module~self_mesh SELF_Mesh module~self_esatmo3d_t->module~self_mesh module~self_ecdgmodel3d_t SELF_ECDGModel3D_t module~self_ecdgmodel3d->module~self_ecdgmodel3d_t module~self_mappedscalar_3d_t SELF_MappedScalar_3D_t module~self_mappedscalar_3d~2->module~self_mappedscalar_3d_t module~self_metadata SELF_Metadata module~self_boundaryconditions->module~self_metadata iso_c_binding iso_c_binding module~self_boundaryconditions->iso_c_binding module~self_supportroutines SELF_SupportRoutines module~self_boundaryconditions->module~self_supportroutines module~self_domaindecomposition~2 SELF_DomainDecomposition module~self_mesh->module~self_domaindecomposition~2 module~self_mesh->iso_c_binding module~self_constants SELF_Constants module~self_mesh->module~self_constants module~self_dgmodel3d SELF_DGModel3D module~self_ecdgmodel3d_t->module~self_dgmodel3d module~self_mappedtwopointvector_3d SELF_MappedTwoPointVector_3D module~self_ecdgmodel3d_t->module~self_mappedtwopointvector_3d HDF5 HDF5 module~self_metadata->HDF5 module~self_hdf5 SELF_HDF5 module~self_metadata->module~self_hdf5 module~self_domaindecomposition_t SELF_DomainDecomposition_t module~self_domaindecomposition~2->module~self_domaindecomposition_t module~self_mappedscalar_3d_t->module~self_domaindecomposition~2 module~self_mappedscalar_3d_t->iso_c_binding module~self_mappedscalar_3d_t->module~self_constants module~self_mesh_3d SELF_Mesh_3D module~self_mappedscalar_3d_t->module~self_mesh_3d module~self_geometry_3d SELF_Geometry_3D module~self_mappedscalar_3d_t->module~self_geometry_3d FEQParse FEQParse module~self_mappedscalar_3d_t->FEQParse module~self_scalar_3d~2 SELF_Scalar_3D module~self_mappedscalar_3d_t->module~self_scalar_3d~2 module~self_lagrange~3 SELF_Lagrange module~self_mappedscalar_3d_t->module~self_lagrange~3 module~self_tensor_3d~2 SELF_Tensor_3D module~self_mappedscalar_3d_t->module~self_tensor_3d~2 module~self_supportroutines->module~self_constants iso_fortran_env iso_fortran_env module~self_supportroutines->iso_fortran_env module~self_constants->iso_c_binding module~self_constants->iso_fortran_env module~self_dgmodel3d_t SELF_DGModel3D_t module~self_dgmodel3d->module~self_dgmodel3d_t module~self_mesh_3d_t SELF_Mesh_3D_t module~self_mesh_3d->module~self_mesh_3d_t module~self_geometry_3d->module~self_supportroutines module~self_geometry_3d->module~self_constants module~self_geometry_3d->module~self_mesh_3d module~self_geometry_3d->module~self_scalar_3d~2 module~self_geometry_3d->module~self_lagrange~3 module~self_geometry_3d->module~self_tensor_3d~2 module~self_data SELF_Data module~self_geometry_3d->module~self_data module~self_vector_3d~2 SELF_Vector_3D module~self_geometry_3d->module~self_vector_3d~2 module~self_mappedtwopointvector_3d_t SELF_MappedTwoPointVector_3D_t module~self_mappedtwopointvector_3d->module~self_mappedtwopointvector_3d_t module~self_domaindecomposition_t->iso_c_binding module~self_domaindecomposition_t->module~self_supportroutines module~self_domaindecomposition_t->module~self_constants module~self_domaindecomposition_t->module~self_lagrange~3 mpi mpi module~self_domaindecomposition_t->mpi module~self_hdf5->module~self_constants module~self_hdf5->iso_fortran_env module~self_hdf5->HDF5 module~self_hdf5->mpi module~self_scalar_3d~2->iso_c_binding module~self_scalar_3d~2->module~self_constants module~self_scalar_3d_t SELF_Scalar_3D_t module~self_scalar_3d~2->module~self_scalar_3d_t module~self_lagrange~3->iso_c_binding module~self_lagrange~3->module~self_constants module~self_lagrange~3->iso_fortran_env module~self_gpu SELF_GPU module~self_lagrange~3->module~self_gpu module~self_lagrange_t SELF_Lagrange_t module~self_lagrange~3->module~self_lagrange_t module~self_tensor_3d_t SELF_Tensor_3D_t module~self_tensor_3d~2->module~self_tensor_3d_t module~self_mappedtwopointvector_3d_t->iso_c_binding module~self_mappedtwopointvector_3d_t->module~self_constants module~self_mappedtwopointvector_3d_t->module~self_geometry_3d module~self_mappedtwopointvector_3d_t->module~self_lagrange~3 module~self_twopointvector_3d~2 SELF_TwoPointVector_3D module~self_mappedtwopointvector_3d_t->module~self_twopointvector_3d~2 module~self_scalar_3d_t->module~self_metadata module~self_scalar_3d_t->iso_c_binding module~self_scalar_3d_t->module~self_constants module~self_scalar_3d_t->FEQParse module~self_scalar_3d_t->HDF5 module~self_scalar_3d_t->module~self_hdf5 module~self_scalar_3d_t->module~self_lagrange~3 module~self_scalar_3d_t->module~self_data module~self_gpu->iso_c_binding module~self_gpu_enums SELF_GPU_enums module~self_gpu->module~self_gpu_enums module~self_tensor_3d_t->module~self_metadata module~self_tensor_3d_t->iso_c_binding module~self_tensor_3d_t->module~self_constants module~self_tensor_3d_t->FEQParse module~self_tensor_3d_t->HDF5 module~self_tensor_3d_t->module~self_hdf5 module~self_tensor_3d_t->module~self_lagrange~3 module~self_tensor_3d_t->module~self_data module~self_dgmodel3d_t->module~self_mappedscalar_3d~2 module~self_dgmodel3d_t->module~self_boundaryconditions module~self_dgmodel3d_t->module~self_metadata module~self_dgmodel3d_t->module~self_supportroutines module~self_dgmodel3d_t->module~self_mesh_3d module~self_dgmodel3d_t->module~self_geometry_3d module~self_dgmodel3d_t->FEQParse module~self_dgmodel3d_t->HDF5 module~self_dgmodel3d_t->module~self_hdf5 module~self_model SELF_Model module~self_dgmodel3d_t->module~self_model module~self_mappedvector_3d SELF_MappedVector_3D module~self_dgmodel3d_t->module~self_mappedvector_3d module~self_data->module~self_metadata module~self_data->iso_c_binding module~self_data->module~self_constants module~self_data->FEQParse module~self_data->HDF5 module~self_data->module~self_hdf5 module~self_data->module~self_lagrange~3 module~self_mesh_3d_t->module~self_mesh module~self_mesh_3d_t->module~self_domaindecomposition~2 module~self_mesh_3d_t->iso_c_binding module~self_mesh_3d_t->module~self_supportroutines module~self_mesh_3d_t->module~self_constants module~self_mesh_3d_t->HDF5 module~self_mesh_3d_t->module~self_hdf5 module~self_mesh_3d_t->module~self_lagrange~3 module~self_vector_3d_t SELF_Vector_3D_t module~self_vector_3d~2->module~self_vector_3d_t module~self_lagrange_t->iso_c_binding module~self_lagrange_t->module~self_supportroutines module~self_lagrange_t->module~self_constants module~self_lagrange_t->iso_fortran_env module~self_lagrange_t->HDF5 module~self_lagrange_t->module~self_hdf5 module~self_quadrature SELF_Quadrature module~self_lagrange_t->module~self_quadrature module~self_gpu_enums->iso_c_binding module~self_vector_3d_t->module~self_metadata module~self_vector_3d_t->iso_c_binding module~self_vector_3d_t->module~self_constants module~self_vector_3d_t->FEQParse module~self_vector_3d_t->HDF5 module~self_vector_3d_t->module~self_hdf5 module~self_vector_3d_t->module~self_lagrange~3 module~self_vector_3d_t->module~self_data module~self_model->module~self_metadata module~self_model->module~self_supportroutines module~self_model->FEQParse module~self_model->HDF5 module~self_model->module~self_hdf5 module~self_mappedvector_3d_t SELF_MappedVector_3D_t module~self_mappedvector_3d->module~self_mappedvector_3d_t module~self_quadrature->module~self_constants module~self_quadrature->iso_fortran_env module~self_twopointvector_3d_t SELF_TwoPointVector_3D_t module~self_twopointvector_3d~2->module~self_twopointvector_3d_t module~self_mappedvector_3d_t->module~self_domaindecomposition~2 module~self_mappedvector_3d_t->iso_c_binding module~self_mappedvector_3d_t->module~self_constants module~self_mappedvector_3d_t->module~self_mesh_3d module~self_mappedvector_3d_t->module~self_geometry_3d module~self_mappedvector_3d_t->FEQParse module~self_mappedvector_3d_t->module~self_lagrange~3 module~self_twopointvector_3d_t->module~self_metadata module~self_twopointvector_3d_t->iso_c_binding module~self_twopointvector_3d_t->module~self_constants module~self_twopointvector_3d_t->FEQParse module~self_twopointvector_3d_t->module~self_lagrange~3 module~self_twopointvector_3d_t->module~self_data

Used by

  • module~~self_esatmo3d_t~~UsedByGraph module~self_esatmo3d_t SELF_ESAtmo3D_t module~self_esatmo3d~2 SELF_ESAtmo3D module~self_esatmo3d~2->module~self_esatmo3d_t module~self_esatmo3d SELF_ESAtmo3D module~self_esatmo3d->module~self_esatmo3d_t

Contents


Derived Types

type, public, extends(ECDGModel3D) :: ESAtmo3D_t

Components

TypeVisibilityAttributesNameInitial
real(kind=prec), public :: Rd =287.0_prec
real(kind=prec), public :: cp =1004.0_prec
real(kind=prec), public :: cv =717.0_prec
type(MappedScalar3D), public :: dSdt
type(MappedScalar3D), public :: diffDiv
type(MappedVector3D), public :: diffFlux
real(kind=prec), public :: dt
real(kind=prec), public :: entropy
real(kind=prec), public :: eta_penalty =4.0_prec
type(MappedVector3D), public :: flux
type(MappedScalar3D), public :: fluxDivergence
real(kind=prec), public :: g =9.81_prec

Constant-coefficient Laplacian diffusion. The interface flux is BR1 central + Nitsche-style jump penalty (i.e. SIPG-style):

Read more…
type(SEMHex), public, pointer:: geometry
logical, public :: gradient_enabled =.false.
type(BoundaryConditionList), public :: hyperbolicBCs
integer, public :: ioIterate =0
real(kind=prec), public :: kappa =0.0_prec
real(kind=prec), public :: length_scale =0.0_prec

Diffusive-flux scratch buffer. Holds the constant-coefficient Laplacian flux F_diff(i,j,k,iel,iVar,d) = -coeff_iVar * d(s_iVar)/dx_d with coeff_iVar = 0 for rho, nu for rhou/rhov/rhow, and kappa for rhotheta. The boundaryNormal slot is filled with the BR1 central flux F_R^diff = -coeff * (avg_grad . n) * nmag (using solutionGradient%avgBoundary, populated by AverageSides).

Read more…
type(Mesh3D), public, pointer:: mesh
real(kind=prec), public :: nu =0.0_prec
integer, public :: nvar
real(kind=prec), public :: p0 =100000.0_prec
type(BoundaryConditionList), public :: parabolicBCs
logical, public :: prescribed_bcs_enabled =.true.
type(MappedScalar3D), public :: solution
type(MappedVector3D), public :: solutionGradient
type(MappedScalar3D), public :: source
real(kind=prec), public :: t
logical, public :: tecplot_enabled =.true.
procedure(SELF_timeIntegrator), public, pointer:: timeIntegrator=> Euler_timeIntegrator
type(MappedTwoPointVector3D), public :: twoPointFlux
type(MappedScalar3D), public :: workSol

Type-Bound Procedures

procedure, public :: AddThermalBubble => AddThermalBubble_ESAtmo3D_t

Constant-coefficient Laplacian / Bassi-Rebay diffusion hooks

procedure, public :: AdditionalFree => AdditionalFree_ESAtmo3D_t
procedure, public :: AdditionalInit => AdditionalInit_ESAtmo3D_t
procedure, public :: AdditionalOutput => AdditionalOutput_Model
procedure, public :: BoundaryFlux => BoundaryFlux_ESAtmo3D_t
procedure, public :: CalculateEntropy => CalculateEntropy_DGModel3D_t
procedure, public :: CalculateSolutionGradient => CalculateSolutionGradient_DGModel3D_t
procedure, public :: CalculateTendency => CalculateTendency_ESAtmo3D_t
procedure, public :: DiffusiveBoundaryFlux => DiffusiveBoundaryFlux_ESAtmo3D_t
procedure, public :: DiffusiveFluxMethod => DiffusiveFluxMethod_ESAtmo3D_t
procedure, public :: Euler_timeIntegrator
procedure, public :: FluxMethod => fluxmethod_DGModel3D_t
procedure, public :: ForwardStep => ForwardStep_Model
procedure, public :: Free => Free_ECDGModel3D_t
procedure, public :: GetSimulationTime
procedure, public :: IncrementIOCounter
procedure, public :: Init => Init_ECDGModel3D_t
procedure, public :: LowStorageRK2_timeIntegrator
procedure, public :: LowStorageRK3_timeIntegrator
procedure, public :: LowStorageRK4_timeIntegrator
procedure, public :: MapBoundaryConditions => MapBoundaryConditions_DGModel3D_t
procedure, public :: PreTendency => PreTendency_Model
procedure, public :: PrintType => PrintType_Model
procedure, public :: ReadModel => Read_DGModel3D_t
procedure, public :: ReportEntropy => ReportEntropy_Model
procedure, public :: ReportMetrics => ReportMetrics_DGModel3D_t
procedure, public :: ReportUserMetrics => ReportUserMetrics_Model
procedure, public :: SetBoundaryCondition => setboundarycondition_DGModel3D_t
procedure, public :: SetDiffusion => SetDiffusion_ESAtmo3D_t
procedure, public :: SetGradientBoundaryCondition => setgradientboundarycondition_DGModel3D_t
procedure, public :: SetHydrostaticBalance => SetHydrostaticBalance_ESAtmo3D_t
procedure, public :: SetMetadata => SetMetadata_ESAtmo3D_t
procedure, public :: SetNumberOfVariables => SetNumberOfVariables_ESAtmo3D_t
procedure, public :: SetSimulationTime
generic, public :: SetSolution => SetSolutionFromChar_DGModel3D_t, SetSolutionFromEqn_DGModel3D_t
generic, public :: SetTimeIntegrator => SetTimeIntegrator_withChar
procedure, public :: SourceMethod => SourceMethod_ESAtmo3D_t
procedure, public :: TwoPointFluxMethod => TwoPointFluxMethod_ESAtmo3D_t
procedure, public :: UpdateGRK2 => UpdateGRK2_DGModel3D_t
procedure, public :: UpdateGRK3 => UpdateGRK3_DGModel3D_t
procedure, public :: UpdateGRK4 => UpdateGRK4_DGModel3D_t
procedure, public :: UpdateSolution => UpdateSolution_DGModel3D_t
procedure, public :: WriteModel => Write_DGModel3D_t
procedure, public :: WriteTecplot => WriteTecplot_DGModel3D_t
procedure, public :: entropy_func => entropy_func_ESAtmo3D_t
procedure, public :: flux1D => flux1d_Model
procedure, public :: flux2D => flux2d_Model
procedure, public :: flux3D => flux3d_Model
procedure, public :: riemannflux1d => riemannflux1d_Model
procedure, public :: riemannflux2d => riemannflux2d_Model
procedure, public :: riemannflux3d => riemannflux3d_ESAtmo3D_t
procedure, public :: source1d => source1d_Model
procedure, public :: source2d => source2d_Model
procedure, public :: source3d => source3d_Model
procedure, public :: twopointflux3d => twopointflux3d_ESAtmo3D_t

Functions

public pure function entropy_func_ESAtmo3D_t(this, s) result(e)

Mathematical entropy: total energy density (kinetic + internal).

Read more…

Arguments

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

Return Value real(kind=prec)

public pure function log_mean(a, b) result(am)

Numerically stable logarithmic mean (Ismail-Roe 2009 / Ranocha 2018).

Read more…

Arguments

TypeIntentOptionalAttributesName
real(kind=prec), intent(in) :: a
real(kind=prec), intent(in) :: b

Return Value real(kind=prec)

public pure function riemannflux3d_ESAtmo3D_t(this, sL, sR, dsdx, nhat) result(flux)

Local Lax-Friedrichs (Rusanov) Riemann flux.

Read more…

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)
real(kind=prec), intent(in) :: dsdx(1:this%nvar,1:3)
real(kind=prec), intent(in) :: nhat(1:3)

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

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.

Read more…

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)


Subroutines

public subroutine AddThermalBubble_ESAtmo3D_t(this, dtheta, r0, x0, y0, z0)

Adds a pressure-balanced warm bubble perturbation.

Read more…

Arguments

TypeIntentOptionalAttributesName
class(ESAtmo3D_t), intent(inout) :: this
real(kind=prec), intent(in) :: dtheta
real(kind=prec), intent(in) :: r0
real(kind=prec), intent(in) :: x0
real(kind=prec), intent(in) :: y0
real(kind=prec), intent(in) :: z0

public subroutine AdditionalFree_ESAtmo3D_t(this)

Arguments

TypeIntentOptionalAttributesName
class(ESAtmo3D_t), intent(inout) :: this

public subroutine AdditionalInit_ESAtmo3D_t(this)

Arguments

TypeIntentOptionalAttributesName
class(ESAtmo3D_t), intent(inout) :: this

public subroutine BoundaryFlux_ESAtmo3D_t(this)

LMARS (Low-Mach Approximate Riemann Solver, Chen et al. 2013) interface flux. No hydrostatic pressure split: gravity is folded into SourceMethod via the Souza non-conservative form using the geopotential carried in the state vector (variable index 6).

Read more…

Arguments

TypeIntentOptionalAttributesName
class(ESAtmo3D_t), intent(inout) :: this

public subroutine CalculateTendency_ESAtmo3D_t(this)

ESAtmo3D tendency = EC inviscid pipeline (parent) + optional constant-coefficient Laplacian diffusion (BR1 weak-form DG).

Read more…

Arguments

TypeIntentOptionalAttributesName
class(ESAtmo3D_t), intent(inout) :: this

public subroutine DiffusiveBoundaryFlux_ESAtmo3D_t(this)

Fill diffFlux%boundaryNormal with the SIPG-stabilised BR1 flux:

Read more…

Arguments

TypeIntentOptionalAttributesName
class(ESAtmo3D_t), intent(inout) :: this

public subroutine DiffusiveFluxMethod_ESAtmo3D_t(this)

Fill diffFlux%interior with the constant-coefficient Laplacian flux at every interior node:

Read more…

Arguments

TypeIntentOptionalAttributesName
class(ESAtmo3D_t), intent(inout) :: this

public subroutine SetDiffusion_ESAtmo3D_t(this, nu, kappa, eta_penalty)

Set the constant-coefficient Laplacian diffusion coefficients (kinematic momentum diffusivity and thermal diffusivity, both in m^2/s) and the dimensionless SIPG jump penalty. Setting nu or kappa > 0 enables the gradient pipeline so that the diffusive flux methods receive solutionGradient.

Read more…

Arguments

TypeIntentOptionalAttributesName
class(ESAtmo3D_t), intent(inout) :: this
real(kind=prec), intent(in) :: nu
real(kind=prec), intent(in) :: kappa
real(kind=prec), intent(in), optional :: eta_penalty

public subroutine SetHydrostaticBalance_ESAtmo3D_t(this, theta0)

Initialise a hydrostatically balanced atmosphere with uniform potential temperature theta0, zero velocity, and the geopotential Phi = g*z carried as state variable index 6.

Read more…

Arguments

TypeIntentOptionalAttributesName
class(ESAtmo3D_t), intent(inout) :: this
real(kind=prec), intent(in) :: theta0

public subroutine SetMetadata_ESAtmo3D_t(this)

Arguments

TypeIntentOptionalAttributesName
class(ESAtmo3D_t), intent(inout) :: this

public subroutine SetNumberOfVariables_ESAtmo3D_t(this)

Six conserved variables: (rho, rhou, rhov, rhow, rhotheta, Phi), where Phi = g*z is the geopotential. Phi has zero flux (volume and surface) so its tendency is identically zero; it is carried in the state vector solely so that the Souza et al. (2023) non-conservative gravity flux differencing in SourceMethod can read it node-locally.

Arguments

TypeIntentOptionalAttributesName
class(ESAtmo3D_t), intent(inout) :: this

public subroutine SourceMethod_ESAtmo3D_t(this)

Souza et al. (2023) non-conservative gravity flux differencing.

Read more…

Arguments

TypeIntentOptionalAttributesName
class(ESAtmo3D_t), intent(inout) :: this

public subroutine TwoPointFluxMethod_ESAtmo3D_t(this)

Pre-projected scalar contravariant two-point Souza et al. (2023) EC flux. For each node pair (a, b) along reference direction r:

Read more…

Arguments

TypeIntentOptionalAttributesName
class(ESAtmo3D_t), intent(inout) :: this

public subroutine hbc3d_NoNormalFlow_ESAtmo3D(bc, mymodel)

No-normal-flow (wall) boundary condition.

Read more…

Arguments

TypeIntentOptionalAttributesName
class(BoundaryCondition), intent(in) :: bc
class(Model), intent(inout) :: mymodel

public subroutine pbc3d_NoStress_ESAtmo3D(bc, mymodel)

Parabolic boundary condition: zero diffusive flux normal to the wall (no-stress for momentum, no-heat-flux for rho*theta).

Read more…

Arguments

TypeIntentOptionalAttributesName
class(BoundaryCondition), intent(in) :: bc
class(Model), intent(inout) :: mymodel