Shock Tube Simulation
OBJECTIVE
The objective of this study is to set up a transient state flow simulation within a shock tube and understand the temperature and pressure distribution across the domain. The setups shall include two cases as per the grid sizes given below.
| Grid Size | Max. Embedding Level | SGS.embed (species:N2) | |
| Case 1 | dx=0.001 m, dy=0.001 m, dz=0.001 m | 3 | 0.001 |
| Case 2 | dx=0.0005 m, dy=0.0005 m, dz=0.0005 m | 3 | 0.001 |
The simulation process includes three major steps:
1. Preprocessing
1.1. Geometry Import
1.2. Diagnosis
1.3. Boundary Flagging
1.4. Case Setup
2. Solving
3. Post Processing
3.1. Mesh
3.2. Plots (Pressure and Temperature)
3.3. Animation
PROCEDURE:
The procedure followed for setting up the simulation is provided below
1. Preprocessing
1.1. Geometry Import and Cleaning
a. The geometry provided was imported by dragging and dropping the file in the converge studio window
Fig. 1: Geometry (All dimension are in m)
b. The geometry imported had all the dimensions in the scale of hundreds of meters and had to be converted to mm. This would result in the mesh generation beyond the license limits. To overcome this the transform command was used to scale down the geometry by 1000. Fig. 1. depicts the scaled down model which was used for further analysis
1.2. Diagnosis: The diagnosis tool helps in identifying the different problems in the geometry.
The Diagnosis tool looks for the following geometric issues
a. Intersection: Highlights number of triangles with piercing inbetween adjacent two triangles
b. Nonmanifold Vertices: Checks for number vertex which are being shared between two triangles
c. Open Edge: This highlights the number of edges of a triangle which not shared by any other triangle
d. Normal Orientation: This highlights the number of traingles whose normal vector is not pointing towards the interior of fluid domain
e. Isolated Triangles: This checks for the number of triangle surrounded by any neighbouring triangles that have different boundary ID number
Goto Diagnostics Dock>Find>
Since all the problem traingles are green ticked, there were no issues in the geometry
1.3. Boundary Flagging:
a. Goto Boundary>Flag>Create a New Boundary>Create Multiple Boundary>Enter 5 in \"Number of Multiple Boundaries\"
b. Since the high pressure and low pressure side is separate by a solid boundary, the separation boundary interface had to be deleted so that the mixing takes place
c. Select the high pressure and low pressure side triangles, assigned to the High_Pressure and Low_Pressure boundaries respectively. The triangles in the front and back side faces in the high pressure side were selected simultneously and flagged as HP_2D1 and HP_2D2 respectively. The same process was followed for the low pressure side as well
The figure below represent the boundaries flagged:
Note: For this case there are no inlet and outet boundaries, as the domain consists of two closed volume sub domains initially comprising of only N2 at high pressure and only O2 at low pressure respectively. An event is created in such a manner that these two initially closed and separated sub domains/regions are opened out at a certain time interval so that mixing takes place as N2 flows from higher pressure side to the lower pressure side where O2 is present
1.4. Case Setup:
a. Clicked on \"Begin case Setup\" and entered the value provided below
| Settings | Values to be Entered/Selected |
| Application | General Flow |
| Material | Select Air (predefined mixture) and Tick onto Species Gas simulation>No Change Global Transport Paramters>No Change Species> Add N2 and O2 under the \'Gas\' tab |
| Simulation Parameters |
Run Paramters> Transient For Case 2 Increased the end time to 0.005 s for better capture of the shock ocillation |
| Boundary Conditions | for High_Pressure & Low_Pressure boundaries: Boundary Type>Wall Velocity Boundary Conditions: Wall Motion Type>Stationary, select \'Law of Wall\' from the list Temperature Boundary Conditions: select \'Law of Wall\' from the list, Temperature value>300k HP_2D1, HP_2D2, LP_2D1, LP_2D2: Boundary type> 2D Assign: High_Pressure@ region to High_Pressure Boundary and similarly Low_Pressure@ region to Low_Pressure Boundary |
| Initial Conditions & Events | Regions and Initialization Add region>High_Pressure@, Low_Pressure@ For High_Pressure@ region Stream ID: 0 Temperature: 300k Enter Pressure value:600000Pa Species: Add N2 and put the mole fraction as 1 For Low_Pressure@ region Stream ID: 0 Temperature: 300k Enter Pressure value:101325.0Pa Species: Add O2 and put the mole fraction as 1 Events: Goto Sequential Tab and add 2 events as follows: 1: Start,s>0; Region A>High_Pressure@, Region B>Low_Pressure@, Event: Close 2: Start,s>0.001; Region A>High_Pressure@, Region B>Low_Pressure@, Event: Open |
| Physical Models | Turbulence Modeling-RNG-K Eplison is selected |
| Grid Controls | Base Grid: Enter the grid values for (dx, dy, dz) as per the case Baseline Case 1: dx = 0.001 m; dy = 0.001 m; dz = 0.001 m Activated Adaptive Mesh Refinement from the menu Adaptive Mesh Refinement-Add AMR Group>AMR groups>tick on Species Select both the regions under Avialable Region and click on => to shift those to active regions Goto Species Tab: click on Add new item Name:N2, Type: Permanent, Sgs.embed: 0.001 For Case 2 Change grid size to dx = 0.0005 m; dy = 0.0005 m; dz = 0.0005 m |
| Output/Post Processing | Post Variable Selection>No change |
| Output Files | Time Interval for writing 3D output data files: 1e-05 s Time Interval for writing text output: 1e-06 s Time Interval for restarting output: 0.001 s |
2. Solving:After this all the input files was imported to a seperate folder. Converge creates .txt files which contains all the values entered while setting up the case for respective settings done above. These input files will be processed by converge using Message Passing Interface (MPI) standard
For running the simulation, Cygwin tool was used instead of converge studio interface. Cygwin is a POSIX-compatible API which is based on command prompt is used to run the simulation
Steps:
a. Navigated to the folder location containing the input files
b. Entered the command> mpiexec.exe -n 2 converge.exe </dev/null> logfile & : This allows converge to run two processors (selection on number of processor cores present as per the system configuration, can use multiple cores if available) for the parallel processing and load balancing
c. Entered the command> taif -f logfile
d. After the simulation is over. Went back to converge studio>Post-Processing 3D
e. Enter Case Name>\"Test\", Change the File Type to Paraview VTK in-line binary format
d. Enter the address for the output files>Select all files>Select all Cell Variables>click on Convert
e. After the conversion of the post files to the binary output, open the Test.vtm (group file) file in Paraview
3. Post-Processing:
After opening the group file in paraview, clicked on apply to load the results. Created slice, glyphs and other plots as required
3.1. Meshing:
Fig: Cell Count (Case 1 & 2)
Fig: Case 1: Mesh View (with Viscosity Contour Output 1)
Fig: Case 2: Mesh View (with Pressure Contour Output 1)
3.2. Plots
Pressure Plots
Fig: Case 1: Pressure Plots
Fig: Case 2: Pressure Plots
Temperature Plots
Fig: Case 1 Temperature Plot
Fig: Case 2 Temperature Plot
Animation Link:
Case 2: Pressure and Temperature
Case 2: Velocity and yN2
Key Conclusions
1.For case 1, the simulation time was not sufficient to observe the shock wave oscillation in the tube so the simulation time was increased in case 2 to observe the same. With increased simulation time, the shock wave oscillation across the tube was observed
2. At the temperature across the domain is constant till 0.001s, post which the high pressure and low pressure region are opened, and variation was observed as the high pressure shock propagates. The N2 gas at high pressure enters the low pressure region containing O2 which a shock wave, compressing it adiabetically, resulting to increase in temperature and pressure. After a certain time, the shock rebounds back after hitting the boundary. In the second cycle the incident and reflected shock wave collide, and the process continues till the shock dies out