CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT

Shock tube simulation in Fluent

Register Blogs Community New Posts Updated Threads Search

Like Tree8Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 4, 2010, 00:55
Red face Shock tube simulation in Fluent
  #1
New Member
 
SV
Join Date: Mar 2010
Location: malaysia
Posts: 2
Rep Power: 0
Vinoo_P is on a distinguished road
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.
Vinoo_P is offline   Reply With Quote

Old   March 4, 2010, 10:27
Default
  #2
agd
Senior Member
 
Join Date: Jul 2009
Posts: 351
Rep Power: 18
agd is on a distinguished road
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.
agd is offline   Reply With Quote

Old   March 5, 2010, 03:32
Default
  #3
New Member
 
SV
Join Date: Mar 2010
Location: malaysia
Posts: 2
Rep Power: 0
Vinoo_P is on a distinguished road
Ok I will try that right away
Vinoo_P is offline   Reply With Quote

Old   March 5, 2010, 05:12
Default shock tube
  #4
Member
 
ali
Join Date: May 2009
Posts: 58
Rep Power: 16
alikami is on a distinguished road
can u mail me ur case file....a1k1s1@yahoo.com
thanks
regards
alikami is offline   Reply With Quote

Old   March 8, 2010, 14:23
Post Same issue
  #5
New Member
 
Vivek Chhabra
Join Date: Mar 2010
Posts: 3
Rep Power: 16
vchhabra18 is on a distinguished road
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
vchhabra18 is offline   Reply With Quote

Old   March 8, 2010, 20:35
Default
  #6
agd
Senior Member
 
Join Date: Jul 2009
Posts: 351
Rep Power: 18
agd is on a distinguished road
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 is offline   Reply With Quote

Old   March 8, 2010, 21:00
Post Thanks
  #7
New Member
 
Vivek Chhabra
Join Date: Mar 2010
Posts: 3
Rep Power: 16
vchhabra18 is on a distinguished road
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
vchhabra18 is offline   Reply With Quote

Old   November 27, 2011, 06:54
Default shock tube modelling using ansys design modeller, ansys meshing and ansys fluent
  #8
New Member
 
Praveen
Join Date: Nov 2011
Posts: 3
Rep Power: 14
praveen2008 is on a distinguished road
Hi,

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 praveen2008@gmail.com 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

Thankyou
praveen2008 is offline   Reply With Quote

Old   February 18, 2012, 08:51
Default shock tube
  #9
New Member
 
kaka
Join Date: Feb 2011
Posts: 14
Rep Power: 15
esikhatar is on a distinguished road
Dear agd,
How we can do this initialize in the Fluent?
I cann't do that! :-(
Can you please send me a case file?
Thanks
zztnshn_2@yahoo.com

Quote:
Originally Posted by agd View Post
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.
esikhatar is offline   Reply With Quote

Old   February 19, 2012, 18:33
Default
  #10
agd
Senior Member
 
Join Date: Jul 2009
Posts: 351
Rep Power: 18
agd is on a distinguished road
I'm sorry, but I do not use Fluent. Perhaps someone else can supply the case file you are looking for.
agd is offline   Reply With Quote

Old   June 15, 2014, 15:56
Default initialization of separate cells with different values in fluent
  #11
New Member
 
m p
Join Date: Nov 2010
Posts: 15
Rep Power: 15
moein_joon27 is on a distinguished road
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!


Left:
Pressure=100,000
density=1.
velocity = 0

Right:
Pressure=10,000
density=0.125
velocity = 0

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


#include "udf.h"

DEFINE_INIT(moein_shock_tube_init,d)
{
cell_t c;
Thread *t;
real xc[ND_ND];

/* loop over all cell threads in the domain */
thread_loop_c(t,d)
{

/* loop over all cells */
begin_c_loop_all(c,t)
{

C_CENTROID(xc,c,t);

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.;
}

else

{

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;



}

}
end_c_loop_all(c,t)
}
}


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...

Last edited by moein_joon27; June 17, 2014 at 07:09.
moein_joon27 is offline   Reply With Quote

Old   July 15, 2015, 07:15
Default
  #12
New Member
 
B. F
Join Date: Feb 2014
Posts: 5
Rep Power: 12
troymcfont is on a distinguished road
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.
troymcfont is offline   Reply With Quote

Old   August 14, 2015, 06:47
Question
  #13
POI
New Member
 
Join Date: Aug 2015
Posts: 1
Rep Power: 0
POI is on a distinguished road
Hi,

please am new to CFD can someone send me a case file on shock tube simulation to guide me on various boundary conditions at the inlet, outlet, diaphragm and how to determine mach number, to peacefisimiintl@yahoo.com
Please Help

Thank you
POI is offline   Reply With Quote

Old   March 28, 2016, 17:20
Default Parse error
  #14
ADI
New Member
 
