Shock Tube Simulation


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



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
Simulation Time Parameter>
Start Time: 0
End time: 0.003 s
Initial time step: 1.0e-9 s
Minimum time step: 1.0e-9 s
Maximum time step: 0.003 s
Solver Parameters> No Change

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: [email protected] region to High_Pressure Boundary and similarly [email protected] region to Low_Pressure Boundary
Initial Conditions & Events Regions and Initialization
Add region>[email protected], [email protected]
For [email protected] region
Stream ID: 0
Temperature: 300k
Enter Pressure value:600000Pa
Species: Add N2 and put  the mole fraction as 1
For [email protected] region
Stream ID: 0
Temperature: 300k
Enter Pressure value:101325.0Pa
Species: Add O2 and put  the mole fraction as 1
Goto Sequential Tab and add 2 events as follows:
1: Start,s>0; Region A>[email protected], Region B>[email protected], Event: Close
2: Start,s>0.001; Region A>[email protected], Region B>[email protected], 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


a. Navigated to the folder location containing the input files

b. Entered the command> mpiexec.exe -n 2 converge.exe 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

Projects by Gaurav Samanta

Data Analysis
Gaurav Samanta · 2020-01-08 12:32:09

Objective: The objective of this project is to write a code for data analysis from an input file and perform the following operations 1. Compatibility Check: The program will ask for the file name with valid extension which if provided incorrect will terminate the prog Read more

Constraint Minimization
Gaurav Samanta · 2020-01-08 11:52:01

Objective: The objective of this project is to minimize a simple non-linear funtion using Lagrange Multiplier The target equation is: `f(x,y)=5-(x-2)^2-2(y-1)^2` & the constrain equation: `x+4y=3` Theory: In real engineering applications there is a Read more

Curve Fitting
Gaurav Samanta · 2019-12-27 19:42:51

Objective: The objective of this project is to perform a curve fitting between the temperature and Cp values given the data file   Theory:  Curve Fitting: it is a process of constructing a curve that best fits the provided data series. Curve fitting in gene Read more

Ice Breaking Challenge
Gaurav Samanta · 2019-12-27 19:01:57

Objective:  The objective of this project is to determine the minimum pressure required to break a given thickness of ice using an air cushion vehicle through Newton Raphson Method Equation: `p^3(1-beta^2)+(0.4hbeta^2-(sigmah^2)/r^2)p^2+((sigma^2h^4)/(3r^4))p-((s Read more

Objective: The objective of this report is to understand the CAD modeller features in Star CCM+ and use it to generate a 3D model of an Ahmed Body and a Convergent Divergent Nozzle in the same as per the drawing given below   Procedure & Results: Conv Read more

Air Standard Cycle
Gaurav Samanta · 2019-12-10 14:51:18

Objective: The objective of this report is to create a python based Otto Cycle simulator which can create the  PV diagram and give the thermal efficiency of the engine as output  Theory: Otto cycle is the set of processes used by the spark ignition Read more

2R Robotic Arm
Gaurav Samanta · 2019-12-10 14:33:33

 Objective: The objective of this report is to simulate the foward kinematics of a 2R robotic arm using python programming   Theory: Robotic arm manipulators are used in various industry verticals such as automotive, electronics, warehouses and logistic Read more

Solving 2nd order ODE
Gaurav Samanta · 2019-12-10 08:14:29

Objective: The objective of this report is the simulate the transient behaviour of a simple pendulum and the create the animation of its motion for a given time interval Theory: The following equation (Ordinary Differential Equation) for the position of the bob w. Read more

Flow over Bicycle
Gaurav Samanta · 2019-11-22 18:54:05

Objective:   The objective of this  study to understand the change in drag force with respect to velocity different cycling positions and drag coefficeint for constant frontal area and constant velocity.   Theory: Cyclists tend to experien Read more

Objective: The objective of this report is to understand the different steps involved in any CFD simulation and the applications of CFD in Medical, Oil & Gas and Construction Industry 1. Steps involved in a CFD Simulation  Step 1. CAD Modelling/Geometry Impor Read more


The End