This repository has been archived on 2023-11-20. You can view files and clone it, but cannot push or open issues or pull requests.
foam-extend4.1-coherent-io/applications/solvers/coupled/conjugateHeatFoam/pEqn.H

47 lines
1.2 KiB
C++
Raw Normal View History

{
volScalarField rUA("rUA", 1.0/UEqn.A());
surfaceScalarField rUAf("(1|A(U))", fvc::interpolate(rUA));
U = rUA*UEqn.H();
phi = (fvc::interpolate(U) & mesh.Sf())
+ fvc::ddtPhiCorr(rUA, U, phi);
surfaceScalarField buoyancyPhi(rUAf*ghf*fvc::snGrad(rhok)*mesh.magSf());
phi -= buoyancyPhi;
while (piso.correctNonOrthogonal())
{
fvScalarMatrix p_rghEqn
(
fvm::laplacian(rUAf, p_rgh) == fvc::div(phi)
);
p_rghEqn.setReference(pRefCell, pRefValue);
p_rghEqn.solve
(
mesh.solutionDict().solver
(
p_rgh.select(piso.finalInnerIter())
)
);
if (piso.finalNonOrthogonalIter())
{
// Calculate the conservative fluxes
phi -= p_rghEqn.flux();
// Explicitly relax pressure for momentum corrector
p_rgh.relax();
// Correct the momentum source with the pressure gradient flux
// calculated from the relaxed pressure
U -= rUA*fvc::reconstruct((buoyancyPhi + p_rghEqn.flux())/rUAf);
U.correctBoundaryConditions();
}
}
#include "continuityErrs.H"
}