Buoyant solvers: changed the sign of phig to be consistent with the sign of the buoyancy force on the RHS of UEqn

This commit is contained in:
Henry
2012-04-19 10:08:59 +01:00
parent 59f63768d6
commit 70595a9a61
4 changed files with 12 additions and 12 deletions

View File

@ -5,7 +5,7 @@ surfaceScalarField rhorAUf(rAU.name() + 'f', fvc::interpolate(rho*rAU));
volVectorField HbyA("HbyA", U);
HbyA = rAU*UEqn.H();
surfaceScalarField phig(rhorAUf*ghf*fvc::snGrad(rho)*mesh.magSf());
surfaceScalarField phig(-rhorAUf*ghf*fvc::snGrad(rho)*mesh.magSf());
surfaceScalarField phiHbyA
(
@ -15,7 +15,7 @@ surfaceScalarField phiHbyA
(fvc::interpolate(HbyA) & mesh.Sf())
+ fvc::ddtPhiCorr(rAU, rho, U, phi)
)
- phig
+ phig
);
@ -37,7 +37,7 @@ while (pimple.correctNonOrthogonal())
if (pimple.finalNonOrthogonalIter())
{
phi = phiHbyA + p_rghEqn.flux();
U = HbyA + rAU*fvc::reconstruct((p_rghEqn.flux() - phig)/rhorAUf);
U = HbyA + rAU*fvc::reconstruct((p_rghEqn.flux() + phig)/rhorAUf);
U.correctBoundaryConditions();
}
}

View File

@ -6,7 +6,7 @@
HbyA = rAU*UEqn().H();
UEqn.clear();
surfaceScalarField phig(rAUf*ghf*fvc::snGrad(rhok)*mesh.magSf());
surfaceScalarField phig(-rAUf*ghf*fvc::snGrad(rhok)*mesh.magSf());
surfaceScalarField phiHbyA
(
@ -16,7 +16,7 @@
adjustPhi(phiHbyA, U, p_rgh);
phiHbyA -= phig;
phiHbyA += phig;
while (simple.correctNonOrthogonal())
{
@ -39,7 +39,7 @@
// Correct the momentum source with the pressure gradient flux
// calculated from the relaxed pressure
U = HbyA - rAU*fvc::reconstruct((phig + p_rghEqn.flux())/rAUf);
U = HbyA + rAU*fvc::reconstruct((phig - p_rghEqn.flux())/rAUf);
U.correctBoundaryConditions();
}
}

View File

@ -9,7 +9,7 @@
HbyA = rAU*UEqn().H();
UEqn.clear();
surfaceScalarField phig(rhorAUf*ghf*fvc::snGrad(rho)*mesh.magSf());
surfaceScalarField phig(-rhorAUf*ghf*fvc::snGrad(rho)*mesh.magSf());
surfaceScalarField phiHbyA
(
@ -19,7 +19,7 @@
bool closedVolume = adjustPhi(phiHbyA, U, p_rgh);
phiHbyA -= phig;
phiHbyA += phig;
while (simple.correctNonOrthogonal())
{
@ -41,7 +41,7 @@
// Correct the momentum source with the pressure gradient flux
// calculated from the relaxed pressure
U = HbyA - rAU*fvc::reconstruct((phig + p_rghEqn.flux())/rhorAUf);
U = HbyA + rAU*fvc::reconstruct((phig - p_rghEqn.flux())/rhorAUf);
U.correctBoundaryConditions();
}
}

View File

@ -5,7 +5,7 @@ surfaceScalarField rhorAUf(rAU.name() + 'f', fvc::interpolate(rho*rAU));
volVectorField HbyA("HbyA", U);
HbyA = rAU*UEqn.H();
surfaceScalarField phig(rhorAUf*ghf*fvc::snGrad(rho)*mesh.magSf());
surfaceScalarField phig(-rhorAUf*ghf*fvc::snGrad(rho)*mesh.magSf());
surfaceScalarField phiHbyA
(
@ -15,7 +15,7 @@ surfaceScalarField phiHbyA
(fvc::interpolate(HbyA) & mesh.Sf())
+ fvc::ddtPhiCorr(rAU, rho, U, phi)
)
- phig
+ phig
);
@ -37,7 +37,7 @@ while (pimple.correctNonOrthogonal())
if (pimple.finalNonOrthogonalIter())
{
phi = phiHbyA + p_rghEqn.flux();
U = HbyA + rAU*fvc::reconstruct((p_rghEqn.flux() - phig)/rhorAUf);
U = HbyA + rAU*fvc::reconstruct((p_rghEqn.flux() + phig)/rhorAUf);
U.correctBoundaryConditions();
}
}