7.3. Compressible Euler Equations¶
7.3.1. Introduction¶
The compressible Euler equations are equations for perfect fluid.
Perfect fluids have no heat conduction () and no
viscosity (
), so in the comoving frame the stress energy tensor
is:
(we use ). Relativistic Euler equations are
given by the conservation of the stress energy tensor and the particle number
conservation:
By doing the nonrelativistic limit (see Perfect Fluids for a detailed derivation), we get the following Euler equations:
where
is the total energy per unit volume, composed of the kinetic energy per unit
volume () and the internal energy per unit volume (
),
where
is the internal energy per unit mass (
). The energy
doesn’t contain the rest mass energy, but all other energies are hidden in
the internal energy.
We use the ideal gas equations, so:
where
is the number of moles of gas,
is the molar mass of the gas (i.e. a mass of one mole of the gas, e.g. for
dry air we get
, as it is mainly composed of 20% of oxygen
with atomic mass 16 and 78% of nitrogen with atomic mass
, both form
diatomic molecules, so the molecular mass is twice the atomic mass
giving the total of
, the rest is
given by the other components and one also has to average over all isotopes),
is the ideal gas constant
(
is the Avogadro constant and
is the Boltzmann constant),
is the specific ideal gas constant (e.g. for dry air we get
),
is the density of the gas (e.g. for dry air at
the pressure
and temperature
we get
),
is the specific heat capacity at constant volume (i.e. the amount of
energy needed to heat one kg by one Kelvin at constant volume, e.g. for dry air
the experimental value is about
),
is the volume
and
is the temperature of the gas.
Of those,
,
,
,
,
are constants,
,
,
and
are
functions of
.
Here are the SI units of the various terms in the Euler equations:
In order to calculate the specific heat ratio , we use
:
and the speed of sound is:
7.3.2. Dimensionless Euler Equations¶
We choose 3 constants ,
and
- characteristic length of the
domain, velocity and density. Now we multiply the Euler equations with proper
combinations of these constants as follows:
This is equal to:
where:
In particular, if , then
So the dimensionless Euler equations look exactly the same as the original ones, we just need to rescale all the quantities using the relations above.
7.3.3. Conservative Form of the Euler Equations¶
We can write the Euler equations as:
where:
We solve for the unknowns ,
,
,
and
as functions of
, the rest (
,
,
,
,
) are either constants
or depend on the unknowns. In order to convert from the physical quantities
,
,
,
,
and
to
, …,
, we use:
the opposite conversion is:
Sometimes people also use ,
and
instead of
,
and
.
Note: , where
is the fluid density current
(it’s a 3-vector) and also
(here
is the same as
, e.g. we are a bit sloppy about the notation), where
is the
density 4-current (e.g. the first 4 components of
are exactly the
components of the 4-current
):
where as usual is the relativistic index,
is the speed
of light, and in the nonrelativistic limit (
) we get
and the remaining
in
will cancel with
in
,
so it will not be present in the final equations (that involve terms like
). We can also just set
as usual in relativistic
physics.
7.3.4. Weak Formulation¶
The Euler equations:
are nonlinear. The time-derivative is approximated using the implicit Euler method
The vector-valued test functions for the above system of equations have the form:
After multiplying the equation system with the test functions and integrating
over the domain , we obtain (here the index
is
numbering the 5 equations, so we are not summing over it):
Now we integrate by parts:
where is the outward surface normal to
. Rearranging:
We can then linearize this for example by taking the flux jacobians
on the previous time level
.
The finite element formulation is obtained from here by replacing in the
standard way the unknown solution by a piecewise-polynomial unknown
function
where are the basis functions of the piecewise-polynomial finite
element space. This turns the above weak formulation into a finite number of
nonlinear algebraic equations of the form
that will be solved using
the Newton’s method.
Explicit Method¶
We also derive the weak formulation for the explicit method. Euler equations:
The time-derivative is approximated using the explicit Euler method
The vector-valued test functions for the above system of equations have the form:
After multiplying the equation system with the test functions and integrating
over the domain , we obtain (here the index
is
numbering the 5 equations, so we are not summing over it):
Now we integrate by parts:
where is the outward surface normal to
. Rearranging:
7.3.5. Flux Jacobians¶
Now we write the spatial derivatives using the so called flux Jacobians
,
and
:
Similarly for and
, so we get:
One nice thing about these particular
,
and
functions is that they are homogeneous of degree 1:
so the Euler equation/formula for the homogeneous function is:
So both the and it’s derivative can be nicely factored out using
the flux Jacobian:
by differentiating the first equation and substracting the second, we get:
similarly for and
.
To calculate the Jacobians, we’ll need:
then we can calculate the Jacobians (and we substitute for ):
7.3.6. 2D Version of the Equations¶
where:
Discretizing the time derivative:
The vector-valued test functions for the above system of equations have the form:
After multiplying the equation system with the test functions and integrating
over the domain , we obtain:
Now we integrate by parts:
where is the outward surface normal to
. Rearranging:
The 2D flux Jacobians are:
7.3.7. Sea Breeze Modeling¶
In our 2D model we make the following assumptions:
and the boundary condition is as follows:
The weak formulation in 2D is (here ):
In order to specify the input forms for Hermes, we’ll write the weak formulation as:
where the forms are (we write instead of
):
In the last expression we do not sum over nor
.
In particular:
7.3.8. Boundary Conditions¶
We rewrite the boundary integral by rotating coordinates, so that
the flow is only in the direction (thus we only have
):
Now we need to approximate somehow.
We do that by solving the following 1D problem (Riemann problem):
or:
(7.3.8.1)¶
And we approximate . The initial
condition is:
Now we write:
and substitute into (7.3.8.1):
so we get:
This is a nonlinear problem, that cannot be solved exactly. First,
let doesn’t depend on
. Then also
are constants:
and the solution is constant along the characteristic
for
and we get:
and
so:
In the nonlinear case we cannot solve it exactly, but we can approximate the solution by:
(7.3.8.2)¶
Let’s say the domain is for and we are applying the BC condition from
. Then
is taken from the solution and
is
prescribed, for example at the bottom it could be:
Now we need to calculate . First we write:
Explicit forms of the matrices:
For :
For :
Boundary Conditions for the Sea Breeze Model¶
In the boundary (line) integral we prescribe using a Dirichlet
condition and calculate it at each iteration using:
where is a known function of time (it changes with the day and night)
and also prescribe
on the left and right end of the domain and
at the top and bottom.
All the surface integrals turn out to be zero. On the top and bottom edges we
have respectively and we prescribe
,
so we get (remember we do not sum over
):
where:
So all the components of the surface integral are zero, and for
the test function
is not there, because we prescribe the Dirichlet
BC
, so the surface integral vanishes for all
.
Similarly on the left and right edges we
have respectively and we prescribe
,
so we get (remember we do not sum over
):
where:
So all the components of the surface integral are zero, and for
the test function
is not there, because we prescribe the Dirichlet
BC
, so the surface integral vanishes for all
.
7.3.9. Newton Method¶
The residual is:
where numbers the equations,
numbers the
finite element basis functions,
,
.
The Jacobian is:
And the Newton method then is:
7.3.10. Older notes¶
Author: Pavel Solin
Governing Equations and Boundary Conditions¶
(7.3.10.1)¶
where is the air density,
is the velocity,
,
,
is the temperature,
, and
is the gravitational acceleration constant. We use the perfect gas state
equation
for the pressure.
Boundary conditions are prescribed as follows:
edge
:
,
,
,
edges
:
,
,
,
edge
:
,
,
,
Initial conditions have the form
Discretization and the Newton’s Method¶
We will use the implicit Euler method in time, i.e.,
etc. Let’s discuss one equation of (7.3.10.1) at a time:
Continuity equation: The weak formulation of
reads
(7.3.10.2)¶
The global coefficient vector consists of four parts
,
,
and
corresponding to the fields
,
,
and
, respectively.
The same holds for the vector function
which consists of four parts
,
,
and
. Thus the global Jacobi matrix will have a four-by-four block structure. We
denote
(7.3.10.3)¶
It follows from (7.3.10.2) and (7.3.10.3) that
First momentum equation: The second equation of (7.3.10.1) has the form
After applying the implicit Euler method, we obtain
Thus we obtain
Analogously,
Second momentum equation: The third equation of (7.3.10.1) reads
After applying the implicit Euler method, we obtain
Thus we obtain
Analogously,
Internal energy equation: The last equation of (7.3.10.1) has the form
where . This can be written equivalently as
Written in terms of single derivatives, this is
i.e.,
Weak formulation:
For the derivatives of the weak form we obtain: