CFD Online Logo CFD Online URL
Home > Forums > OpenFOAM

Species Mass Fraction in reactingFOAM

Register Blogs Members List Search Today's Posts Mark Forums Read

LinkBack Thread Tools Display Modes
Old   November 28, 2012, 20:39
Default Species Mass Fraction in reactingFOAM
New Member
Join Date: Feb 2012
Posts: 25
Rep Power: 5
Marshak is on a distinguished road

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.
Marshak is offline   Reply With Quote

Old   November 29, 2012, 02:31
Senior Member
Karl-Johan Nogenmyr
Join Date: Mar 2009
Location: Linköping
Posts: 257
Rep Power: 12
kalle is on a distinguished road

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.

kalle is offline   Reply With Quote


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
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

All times are GMT -4. The time now is 14:17.