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:
Maybe, this might help someone (or at least me in the future).
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"; } }
Total Comments 1