CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums

Writing the last iteration for steady state simulations

Register Blogs Community New Posts Updated Threads Search

Rate this Entry

Writing the last iteration for steady state simulations

Posted August 17, 2016 at 06:09 by Ramwi

Ok, I have a very bad memory and furthermore, I did not find the solution to the bellow described problem right away. So, I will use this place to store the solution for future use.

Note: The proposed approach might be overcomplicated. If it is so, please let me know what is the "proper way".

Problem description: You run a steady state simulation (e.g. simpleFOAM) and you control the endTime (number of iterations) via the residualControl. Thus, the number of iterations needed for the solution to converge is not a priori known.

Goal: Write out the last iteration, no matter what is its number. Furthermore, you do not want to (cannot) write all the iterations (time steps) and keep only the last one using purgeWrite.

Solution: As I wrote above, there might be a simple and totaly evident solution, but I did not find it. So, my proposition is to combine different functionObjects in controlDict to achieve the wanted outcome. Id est, add to the end of the controlDict file the following code:

Code:
functions
{
    sysCall
    {
        type systemCall;
        functionObjectLibs ( "libsystemCall.so" );
        executeCalls 0();
        endCalls 1("touch writeOnEnd");
        writeCalls 0();
        outputControl outputTime;
    }
    
    writeOnEnd
    {
        type abort;
        functionObjectLibs ( "libjobControl.so" );
        action writeNow;
        fileName "writeOnEnd";
    }
}
Maybe, this might help someone (or at least me in the future).
Posted in Tips and tricks
Views 1997 Comments 1 Edit Tags Email Blog Entry
« Prev     Main     Next »
Total Comments 1

Comments

  1. Old Comment
    using near air temperature and wind speed data, how can i obtain aerodynamic resistance to heat flow? it is important parameter to calculate sensible heat flux. please forward me this information as soon as possible.

    thanks in advance!!!!!!!!!
    permalink
    Posted August 20, 2016 at 11:55 by meonaddis
 

All times are GMT -4. The time now is 00:40.