CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM (http://www.cfd-online.com/Forums/openfoam/)
-   -   total energy and mass balances (http://www.cfd-online.com/Forums/openfoam/93566-total-energy-mass-balances.html)

 megacrout October 19, 2011 09:17

total energy and mass balances

I am trying to know how the TOTAL balances for energy and mass are checked in OF, especially in reactingFoam. Please tell me if the following is correct or not and why not.

1) Total mass balance: sum Yi = 1. Is it checked through Y[inertIndex] = scalar(1) - Yt; at the end of YEqn.H? This looks a bit tricky to me as it only modifies the (total) mass fraction of the inert species, it does not correct the computed values. This means the total mass fraction of the inert species would be altered if the computation of the other Yi´s is wrong.
What does the next line : Y[inertIndex].max(0.0); do?

2) As for the total energy, I am actually not quite sure of how it is computed in reactingFoam. Is it e = h - p/rho + u^2/2 ?
And where is the total energy conservation being checked? Is it in thermo.correct() in hsEqn?

3) Finally, the sensible enthalpy is computed through hsEqn in reactingFoam and the chemical one as hc = h(Tstd) through janafThermo. However, janaf also computes (or at least can compute) h(T) and then the sensible enthalpy as hs = h - hc. So, is h being computed as hs + hc? In any case, where is it computed?

Thx for your help and time.

Tibo

I can answer parts of the questions you raised.
1. Yes, it does not check any mass conservation, but uses the mass conservation condition as a constraint. If there is an error in any of the calculated Y's the inert specie will get modified.
The next line Y[i].max(0) sets all values in the Y[i] field to non negative ones. You know from the physical nature of the problem that Y[i] has to be positive or zero. Yet during numerical calculations this condition often needs to be explicitly enforced. Hence the line.
2. ReactingFOAM solves for the transport equation for enthalpy. In version 1.7 it is the sensible enthalpy hs. There is no in built check for energy conservation. The thermo.correct() call goes through a series of functions and then updates the temperature and other properties based on the hs values that have been calculated.
Hope that helps.

 megacrout October 20, 2011 06:51

If the energy conservation is not checked, there actually is no need to compute h. Still, can you maybe tell me if h includes the kinetic energy in reactingFoam (i.e. e = h - p/rho instead of e = h - p/rho + u^2/2) as it sometimes is the case?

I can't remember what is the advantage of the splitting of enthalpy into chemical and sensitive terms. Can you help me? I only vaguely remember something about the separation of the computation for reactions and from the one for transport but I can't find the details anymore.

Tibo