CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM

Species Mass Fraction in reactingFOAM

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 28, 2012, 20:39
Default Species Mass Fraction in reactingFOAM
  #1
New Member
 
Join Date: Feb 2012
Posts: 25
Rep Power: 14
Marshak is on a distinguished road
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.
Marshak is offline   Reply With Quote

Old   November 29, 2012, 02:31
Default
  #2
Senior Member
 
Karl-Johan Nogenmyr
Join Date: Mar 2009
Location: Linköping
Posts: 279
Rep Power: 21
kalle is on a distinguished road
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
kalle is offline   Reply With Quote

Reply


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 Off
Pingbacks are On
Refbacks are On


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


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