self_LinearEuler2D_t Module

This module defines a class that can be used to solve the Linear Euler equations in 2-D. The Linear Euler Equations, here, are the Euler equations linearized about a motionless background state.

The density anomaly is not carried as a solution variable: for a motionless background state it is slaved to the pressure through and never feeds back into the velocity or pressure dynamics, so only the velocity components and the pressure are forward-stepped. If the density anomaly is needed as a diagnostic, it can be recovered pointwise as .

The solution variables are

The sound speed , the background density and the relaxation rate are carried as solution variables so that they can vary in space (heterogeneous media, sponge/damping layers). Their flux and source are identically zero, so they are held fixed in time at each spatial location. This is entropy-stable for piecewise-constant material regions aligned with element boundaries: interiors have (so the flux-divergence form is exact) and the impedance-matched Riemann flux handles the jumps at faces.

The conservative flux is

and the source term is the linear relaxation ("sponge"/damping) term

where [s] is the inverse of a local damping time scale. With everywhere (the default, since the solution array is zero-initialized) the source vanishes identically and the model reduces to the undamped linear Euler system.


Uses

  • module~~self_lineareuler2d_t~~UsesGraph module~self_lineareuler2d_t self_LinearEuler2D_t module~self_mesh SELF_Mesh module~self_lineareuler2d_t->module~self_mesh module~self_boundaryconditions SELF_BoundaryConditions module~self_lineareuler2d_t->module~self_boundaryconditions module~self_dgmodel2d SELF_DGModel2D module~self_lineareuler2d_t->module~self_dgmodel2d module~self_model SELF_Model module~self_lineareuler2d_t->module~self_model module~self_constants SELF_Constants module~self_mesh->module~self_constants module~self_domaindecomposition SELF_DomainDecomposition module~self_mesh->module~self_domaindecomposition iso_c_binding iso_c_binding module~self_mesh->iso_c_binding module~self_supportroutines SELF_SupportRoutines module~self_boundaryconditions->module~self_supportroutines module~self_metadata SELF_Metadata module~self_boundaryconditions->module~self_metadata module~self_boundaryconditions->iso_c_binding module~self_dgmodel2d_t SELF_DGModel2D_t module~self_dgmodel2d->module~self_dgmodel2d_t module~self_model->module~self_supportroutines module~self_model->module~self_metadata module~self_hdf5 SELF_HDF5 module~self_model->module~self_hdf5 FEQParse FEQParse module~self_model->FEQParse HDF5 HDF5 module~self_model->HDF5 module~self_constants->iso_c_binding iso_fortran_env iso_fortran_env module~self_constants->iso_fortran_env module~self_domaindecomposition_t SELF_DomainDecomposition_t module~self_domaindecomposition->module~self_domaindecomposition_t module~self_supportroutines->module~self_constants module~self_supportroutines->iso_fortran_env module~self_metadata->module~self_hdf5 module~self_metadata->HDF5 module~self_dgmodel2d_t->module~self_boundaryconditions module~self_dgmodel2d_t->module~self_model module~self_dgmodel2d_t->module~self_supportroutines module~self_dgmodel2d_t->module~self_metadata module~self_dgmodel2d_t->module~self_hdf5 module~self_dgmodel2d_t->FEQParse module~self_dgmodel2d_t->HDF5 module~self_dgmodel2d_t->iso_fortran_env module~self_mesh_2d SELF_Mesh_2D module~self_dgmodel2d_t->module~self_mesh_2d module~self_mappedscalar_2d SELF_MappedScalar_2D module~self_dgmodel2d_t->module~self_mappedscalar_2d module~self_solutionmigration SELF_SolutionMigration module~self_dgmodel2d_t->module~self_solutionmigration module~self_transferplan_2d SELF_TransferPlan_2D module~self_dgmodel2d_t->module~self_transferplan_2d module~self_mappedvector_2d~2 SELF_MappedVector_2D module~self_dgmodel2d_t->module~self_mappedvector_2d~2 module~self_geometry_2d SELF_Geometry_2D module~self_dgmodel2d_t->module~self_geometry_2d module~self_hdf5->module~self_constants module~self_hdf5->HDF5 module~self_hdf5->iso_fortran_env mpi mpi module~self_hdf5->mpi module~self_domaindecomposition_t->module~self_constants module~self_domaindecomposition_t->module~self_supportroutines module~self_domaindecomposition_t->iso_c_binding module~self_domaindecomposition_t->mpi module~self_lagrange~2 SELF_Lagrange module~self_domaindecomposition_t->module~self_lagrange~2 module~self_mesh_2d_t SELF_Mesh_2D_t module~self_mesh_2d->module~self_mesh_2d_t module~self_mappedscalar_2d_t SELF_MappedScalar_2D_t module~self_mappedscalar_2d->module~self_mappedscalar_2d_t module~self_solutionmigration->module~self_constants module~self_solutionmigration->module~self_domaindecomposition module~self_solutionmigration->iso_fortran_env module~self_solutionmigration->mpi module~self_transferplan_2d->module~self_constants module~self_transferplan_2d->module~self_lagrange~2 module~self_quadtreemesh_2d SELF_QuadTreeMesh_2D module~self_transferplan_2d->module~self_quadtreemesh_2d module~self_solutiontransfer_2d SELF_SolutionTransfer_2D module~self_transferplan_2d->module~self_solutiontransfer_2d module~self_mappedvector_2d_t SELF_MappedVector_2D_t module~self_mappedvector_2d~2->module~self_mappedvector_2d_t module~self_geometry_2d->module~self_constants module~self_geometry_2d->module~self_supportroutines module~self_geometry_2d->module~self_mesh_2d module~self_geometry_2d->module~self_lagrange~2 module~self_data SELF_Data module~self_geometry_2d->module~self_data module~self_vector_2d SELF_Vector_2D module~self_geometry_2d->module~self_vector_2d module~self_tensor_2d SELF_Tensor_2D module~self_geometry_2d->module~self_tensor_2d module~self_scalar_2d~2 SELF_Scalar_2D module~self_geometry_2d->module~self_scalar_2d~2 module~self_lagrange~2->module~self_constants module~self_lagrange~2->iso_c_binding module~self_lagrange~2->iso_fortran_env module~self_lagrange_t SELF_Lagrange_t module~self_lagrange~2->module~self_lagrange_t module~self_mappedscalar_2d_t->module~self_constants module~self_mappedscalar_2d_t->module~self_domaindecomposition module~self_mappedscalar_2d_t->iso_c_binding module~self_mappedscalar_2d_t->FEQParse module~self_mappedscalar_2d_t->module~self_mesh_2d module~self_mappedscalar_2d_t->module~self_geometry_2d module~self_mappedscalar_2d_t->module~self_lagrange~2 module~self_mappedscalar_2d_t->module~self_tensor_2d module~self_mappedscalar_2d_t->module~self_scalar_2d~2 module~self_quadtreemesh_2d->module~self_constants module~self_quadtreemesh_2d->module~self_mesh_2d module~self_quadtreemesh_2d->module~self_lagrange~2 module~self_refinementprimitives_2d SELF_RefinementPrimitives_2D module~self_quadtreemesh_2d->module~self_refinementprimitives_2d module~self_mesh_2d_t->module~self_mesh module~self_mesh_2d_t->module~self_constants module~self_mesh_2d_t->module~self_domaindecomposition module~self_mesh_2d_t->module~self_supportroutines module~self_mesh_2d_t->iso_c_binding module~self_mesh_2d_t->module~self_hdf5 module~self_mesh_2d_t->HDF5 module~self_mesh_2d_t->module~self_lagrange~2 module~self_quadrature SELF_Quadrature module~self_mesh_2d_t->module~self_quadrature module~self_solutiontransfer_2d->module~self_constants module~self_solutiontransfer_2d->module~self_lagrange~2 module~self_mappedvector_2d_t->module~self_constants module~self_mappedvector_2d_t->module~self_domaindecomposition module~self_mappedvector_2d_t->iso_c_binding module~self_mappedvector_2d_t->FEQParse module~self_mappedvector_2d_t->module~self_mesh_2d module~self_mappedvector_2d_t->module~self_geometry_2d module~self_mappedvector_2d_t->module~self_lagrange~2 module~self_mappedvector_2d_t->module~self_vector_2d module~self_mappedvector_2d_t->module~self_tensor_2d module~self_data->module~self_constants module~self_data->module~self_metadata module~self_data->iso_c_binding module~self_data->module~self_hdf5 module~self_data->FEQParse module~self_data->HDF5 module~self_data->module~self_lagrange~2 module~self_vector_2d_t SELF_Vector_2D_t module~self_vector_2d->module~self_vector_2d_t module~self_tensor_2d_t SELF_Tensor_2D_t module~self_tensor_2d->module~self_tensor_2d_t module~self_scalar_2d~2->module~self_constants module~self_scalar_2d~2->iso_c_binding module~self_scalar_2d_t SELF_Scalar_2D_t module~self_scalar_2d~2->module~self_scalar_2d_t module~self_lagrange_t->module~self_constants module~self_lagrange_t->module~self_supportroutines module~self_lagrange_t->iso_c_binding module~self_lagrange_t->module~self_hdf5 module~self_lagrange_t->HDF5 module~self_lagrange_t->iso_fortran_env module~self_lagrange_t->module~self_quadrature module~self_vector_2d_t->module~self_constants module~self_vector_2d_t->module~self_metadata module~self_vector_2d_t->iso_c_binding module~self_vector_2d_t->module~self_hdf5 module~self_vector_2d_t->FEQParse module~self_vector_2d_t->HDF5 module~self_vector_2d_t->module~self_lagrange~2 module~self_vector_2d_t->module~self_data module~self_datapool SELF_DataPool module~self_vector_2d_t->module~self_datapool module~self_tensor_2d_t->module~self_constants module~self_tensor_2d_t->module~self_metadata module~self_tensor_2d_t->iso_c_binding module~self_tensor_2d_t->module~self_hdf5 module~self_tensor_2d_t->FEQParse module~self_tensor_2d_t->HDF5 module~self_tensor_2d_t->module~self_lagrange~2 module~self_tensor_2d_t->module~self_data module~self_tensor_2d_t->module~self_datapool module~self_refinementprimitives_2d->module~self_constants module~self_refinementprimitives_2d->module~self_lagrange~2 module~self_quadrature->module~self_constants module~self_quadrature->iso_fortran_env module~self_scalar_2d_t->module~self_constants module~self_scalar_2d_t->module~self_metadata module~self_scalar_2d_t->iso_c_binding module~self_scalar_2d_t->module~self_hdf5 module~self_scalar_2d_t->FEQParse module~self_scalar_2d_t->HDF5 module~self_scalar_2d_t->module~self_lagrange~2 module~self_scalar_2d_t->module~self_data module~self_scalar_2d_t->module~self_datapool module~self_datapool->module~self_constants

