Challenge

Week 7: Shock tube simulation project

Objective: The objective of the challenge is to set up a transient state simulation of Shock-Tube with a diaphragm placed inside and at the center of the geometry. As High and Low-pressure gas, we introduced the Nitrogen and Oxygen with respective pressures.

Shock Tube Introduction:

The shock-tube problem is a very interesting test case because the exact time-dependent solution is known and can be compared with the solution computed applying numerical discretizations.

The initial solution of the shock-tube problem is composed of two uniform states separated by a discontinuity which is usually located at the origin.

This particular initial value problem is known as the Riemann Problem.

The initial left and right uniform states are usually introduced by giving the density, the pressure, and the velocity. This initial set represents a tube where the left and the right regions are separated by a diaphragm and filled by the same gas in two different physical states.

At the bursting of the diaphragm, the discontinuity between the two initial states breaks into leftward and rightward moving waves, which are separated by a contact surface.

Each wave pattern is composed of a contact discontinuity (C) in the middle, and a shock (S) or a rarefaction wave (R) at the left and the right sides separating uniform state solution.

All the available combinations produce four wave patterns:

  • RCR
  • RCS
  • SCR
  • SCS

A fifth pattern is possible in theory, and it contains a vacuum state between two central contact discontinuities, which occur between two rarefaction waves.

  • This case is of only theoretical interest because it is the limit of the perfect gas equations at zero pressure and temperatures, but it can never occur in practice.

The Sod'd Shock-Tube Problem:

The Sod shock tube problem, named after Gary A. Sod, is a common test for the accuracy of computational fluid codes, like Riemann solvers, and was heavily investigated by Sod in 1978.

The test consists of a one-dimensional Riemann solver with the following parameters, for the left and right states of an ideal gas.

`((rho_L),(P_L),(u_L))=((1.0),(1.0),(0.0))`

`((rho_R),(P_R),(u_R))=((0.125),(0.1),(0.0))`

Where:

  • `rho` is the density
  • `P` is the pressure
  • `u` is the velocity

The time evolution of this problem can be described by solving the Euler equations, which leads to three characteristics, describing the propagation speed of the various regions of the system.

Namely the rarefaction wave, the contact discontinuity, and the shock discontinuity.

If this is solved numerically, one can test against the analytical solution, and get information on how well a code captures and resolves shocks and contact discontinuities and reproduce the correct density profile of the rarefaction wave.

Geometry:

  • The whole computational geometry contains only two regions: 1) High-Pressure, 2) Low-Pressure zones with only two boundaries.
  • The above picture is a shock-tube setup for the transient case. The dimensions of the shock tube are 0.2 * 0.01 * 0.01 meters.
  • The thick colored side is a High pressured zone and the light-colored side is a low-pressure zone.
  • The brown-colored region tells us the high-pressure region filled with the N2 gas and the violet colored region tells us low pressured region filled with the O2 gas.
  • For this case setup, there are no inlets and outlets, instead, the gases inside have the velocity of 0 M/s at the start of solution i.e., at time t = 0 sec.

Case setup:

Application Type - Time-Based

Materials - O2 & N2

Simulation Parameters:

  • Run parameters: Solver - Transient
  • Simulation time parameters: Start time - 0

End time - 0.003

Initial time step - 1e-9

Minimum time step - 1e-9

Maximum time step - 1

Boundary Conditions:

1) High Pressure:

  • Boundary type: Wall
  • Slip Boundary Condition

2) Low Pressure:

  • Boundary type: Wall
  • Slip Boundary Condition

Initial conditions and Events:

Regions:

1) High Pressure:

  • Temperature: 300k
  • Pressure: 600000 Pa
  • Species: N2 (Mass fraction = 1)

2) Low Pressure:

  • Temperature: 300k
  • Pressure: 101325 Pa
  • Species: O2 (Mass fraction = 1)

Events:

Sequential:

1)

  • Start second: 0 sec
  • Region A: High pressure
  • Region B: Low pressure
  • Event: Close

2)

  • Start second: 0.001 sec
  • Region A: High pressure
  • Region B: Low pressure
  • Event: Open

Physical Model:

  • Turbulence Model: RNG K-Epsilon

Grid Control:

  • Base grid: 0.001 m (dx,dy,dz)
  • Adaptive Mesh Refinement:

    • Min. cells = 1
    • Max. cells = 200000
    • Default Embedding level = 3
    • Species: N2
    • Timing type: Permanent

