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

Modified rhoReactionBuoyantFOAM for Mixing of Non Reactive Species

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 2, 2014, 15:31
Default Modified rhoReactionBuoyantFOAM for Mixing of Non Reactive Species
  #1
Member
 
Krishna
Join Date: Jun 2012
Posts: 33
Blog Entries: 1
Rep Power: 13
rkc.cfd is on a distinguished road
Hello,

I am trying to modify rhoReactingBuoyantFoam to simulate mixing of two gases with buoyancy effects. The gases are at constant temperature and density fluctuations arise due to mass fractions. I have taken out the reaction terms and also the EEeqn.H from
rhoReactingBuoyantFoam.


Then I calculate the density based on the species mass fraction at the location and feed the mixture density into thermo.rho().

Code:
/*
 * Calculate Average rho
 */
    volScalarField Yt(0.0*Y[0]);
    volScalarField Winv(0.0*Y[0]);
    for (label n=0; n<Y.size(); n++)
    {
        Yt += Y[n];
        Winv += Y[n] / thermo.composition().W(n);
    }
    //- Mean molecular weight [kg/kmol]
    volScalarField Wmix = 1.0/Winv;

    //- Specific gas constant [J/(kg K)] for this mixture
    volScalarField Rmix = specie::RR/Wmix;

    forAll(Y,i){
             for (label n=0; n<Y.size(); n++) {
                 rhoMix[i]=0;
             }
            }

    //Calculate rhoMix
        forAll(Y,i){
          for (label n=0; n<Y.size(); n++) {
                   rhoMix[i]=p[i]/Rmix[i]*T[i];
          }
         }
thermo.rho()=rhoMix;
I have placed the above equation just before the p equation in the main solver.
The solution diverges with the following error:

Code:
Program received signal SIGFPE, Arithmetic exception.
0x00007ffff24dbab9 in Foam::divide (res=..., f1=..., f2=...) at fields/Fields/scalarField/scalarField.C:114
114    BINARY_OPERATOR(scalar, scalar, scalar, /, divide)
(gdb) bt
#0  0x00007ffff24dbab9 in Foam::divide (res=..., f1=..., f2=...) at fields/Fields/scalarField/scalarField.C:114
#1  0x000000000048f178 in Foam::divide<Foam::fvsPatchField, Foam::surfaceMesh> (res=..., gf1=..., gf2=...) at /home/krishna/OpenFOAM/OpenFOAM-2.3.x/src/OpenFOAM/lnInclude/GeometricScalarField.C:114
#2  0x000000000047bfba in Foam::operator/<Foam::fvsPatchField, Foam::surfaceMesh> (tgf1=..., gf2=...) at /home/krishna/OpenFOAM/OpenFOAM-2.3.x/src/OpenFOAM/lnInclude/GeometricScalarField.C:114
#3  0x000000000046a740 in main (argc=1, argv=0x7fffffffd128) at pEqn.H:72

Is there a better way to address the problem of updating the rho. The case runs fine with non-modified rhoReactionBuoyantFoam.


Cheers
rkc.cfd is offline   Reply With Quote

Reply

Tags
mixing, non reacting flow, rhoreactingbuyantfoam, rhoreactingfoam


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
Species Mole and Mass Fraction Macro combustion FLUENT 18 February 5, 2024 12:23
Modelling Biomass Combustion via Species Transport Racheal FLUENT 39 January 8, 2022 07:42
What is the difference between liquid reactive flow and gas reactive flow? James Main CFD Forum 6 May 15, 2009 12:14
Species order fluent Raddi FLUENT 1 March 13, 2009 00:21
mass fraction of species Ahmed FLUENT 0 April 18, 2007 11:57


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