
[Sponsors] 
August 7, 2007, 05:33 
Hello!
I am using turbFoam

#1 
New Member
Hardy
Join Date: Mar 2009
Location: Sweden
Posts: 19
Rep Power: 9 
Hello!
I am using turbFoam to do a transient analysis. First I made a steady state analysis to get a start solution for the transient case. After changing to transient, whith Euler scheme, the Courant number becomes very high within a couple of time steps and the simulation crashes. This happens even when I lower the time step to a small value. Am I perhaps doing something wrong when going to transient? I simply set the start time, in controlDict, as the number of the latest iteration from the steady state case in whose folder all variables are saved. Will my boundary conditions be preserved now? Is this the right way to do it or am i missing something here....or somewhere else... Any ideas appreciated!! 

August 13, 2007, 09:01 
Hello again!
Just to compl

#2 
New Member
Hardy
Join Date: Mar 2009
Location: Sweden
Posts: 19
Rep Power: 9 
Hello again!
Just to complement myself, the steady state start solution is made with simpleFoam before taking the results to turbFoam. And after doing some more investigation I think I can rule out the concerns about preservation of the boundary conditions. They are stored in the result files under boundaryField, right? Thank You!! /H 

August 13, 2007, 11:33 
Hello Hardy,
this may happen,

#3 
Member
Rolando Maier
Join Date: Mar 2009
Posts: 89
Rep Power: 9 
Hello Hardy,
this may happen, if the pressure equation isn´t solved accurately enough. Make sure, that your initial Co is small enough, take a value of 0.2 or 0.3 for that. Increment the number of correctors and nonorthogonal correctors (how much is problem dependend). If your simulation runs stable, after a while you can change that parameters to improve efficiency. Experiment with that. Rolando 

August 13, 2007, 11:43 
Hello Hardy,
A Good day to

#4 
Senior Member
Philippose Rajan
Join Date: Mar 2009
Location: Germany
Posts: 531
Rep Power: 17 
Hello Hardy,
A Good day to you :)! I have a couple (ok..more :)!) of questions regarding the problem you are facing..... You mentioned that the Courant number becomes "high" after a few iterations, and that happens even when you make the time steps "small". Could you quantify these terms? How high does the Courant number go and after how many iterations, and what was the smallest time step you tried ? Also... how big is your mesh, what kind of cells does your mesh contain, and how well did the solution converge during the steady state run using simpleFOAM, after how many iterations? I know that is a lot of stuff to ask for :)! But it would help figure out why your Courant number is shooting up. One other thing.... did you try the Automatic Time Step adjust feature in OpenFOAM? You can set a maximum courant number, and the time step is automatically adjusted to maintain this courant number. Have a nice day! Philippose 

August 14, 2007, 02:52 
Thank You for your kind answer

#5 
New Member
Hardy
Join Date: Mar 2009
Location: Sweden
Posts: 19
Rep Power: 9 
Thank You for your kind answers and ideas!
I have now set the time step to give a Courant nr = 0.3 I also set the number of correctors and nonorthogonal correctors up to 5 and it really seems to work now!! :) Philippose, you made me interested in the Automatic Time Step adjust feature. How do you use it, is there perhaps some kind of tutorial to look into? Thanks! /H 

August 14, 2007, 14:24 
Hi Hardy,
The Automatic Tim

#6 
Senior Member
Join Date: Mar 2009
Posts: 225
Rep Power: 10 
Hi Hardy,
The Automatic Time Step function is defined in the same dictionary file as maximum Courant number. It is a controlDict file in system/ folder. There is writeControl option. Change it to adjustableRunTime. Also there is runTimeModifiable option, set it to yes. Remember the automatic time step is dependent on maxCo value, so it is adjusted to fit it. Hope that helps. Cheers! Krystian 

August 14, 2007, 15:55 
Hello,
Oops.... Krystian, t

