|
[Sponsors] | |||||
temperature equation into interFOAM, undefined reference to ::typeName |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
|
|
|
#1 |
|
Member
Join Date: Feb 2020
Posts: 90
Rep Power: 7 ![]() |
Hello to all, I would like to implement the temperature equation into interFOAM on openFOAM 2106. I found, what I consider to be, an elegant solution in Adding the Energy Equation to interFoam (OF 2.4.0) where a new myImmiscibleIncompressibleTwoPhaseMixture class is derived from immiscibleIncompressibleTwoPhaseMixture and the thermal part of the code gets implemented there. I have followed the example, but upon compilation I get and error : Code:
In function `Foam::incompressibleInterPhaseTransportModel<Foam::myImmiscibleIncompressibleTwoPhaseMixture>::type() const': /home/of/OpenFOAM/OpenFOAM-v2106/src/phaseSystemModels/twoPhaseInter/incompressibleInterPhaseTransportModel/lnInclude/incompressibleInterPhaseTransportModel.H:106: undefined reference to `Foam::incompressibleInterPhaseTransportModel<Foam::myImmiscibleIncompressibleTwoPhaseMixture>::typeName' collect2: error: ld returned 1 exit status Code:
typedef incompressibleInterPhaseTransportModel
<
immiscibleIncompressibleTwoPhaseMixture
> transportModelType;
to: Code:
typedef incompressibleInterPhaseTransportModel
<
myImmiscibleIncompressibleTwoPhaseMixture
> transportModelType;
Currently the class has: .H Code:
#ifndef myImmiscibleIncompressibleTwoPhaseMixture_H
#define myImmiscibleIncompressibleTwoPhaseMixture_H
#include "immiscibleIncompressibleTwoPhaseMixture.H"
namespace Foam
{
class myImmiscibleIncompressibleTwoPhaseMixture
:
public immiscibleIncompressibleTwoPhaseMixture
{
protected:
public:
// Constructors
//- Construct from components
myImmiscibleIncompressibleTwoPhaseMixture
(
const volVectorField& U,
const surfaceScalarField& phi
);
//- Destructor
virtual ~myImmiscibleIncompressibleTwoPhaseMixture(){}
// No temperature related stuff are currently implemented
};
} // End namespace Foam
#endif
.C Code:
#include "myImmiscibleIncompressibleTwoPhaseMixture.H"
namespace Foam
{
defineTypeNameAndDebug(myImmiscibleIncompressibleTwoPhaseMixture, 0);
}
Foam::myImmiscibleIncompressibleTwoPhaseMixture::myImmiscibleIncompressibleTwoPhaseMixture
(
const volVectorField& U,
const surfaceScalarField& phi
)
:
immiscibleIncompressibleTwoPhaseMixture (U, phi)
{}
Code:
EXE_INC = \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/OpenFOAM/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/transportModels \
-I$(LIB_SRC)/transportModels/immiscibleIncompressibleTwoPhaseMixture/lnInclude \
-I$(LIB_SRC)/transportModels/incompressible/incompressibleTwoPhaseMixture/lnInclude \
-I$(LIB_SRC)/transportModels/incompressible/lnInclude \
-I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \
-I$(LIB_SRC)/transportModels/twoPhaseMixture/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude
LIB_LIBS = \
-ltwoPhaseMixture \
-lincompressibleTransportModels \
-limmiscibleIncompressibleTwoPhaseMixture \
-linterfaceProperties \
-lfiniteVolume
Code:
EXE_INC = \
-I./myImmiscibleIncompressibleTwoPhaseMixture/myImmiscibleIncompressibleTwoPhaseMixture/ \
-I$(FOAM_SOLVERS)/multiphase/VoF \
-I$(LIB_SRC)/phaseSystemModels/twoPhaseInter/incompressibleInterPhaseTransportModel/lnInclude \
-I$(LIB_SRC)/phaseSystemModels/twoPhaseInter/VoFphaseIncompressibleTurbulenceModels/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/sampling/lnInclude \
-I$(LIB_SRC)/dynamicFvMesh/lnInclude \
-I$(LIB_SRC)/transportModels \
-I$(LIB_SRC)/transportModels/incompressible/lnInclude \
-I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \
-I$(LIB_SRC)/transportModels/twoPhaseMixture/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/incompressible/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/phaseIncompressible/lnInclude \
-I$(LIB_SRC)/transportModels/immiscibleIncompressibleTwoPhaseMixture/lnInclude
EXE_LIBS = \
-L$(FOAM_USER_LIBBIN) \
-lmyImmiscibleIncompressibleTwoPhaseMixture \
-lfiniteVolume \
-lfvOptions \
-lmeshTools \
-lsampling \
-ldynamicFvMesh \
-lincompressibleTransportModels \
-linterfaceProperties \
-limmiscibleIncompressibleTwoPhaseMixture \
-lturbulenceModels \
-lincompressibleTurbulenceModels \
-lwaveModels \
-lVoFphaseTurbulentTransportModels
Thanks in advance! |
|
|
|
|
|
|
|
|
#2 |
|
Member
Join Date: Feb 2020
Posts: 90
Rep Power: 7 ![]() |
Can anyone one give me hand with this?
Best Regards |
|
|
|
|
|
|
|
|
#3 |
|
Senior Member
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,715
Rep Power: 41 ![]() ![]() |
Interpreting the error message is not easy at first, but it states that typeName has not been defined. In OpenFOAM there are two frequently used macros "ClassName()" and "TypeName()". Both of these will add a declaration in your class for a typeName_() method and a typeName static const. You need a corresponding definition of the values in the C code, usually with the defineTypeNameAndDebug macro. Make certain that the c++ file is actually being compiled (and linked) and all should be fine.
|
|
|
|
|
|
|
|
|
#4 |
|
New Member
lixiaoyang
Join Date: Aug 2025
Posts: 1
Rep Power: 0 ![]() |
I also face with this problem,if you solve it can you give me some suggestions?
|
|
|
|
|
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| can not complie fluentDataToFoam in OF2.1.1 | hewei | OpenFOAM Pre-Processing | 20 | September 8, 2018 10:19 |
| wmake problems during custom utility compilation | palazi88 | OpenFOAM Programming & Development | 11 | August 13, 2018 21:52 |
| OpenFoam 1.6-ext - RPM build errors | preibie | OpenFOAM | 12 | September 8, 2011 04:12 |
| Error with Wmake | skabilan | OpenFOAM Installation | 3 | July 28, 2009 01:35 |
| G95 + CGNS | Bruno | Main CFD Forum | 1 | January 30, 2007 01:34 |