Used by

  • module~~self_lineareuler2d_t~~UsedByGraph module~self_lineareuler2d_t self_LinearEuler2D_t module~self_lineareuler2d_pml_t self_LinearEuler2D_PML_t module~self_lineareuler2d_pml_t->module~self_lineareuler2d_t module~self_lineareuler2d self_LinearEuler2D module~self_lineareuler2d->module~self_lineareuler2d_t module~self_lineareuler2d~2 self_LinearEuler2D module~self_lineareuler2d~2->module~self_lineareuler2d_t module~self_lineareuler2d_pml~2 self_LinearEuler2D_PML module~self_lineareuler2d_pml~2->module~self_lineareuler2d_pml_t module~self_lineareuler2d_pml self_LinearEuler2D_PML module~self_lineareuler2d_pml->module~self_lineareuler2d_pml_t

Contents


Derived Types

type, public, extends(DGModel2D) :: LinearEuler2D_t

Components

TypeVisibilityAttributesNameInitial
type(MappedScalar2D), public :: dSdt
real(kind=prec), public :: dt
real(kind=prec), public :: entropy
type(MappedVector2D), public :: flux
type(MappedScalar2D), public :: fluxDivergence
real(kind=prec), public :: g =0.0_prec
type(SEMQuad), public, pointer:: geometry=> null()
logical, public :: gradient_enabled =.false.
type(BoundaryConditionList), public :: hyperbolicBCs
integer, public :: ioIterate =0
type(Mesh2D), public, pointer:: mesh=> null()
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
integer, public :: nvar
type(BoundaryConditionList), public :: parabolicBCs

