CFD Online Discussion Forums

CFD Online Discussion Forums (
-   FLUENT (
-   -   Shock tube simulation in Fluent (

Vinoo_P March 4, 2010 01:55

Shock tube simulation in Fluent
Hi everyone i want to run a shock tube simulation case to verify if the data can match experimental data from our lab. What boundary condition do i assign to the diaphragm of the shock tube in Fluent? Ive tried interior, symmetry and internal but they dont work. Please help. Thx.

agd March 4, 2010 11:27

Don't use a BC - set the initial distributions of density, temperature, and pressure as if the diaphragm is there (i.e. step in pressure and density with constant temp across the diaphragm is the normal setup). Then let the simulation run. You are simulating the situation where the diaphragm is instantly removed from the system, so no BC for the diaphragm.

Vinoo_P March 5, 2010 04:32

Ok I will try that right away

alikami March 5, 2010 06:12

shock tube
can u mail me ur case

vchhabra18 March 8, 2010 15:23

Same issue
Hi everyone here,

I just this post after searching for the same question for such a long. Even I am doing an MSc project on a shock tube and not too sure how to go about the diaphragm.

'agd' Your suggestion sounds very promising but to be honest, I am not too clever in fluent so would you mind just expalining the same thing a little more. It'll be of great help if you can please.

And Vinoo if you understood what agd was explaining and you tried that method too, than again it'll be very helpful if you could send me your case file to have a better idea.

Many thanks in advance

I will be waiting for the replies
Best Regards

agd March 8, 2010 21:35

Let your tube be length L. From 0 to L/2 initialize your field as (p1,T1,rho1,u1=0). From L/2 to L, initialize the field as (p2,T2,rho2,u2=0). Run simulation for some time length, post-process results.

vchhabra18 March 8, 2010 22:00

Thanks a lot AGD for your prompt reply. I guess I know what you mean now. I will try this out tmrw or day after and will get back if any more issues will come up.

I hope you would not mind helping me out than as well.

Many thanks once again
Best Regards
Vivek Chhabra

praveen2008 November 27, 2011 07:54

shock tube modelling using ansys design modeller, ansys meshing and ansys fluent

can anyone tell me if i could model a shock tube simulation using ansys design modeller, ansys meshing and ansys fluent??? and if someone could send me a case file to just to get a glimpse of the problem as I am new to ansys. It would be a great help if someone could help with how to define the diaphram and how to give the boundary conditions.

Please Help


esikhatar February 18, 2012 09:51

shock tube
Dear agd,
How we can do this initialize in the Fluent?
I cann't do that! :-(
Can you please send me a case file?


Originally Posted by agd (Post 249064)
Let your tube be length L. From 0 to L/2 initialize your field as (p1,T1,rho1,u1=0). From L/2 to L, initialize the field as (p2,T2,rho2,u2=0). Run simulation for some time length, post-process results.

agd February 19, 2012 19:33

I'm sorry, but I do not use Fluent. Perhaps someone else can supply the case file you are looking for.

moein_joon27 June 15, 2014 15:56

initialization of separate cells with different values in fluent
Hi Everyone

Here's my solution to your problem in initializing fluent with separate values and simulating a shock tube. I have tested it, I have got the results and I am sure it works properly.
you need a very simple grid which should be like a 2D rectangle. you don't need to separate it or create 2 zones. A simple 1-zone grid will work just fine. we will try to initialize that zone with different values.

suppose the problem says the parameters ( as an example ) are as the case in Hirsch's book:

length of tube=10 m.
width of tube is not important ( because the problem is actually one dimensional when considered inviscid ) i.e. give the width as you wish!

velocity = 0

velocity = 0

you should introduce the UDF mentioned below to fluent. Save it to a text file:

#include "udf.h"

cell_t c;
Thread *t;
real xc[ND_ND];

/* loop over all cell threads in the domain */

/* loop over all cells */


if (xc[0] < 5. )


C_U(c,t) = 0.;
C_V(c,t) = 0.;
C_P(c,t) = 100000.;
C_T(c,t) = 348.362;
C_R(c,t) = 1.;



C_U(c,t) = 0.;
C_V(c,t) = 0.;
C_P(c,t) = 10000.;
C_T(c,t) = 278.689;
C_R(c,t) = 0.125;



then go to Define> User Defined > Functions > interpreted and browse to the text file ( you must save it as *.c first) then again go to Define> User Defined > Function Hooks > initialization > Edit > select the name "moein_shock_tube_init" and then click on Add and then Ok.

then go to Solve > Initialiaze > press Init.
Dont' worry. the numbers like 300 kelvin in initialization dialog box will not influence your simulation and the udf will override them.
now you can plot contours or XY Diagrams and see the result.

Some more tips:
Is giving the temperature values like 348.362 necessary?
I don't think so, because you define your material as an ideal gas, since there is an ideal gas relation P = density * R * T. but I haven't tried eliminating that. :) you can try!
Also make sure to go to Operating Conditions and set the pressure to 0, since you must work with Absolute Pressures.
if you don't understand the commands in the UDF, search them in internet.

Define_init was the the key to this solution, but I'm happy I turned that key to open a door to salvation. :) I am now tired of typing, but I have a good sensation...

troymcfont July 15, 2015 07:15

Hi! Thanks for the UDF Moein.
Just a couple of question. Which BCs do you use at the left and the right of the tube? And also in my case the density is not patched correctly. After initializing I can only see the same value (1.62 kg/m3) everywhere even though I specified 2 different values for the left and the right states of the shock tube. I am using the density based solver with the ideal gas option for the density of the material.
Thank you so much.

All times are GMT -4. The time now is 11:14.