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

Outlet gas composition species mass flux programming

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 29, 2021, 17:08
Default Outlet gas composition species mass flux programming
  #1
Member
 
Vitor Monteiro
Join Date: Nov 2020
Posts: 32
Rep Power: 6
Vitor Monteiro is on a distinguished road
I'm using multiphaseEulerFoam to simulate a fluidised bed reator. This is part of the code I'm using to quantify the components conversion of all finite volumes of my mesh to handle the mass balance calculations.
However, I would like to program into my multiphaseEulerFoam.C the mass fraction composition of the gas flux of the Outlet boundary, and implement the mass flow of each species into the mass balance calculations.
Could anyone help me do this? I don't know what functions to use or how to integrate the mass flux to the outlet face.

Code:
const scalarField& v = mesh.V();
forAll(fluid.multiComponentPhases(), multiComponentPhasei) 
 
    {
        phaseModel& phase = fluid.multiComponentPhases()[multiComponentPhasei]; 
        UPtrList<volScalarField>& Y = phase.YRef();
        const volScalarField& rho = phase.rho();
    
        forAll(Y, i)
        {
             const volScalarField& alpha = Y[i];                    
             alphaYrho[ii] =  gSum(alpha*phase*rho*v);  // mass of each species        

             const scalarField& outletPatchPhi = phi.boundaryField()[1];  // determines the Outlet patch
              outletPatchPhi = gSum((alpha*phase*rho)*phi.boundaryField()[1]);  // I don't understand this phi very well. My system has phi, phi.air, phi.sand and phi.particles fields
             Info << "    " << alpha.name() << " = " << outletPatchPhi << " kg/s" << endl;

         } 

   }
The red lines doesn't work, once I'm a new foam programmer, but it has the idea I was wondering about.
Thanks a lot!


I know I could do this at controlDict, but I just want to program it into the solver to make further calculations.

Last edited by Vitor Monteiro; July 4, 2021 at 12:15.
Vitor Monteiro is offline   Reply With Quote

Old   July 6, 2021, 16:30
Default
  #2
Member
 
Vitor Monteiro
Join Date: Nov 2020
Posts: 32
Rep Power: 6
Vitor Monteiro is on a distinguished road
I have already made some progress with this at my multiphaseEulerFoam.C file:

Code:
const scalarField& phasex = phase.boundaryField()[outletPatchID]; 
const scalarField& Yip = alpha.boundaryField()[outletPatchID];   
const scalarField& rhoi = rho.boundaryField()[outletPatchID];  
const scalarField& outletPatchPhi = phi.boundaryField()[outletPatchID];
scalar outletMass = gSum(phasex*Yip*outletPatchPhi); // without rhoi just to match with controlDict tool
Info << "    " << alpha.name() << " = " << outletMass << " kg/s" << endl;
However, it seems like it doesn't matches with the controlDict results duirng simulation.
controlDict.C file I've set like this:

Code:
gasFlux
    {
        type            surfaceFieldValue;
        libs            ( "libfieldFunctionObjects.so" );
        writeControl    timeStep;
        log             true;
        writeFields     false;
        regionType      patch;
        name            outlet;
        operation       weightedAreaIntegrate;
        weightField     phi.air;
        fields            
        ( 
            H2O.air
            CO2.air
            CO.air
            H2.air
            O2.air
            N2.air
            CH4.air
        );
    }
Could anyone help?

Last edited by Vitor Monteiro; July 7, 2021 at 14:54.
Vitor Monteiro is offline   Reply With Quote

Reply

Tags
composition, outlet


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
Radiation in semi-transparent media with surface-to-surface model? mpeppels CFX 11 August 22, 2019 08:30
Inconsistencies in reading .dat file during run time in new injection model Scram_1 OpenFOAM 0 March 23, 2018 23:29
Surface Integrals of Species Mass Flow to Wall Incorrect koad FLUENT 4 January 12, 2016 17:38
Fixed Outlet Mass Flux boundary condition? trex930 OpenFOAM Pre-Processing 2 June 30, 2010 22:44
total mass flux correction for compressible fluid? Francesco Di Maio Main CFD Forum 0 August 21, 2000 05:23


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