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

Change deltaT using codeStream

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By whatsoever

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 21, 2012, 10:12
Default Change deltaT using codeStream
  #1
New Member
 
Join Date: Nov 2012
Posts: 1
Rep Power: 0
whatsoever is on a distinguished road
Dear Foamers,

I am a new guy to OF(v2.1.1), now I am running the tutorials and checking the user guides.

One thing I got stuck is change deltaT using codeStream. My code is as follows:

application icoFoam;
startFrom startTime;
startTime 0;
stopAt endTime;
endTime 10;
deltaT #codeStream
{
code
#{
const scalar time = this->db().time().value();
const scalar interT = 1;
const scalar deltaT1 = 0.01;
const scalar deltaT2 = 0.1;
if(time<=interT)
{
os << deltaT1;
}
else
{
os << deltaT2;
}
#};
}
writeControl runTime;
writeInterval 1;

However, there is no this pointer in the constant files. I also try to use runTime.value(), which does not work either. So my question is how to get the current runtime value in "constant" file? Can anyone help me and fix this error?


Many thx in advance


FreshFoamer
21-11-2012
cfdlance.com likes this.
whatsoever is offline   Reply With Quote

Old   April 30, 2013, 03:53
Default
  #2
New Member
 
Ilya Vichev
Join Date: Feb 2013
Posts: 1
Rep Power: 0
ilyavichev is on a distinguished road
Hi All,

this question is still actual!

How to get the current runtime value in "constant" file?
ilyavichev is offline   Reply With Quote

Reply


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
Is it to possible to change time step DeltaT during a calculation dbxmcf OpenFOAM Running, Solving & CFD 5 January 26, 2018 17:03
Radiation interface hinca CFX 15 January 26, 2014 18:11
How to change turbulence model in InterFoam Gildeh OpenFOAM Running, Solving & CFD 4 March 28, 2012 13:04
no enthalpy change across the momentum source Atit Koonsrisuk CFX 2 December 19, 2005 03:33
Multicomponent fluid Andrea CFX 2 October 11, 2004 06:12


All times are GMT -4. The time now is 04:36.