ESAtmo3D_t Derived Type

type, public, extends(ECDGModel3D) :: ESAtmo3D_t


Inherits

type~~esatmo3d_t~~InheritsGraph type~esatmo3d_t ESAtmo3D_t type~mappedvector3d MappedVector3D type~esatmo3d_t->type~mappedvector3d diffFlux type~mappedscalar3d~2 MappedScalar3D type~esatmo3d_t->type~mappedscalar3d~2 diffDiv type~ecdgmodel3d ECDGModel3D type~esatmo3d_t->type~ecdgmodel3d type~mappedvector3d_t MappedVector3D_t type~mappedvector3d->type~mappedvector3d_t type~mappedscalar3d_t MappedScalar3D_t type~mappedscalar3d~2->type~mappedscalar3d_t type~ecdgmodel3d_t ECDGModel3D_t type~ecdgmodel3d->type~ecdgmodel3d_t type~semhex SEMHex type~mappedvector3d_t->type~semhex geometry type~vector3d~2 Vector3D type~mappedvector3d_t->type~vector3d~2 type~mappedscalar3d_t->type~semhex geometry type~scalar3d~2 Scalar3D type~mappedscalar3d_t->type~scalar3d~2 type~mappedtwopointvector3d MappedTwoPointVector3D type~ecdgmodel3d_t->type~mappedtwopointvector3d twoPointFlux type~dgmodel3d~2 DGModel3D type~ecdgmodel3d_t->type~dgmodel3d~2 type~semhex->type~scalar3d~2 nScale, J type~semhex->type~vector3d~2 x, nHat, xMesh type~tensor3d~2 Tensor3D type~semhex->type~tensor3d~2 dxds, dsdx type~lagrange Lagrange type~semhex->type~lagrange meshToModel type~mappedtwopointvector3d_t MappedTwoPointVector3D_t type~mappedtwopointvector3d->type~mappedtwopointvector3d_t type~scalar3d_t Scalar3D_t type~scalar3d~2->type~scalar3d_t type~vector3d_t Vector3D_t type~vector3d~2->type~vector3d_t type~dgmodel3d_t DGModel3D_t type~dgmodel3d~2->type~dgmodel3d_t type~tensor3d_t Tensor3D_t type~tensor3d~2->type~tensor3d_t type~self_dataobj SELF_DataObj type~vector3d_t->type~self_dataobj type~mappedtwopointvector3d_t->type~semhex geometry type~twopointvector3d TwoPointVector3D type~mappedtwopointvector3d_t->type~twopointvector3d type~scalar3d_t->type~self_dataobj type~lagrange_t Lagrange_t type~lagrange->type~lagrange_t type~dgmodel3d_t->type~mappedvector3d solutionGradient, flux type~dgmodel3d_t->type~mappedscalar3d~2 solution, source, fluxDivergence, dSdt, workSol type~dgmodel3d_t->type~semhex geometry type~mesh3d Mesh3D type~dgmodel3d_t->type~mesh3d mesh type~boundaryconditionlist BoundaryConditionList type~dgmodel3d_t->type~boundaryconditionlist hyperbolicBCs, parabolicBCs type~model Model type~dgmodel3d_t->type~model type~tensor3d_t->type~self_dataobj type~self_dataobj->type~lagrange interp type~metadata Metadata type~self_dataobj->type~metadata meta EquationParser EquationParser type~self_dataobj->EquationParser eqn type~mesh3d_t Mesh3D_t type~mesh3d->type~mesh3d_t type~twopointvector3d_t TwoPointVector3D_t type~twopointvector3d->type~twopointvector3d_t type~boundarycondition BoundaryCondition type~boundaryconditionlist->type~boundarycondition current, head, tail type~semmesh SEMMesh type~mesh3d_t->type~semmesh type~twopointvector3d_t->type~self_dataobj type~boundarycondition->type~boundarycondition next, prev c_ptr c_ptr type~boundarycondition->c_ptr elements_gpu, sides_gpu type~domaindecomposition DomainDecomposition type~semmesh->type~domaindecomposition decomp type~domaindecomposition_t DomainDecomposition_t type~domaindecomposition->type~domaindecomposition_t

