|
[Sponsors] |
Modified rhoReactionBuoyantFOAM for Mixing of Non Reactive Species |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
June 2, 2014, 16:31 |
Modified rhoReactionBuoyantFOAM for Mixing of Non Reactive Species
|
#1 |
Member
|
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; 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 |
|
Tags |
mixing, non reacting flow, rhoreactingbuyantfoam, rhoreactingfoam |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Species Mole and Mass Fraction Macro | combustion | FLUENT | 18 | February 5, 2024 13:23 |
Modelling Biomass Combustion via Species Transport | Racheal | FLUENT | 39 | January 8, 2022 08:42 |
What is the difference between liquid reactive flow and gas reactive flow? | James | Main CFD Forum | 6 | May 15, 2009 13:14 |
Species order fluent | Raddi | FLUENT | 1 | March 13, 2009 01:21 |
mass fraction of species | Ahmed | FLUENT | 0 | April 18, 2007 12:57 |