alphaEqnSubCycle.H
Go to the documentation of this file.
1if (pimple.nCorrPIMPLE() > 1)
2{
3 // If nOuterCorrectors > 1 then for all but the first loop the advection
4 // of alpha is done using an average, 0.5*phi+0.5*phiNew where phi is
5 // the flux at the beginning of the time step and phiNew is the flux
6 // estimate at the end of the time step from the previous outer
7 // iteration. Similarly we use 0.5*U + 0.5*UNew in later iterations.
8 if (pimple.firstIter())
9 {
10 // To recalculate the alpha1 update in subsequent iterations, we
11 // must store its current value before overwriting with the new
12 // value
13 alpha1.storePrevIter();
14 // Storing initial phi and U for use in later outer iterations.
15 phi.storePrevIter();
16 U.storePrevIter();
17 }
18 else
19 {
20 // Resetting alpha1 to value before advection in first PIMPLE
21 // iteration.
22 alpha1 = alpha1.prevIter();
23
24 // Temporarily setting U and phi with which to advect interface.
25 U = 0.5*U.prevIter() + 0.5*U;
26 phi = 0.5*phi.prevIter() + 0.5*phi;
27 }
28}
29
31{
32 dimensionedScalar totalDeltaT = runTime.deltaT();
33 surfaceScalarField rhoPhiSum
34 (
35 IOobject
36 (
37 "rhoPhiSum",
38 runTime.timeName(),
39 mesh
40 ),
41 mesh,
42 dimensionedScalar(rhoPhi.dimensions(), Zero)
43 );
44
45 for
46 (
47 subCycle<volScalarField> alphaSubCycle(alpha1, nAlphaSubCycles);
48 !(++alphaSubCycle).end();
49 )
50 {
51 #include "alphaEqn.H"
52 rhoPhiSum += (runTime.deltaT()/totalDeltaT)*rhoPhi;
53 }
54
55 rhoPhi = rhoPhiSum;
56}
57else
58{
59 #include "alphaEqn.H"
60}
61
62if (!pimple.firstIter())
63{
64 // Resetting U and phi to value at latest iteration.
65 U = 2.0*U - U.prevIter();
66 phi = 2.0*phi - phi.prevIter();
67}
68
rhoPhi
Definition: rhoEqn.H:10
surfaceScalarField & phi
pimpleControl & pimple
const volScalarField & alpha1
volScalarField & rho2
const volScalarField & alpha2
volScalarField & rho1
U
Definition: pEqn.H:72
dynamicFvMesh & mesh
engineTime & runTime
label nAlphaSubCycles(alphaControls.get< label >("nAlphaSubCycles"))