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

error in calculating mole fractions

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

Reply
 
LinkBack Thread Tools Display Modes
Old   February 16, 2010, 05:16
Default error in calculating mole fractions
  #1
New Member
 
Emanuele Leoni
Join Date: Apr 2009
Posts: 13
Rep Power: 8
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

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
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 10:00
How to update polyPatchbs localPoints liu OpenFOAM Running, Solving & CFD 6 December 30, 2005 18:27
Mole fractions from mass fractions? Keith CD-adapco 5 September 27, 2002 05:39


All times are GMT -4. The time now is 01:58.