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

Log-time writeInterval for PimpleFoams

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

Like Tree1Likes
  • 1 Post By wyldckat

Reply
 
LinkBack Thread Tools 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: 128
Rep Power: 9
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
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 9,523
Blog Entries: 36
Rep Power: 97
wyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nice
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.
__________________
___
I'll be at OFW11 in Portugal
wyldckat is offline   Reply With Quote

Old   September 28, 2013, 11:23
Default
  #3
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 9,523
Blog Entries: 36
Rep Power: 97
wyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nice
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
__________________
___
I'll be at OFW11 in Portugal
wyldckat is offline   Reply With Quote

Reply

Tags
controldict, log, openfoam, pimplefoam, writeinterval

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
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 04: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 07:44.