
[Sponsors] 
June 16, 2009, 05:22 

#21 
Member
Julian Krick
Join Date: May 2009
Location: Guelph
Posts: 88
Rep Power: 9 
Hi,
I used sonicFoam for solving the flow through a nozzle. I encountered the same problem of diverging Courant number after a few iterations. Changing the numerical scheme for the divergence terms did solve the problem. After some time, I found that my specific heat capacity (c_v) was specified incorrectly. When I changed c_v from 1.78571 to 717.51 and started the iteration process, the Courant number did also diverge, however it is stable over many time step before it suddenly diverges. Can anyone explain this to me?
__________________
grid generation: ICEM CFD 13.0 solver: CFX 13.0 Last edited by Julian K.; June 16, 2009 at 09:17. 

June 16, 2009, 16:41 

#22 
Member
Joern Bader
Join Date: Mar 2009
Posts: 33
Rep Power: 9 
did you just change Cv and nothing else?
if you just set up Cv and don't change R and U, then you get a completely different case. with Cv the speed of sound is defined as: c=sqr(R*p/rho*Cv + p/rho) if you just change Cv, you change c. check all other variables, possibly there is a problem. 

June 17, 2009, 08:49 

#23 
Member
Julian Krick
Join Date: May 2009
Location: Guelph
Posts: 88
Rep Power: 9 
I changed the Cv value, only. Now, I'm sure that I defined R and Cv correctly.
After some investigation of the flow, I encountered another possible source for the diverging Courantnumber. The following happens: I'm simulating a supersonic convergentdivergent nozzle. There is a shock in the divergent part of the nozzle causing the boundary layer to separate, which creates a vortice. This vortice is transported towards the outlet. When it hit the outlet, there is a sudden and dramatic increase in velocity in this region, which is pointing into the nozzle. Thus the Courantnumber increases. I'm quiet sure that this increase in velocity is artificial. I suppose, it occurs because of reversed flow due to the vortice. The BC at the outlet obivously does not let the vortice pass. I already used the 'totalPressure' BC and a 'fixedValue' BC for the outlet, however, the effect occurs for both types. Can anyone suggest a BC which is more appropriate?
__________________
grid generation: ICEM CFD 13.0 solver: CFX 13.0 

June 17, 2009, 09:11 

#24 
Member
Joern Bader
Join Date: Mar 2009
Posts: 33
Rep Power: 9 
ok, i never used 'totalpressure', but 'fixedValue' is wrong.
for mu=0 the sonicFoam solver solves the EulerEquations. These Equations have the eigenvalues vc, v and v+c. For a supersonic flow all these eigenvalues are >0 so error shocks run all in your flowdirection. So have to set 3 fixedValues at inlet and no value at the outlet. try 'zeroGradient' at the outlet. 

June 23, 2009, 11:18 

#25 
New Member
Join Date: Jun 2009
Posts: 8
Rep Power: 8 
ok here is my update which i also posted in another thread :
Hey ive been following this discussion I am trying to model barrell shocks in an axisymmetric model. Inlet air is M=1. The exit is a subsonic outlet. I am using rhoSonicFoam [modified to read p , rho, T, U fields , so that the solver can accept derived BCs ] , Im using nonreflective BCs at the exit for rho, since for subsonic outlet , the eigenvalue correspding to rho is ve. However i am not getting the inlet BCs correct . I ll summarize the Bc i have tried : p Inlet : totalPressure outlet : fixedValue [ static] rho inlet: fixedValue outlet : nonReflective. U inlet : 350 outlet : zeroGradient T Inlet : 250 outlet : zerogradient U & T are fine.. kindly suggest me a better combination .... 

July 7, 2009, 04:34 

#26 
Member
Julian Krick
Join Date: May 2009
Location: Guelph
Posts: 88
Rep Power: 9 
I used the BC 'waveTransmissive' in order to have a nonreflecting BC. Find more infos here: http://www.openfoamwiki.net/index.ph...dary_condition
and here: Pressure Inlet Velocity
__________________
grid generation: ICEM CFD 13.0 solver: CFX 13.0 

July 7, 2009, 10:04 

