CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Programming & Development

Unable to compile solver

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree1Likes
  • 1 Post By marupio

Reply
 
LinkBack Thread Tools Display Modes
Old   November 20, 2014, 07:07
Default Unable to compile solver
  #1
Member
 
Join Date: Nov 2014
Posts: 88
Rep Power: 4
hwsv07 is on a distinguished road
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
According to the error code, it says RASModel.H does not exist, but I did a search in OpenFoam/src/turbulenceModels/incompressible/RAS/RASModel/ , and RASModel.H is indeed sitting there. I am not sure why wmake is trying to find RASModel.H in .../incompressible/RASModel/, so I checked my Make/files and Make/options, but it seems to be correct?

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.
hwsv07 is offline   Reply With Quote

Old   November 20, 2014, 07:49
Default
  #2
New Member
 
Marcel Vonlanthen
Join Date: Nov 2012
Location: Zurich, Switzerland
Posts: 28
Rep Power: 6
Sylv is on a distinguished road
Hello hwsv07,

Quote:
Question : Must my solver be placed in OpenFOAM\applications or it can be anywhere on my hdd?
No, you can put your solver anywhere on your HDD. To do so, just modify your MAKE/file as:

Code:
mySolver.C

EXE = $(FOAM_USER_APPBIN)/MySolver
Concerning you compiling error, have you tried to write simply
Code:
#include "RASModel.H"
instead of

Code:
#include "incompressible/RASModel/RASModel.H"
Not sure about the error, but it should work just with RASModel.H as include....


Cheers,
Marcel
Sylv is offline   Reply With Quote

Old   November 20, 2014, 08:33
Default
  #3
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Leoben (Austria)
Posts: 1,700
Blog Entries: 6
Rep Power: 31
Tobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
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
Cheers
__________________
Keep foaming,
Tobias Holzmann
Tobi is offline   Reply With Quote

Old   November 30, 2014, 14:50
Default
  #4
Member
 
Join Date: Nov 2014
Posts: 88
Rep Power: 4
hwsv07 is on a distinguished road
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.
it seems like it is looking for readSIMPLEControls.H , initConvergenceCheck.H and convergenceCheck.H.

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?
hwsv07 is offline   Reply With Quote

Old   June 16, 2016, 16:17
Default
  #5
New Member
 
mayank bhuwal
Join Date: Jun 2016
Posts: 3
Rep Power: 2
mayankbhuwal89 is on a distinguished road
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
mayankbhuwal89 is offline   Reply With Quote

Old   June 17, 2016, 12:16
Default
  #6
Senior Member
 
David Gaden
Join Date: Apr 2009
Location: Winnipeg, Canada
Posts: 436
Rep Power: 14
marupio is on a distinguished road
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"
linyanx likes this.
__________________
~~~
Follow me on twitter @DavidGaden
marupio is offline   Reply With Quote

Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


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 04:10
Quarter Burner mesh with periosic condition SamCanuck FLUENT 2 August 31, 2011 11: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 11:16
why the solver reject it? Anyone with experience? bearcat CFX 6 April 28, 2008 14:08


All times are GMT -4. The time now is 07:43.