CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   total energy and mass balances (https://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

adhiraj October 19, 2011 19:50

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

Hi Adhiraj,

Thanks for your reply, again. It does help, indeed.

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?

And your answers raised a new question:
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

adhiraj October 20, 2011 09:09

Quote:

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?
As far as I recall, h meant e+p/rho. OpenFOAM solves the transport equation for hs and then calculates the temperature from the relation h=integral Cd dT
Quote:

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.
You can formulate your energy equation in terms of either one. But remember that one advantage of using h in place of hs is that there is no source term due to chemical reactions in the h equation
On the other hand, there are some issues with diffusion flames that are exacerbated by the use of the h equation. In this case, use of the hs equation somewhat masks the problem, though it is not eliminated.


All times are GMT -4. The time now is 05:39.