|
[Sponsors] |
September 11, 2014, 09:37 |
Heat capacity of species
|
#1 |
Member
|
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); i is the label of species and Code:
basicMultiComponentMixture& composition = thermo.composition(); Hossein |
|
September 11, 2014, 17:24 |
|
#2 |
Senior Member
Marco A. Turcios
Join Date: Mar 2009
Location: Vancouver, BC, Canada
Posts: 740
Rep Power: 28 |
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(); |
|
September 12, 2014, 23:32 |
|
#3 |
Member
|
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; 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}’ Your second suggestion gives the heat capacity of each cell but not each species. Also, Code:
thermo.cp(); Code:
class Foam::hsCombustionThermo’ has no member named ‘cp’ Last edited by atoof; September 13, 2014 at 02:42. |
|
September 13, 2014, 03:59 |
|
#4 |
Member
|
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); } Code:
forAll(T, cellI) { forAll(Y, specieI) { cpi[specieI][cellI] = composition.Cp(specieI,T[cellI]); } } |
|
September 15, 2014, 12:31 |
|
#5 |
Senior Member
Marco A. Turcios
Join Date: Mar 2009
Location: Vancouver, BC, Canada
Posts: 740
Rep Power: 28 |
Looks good to me.
|
|
|
|
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 |