|November 28, 2012, 20:39||
Species Mass Fraction in reactingFOAM
Join Date: Feb 2012
Posts: 25Rep Power: 5
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||
Join Date: Mar 2009
Posts: 256Rep Power: 12
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.
|Thread||Thread Starter||Forum||Replies||Last Post|
|Water subcooled boiling||Attesz||CFX||7||January 5, 2013 04:32|
|mass fraction of species||Lilly||FLUENT||3||July 25, 2011 05:00|
|mass flow in is not equal to mass flow out||saii||CFX||2||September 18, 2009 08:07|
|On the damBreak4phaseFine cases||paean||OpenFOAM Running, Solving & CFD||0||November 14, 2008 22:14|
|gradient of species mass fraction||zhou||FLUENT||0||March 3, 2004 23:55|