FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

alphaEqn.H

Go to the documentation of this file.
00001 {
00002     word alphaScheme("div(phi,alpha)");
00003     word alpharScheme("div(phirb,alpha)");
00004 
00005     surfaceScalarField phir("phir", phic*interface.nHatf());
00006 
00007     for (int gCorr=0; gCorr<nAlphaCorr; gCorr++)
00008     {
00009         surfaceScalarField phiAlpha =
00010             fvc::flux
00011             (
00012                 phi,
00013                 alpha1,
00014                 alphaScheme
00015             )
00016           + fvc::flux
00017             (
00018                 -fvc::flux(-phir, scalar(1) - alpha1, alpharScheme),
00019                 alpha1,
00020                 alpharScheme
00021             );
00022 
00023         Pair<tmp<volScalarField> > vDotAlphal =
00024             twoPhaseProperties->vDotAlphal();
00025         const volScalarField& vDotcAlphal = vDotAlphal[0]();
00026         const volScalarField& vDotvAlphal = vDotAlphal[1]();
00027 
00028         volScalarField Sp
00029         (
00030             IOobject
00031             (
00032                 "Sp",
00033                 runTime.timeName(),
00034                 mesh
00035             ),
00036             vDotvAlphal - vDotcAlphal
00037         );
00038 
00039         volScalarField Su
00040         (
00041             IOobject
00042             (
00043                 "Su",
00044                 runTime.timeName(),
00045                 mesh
00046             ),
00047             // Divergence term is handled explicitly to be
00048             // consistent with the explicit transport solution
00049             divU*alpha1
00050           + vDotcAlphal
00051         );
00052 
00053         //MULES::explicitSolve(alpha1, phi, phiAlpha, 1, 0);
00054         //MULES::explicitSolve(geometricOneField(), alpha1, phi, phiAlpha, Sp, Su, 1, 0);
00055         MULES::implicitSolve(geometricOneField(), alpha1, phi, phiAlpha, Sp, Su, 1, 0);
00056 
00057         rhoPhi +=
00058             (runTime.deltaT()/totalDeltaT)
00059            *(phiAlpha*(rho1 - rho2) + phi*rho2);
00060     }
00061 
00062     Info<< "Liquid phase volume fraction = "
00063         << alpha1.weightedAverage(mesh.V()).value()
00064         << "  Min(alpha1) = " << min(alpha1).value()
00065         << "  Max(alpha1) = " << max(alpha1).value()
00066         << endl;
00067 }
00068 
00069 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines