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

Problem/Bug using enthalpy as thermodynamic model with rhoCentralFoam

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 17, 2023, 12:44
Default Problem/Bug using enthalpy as thermodynamic model with rhoCentralFoam
  #1
Senior Member
 
Join Date: Dec 2019
Posts: 215
Rep Power: 7
shock77 is on a distinguished road
Hello all,


the long version of the problem is described in this thread: Wrong Solution for sensibleEnthalpy
I could reconstruct this case and it seems, that rhoCentralFoam only works with sensibleInternalEnergy as energy variable and not with internalEnthalpy. I also used the sod shock tube.
I tried to figure out the problem. Since I am not an expert on C++, I would like to hear your opinion.

I think the problem is, that enthalpy h is assumed to be equal to internal energy e, which is not correct, but for incompressible flow the assumption is okay, like Bloerb described it in the thread meantioned above. The bug report https://bugs.openfoam.org/view.php?id=571 also mentioned this problem. I am struggling to find this issue in the code and maybe someone can help me out.

The energy variable e used in rhoCentralFoam is defined as:


Code:
volScalarField& e = thermo.he();
in applications/solvers/compressible/rhoCentralFoam/rhoCentralFoam.C/createFields.H


Further, he is derived from:


Code:
  
 template<class Thermo, template<class> class Type>

 inline Foam::scalar

 Foam::species::thermo<Thermo, Type>::he(const scalar p, const scalar T) const

 {

     return this->HE(p, T)*this->W();

 }
in src/thermophysicalModels/specie/thermo/thermo/thermoI.H



HE is derived from


Code:
            // Sensible enthalpy [J/kg]

             scalar HE

             (

                 const Thermo& thermo,

                 const scalar p,

                 const scalar T

             ) const

             {

                 return thermo.Hs(p, T);

             }
In src/thermophysicalModels/specie/thermo/sensibleEnthalpy/sensibleEnthalpy.H


Hs is derived from:


Code:
 template<class EquationOfState>

 inline Foam::scalar Foam::hConstThermo<EquationOfState>::Hs

 (

     const scalar p, const scalar T

 ) const

 {

     return Cp_*T + EquationOfState::H(p, T);

 }
in src/thermophysicalModels/specie/thermo/hConst/hConstThermoI.H


This concludes: e=cp*T, which is wrong. It is easily tricked by specifying for Cp the value of Cv. I tried it and it produced the right answers.


Thoughts? Did I make a mistake?
shock77 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
viewFactor radiation model stuck shach934 OpenFOAM 1 May 25, 2021 11:01
Need help to implement turbulence model in rhoCentralFoam Calmly OpenFOAM Running, Solving & CFD 1 October 6, 2020 10:06
Simulation of a single bubble with a VOF-method Suzzn CFX 21 January 29, 2018 00:58
user defined enthalpy for heat exchanger model jackstraw Fluent UDF and Scheme Programming 0 December 23, 2015 03:53
Superlinear speedup in OpenFOAM 13 msrinath80 OpenFOAM Running, Solving & CFD 18 March 3, 2015 05:36


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