Shock tube simulation project
AIM:
1) To set up a transient shock tube simulation.
2) To plot the pressure and temperature history in the entire domain. Explain the results thus obtained.
3) Plot the cell count as a function of time and explain the plot.
INTRODUCTION AND THEORY:
Shock tube:
The conventional shock tube consists essentially of a uniform tube divided initially by a diaphragm into two compartments containing gases at different pressures. When the diaphram is ruptured by means of a needle or an electric spark, a normal shock wave moves into the low pressure part of the tube and an expansion wave moves into the high-pressure part. Between these two disturbances, there may be regions in which the gas moves with uniform subsonic, sonic or supersonic speed depending on the initial pressure ratio aoross the diaphragm. The duration of steady flow in these regions is limited to times of the order of milliseaonds in tubes of reasonable length by reflections of the shock and expansion waves from the ends of the tube.
Shock tubes have been used to investigate a wide range of problems in fluid dynamics. For some of these they provide the only convenient method of experiment and for others they are attractive because of their relative simplicity. For the examination of steady flow at high mach number the shock tube requires less power and is probably cheaper to build than a wind tunnel of comparable size, but has the disadvantage that the duration of steady flow is so short that it is difficult to make observations.
Events in converge studio:
Events in converge studio, are used to connect or disconnect two regions. Events can be very helpful in simulating some cases where we it is requried to break some part of the geometry at a particular time such as breaking a diaphragm in a shock tube. Also, in some cases it may be required to connect the valve inlet port at a particular time and disconnect them when not required.
GEOMETRY:
The geometry of the shock tube is shown below.
The shape of the shock tube is a cuboid. The length of the shock tube is 0.2m, width and height of the tube are each 0.01m.
The above geometry can be made in any CAD software and can be imported as .stl file which is a file in triangulated format, which means the entity with which the geometry is made of are trianigles. It can also be made using the inbuilt CAD package provided by Converge software as the above geometry is a simple geometry.
After making the geometry, make sure that the Normals of each triangle are pointing inside the sock tube as we want to study the shock waves and expansion waves generated inside the shock tube.
Now, it is checked for any errors in the diagnosis dock.
It checks for the following problems in the geometry:
1) Intersections.
2) Nonmanifold edges.
3) Open edges.
4) Overlapping Tris.
5) Normal orientation.
6) Isolated tris.
The diagnosis dock is shown in the picture below.
We can click the find option marked in the above picture of diagnosis dock to check for the problems in the geometry.
As it can be seen in the above picture that there are no problems in the geometry.
Next step is to set up the case. In this process we input all the necessary parameters for before processing the solution for the simulation.
CASE SETUP:
i) Application type: In the application type we select the time-based type as in our case the simulation is not for an IC engine. In the version prior to converge studio 3.0, the application type can be selected as General flow.
ii) Materials: We check Gas simulation. We select Air as the pre-defined mixture. We also check species and uncheck reaction mechanism if it is checked.
For gas simulation we use Redich_kwong method for equation of state and rest of the options are taken as follows:
The values for the global transport parameters are taken as follows:
1) Prandtl Number: 0.9
2) Schmidt Number: 0.78
In the species, in the gas tab, add the Oxygen and Nitrogen.
iii) Simulation parameters:
In simulation parameters we check run parameters, simulation time parameters and solver parameters.
Under run parameters set the simulation type to transient and run the simulation on full hydro mode.
Under the simulation time parameters the conditions are set as following:
1) start time = 0.0 s
2) End time = 0.003 s
3) Initial time step = 1e-09 s
4) Minimum time step = 1e-09 s
5) Maximum time step = 1 s
6) Maximum convetion cfl limit = 1.0
For Solver parameters, set Navier-stokes solver scheme to PISO.
iv) Initial conditionss and Events:
Under Initial conditions and Events, check Events.
Under regions and initialization, add two regions, one as high pressure region and the other as low pressure region.
For high pressure region specify the following:
Stream ID: 0
Velocity: 0 m/s
Temperature: 300k
Pressure: 600000.0 Pa
Add N2 as the species with mass fraction 1.0.
For low pressure region specify the following:
Stream ID: 0
Velocity: 0 m/s
Temperature: 300k
Pressure: 101325.0 pa
Add O2 as the species with mass fraction 1.0.
Events:
In Events, check the sequential tab and add two events,
For the first event set the following:
start - 0s
Region A- High pressure region
Region B- Low pressure region
Event- Close
For the second event set the following:
Start- 0.001s
Region A- High pressure region
Region B- Low pressure region
Event- Open
v) Boundary conditions:
High_Pressure_Walls:
For High pressure walls boundary, set the following conditions
Boundary type- WALL
Velocity boundary conditions-
Wall motion type- Stationary
Surface movement- FIXED
Wall Treatment- select 'Law of the wall' from the drop down box
Temperature boundary condition-
Select 'Law of the wall' from the drop down box.
Temperature value- 300k
Turbulent Kinetic energy boundary Condition-
Zero normal gradient (NE)
HP_2D_1:
Boundary type is set as TWO_D
HP_2D_2:
Boundary type is set as TWO_D
Low_Pressure_Walls:
For Low pressure walls boundary, set the following conditions
Boundary type- WALL
Velocity boundary conditions-
Wall motion type- Stationary
Surface movement- FIXED
Wall Treatment- select 'Law of the wall' from the drop down box
Temperature boundary condition-
Select 'Law of the wall' from the drop down box.
Temperature value- 300k
Turbulent Kinetic energy boundary Condition-
Zero normal gradient (NE)
LP_2D_1:
Boundary type is set as TWO_D
LP_2D_2:
Boundary type is set as TWO_D
Vi) Physical models:
For turbulence modelling select the following:
Turbulence model: RNG k-epsilon
Remaining parameters are set as default.
vii) Grid control:
In Grid control we check adaptive mesh refinement.
Base grid:
set base grid as dx=dy=dz=0.002m
In Adaptive mesh refinement, set the folowing:
In species tab, add nitrogen ,
Timing type: permanent
Embedding scale : 3
S embedding (Sub grid criterion) = 0.001
viii) Output/Post processing:
Output files:
For output files, in the writing time intervals tab set the following
Time interval for writing 3D output data files: 1e-05 s
Time interval for writing text output: 1e-05 s
Time interval for writing restarting output: 0.01 s
Now, the input files are exported to a folder and are processed in the software Cygwin terminal 64. Here the solver solves the Navier stokes equations and the results thus obtained are post processed in the Software called Paraview.
RESULTS AND DISCUSSION:
The mesh dx=dy=dz=0.002m is shown below:
The above two images shows the mesh size at the end of the simulation, the top one showing the complete mesh and the bottom one showing the detail of a portion to show some of the finer cells from the top image . From the above images showing the mesh, we can observe that the size of each cell is different at some portions while it is same at some other portion. This is because of the adaptive mesh refinement, a grid control technique used in converge. By using this technique, we can capture those finer details of a quantity under study, where the results obtained from the base grid size are not accurate at a particular portion at a particular time during the simulation. This dynamic cell refinement triggers when a particular quantity between the two adjacent cells achieves a difference in its value which is less than the sub grid scale criterion. Here, we have used the mass fraction of nitrogen as the quantity and the sub grid criterion of 0.001.
The embed level is set as 3. So, the minimum cell size is (base grid)/(2)^(embed level).
Which is 0.002/8 = 0.00025 m. This means that we see that at some parts the mesh size is the smallest, therefore it is 0.00025 m. As per the requirement, the mesh size can become smaller at a particular time depending upon the level of refinement.
The pressure, temperature and velocity history in the entire domain can be seen in the animations below:
Link to Pressure contour animation:
Link to Temperature contour animation:
Link to Volume contour animation:
In the above animations for pressure, temperature and velocity contours we can observe that the pressure of in the high pressure region and low pressure region does not change up until the diaphragm between the two regions ruptures just after one third of the simulation is completed, where as the temperature in the high pressure region has small changes near the diaphragm until the diaphragm ruptures and in the low pressure region the temperature remains constant until the diaphragm is ruptured. The velocity of nitrogen changes inside the high pressure region and the velocity of oxygen is zero in th elow pressure region until the diaphragm ruptures. Now, after the diaphragm ruptures, due to the difference in pressure of 498975 pa between the two regions, sudden increase in velocity and temperature and pressure results in the formation of mini shock waves which travel back and forth through out the remaining simulation in a periodic manner. If we contine our simulation more than 0.003 s, we can see that the pressure, temperature and velocity will reach a steady state.
Velocity vector plot is shown below:
Pressure vector plot is shown below:
Temperature vector plot is shown below:
The above contour plots of prsssure, temperature and velocity shows pressure, temperature and velocity at the end of the simulation.
Plot of Pressure vs time taken is shown below:
In the above plot, we can observe that the pressure in the shock tube at the initial time steps, fluctuates a lot as converge adjusts the error in calculations of pressure, then we see that the pressure in the shock tube increases until 0.001 s. This is the time when the diaphramgm is ruptured. After this, we see that the pressure suddenly drops due to diaphram rupture and then it increases as the dynamic pressure goes up due to increase in velocity. Then again after the air touches the low pressure region's end, the shock wave reflects back and similar pressure pattern is seen as the shock wave reflects back and forth untill it reaches steady state.
Plot of mean temperature in the shock tube vs time taken is shown below:
In the above plot, we can observe that the mean temperature in the shock tube at the initial time steps, fluctuates a lot as converge adjusts the error in calculations of mean temperature, then we see that the mean temperature in the shock tube increases until 0.001 s. This is the time when the diaphramgm is ruptured. After this, we see that the meamn temperature suddenly drops due to diaphram rupture and then it increases as the dynamic pressure goes up due to increase in velocity. Then again after the air touches the low pressure region's end, the shock wave reflects back and similar pattern is seen as the shock wave reflects back and forth untill it reaches steady state.
Plot of cell count vs time taken:
In the above plot, we can see that the cell count is plotted as a function of time. It includes the total cell count, the cell count processed by the four processors.
We can see a sudden increase in the total cells processed as converge adjusts its error in calculations. After that the cell count changes a little until it reaches one third of the simiulation. At 0.001s, after the diaphrgm ruptures, we can see sudden increase in the totakl cell count because at the portion where the diaphragm is ruptured, the AMR is triggered as a result of sudden change in pressure, temperature and velocity and this increases the total cell count as the cells are refined. Then, after this, the total cell count increases and decreases as per the requirement of the refinement of the cells.
Conclusion:
Transient Shock tube simulation has been succesfully set up. The behaviour of variation of pressure, temperature , velocity and total cell count of simulation for the entire simulation time is carried out.
The meaning and importance of events has been attended to while setting up some simulations where there is a need to disrupt or connect a particular part or parts of a geometry at a particular time during the simulation may be one time or multiple times.