CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (http://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Total specie mass instead of local concentration (http://www.cfd-online.com/Forums/openfoam-solving/60220-total-specie-mass-instead-local-concentration.html)

tsencic May 12, 2006 03:09

The output files of combustion
 
The output files of combustion/chemistry solvers, beside others, are species concentrations (O2, N2, CO2, CO...), with a list of local concentration in each cell. The problem is that bigger cells contribute to the global concentration more than the small ones, so just calculating the average does not lead to the correct result. In addition, in engine solvers cell volume changes with time. How can be obtained the average concentration over the hole domain? Or, how could I output specie mass instead of concentration? Where can I find the cell volumes?

gschaider May 12, 2006 03:35

The cell volumes are available
 
The cell volumes are available via mesh.V() (Look at table 2.1 in the Programmers guide; it's small but most useful).

Average concentration would be

Yavg=sum(Y[specIndex]*mesh.V())/sum(mesh.V());

stefanke May 12, 2006 03:37

the solvers write out the spec
 
the solvers write out the species mass fraction of each cell. If you want to know the global mass of a specie just sum up the specie mass fraction of each cell you will get the right result:

mathematical writing:

m_k_tot = Sum_j(m_kj) = Sum_j(rho_j*Y_kj*V_j)

k is the species index
j is the cell index

hth

You can get the cell volumes from 'mesh.V()'


All times are GMT -4. The time now is 02:53.