A. N.
Join Date: Oct 2009
Posts: 10
Rep Power: 16
ADI is on a distinguished road
Send a message via MSN to ADI
Any one getting a parse error when interpreting this UDF?

I get parse error for the 'if loop' start line, 'else' line and the final '}s'...

Can any one help?
__________________
Adi.
ADI is offline   Reply With Quote

Old   May 22, 2016, 03:19
Default
  #15
New Member
 
cfduser
Join Date: May 2016
Posts: 15
Rep Power: 9
hello-fluenttt is on a distinguished road
Quote:
Originally Posted by moein_joon27 View Post
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!


Left:
Pressure=100,000
density=1.
velocity = 0

Right:
Pressure=10,000
density=0.125
velocity = 0

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


#include "udf.h"

DEFINE_INIT(moein_shock_tube_init,d)
{
cell_t c;
Thread *t;
real xc[ND_ND];

/* loop over all cell threads in the domain */
thread_loop_c(t,d)
{

/* loop over all cells */
begin_c_loop_all(c,t)
{

C_CENTROID(xc,c,t);

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.;
}

else

{

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;



}

}
end_c_loop_all(c,t)
}
}


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...
Hey..!!! Thanks for your post...the density contour is coming wrong and could you explain how can we make the shock wave to move inside it under transient flow...
hello-fluenttt is offline   Reply With Quote

Old   June 22, 2016, 07:47
Default cfd shock tube simullation
  #16
KLG
New Member
 
Kanchan Gurung
Join Date: Jun 2016
Posts: 4
Rep Power: 9
KLG is on a distinguished road
can anyone send me .cas case file of shock tube simulation in my email. I have been having problem regarding patching and assigning BCs on the tube?
kanchugurung94@gmail.com
KLG is offline   Reply With Quote

Old   June 22, 2016, 08:13
Default
  #17
New Member
 
cfduser
Join Date: May 2016
Posts: 15
Rep Power: 9
hello-fluenttt is on a distinguished road
you can simply copy the code and write it in a .c file and compile and use it in fluent solver. no BC or patching required. The udf will simply initialise the problem and that will be sufficient. see Moin's post .....
KLG likes this.
hello-fluenttt is offline   Reply With Quote

Old   June 24, 2016, 07:26
Default
  #18
KLG
New Member
 
Kanchan Gurung
Join Date: Jun 2016
Posts: 4
Rep Power: 9
KLG is on a distinguished road
can anyone mail me the journal or article regarding results obtained by simulating open type shock tube in fluent?
I have no idea what type of contours comes as a result of the simulation of open type shock tube?
mail: kanchugurung94@gmail.com
KLG is offline   Reply With Quote

Old   July 29, 2016, 18:40
Default High Pressure Vessel discharge
  #19
New Member
 
José
Join Date: May 2014
Location: Argentina
Posts: 7
Rep Power: 11
jzapatau is on a distinguished road
Hi, sorry to bother, but I am dealing with a similar problem. I am trying to simulate the high pressure discharge of a nitrogen tank (tube shape )with an initial pressue of ~80 bar. So far I have a good capture of the underexpanded jet on the outlet, though I am suspicious of the expansion wave that develops within the tube. This phenomena is something characteristic of shock tubes.
What happens is that the front expansion wave dissipates while it moves across the tube, and I my understanding is that it shouldnt dissipate, so my suspicious goes that I might be having some numerical diffusion.

The order of the method Im using is second order upwind for the convective term, and the solver is density based. Do you have any recommendation on which method I should use to avoid this dissipation?

I would appreciate any comment on this issue and I thank you for taking the time for readind this.

Regards,

jzapatau
jzapatau is offline   Reply With Quote

Old   August 27, 2018, 15:49
Default
  #20
New Member
 
vektor
Join Date: Aug 2018
Posts: 23
Rep Power: 7
vek123 is on a distinguished road
hi, i tried your udf and i get wrong pressure distribution i get separate regions but not as written in the text file i get very small pressures like between 10e-8 and 10e-5. i am messing something because i went through a pdf of how to make the udfs and the one you provided is correct, but somehow the fluent overwrite it or something

Last edited by vek123; August 27, 2018 at 23:12.
vek123 is offline   Reply With Quote

Reply

Tags
shock tube, simulation


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
HELP - Moving car simulation in fluent Brad Wells FLUENT 7 January 4, 2018 19:55
shock absorber simulation dik FloEFD, FloWorks & FloTHERM 2 May 7, 2010 08:36
[ask] shock absorber simulation dik Main CFD Forum 1 December 17, 2009 01:32
Fluent Remote Simulation Facility Service (RSF) di Rami FLUENT 2 June 4, 2008 05:38
Shock Tube Test queram Main CFD Forum 0 July 8, 2006 04:24


All times are GMT -4. The time now is 03:39.