Mesh boundary edges 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 an edge, 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.
real(kind=prec), public :: rho0 =1.0_prec
type(MappedScalar2D), public :: solution
type(MappedVector2D), public :: solutionGradient
type(MappedScalar2D), 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.

logical, public :: unmappedBoundariesReported =.false.

Pre-regrid copy of the solution, held between StageSolutionForTransfer and ApplyTransferPlan so that Regrid is free to release the storage it was read from. The base implementation stages on the host; the GPU backend overrides both procedures and stages device-side instead, leaving this unallocated.

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(MappedScalar2D), public :: workSol

Type-Bound Procedures

procedure, public :: AdditionalFree => AdditionalFree_Model
procedure, public :: AdditionalInit => AdditionalInit_LinearEuler2D_t
procedure, public :: AdditionalOutput => AdditionalOutput_Model
procedure, public :: ApplyTransferPlan => ApplyTransferPlan_DGModel2D_t
procedure, public :: BoundaryFlux => BoundaryFlux_DGModel2D_t
procedure, public :: CalculateEntropy => CalculateEntropy_DGModel2D_t
procedure, public :: CalculateSolutionGradient => CalculateSolutionGradient_DGModel2D_t
procedure, public :: CalculateTendency => CalculateTendency_DGModel2D_t
procedure, public :: DownloadOldWindow => DownloadOldWindow_DGModel2D_t
procedure, public :: Euler_timeIntegrator
procedure, public :: FluxMethod => fluxmethod_DGModel2D_t
procedure, public :: ForwardStep => ForwardStep_Model
procedure, public :: Free => Free_DGModel2D_t
procedure, public :: GetSimulationTime
procedure, public :: IncrementIOCounter
procedure, public :: Init => Init_DGModel2D_t
procedure, public :: LowStorageRK2_timeIntegrator
procedure, public :: LowStorageRK3_timeIntegrator
procedure, public :: LowStorageRK4_timeIntegrator
procedure, public :: MapBoundaryConditions => MapBoundaryConditions_DGModel2D_t
procedure, public :: MigrateOldWindow => MigrateOldWindow_DGModel2D_t
procedure, public :: PostStepHook => PostStepHook_Model
procedure, public :: PreStepHook => PreStepHook_Model
procedure, public :: PreTendencyHook => PreTendencyHook_Model
procedure, public :: PrintType => PrintType_Model
procedure, public :: ReadModel => Read_DGModel2D_t
procedure, public :: Regrid => Regrid_DGModel2D_t
procedure, public :: ReportEntropy => ReportEntropy_Model
procedure, public :: ReportMetrics => ReportMetrics_DGModel2D_t
procedure, public :: ReportUnmappedBoundaries => ReportUnmappedBoundaries_DGModel2D_t
procedure, public :: ReportUserMetrics => ReportUserMetrics_Model
procedure, public :: SetBoundaryCondition => setboundarycondition_DGModel2D_t
procedure, public :: SetGradientBoundaryCondition => setgradientboundarycondition_DGModel2D_t
procedure, public :: SetMetadata => SetMetadata_LinearEuler2D_t
procedure, public :: SetNumberOfVariables => SetNumberOfVariables_LinearEuler2D_t
procedure, public :: SetSimulationTime
generic, public :: SetSolution => SetSolutionFromChar_DGModel2D_t, SetSolutionFromEqn_DGModel2D_t
generic, public :: SetTimeIntegrator => SetTimeIntegrator_withChar
procedure, public :: SourceMethod => sourcemethod_LinearEuler2D_t
procedure, public :: SphericalSoundWave => SphericalSoundWave_LinearEuler2D_t
procedure, public :: StageSolutionForTransfer => StageSolutionForTransfer_DGModel2D_t
procedure, public :: UpdateGRK2 => UpdateGRK2_DGModel2D_t
procedure, public :: UpdateGRK3 => UpdateGRK3_DGModel2D_t
procedure, public :: UpdateGRK4 => UpdateGRK4_DGModel2D_t
procedure, public :: UpdateSolution => UpdateSolution_DGModel2D_t
procedure, public :: WriteModel => Write_DGModel2D_t
procedure, public :: WriteTecplot => WriteTecplot_DGModel2D_t
procedure, public :: entropy_func => entropy_func_LinearEuler2D_t
procedure, public :: flux1D => flux1d_Model
procedure, public :: flux2d => flux2d_LinearEuler2D_t
procedure, public :: flux3D => flux3d_Model
procedure, public :: riemannflux1d => riemannflux1d_Model
procedure, public :: riemannflux2d => riemannflux2d_LinearEuler2D_t
procedure, public :: riemannflux3d => riemannflux3d_Model
procedure, public :: source1d => source1d_Model
procedure, public :: source2d => source2d_Model
procedure, public :: source3d => source3d_Model

