|
[Sponsors] |
Outlet gas composition species mass flux programming |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
June 29, 2021, 17:08 |
Outlet gas composition species mass flux programming
|
#1 |
Member
Vitor Monteiro
Join Date: Nov 2020
Posts: 32
Rep Power: 6 |
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; } } 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. |
|
July 6, 2021, 16:30 |
|
#2 |
Member
Vitor Monteiro
Join Date: Nov 2020
Posts: 32
Rep Power: 6 |
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; 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 ); } Last edited by Vitor Monteiro; July 7, 2021 at 14:54. |
|
Tags |
composition, outlet |
|
|
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 |