T6:
Flow through a nozzle:
accelerating flows and boundaries
Before the tutorials:
Think about:
- What happens when a flow passes through a Nozzle?
You might find this video from the 1960s useful, even more information can be found here.
- What was is the resolution in our SPH simulations (e.g., check the
HSML from one of the previous tests and interpret it)
- What is now the minimum size of regions to be described consistently in the simulation?
During the tutorials:
You can run the experiment from above movie.
A flow through a nozzle
- Create a slab with uniform distribution of particles (say, 400×20×20).
- Assume a empty space of equal size to the left.
- Boundary particles can be defined by setting their
id values to 0.
Such particles will not feel any forces but keep their initial movement.
- Create a setup mimicking the vacuum pump and the nozzle from the simulation setup above.
- How can you geometrically define a nozzle?
- How can you set the
id values for these regions to zero?
- How can you make a wall move (e.g., setting the velocity in the x direction to a reasonable value, like −1)?
- Now create the setup:
- First assume a wall at the right end of the slab.
- Second create a wall on the left end of the slab, which is moving to the left.
- Create a symmetric nozzle (i.e., a reduction of the area in the y direction)
at the left side of the slab (but leave some place for the initial position of the moving wall).
- Now move all more to the right side, so that the left wall can safely move to the left.
- Hint: Here a is sketch of the geometry:
Now we can perform the simulation and analyze it.
- When compiling the code, do not forget to:
- Insert the new settings
SPH_BND_PARTICLES and SPH_BND_PARTICLES_ALLOW_DRIFT into the Config.sh
- Do not forget to enable
NOGRAVITY, TWODIMS and PERIODIC
- Switch on
LONG_X, LONG_Y and LONG_Z and set them to proper values.
- Think which Kernel to use.
- Before running, edit the
box.param file:
- Choose resonable values for
TimeMax and TimeBetSnapshot
- Add
ArtBulkViscConst and set it to 0.8
- some example initial conditions to start with:
wget https://www.usm.uni-muenchen.de/~dolag/Lille2026/T06/box.ic
- Depending on your laptop we sugegst to use as much as possible CPUs for this experiment.
- Try to explain what is happening in the simulation.
- Is the gas at the beginning streaming through the nozzle (if not, why)?
- What happens to the gas on the opposite of the nozzle (and why)?
- Try to have a look at the temperature of the gas.
- What happens when the gas is finally flowing through the nozzle?
- As usual, you might increase resolution of the initial condition.
Programming goals for T6:
Producing initial condition with special boundary regions, especially we will
- learn how to create boundary regions in the initial conditions
- how to define special shapes and obstacles
Solution
As a 2D test case;
- Again, extending the setup script from previous experiments we can start with a slab with a base grid of
1000×50 sand the place the different obstacles in it.
wget https://www.usm.uni-muenchen.de/~dolag/Hydro/Hydro/Python/ic_header (if not already done before)
wget https://www.usm.uni-muenchen.de/~dolag/Lille2026/T06/setup_nozzle.py
python3 setup_nozzle.py
you should get something like shown below, where the black and blue points indicate
the defined boundary particles (black = stationary, blue = moving)
- Now vizualize the results after running the simulation
wget https://www.usm.uni-muenchen.de/~dolag/Lille2026/T06/show_nozzle.py
python3 show_nozzle.py
you should be able to obtain an animation like this and identify all the phenomena discussed in the experiment from above
As a 3D test case (needs significant more computing power);
wget https://www.usm.uni-muenchen.de/~dolag/Hydro/Hydro/glass_10x10x10
wget https://www.usm.uni-muenchen.de/~dolag/Hydro/Hydro/Python/ic_header (if not already done before)
wget https://www.usm.uni-muenchen.de/~dolag/Lille2026/T06/setup_nozzle_3d.py
python3 setup_nozzle_3d.py
Useful commands
- More informations on the OpenGadget3 containers
- Start your docker session:
docker run -it -v :/mnt --name opengadget3_container opengadget3:XXX
- Connect from a second shell to a running docker session:
docker exec -it opengadget3_container bash
- Get the simulation code:
cp -r ~/OpenGadget3 .
- Copy the config file:
wget https://www.usm.uni-muenchen.de/~dolag/Hydro/Hydro/Config.sh
- Copy the parameter file:
wget https://www.usm.uni-muenchen.de/~dolag/Hydro/Hydro/box.param
- Setup the environment for compiling the code:
source Build/Container_build.sh
- Compile the code:
make -j
- Run a simulation:
mpiexec -np 2 OpenGadget3/OpenGadget3 box.param