pEqn.H 1.18 KB
Newer Older
1
2
3
4
{
    volScalarField rAU = 1.0/UEqn.A();
    surfaceScalarField rAUf = fvc::interpolate(rAU);

5
    U = rAU*UEqn.H();
6
    surfaceScalarField phiU("phiU", (fvc::interpolate(U) & mesh.Sf()));
7
8

    phi = phiU +
9
10
11
12
    (
        fvc::interpolate(interface.sigmaK())*fvc::snGrad(gamma)
      - ghf*fvc::snGrad(rho)
    )*rAUf*mesh.magSf();
13
14
15

    if (pd.needReference())
    {
16
17
18
        fvc::makeRelative(phi, U);
        adjustPhi(phi, U, pd);
        fvc::makeAbsolute(phi, U);
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
    }

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

        pdEqn.setReference(pdRefCell, pdRefValue);

        if (corr == nCorr-1 && nonOrth == nNonOrthCorr)
        {
            pdEqn.solve(mesh.solver(pd.name() + "Final"));
        }
        else
        {
            pdEqn.solve(mesh.solver(pd.name()));
        }

        if (nonOrth == nNonOrthCorr)
        {
            phi -= pdEqn.flux();
        }
    }

    U += rAU*fvc::reconstruct((phi - phiU)/rAUf);
    U.correctBoundaryConditions();

48
49
    #include "continuityErrs.H"

50
51
52
    // Make the fluxes relative to the mesh motion
    fvc::makeRelative(phi, U);
}