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 and the background density are carried as solution variables so that they can vary in space (heterogeneous media). 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 terms are null.
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| 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 | |||
| logical, | public | :: | gradient_enabled | = | .false. | ||
| type(BoundaryConditionList), | public | :: | hyperbolicBCs | ||||
| integer, | public | :: | ioIterate | = | 0 | ||
| type(Mesh2D), | public, | pointer | :: | mesh | |||
| integer, | public | :: | nstepped | = | 0 | ||
| integer, | public | :: | nvar | ||||
| type(BoundaryConditionList), | public | :: | parabolicBCs | ||||
| 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 | |
| type(MappedScalar2D), | public | :: | workSol |
| procedure, public :: AdditionalFree => AdditionalFree_Model | |
| procedure, public :: AdditionalInit => AdditionalInit_LinearEuler2D_t | |
| procedure, public :: AdditionalOutput => AdditionalOutput_Model | |
| 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 :: 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 :: 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 :: ReportEntropy => ReportEntropy_Model | |
| procedure, public :: ReportMetrics => ReportMetrics_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_DGModel2D_t | |
| procedure, public :: SphericalSoundWave => SphericalSoundWave_LinearEuler2D_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 |
The entropy function is the sum of kinetic and internal energy For the linear model, this is
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(LinearEuler2D_t), | intent(in) | :: | this | |||
| real(kind=prec), | intent(in) | :: | s(1:this%nvar) |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| 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) |
Characteristic-decomposition (impedance-matched) interface flux for linear acoustics with possibly discontinuous sound speed.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| 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) |
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.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(LinearEuler2D_t), | intent(inout) | :: | this |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(LinearEuler2D_t), | intent(inout) | :: | this |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(LinearEuler2D_t), | intent(inout) | :: | this |
This subroutine sets the initial condition for a weak blast wave problem. The initial condition is given by
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| 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 |
No-normal-flow boundary condition for 2D linear Euler equations. Reflects the velocity vector about the boundary normal while preserving pressure, sound speed, and background density.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(BoundaryCondition), | intent(in) | :: | bc | |||
| class(Model), | intent(inout) | :: | mymodel |
Radiation BC: zero acoustic perturbation in the exterior state; the sound speed (variable 4) and background density (variable 5) are copied from the interior side so the Riemann solver sees a consistent c and rho0 (impedance-matched, non-reflecting outflow).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(BoundaryCondition), | intent(in) | :: | bc | |||
| class(Model), | intent(inout) | :: | mymodel |