Observation
When using a forward-Euler method for the time integration of the momentum equation for an inviscid-flow, it appears that the kinetic energy of the flow grows unbounded in time, regardless of the timestep size.
Problem Statement
Estimate the change in total kinetic energy when using forward-Euler to integrate the Euler momentum equations in a periodic box.
Approach
To solve this problem, we need to do the following:
- Formulate a FE semi-discrete formula for the Euler equations.
- Construct the local kinetic energy (i.e. pointwise) by taking the dot product of the semi-discrete velocity field.
- Using this information, construct an equation for the change in total kinetic energy with time, e.g. ${\displaystyle \frac{\Delta K}{\Delta t}} $.
- Analyze the right-hand-side (RHS) of this equation in the context of a periodic box. If the RHS > 0, then the kinetic energy will increase.
Show Me the Math
It is best to use tensor notation for this problem. We start with the Euler equations
∂ui∂xi=0
∂ui∂t=−uj∂ui∂xj−∂p∂xi≡Fi
where $i\in\{1,2,3\}$ denotes the $i^{\text{th}}$ spatial direction.
Using forward-euler time integration, we construct the semi-discrete formula
un+1i−uniΔt+O(Δt)=Fni;Fni≡unj∂uni∂xj+∂pn∂xi
where $t^{n+1}=t^{n}+\Delta t$ and $\Delta t$ is the fixed timestep size. For simplity of the exposition, we drop the “order” notation and set
un+1i=uni−ΔtFni
Now, in a staggered arrangement, the kinetic energy lives at cell centers while the velocity components are stored on staggered volumes. For simpliciy, we assume a uniform, staggered grid. Consequently, the staggered-volumes coincide with the faces of the cell centered ones. Then, one calculates the local kinetic energy, $k$, as
k=12uiui=12(u21+u22+u23)
where Einstein summation is implied on repeated inidces. Note that the local kinetic energy is defined as the pointwise kinetic energy – the kinetic energy in every cell. Now, we can formulate the following sub-problem: given a discrete velocity field $u_{i}^{n}$ such that $\frac{\partial u_{i}^{n}}{\partial x_{i}}=0$ (discretely), estimate the kinetic energy, $ k^{n+1}$, at the next timestep. In other words, use (???) to calculate $k^{n+1}$.
We start by multiplying (???) through with $u_{i}^{n+1}$, we have
un+1iun+1i=un+1i(uni−ΔtFni)
Or, using $k=\frac{1}{2}u_{i}u_{i}$, we have
2kn+1=(uni−ΔtFni)(uni−ΔtFni)
Expanding the right-hand-side, we get
2kn+1=uniuni−2ΔtuniFni+Δt2FniFni
or
2kn+1=2kn−2ΔtuniFni+Δt2FniFni
We now rearrange (???) as follows
kn+1−knΔt=−uniFni+12ΔtFniFni
or
ΔkΔt=−uniFni+12ΔtFniFni
This equation tells us how much the implied kinetic energy changes with time. It is an implied kinetic energy equation given that it was constructed from the velocity field not from the transported kinetic energy.
We now focus our attention on the first term in the RHS of (???), i.e. $u_{i}^{n}F_{i}^{n}$. Substituting for $F_{i}^{n}$, we have
uniFni=uni(unj∂uni∂xj+∂pn∂xi)=uniunj∂uni∂xj+uni∂pn∂xi
The purpose now is to try to convert this term into a divergence form. We will see why later. Starting with the first term $u_{i}^{n}u_{j}^{n}\frac{\partial u_{i}^{n}}{\partial x_{j}}$, we know that
∂uniuniunj∂xj=uniuni∂unj∂xj+unj∂uniuni∂xj=uniuni∂unj∂xj+2uniunj∂uni∂xj
But, assuming that continuity is satified discretely at every cell, we can set $\frac{\partial u_{j}^{n}}{\partial x_{j}}=0$. Then, we recover
uniunj∂uni∂xj=12∂uniuniunj∂xj=∂knunj∂xj
Lastly, the second term in (???) is easily replaced by
uni∂pn∂xi=∂unipn∂xi−pn∂uni∂xi
Again, by assuming that continuity is satisfied discretely, we can drop the last term in the previous equation and use
uni∂pn∂xi=∂unipn∂xi
Upon substitution of the modified terms back into the implied kinetic energy equation (???), we have
ΔkΔt=−∂knunj∂xj−∂unipn∂xi+12ΔtFniFni
In principle, for an inviscid flow in a period box, there should be no production or dissipation of total kinetic energy. The total kinetic energy is defined as the volumetric integral of $k$ over the domain, i.e.
K=∫VkdV
Since there is no production or dissipation in our problem, we expect that $\text{K}=const$ or
∂∂t∫VkdV=0
Looking at our semi-discrete equation, upon integration over the periodic box, we have
ΔΔt∫VkdV=−∫V∂knunj∂xjdV−∫V∂unipn∂xidV+12Δt∫VFniFnidV
Being periodic, we have, for any vector $\mathbf{v}$,
∫V∇⋅vdV=∫V∂vi∂xidV=∫Sv⋅ndS=0
Then, all terms that are written in divergence form vanish identically. Hence, one is left with,
ΔKΔt=12Δt∫VFniFnidV≥0
and therefore, the total kinetic energy grows unboundedly with time when using a forward-Euler scheme on the Euler equations, in a periodic box.