Hydrodynamics tutorial SS 2018

Assignment sheet 2

Hand-out 18.04.2018 Hand-in 24.04.2018

Total points: 30 Punkte

Exercise 1 2 Total

Points

• Work in groups of 2 – 4 people. • The assignment sheet has to be handed in directly before the start of the tutorial. • For a successful participation 50 % of the points of all assignment sheets have to be reached. • You have to be able to present exercises you handed-in. Over the course you have to present at least 3 exercises on the black board. • Note all names on the assignment sheet. • Hand-in the printed assignemt sheet with the solution. • For programming exercises, send the programm (source code plus compiled exe- cutable) to the email address given on the assignmet sheet before the start of the tutorial.

1 Barometric formula [10 Points]

The barometric formula, sometimes called isothermal , is used to model how the or of air changes with . 1. Write down the Euler equation considering the gravitational acceleration on Earth for the hydrostatic case. 2. Solve this equation assuming an incompressible fluid. What force acts on a swimmer resting at the bottom of a lake with depth h = 5 m, if the density of water is ρ = 1 g cm−3? 3. Now consider an ideal fluid where ρ = P and solve the hydrostatic Euler equation. kBT 5 4. Plot the pressure as a function of height if the pressure at sea level is P0 = 10 Pa and the temperature is T = 285 K. 2 Rotating fluid [10 Points]

Imagine a fluid with constant density in uniform rotation around a fixed z-axis, ~v = ~ω × ~r and ~ω = ω0 ~ez, for instance a rotating bucket of water. We assume an ideal fluid and neglect shear flows within the fluid. As an external force we only consider the gravitational acceleration along the rotation axis. Take into account that the velocity field is time- independent in uniform rotation.

1. Compute the pressure as a function of radius on top of the fluid. Hint: use vector identities.

2. Plot the solution for three different values of ω

Preparations of an implementation of a 1D FV Euler solver

In this tutorial we will lay the foundation for a fully operational computational fluid dynamics code. Later exercises will complete the 1D code and extend it to 2D. We will also give bonus exercises for experienced users that will contain extending the code to three- spatial dimensions, increase accuracy of the code by using reconstruction and potentially, implement an efficient parallelization that would allow you to run your code on the largest supercomputers available. Many problems in natural sciences and engineering are modeled following a simple prin- ciple: The time rate of change of a quantity of interest q in a fixed volume is equal to the flux of q across the boundary of this volume. This simple principle gives the integral form of a conservation law, d Z I q dx = − f~ · ~n ds, (1) dt Ω ∂Ω where the flux f~, and the normal vector ~n point outwards of the d-dimensional domain Ω ⊂ Rd. The conserved quantities of the Euler equations are the mass, energy, and momenta. If we assume that f~ is smooth (differentiable!) in space, we can apply Gauss’ law to the surface integral and get d Z Z q dx = − ∇~ · f~ dx. (2) dt Ω Ω Since this conservation law holds for all domains Ω, we can simplify this into a partial differential equation (PDE) form,

~ ~ qt + ∇ · f = 0, (3)

where we use the subscript (·)t as an abbreviation for the temporal derivative. In one dimension, (3) simplifies to

qt + fx = 0. (4) From the lecture we know that, in one dimension, the compressible Euler equations are given by     ρ ρvx 2 ρvx  ρvx + p    ~   ~q = ρvy , f =  ρvxvy  (5)     ρvz   ρvxvz  1 2 γp E u( 2 ρk~vk + γ−1 ) so we can write the full system as       ρ ρvx 0 2 ρvx  ρvx + p  0 ∂   ∂     ρvy +  ρvxvy  = 0 . (6) ∂t   ∂x     ρvz   ρvxvz  0 1 2 γp E u( 2 ρk~vk + γ−1 ) 0 Closure of the system is done under the ideal assumption  1  p = (γ − 1) E − ρk~vk2 . (7) 2

3 Eigenvalues of the compressible Euler equations [10 Points]

The Jacobian of the compressible Euler equations is given by ∂f~ A = (8) ∂~q  0 1 0 0 0  1 2 2  (γ − 1) k~vk − vx vx(3 − γ) vy(1 − γ) vz(1 − γ) γ − 1  2  =  −vxvy vy vx 0 0     −vxvz vz 0 vx 0  2 γE 1 2 2 2 γE u (γ − 1)k~vk − ρ ) 2 (3vx + vy + vz )(1 − γ) + ρ vxvy(1 − γ) vxvz(1 − γ) vxγ Fortunately, using a transformation from conservative (~q = ρ, ρ~v, E) to primitive variables (~ω = ρ, ~v, p), we can make the Jacobian considerably simpler: u ρ 0 0 0  0 u 0 0 ρ−1 ∂f~   A = = 0 0 u 0 0  (9) ∂~ω   0 0 0 u 0  0 γp 0 0 u Since both matrices are similar (they describe the same physics just for a different set of quantities), the have the same eigenvalues. 1. Compute the eigenvalues of the compressible Euler equations in one dimension. 2. Interpret the eigenvalues: What do they describe? What might be their physical interpretation?