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

Heat capacity of species

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 11, 2014, 09:37
Default Heat capacity of species
  #1
Member
 
Hossein
Join Date: Apr 2010
Posts: 65
Rep Power: 16
atoof is on a distinguished road
Send a message via Yahoo to atoof
Dears,

I am going to implement a new model for calculating viscosity that needs to heat capacity of each species. The new solver is based on reactingFoam.

Is it possible to get heat capacity of all species in all computational cells of the domain?

I used the following with no success.

Code:
volScalarField cpi = composition.Cp(i,T);
where
i is the label of species and
Code:
basicMultiComponentMixture& composition = thermo.composition();
Thank you in advance,

Hossein
atoof is offline   Reply With Quote

Old   September 11, 2014, 17:24
Default
  #2
Senior Member
 
mturcios777's Avatar
 
Marco A. Turcios
Join Date: Mar 2009
Location: Vancouver, BC, Canada
Posts: 740
Rep Power: 28
mturcios777 will become famous soon enough
If you look at the documentation, the return value for the Cp is a single scalar, and the inputs are single scalars as well. To get Cp for a single field like this you will need to go through each species, and each cell, and calculate the mass weighted Cp.

Or you can use the cp function from the thermo class that does this already:

Code:
volScalarField cp = thermo.cp();
mturcios777 is offline   Reply With Quote

Old   September 12, 2014, 23:32
Default
  #3
Member
 
Hossein
Join Date: Apr 2010
Posts: 65
Rep Power: 16
atoof is on a distinguished road
Send a message via Yahoo to atoof
Thanks Marco,



How can I go through each species? I'm using OF2.1.x. In the documentation of basicMultiComponentMixture.H we read:

Code:
//- Heat capacity at constant pressure [J/(kg K)]
            virtual scalar Cp(const label specieI, const scalar T) const = 0;
But I can not reach and I encounter the following error:

Code:
YEqn.H:53:52: error: no matching function for call to  ‘Foam::basicMultiComponentMixture::Cp(Foam::label&, const  volScalarField&)’
YEqn.H:53:52: note: candidate is:
In file  included from  /home/mohammad/OpenFOAM/OpenFOAM-2.1.x/src/thermophysicalModels/reactionThermo/lnInclude/hsCombustionThermo.H:39:0,
                  from  /home/mohammad/OpenFOAM/OpenFOAM-2.1.x/src/thermophysicalModels/chemistryModel/lnInclude/psiChemistryModel.H:43,
                 from /home/mohammad/OpenFOAM/OpenFOAM-2.1.x/src/combustionModels/lnInclude/psiChemistryCombustionModel.H:43,
                 from myReactingFoam.C:35:
/home/mohammad/OpenFOAM/OpenFOAM-2.1.x/src/thermophysicalModels/reactionThermo/lnInclude/basicMultiComponentMixture.H:134:28:  note: virtual Foam::scalar  Foam::basicMultiComponentMixture::Cp(Foam::label, Foam::scalar) const
/home/mohammad/OpenFOAM/OpenFOAM-2.1.x/src/thermophysicalModels/reactionThermo/lnInclude/basicMultiComponentMixture.H:134:28:  note:   no known conversion for argument 2 from ‘const volScalarField  {aka const Foam::GeometricField<double, Foam::fvPatchField,  Foam::volMesh>}’ to ‘Foam::scalar {aka double}’
Because it needs scalar instead of volScalarField. Is there any way to extract Cp value from a volScalarField value (temperature)?
Your second suggestion gives the heat capacity of each cell but not each species. Also,
Code:
thermo.cp();
leads to
Code:
class Foam::hsCombustionThermo’ has no member named ‘cp’
cp shold be replaced by Cp

Last edited by atoof; September 13, 2014 at 02:42.
atoof is offline   Reply With Quote

Old   September 13, 2014, 03:59
Default
  #4
Member
 
Hossein
Join Date: Apr 2010
Posts: 65
Rep Power: 16
atoof is on a distinguished road
Send a message via Yahoo to atoof
I used the following to get the species' heat capacities:
In createFields:
Code:
PtrList<volScalarField>& cpi = Y;
forAll( cpi, rowI){
      cpi[rowI].setSize(mesh.cells().size(), 0);
}
and in YEqn.H:
Code:
    forAll(T, cellI)
    {   
        forAll(Y, specieI)
        {
            cpi[specieI][cellI] = composition.Cp(specieI,T[cellI]);
        }
    }
Any Comments?
atoof is offline   Reply With Quote

Old   September 15, 2014, 12:31
Default
  #5
Senior Member
 
mturcios777's Avatar
 
Marco A. Turcios
Join Date: Mar 2009
Location: Vancouver, BC, Canada
Posts: 740
Rep Power: 28
mturcios777 will become famous soon enough
Looks good to me.
mturcios777 is offline   Reply With Quote

Reply


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
specific heat capacity at constant pressure in CFD Post newbie384 CFX 5 November 27, 2015 21:25
Implementing tabular heat capacity chriss85 OpenFOAM Programming & Development 5 February 10, 2014 07:29
Effective heat capacity - Phase change does not work!!! papteo CFX 8 October 31, 2013 05:15
Temperature dependend heat capacity sega OpenFOAM Running, Solving & CFD 0 October 8, 2009 16:00
Convective Heat Transfer - Heat Exchanger Mark CFX 6 November 15, 2004 15:55


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