Week 7: Shock tube simulation project
Shock tube simulation project
I. Aim: The aim of the current project is:
1. To setup a transient shock tube simulation.
2. Observe the pressure and temperature throughout the domain as a function of time.
3. Estimate the cell count as a function of time
II. Theoretical background: Shock tube is a device used to study the flow of high-temperature and high-velocity compressible gas. A shock tube typically consists of a high pressure region and a low pressure region separated from each other by a diaphragm. When the diaphragm is ruptured rarefaction waves are established in the high pressure region and compression waves are established in the low pressure region. Depending on the pressure ratio, supersonic gas flow is initiated in the low pressure region which causes the compression wave-fronts to combine and form a shock-front. Meanwhile the expansion waves generated in the high pressure region cause the gas to enter into the low pressure region. The shock-front and expansion waves get reflected from the walls of the shock tube and interact with the induced flow.
The figure shown above is a schematic representation of shock tube.
III. Case setup
In the current section, the computational details pertinent to the problem are discussed.
1. Materials
A gas simulation is performed using air as the predefined mixture with the following global properties:
Turbulent Prandtl number=0.9
Turbulent Schmidt number=0.78
Nitrogen and Oxygen are considered as the two species participating in the simulation.
2. Geometry
The geometry used for performing the simulation consists of a tube, with square cross-section, having the following dimensions:
Length of the tube=0.2m
Square cross-section=0.01x0.01m
3. Solver
The three-dimensional Navier-Stokes equations are solved using CONVERGE solver with the following settings:
i. Solver type: Transient
ii. Gas flow solver: Compressible
iii. Navier-Stokes solver scheme: PISO
iv. Navier-Stokes solver type: Pressure-based
v. Start time: 0
vi. End time: 0.003s
vii. Initial time-step: 1e-9
viii. Minimum time-step:1e-9
ix. Maximum time-step: 1
x. Turbulence model: RNG K-epsilon
4. Initial conditions
Throughout the computational domain, the following two regions are defined:
i. High_Pressure_Region:
Stream ID: 0
Velocity: X component=0.0, Y component=0.0, Z component=0.0
Temperature: 300K
Pressure: 600000Pa
Turbulent Kinetic Energy: 1m^2/s^2
Turbulent Dissipation: 100m^2/s^3
Species: N2 mass fraction=1
ii. Low_Pressure_Region:
Stream ID: 0
Velocity: X component=0.0, Y component=0.0, Z component=0.0
Temperature: 300K
Pressure: 101325Pa
Turbulent Kinetic Energy: 1m^2/s^2
Turbulent Dissipation: 100m^2/s^3
Species: O2 mass fraction=1
An event is created to define the nature of connection between the two regions. At t=0, CLOSE type connection is established. This implies that the two regions are disconnected from one another. At t=0.001s, the connection switches to OPEN type, which implies that the two regions are in contact with each other. The solver accomplishes this task using disconnect triangles.
In shock tube simulations, it is nearly impossible and quite unnecessary to simulate the rupture of the diaphragm (separating the two regions). Hence events, such as above, are defined to numerically implement the presence and absence of diaphragm.
5. Boundary conditions
All the walls of the geometry encompassing the High_Pressure_Region are termed as Walls_HP whereas those encompassing the Low_Pressure_Region are termed as Walls_LP. All walls of the geometry are assigned SYMMETRY type boundary condition.
6. Grid
In order to effectively capture the shock, adaptive mesh refinement (AMR) is used with a base grid of dx=dy=dz=0.001m. The following settings are used for AMR:
i. Minimum cells: 1
ii. Maximum cells: 200000
iii. Type: Species (N2)
iv. Embed type: SGS
v. SGS embed: 0.001
vi. Embed scale: 2
vii. Embedding level: 3
viii. Timing type: Permanent
Computational grid at t=0
Computational grid at t=0.003s
The computational grid at 3ms clearly shows the adaptive mesh refinement (AMR) at play in the domain.
IV. Results and discussions
In the current section, the simulation results are discussed.
1. Nitrogen mass fraction contours + Velocity contours
The animation attached below shows the evolution of the following variables with time:
(a) Nitrogen mass fraction contours
(b) Velocity contours
It can be seen that after the event is triggered (at t=0.001s) compression waves are generated in the Low_Pressure_Region (Oxygen gas) and expansion waves are formed in the High_Pressure_Region (Nitrogen gas). The compression waves combine together to form a shock-front in the Oxygen gas, which is moving towards the end of the Low_Pressure_Region. Simultaneously, due to the presence of expansion waves in the High_Pressure_region, the Nitrogen gas begins to enter the Low_Pressure_Region due to which the the gas interface begins advancing into the Oxygen gas. Hence both the gas interface and the shock-front are moving through the Oxygen gas. However the shock-front travels at supersonic speed (greater than the speed of gas interface). Hence before mixing commences at the gas interface, the reflected shock-front pushes it (gas interface) in the opposite direction. This retreating gas interface again interacts with the shock-front after it gets reflected from the end of the High_Pressure_Region. This time the shock-front pushes the gas interface back towrads the Oxygen gas. In this manner the back and forth movement of the shock-front between the two regions causes the gas interface to oscillate. The motion of shock-front through the shock tube can be easily observed by looking at the velocity contours whereas its effect on the motion of gas interface is clearly evident in the Nitrogen mass fraction contours.
2. Pressure
The animation attached below shows the evolution of pressure contours in the domain with time.
The plot attached below shows the variation of the following parameters with time:
(a) Mean pressure in the High_Pressure_Region
(b) Mean pressure in the Low_Pressure_Region
(c) Mean pressure in the domain
The results show that pressure in both the regions remains constant until the event is triggered (at t=0.001s). After the event, compression waves are generated in the Low_Pressure_Region whereas expansion waves are formed in the High_Pressure_Region. The compression waves combine together to form a shock-front. The shock-front travels towards the end of the Low_Pressure_Region whereas the expansion waves travel towards the end of the High_Pressure_Region. Due to this, pressure in the Low_Pressure_Region increases whereas pressure in the High_Pressure_Region decreases. The shock-front and the expansion waves get reflected at the ends of the shock tube and reverse their direction of motion. Eventually the shock-front enters the High_Pressure_Region and the expansion waves enter the Low_Pressure_Region. Consequently, pressure in the High_Pressure_Region increases and pressure in the Low_Pressure_Region decreases. In this manner, the alternating presence of shock-front and expansion waves in a particular region results in cyclic rise and fall of pressure. This is clearly evident in the plot which also indicates that the peak pressure in a particular region decreases with each cycle. This is because the energy contained in the shock-front is continuously dissipated in heating and compressing the gas through which it travels. After sufficient amount of time, when the energy contained in the shock is dissipated completely, pressure in both the regions attains an equilibrium value.
3. Temperature
The animation attached below shows the evolution of temperature contours in the domain with time.
The plot attached below shows the variation of the following parameters with time:
(a) Mean temperature in the High_Pressure_Region
(b) Mean temperature in the Low_Pressure_Region
(c) Mean temperature in the domain
The results show that, similar to pressure, the mean temperature in a particular region rises and falls alternatively. This can again be attributed to the alternating presence of shock-front and expansion waves in a particular region as the passage of shock-front over a region increases its temperature and the passage of expansion waves over a region decreases its temperature.
4. Cell count
The plot attached below shows the number of computational cells in the domain as a function of time.
The plot shows that before the event (at t=0.001s) the total cell count remains constant and equal to 20000. This is because the AMR (adaptive mesh refinement) feature is not triggered and the total cell count is based on the base grid specifications. After the event, the AMR feature is triggered due to the generation of shockin the domain. The AMR feature enabes the addtion of new computational cells, based on the SGS criterion, to resolve the gradients across the shock effectively. As a result, the total cell count varies with time.
V. Conclusion
The following conclusions can be made based on the simulation results:
1. The gas interface oscillates inside the shock tube due to the back and forth movement of the shock-front between the two regions.
2. In each region, mean pressure rises and falls cyclically and with each cycle the peak pressure decreases.
3. In each region, mean temperature rises and falls cyclically.
4. The total cell count: remains equal to 20000 (constant) before the event and varies with time after it.