CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Running, Solving & CFD

Is it to possible to change time step DeltaT during a calculation

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree4Likes
  • 1 Post By dbxmcf
  • 3 Post By philippose

Reply
 
LinkBack Thread Tools Display Modes
Old   March 13, 2007, 00:44
Default I am using icoFoam to calculat
  #1
Member
 
roy fokker
Join Date: Mar 2009
Posts: 44
Rep Power: 7
dbxmcf is on a distinguished road
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!
sunshuai likes this.
dbxmcf is offline   Reply With Quote

Old   March 13, 2007, 03:32
Default I use scalar dt=runTime.de
  #2
Member
 
Thomas Jung
Join Date: Mar 2009
Posts: 96
Rep Power: 7
tehache is on a distinguished road
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
tehache is offline   Reply With Quote

Old   November 1, 2007, 18:59
Default Hi. the example above, is e
  #3
Member
 
Ken Darcovich
Join Date: Mar 2009
Location: Ottawa, Canada
Posts: 30
Rep Power: 7
kdarc is on a distinguished road
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.
kdarc is offline   Reply With Quote

Old   November 1, 2007, 19:48
Default it should work using setDeltaT
  #4
Member
 
roy fokker
Join Date: Mar 2009
Posts: 44
Rep Power: 7
dbxmcf is on a distinguished road
it should work using setDeltaT(dt):

like this:

runTime.setTime(tStart,0);
runTime.setDeltaT(dt);
runTime.setEndTime(runTime.value()+runTime.deltaT( ).value());
dbxmcf is offline   Reply With Quote

Old   November 4, 2007, 14:21
Default Hello, A Good day to you!
  #5
Senior Member
 
Philippose Rajan
Join Date: Mar 2009
Location: Germany
Posts: 517
Rep Power: 15
philippose will become famous soon enough
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
solefire, saba_saeb and manju819 like this.
philippose is offline   Reply With Quote

Reply

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
time step calculation david FLUENT 1 May 7, 2008 01:36
unsteady state calculation with adaptive time step sm FLUENT 0 November 7, 2007 01:26
How to change boundary type at calculation time? Stanislav Kraev FLUENT 0 December 4, 2006 03:33
time step calculation in unsteady solidconduction ps CD-adapco 0 July 19, 2006 01:01
Time step calculation Shashi Main CFD Forum 1 March 1, 2006 07:27


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