CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   molar mass of mixture (https://www.cfd-online.com/Forums/openfoam-programming-development/111534-molar-mass-mixture.html)

Marshak January 9, 2013 09:14

molar mass of mixture
 
Can anyone kindly let me know how to calculate the molar mass of a gas mixture in each cell. I am using hsCombustionThermo.

charles4allme May 2, 2019 15:29

Were you able to figure it out

raumpolizei May 3, 2019 03:46

Hey Charles,

the mixture averaged molar mass can be accessed via the mixture classes in the thermophysicalModels library (at least in my version, of1612). The mixture itself is a "part" of the thermo object which is used in your solver. In order to access it, something similar to
Code:

const auto mixture = thermo.composition();
should work. In order to output the mixture averaged molar mass, you could do something like this (not tested):
Code:

// create new field to get the mixture at write time
volScalarField mixtureMolarMass
(
    IOobject
    (
        "WMixture",
        runTime.timeName(),
        mesh,
        IOobject::NO_READ,
        IOobject::AUTO_WRITE
    ),
    mixture.W()
);

Though it is unlikely, the function you have to call may be different for your specific case (here I assumed the mixture type you are using is derived from the basicSpecieMixture class).

Cheers
RP


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