CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM (http://www.cfd-online.com/Forums/openfoam/)
-   -   units in hsEqn (http://www.cfd-online.com/Forums/openfoam/93484-units-hseqn.html)

 megacrout October 17, 2011 09:53

units in hsEqn

Hi,

I am confused about the parameters used in hsEqn (in my case, in reactingFoam: http://foam.sourceforge.net/docs/cpp/a02385_source.html) and their respective units.

No problem with the right side: both terms are in kg/(ms3). However, this does not seem to be the case of the terms on the left side. Firstly, hs is supposed to be in J/kmkol (see janafThermo, where it is computed) but kmol wonīt cancel out here. So I assume hs has here the same units as Hs (J/kg). This leaves the first two terms with units kg/(sm3) and the third one with units m2/s3.

1) What is wrong here? I did a similar unit check with UEqn and YEqn and got no problem.
2) Can someone show me why hs should suddenly be in J/kg instead of J/kmol? Where does it get converted?

Thx.

Tibo

 megacrout October 17, 2011 10:26

Ok, first two terms actually are in kg/(ms3) if we assume hs is J/kg, not in J/kmol. My bad.

Third term appers to be fine if we multiply it by density.

Still:
1) Can someone explain me why hs should suddenly be in J/kg instead of J/kmol? Where does it get converted?
2) Is there a mistake or is the density actually missing in the code?

Tibo

 adhiraj October 17, 2011 11:02

OpenFOAM's definition of Alpha corresponds to "rho times alpha" in terms of units.
hs is in units of energy/mass, and the conversion is done when computing hs at the cell level. I think the function hs(T) returns hs(in J/Kmol)/W.

 megacrout October 17, 2011 11:16

That would explain pretty well what I observed. Can you tell me what files to look at to see what you mention, i.e. can you proof what you wrote? I still have to learn quite a lot about C++ so I might have missed some code specificity too.

Thank you.

Tibo

 adhiraj October 17, 2011 11:33

Just check the units of alpha where it is defined.

\$FOAM/src/thermophysicalModels/basic/basicThermo

For the other thing, you might want to check the file specieThermo files.

\$FOAM/src/thermophysicalModels/specie/thermo

Hope this helps.

 megacrout October 18, 2011 08:00

It does. Thx.
I needed some time to understand how reactingFoam is related to basicThermo: it is used in basicPsiThermo which is in turn used in hsCombustionThermo on which reactingFoam is based.

I donīt really see how alphaEff ends up being called from basicThermo (i.e. with the properties of basicThermo) to hsEqn though. Can you help me on this?

 adhiraj October 18, 2011 08:18

I believe that the turbulence model had a copy of the thermo package, and could thus access the alpha value. But I don't work in turbulence, and further do not use OpenFOAM's transport models, so I am not qualified enough to answer this.

 All times are GMT -4. The time now is 06:00.