/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: dev | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ inletMassFlowRate { type surfaceFieldValue; libs ("libfieldFunctionObjects.so"); fields ( alphaRhoPhi.gas alphaRhoPhi.liquid ); writeFields false; log true; surfaceFormat null; regionType patch; name inlet; operation sum; writeControl timeStep; } outletMassFlowRate { type surfaceFieldValue; libs ("libfieldFunctionObjects.so"); fields ( alphaRhoPhi.gas alphaRhoPhi.liquid ); writeFields false; log true; surfaceFormat null; regionType patch; name outlet; operation sum; writeControl timeStep; } totalMass { type coded; libs ("libutilityFunctionObjects.so"); name error; codeExecute #{ const volScalarField& alphaGas = mesh().lookupObject("alpha.gas"); const volScalarField& alphaLiquid = mesh().lookupObject("alpha.liquid"); const volScalarField& rhoGas = mesh().lookupObject("thermo:rho.gas"); const volScalarField& rhoLiquid = mesh().lookupObject("thermo:rho.liquid"); const scalarField& v = mesh().V(); Info<< "coded totalMass output:" << endl << " volIntegrate(all) for alpha.gas*rho.gas = " << gSum(alphaGas*rhoGas*v) << endl << " volIntegrate(all) for alpha.liquid*rho.liquid = " << gSum(alphaLiquid*rhoLiquid*v) << endl << endl; #}; } // ************************************************************************* //