Functions

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

The entropy function is the sum of kinetic and internal energy For the linear model, this is

Read more…

Arguments

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

Return Value real(kind=prec)

public pure function flux2d_LinearEuler2D_t(this, s, dsdx) result(flux)

Arguments

TypeIntentOptionalAttributesName
class(LinearEuler2D_t), 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)

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

Characteristic-decomposition (impedance-matched) interface flux for linear acoustics with possibly discontinuous sound speed.

Read more…

Arguments

TypeIntentOptionalAttributesName
class(LinearEuler2D_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:2)
real(kind=prec), intent(in) :: nhat(1:2)

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


Subroutines

public subroutine AdditionalInit_LinearEuler2D_t(this)

Register the (CPU) no-normal-flow and radiation boundary conditions. GPU builds call this parent and then overwrite both registrations with the device kernels in AdditionalInit_LinearEuler2D.

Arguments

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

public subroutine SetMetadata_LinearEuler2D_t(this)

Arguments

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

public subroutine SetNumberOfVariables_LinearEuler2D_t(this)

Arguments

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

public subroutine SphericalSoundWave_LinearEuler2D_t(this, rhoprime, Lr, x0, y0, c)

This subroutine sets the initial condition for a weak blast wave problem. The initial condition is given by

Read more…

Arguments

TypeIntentOptionalAttributesName
class(LinearEuler2D_t), intent(inout) :: this
real(kind=prec), intent(in) :: rhoprime
real(kind=prec), intent(in) :: Lr
real(kind=prec), intent(in) :: x0
real(kind=prec), intent(in) :: y0
real(kind=prec), intent(in) :: c

public subroutine hbc2d_NoNormalFlow_LinearEuler2D(bc, mymodel)

No-normal-flow boundary condition for 2D linear Euler equations. Reflects the velocity vector about the boundary normal while preserving pressure, sound speed, background density, and the relaxation rate.

Arguments

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

public subroutine hbc2d_Radiation_LinearEuler2D(bc, mymodel)

Radiation BC: zero acoustic perturbation in the exterior state; the sound speed (variable 4), background density (variable 5) and relaxation rate (variable 6) are copied from the interior side so the Riemann solver sees a consistent c and rho0 (impedance-matched, non-reflecting outflow) and the exterior state stays a faithful mirror of the interior one for diagnostics. The relaxation rate carries no flux, so its exterior value never enters the tendency.

Arguments

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

public subroutine sourcemethod_LinearEuler2D_t(this)

Spatially-dependent linear relaxation (sponge / damping layer) source.

Read more…

Arguments

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