How to let OpenFOAM abort a simulation when values exceed a given range?
When the absolute pressure becomes negative or U exceeds the speed of light, things have pretty obviously gone wrong (be that bad boundary conditions, a too coarse mesh, a too large timestep etc.).
So, is there any way to have a simulation abort with an error message when values exceed definable non-physical ranges?
I also asked this question at the Computational Science StackExchange (http://scicomp.stackexchange.com/q/2654/1669), please have a look at their Q&A system which offers a more ordered system for answers (none of these <<oh, I haz similar prob, plz send codez>> "answers")
FatalErrorIn("Function name")<<"error message"<<abort(FatalError);
If the velocity exceed 3e8, there should be a problem, and program should abort after a short time itself.
I assume you mean putting that in the used solver?
But is there any other solution that does not require recompilation? Maybe something like a #codeStream statement in controlDict?
|All times are GMT -4. The time now is 02:52.|