Performing a Shock tube simulation using Converge CFD
Objective
Performing a Shock tube simulation using Converge CFD. Here we are creating two regions namely High-pressure region and Low-pressure regions and with a diaphragm between them and look at different parameters that take place when we remove the diaphragm. What is the significance of this problem? Hereby this we can stimulate a model where we can find the Autoignition temperature of a fuel where fuel in High-pressure region and Low-pressure region with air. But here our objective is different we are just trying to run a normal simulation by taking an N2 gas in HPR and Low-pressure region which is O2 so here we will look at how pressure and temperatures are getting effected in the shock tube.
Shock Tube
Performing Transient Simulation. Steps involved in running Simulation
1)Geometry Creation
2)Boundary flagging
3)Diagnosing the geometry
4)Case Setup
5)Solve
6)Post-processing the results
Step 1
Geomentry
Creating a geomentry is quite easy we can just create two seperate connected rectangular boxes or simply import geometry provided.Make shore that there is no diaphragm between these two rectangles
Step 2
Boundary Flagging
In this geometry we just have two boundaries that need to be flagged
1)High_Pressure_Region
2)Low_Pressure_Region
Step 3
Diagnosing the geometry
We will just run the diagnosis for a set of important problems which are going to affect the solution
After running the diagnosis we see that no errors are present let us proceed to the case setup
Step 4
Case Setup
Application Type-->Time Based
Simulation Parameters
The required data to be given to the system are mentioned. Rest are set to default other than below parameters
| Run parameters | Simulation time parameters |
| Solver: Transient | Start time : 0 |
| End time: 0.003 | |
| Simulation mode: Hydro | Initial Time Step: 1e-9 |
| Minimum time step: 1e-9 | |
| Maximum Time step: 1 |
Solver Parameters : Default
Boundary Conditions
| Boundary ID | Boundary Name | Boundary Conditions |
| 1 | High_Pressure_Region | Velocity BC-Slip Temperature BC-Neumann |
| 2 | Low_Pressure_Region | Velocity BC-Slip Temperature BC-Neumann |
Regions and Initialization
| Region ID | Region Name | Temperature(K) | Pressure(Pa) | Species |
| 0 | HPR | 300 | 600000 | N2- Mass Fraction-1 |
| 1 | LPR | 300 | 101325 | O2- Mass Fraction-1 |
Events
Here we are enabling the sequential parameter by that we are telling simulation when to open diaphragm. So it open when the simulation reaches 0.001 sec so that we are creating a shock inside the tube
| Start | Event by | Region A | Region B | Event |
| 0 | Region | HPR | LPR | Close |
| 0.001 | Region | HPR | LPR | Open |
Physical Model
Turbulence-RANS RNG k-epsilon Model
Grid Control
Base Grid : dx=dy=dz=0.0005m
Adaptive Mesh refinement
Here the species are going to move when the diaphragm wall in separating them gets cleared so the mesh need to get updated
- Automatic mesh generation algorithms that accommodate the geometry motion by creating a new mesh at each time-step. The result is of higher accuracy.
- AMR is also enabled to see shock more clearly because the sensitive and more turbulent area is present in the domain. The parameter to optimize the mesh during moving are clearly shown in the above figure. Like we enabling Species type AMR SGS embedding is given as Nitrogen gas as 0.00 with a scale of 3 with Active regions of HPR and LPR
Step 5
Solve
Then we need to export the input files to a folder to start running a simulation.then by using Cygwin we are directing to the input file and simulation is stared by using an executable file and simulation ran by using two processors. After successfully running the simulation we can post-process the results and check the general outcomes whether simulation ran properly and are they making any sense.
Step6
Post Processing Results
Pressure Plot
- Simulation ran for around 0.003 sec we can see that until 0.001 sec the pressure of both the HPR and LPR regions is constant. That is because the Diaphragm wall is closed when time crosses 0.001 sec we can see the graphs deflecting up and down that is because compression and expansion taking place. To be more precise
- From 0.00115 to 0.00165 we can see the LPR pressure is increased and HPR Pressure decreases because when the diaphragm wall is opened the with high-pressure N2 is expanded and O2 is getting compressed Because of that the N2 pressure is decreased and O2 pressure is decreased.
- From 0.00165 to 0.00235 we can see the LPR pressure is decreased and HPR Pressure Increases because the compressed oxygen pushes Nitrogen back which makes Oxygen gas expanded due to that N2 gas get compressed. This fluctuation goes on until it meets its equilibrium.
- How I can say the fluctuations will disappear after some time that is because if we look into the graph carefully we can see the fluctuation are getting smaller and smaller as the time goes on.
Mean Temperature
I can say Temperature can be pretty much depends upon the pressure this is commonly known.If the pressure increases parallelly temperature also increases.Initially, we started the case with 300K for both the regions so until 0.00115 the temperature is the same with 300K.But due to the diaphragm opening we due to high and Low-pressure differences there is a temperature fluctuation in both LHR and HPR.
From 0.00115 to 0.00165 in this time range we can see that N2 gas temperature is getting reduced because here the gas is getting expanded because of that the temperature gets decreases parallelly the O2 gas here is getting compresses by the nitrogen so O2 Temperature rises.You may ask why O2 gas temperature is linear in the range of 0.00115 to 0.0013 that may be because the effect of compression on O2 Gas is less and the temperature change in that range is so n minimum. Because you can see that the deflection of N2 gas is quite high while we compare to the O2 gas.
From 0.00165 to 0.00235 in this time range we can see that N2 gas temperature is getting increased because here the gas is getting compressed by oxygen because of that the temperature gets increased parallelly the O2 gas here is getting expanded. So O2 Temperature rises. And these fluctuation disappears after some time. To know the time we just need to run the simulation may for some extra 0.006 - 0.01 sec. The time range is purely by guess
Total Cells vs Time
- Until 0.00115 we can see that cell count is constant at 1,60,000 cells but when it crosses the time 0.00115 we can see a huge spike and in a fraction of second it falls back and continuous fluctuation is observed That is happening because of moving species such that we enabled AMR. Automatic mesh generation algorithms that accommodate the geometry motion by creating a new mesh at each time-step. The result is of higher accuracy.
- You may ask why the cells are not crossing 2,00,000 element.For this answer, you need to look at AMR figure in Grid Control their I took 200000 as my maximum cell generation due to that the cell count doesn\'t cross 2,00,000 cells.
- This is not necessary to have 2 lakhs as maximum cells just for the simulation to run faster I have changed the criteria because my base mesh grid size is 0.0005m so initially my base grid size is finer because of that I choose 2,00,000.
- You may ask is this the best way of taking this kind of mesh. Actually I can say this is one way but the situation can be done in a better way by reducing the base grid size and taking a big value for AMR Maximum cells because here we are more concerned about the Shock or the interaction that happens between N2 and O2. I am not saying the way I took the mesh is wrong but due to the gap in computation power or my convenience, I took the meshing data.