1

I am a beginner to programming. I am trying to run a simulation of a combustion chamber using reactingFoam.

I have modified the counterflow2D tutorial.

For those who maybe don't know OpenFOAM, it is a programme built in C++ but it does not require C++ programming, just well-defining the variables in the files needed.

In one of my first tries I have made a very simple model but since I wanted to check it very well I set it to 60 seconds with a 1e-6 timestep.

My computer is not very powerful so it took me for a day aprox. (by this I mean I'd like to find a solution rather than repeating the simulation).

I executed the solver reactingFOAM using 4 processors in parallel using

mpirun -np 4 reactingFOAM -parallel > log

The log does not show any evidence of error.

The problem is that when I use reconstructPar it works perfectly but then I try to watch the results with paraFoam and this error is shown:

From function bool Foam::IOobject::readHeader(Foam::Istream&)

in file db/IOobject/IOobjectReadHeader.C at line 88

Reading "mypath/constant/reactions" at line 1

First token could not be read or is not the keyword 'FoamFile'

I have read that maybe some files are empty when they are not supposed to be so, but I have not found that problem.

My 'reactions' file have not been modified from the tutorial and has always worked.

edit:

Sorry for the vague question. I have modified it a bit.

Community
  • 1
  • 1
edugius
  • 13
  • 5
  • In order to make this reproducible for readers, who will want to help, do they need to see anything else? For example, does OpenFOAM require you to write code? If code is involved, it would probably be worth adding that to the question. (It is better on any Q&A platform to consider what readers need to see, rather than adding the catch-all of "let me know what you need" - readers will certainly ask if they need something else, but if you can make a good go of providing obviously required things in the first instance, that helps a lot). – halfer May 13 '18 at 21:20
  • It seems 'reactions' file does not contain the typical 'FoamFile' header, which, for example, you can see at the top of 'controlDict' file. It is very hard to comment on this vague question, though. Would you please improve your question, so that we can provide better help? – Herpes Free Engineer May 13 '18 at 22:19
  • 1
    Thank you for yours answers and for changing my question to a better format. I'm sorry my question is not clear, I'll improve that. Otherwise I have added _that_ header to 'reactions' and the error does not show up anymore. I am very grateful for your help and your time even with my unclear explanation. Thank you both! Is there a way I can thank you by giving thanks or reputation or something like that? – edugius May 14 '18 at 18:36
  • @edugius You can accept the answer if you deem it beneficial to your problem. Pleasure. – Herpes Free Engineer May 14 '18 at 19:25

1 Answers1

0

A typical OpenFOAM dictionary file always contains a Foam::Istream named FoamFile. An example from a typical system/controlDict file can be seen below:

FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    location    "system";
    object      controlDict;
}

During the construction of the dictionary header, if this Istream is absent, OpenFOAM ceases its operation by raising an error message that you have experienced:

First token could not be read or is not the keyword 'FoamFile'

The benefit of the header is possibly to contribute OpenFOAM's abstraction mechanisms, which would be difficult otherwise.

As mentioned in the comments, adding the header entity almost always solves this problem.

Herpes Free Engineer
  • 2,425
  • 2
  • 27
  • 34