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

How to set a time-adjustable writeInterval

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 19, 2018, 06:20
Default How to set a time-adjustable writeInterval
  #1
KTG
Senior Member
 
Abe
Join Date: May 2016
Posts: 119
Rep Power: 10
KTG is on a distinguished road
Hey everyone,


I have some simulations that take a long time to wind up, and take some big time steps at the beginning. At later times I need a short write interval, but don't want it to chop up my early timestep interval. I can't seem to access time in the control dict though:
Code:
writeInterval   #codeStream
{

    code
    #{
        scalar t = this->db().time().value(); //wishful thinking
        if(t < 2000)
            {os << 5;}
        else
            {os << .1;}
       
    #};
};

I can't seem to codeInclude here either - maybe this is the wrong approach? Does anyone have a workaround for this, maybe using a function object?


Thanks
KTG 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
courant number increases to rather large values 6863523 OpenFOAM Running, Solving & CFD 22 July 5, 2023 23:48
pressure in incompressible solvers e.g. simpleFoam chrizzl OpenFOAM Running, Solving & CFD 13 March 28, 2017 05:49
High Courant Number @ icoFoam Artex85 OpenFOAM Running, Solving & CFD 11 February 16, 2017 13:40
Moving mesh Niklas Wikstrom (Wikstrom) OpenFOAM Running, Solving & CFD 122 June 15, 2014 06:20
Micro Scale Pore, icoFoam gooya_kabir OpenFOAM Running, Solving & CFD 2 November 2, 2013 13:58


All times are GMT -4. The time now is 19:23.