#7 
Senior Member
Philippose Rajan
Join Date: Mar 2009
Location: Germany
Posts: 531
Rep Power: 17 
Hello,
Oops.... Krystian, there is an oversight in the suggestion you have provided.... the changes to be made to enable Automatic Time stepping in OpenFOAM are the following: As you mentioned, these changes have to be made to the controlDict file within the system folder of a case... but the changes themselves are: maxCo [the maximum Courant number you want]; adjustTimeStep [yes/no]; For example, you could add the following two lines to the end of your controlDict file to enable automatic time stepping, where the maximum courant number is limited to 0.5: maxCo 0.5; adjustTimeStep yes; The other two options... writeControl adjustableRunTime  This basically tells the system, to adjust the time step (if the time step is variable) so that at the point in time when an output needs to be written to disk, the simulation time exactly equals the write time..... For example, if you had a simulation time of 0.0018, and the time at which the next write happens is 0.002, and you had variable time step step which at that instance was 0.00025... then, the time step would be adjusted to 0.0002, so that the solution can be written to disk at the next step. runTimeModifiable [yes/no>]  This option tells the system, that even when a simulation has been started, and is running, if there is a change in any of the files for example, controlDict, fvSolution, fvSchemes, etc...etc... these changes should be accounted for, from the next simulation step onwards. Using this option, you can change, for example, the write interval, or the solver tolerances, etc... while the simulation is running. Anyway.... now... there is one more problem... :)! turbFoam by default, does not support adjustable time stepping. So, even if you do put these two options into the controlDict file, you will still not see any changes in the time step. I have made the small modifications required to turbFoam to enable variable timestepping, and created another solver called turbFoamVarDt (Couldnt think of a better name :)!), which you could compile and try out... turbFoamVarDt.tar.gz Enjoy! Philippose 

August 15, 2007, 05:34 
Thank You all once again!

#8 
New Member
Hardy
Join Date: Mar 2009
Location: Sweden
Posts: 19
Rep Power: 9 
Thank You all once again!
I managed to get the turbFoamVarDt solver to run and am now exploring its capabilities :) To switch subject a bit, does anyone know how to get values of lift and drag force from each time step? I have seen other threads on this subject on the forum but don´t realy get it?? Regards! /H 

August 1, 2008, 16:39 
Thanks Philippose for sharing

#9 
Senior Member

