2

I'm trying to learn about OpenFOAM Computational Fluid Dynamics software in order to use it for my undergraduate thesis. I am currently following Joszef Nagy's tutorial to run your first simulation. Everything up to about the 18:30 mark has worked completely fine. Editing initial conditions, timestep, savestep, total run time, and so on have all worked without a hitch. I have navigated to the correct directory, which in his video is /OpenFOAM/OpenFOAM-2.3.0/tutorials/incompressible/icoFoam/elbow_tri but on my installation my path goes /opt/openfoam8/tutorials... and the rest. I first tried to run the command as it was given in the video, which is

fluentMeshToFoam elbow.msh

And the command worked just fine, up until the point it needed to write the changes to constant/polymesh, at which point it gave the error

FOAM FATAL ERROR: 
The parent directory does not allow write permission to the process,
or one of the directories in "/opt/openfoam8/tutorials/incompressible/icoFoam/elbow_tri/constant/polyMesh" did not allow search (execute) permission.

    From function bool Foam::mkDir(const Foam::fileName&, mode_t)
    in file POSIX.C at line 346.

So what i understand happened is it succeeded in creating the mesh, but didn't have the proper permissions to write the mesh file to the constant/polyMesh folder.

With this in mind, I instead tried the command

sudo fluentMeshToFoam elbow.msh

But this time i was given the much shorter error

FOAM FATAL ERROR :
    Could not find mandatory etc entry (mode=ugo)
    'controlDict'

But, this time, it didn't even go through the mesh creation process. I was given this error right out of the gate. Can someone who is familiar with OpenFOAM explain why this is happening? I have had a LOT of problems even trying to get this software installed on my computer, so I'm getting very frustrated at this point and can hardly think straight.

Thanks so much.

NB: I am running Ubuntu version 20.04 LTS and OpenFOAM version 8.

4
  • That's the wrong way to run a case. Could you provide the output of the command pwd and ls before running that command to convert the mesh? Commented Nov 4, 2021 at 3:31
  • @s.ouchene I have since resolved the problem. The issue was I was running OpenFOAM directly out of the installation folder, which is a bad idea. Commented Nov 4, 2021 at 10:54
  • @K.defaoite can you please elaborate on that? Commented Dec 11, 2021 at 22:44
  • 1
    @Foad see my answer. Commented Dec 12, 2021 at 10:24

2 Answers 2

2

This, and several other problems, can be resolved by running OpenFOAM from the correct folder. After you have installed OpenFOAM, be sure to make a folder in your home directory called OpenFOAM with a sub folder called run, as detailed on their website. To run a tutorial case, copy it from the tutorials folder in your installation and move it to this run folder and run it from there.

RUNNING OPENFOAM CASES DIRECTLY FROM THE INSTALLATION FOLDER IS A RECIPE FOR DISASTER. DO NOT DO IT.

Sign up to request clarification or add additional context in comments.

2 Comments

So we are only allowed to run OpenFOAM from the ~/OpenFOAM/run/ directory? this, if correct is a really bad practice!
You may see a follow-up discussion here.
1

Besides the advice in the OP's answer, you might also get this symptom due to OpenFOAM not being able to find OpenFoam-XX/etc/controlDict (i.e. not the controlDict in CASE/system/controlDict, but the one in the installation directory).

To resolve this, set the WM_PROJECT_DIR variable to the installation directory:

export WM_PROJECT_DIR=/opt/OpenFOAM/OpenFOAM-11

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.