#27 
Member
Mihir
Join Date: Mar 2009
Posts: 40
Rep Power: 9 
hey thank you ..
ok , they have said that the "waveTransmissive" BC is more general , but just for confirmation . can it be used for U & p [subsonic outlet ] both ??? 

July 7, 2009, 10:42 

#28  
Member
Julian Krick
Join Date: May 2009
Location: Guelph
Posts: 88
Rep Power: 9 
Quote:
Code:
outflow {type waveTransmissive;[...]field U; //the name of the field that we are working on; here you put p or U for pressure or velocity, respectively [...]}
__________________
grid generation: ICEM CFD 13.0 solver: CFX 13.0 

July 7, 2009, 10:47 

#29  
Member
Mihir
Join Date: Mar 2009
Posts: 40
Rep Power: 9 
hey thanx..
Quote:
Quote:
inlet fixed outlet zeroGradient these r my BC .are they correct ? . ill proceed with my new simulation & see where it leads me 

July 13, 2009, 04:41 

#30 
Member
Julian Krick
Join Date: May 2009
Location: Guelph
Posts: 88
Rep Power: 9 
Well, I think your BCs are correctly defined. Let me know if your results are okay.
__________________
grid generation: ICEM CFD 13.0 solver: CFX 13.0 

July 28, 2009, 17:00 
CFL criterion

#31  
New Member
Barath Ezhilan
Join Date: Jun 2009
Posts: 20
Rep Power: 8 
I am currently simulating vortex breakdown in a conical diffuser and am doing unsteady simulations using transientSimpleFoam and LAunderGibsonRSTM model.
I have a doubt. The generally suggested criteria that CFL<1, is it the Courant Number mean value or the max courant number value??? I have a mean Courant Number of close to 0.13 and Maximum Courant Number of close to 7. (Courant Number mean: 0.130184 max: 7.10512 velocity magnitude: 3.59437) And I am able to capture the vortex. (URANS using conventional ke and kw models dont work!!!!) Is it the correct solution that I have got or is the solution unphysical as the CFL condition states?? Quote:


August 6, 2009, 12:40 

#32  
New Member
Join Date: Jun 2009
Posts: 8
Rep Power: 8 
Quote:
Code:
p boundaryField { inlet { type totalPressure; p0 uniform 1.0135e5; U U; phi phi; rho none; psi none; gamma 1.4; // value uniform 12780.45; } outlet { type waveTransmissive; value uniform 1000; field U; gamma 1.4; phi phi; rho rho; psi psi; lInf 0.5; fieldInf 1000; } U internalField uniform (260.39 0 0); boundaryField { inlet { type fixedValue; value uniform (700 0 0); } outlet { //type zeroGradient; type waveTransmissive; value uniform (10 0 0 ); field U; gamma 1.4; phi phi; rho rho; psi psi; lInf 0.5; fieldInf (10 0 0 ); } Code:
Mass flux at axis = 0 Mass flux at back = 0.000445458 Mass flux at front = 0.000445456 Mass flux at frontAndBackPlanes = 0 Mass flux at inlet = 0.000497143 Mass flux at outlet = 0.000572761 Mass flux at wall = 0 Time = 0.019552 Net mass flux = 7.56164e05 Time = 0.0195521 

August 18, 2009, 05:36 

#33 
Member
Julian Krick
Join Date: May 2009
Location: Guelph
Posts: 88
Rep Power: 9 
Dear Statesman,
for my simulations (critical CDnozzle) I'm using the 'rhoCentralFoam' solver. I read, that it should be more precise than the other incompressible solvers http://openfoamwiki.net/index.php/TestLucaG Maybe, this will help.
__________________
grid generation: ICEM CFD 13.0 solver: CFX 13.0 

September 10, 2009, 06:09 

#34 
New Member
Join Date: Sep 2009
Posts: 4
Rep Power: 8 
I'm currently using the rhoSonicFoam solver (OpenFoam 1.6) and my Courant number is exploding as well, although I'm sure my bc are correct, since my case is very similar to the forewardStep tutorial.
Therefore I went back to the forewardStep tutorial and changed the mesh. I just moved the vertice of the obstacle corner a little right (from (0.6 0.2 z) to (1 0.2 z)). But even with this small change the courant number explodes after a while. Since the changing of the mesh causes some cells to be deformed and some getting a bit smaller I decreased the time step to 0.001 (from 0.002). But it didn't help. For me rhoSonicFoam only worked for the turorial cases. What can I do? 

September 10, 2009, 08:24 

#35 
Member
Joern Bader
Join Date: Mar 2009
Posts: 33
Rep Power: 9 
sandrak, plese give some more info.
what are your BCs? what is your U? how is your start CoNum? what are your initial values? what schemes do you use? 1. rhoSonic is just stable for Ma>2. If you use a lower Ma, you need a far smaller timestep. 2. you have to use bounded schemes for div. rhoSonic solves the Euler Equations, they are convection dominated and if the convection is not bounded, the solver is unstable. 

September 10, 2009, 08:30 

#36 
Member
Julian Krick
Join Date: May 2009
Location: Guelph
Posts: 88
Rep Power: 9 
Hi Sandrak,
maybe you should try to use 'rhoCentralFoam'. According to the literature I gave in my last post, this solvers is more accurate than 'rhoSonicFoam'. Furthermore, from my point of view it seems to be even more stable, as well, at least in my case. Generally, my problem is that pressure waves are not transmitted across the output. They are reflected, even tough, I use the 'waveTransmissive' BC for p at the outlet (I am currently testing different values for lInf, so maybe I will get better results in some time). With 'rhoSonicFoam' my simulations always crashed after the pressure wave has been reflected. With 'rhoCentralFoam' the pressure wave is reflected as well, however, the simulation does not crash. It's just that the pressure wave will travel towards the inlet of my nozzle. Thus, I suppose that 'rhoCentralFoam' is more stable. Furthermore, the shock is resolved more distinct with 'rhoCentralFoam' than with 'rhoSonicFoam'.
__________________
grid generation: ICEM CFD 13.0 solver: CFX 13.0 

September 10, 2009, 10:49 

#37 
Member
Mihir
Join Date: Mar 2009
Posts: 40
Rep Power: 9 
Sandrack
So you are where each of us [ me , Julian , Joern] was a few months ago.. Please post your BCs that you are applying so that we can know better what you are actually doing.
Just read CFD texts to understand the above mentioned items Julian I ve been using sonicFoam with Minmod schemes for divSchemes. & backward for ddtSchemes. SO far I'm very happy in terms of both stability & results. However would you mind sharing with me the boundary conditions of rhoCentralFoam ? I used the same as i posted earlier , but my code wouldn't run. 

September 11, 2009, 05:29 

#38 
Member
Julian Krick
Join Date: May 2009
Location: Guelph
Posts: 88
Rep Power: 9 
Thanks for the last post Mihir, you have stated the problem quite well.
Here are my boundary conditions I use for my simulation and a brief explanation of what I am doing: My domain is 2D, axiSymmetric and consists of a CD noozle,only. That means, I do not have a far field before or after the nozzle. That's probably why I get problems with the outlet BC, because, if I had a far field, the pressure waves could leave the outlet and due to increasing cell size, the waves would be damped, so that at the farfield outlet, there would be a weak BC interaction, only. Anyway, I induce the flow with a pressure difference at dp=300mbar. At the inlet I have atmospheric pressure and thus at the outlet the low pressure. I am using rhoCentralFoam. I have uploaded a little video of the pressure contours:http://www.youtube.com/watch?v=hhriqus28 The BCs are: p Code:
dimensions [1 1 2 0 0 0 0]; internalField uniform 101325; boundaryField { inlet { type fixedValue; value uniform 101325; } outlet { type waveTransmissive; phi phi; rho rho; psi psi; gamma 1.4; fieldInf 71325; lInf 0.05;// I have increased this value from 0.05 to 500 now, without noticing any difference. value uniform 71325; } wall { type zeroGradient; } symmetry { type empty; } frontAndBackPlanes { type empty; } frontAndBackPlanes_pos { type wedge; } frontAndBackPlanes_neg { type wedge; } } Code:
dimensions [0 1 1 0 0 0 0]; internalField uniform (0 0 0); boundaryField { inlet { type zeroGradient; } outlet { type zeroGradient; } wall { type fixedValue; value uniform (0 0 0); } symmetry { type empty; } frontAndBackPlanes { type empty; } frontAndBackPlanes_pos { type wedge; } frontAndBackPlanes_neg { type wedge; } } Code:
dimensions [0 0 0 1 0 0 0]; internalField uniform 293.14; boundaryField { inlet { type fixedValue; value uniform 293.14; } outlet { type zeroGradient; } wall { type zeroGradient; } symmetry { type empty; } frontAndBackPlanes { type empty; } frontAndBackPlanes_pos { type wedge; } frontAndBackPlanes_neg { type wedge; } } Code:
//fluxScheme Tadmor; // KT fluxScheme Kurganov; // KNP ddtSchemes { default CrankNicholson 1; //Euler; } gradSchemes { default Gauss linear; } divSchemes { default none; div(tauMC) Gauss linear; } laplacianSchemes { default Gauss linear corrected; } interpolationSchemes { default linear; reconstruct(rho) vanLeer; reconstruct(U) vanLeerV; reconstruct(T) vanLeer; // reconstruct(rho) upwind; // reconstruct(U) upwind; // reconstruct(T) upwind; } snGradSchemes { default corrected; } Code:
solvers { rho diagonal {}; rhoU diagonal {}; rhoE diagonal {}; U smoothSolver { smoother GaussSeidel; nSweeps 2; tolerance 1e09; relTol 0.01; }; h smoothSolver { smoother GaussSeidel; nSweeps 2; tolerance 1e10 relTol 0; }; } If you need more information, let me know. Mihir, could you also post your fvSchemes? I'd be very interested. Maybe also you rBC setup for P U and T. Thanks.
__________________
grid generation: ICEM CFD 13.0 solver: CFX 13.0 Last edited by Julian K.; September 11, 2009 at 05:47. 

September 11, 2009, 05:54 

#39 
New Member
Join Date: Sep 2009
Posts: 4
Rep Power: 8 
Thanks for your replies, they helped. As I said, my case is very similar to the forewardStep case, just a slightly different mesh.
U: inlet fixedValue: (2 0 0), outlet: zeroGradient, wall/obstacle: fixedValue (0 0 0), top: symmetryPlane p: inlet fixedValue: 1, outlet: zeroGradient, wall/obstacle: zeroGradient, top: symmetryPlane The shock waves were a really good hint. In my case a pressure wave was reflected at the obstacle and travelled back to my inlet, where I had stated a constant pressure of 1. It happend that a region of very high pressure and very low pressure were at a small distance and thus I got very high velocity behind my inlet and that was, what caused the crash. After I changed the p bc at the inlet to zeroGradient as well, the program runs stable, even when I change the velocity at the inlet to Mach smaller than 2. So thanks. I understand the problem much more now. 

September 11, 2009, 06:20 

#40 
Member
Joern Bader
Join Date: Mar 2009
Posts: 33
Rep Power: 9 
sandrak,
what you discribe is a problem of rhosonicfoam. the solver is a "direct" solver for the decoupled eulerequations. if you use Ma 2 as speed the shockwaves all point into your domain, thats ok. but the speed is not fast enough to transport reflected shockwaves. if you use Ma 3 it should work. the real problem is, that the decoupled equations produce an error in U. If the speed is fast enough the solve of the mass equation (for rho) corrects this error. if the speed is slower this error is not corrected. An solution for that gives the sonicFoam solver. This solver does an pressurecorrection (PISO) to correct U and p. there you should be able to use all Ma speeds correct with a possible CoNum of ~1. (The BCs have to be set right) For sonicFoam make shure that you do outer an inner corrections (fvSolutionPISOControls). If one of them is 0 you never solve the pressure equation and do no correction. 

Thread Tools  
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
How to get the Global Node Number by UDF : Fluent  Yusuke  FLUENT  1  October 23, 2015 10:55 
CFL number  Daniele  CFX  5  July 19, 2012 19:11 
Number of interation?  Tu  Phoenics  1  September 28, 2008 14:12 
SOS! HELP! max number of cells :(  Jas  Phoenics  4  February 14, 2004 11:12 
Boundary region number limitation  Pablo Barreiro  CDadapco  1  May 2, 2001 11:13 