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/)
-   -   library compilation (https://www.cfd-online.com/Forums/openfoam-programming-development/91062-library-compilation.html)

foamer August 1, 2011 02:21

Hi

It is a little different. My option file look like:

EXE_INC = \
-I../bubbleFoam \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/transportModels/incompressible/lnInclude \
-IturbulenceModel \
-IkineticTheoryModels/lnInclude \
-IinterfacialModels/lnInclude \
-IphaseModel/lnInclude \
-Iaveraging
EXE_LIBS = \
-L$(FOAM_USER_LIBBIN)\
-lEulerianInterfacialModels \
-lfiniteVolume \
-lmeshTools \
-lincompressibleTransportModels \
-lphaseModel \
-lkineticTheoryModel


Alex

bigphil August 1, 2011 13:36

Alex,

Try "wclean" and then "wmake", this will make wmake look for all the files for the solver again, it may help.

Philip

foamer August 2, 2011 02:06

it did not seem to work.

it did not compile this time either. My option file look like this:

EXE_INC = \
-I../bubbleFoam \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/transportModels/incompressible/lnInclude \
-IturbulenceModel \
-IkineticTheoryModels/lnInclude \
-IinterfacialModels/lnInclude \
-IphaseModel/lnInclude \
-Iaveraging
EXE_LIBS = \
-L$(FOAM_USER_LIBBIN)\
-lEulerianInterfacialModels \
-lfiniteVolume \
-lmeshTools \
-lincompressibleTransportModels \
-lphaseModel \
-lkineticTheoryModel


Alex

bigphil August 2, 2011 05:43

Alex,

hmmnn could you paste the output of "wclean; wmake" here so I can see?

If you want you can email me your solver and I can try compile it myself (philip DOT cardiff AT ucd DOT ie).

Philip

foamer August 2, 2011 06:17

wclean does not give me anything.

wmake gives me:

Making dependency list for source file twoPhaseEulerFoam.C
could not open file createRASTurbulence.H for source file twoPhaseEulerFoam.C
could not open file wallFunctions.H for source file twoPhaseEulerFoam.C
could not open file wallDissipation.H for source file twoPhaseEulerFoam.C
could not open file wallViscosity.H for source file twoPhaseEulerFoam.C
SOURCE=twoPhaseEulerFoam.C ; g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3 -DNoRepository -ftemplate-depth-40 -I../bubbleFoam -I/opt/openfoam171/src/finiteVolume/lnInclude -I/opt/openfoam171/src/transportModels/incompressible/lnInclude -IturbulenceModel -IkineticTheoryModels/lnInclude -IinterfacialModels/lnInclude -IphaseModel/lnInclude -Iaveraging -IlnInclude -I. -I/opt/openfoam171/src/OpenFOAM/lnInclude -I/opt/openfoam171/src/OSspecific/POSIX/lnInclude -fPIC -c $SOURCE -o Make/linux64GccDPOpt/twoPhaseEulerFoam.o
In file included from twoPhaseEulerFoam.C:54:
createFields.H:131: fatal error: createRASTurbulence.H: No such file or directory
compilation terminated.
make: *** [Make/linux64GccDPOpt/twoPhaseEulerFoam.o] Error 1

Sorry i mislead you the other day. There is not any changes in the solver code itself. I can not compile the original one.

bigphil August 2, 2011 06:30

Alex,


OK createRASTurbulence.H is not in the default twoPhaseEulerFoam, so presumably you are trying to use the createRASTurbulence.H from bubbleFoam..?

If that is the case then add the following line to your solver Make/options
-I$(FOAM_SOLVERS)/multiphase/bubbleFoam \ instead of -I../bubbleFoam \.

Then try wclean; wmake and let me know the output.

If it still can't find createRASTurbulence.H then copy this file from bubbleFoam to your directory ie if you are in your solver directory then use the following command:
Code:

cp $FOAM_SOLVERS/multiphase/bubbleFoam/createRASTurbulence.H .
then try wclean wmake again.


Philip

foamer August 2, 2011 07:03

Hi

After i typed in "-I$(FOAM_SOLVERS)/multiphase/bubbleFoam \ instead of -I../bubbleFoam" i got the following after wclean and wmake:

options:2: warning: backslash and newline separated by space
Making dependency list for source file twoPhaseEulerFoam.C
SOURCE=twoPhaseEulerFoam.C ; g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3 -DNoRepository -ftemplate-depth-40 -I/opt/openfoam171/applications/solvers/multiphase/bubbleFoam -I/opt/openfoam171/src/finiteVolume/lnInclude -I/opt/openfoam171/src/transportModels/incompressible/lnInclude -IturbulenceModel -IkineticTheoryModels/lnInclude -IinterfacialModels/lnInclude -IphaseModel/lnInclude -Iaveraging -IlnInclude -I. -I/opt/openfoam171/src/OpenFOAM/lnInclude -I/opt/openfoam171/src/OSspecific/POSIX/lnInclude -fPIC -c $SOURCE -o Make/linux64GccDPOpt/twoPhaseEulerFoam.o
/opt/openfoam171/src/finiteVolume/lnInclude/readPISOControls.H: In function ‘int main(int, char**)’:
/opt/openfoam171/src/finiteVolume/lnInclude/readPISOControls.H:8: warning: unused variable ‘momentumPredictor’
/opt/openfoam171/src/finiteVolume/lnInclude/readPISOControls.H:11: warning: unused variable ‘transonic’
/opt/openfoam171/src/finiteVolume/lnInclude/readPISOControls.H:14: warning: unused variable ‘nOuterCorr’
g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3 -DNoRepository -ftemplate-depth-40 -I/opt/openfoam171/applications/solvers/multiphase/bubbleFoam -I/opt/openfoam171/src/finiteVolume/lnInclude -I/opt/openfoam171/src/transportModels/incompressible/lnInclude -IturbulenceModel -IkineticTheoryModels/lnInclude -IinterfacialModels/lnInclude -IphaseModel/lnInclude -Iaveraging -IlnInclude -I. -I/opt/openfoam171/src/OpenFOAM/lnInclude -I/opt/openfoam171/src/OSspecific/POSIX/lnInclude -fPIC -Xlinker --add-needed Make/linux64GccDPOpt/twoPhaseEulerFoam.o -L/opt/openfoam171/lib/linux64GccDPOpt \
-L/home/user/OpenFOAM/user-1.7.1/lib/linux64GccDPOpt -lEulerianInterfacialModels -lfiniteVolume -lmeshTools -lincompressibleTransportModels -lphaseModel -lkineticTheoryModel -lOpenFOAM -liberty -ldl -lm -o /home/user/OpenFOAM/user-1.7.1/applications/bin/linux64GccDPOpt/alex


Alex

bigphil August 2, 2011 07:53

Alex,


From the output shown, your solver has compiled. The last line "-o /home/user/OpenFOAM/user-1.7.1/applications/bin/linux64GccDPOpt/alex" shows that your solver executable called alex has been output to the directory /home/user/OpenFOAM/user-1.7.1/applications/bin/linux64GccDPOpt/ (which is $FOAM_USER_APPBIN).

So you should be able to run your solver (called alex) now, just run "alex" in your case directory.

There are a few compiler warnings shown, they are three "unused variables". This means you declared the variables shown but never used them. This is not an error but make sure that you are not meant to use these variables and remove them if you don't need them.

Also the wmake warning "options:2: warning: backslash and newline separated by space" wants you to remove a space in the Make/options file.

So your solver compiles, now you just have to get it to do what you want ;)

Philip

foamer August 2, 2011 09:37

hmm

i get the following whne typing "alex":

FOAM FATAL IO ERROR:
cannot open file
file: /home/user/OpenFOAM/user-1.7.1/applications/solvers/multiphase/twoPhaseEulerFoam/system/controlDict at line 0.
From function regIOobject::readStream()
in file db/regIOobject/regIOobjectRead.C at line 61.

Alex

bigphil August 2, 2011 09:59

Alex,


You have to run your solver in your case directory (not the solver source code directory). The solver is looking for the controlDict file in the system directory of your case.

You should check out the tutorials in the user guide (http://www.openfoam.com/docs/user/).


Philip

foamer August 3, 2011 07:57

Thank you very much Philihp



Alex

bigphil August 3, 2011 08:31

No Problem,

Hopefully your solver works out for you!

Philip


All times are GMT -4. The time now is 08:37.