mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
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:
@ -5,7 +5,7 @@ surfaceScalarField rhorAUf(rAU.name() + 'f', fvc::interpolate(rho*rAU));
|
|||||||
volVectorField HbyA("HbyA", U);
|
volVectorField HbyA("HbyA", U);
|
||||||
HbyA = rAU*UEqn.H();
|
HbyA = rAU*UEqn.H();
|
||||||
|
|
||||||
surfaceScalarField phig(rhorAUf*ghf*fvc::snGrad(rho)*mesh.magSf());
|
surfaceScalarField phig(-rhorAUf*ghf*fvc::snGrad(rho)*mesh.magSf());
|
||||||
|
|
||||||
surfaceScalarField phiHbyA
|
surfaceScalarField phiHbyA
|
||||||
(
|
(
|
||||||
@ -15,7 +15,7 @@ surfaceScalarField phiHbyA
|
|||||||
(fvc::interpolate(HbyA) & mesh.Sf())
|
(fvc::interpolate(HbyA) & mesh.Sf())
|
||||||
+ fvc::ddtPhiCorr(rAU, rho, U, phi)
|
+ fvc::ddtPhiCorr(rAU, rho, U, phi)
|
||||||
)
|
)
|
||||||
- phig
|
+ phig
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
@ -37,7 +37,7 @@ while (pimple.correctNonOrthogonal())
|
|||||||
if (pimple.finalNonOrthogonalIter())
|
if (pimple.finalNonOrthogonalIter())
|
||||||
{
|
{
|
||||||
phi = phiHbyA + p_rghEqn.flux();
|
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();
|
U.correctBoundaryConditions();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
HbyA = rAU*UEqn().H();
|
HbyA = rAU*UEqn().H();
|
||||||
UEqn.clear();
|
UEqn.clear();
|
||||||
|
|
||||||
surfaceScalarField phig(rAUf*ghf*fvc::snGrad(rhok)*mesh.magSf());
|
surfaceScalarField phig(-rAUf*ghf*fvc::snGrad(rhok)*mesh.magSf());
|
||||||
|
|
||||||
surfaceScalarField phiHbyA
|
surfaceScalarField phiHbyA
|
||||||
(
|
(
|
||||||
@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
adjustPhi(phiHbyA, U, p_rgh);
|
adjustPhi(phiHbyA, U, p_rgh);
|
||||||
|
|
||||||
phiHbyA -= phig;
|
phiHbyA += phig;
|
||||||
|
|
||||||
while (simple.correctNonOrthogonal())
|
while (simple.correctNonOrthogonal())
|
||||||
{
|
{
|
||||||
@ -39,7 +39,7 @@
|
|||||||
|
|
||||||
// Correct the momentum source with the pressure gradient flux
|
// Correct the momentum source with the pressure gradient flux
|
||||||
// calculated from the relaxed pressure
|
// 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();
|
U.correctBoundaryConditions();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -9,7 +9,7 @@
|
|||||||
HbyA = rAU*UEqn().H();
|
HbyA = rAU*UEqn().H();
|
||||||
UEqn.clear();
|
UEqn.clear();
|
||||||
|
|
||||||
surfaceScalarField phig(rhorAUf*ghf*fvc::snGrad(rho)*mesh.magSf());
|
surfaceScalarField phig(-rhorAUf*ghf*fvc::snGrad(rho)*mesh.magSf());
|
||||||
|
|
||||||
surfaceScalarField phiHbyA
|
surfaceScalarField phiHbyA
|
||||||
(
|
(
|
||||||
@ -19,7 +19,7 @@
|
|||||||
|
|
||||||
bool closedVolume = adjustPhi(phiHbyA, U, p_rgh);
|
bool closedVolume = adjustPhi(phiHbyA, U, p_rgh);
|
||||||
|
|
||||||
phiHbyA -= phig;
|
phiHbyA += phig;
|
||||||
|
|
||||||
while (simple.correctNonOrthogonal())
|
while (simple.correctNonOrthogonal())
|
||||||
{
|
{
|
||||||
@ -41,7 +41,7 @@
|
|||||||
|
|
||||||
// Correct the momentum source with the pressure gradient flux
|
// Correct the momentum source with the pressure gradient flux
|
||||||
// calculated from the relaxed pressure
|
// 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();
|
U.correctBoundaryConditions();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -5,7 +5,7 @@ surfaceScalarField rhorAUf(rAU.name() + 'f', fvc::interpolate(rho*rAU));
|
|||||||
volVectorField HbyA("HbyA", U);
|
volVectorField HbyA("HbyA", U);
|
||||||
HbyA = rAU*UEqn.H();
|
HbyA = rAU*UEqn.H();
|
||||||
|
|
||||||
surfaceScalarField phig(rhorAUf*ghf*fvc::snGrad(rho)*mesh.magSf());
|
surfaceScalarField phig(-rhorAUf*ghf*fvc::snGrad(rho)*mesh.magSf());
|
||||||
|
|
||||||
surfaceScalarField phiHbyA
|
surfaceScalarField phiHbyA
|
||||||
(
|
(
|
||||||
@ -15,7 +15,7 @@ surfaceScalarField phiHbyA
|
|||||||
(fvc::interpolate(HbyA) & mesh.Sf())
|
(fvc::interpolate(HbyA) & mesh.Sf())
|
||||||
+ fvc::ddtPhiCorr(rAU, rho, U, phi)
|
+ fvc::ddtPhiCorr(rAU, rho, U, phi)
|
||||||
)
|
)
|
||||||
- phig
|
+ phig
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
@ -37,7 +37,7 @@ while (pimple.correctNonOrthogonal())
|
|||||||
if (pimple.finalNonOrthogonalIter())
|
if (pimple.finalNonOrthogonalIter())
|
||||||
{
|
{
|
||||||
phi = phiHbyA + p_rghEqn.flux();
|
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();
|
U.correctBoundaryConditions();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user