CFD Online Logo CFD Online URL
Home > Forums > OpenFOAM Programming & Development

Avoid abort after "FOAM FATAL IO ERROR"

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

LinkBack Thread Tools Display Modes
Old   July 4, 2013, 09:04
Default Avoid abort after "FOAM FATAL IO ERROR"
New Member
Join Date: Jul 2013
Posts: 1
Rep Power: 0
thomasfr is on a distinguished road
usually the solvers abort program execution with the message "--> FOAM FATAL IO ERROR" if there is something wrong with the format of the input data (for example giving "value (0 0 0)" instead of "uniformValue (0 0 0)" to a uniform boundary condition).

This is problematic, because I have to run some clean-up code when the solver crashes after wrong user input (I use a modification of the standard solvers).

Is the program abort hard coded in OpenFOAM? Or can I change some switch (in the global controlDict, maybe?) so that a warning is shown or an exception is thrown instead of exiting immediately?

thomasfr is offline   Reply With Quote

Old   July 9, 2013, 09:30
Senior Member
David Gaden
Join Date: Apr 2009
Location: Winnipeg, Canada
Posts: 436
Rep Power: 15
marupio is on a distinguished road
It is a program exit, not an abort. There is no stack after a fatal IO error.

I don't think you can change this behaviour. You could find the source where it throws the error and exits (buried in src/OpenFOAM) but what would you change? Stop it from throwing the error?

The problem is: the program doesn't know how to continue when it gets bad input, the only thing it can do is tell the user and exit. For example, let's say it needs to read a dimensionedScalar "gamma", but encounters:

gamma    gamma 1.250 [0 0 0 0 0 0 0];
The dimensions are in the wrong position. The program is written to read the name, the dimensions, then the value. It is not flexible enough to dynamically change the order of these. It will throw the IO error when it doesn't encounter a "[" after "gamma. If you want to force it to continue, what should it do? Assume a default value for gamma?

Hope that helps!
Follow me on twitter @DavidGaden
marupio is offline   Reply With Quote


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
Error "FLUENT has recieved fatal error" yys88 FLUENT 0 January 22, 2013 15:58
error while compiling the USER Sub routine CFD user CFX 3 November 25, 2002 16:16

All times are GMT -4. The time now is 04:53.