CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

temperature equation into interFOAM, undefined reference to ::typeName

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 12, 2021, 05:21
Default temperature equation into interFOAM, undefined reference to ::typeName
  #1
Member
 
Join Date: Feb 2020
Posts: 90
Rep Power: 7
Shibi is on a distinguished road
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
This happens when I change line 75 of createFields.H from:

Code:
typedef incompressibleInterPhaseTransportModel
    <
        immiscibleIncompressibleTwoPhaseMixture
    > transportModelType;


to:


Code:

typedef incompressibleInterPhaseTransportModel
    <
        myImmiscibleIncompressibleTwoPhaseMixture
    > transportModelType;
Can anyone help me fixing this?

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)
 {}
The options file of the class:
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
The options file of the modified interFOAM
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!
Shibi is offline   Reply With Quote

Old   November 20, 2021, 06:29
Default
  #2
Member
 
Join Date: Feb 2020
Posts: 90
Rep Power: 7
Shibi is on a distinguished road
Can anyone one give me hand with this?


Best Regards
Shibi is offline   Reply With Quote

Old   November 20, 2021, 06:48
Default
  #3
Senior Member
 
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,715
Rep Power: 41
olesen has a spectacular aura aboutolesen has a spectacular aura about
Quote:
Originally Posted by Shibi View Post
Can anyone one give me hand with this?


Best Regards
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.
olesen is offline   Reply With Quote

Old   October 6, 2025, 08:23
Default
  #4
New Member
 
lixiaoyang
Join Date: Aug 2025
Posts: 1
Rep Power: 0
xyfoamer is on a distinguished road
I also face with this problem,if you solve it can you give me some suggestions?
xyfoamer is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


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


All times are GMT -4. The time now is 05:48.