|
[Sponsors] |
Problem with compilation of new Boundary Conditions |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
October 20, 2012, 17:55 |
Problem with compilation of new Boundary Conditions
|
#1 |
New Member
Arvind Bharathi
Join Date: Oct 2012
Posts: 6
Rep Power: 14 |
Dear readers
I am new to Open foam, so please bear with me if the question is trivial. I am trying to create new BC based on advectiveFvPatchField and using rhoPimpleFoam solver. Following standard procedure, I copied the solver files and advectiveFvPatchField.h and .C to a folder and tried to compile I am getting the following error: Making dependency list for source file advectiveFvPatchField.C Making dependency list for source file rhoPimpleFoam.C SOURCE=rhoPimpleFoam.C ; g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3 -DNoRepository -ftemplate-depth-100 -I/opt/openfoam211/src/thermophysicalModels/basic/lnInclude -I/opt/openfoam211/src/turbulenceModels/compressible/turbulenceModel -I/opt/openfoam211/src/finiteVolume/cfdTools -I/opt/openfoam211/src/finiteVolume/lnInclude -IlnInclude -I. -I/opt/openfoam211/src/OpenFOAM/lnInclude -I/opt/openfoam211/src/OSspecific/POSIX/lnInclude -fPIC -c $SOURCE -o Make/linux64GccDPOpt/rhoPimpleFoam.o SOURCE=advectiveFvPatchField.C ; g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3 -DNoRepository -ftemplate-depth-100 -I/opt/openfoam211/src/thermophysicalModels/basic/lnInclude -I/opt/openfoam211/src/turbulenceModels/compressible/turbulenceModel -I/opt/openfoam211/src/finiteVolume/cfdTools -I/opt/openfoam211/src/finiteVolume/lnInclude -IlnInclude -I. -I/opt/openfoam211/src/OpenFOAM/lnInclude -I/opt/openfoam211/src/OSspecific/POSIX/lnInclude -fPIC -c $SOURCE -o Make/linux64GccDPOpt/advectiveFvPatchField.o advectiveFvPatchField.C:38:1: error: redefinition of ‘Foam::advectiveFvPatchField<Type1>::advectiveFvPa tchField(const Foam::fvPatch&, const Foam:imensionedField<Type, Foam::volMesh>&)’ advectiveFvPatchField.C:38:1: error: ‘Foam::advectiveFvPatchField<Type1>::advectiveFvPa tchField(const Foam::fvPatch&, const Foam:imensionedField<Type, Foam::volMesh>&)’ previously declared here advectiveFvPatchField.C:57:1: error: redefinition of ‘Foam::advectiveFvPatchField<Type1>::advectiveFvPa tchField(const Foam::advectiveFvPatchField<Type1>&, const Foam::fvPatch&, const Foam:imensionedField<Type, Foam::volMesh>&, const Foam::fvPatchFieldMapper&)’ advectiveFvPatchField.C:57:1: error: ‘Foam::advectiveFvPatchField<Type1>::advectiveFvPa tchField(const Foam::advectiveFvPatchField<Type1>&, const Foam::fvPatch&, const Foam:imensionedField<Type, Foam::volMesh>&, const Foam::fvPatchFieldMapper&)’ previously declared here advectiveFvPatchField.C:74:1: error: redefinition of ‘Foam::advectiveFvPatchField<Type1>::advectiveFvPa tchField(const Foam::fvPatch&, const Foam:imensionedField<Type, Foam::volMesh>&, const Foam::dictionary&)’ advectiveFvPatchField.C:74:1: error: ‘Foam::advectiveFvPatchField<Type1>::advectiveFvPa tchField(const Foam::fvPatch&, const Foam:imensionedField<Type, Foam::volMesh>&, const Foam::dictionary&)’ previously declared here advectiveFvPatchField.C:126:1: error: redefinition of ‘Foam::advectiveFvPatchField<Type1>::advectiveFvPa tchField(const Foam::advectiveFvPatchField<Type1>&)’ advectiveFvPatchField.C:126:1: error: ‘Foam::advectiveFvPatchField<Type1>::advectiveFvPa tchField(const Foam::advectiveFvPatchField<Type1>&)’ previously declared here advectiveFvPatchField.C:140:1: error: redefinition of ‘Foam::advectiveFvPatchField<Type1>::advectiveFvPa tchField(const Foam::advectiveFvPatchField<Type1>&, const Foam:imensionedField<Type, Foam::volMesh>&)’ advectiveFvPatchField.C:140:1: error: ‘Foam::advectiveFvPatchField<Type1>::advectiveFvPa tchField(const Foam::advectiveFvPatchField<Type1>&, const Foam:imensionedField<Type, Foam::volMesh>&)’ previously declared here advectiveFvPatchField.C:158:1: error: redefinition of ‘Foam::tmp<Foam::Field<double> > Foam::advectiveFvPatchField<Type1>::advectionSpeed () const’ advectiveFvPatchField.C:158:1: error: ‘virtual Foam::tmp<Foam::Field<double> > Foam::advectiveFvPatchField<Type1>::advectionSpeed () const’ previously declared here advectiveFvPatchField.C:188:6: error: redefinition of ‘void Foam::advectiveFvPatchField<Type1>::updateCoeffs() ’ advectiveFvPatchField.C:188:6: error: ‘virtual void Foam::advectiveFvPatchField<Type1>::updateCoeffs() ’ previously declared here advectiveFvPatchField.C:303:6: error: redefinition of ‘void Foam::advectiveFvPatchField<Type1>::write(Foam::Os tream&) const’ advectiveFvPatchField.C:303:6: error: ‘virtual void Foam::advectiveFvPatchField<Type1>::write(Foam::Os tream&) const’ previously declared here make: *** [Make/linux64GccDPOpt/advectiveFvPatchField.o] Error 1 I think the error has more to do with C++ template definitions. I tried reading up on it and tried a couple of things by changing the template type name etc... but nothing has worked so far. Any help would be appreciated. I have attached the relevant files. This is my make file settings: rhoPimpleFoam.C advectiveFvPatchField.C EXE = $(FOAM_USER_APPBIN)/myRhoPimpleFoam Thank you arvind3008 |
|
October 22, 2012, 10:57 |
|
#2 |
Senior Member
David Gaden
Join Date: Apr 2009
Location: Winnipeg, Canada
Posts: 437
Rep Power: 22 |
This is a template problem. I think you need to create another file to instantiate the types, and only include that one. See other fvPatchFields... the ones that have an extra couple of files ending with "s". (Also, it is generally undesirable to tie a solver to a boundary condition... but I've done it myself.)
__________________
~~~ Follow me on twitter @DavidGaden |
|
October 22, 2012, 17:13 |
|
#3 |
New Member
Arvind Bharathi
Join Date: Oct 2012
Posts: 6
Rep Power: 14 |
Thanks That solved the problem .. although I am not sure why this is the case
Also, I am unable to compile without a solver as I get the error of unreferenced function main() which is true as there is not main function. I assume that in this case we can compile only as a static library then? |
|
October 22, 2012, 18:08 |
|
#4 |
Senior Member
David Gaden
Join Date: Apr 2009
Location: Winnipeg, Canada
Posts: 437
Rep Power: 22 |
You have to compile it to a static library with "wmake libso". You can link your solver to it directly if you want when you compile that, or you could load it with the controlDict at runTime.
-Dave
__________________
~~~ Follow me on twitter @DavidGaden |
|
Tags |
boundary coundition, compilation, errors |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
mass flow in is not equal to mass flow out | saii | CFX | 12 | March 19, 2018 06:21 |
An error has occurred in cfx5solve: | volo87 | CFX | 5 | June 14, 2013 18:44 |
[Gmsh] Import problem | ARC | OpenFOAM Meshing & Mesh Conversion | 0 | February 27, 2010 11:56 |
CG, BICGSTAB(2) : problem with matrix operation and boundary conditions | moomba | Main CFD Forum | 2 | February 17, 2010 04:37 |
Boundary conditions? | Tom | Main CFD Forum | 0 | November 5, 2002 02:54 |