alexvaleije |
May 11, 2018 10:38 |
Problem while compiling a turbulence model in OF 4.1
Hi everybody,
I am having some problems compiling a modified k-epsilon turbulence model in OpenFoam 4.1
To be sure I'm not writing anything wrong in the files, I have copied the original files of the model and I have changed all of the "kEpsilon" terms for "mykEpsilon" and nothing else.
My Make/files has the following:
Quote:
mykEpsilon.C
LIB = $(FOAM_USER_LIBBIN)/libmyIncompressibleRASModels
|
and my Make/options is:
Quote:
EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude
LIB_LIBS = \
-lfiniteVolume \
-lmeshTools
|
Despite of that, the error when I try to compile is this:
Quote:
g++ -std=c++0x -m64 -Dlinux64 -DWM_ARCH_OPTION=64 -DWM_DP -DWM_LABEL_SIZE=32 -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter -Wno-invalid-offsetof -O3 -DNoRepository -ftemplate-depth-100 -I/opt/openfoam4/src/finiteVolume/lnInclude -I/opt/openfoam4/src/meshTools/lnInclude -I/opt/openfoam4/src/TurbulenceModels/turbulenceModels/lnInclude -IlnInclude -I. -I/opt/openfoam4/src/OpenFOAM/lnInclude -I/opt/openfoam4/src/OSspecific/POSIX/lnInclude -fPIC -c mykEpsilon.C -o Make/linux64GccDPInt32Opt/mykEpsilon.o
mykEpsilon.C:40:6: error: redefinition of \u2018void Foam::RASModels::mykEpsilon<BasicTurbulenceModel>: :correctNut()\u2019
void mykEpsilon<BasicTurbulenceModel>::correctNut()
^
In file included from mykEpsilon.H:213:0,
from mykEpsilon.C:26:
mykEpsilon.C:40:6: error: \u2018virtual void Foam::RASModels::mykEpsilon<BasicTurbulenceModel>: :correctNut()\u2019 previously declared here
void mykEpsilon<BasicTurbulenceModel>::correctNut()
^
mykEpsilon.C:51:21: error: redefinition of \u2018Foam::tmp<Foam::fvMatrix<double> > Foam::RASModels::mykEpsilon<BasicTurbulenceModel>: :kSource() const\u2019
tmp<fvScalarMatrix> mykEpsilon<BasicTurbulenceModel>::kSource() const
^
In file included from mykEpsilon.H:213:0,
from mykEpsilon.C:26:
mykEpsilon.C:51:21: error: \u2018virtual Foam::tmp<Foam::fvMatrix<double> > Foam::RASModels::mykEpsilon<BasicTurbulenceModel>: :kSource() const\u2019 previously declared here
tmp<fvScalarMatrix> mykEpsilon<BasicTurbulenceModel>::kSource() const
^
mykEpsilon.C:66:21: error: redefinition of \u2018Foam::tmp<Foam::fvMatrix<double> > Foam::RASModels::mykEpsilon<BasicTurbulenceModel>: :epsilonSource() const\u2019
tmp<fvScalarMatrix> mykEpsilon<BasicTurbulenceModel>::epsilonSource() const
^
In file included from mykEpsilon.H:213:0,
from mykEpsilon.C:26:
mykEpsilon.C:66:21: error: \u2018virtual Foam::tmp<Foam::fvMatrix<double> > Foam::RASModels::mykEpsilon<BasicTurbulenceModel>: :epsilonSource() const\u2019 previously declared here
tmp<fvScalarMatrix> mykEpsilon<BasicTurbulenceModel>::epsilonSource() const
^
mykEpsilon.C:83:1: error: redefinition of \u2018Foam::RASModels::mykEpsilon<BasicTurbulenceM odel>::mykEpsilon(const alphaField&, const rhoField&, const volVectorField&, const surfaceScalarField&, const surfaceScalarField&, const transportModel&, const Foam::word&, const Foam::word&)\u2019
mykEpsilon<BasicTurbulenceModel>::mykEpsilon
^
In file included from mykEpsilon.H:213:0,
from mykEpsilon.C:26:
mykEpsilon.C:83:1: error: \u2018Foam::RASModels::mykEpsilon<BasicTurbulenceM odel>::mykEpsilon(const alphaField&, const rhoField&, const volVectorField&, const surfaceScalarField&, const surfaceScalarField&, const transportModel&, const Foam::word&, const Foam::word&)\u2019 previously declared here
mykEpsilon<BasicTurbulenceModel>::mykEpsilon
^
mykEpsilon.C:200:6: error: redefinition of \u2018bool Foam::RASModels::mykEpsilon<BasicTurbulenceModel>: :read()\u2019
bool mykEpsilon<BasicTurbulenceModel>::read()
^
In file included from mykEpsilon.H:213:0,
from mykEpsilon.C:26:
mykEpsilon.C:200:6: error: \u2018virtual bool Foam::RASModels::mykEpsilon<BasicTurbulenceModel>: :read()\u2019 previously declared here
bool mykEpsilon<BasicTurbulenceModel>::read()
^
mykEpsilon.C:221:6: error: redefinition of \u2018void Foam::RASModels::mykEpsilon<BasicTurbulenceModel>: :correct()\u2019
void mykEpsilon<BasicTurbulenceModel>::correct()
^
In file included from mykEpsilon.H:213:0,
from mykEpsilon.C:26:
mykEpsilon.C:221:6: error: \u2018virtual void Foam::RASModels::mykEpsilon<BasicTurbulenceModel>: :correct()\u2019 previously declared here
void mykEpsilon<BasicTurbulenceModel>::correct()
^
make: *** [Make/linux64GccDPInt32Opt/mykEpsilon.o] Error 1
|
Since I have not redefined anything, I don't know why is this happening. Could anybody help me with this?
Thank you very much!!
Alex
|