|
[Sponsors] |
November 28, 2012, 20:39 |
Species Mass Fraction in reactingFOAM
|
#1 |
New Member
Join Date: Feb 2012
Posts: 25
Rep Power: 14 |
Hi!
I am simulating methane CH4 combustion using reactingFOAM solver. I want to define a variable which is a function of local mass fraction of CO2, H2O in each computational cell and the cell size.for example: A=Y_CO2*Y_H2O* cell size Can anyone help me on how can I write the above in openFOAM coding language to access these variables. |
|
November 29, 2012, 02:31 |
|
#2 |
Senior Member
Karl-Johan Nogenmyr
Join Date: Mar 2009
Location: Linköping
Posts: 279
Rep Power: 21 |
Hi,
To access species, something like this should work: const volScalarField& Y_CO2 = composition.Y("CO2"); const volScalarField& Y_H2O = composition.Y("H2O"); Then you should consider that mesh.V() is just a scalarField, so you cannot directly multiply it with the above. You can let A be a scalarField too and try this: scalarField A(mesh.V() * Y_CO2.internalField() * Y_H2O.internalField() ); I have not tried the above code, so get back here if you get compilation or runtime problems. K |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
mass fraction of species | Lilly | FLUENT | 5 | March 13, 2022 18:52 |
gradient of species mass fraction | zhou | FLUENT | 1 | March 14, 2020 08:55 |
mass flow in is not equal to mass flow out | saii | CFX | 12 | March 19, 2018 06:21 |
Water subcooled boiling | Attesz | CFX | 7 | January 5, 2013 04:32 |
On the damBreak4phaseFine cases | paean | OpenFOAM Running, Solving & CFD | 0 | November 14, 2008 22:14 |