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

[OF 6] Outputting enthalpies by reavtingFoam

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 24, 2018, 06:33
Question [OF 6] Outputting enthalpies from janafThermo
  #1
New Member
 
Daiki Sugawara
Join Date: Aug 2018
Location: Japan
Posts: 1
Rep Power: 0
dik0424 is on a distinguished road
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.

Last edited by dik0424; August 28, 2018 at 04:12. Reason: To make my problem concreate
dik0424 is offline   Reply With Quote

Reply

Tags
enthalpy, openfoam 6, reactingfoam


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



All times are GMT -4. The time now is 13:59.