CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Programming & Development (
-   -   Compiling New Solver (

DavidOuellette February 17, 2013 18:34

Compiling New Solver
1 Attachment(s)
Hi All,

I'm currently attempting to compile an unaltered solver so I can eventually change the solver to the situation that I am researching. The instructions I have been following are shown in the attached file. I also followed the instructions in section 2 of the provided link (, only to receive the same problem. In both cases, when I run the solver for the given tutorial case, the new name of the solver is not recognized, while the original solver name is (ie: my_icoFoam and jrFoam are not recognized, but icoFoam and pisoFoam are recognized in their respective cases).

The only explanation that I can come up with is the information I receive when I type 'wmake' into the terminal (without the apostrophes). The information that the terminal returns is shown below. Unfortunately, I am new to OpenFoam and linux, so a lot of the warnings make little sense to me.

Information returned by the terminal for the jrFoam case:

Making dependency list for source file jrFoam.C
SOURCE=jrFoam.C ; g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3 -DNoRepository -ftemplate-depth-100 -I/opt/openfoam211/src/turbulenceModels/incompressible/turbulenceModel -I/opt/openfoam211/src/transportModels -I/opt/openfoam211/src/transportModels/incompressible/singlePhaseTransportModel -I/opt/openfoam211/src/finiteVolume/lnInclude -IlnInclude -I. -I/opt/openfoam211/src/OpenFOAM/lnInclude -I/opt/openfoam211/src/OSspecific/POSIX/lnInclude -fPIC -c $SOURCE -o Make/linux64GccDPOpt/jrFoam.o
/opt/openfoam211/src/finiteVolume/lnInclude/readPISOControls.H: In function ‘int main(int, char**)’:
/opt/openfoam211/src/finiteVolume/lnInclude/readPISOControls.H:3:15: warning: unused variable ‘nOuterCorr’ [-Wunused-variable]
/opt/openfoam211/src/finiteVolume/lnInclude/readPISOControls.H:15:16: warning: unused variable ‘transonic’ [-Wunused-variable]
g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3 -DNoRepository -ftemplate-depth-100 -I/opt/openfoam211/src/turbulenceModels/incompressible/turbulenceModel -I/opt/openfoam211/src/transportModels -I/opt/openfoam211/src/transportModels/incompressible/singlePhaseTransportModel -I/opt/openfoam211/src/finiteVolume/lnInclude -IlnInclude -I. -I/opt/openfoam211/src/OpenFOAM/lnInclude -I/opt/openfoam211/src/OSspecific/POSIX/lnInclude -fPIC -Xlinker --add-needed -Xlinker --no-as-needed Make/linux64GccDPOpt/jrFoam.o -L/opt/openfoam211/platforms/linux64GccDPOpt/lib \
-lincompressibleTurbulenceModel -lincompressibleRASModels -lincompressibleLESModels -lincompressibleTransportModels -lfiniteVolume -lmeshTools -lOpenFOAM -ldl -lm -o /home/fuelcell-laptop/OpenFOAM/fuelcell-laptop-2.1.1/applications/bin/linux64GccDPOpt/jrFoam

Also, I should note that I am using OpenFOAM-2.1.1 and Ubuntu 12.04 LTS. I welcome any comments or suggestions.

Thanks and all the best,

wyldckat February 18, 2013 04:49

Greetings David and welcome to the forum!

There are no error messages while building the solver (only some usual warnings), so that's not the problem.

Have you tried starting a new terminal? The reason I ask is because the path where the solver is placed, was possibly created when you first built the new solvers, which might lead to the shell not detecting sooner that the new path is now populated.

After you start a new terminal, you can also try running:

which jrFoam
which will tell you where the application is located, if found.

Best regards,

DavidOuellette February 18, 2013 13:38

Hi Bruno,

Thank you for your reply. I attempted your suggestions. When I open a new terminal window and type


which jrFoam
I receive no feedback from the terminal; as in the terminal just moves to a new empty line that you would get before entering a new command (if that makes any sense). I also typed the same commands in the directory of the jrFoam solver as well as in the 'jrCavity' directory, with the same response from the terminal. As a check, I also tried,


which pisoFoam
and the terminal gave the output of:


So, it seems to me that terminal does not recognize 'jrFoam' as a solver; even in a new terminal window. When I type jrFoam in the 'jrCavity' directory in the new terminal window, the response I receive is:

jrFoam: command not found

However, the command 'pisoFoam' does still work.

Do you have any other suggestions?

Many thanks,

wyldckat February 18, 2013 16:19

Hi David,

This is very strange... check if the following command works:

ls -l /home/fuelcell-laptop/OpenFOAM/fuelcell-laptop-2.1.1/applications/bin/linux64GccDPOpt/jrFoam
You can also try running it directly, in case it does exist:

If both worked, then try:

export PATH=$PATH:/home/fuelcell-laptop/OpenFOAM/fuelcell-laptop-2.1.1/applications/bin/linux64GccDPOpt

which jrFoam

If this doesn't work, then it's because your "PATH" variable is broken. Not sure how or why... but you can check by running:

echo $PATH
For reference, a good output would be something like this (when without OpenFOAM activated):

Best regards,

DavidOuellette February 18, 2013 16:34

Hi Bruno,

It seems to be working now! I followed your instructions for exporting the path, and the command 'jrFoam' is now working! I also compared the results to 'pisoFoam' and they both match.

Thank you very much for your help Bruno. I greatly appreciate it.

All the best,

All times are GMT -4. The time now is 01:28.