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/)
-   -   myThermo using makeThermo.H symbol lookup error (https://www.cfd-online.com/Forums/openfoam-programming-development/205000-mythermo-using-makethermo-h-symbol-lookup-error.html)

Robin.Kamenicky August 7, 2018 06:45

myThermo using makeThermo.H symbol lookup error
 
Hi Foamers,

I wonder whether somebody could help me with symbol lookup error I am getting.

I want to make non-newtonian trasport model for compressible flow. Till now I have just tried to copy other transport model, rename it and run.

The compilation runs fine, I can also choose the transport model in a solver. However, when I run in a case I get following error:

Code:

rhoPimpleFoam: symbol lookup error: /home/robin/OpenFOAM/robin-5.0-debug/platforms/linux64GccDPInt32Debug/lib/libmyThermos.so: undefined symbol: _ZN4Foam21nonNewtonianTransportINS_7species6thermoINS_1    2eConstThermoINS_10perfectGasINS_6specieEEEEENS_22sensibleInternalEnergyEEEEC1ERKNS_10dictionaryE
When I run
Code:

nm -C
on my library following symbolic link is the error one:
Code:

U Foam::nonNewtonianTransport<Foam::species::thermo<Foam::eConstThermo<Foam::perfectGas<Foam::specie> >, Foam::sensibleInternalEnergy> >::nonNewtonianTransport(Foam::dictionary const    &)
It tells it is undefined.

I have done following step:
  • cp -r OpenFOAM-5.0-debug/src/thermophysicalModels/specie/transport/const xxx-5.0-debug/src/thermophysicalModels/specie/transport/nonNewtonianTransport
  • mv constTransport.H nonNewtonianTransport,H
  • mv constTransportI.H nonNewtonianTransportI,H
  • mv constTransport.C nonNewtonianTransport,C
  • sed -i s/constTransport/nonNewtonianTransport/g nonNewtonianTransport*
  • Change public method typeName() in nonNewtonianTransport.H so it return:
    Code:

    return "nonNewtonianTransport<" + Thermo::typeName() + '>';
    instead of const.
  • Make a file myThermos.C based on psiThermos.C where also nonNewtonianTransport.H is included
    Code:

    *---------------------------------------------------------------------------*\
      =========                |
      \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox
      \\    /  O peration    |
        \\  /    A nd          | Copyright (C) 2011-2015 OpenFOAM Foundation
        \\/    M anipulation  |
    -------------------------------------------------------------------------------
    License
        This file is part of OpenFOAM.

        OpenFOAM is free software: you can redistribute it and/or modify it
        under the terms of the GNU General Public License as published by
        the Free Software Foundation, either version 3 of the License, or
        (at your option) any later version.

        OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
        ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
        FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
        for more details.

        You should have received a copy of the GNU General Public License
        along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.

    \*---------------------------------------------------------------------------*/
    #ifndef myThermo_H
    #define myThermo_H
    #include "psiThermo.H"
    #include "makeThermo.H"

    #include "specie.H"
    #include "perfectGas.H"
    #include "PengRobinsonGas.H"
    #include "hConstThermo.H"
    #include "eConstThermo.H"
    #include "janafThermo.H"
    #include "sensibleEnthalpy.H"
    #include "sensibleInternalEnergy.H"
    #include "thermo.H"

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

    #include "hPolynomialThermo.H"
    #include "polynomialTransport.H"

    #include "hePsiThermo.H"
    #include "pureMixture.H"
    #include "nonNewtonianTransport.H"

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

    namespace Foam
    {

    /* * * * * * * * * * * * * * * private static data * * * * * * * * * * * * * */

    makeThermo
    (
                psiThermo,
                hePsiThermo,
                pureMixture,
                nonNewtonianTransport,
                sensibleInternalEnergy,
                eConstThermo,
                perfectGas,
                specie
    );



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

    } // End namespace Foam
    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
    #endif
    // ************************************************************************* //

  • Make a Make directory
    files:
    Code:

    myThermos.C
    LIB = $(FOAM_USER_LIBBIN)/libmyThermos

    options:
    Code:

    EXE_INC = \
            -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
            -I$(LIB_SRC)/OpenFOAM/lnInclude \
            -I$(LIB_SRC)/finiteVolume/lnInclude \
            -I$(LIB_SRC)/transportModels/compressible/lnInclude \
            -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
            -I$(LIB_SRC)/thermophysicalModels/thermophysicalProperties/lnInclude \
            -I$(LIB_SRC)/meshTools/lnInclude
       
    LIB_LIBS = \
            -L$(FOAM_USER_LIBBIN) \
            -lOpenFOAM \
            -lfiniteVolume \
            -lcompressibleTransportModels \
            -lspecie \
            -lfluidThermophysicalModels \
            -lthermophysicalProperties \
            -lmeshTools

  • wmake runs successfully.
  • tested at the tutorial tutorials/compressible/rhoPimpleFoam/laminar/helmholtzResonance
  • library is included in the controlDict
    Code:

    libs   
    (
    "libmyThermos.so"
    );

  • thermophysicalProperties changed to utilize nonNewtonianTransport as transport model

Any help is very appreciated,
Thank you,
Robin

Robin.Kamenicky August 16, 2018 09:08

Hi,

The problem was commenting out following lines in nonNewtonianTransport.H

Code:

#ifdef NoRepository
#include "nonNewtonianTransport.C"
#endif

Kind Regards,
Robin

StefanW November 12, 2018 05:48

similar Problem
 
Hi Robin,

how is it going?
just found your Thread and see that we are aiming the same goal.

In my case it is the multiphase solver compressibleInterFoam where I want to make one phase a nonNewtonian fluid with OF 5.x.

So far i coppied the polynomial transport model, called it nnTransport and implemented the necessary headers in
makeReaktion.H
reactionTypes.H
psiThermos.C
rhoThermos.C
thermoPhysicsTypes.H

and also the model in
psiThermos.C
rhoThermos.C

I compiled everything started a calculation and it runs well so far, but still with the calculation of mu based on the Tempreture (like polynomialTransport)

Now its time for changing the way how mu is calculated.

Have you been successfull here?
Any Hints would be really appreciated.

Thanks a lot.

Stefan

Robin.Kamenicky December 16, 2018 17:05

Quote:

Originally Posted by StefanW (Post 714935)
Hi Robin,

how is it going?
just found your Thread and see that we are aiming the same goal.

In my case it is the multiphase solver compressibleInterFoam where I want to make one phase a nonNewtonian fluid with OF 5.x.

So far i coppied the polynomial transport model, called it nnTransport and implemented the necessary headers in
makeReaktion.H
reactionTypes.H
psiThermos.C
rhoThermos.C
thermoPhysicsTypes.H

and also the model in
psiThermos.C
rhoThermos.C

I compiled everything started a calculation and it runs well so far, but still with the calculation of mu based on the Tempreture (like polynomialTransport)

Now its time for changing the way how mu is calculated.

Have you been successfull here?
Any Hints would be really appreciated.

Thanks a lot.

Stefan

Hi Stefan,

sorry for a late answer. How is it going?
I have not finished the nonNewtonian model implementation, I had to move over to other topic. I do work on reactingTwoPhaseEulerFoam where I am particularly interested in bulk and wall boiling models.

I hope , I will be able to return to nonNewtonian model implementation in February.

Have a nice day,
Robin


All times are GMT -4. The time now is 04:15.