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/)
-   -   [OF 6] Outputting enthalpies by reavtingFoam (https://www.cfd-online.com/Forums/openfoam-programming-development/205745-6-outputting-enthalpies-reavtingfoam.html)

dik0424 August 24, 2018 06:33

[OF 6] Outputting enthalpies from janafThermo
 
Dear all,

Hello everyone, thank you for viewing my post.
I'm a beginner of OpenFOAM and C++.

I'm trying to simulate combustion by using reactingFoam in OpenFOAM 6, and I wanna get

1. Total enthalpy
2. Sensible enthalpy
3. Enthalpy of formation

from "janafThermo" class. Then, I add some functions into createFiselds.H as shown below.


Code:

#include "janafThermo.H"

volScalarField& p = thermo.p();

scalar Ha = Foam::janafTermo<EquationOfState>::Ha(p, T);
scalar Hs = Foam::janafTermo<EquationOfState>::Hs(p, T);
scalar Hc = Foam::janafTermo<EquationOfState>::Hc(p, T);

volScalarField Ha
(
    IOobject
    (
    "Ha",
    runTime.timeName(),
        mesh
    ),
    Ha
    //    bsm.Ha()
 );

volScalarField Hs
(
    IOobject
    (
    "Hs",
    runTime.timeName(),
        mesh
    ),
    //    bsm.Hs()
    Hs
);

volScalarField Hc
(
    IOobject
    (
    "Hc",
    runTime.timeName(),
        mesh
    ),
    //    bsm.Hc()
    Hc
 );

//--------------------------------------

But I got the error message like


Code:

from reactingFoam_H.C:48:
./createFields.H: function ‘int main(int, char**)’ 内:
./createFields.H:31:13: error: ‘EquationOfState’ has not been declared
 scalar Ha = EquationOfState::Ha(p, T);// const;
            ^
./createFields.H:32:13: error: ‘EquationOfState’ has not been declared
 scalar Hs = EquationOfState::Hs(p, T);// const;
            ^
./createFields.H:33:13: error: ‘EquationOfState’ has not been declared
 scalar Hc = EquationOfState::Hc(p, T);// const;
            ^
./createFields.H:39:5: error: conflicting declaration ‘Foam::volScalarField Ha’
    (
    ^
./createFields.H:31:8: error: ‘Ha’ has a previous declaration as ‘Foam::scalar Ha’
 scalar Ha = EquationOfState::Ha(p, T);// const;
        ^
./createFields.H:51:5: error: conflicting declaration ‘Foam::volScalarField Hs’
    (
    ^
./createFields.H:32:8: error: ‘Hs’ has a previous declaration as ‘Foam::scalar Hs’
 scalar Hs = EquationOfState::Hs(p, T);// const;
        ^
./createFields.H:63:5: error: conflicting declaration ‘Foam::volScalarField Hc’
    (
    ^
./createFields.H:33:8: error: ‘Hc’ has a previous declaration as ‘Foam::scalar Hc’
 scalar Hc = EquationOfState::Hc(p, T);// const;
        ^

.
.
.

So, please tell me the correct way to declare EquationOfState.


Best regard,


Thank you.


All times are GMT -4. The time now is 12:35.