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

Log-time writeInterval for PimpleFoams

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 1 Post By wyldckat
  • 1 Post By wyldckat

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 21, 2013, 09:18
Default Log-time writeInterval for PimpleFoams
  #1
Senior Member
 
JR22's Avatar
 
Jose Rey
Join Date: Oct 2012
Posts: 134
Rep Power: 17
JR22 will become famous soon enough
Hi,

I am running buoyantbBoussinesqPimplefoam and would like to use writeInterval values in my controlDict that are not linear but grow in log-10 scale. How do I do this?

Thanks in advance
JR22 is offline   Reply With Quote

Old   September 23, 2013, 16:45
Default
  #2
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Hi Jose,

I know that the latest 2.2.x has some new feature that allows controlling the write interval... or some time interval... it's this commit: https://github.com/OpenFOAM/OpenFOAM...f57922bec7b80b

The "partialWrite" function object looks like it might work.

And I vaguely remember seeing a tutorial that used the "#codeStream" feature for defining the time with C++ code... but I can't remember which one was it.


If you don't figure it out until then, I'll try to have a look at it this coming weekend.

Best regards,
Bruno
JR22 likes this.
__________________
wyldckat is offline   Reply With Quote

Old   September 28, 2013, 11:23
Default
  #3
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Hi Jose,

OK, interesting find... write internal cannot be controlled directly through code, because there isn't a method for it in the "Time" class: http://foam.sourceforge.net/docs/cpp/a02301.html

But you can change the "deltaT"... and initial and end time...

So, how else can you do this? There are two ways I can think of:
  • Creating a dedicated function object for this, which works similarly to the "partialWrite" function object. As for the actual "writeInterval"... you simply disable it, by using a very large value or the final time/iteration value.
  • Or you can use the function object "timeActivatedFileUpdate": http://foam.sourceforge.net/docs/cpp/a02302.html
The second one should be the easiest one to implement. Something like this:
Code:
fileUpdate1
{
    type              timeActivatedFileUpdate;
    functionObjectLibs ("libutilityFunctionObjects.so");
    outputControl     timeStep;
    outputInterval    1;
    fileToUpdate      "$FOAM_CASE/system/controlDict";
    timeVsFile
    (
        (-1 "$FOAM_CASE/system/controlDict.0")
        (1 "$FOAM_CASE/system/controlDict.1")
        (10 "$FOAM_CASE/system/controlDict.10")
        (100 "$FOAM_CASE/system/controlDict.100")
        (1000 "$FOAM_CASE/system/controlDict.1000")
    );
}
The entry "outputControl timeStep" ensures that it checks things every time set (aka iteration).

In order to not need to have this function object included in all "controlDict" files, as exemplified in the tutorial "incompressible/simpleFoam/motorBike".

Best regards,
Bruno
Niteck likes this.
__________________
wyldckat is offline   Reply With Quote

Reply

Tags
controldict, log, openfoam, pimplefoam, writeinterval


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
dynamic Mesh is faster than MRF???? sharonyue OpenFOAM Running, Solving & CFD 14 August 26, 2013 07:47
Low Mixing time Problem Mavier CFX 5 April 29, 2013 00:00
pisoFoam with k-epsilon turb blows up - Some questions Heroic OpenFOAM Running, Solving & CFD 26 December 17, 2012 03:34
Upgraded from Karmic Koala 9.10 to Lucid Lynx10.04.3 bookie56 OpenFOAM Installation 8 August 13, 2011 04:03
calculation diverge after continue to run zhajingjing OpenFOAM 0 April 28, 2010 04:35


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