|
[Sponsors] |
November 20, 2018, 16:18 |
Equation of state redifinition error
|
#1 |
New Member
Gergely Keszthelyi
Join Date: Nov 2018
Posts: 1
Rep Power: 0 |
Hello everyone!
I am currently trying to create a new Equation of State model loosely based on the IAPWS formulation for super-heated steam called oneIAPWS, working on OpenFOAM 6.0. (Though it is at the moment just a simple polynomial fit in the region interest, but this would suffice for my needs at the moment.) This way this is an equation of state that does not need any input data. Therefore I based my code on the perfectGas built-in equation of state, where I switched all instances of perfectGas to oneIAPWS, and edited the property functions in the file containing the inline declarations. All the operators were left alone. For compilation, I made a Make directory as necessary, along with the files. In the files file, I created an so Code:
./oneIAPWS.C LIB = $(FOAM_USER_LIBBIN)/liboneIAPWS Code:
EXE_INC = \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude LIB_LIBS = \ -lfiniteVolume The library does not compile however, as I get the following error message after using wmake libso: Code:
wmakeLnInclude: linking include files to ./lnInclude Making dependency list for source file oneIAPWS.C g++ -std=c++11 -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 -Wno-attributes -O3 -DNoRepository -ftemplate-depth-100 -I/opt/openfoam6/src/finiteVolume/lnInclude -I/opt/openfoam6/src/thermophysicalModels/basic/lnInclude -I/opt/openfoam6/src/thermophysicalModels/specie/lnInclude -I/opt/openfoam6/src/thermophysicalModels/reactionThermo/lnInclude -IlnInclude -I. -I/opt/openfoam6/src/OpenFOAM/lnInclude -I/opt/openfoam6/src/OSspecific/POSIX/lnInclude -fPIC -c oneIAPWS.C -o Make/linux64GccDPInt32Opt/./oneIAPWS.o oneIAPWS.C:32:1: error: redefinition of ‘Foam::oneIAPWS<Specie>::oneIAPWS(const Foam::dictionary&)’ Foam::oneIAPWS<Specie>::oneIAPWS(const dictionary& dict) ^~~~ In file included from oneIAPWS.H:200:0, from oneIAPWS.C:26: oneIAPWS.C:32:1: note: ‘Foam::oneIAPWS<Specie>::oneIAPWS(const Foam::dictionary&)’ previously declared here Foam::oneIAPWS<Specie>::oneIAPWS(const dictionary& dict) ^~~~ oneIAPWS.C:41:6: error: redefinition of ‘void Foam::oneIAPWS<Specie>::write(Foam::Ostream&) const’ void Foam::oneIAPWS<Specie>::write(Ostream& os) const ^~~~ In file included from oneIAPWS.H:200:0, from oneIAPWS.C:26: oneIAPWS.C:41:6: note: ‘void Foam::oneIAPWS<Specie>::write(Foam::Ostream&) const’ previously declared here void Foam::oneIAPWS<Specie>::write(Ostream& os) const ^~~~ oneIAPWS.C:50:16: error: redefinition of ‘template<class Specie> Foam::Ostream& Foam::operator<<(Foam::Ostream&, const Foam::oneIAPWS<Specie>&)’ Foam::Ostream& Foam::operator<<(Ostream& os, const oneIAPWS<Specie>& pg) ^~~~ In file included from oneIAPWS.H:200:0, from oneIAPWS.C:26: oneIAPWS.C:50:16: note: ‘template<class Specie> Foam::Ostream& Foam::operator<<(Foam::Ostream&, const Foam::oneIAPWS<Specie>&)’ previously declared here Foam::Ostream& Foam::operator<<(Ostream& os, const oneIAPWS<Specie>& pg) ^~~~ /opt/openfoam6/wmake/rules/General/transform:25: recipe for target 'Make/linux64GccDPInt32Opt/./oneIAPWS.o' failed make: *** [Make/linux64GccDPInt32Opt/./oneIAPWS.o] Error 1 What could I be doing wrong? Are the headers wrongly declared? (As this is most often linked to redefinition errors. I did not edit the #ifndef settings though.) I only found one similar error, but that simply "disappeared" by copying the files again. All of my files are attached to this post. Thanks for all the help in advance; Gergely |
|
December 4, 2018, 06:07 |
|
#2 |
Senior Member
Join Date: Sep 2015
Location: Singapore
Posts: 102
Rep Power: 11 |
I had a similar problem. Try removing the following lines from oneIAPWS.H.
Code:
#ifdef NoRepository #include "oneIAPWS.C" #endif |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Setting the height of the stream in the free channel | kevinmccartin | CFX | 12 | October 13, 2022 22:43 |
[OpenFOAM] an error in Calculator's equation | immortality | ParaView | 12 | June 29, 2021 01:10 |
[OpenFOAM.org] Compile OF 2.3 on Mac OS X .... the patch | gschaider | OpenFOAM Installation | 225 | August 25, 2015 20:43 |
error message | cuteapathy | CFX | 14 | March 20, 2012 07:45 |
How to get the max value of the whole field | waynezw0618 | OpenFOAM Running, Solving & CFD | 4 | June 17, 2008 06:07 |