CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Problem with mass flux calculation in libsimpleFunctionObjects.so (https://www.cfd-online.com/Forums/openfoam-solving/189698-problem-mass-flux-calculation-libsimplefunctionobjects-so.html)

BlnPhoenix June 24, 2017 15:02

Problem with mass flux calculation in libsimpleFunctionObjects.so
 
Hello,


i want to check the mass balance for multiphase cases while running the solver multiphaseEulerFoam. Ideally i want to create an output that calculates the mass balance for all phases e.g. for water and a secondary air phase. So far the closest i got to that is using

Code:


functions
{

    MassflowInlet
  {
    type                    faceSource;
    functionObjectLibs      ("libfieldFunctionObjects.so");
    enabled                true;
    outputControl          timeStep;
    outputInterval          1;
    outputControlMode      timeStep;
    log                        true;
    valueOutput          false;
    source                  patch;
    sourceName          outlet;
    operation              sum;
   
fields
                (
      phi.water
      phi.air
                );
  }
}

to ControlDict and calculating the imbalance by hand. The issue here is that the mass flux on outlet is incorrect. In an early time step there is no secondary phase on the outlet, so therefore the flux must be ZERO but it isn't. It's pretty much the inlet divided by two. I have in total one inlet and two outlets. Getting a NON zero flux for the secondary phase doesn't make sense to me, there is not yet air on the outlet, why does OpenFoam have flux there? The alpha values area averaged correctly on the outlets. What am i missing here?

Also, is there a possibilty to check the overall mass balance with a function object or do i need to calcualte it by hand for each time step?

Thanks!!

BlnPhoenix June 24, 2017 15:36

Ok, i found that phi in incompressible solvers is m^3/s and so i guess, to get the mass flux i have to calculate by hand with average alpha on outlet face and the density of the phase.


All times are GMT -4. The time now is 07:48.