Thanks Philippose for sharing this variable delta T turbFoam, I have adapted it to OF 1.5 and also made it read the maxCo value at every loop in order to be able to change it while the program is running.
(I simply moved the # include "readTimeControls.H" within the while loop) turbFoam.tar.gz It is also interesting to note that the writeInterval for this represents the time interval in seconds and not in timesteps. 

November 12, 2008, 04:33 
Time = 0.0038
Courant Numbe

#10 
Guest
Posts: n/a

Time = 0.0038
Courant Number mean: 2.09671 max: 1060.3 DILUPBiCG: Solving for Ux, Initial residual = 0.919624, Final residual = 1.67874e06, No Iterations 37 DILUPBiCG: Solving for Uy, Initial residual = 0.901699, Final residual = 2.47234e06, No Iterations 36 DILUPBiCG: Solving for Uz, Initial residual = 0.938489, Final residual = 4.1829e06, No Iterations 36 DICPCG: Solving for p, Initial residual = 0.879601, Final residual = 0.00364827, No Iterations 1001 time step continuity errors : sum local = 0.0259577, global = 9.6956e08, cumulative = 3.94409e06 DICPCG: Solving for p, Initial residual = 0.666183, Final residual = 0.000557632, No Iterations 1001 time step continuity errors : sum local = 0.0113467, global = 8.28394e06, cumulative = 1.2228e05 DILUPBiCG: Solving for T, Initial residual = 0.64382, Final residual = 6.68318e08, No Iterations 59 ExecutionTime = 378.29 s ClockTime = 381 s Time = 0.0039 Courant Number mean: 9.857 max: 30723.2 DILUPBiCG: Solving for Ux, Initial residual = 0.992898, Final residual = 7.52633e06, No Iterations 52 DILUPBiCG: Solving for Uy, Initial residual = 0.990041, Final residual = 4.81015e06, No Iterations 55 DILUPBiCG: Solving for Uz, Initial residual = 0.995945, Final residual = 7.08196e06, No Iterations 51 DICPCG: Solving for p, Initial residual = 0.943505, Final residual = 0.00279098, No Iterations 1001 time step continuity errors : sum local = 0.133287, global = 0.000834918, cumulative = 0.000847146 DICPCG: Solving for p, Initial residual = 0.511564, Final residual = 0.000185419, No Iterations 1001 time step continuity errors : sum local = 0.0590576, global = 0.0111944, cumulative = 0.0103473 DILUPBiCG: Solving for T, Initial residual = 0.906877, Final residual = 6.47856e08, No Iterations 76 ExecutionTime = 392.06 s ClockTime = 395 s Time = 0.004 Courant Number mean: 114.419 max: 474556 DILUPBiCG: Solving for Ux, Initial residual = 0.997831, Final residual = 5.29673e06, No Iterations 199 DILUPBiCG: Solving for Uy, Initial residual = 0.995946, Final residual = 2.97571e06, No Iterations 208 DILUPBiCG: Solving for Uz, Initial residual = 0.997078, Final residual = 7.97488e06, No Iterations 198 DICPCG: Solving for p, Initial residual = 0.967972, Final residual = 0.244505, No Iterations 1001 time step continuity errors : sum local = 357.75, global = 0.0473633, cumulative = 0.0577106 DICPCG: Solving for p, Initial residual = 0.43629, Final residual = 0.000865386, No Iterations 1001 time step continuity errors : sum local = 78.2216, global = 0.0380752, cumulative = 0.0957858 DILUPBiCG: Solving for T, Initial residual = 0.96816, Final residual = 8.15618e08, No Iterations 88 ExecutionTime = 411.14 s ClockTime = 414 s Time = 0.0041 I have such a problem that courant number increasing after a while...I can t find out the problem...I have decrease time steps and it is working longer but again crash... can someone help me? best regards emo 

November 12, 2008, 09:02 
can anyone help me?
please

#11 
Guest
Posts: n/a

can anyone help me?
please thanks Emo 

November 12, 2008, 10:42 
If I recall correctly, turbFoa

#12 
Senior Member
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Deltares, Delft, The Netherlands
Posts: 1,693
Rep Power: 27 
If I recall correctly, turbFoam is already equiped with a variable timestepping routine based on a Courant number.
If you are in doubt with respect to how to apply it, look into the controlDict in the interFoam/damBreak case. Besst regards, Niels
__________________
Please note that I do not use the Friendfeature, so do not be offended, if I do not accept a request. 

November 18, 2008, 05:55 
Hi Emilian,
I see your delt

#13 
Senior Member
Wolfgang Heydlauff
Join Date: Mar 2009
Location: Germany
Posts: 136
Rep Power: 10 
Hi Emilian,
I see your deltaT is 1e4...? try a smaller deltaT. when I calculate my grids. I'm startting with a deltaT of 1e8. after 1000 timesteps calculated I turn it up to 1e7. 1000 later to 1e6. and finally to 5e6. this works fine. 

November 19, 2008, 14:36 
Hi again,
here are some fac

#14 
Senior Member
Wolfgang Heydlauff
Join Date: Mar 2009
Location: Germany
Posts: 136
Rep Power: 10 
Hi again,
here are some facts to look after for a better running (anyone please correct me if I'm wrong)  alternatively you can use adjustable timestepcontrol (see under http://www.cfdonline.com/OpenFOAM_D...tml?1227012935 )  the nonhorthogonality mustn't be to great  using a more aggressive solver/schema  increasing the solution precision (make smaller!)  maybe start simulation with turbulence OFF. after good advice turn on and go on simulating  turn down turbulence a little  does your mesh look "smooth"??  all BC correct? hope that helps a little 

Thread Tools  
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
courant number for transient flow on CFX ?  amine  CFX  13  August 20, 2013 19:02 
TurbFoam and high nu viscosity  lam  OpenFOAM Running, Solving & CFD  0  June 7, 2007 10:54 
PISO for high Courant Numbers  turb  Main CFD Forum  1  April 20, 2006 11:42 
courant number for cfx transient run  Mike  CFX  8  April 6, 2006 23:48 
High lift analysis using overset  keitee  Main CFD Forum  0  April 10, 2003 09:53 