Inherited by

type~~esatmo3d_t~~InheritedByGraph type~esatmo3d_t ESAtmo3D_t type~esatmo3d ESAtmo3D type~esatmo3d->type~esatmo3d_t type~esatmo3d~2 ESAtmo3D type~esatmo3d~2->type~esatmo3d_t

Contents

Source Code


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):

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
integer, public :: nUnmappedBoundaries =0

The first unregistered bcid found, and meaningful only when nUnmappedBoundaries > 0: -1 is itself a legal bcid, so it cannot double as an "absent" marker.

integer, public :: nstepped =0
real(kind=prec), public :: nu =0.0_prec
integer, public :: nvar
real(kind=prec), public :: p0 =100000.0_prec
type(BoundaryConditionList), public :: parabolicBCs

Mesh boundary faces whose sideInfo(5) boundary condition id matches no registered boundary condition, counted over the whole domain by MapBoundaryConditions and summed across ranks. Nothing writes solution%extBoundary on such a face, so the Riemann solver reads zeros at t = 0 and stale values afterwards. ReportUnmappedBoundaries warns about them once, from the top of ForwardStep.

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
real(kind=prec), public, allocatable:: transferStage(:,:,:,:,:)

Migrated old-element window, held between MigrateOldWindow and ApplyTransferPlan on the multi-rank path: the contiguous run of OLD elements this rank's new element range references. Flat, because it is viewed through a rank-remapped pointer whose element lower bound is the window's first GLOBAL old element index - the numbering the transfer plan uses. Persistent and grow-only, so a settled adapting run allocates nothing here. The GPU backend overrides the migration and keeps the window in device memory instead, leaving this unallocated.

type(MappedTwoPointVector3D), public :: twoPointFlux
logical, public :: unmappedBoundariesReported =.false.
integer, public :: unmappedBoundaryID =-1
real(kind=prec), public, allocatable:: winStage(:)
integer, public :: winStageFirst =0

global old index of winStage's first element

integer, public :: winStageN =0

window element count; 0 means no window is migrated

type(MappedScalar3D), public :: workSol

Type-Bound Procedures

procedure, public :: AddThermalBubble => AddThermalBubble_ESAtmo3D_t

Constant-coefficient Laplacian / Bassi-Rebay diffusion hooks

  • 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

procedure, public :: AdditionalFree => AdditionalFree_ESAtmo3D_t

procedure, public :: AdditionalInit => AdditionalInit_ESAtmo3D_t

procedure, public :: AdditionalOutput => AdditionalOutput_Model

  • public subroutine AdditionalOutput_Model(this, fileid)

    Arguments

    TypeIntentOptionalAttributesName
    class(Model), intent(inout) :: this
    integer(kind=HID_T), intent(in) :: fileid

procedure, public :: ApplyTransferPlan => ApplyTransferPlan_DGModel3D_t

  • public subroutine ApplyTransferPlan_DGModel3D_t(this, plan, interp, eFirst, eLast, uGlobal, oldFirst)

    Transfer the staged pre-regrid solution onto the regridded mesh through plan, filling the rank-local element range [eFirst,eLast] of the new solution.

    Read more…

    Arguments

    TypeIntentOptionalAttributesName
    class(DGModel3D_t), intent(inout), target:: this
    type(TransferPlan3D), intent(in), target:: plan
    type(Lagrange), intent(in) :: interp
    integer, intent(in) :: eFirst
    integer, intent(in) :: eLast
    real(kind=prec), intent(in), optional contiguous:: uGlobal(:,:,:,:,:)
    integer, intent(in), optional :: oldFirst

procedure, public :: BoundaryFlux => BoundaryFlux_ESAtmo3D_t

  • 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

procedure, public :: CalculateEntropy => CalculateEntropy_DGModel3D_t

procedure, public :: CalculateSolutionGradient => CalculateSolutionGradient_DGModel3D_t

procedure, public :: CalculateTendency => CalculateTendency_ESAtmo3D_t

  • 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

procedure, public :: DiffusiveBoundaryFlux => DiffusiveBoundaryFlux_ESAtmo3D_t