Output files:

  • Time Interval for writing 3D files: 1e-05 s
  • Max. Number of restart files saved: 3

Results:

Mesh:

  • CONVERGE automatically generates an optimized Cartesian mesh at runtime and dynamically refines the mesh throughout the simulation using AMR. All of this remains the same in CONVERGE 3.0, and you can still use meshes exactly as they were in all previous versions of CONVERGE.
  • The base grid size is taken as 0.001 m. in all the directions (dx, dy, dz).
  • The above figure represents the mesh at time t = 0. So, there is no adaptive mesh refinement phenomena.
  • The Adaptive Mesh Refinement comes into the picture after 40-time steps. That will look like:

Mesh Animation:https://youtu.be/d45IifBQ2kQ

Pressure:

  • At the time of before the diaphragm is going to break. Which means at the time interval t = 0 secs.
  • The high pressure of 6 bar is recorded at the left side and low pressure of 1 bar is recorded at the right side of the tube.
  • The pressure contour looks like after the diaphragm gets broken after a considerable amount of time:
  • The above figure is taken at the time step of 100. At this time step, we can see that a wave is generated due to differences in the pressure and density of the gases inside the tube.
  • The compression of the low-pressure gas generates a shock wave propagating to the right. The expanded gas is separated from the compressed gas by a contact discontinuity, which can be regarded as a fictitious membrane traveling to the right at a constant speed.
  • The full formation of shock waves inside the tube can be observed in the animation provided below.
  • The starting of the curves represents that at that point the diaphragm has been broken.
  • The curves (crust and throughs) tells us the shock wave is generated and traveled inside the tube from one end to the other end.

Pressure Animation: https://youtu.be/3GvDjCV6uYg

Temperature:

  • The figure shows at the time before the diaphragm is going to break. Which means at the time interval t = 0 secs.
  • The temperature recorded is 300 k, which is a given property for the gases inside the tube.
  • The temperature contour looks like after the diaphragm gets broken after a considerable amount of time:
  • The above figure is taken at the time step of 100. At this time step, we can see that a wave is generated due to differences in the pressure and density of the gases inside the tube.
  • The max. temperature recorded inside the tube is nearly 470 k and the min.temperature recorded is 220 k.
  • The above graph represents the mean temperature of both the high and low-pressure gas inside the shock tube.
  • The maximum mean temperature of the high-pressure gas is recorded as nearly 340 k. The minimum temperature of 200 k recorded is for the low-pressure gas.

Temperature Animation: https://youtu.be/pSH0jq5_gw8

Velocity:

  • The above contour shows the velocity of both the low and high-pressure regions and as well as the velocity of both gases inside the tube.
  • This shows the velocity inside the tube is 0 m/s of both the gases at the time t = 0 sec.
  • The above figure is taken at the time step of 50. The high pressured ga is penetrating towards the low pressured gas to equilibrate the pressure inside the tube.
  • In that process, the temperature and velocity of the gases inside have been rise to a certain level and if possible they make an ignition also if the gases are fumble.
  • Here the max. velocity recorded is 230 m/s and it is traveling from the left hand to the right-hand side and the min. velocity is 180 m/s.
  • In the animations we also come to see some discontinuities in the flow, there are because of the sudden changes in the pressure field.

Velocity Animation: https://youtu.be/b08LwFCCZDQ

Total Cell Count:

  • For the time of 0.001 seconds, the number of cell counts has a decent behavior, which means till then the diaphragm did not break until this time.
  • The sudden rise in the cell count can be sen as the sudden breakage of the diaphragm and the AMR meshing technique is started applying from here.
  • A total of 0.21 million cells has been generated to study the transient case of the shock tube problem.

Conclusion:

  • The simulation for the case setup of the transient state shock tube problem has been conducted and results are posted.
  • From the pressure, velocity and, temperature animations we can clearly see the formation of the shock wave and how it traveled inside the tube.
  • The reason for the generation of multiple shock waves inside the tube is because it doesn't have any outlet boundary.
  • At the end of the simulation, the pressure inside the shock tube observed is nearly 3.2 bar at the contact surface of both the gases.
  • In the simulation, we did not include any reaction mechanism. Otherwise, the reaction can be started at the mixing region of both gases.
1 comment
  1. Griffin HoustonHey Shaik! Did you use matlab to code this? Is there anyway I could see your code? I'm trying to do something similar and it would be helpful to have somewhere to go off
Your portfolio, next

Ship work like this
in your own course.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.