CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   Symbol lookup error related with a custom thermophysical model in foam-extend 4.0 (https://www.cfd-online.com/Forums/openfoam-programming-development/218713-symbol-lookup-error-related-custom-thermophysical-model-foam-extend-4-0-a.html)

ch1 July 1, 2019 14:07

Symbol lookup error related with a custom thermophysical model in foam-extend 4.0
 
1 Attachment(s)
Hey folks,
I followed instructions given here http://www.tfd.chalmers.se/~hani/kur...3-or-2.4.x.pdf(Part I) to compile my custom thermophysical library and link it to a solver. The difference is that I am using foam-extend 4.0. Now, I'm trying to figure out why I'm getting the following symbol lookup error
Code:

symbol lookup error: /home/of/OpenFOAM/icpaxiof/fe40/lib/linux64GccDPOpt/libbasicThermophysicalModels.so: undefined symbol: _ZN4Foam11pureMixtureINS_18kineticArTransportINS_12specieThermoINS_12hConstThermoINS_10perfectGasEEEEEEEE8typeNameE
when running the case. Using the c++filt command this error message can be converted to
Code:

Foam::pureMixture<Foam::kineticArTransport<Foam::specieThermo<Foam::hConstThermo<Foam::perfectGas> > > >::typeName
.

I uploaded the modified library here: https://www63.zippyshare.com/v/LpyM6bZf/file.html
In the attachments you can find two compilation log files of running "wmake libso" in /basic and /specie directories, respectively, and the Make/options file of the solver.

Best regards
Christian

ch1 July 19, 2019 11:34

Hello everyone,
finally I found the source of the error in /src/thermophysicalModels/basic/psiThermo/psiThermos.C :
Code:

#include "makeBasicPsiThermo.H"

#include "perfectGas.H"

#include "hConstThermo.H"
#include "janafThermo.H"
#include "specieThermo.H"

#include "constTransport.H"
#include "kineticArTransport.H"
#include "sutherlandTransport.H"

#include "hPsiThermo.H"
#include "pureMixture.H"


// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

namespace Foam
{

/* * * * * * * * * * * * * * * Private Static Data * * * * * * * * * * * * * */

makeBasicPsiThermo //new custom thermophysical model
(
    hPsiThermo,
    pureMixture,
    kineticArTransport,
    hConstThermo,
    perfectGas
);

makeBasicPsiThermo
(
    hPsiThermo,
    pureMixture,
    constTransport,
    hConstThermo,
    perfectGas
);

The word kineticArTransport was not defined. If you carefully follow the instructions given by http://www.tfd.chalmers.se/~hani/kur...3-or-2.4.x.pdf , you will get the same symbol look-up error in foam-extend 4.0. The problem is that the following word definition in files like constTransport.H (my copy is named kineticArTransport.H) is missing:


Code:

  //- Return the instantiated type name
        static word typeName()
        {
            return "kineticAr<" + thermo::typeName() + '>';
        }

In other OF versions like of-v1812 the definition of the word typeName exists. So there the custom thermophysical library should run without problems.

My workaround to make my custom thermophysical model run in foam-extend 4.0 was to modify the OF standard transport and thermo models like hConst,..

However, this is not very elegant and I am still curious, where and how the typeName words of the thermophysical models are defined in foam-extend 4.0.

Actually, I tried to add the above word defintion to my kineticArTransport.H, but this didn't work here, either.


Best regards
Christian


All times are GMT -4. The time now is 09:07.