procedure, public :: DiffusiveFluxMethod => DiffusiveFluxMethod_ESAtmo3D_t

procedure, public :: DownloadOldWindow => DownloadOldWindow_DGModel3D_t

  • public subroutine DownloadOldWindow_DGModel3D_t(this, wFirst, wLast, uWin)

    Copy the migrated window into a host array, for the SELF_AMR_MIGRATE_VERIFY diagnostic. Diagnostic-only and off the default path: on a GPU build the override is a device-to-host transfer of the whole window, which is exactly the traffic the device path exists to avoid.

    Read more…

    Arguments

    TypeIntentOptionalAttributesName
    class(DGModel3D_t), intent(in) :: this
    integer, intent(in) :: wFirst
    integer, intent(in) :: wLast
    real(kind=prec), intent(out), target, contiguous:: uWin(:,:,:,:,:)

    (Np,Np,Np,nWinElem,nvar)

procedure, public :: Euler_timeIntegrator

  • public subroutine Euler_timeIntegrator(this, tn)

    Arguments

    TypeIntentOptionalAttributesName
    class(Model), intent(inout) :: this
    real(kind=prec), intent(in) :: tn

procedure, public :: FluxMethod => fluxmethod_DGModel3D_t

procedure, public :: ForwardStep => ForwardStep_Model

  • public subroutine ForwardStep_Model(this, tn, dt, ioInterval)

    Forward steps the model using the associated tendency procedure and time integrator

    Read more…

    Arguments

    TypeIntentOptionalAttributesName
    class(Model), intent(inout) :: this
    real(kind=prec), intent(in) :: tn
    real(kind=prec), intent(in) :: dt
    real(kind=prec), intent(in) :: ioInterval

procedure, public :: Free => Free_ECDGModel3D_t

procedure, public :: GetSimulationTime

  • public subroutine GetSimulationTime(this, t)

    Returns the current simulation time stored in the model % t attribute

    Arguments

    TypeIntentOptionalAttributesName
    class(Model), intent(in) :: this
    real(kind=prec), intent(out) :: t

procedure, public :: IncrementIOCounter

  • public subroutine IncrementIOCounter(this)

    Arguments

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

procedure, public :: Init => Init_ECDGModel3D_t

  • public subroutine Init_ECDGModel3D_t(this, mesh, geometry)

    Arguments

    TypeIntentOptionalAttributesName
    class(ECDGModel3D_t), intent(out) :: this
    type(Mesh3D), intent(in), target:: mesh
    type(SEMHex), intent(in), target:: geometry

procedure, public :: LowStorageRK2_timeIntegrator

  • public subroutine LowStorageRK2_timeIntegrator(this, tn)

    Arguments

    TypeIntentOptionalAttributesName
    class(Model), intent(inout) :: this
    real(kind=prec), intent(in) :: tn

procedure, public :: LowStorageRK3_timeIntegrator

  • public subroutine LowStorageRK3_timeIntegrator(this, tn)

    Arguments

    TypeIntentOptionalAttributesName
    class(Model), intent(inout) :: this
    real(kind=prec), intent(in) :: tn

procedure, public :: LowStorageRK4_timeIntegrator

  • public subroutine LowStorageRK4_timeIntegrator(this, tn)

    Arguments

    TypeIntentOptionalAttributesName
    class(Model), intent(inout) :: this
    real(kind=prec), intent(in) :: tn

procedure, public :: MapBoundaryConditions => MapBoundaryConditions_DGModel3D_t

  • public subroutine MapBoundaryConditions_DGModel3D_t(this)

    Scan the mesh sideInfo and populate the elements/sides arrays for each registered boundary condition.

    Arguments

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

