CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   Compiling New Solver (https://www.cfd-online.com/Forums/openfoam-programming-development/113315-compiling-new-solver.html)

DavidOuellette February 17, 2013 17: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 (http://openfoamwiki.net/index.php/Ho...ure_to_icoFoam), 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,
David

wyldckat February 18, 2013 03: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:
Code:

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

Best regards,
Bruno

DavidOuellette February 18, 2013 12:38

Hi Bruno,

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

Code:

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,

Code:

which pisoFoam
and the terminal gave the output of:

/opt/openfoam211/platforms/linux64GccDPOpt/bin/pisoFoam

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,
David

wyldckat February 18, 2013 15:19

Hi David,

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

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:
Code:

/home/fuelcell-laptop/OpenFOAM/fuelcell-laptop-2.1.1/applications/bin/linux64GccDPOpt/jrFoam
If both worked, then try:
Code:

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:
Code:

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

/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
Best regards,
Bruno

DavidOuellette February 18, 2013 15: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,
David


All times are GMT -4. The time now is 15:50.