2 // Creates the porosity field for MULES
3 volScalarField porosity
14 dimensionedScalar("NULL", dimless, 1.0),
18 forAll (pZones, zoneI)
20 const label zoneId = pZones[zoneI].zoneId();
22 const labelList& cells= mesh.cellZones()[zoneId];
24 const scalar& zonePorosity = pZones[zoneI].porosity();
28 porosity[cells[cellI]] = zonePorosity;
32 // Ordinary MULES except for the argument list to explicitSolve
33 word alphaScheme("div(phi,alpha)");
34 word alpharScheme("div(phirb,alpha)");
36 surfaceScalarField phic = mag(phi/mesh.magSf());
37 phic = min(interface.cAlpha()*phic, max(phic));
38 surfaceScalarField phir = phic*interface.nHatf();
40 for (int aCorr=0; aCorr<nAlphaCorr; aCorr++)
42 surfaceScalarField phiAlpha =
51 -fvc::flux(-phir, scalar(1) - alpha1, alpharScheme),
68 rhoPhi = phiAlpha*(rho1 - rho2) + phi*rho2;
71 // The weightedAverage will change even in a closed box,
72 // however, the volume of water should
73 // remain constant - hence both values are written in the log
74 Info<< "Liquid phase volume fraction = "
75 << alpha1.weightedAverage(mesh.V()).value()
76 << " Volume of water = "
77 << gSum( alpha1.internalField()*porosity.internalField()*mesh.V()
78 << " Min(alpha1) = " << min(alpha1).value()
79 << " Max(alpha1) = " << max(alpha1).value()