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

error in calculating mole fractions

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 16, 2010, 04:16
Default error in calculating mole fractions
  #1
New Member
 
Emanuele Leoni
Join Date: Apr 2009
Posts: 13
Rep Power: 17
lions85 is on a distinguished road
Hi, I have a problem: I would like to change the radiation model in openfoam 1.5-dev using a species-weighted absorption coefficient (wggs) to compare my results with fluent and experimental data. The point is that in the equation of wggs I have the mole fraction and not the mass fraction. I tried in the simplest way, using the equation to change mass fraction in mole fraction trough the total molecular weight. I wrote a code like this:

Code:
volScalarField unosuMWtot
(
    IOobject
    (
        "unosuMWtot",
        mesh_.time().timeName(),
        mesh_,
        IOobject::NO_READ,
        IOobject::NO_WRITE
    ),
    mesh_,
    dimensionedScalar("zero", dimensionSet(-1,0,0,0,1,0,0), 0.0)
);
for (label i=0;i<Y.size();i++)
{
unosuMWtot=unosuMWtot+Y[i]/chemistry->specieThermo()[i].W();
}
where chemistry is a pointer to a chemistrymodel object, Y is the ptrlist of the compositions and unosuMWtot would be 1 over the total molecular weight. In this way i get a segmentation fault error and i don't know why. probably this is for the chemistry->specieThermo()[i].W() row, because deleting it the error disappears. Anyway i don't understand because i used the same row in another class with a pointer to chemistrymodel in the same way and everything works fine.

So, anyway can find me a way to solve the problem, or maybe there is a direct function of chemistry model or hcomustionthermo where i can find the mole fraction without calculate it?

Thank you
Bye
Emanuele
lions85 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
Problems in calculating the fluid traction on the current structure frame in 3D models fw407 OpenFOAM Running, Solving & CFD 0 August 6, 2008 12:04
Calculating time thuy FLUENT 5 April 10, 2008 04:23
Diffusion-coefficient based on mole fraction Fady FLUENT 1 November 11, 2006 09:00
How to update polyPatchbs localPoints liu OpenFOAM Running, Solving & CFD 6 December 30, 2005 17:27
Mole fractions from mass fractions? Keith Siemens 5 September 27, 2002 05:39


All times are GMT -4. The time now is 15:43.