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/)
-   -   Compilation Error--PoweLawVelocity (https://www.cfd-online.com/Forums/openfoam-programming-development/211624-compilation-error-powelawvelocity.html)

vivek05 November 16, 2018 08:40

Compilation Error--PoweLawVelocity
 
Hi,
I am trying to compile power-law velocity using wmake. It is showing this error
PHP Code:

SOURCE=powerLawVelocity/powerLawVelocityFvPatchVectorField.;  g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3  -DNoRepository -ftemplate-depth-100 -I/home/ssvivek/OpenFOAM/OpenFOAM-2.3.1/src/finiteVolume/lnInclude -I/home/ssvivek/OpenFOAM/OpenFOAM-2.3.1/src/meshTools/lnInclude -I/home/ssvivek/OpenFOAM/OpenFOAM-2.3.1/src/sampling/lnInclude -I/home/ssvivek/OpenFOAM/OpenFOAM-2.3.1/src/thermophysicalModels/solidThermo/lnInclude -I/home/ssvivek/OpenFOAM/OpenFOAM-2.3.1/src/transportModels/compressible/lnInclude -I/home/ssvivek/OpenFOAM/OpenFOAM-2.3.1/src/thermophysicalModels/basic/lnInclude -I/home/ssvivek/OpenFOAM/OpenFOAM-2.3.1/src/thermophysicalModels/specie/lnInclude -I/home/ssvivek/OpenFOAM/OpenFOAM-2.3.1/src/TurbulenceModels/turbulenceModels/lnInclude -I/home/ssvivek/OpenFOAM/OpenFOAM-2.3.1/src/TurbulenceModels/compressible/lnInclude -IlnInclude -I. -I/home/ssvivek/OpenFOAM/OpenFOAM-2.3.1/src/OpenFOAM/lnInclude -I/home/ssvivek/OpenFOAM/OpenFOAM-2.3.1/src/OSspecific/POSIX/lnInclude   -fPIC -c $SOURCE -o Make/linux64GccDPOpt/powerLawVelocityFvPatchVectorField.o
In file included from powerLawVelocity
/powerLawVelocityFvPatchVectorField.C:26:0:
powerLawVelocity/powerLawVelocityFvPatchVectorField.H:79:23fatal errorFunction1.HNo such file or directory
 
#include "Function1.H"
                       
^
compilation terminated.
make: *** [Make/linux64GccDPOpt/powerLawVelocityFvPatchVectorField.oError 1 


I am making this file in Openfoam/usr/run directory.

Could anyone help me to find the problem?

Daniel_Khazaei November 16, 2018 11:32

Hi,


you didn't say which version of OpenFOAM or foam-extend you are using?
But, without knowing the version check the following path:
Code:

OpenFOAM-???/src/OpenFOAM/primitives/functions
if you don't have function1 source folder there, then that's why the compiler can't find the corresponding header!

Regards,
D. Khazaei

vivek05 November 16, 2018 11:42

Thanks for your response Mr.Daniel

I am using openFoam 2.3.1

the path for functions

/home/ssvivek/OpenFOAM/OpenFOAM-2.3.1/src/OpenFOAM/primitives/functions

Daniel_Khazaei November 16, 2018 11:58

Quote:

Originally Posted by vivek05 (Post 715892)
Thanks for your response Mr.Daniel

I am using openFoam 2.3.1

the path for functions

/home/ssvivek/OpenFOAM/OpenFOAM-2.3.1/src/OpenFOAM/primitives/functions

I have just checked OpenFOAM-2.3.x git, it doesn't have function1 library...so if you want to compile your library, you have two options:

1- port back function1 from recent openfoam versions: if you are familiar with c++ and openfoam structure, it is not that hard.

2- upgrade to the newer openfoam versions

vivek05 November 16, 2018 12:07

I am not familiar with C++

Could you give me some steps for port backing from other OpenFoam version??

Daniel_Khazaei November 16, 2018 12:59

Quote:

Originally Posted by vivek05 (Post 715895)
I am not familiar with C++

Could you give me some steps for port backing from other OpenFoam version??

well the safest way is to compile it in user directory without modifying the the installation directory! try as usual and get the function1 from the closest version to your exiting installation! this way you need minimal changes to make it compile on 2.3.1, I would recommend OpenFOAM-4...

you may need to create Make folder and copy files and option file from src/OpenFOAM/Make into your local directory! then modify file and remove unnecessary lines. Also don't forget to change the library path to USER_LIBBIN and name! I assume you know how to compile library in your local directory!

then try to fix each error you get during compile one by one...

vivek05 November 16, 2018 13:08

Thanks for your reply

I am new to compilation procedure.

Is there any sample guidelines available for compiling a library in openfoam

Daniel_Khazaei November 17, 2018 09:21

Quote:

Originally Posted by vivek05 (Post 715903)
Thanks for your reply

I am new to compilation procedure.

Is there any sample guidelines available for compiling a library in openfoam


Yes, there are plenty guidelines available, but in this situation, I would recommend installing a new OpenFOAM version if you have just started to learn OpenFOAM!


All times are GMT -4. The time now is 12:38.