|
[Sponsors] |
Is it to possible to change time step DeltaT during a calculation |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
March 13, 2007, 00:44 |
I am using icoFoam to calculat
|
#1 |
Member
roy fokker
Join Date: Mar 2009
Posts: 44
Rep Power: 17 |
I am using icoFoam to calculate a simple fluid, however I want to change the time step dynamically, e.g. first time step is: deltaT[1]=0.001, the next time step is deltaT[2]=0.003, the next is deltaT[3]=0.002, and so on.
i.e. t0=0 t1=0+0.001=0.001 t2=0.001+0.003=0.004 t3=0.004+0.002=0.006 Maybe it is a wired problem, but in my program it seems that I need such kind of dynamic timestep, is it possible to program it in OpenFOAM? I didn't find any function like runTime.setTimeStep(DeltaT)...the only function I found is adjustDeltaT() but it is protected and after I read through the source, I found it is not doing what I want. Thanks a lot! |
|
March 13, 2007, 03:32 |
I use
scalar dt=runTime.de
|
#2 |
Senior Member
Thomas Jung
Join Date: Mar 2009
Posts: 102
Rep Power: 17 |
I use
scalar dt=runTime.deltaT() to get the actual timestep, and runTime.setDeltaT(dt) to set it to a new value, works. Have fun ... Thomas |
|
November 1, 2007, 18:59 |
Hi.
the example above, is e
|
#3 |
Member
Ken Darcovich
Join Date: Mar 2009
Location: Ottawa, Canada
Posts: 34
Rep Power: 17 |
Hi.
the example above, is exactly what I'm trying to do and when I implement the code as shown above, NOTHING changes. This makes me think that I also have to have some "include file" statements, or need to have some extra libraries mentioned in the "options" file. Any advice? thanks. |
|
November 1, 2007, 19:48 |
it should work using setDeltaT
|
#4 |
Member
roy fokker
Join Date: Mar 2009
Posts: 44
Rep Power: 17 |
it should work using setDeltaT(dt):
like this: runTime.setTime(tStart,0); runTime.setDeltaT(dt); runTime.setEndTime(runTime.value()+runTime.deltaT( ).value()); |
|
November 4, 2007, 15:21 |
Hello,
A Good day to you!
|
#5 |
Senior Member
Philippose Rajan
Join Date: Mar 2009
Location: Germany
Posts: 552
Rep Power: 25 |
Hello,
A Good day to you! Sorry I could not get into this post a little earlier... I saw the post, but was away, so could not react to it :-)! Some time back, I had modified the icoFoam solver to include variable time step functionality as a question from another user on this forum. Unfortunately, I am unable to find that post now... so... here is "icoFoamVarDt"... basically does exactly what you want..... it uses the built in capability in OpenFOAM to limit the Courant Number by adapting the time step size.... Hope this helps.... icoFoamVarDt.tar.gz In order to activate this, you need to use the "adjustTimeStep yes" option, followed my "maxCo [maximum Co Number you want to limit to]" in the controlDict file. Philippose |
|
January 26, 2018, 17:03 |
Adjustable Time-Step
|
#6 |
New Member
PLD
Join Date: Jun 2017
Location: Braunschweig, Germany
Posts: 13
Rep Power: 9 |
Hello Everyone,
I am trying to implement an adaptive time-stepping scheme based on the error. So for example, a rough code would look like this: Code:
if error > tolerance { //compute new deltaT and set new deltaT; runTime.setDeltaT(dt); //and Reject this step, and re-compute the same step with a new deltaT = dt; } I can successfully set the new time-step, but cannot recompute the same step using the new deltaT. I tried runTime--, and also runTime.Times = runTime.times - oldDeltaT; but nothing works. Even the "adjustTimeStep" is set to "true" in controlDict. Any help would be appreciated. Thank you in advance. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
time step calculation | david | FLUENT | 1 | May 7, 2008 02:36 |
unsteady state calculation with adaptive time step | sm | FLUENT | 0 | November 7, 2007 02:26 |
How to change boundary type at calculation time? | Stanislav Kraev | FLUENT | 0 | December 4, 2006 04:33 |
time step calculation in unsteady solidconduction | ps | Siemens | 0 | July 19, 2006 02:01 |
Time step calculation | Shashi | Main CFD Forum | 1 | March 1, 2006 08:27 |