|
[Sponsors] |
November 20, 2014, 07:07 |
Unable to compile solver
|
#1 |
Member
Join Date: Nov 2014
Posts: 88
Rep Power: 12 |
Hi Everyone,
So I am customising a solver adapted from simpleFoam and I am trying to compile it to see if it works. I used wmake in the solver's root directory to attempt to compile it. Question : Must my solver be placed in OpenFOAM\applications or it can be anywhere on my hdd? I am receiving errors during compilation but I cannot figure where or what the problem is according to the error. Code:
SOURCE=MySolver.C ; g++ -m32 -Dlinux -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -O3 -DNoRepository -ftemplate-depth-100 -I/home/user/OpenFOAM/OpenFOAM-2.3.0/src/finiteVolume/lnInclude -I/home/user/OpenFOAM/OpenFOAM-2.3.0/src/turbulenceModels -I/home/user/OpenFOAM/OpenFOAM-2.3.0/src/turbulenceModels/incompressible/RAS/RASModel -I/home/user/OpenFOAM/OpenFOAM-2.3.0/src/transportModels -I/home/user/OpenFOAM/OpenFOAM-2.3.0/src/transportModels/incompressible/singlePhaseTransportModel -I/home/user/OpenFOAM/OpenFOAM-2.3.0/src/meshTools/lnInclude -I/home/user/OpenFOAM/OpenFOAM-2.3.0/src/fvOptions/lnInclude -I/home/user/OpenFOAM/OpenFOAM-2.3.0/src/sampling/lnInclude -IlnInclude -I. -I/home/user/OpenFOAM/OpenFOAM-2.3.0/src/OpenFOAM/lnInclude -I/home/user/OpenFOAM/OpenFOAM-2.3.0/src/OSspecific/POSIX/lnInclude -fPIC -c $SOURCE -o Make/linuxGccDPOpt/MySolver.o MySolver.C:36:46: fatal error: incompressible/RASModel/RASModel.H: No such file or directory #include "incompressible/RASModel/RASModel.H" ^ compilation terminated. make: *** [Make/linuxGccDPOpt/MySolver.o] Error 1 Code:
MySolver.C EXE = $(FOAM_APPBIN)/MySolver Code:
EXE_INC = \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/turbulenceModels \ -I$(LIB_SRC)/turbulenceModels/incompressible/RAS/RASModel \ -I$(LIB_SRC)/transportModels \ -I$(LIB_SRC)/transportModels/incompressible/singlePhaseTransportModel \ -I$(LIB_SRC)/meshTools/lnInclude \ -I$(LIB_SRC)/fvOptions/lnInclude \ -I$(LIB_SRC)/sampling/lnInclude EXE_LIBS = \ -lincompressibleRASModels \ -lincompressibleTurbulenceModel \ -lincompressibleTransportModels \ -lfiniteVolume \ -lmeshTools \ -lfvOptions \ -llduSolvers \ -lsampling Could someone help out here please? Thanks. |
|
November 20, 2014, 07:49 |
|
#2 | |
New Member
Marcel Vonlanthen
Join Date: Nov 2012
Location: Zurich, Switzerland
Posts: 28
Rep Power: 14 |
Hello hwsv07,
Quote:
Code:
mySolver.C EXE = $(FOAM_USER_APPBIN)/MySolver Code:
#include "RASModel.H" Code:
#include "incompressible/RASModel/RASModel.H" Cheers, Marcel |
||
November 20, 2014, 08:33 |
|
#3 |
Super Moderator
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52 |
Simple error,
as Sylv told you, you have to include the header files like that: Code:
#include "FooBar.H" // correct #include "path/to/foobar.H" // wrong
__________________
Keep foaming, Tobias Holzmann |
|
November 30, 2014, 14:50 |
|
#4 |
Member
Join Date: Nov 2014
Posts: 88
Rep Power: 12 |
Thanks Tobi and Syvl.
I tried to compile again. But I now receive these errors: Code:
Making dependency list for source file mySolver.C could not open file readSIMPLEControls.H for source file mySolver.C due to No such file or directory could not open file initConvergenceCheck.H for source file mySolver.C due to No such file or directory could not open file convergenceCheck.H for source file mySolver.C due to No such file or directory SOURCE=mySolver.C ; g++ -m32 -Dlinux -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -O3 -DNoRepository -ftemplate-depth-100 -I/home/user/OpenFOAM/OpenFOAM-2.3.0/src/finiteVolume/lnInclude -I/home/user/OpenFOAM/OpenFOAM-2.3.0/src/turbulenceModels -I/home/user/OpenFOAM/OpenFOAM-2.3.0/src/turbulenceModels/incompressible/RAS/RASModel -I/home/user/OpenFOAM/OpenFOAM-2.3.0/src/transportModels -I/home/user/OpenFOAM/OpenFOAM-2.3.0/src/transportModels/incompressible/singlePhaseTransportModel -I/home/user/OpenFOAM/OpenFOAM-2.3.0/src/meshTools/lnInclude -I/home/user/OpenFOAM/OpenFOAM-2.3.0/src/fvOptions/lnInclude -I/home/user/OpenFOAM/OpenFOAM-2.3.0/src/sampling/lnInclude -IlnInclude -I. -I/home/user/OpenFOAM/OpenFOAM-2.3.0/src/OpenFOAM/lnInclude -I/home/user/OpenFOAM/OpenFOAM-2.3.0/src/OSspecific/POSIX/lnInclude -fPIC -c $SOURCE -o Make/linuxGccDPOpt/mySolver.o mySolver.C:67:34: fatal error: readSIMPLEControls.H: No such file or directory #include "readSIMPLEControls.H" ^ compilation terminated. I am creating this solver out of a paper i read somewhere. apparently they were created in OF 1.5, but Im using the latest 2.3.0 now. are these 3 H files not standard of OpenFoam? where can I get them and where should i place them? |
|
June 16, 2016, 17:17 |
|
#5 |
New Member
mayank bhuwal
Join Date: Jun 2016
Posts: 3
Rep Power: 10 |
Well exactly the same problem I am also facing
sclsVOFFoamsf.C:46:29: fatal error: turbulenceModel.H: No such file or directory #include "turbulenceModel.H" ^ compilation terminated. make: *** [/home/mayank/OpenFOAM/OpenFOAM-3.0.1/platforms/linux64GccDPInt32Opt/applications/solvers/multiphase/sclsVOFFoamsf/sclsVOFFoamsf.o] Error 1 i can see turbulenceModel.H header file present in the src |
|
June 17, 2016, 13:16 |
|
#6 |
Senior Member
David Gaden
Join Date: Apr 2009
Location: Winnipeg, Canada
Posts: 437
Rep Power: 22 |
You should also check the Make/options to see what lnInclude folders are included. I think the turbulenceModel.H has a name collision, so you might have to include "compressible/turbulenceModel.H" or "incompressible/turbulenceModel.H"
__________________
~~~ Follow me on twitter @DavidGaden |
|
February 21, 2018, 06:32 |
Similar Problem
|
#7 |
New Member
Riccardo
Join Date: Jan 2016
Posts: 16
Rep Power: 10 |
Hello,
I've an analogous problem when I compile my code. In this regard, I don't face this problem if I source/use OpenFoam 2.3.0. While I get it if I refer to an older version (OpenFoam 4.x i.e.). The error is the following one: ABLkEpsilonMarker.H:70:22: fatal error: RASModel.H: No such file or directory #include "RASModel.H" Indeed I found the RASModel.H file in the directory "OpenFOAM-4.x/src/TurbulenceModels/turbulenceModels/RAS/RASModel/" . Do you have any idea on the reason of this error and any suggestion on how I could solve it? |
|
February 21, 2018, 06:34 |
|
#8 |
Super Moderator
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52 |
You have to tell the compile the path in which it should search for the file. The path is easy to figure out by using
Code:
find -iname "RASModel.H"
__________________
Keep foaming, Tobias Holzmann |
|
February 21, 2018, 09:23 |
|
#9 | |
Member
Anurag
Join Date: Aug 2014
Location: Germany
Posts: 57
Rep Power: 12 |
Quote:
As an example, compare line number 39 of multiphaseEulerFoam.C b/w OF2.3 and OF4 OF2.3: Code:
#include "LESModel.H" Code:
#include "turbulentTransportModel.H" |
||
February 21, 2018, 09:54 |
|
#10 |
Super Moderator
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52 |
How you will get your library ready is up to you and is related to the functionality you are going to build. However, I agree to use the appropriate format which is used in the current version one is using. As one can see with the turbulentTransportModel.H header, all the other classes are included; Doxygen is your friend (here Foam-dev). So by using the way Anurag is mentioning, you should solve your problem but you also can just include the RASModel.H. At the end it does not matter which way you go. The only important thing is, that you tell your compiler everything that it needs.
turbulentTransportModel_8H__incl.png
__________________
Keep foaming, Tobias Holzmann |
|
February 21, 2018, 10:41 |
|
#11 | ||
New Member
Riccardo
Join Date: Jan 2016
Posts: 16
Rep Power: 10 |
Quote:
Quote:
Giving a look to the different version OF folders, in 2.3.0 the RASModel.H file is located in "turbulenceModels/incompressible/RAS/RASModel". While in the most recent ones it's located in "TurbulenceModels/turbulenceModels/RAS/RASModel". Thus, I don't know how this could affect the overall code structure (considering it is quite complicated and it was written for 2.3.0 version and I would like to run it into 4.x) and how to account for incompressibility when dealing with more recent version of OpenFOAM. |
|||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to compile a new solver in OpenFOAM-2.1.0? | sandy | OpenFOAM Programming & Development | 24 | July 27, 2016 05:10 |
Quarter Burner mesh with periosic condition | SamCanuck | FLUENT | 2 | August 31, 2011 12:34 |
Working directory via command line | Luiz | CFX | 4 | March 6, 2011 21:02 |
How to compile an unsteady solver based on solver of MRFSimpleFoam? | renyun0511 | OpenFOAM Running, Solving & CFD | 0 | April 27, 2010 12:16 |
why the solver reject it? Anyone with experience? | bearcat | CFX | 6 | April 28, 2008 15:08 |