pdEqn.H 942 Bytes
Newer Older
Andrew Heather's avatar
Andrew Heather committed
1
2
3
4
5
6
7
{
    volScalarField rUA("rUA", 1.0/UEqn().A());
    surfaceScalarField rUAf("(1|A(U))", fvc::interpolate(rUA));

    U = rUA*UEqn().H();
    UEqn.clear();

Andrew Heather's avatar
update    
Andrew Heather committed
8
9
    surfaceScalarField phiU
    (
Andrew Heather's avatar
Andrew Heather committed
10
11
        (fvc::interpolate(U) & mesh.Sf())
      + fvc::ddtPhiCorr(rUA, U, phi)
Andrew Heather's avatar
update    
Andrew Heather committed
12
13
14
    );

    phi = phiU + betaghf*fvc::snGrad(T)*rUAf*mesh.magSf();
Andrew Heather's avatar
Andrew Heather committed
15
16
17
18
19
20
21
22

    for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
    {
        fvScalarMatrix pdEqn
        (
            fvm::laplacian(rUAf, pd) == fvc::div(phi)
        );

Andrew Heather's avatar
update    
Andrew Heather committed
23
        if (corr == nCorr-1 && nonOrth == nNonOrthCorr)
Andrew Heather's avatar
Andrew Heather committed
24
25
26
27
28
29
30
31
32
33
        {
            pdEqn.solve(mesh.solver(pd.name() + "Final"));
        }
        else
        {
            pdEqn.solve(mesh.solver(pd.name()));
        }

        if (nonOrth == nNonOrthCorr)
        {
Andrew Heather's avatar
update    
Andrew Heather committed
34
            phi += pdEqn.flux();
Andrew Heather's avatar
Andrew Heather committed
35
36
37
        }
    }

Andrew Heather's avatar
update    
Andrew Heather committed
38
39
40
    U -= rUA*fvc::reconstruct((phi - phiU)/rUAf);
    U.correctBoundaryConditions();

Andrew Heather's avatar
Andrew Heather committed
41
42
    #include "continuityErrs.H"
}