procedure, public :: MigrateOldWindow => MigrateOldWindow_DGModel3D_t

  • public subroutine MigrateOldWindow_DGModel3D_t(this, winFirst, winLast, wFirst, wLast, nBytesRecv, nBytesSent, nElemRemote)

    Migrate the pre-regrid solution into this rank's old-element window, ready for a windowed ApplyTransferPlan. Call it BEFORE Regrid, which releases the storage the sends read:

    Read more…

    Arguments

    TypeIntentOptionalAttributesName
    class(DGModel3D_t), intent(inout) :: this
    integer, intent(in) :: winFirst(:)

    (1:nRanks) window lower bounds, from PlanWindows

    integer, intent(in) :: winLast(:)

    (1:nRanks) window upper bounds

    integer, intent(in) :: wFirst

    this rank's window (wFirst > wLast if empty)

    integer, intent(in) :: wLast
    integer(kind=int64), intent(inout) :: nBytesRecv
    integer(kind=int64), intent(inout) :: nBytesSent
    integer(kind=int64), intent(inout) :: nElemRemote

procedure, public :: PostStepHook => PostStepHook_Model

  • public subroutine PostStepHook_Model(this)

    PostStepHook is a template routine invoked by the time integrators once immediately after each completed time step (after this%t has advanced by this%dt). The default implementation is a no-op.

    Read more…

    Arguments

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

procedure, public :: PreStepHook => PreStepHook_Model

  • public subroutine PreStepHook_Model(this)

    PreStepHook is a template routine invoked by the time integrators once immediately before each time step is taken (before any Runge-Kutta stages of that step). The default implementation is a no-op.

    Read more…

    Arguments

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

procedure, public :: PreTendencyHook => PreTendencyHook_Model

  • public subroutine PreTendencyHook_Model(this)

    PreTendencyHook 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 PreTendencyHook simply returns back to the caller without executing any instructions

    Read more…

    Arguments

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

procedure, public :: PrintType => PrintType_Model

  • public subroutine PrintType_Model(this)

    Arguments

    TypeIntentOptionalAttributesName
    class(Model), intent(in) :: this

procedure, public :: ReadModel => Read_DGModel3D_t

  • public subroutine Read_DGModel3D_t(this, fileName)

    Arguments

    TypeIntentOptionalAttributesName
    class(DGModel3D_t), intent(inout) :: this
    character, intent(in) :: fileName

procedure, public :: Regrid => Regrid_DGModel3D_t

  • public subroutine Regrid_DGModel3D_t(this, mesh, geometry)

    Rebind a live model to a new mesh/geometry pair (AMR regrid). The mesh-sized solution storage is reallocated and the boundary-condition registrations and maps are rebuilt for the new mesh, while everything that is not mesh-sized is preserved: the time state (t, dt, entropy, IO counter), the time-integrator selection, configuration flags, and any model-specific parameters (Init is intent(out) and would reset all of these). nvar/nstepped are unchanged - the model solves the same equations on a new mesh.

    Read more…

    Arguments

    TypeIntentOptionalAttributesName
    class(DGModel3D_t), intent(inout) :: this
    type(Mesh3D), intent(in), target:: mesh
    type(SEMHex), intent(in), target:: geometry

