CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   multiphaseEulerFoam - Modifying equation used to calculate alpha (https://www.cfd-online.com/Forums/openfoam-programming-development/150025-multiphaseeulerfoam-modifying-equation-used-calculate-alpha.html)

anuragm March 13, 2015 09:40

multiphaseEulerFoam - Modifying equation used to calculate alpha
 
Hi everyone,

I would like to make some changes to the way alpha (phase fraction) is calculated in multiphaseEulerFoam. I am still new to it and I have some questions:

1. Calculation of alpha is the first step in the algorithm called by fluid.solve()

Now fluid is an object of the type multiphaseSystem. So I check the function Foam::multiphaseSystem::solve() in multiphaseSystem.C

However, I still do not seem to understand how exactly is alpha being calculated? Can someone at least point me in the right direction?

2. What does "nAlphaSubCycles" in the fvSolution dictionary do? I read somewhere that this represents the number of additional solutions within a given time step - basically done to calculate "cheaper" alpha while increasing max Co at the same time. But I don't seem to fully appreciate its meaning. Additionally, the fvSolution dictionary in the case mixervessel2D does not define cycleAlpha or nAlphaCorr. Is this not necessary to have a value of nAlphaSubCycles > 1 ?

anuragm March 18, 2015 09:49

Ok. So I have managed to find how alpha is calculated. However, I do not fully understand it yet.

In multiphaseSystem.C, I came across the following equation which is similar to the equation (8) in the relevant paper.

Code:

            word phirScheme
            (
                "div(phir," + alpha2.name() + ',' + alpha1.name() + ')'
            );

            phiAlphaCorr += fvc::flux
            (
                -fvc::flux(-phir, phase2, phirScheme),
                phase1,
                phirScheme
            );

What exactly is the operator fvc::flux doing here? Can someone please explain this equation?

Thanks in advance.

fs82 June 23, 2015 08:22

May be you allready solved this problem, if not here is the explanation. Have a look in gaussConvectionScheme.C. The flux operator evaluates the result of (-fvc::flux(-phir, phase2, phirScheme)) times phase1 for each face (as phase1 is a volScalarField it has to be interpolated to the face).

anuragm July 7, 2015 07:36

Thank you for the help Fabian. I had stopped looking into this problem altogether and occupied myself a different, although not entirely unrelated, one. I will refer to your comment when I start tinkering with this part of the solver again.


All times are GMT -4. The time now is 20:55.