Description of the Euler equation system for inviscid compressible flows.
The flow field is described in terms of the conservative variables density, momentum and energy. The Euler equations require the definition of the following parameters:
isen_coef
r
cv
numflux
linear_limit
linearization_indicator
ensure_positivity
porosity
viscous_permeability
thermal_permeability
material
There are three different implementations for the numerical flux available:
It is possible to adaptively linearize the flux in elements according to its
state. This is activated by setting the linear_limit
to some value larger
than 0. The default is to use no adaptive linearization (linear_limit=0
).
There are three different indicators available that may be used to decide the
linearization of elements. linearization_indicator
may be:
The deviations are considered in relation to the cell mean value. Thus,
setting linear_limit = 0.01
and linearization_indicator = 'density'
would only compute the linearized flux in elements where the maximal
deviation of the state is guaranteed to be less or equal to one percent
of the mean density in that cell.
For the material the following variables need to be defined:
characteristic
masking function, has to 1 where a geometry is to be found
and 0 elsewhere.relax_velocity
the velocity of the objectrelax_temperature
the temperature of the objectIf the characteristic
is 0 everywhere, the other settings are irrelevant.
Each material component is of tem_variable_type. However, these can be
also simply defined as space-time functions, which can just be constants.
See the tem_variable_module and tem_spacetime_fun_module for more
details.
If ensure_positivity = true
is set, the state will be scaled such that the
deviation of the state is guaranteed to be smaller than the mean for density
and energy such that these are positive.
While this is a computationally cheap measure, you should be aware that it is
not sufficient to avoid unphysical states, as the pressure may still be
negative.
The following equation names are implementing the Euler equations and require the settings described above:
euler
(3D)euler_2d
(2D)euler_1d
(1D)loclineuler
Locally linearized (3D)loclineuler_1d
Locally linearized (1D)The locally linearized variants use fluxes linearized to the cell means within the elements, while between elements the nonlinear flux is computed.
An example configuration for Euler equations is shown below:
```lua gamma = 1.4 -- isentropic expansion coefficient R = 1.0 -- gas constant equation = { name = 'euler', isen_coef = gamma, r = R, cv = R/(gamma-1), numflux = 'hll',
linear_limit = 0.001,
linearization_indicator = 'error',
ensure_positivity = false, -- Ensure that density and energy remain
-- positive by only considering higher modes up
-- to the point where positivity is guaranteed.
porosity = 1.0, -- Porosity to use in material modelling for
-- wall representation in elements.
viscous_permeability = 1.0e-6, -- Viscous permeability for the porous
-- medium to represent wall geometries in
-- elements.
thermal_permeability = 1.0e-3, -- Thermal permeability for the material to
-- represent walls.
material = {
-- Description of the material distribution to define obstacles inside
-- the domain.
characteristic = 0.0, -- Masking function (may be a variable) that
-- describes where Material is to be found
-- (Chi(x,y,z)), should be 1 inside material and 0
-- everywhere else.
relax_velocity = {0, 0, 0}, -- Velocity of the obstacle.
relax_temperature = 0.0 -- Temperature of the obstacle.
}
}
Computation of indicator, whether a linear flux is sufficient.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(atl_euler_type), | intent(in) | :: | euler |
Description of the equation |
||
real(kind=rk), | intent(in) | :: | mean(:) |
The mean value of each state |
||
real(kind=rk), | intent(in) | :: | deviation(:) |
Maximal deviation of each state |
Interface definition for numerical fluxes.
Todo
HK: should be vectorized to reduce overheads.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(atl_euler_type), | intent(in) | :: | euler |
The global equation specific settings. |
||
real(kind=rk), | intent(in) | :: | state_left(:,:) |
State on the left side of the interface. First index has to correspond with nPoints, second with number of variables. |
||
real(kind=rk), | intent(in) | :: | state_right(:,:) |
State on the right side of the interface. First index has to correspond with nPoints, second with number of variables. |
||
real(kind=rk), | intent(in) | :: | material_left(:,:) |
Material definition on the left of the interface. First index corresponds to nPoints or is 1 for constant material, second index has to correspond with number of material settings. |
||
real(kind=rk), | intent(in) | :: | material_right(:,:) |
Material definition on the right of the interface. First index corresponds to nPoints or is 1 for constant material, second index has to correspond with number of material settings. |
||
integer, | intent(in) | :: | nPoints |
Number of points to evaluate the flux at. |
||
real(kind=rk), | intent(out) | :: | flux(:,:) |
Resulting flux. First index has to correspond with nPoints, second with number of variables. |
The Euler equation properties are stored here
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
real(kind=rk), | public | :: | isen_coef |
Isentropic coefficient |
|||
real(kind=rk), | public | :: | r |
Ideal gas constant |
|||
real(kind=rk), | public | :: | cv |
Heat capacity |
|||
real(kind=rk), | public | :: | linear_limit |
Limit in energy variation up to which a linearization is to be allowed in elements. |
|||
logical, | public | :: | ensure_positivity |
Ensure that polynomials for density and energy are everywhere positive after transfer to oversampled space. |
|||
logical, | public | :: | adaptive_timestep |
Flag for adaptive timestep calculation |
|||
real(kind=rk), | public | :: | porosity |
Porosity (for the continuity equation) |
|||
real(kind=rk), | public | :: | viscous_permeability |
Porosity for the momentum transport |
|||
real(kind=rk), | public | :: | thermal_permeability |
Porosity for the heat transport |
|||
procedure(euler_numflux), | public, | pointer, pass(euler) | :: | numflux | => | NULL() |
Procedure to compute the numerical flux for the equation at hand. |
procedure(linearization_indicator), | public, | pointer, pass(euler) | :: | linear | => | NULL() |
Function to decide, whether linearized flux computation would be tolerable. |
Subroutine to initialize an equation of type euler equation as defined in the configuration file
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(atl_euler_type), | intent(out) | :: | euler |
Resulting description of the Euler equation parameters. |
||
type(flu_State) | :: | conf |
Handle to the configuration script, to load the parameters from. |
|||
integer, | intent(in) | :: | eq_table |
Handle to the table containing the description for the equation system. |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(atl_euler_type), | intent(in) | :: | me | |||
character(len=*), | intent(in) | :: | eqn_name | |||
type(aot_out_type) | :: | conf | ||||
logical, | intent(in), | optional | :: | withName |
Defines whether or not to print the equation name. Default is true. |