procedure, public :: ReportEntropy => ReportEntropy_Model

  • public subroutine ReportEntropy_Model(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.

    Arguments

    TypeIntentOptionalAttributesName
    class(Model), intent(in) :: this

procedure, public :: ReportMetrics => ReportMetrics_DGModel3D_t

  • public subroutine ReportMetrics_DGModel3D_t(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.

    Arguments

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

procedure, public :: ReportUnmappedBoundaries => ReportUnmappedBoundaries_DGModel3D_t

  • public subroutine ReportUnmappedBoundaries_DGModel3D_t(this)

    Warn, once, about mesh boundary faces whose bcid has no registered boundary condition. MapBoundaryConditions establishes the count; ForwardStep calls this.

    Read more…

    Arguments

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

procedure, public :: ReportUserMetrics => ReportUserMetrics_Model

  • public subroutine ReportUserMetrics_Model(this)

    Method that can be overridden by users to report their own custom metrics after file io

    Arguments

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

procedure, public :: SetBoundaryCondition => setboundarycondition_DGModel3D_t

procedure, public :: SetDiffusion => SetDiffusion_ESAtmo3D_t

  • 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

procedure, public :: SetGradientBoundaryCondition => setgradientboundarycondition_DGModel3D_t

procedure, public :: SetHydrostaticBalance => SetHydrostaticBalance_ESAtmo3D_t

  • 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

procedure, public :: SetMetadata => SetMetadata_ESAtmo3D_t

procedure, public :: SetNumberOfVariables => SetNumberOfVariables_ESAtmo3D_t

  • 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

procedure, public :: SetSimulationTime

  • public subroutine SetSimulationTime(this, t)

    Sets the model % t attribute with the provided simulation time

    Arguments

    TypeIntentOptionalAttributesName
    class(Model), intent(inout) :: this
    real(kind=prec), intent(in) :: t

generic, public :: SetTimeIntegrator => SetTimeIntegrator_withChar

  • public subroutine SetTimeIntegrator_withChar(this, integrator)

    Sets the time integrator method, using a character input

    Read more…

    Arguments

    TypeIntentOptionalAttributesName
    class(Model), intent(inout) :: this
    character, intent(in) :: integrator

procedure, public :: SourceMethod => SourceMethod_ESAtmo3D_t

procedure, public :: StageSolutionForTransfer => StageSolutionForTransfer_DGModel3D_t

  • public subroutine StageSolutionForTransfer_DGModel3D_t(this)

    Preserve the current solution ahead of a regrid, so that Regrid may release the storage it lives in. Pair with ApplyTransferPlan, which consumes the staged copy:

    Read more…

    Arguments

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

procedure, public :: TwoPointFluxMethod => TwoPointFluxMethod_ESAtmo3D_t

  • 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

procedure, public :: UpdateGRK2 => UpdateGRK2_DGModel3D_t

procedure, public :: UpdateGRK3 => UpdateGRK3_DGModel3D_t

procedure, public :: UpdateGRK4 => UpdateGRK4_DGModel3D_t

procedure, public :: UpdateSolution => UpdateSolution_DGModel3D_t

  • public subroutine UpdateSolution_DGModel3D_t(this, dt)

    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)

    Arguments

    TypeIntentOptionalAttributesName
    class(DGModel3D_t), intent(inout) :: this
    real(kind=prec), intent(in), optional :: dt

procedure, public :: WriteModel => Write_DGModel3D_t

  • public subroutine Write_DGModel3D_t(this, fileName)

    Arguments

    TypeIntentOptionalAttributesName
    class(DGModel3D_t), intent(inout) :: this
    character, intent(in), optional :: fileName

procedure, public :: WriteTecplot => WriteTecplot_DGModel3D_t

  • public subroutine WriteTecplot_DGModel3D_t(this, filename)

    Arguments

    TypeIntentOptionalAttributesName
    class(DGModel3D_t), intent(inout) :: this
    character, intent(in), optional :: filename

procedure, public :: entropy_func => entropy_func_ESAtmo3D_t

  • 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)

procedure, public :: flux1D => flux1d_Model

  • public pure function flux1d_Model(this, s, dsdx) result(flux)

    Arguments

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

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

procedure, public :: flux2D => flux2d_Model

  • public pure function flux2d_Model(this, s, dsdx) result(flux)

    Arguments

    TypeIntentOptionalAttributesName
    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)

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

procedure, public :: flux3D => flux3d_Model

  • public pure function flux3d_Model(this, s, dsdx) result(flux)

    Arguments

    TypeIntentOptionalAttributesName
    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)

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

procedure, public :: riemannflux1d => riemannflux1d_Model

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

    Arguments

    TypeIntentOptionalAttributesName
    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

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

procedure, public :: riemannflux2d => riemannflux2d_Model

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

    Arguments

    TypeIntentOptionalAttributesName
    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)

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

procedure, public :: riemannflux3d => riemannflux3d_ESAtmo3D_t

  • 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)

procedure, public :: source1d => source1d_Model

  • public pure function source1d_Model(this, s, dsdx) result(source)

    Arguments

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

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

procedure, public :: source2d => source2d_Model

  • public pure function source2d_Model(this, s, dsdx) result(source)

    Arguments

    TypeIntentOptionalAttributesName
    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)

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

procedure, public :: source3d => source3d_Model

  • public pure function source3d_Model(this, s, dsdx) result(source)

    Arguments

    TypeIntentOptionalAttributesName
    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)

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

procedure, public :: twopointflux3d => twopointflux3d_ESAtmo3D_t

  • 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)

Source Code

  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