rhoSimplecFoam: Added coupled-patch handling to H1 to support parallel running

This commit is contained in:
Henry
2012-05-02 10:53:29 +01:00
parent 687232488f
commit ac9203e1b8
8 changed files with 123 additions and 64 deletions

View File

@ -54,7 +54,8 @@ else
{
fvScalarMatrix pEqn
(
fvm::laplacian(rho*rAU, p) == fvc::div(phiHbyA)
fvc::div(phiHbyA)
- fvm::laplacian(rho*rAU, p)
);
pEqn.setReference(pRefCell, pRefValue);
@ -63,7 +64,7 @@ else
if (simple.finalNonOrthogonalIter())
{
phi = phiHbyA - pEqn.flux();
phi = phiHbyA + pEqn.flux();
}
}
}
@ -88,5 +89,10 @@ if (closedVolume)
rho = thermo.rho();
rho = max(rho, rhoMin);
rho = min(rho, rhoMax);
rho.relax();
if (!simple.transonic())
{
rho.relax();
}
Info<< "rho max/min : " << max(rho).value() << " " << min(rho).value() << endl;

View File

@ -3,8 +3,6 @@ rho = max(rho, rhoMin);
rho = min(rho, rhoMax);
rho.relax();
volScalarField p0(p);
volScalarField AU(UEqn().A());
volScalarField AtU(AU - UEqn().H1());
@ -22,7 +20,7 @@ if (simple.transonic())
surfaceScalarField phid
(
"phid",
fvc::interpolate(psi*HbyA) & mesh.Sf()
fvc::interpolate(psi)*(fvc::interpolate(HbyA) & mesh.Sf())
);
surfaceScalarField phic
@ -31,6 +29,8 @@ if (simple.transonic())
fvc::interpolate(rho/AtU - rho/AU)*fvc::snGrad(p)*mesh.magSf()
);
HbyA -= fvc::grad(p)*(1.0/AU - 1.0/AtU);
fvScalarMatrix pEqn
(
fvm::div(phid, p)
@ -58,11 +58,15 @@ else
surfaceScalarField phiHbyA
(
"phiHbyA",
fvc::interpolate(rho*HbyA) & mesh.Sf()
fvc::interpolate(rho)*fvc::interpolate(HbyA) & mesh.Sf()
);
closedVolume = adjustPhi(phi, U, p);
phi += fvc::interpolate(rho/AtU - rho/AU)*fvc::snGrad(p)*mesh.magSf();
closedVolume = adjustPhi(phiHbyA, U, p);
phiHbyA +=
fvc::interpolate(rho/AtU - rho/AU)*fvc::snGrad(p)*mesh.magSf();
HbyA -= fvc::grad(p)*(1.0/AU - 1.0/AtU);
fvScalarMatrix pEqn
(
@ -88,9 +92,7 @@ else
// Explicitly relax pressure for momentum corrector
p.relax();
U = HbyA - (fvc::grad(p0)*(1.0/AU - 1.0/AtU) + fvc::grad(p)/AtU);
//U = HbyA - fvc::grad(p)/AU;
U = HbyA - fvc::grad(p)/AtU;
U.correctBoundaryConditions();
// For closed-volume cases adjust the pressure and density levels