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

alphaEqns.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 = phic*interface.nHatf();
00006 
00007     for (int gCorr=0; gCorr<nAlphaCorr; gCorr++)
00008     {
00009         volScalarField::DimensionedInternalField Sp
00010         (
00011             IOobject
00012             (
00013                 "Sp",
00014                 runTime.timeName(),
00015                 mesh
00016             ),
00017             mesh,
00018             dimensionedScalar("Sp", dgdt.dimensions(), 0.0)
00019         );
00020 
00021         volScalarField::DimensionedInternalField Su
00022         (
00023             IOobject
00024             (
00025                 "Su",
00026                 runTime.timeName(),
00027                 mesh
00028             ),
00029             // Divergence term is handled explicitly to be
00030             // consistent with the explicit transport solution
00031             divU*min(alpha1, scalar(1))
00032         );
00033 
00034         forAll(dgdt, celli)
00035         {
00036             if (dgdt[celli] > 0.0 && alpha1[celli] > 0.0)
00037             {
00038                 Sp[celli] -= dgdt[celli]*alpha1[celli];
00039                 Su[celli] += dgdt[celli]*alpha1[celli];
00040             }
00041             else if (dgdt[celli] < 0.0 && alpha1[celli] < 1.0)
00042             {
00043                 Sp[celli] += dgdt[celli]*(1.0 - alpha1[celli]);
00044             }
00045         }
00046 
00047 
00048         surfaceScalarField phiAlpha1 =
00049             fvc::flux
00050             (
00051                 phi,
00052                 alpha1,
00053                 alphaScheme
00054             )
00055           + fvc::flux
00056             (
00057                 -fvc::flux(-phir, alpha2, alpharScheme),
00058                 alpha1,
00059                 alpharScheme
00060             );
00061 
00062         MULES::explicitSolve(geometricOneField(), alpha1, phi, phiAlpha1, Sp, Su, 1, 0);
00063 
00064         surfaceScalarField rho1f = fvc::interpolate(rho1);
00065         surfaceScalarField rho2f = fvc::interpolate(rho2);
00066         rhoPhi = phiAlpha1*(rho1f - rho2f) + phi*rho2f;
00067 
00068         alpha2 = scalar(1) - alpha1;
00069     }
00070 
00071     Info<< "Liquid phase volume fraction = "
00072         << alpha1.weightedAverage(mesh.V()).value()
00073         << "  Min(alpha1) = " << min(alpha1).value()
00074         << "  Min(alpha2) = " << min(alpha2).value()
00075         << endl;
00076 }
00077 
00078 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines