| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| 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): f_R^diff(iVar) = -coeff(iVar) * (avg_grad . n) * nmag + tau(iVar) * (uL - uR) * nmag with tau(iVar) = eta_penalty * coeff(iVar) * (N+1)^2 / length_scale. The penalty is what makes the discrete operator coercive on the checkerboard / odd-even modes that pure BR1 cannot damp. nu : kinematic diffusivity for momentum [m^2/s] kappa : thermal diffusivity for rhotheta [m^2/s] eta_penalty : dimensionless SIPG penalty (default 4.0) length_scale : characteristic element length [m], filled by SetDiffusion from the geometry (mean J^(1/3)2). All default to zero (inviscid). Setting nu or kappa > 0 via SetDiffusion enables the gradient pipeline so that the model can read solutionGradient inside the diffusive flux methods. |
|
| 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). MappedDGDivergence on this buffer gives the parabolic divergence contribution that is then accumulated into fluxDivergence. |
|
| 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 |
Constant-coefficient Laplacian / Bassi-Rebay diffusion hooks
Adds a pressure-balanced warm bubble perturbation.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| 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 |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ESAtmo3D_t), | intent(inout) | :: | this |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ESAtmo3D_t), | intent(inout) | :: | this |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Model), | intent(inout) | :: | this | |||
| integer(kind=HID_T), | intent(in) | :: | fileid |
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).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ESAtmo3D_t), | intent(inout) | :: | this |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(DGModel3D_t), | intent(inout) | :: | this |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(DGModel3D_t), | intent(inout) | :: | this |
ESAtmo3D tendency = EC inviscid pipeline (parent) + optional constant-coefficient Laplacian diffusion (BR1 weak-form DG).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ESAtmo3D_t), | intent(inout) | :: | this |
Fill diffFlux%boundaryNormal with the SIPG-stabilised BR1 flux:
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ESAtmo3D_t), | intent(inout) | :: | this |
Fill diffFlux%interior with the constant-coefficient Laplacian flux at every interior node:
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ESAtmo3D_t), | intent(inout) | :: | this |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Model), | intent(inout) | :: | this | |||
| real(kind=prec), | intent(in) | :: | tn |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(DGModel3D_t), | intent(inout) | :: | this |
Forward steps the model using the associated tendency procedure and time integrator
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Model), | intent(inout) | :: | this | |||
| real(kind=prec), | intent(in) | :: | tn | |||
| real(kind=prec), | intent(in) | :: | dt | |||
| real(kind=prec), | intent(in) | :: | ioInterval |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ECDGModel3D_t), | intent(inout) | :: | this |
Returns the current simulation time stored in the model % t attribute
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Model), | intent(in) | :: | this | |||
| real(kind=prec), | intent(out) | :: | t |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Model), | intent(inout) | :: | this |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ECDGModel3D_t), | intent(out) | :: | this | |||
| type(Mesh3D), | intent(in), | target | :: | mesh | ||
| type(SEMHex), | intent(in), | target | :: | geometry |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Model), | intent(inout) | :: | this | |||
| real(kind=prec), | intent(in) | :: | tn |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Model), | intent(inout) | :: | this | |||
| real(kind=prec), | intent(in) | :: | tn |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Model), | intent(inout) | :: | this | |||
| real(kind=prec), | intent(in) | :: | tn |
Scan the mesh sideInfo and populate the elements/sides arrays for each registered boundary condition.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(DGModel3D_t), | intent(inout) | :: | this |
PreTendency is a template routine that is used to house any additional calculations that you want to execute at the beginning of the tendency calculation routine. This default PreTendency simply returns back to the caller without executing any instructions
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Model), | intent(inout) | :: | this |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Model), | intent(in) | :: | this |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(DGModel3D_t), | intent(inout) | :: | this | |||
| character, | intent(in) | :: | fileName |
Base method for reporting the entropy of a model to stdout. Only override this procedure if additional reporting is needed. Alternatively, if you think additional reporting would be valuable for all models, open a pull request with modifications to this base method.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Model), | intent(in) | :: | this |
Base method for reporting the entropy of a model to stdout. Only override this procedure if additional reporting is needed. Alternatively, if you think additional reporting would be valuable for all models, open a pull request with modifications to this base method.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(DGModel3D_t), | intent(inout) | :: | this |
Method that can be overridden by users to report their own custom metrics after file io
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Model), | intent(inout) | :: | this |
Apply registered boundary conditions for the solution.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(DGModel3D_t), | intent(inout) | :: | this |
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.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| 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 |
Apply registered boundary conditions for the solution gradient.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(DGModel3D_t), | intent(inout) | :: | this |
Initialise a hydrostatically balanced atmosphere with uniform potential temperature theta0, zero velocity, and the geopotential Phi = g*z carried as state variable index 6.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ESAtmo3D_t), | intent(inout) | :: | this | |||
| real(kind=prec), | intent(in) | :: | theta0 |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ESAtmo3D_t), | intent(inout) | :: | 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.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ESAtmo3D_t), | intent(inout) | :: | this |
Sets the model % t attribute with the provided simulation time
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Model), | intent(inout) | :: | this | |||
| real(kind=prec), | intent(in) | :: | t |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(DGModel3D_t), | intent(inout) | :: | this | |||
| character, | intent(in) | :: | eqnChar(1:this%solution%nVar) |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(DGModel3D_t), | intent(inout) | :: | this | |||
| type(EquationParser), | intent(in) | :: | eqn(1:this%solution%nVar) |
Sets the time integrator method, using a character input
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Model), | intent(inout) | :: | this | |||
| character, | intent(in) | :: | integrator |
Souza et al. (2023) non-conservative gravity flux differencing.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ESAtmo3D_t), | intent(inout) | :: | this |
Pre-projected scalar contravariant two-point Souza et al. (2023) EC flux. For each node pair (a, b) along reference direction r:
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ESAtmo3D_t), | intent(inout) | :: | this |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(DGModel3D_t), | intent(inout) | :: | this | |||
| integer, | intent(in) | :: | m |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(DGModel3D_t), | intent(inout) | :: | this | |||
| integer, | intent(in) | :: | m |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(DGModel3D_t), | intent(inout) | :: | this | |||
| integer, | intent(in) | :: | m |
Computes a solution update as , where dt is either provided through the interface or taken as the Model's stored time step size (model % dt)
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(DGModel3D_t), | intent(inout) | :: | this | |||
| real(kind=prec), | intent(in), | optional | :: | dt |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(DGModel3D_t), | intent(inout) | :: | this | |||
| character, | intent(in), | optional | :: | fileName |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(DGModel3D_t), | intent(inout) | :: | this | |||
| character, | intent(in), | optional | :: | filename |
Mathematical entropy: total energy density (kinetic + internal).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ESAtmo3D_t), | intent(in) | :: | this | |||
| real(kind=prec), | intent(in) | :: | s(1:this%nvar) |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Model), | intent(in) | :: | this | |||
| real(kind=prec), | intent(in) | :: | s(1:this%nvar) | |||
| real(kind=prec), | intent(in) | :: | dsdx(1:this%nvar) |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Model), | intent(in) | :: | this | |||
| real(kind=prec), | intent(in) | :: | s(1:this%nvar) | |||
| real(kind=prec), | intent(in) | :: | dsdx(1:this%nvar,1:2) |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Model), | intent(in) | :: | this | |||
| real(kind=prec), | intent(in) | :: | s(1:this%nvar) | |||
| real(kind=prec), | intent(in) | :: | dsdx(1:this%nvar,1:3) |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Model), | 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) | |||
| real(kind=prec), | intent(in) | :: | nhat |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Model), | 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:2) | |||
| real(kind=prec), | intent(in) | :: | nhat(1:2) |
Local Lax-Friedrichs (Rusanov) Riemann flux.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| 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) |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Model), | intent(in) | :: | this | |||
| real(kind=prec), | intent(in) | :: | s(1:this%nvar) | |||
| real(kind=prec), | intent(in) | :: | dsdx(1:this%nvar) |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Model), | intent(in) | :: | this | |||
| real(kind=prec), | intent(in) | :: | s(1:this%nvar) | |||
| real(kind=prec), | intent(in) | :: | dsdx(1:this%nvar,1:2) |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Model), | intent(in) | :: | this | |||
| real(kind=prec), | intent(in) | :: | s(1:this%nvar) | |||
| real(kind=prec), | intent(in) | :: | dsdx(1:this%nvar,1:3) |
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.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ESAtmo3D_t), | intent(in) | :: | this | |||
| real(kind=prec), | intent(in) | :: | sL(1:this%nvar) | |||
| real(kind=prec), | intent(in) | :: | sR(1:this%nvar) |
type,extends(ECDGModel3D) :: ESAtmo3D_t
real(prec) :: p0 = 100000.0_prec ! Reference pressure [Pa]
real(prec) :: Rd = 287.0_prec ! Gas constant for dry air [J/(kg*K)]
real(prec) :: cp = 1004.0_prec ! Specific heat at constant pressure [J/(kg*K)]
real(prec) :: cv = 717.0_prec ! Specific heat at constant volume [J/(kg*K)]
real(prec) :: g = 9.81_prec ! Gravitational acceleration [m/s^2]
!! Constant-coefficient Laplacian diffusion. The interface flux is
!! BR1 central + Nitsche-style jump penalty (i.e. SIPG-style):
!!
!! f_R^diff(iVar) = -coeff(iVar) * (avg_grad . n) * nmag
!! + tau(iVar) * (uL - uR) * nmag
!!
!! with tau(iVar) = eta_penalty * coeff(iVar) * (N+1)^2 / length_scale.
!! The penalty is what makes the discrete operator coercive on the
!! checkerboard / odd-even modes that pure BR1 cannot damp.
!!
!! nu : kinematic diffusivity for momentum [m^2/s]
!! kappa : thermal diffusivity for rho*theta [m^2/s]
!! eta_penalty : dimensionless SIPG penalty (default 4.0)
!! length_scale : characteristic element length [m], filled by
!! SetDiffusion from the geometry (mean J^(1/3)*2).
!!
!! All default to zero (inviscid). Setting nu or kappa > 0 via
!! SetDiffusion enables the gradient pipeline so that the model
!! can read solutionGradient inside the diffusive flux methods.
real(prec) :: nu = 0.0_prec
real(prec) :: kappa = 0.0_prec
real(prec) :: eta_penalty = 4.0_prec
real(prec) :: 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).
!!
!! MappedDGDivergence on this buffer gives the parabolic divergence
!! contribution that is then accumulated into fluxDivergence.
type(MappedVector3D) :: diffFlux
type(MappedScalar3D) :: diffDiv
contains
procedure :: SetNumberOfVariables => SetNumberOfVariables_ESAtmo3D_t
procedure :: SetMetadata => SetMetadata_ESAtmo3D_t
procedure :: entropy_func => entropy_func_ESAtmo3D_t
procedure :: twopointflux3d => twopointflux3d_ESAtmo3D_t
procedure :: TwoPointFluxMethod => TwoPointFluxMethod_ESAtmo3D_t
procedure :: riemannflux3d => riemannflux3d_ESAtmo3D_t
procedure :: BoundaryFlux => BoundaryFlux_ESAtmo3D_t
procedure :: SourceMethod => SourceMethod_ESAtmo3D_t
procedure :: AdditionalInit => AdditionalInit_ESAtmo3D_t
procedure :: AdditionalFree => AdditionalFree_ESAtmo3D_t
procedure :: SetHydrostaticBalance => SetHydrostaticBalance_ESAtmo3D_t
procedure :: AddThermalBubble => AddThermalBubble_ESAtmo3D_t
!! Constant-coefficient Laplacian / Bassi-Rebay diffusion hooks
procedure :: SetDiffusion => SetDiffusion_ESAtmo3D_t
procedure :: DiffusiveFluxMethod => DiffusiveFluxMethod_ESAtmo3D_t
procedure :: DiffusiveBoundaryFlux => DiffusiveBoundaryFlux_ESAtmo3D_t
procedure :: CalculateTendency => CalculateTendency_ESAtmo3D_t
endtype ESAtmo3D_t