Loading...
Searching...
No Matches
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 mesh.newIOobject("rhoPhiSum"),
36 mesh,
37 dimensionedScalar(rhoPhi.dimensions(), Zero)
38 );
39
40 for
41 (
42 subCycle<volScalarField> alphaSubCycle(alpha1, nAlphaSubCycles);
43 !(++alphaSubCycle).end();
44 )
45 {
46 #include "alphaEqn.H"
47 rhoPhiSum += (runTime.deltaT()/totalDeltaT)*rhoPhi;
48 }
49
50 rhoPhi = rhoPhiSum;
51}
52else
53{
54 #include "alphaEqn.H"
55}
56
57if (!pimple.firstIter())
58{
59 // Resetting U and phi to value at latest iteration.
60 U = 2.0*U - U.prevIter();
61 phi = 2.0*phi - phi.prevIter();
62}
63
rhoPhi
Definition rhoEqn.H:10
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"))