mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
pimpleDyMFoam: Corrected caching of rUA/rAU
This commit is contained in:
@ -9,7 +9,7 @@ tmp<fvVectorMatrix> UEqn
|
|||||||
|
|
||||||
UEqn().relax();
|
UEqn().relax();
|
||||||
|
|
||||||
volScalarField rUA = 1.0/UEqn().A();
|
volScalarField rAU = 1.0/UEqn().A();
|
||||||
|
|
||||||
if (momentumPredictor)
|
if (momentumPredictor)
|
||||||
{
|
{
|
||||||
@ -17,6 +17,6 @@ if (momentumPredictor)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
U = rUA*(UEqn().H() - fvc::grad(p));
|
U = rAU*(UEqn().H() - fvc::grad(p));
|
||||||
U.correctBoundaryConditions();
|
U.correctBoundaryConditions();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
U = rUA*UEqn().H();
|
U = rAU*UEqn().H();
|
||||||
|
|
||||||
if (nCorr <= 1)
|
if (nCorr <= 1)
|
||||||
{
|
{
|
||||||
@ -6,7 +6,7 @@ if (nCorr <= 1)
|
|||||||
}
|
}
|
||||||
|
|
||||||
phi = (fvc::interpolate(U) & mesh.Sf())
|
phi = (fvc::interpolate(U) & mesh.Sf())
|
||||||
+ fvc::ddtPhiCorr(rUA, U, phi);
|
+ fvc::ddtPhiCorr(rAU, U, phi);
|
||||||
|
|
||||||
adjustPhi(phi, U, p);
|
adjustPhi(phi, U, p);
|
||||||
|
|
||||||
@ -16,7 +16,7 @@ for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
|
|||||||
// Pressure corrector
|
// Pressure corrector
|
||||||
fvScalarMatrix pEqn
|
fvScalarMatrix pEqn
|
||||||
(
|
(
|
||||||
fvm::laplacian(rUA, p) == fvc::div(phi)
|
fvm::laplacian(rAU, p) == fvc::div(phi)
|
||||||
);
|
);
|
||||||
|
|
||||||
pEqn.setReference(pRefCell, pRefValue);
|
pEqn.setReference(pRefCell, pRefValue);
|
||||||
@ -47,5 +47,5 @@ for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
|
|||||||
// Explicitly relax pressure for momentum corrector
|
// Explicitly relax pressure for momentum corrector
|
||||||
p.relax();
|
p.relax();
|
||||||
|
|
||||||
U -= rUA*fvc::grad(p);
|
U -= rAU*fvc::grad(p);
|
||||||
U.correctBoundaryConditions();
|
U.correctBoundaryConditions();
|
||||||
|
|||||||
@ -27,7 +27,7 @@
|
|||||||
mesh
|
mesh
|
||||||
);
|
);
|
||||||
|
|
||||||
# include "createPhi.H"
|
#include "createPhi.H"
|
||||||
|
|
||||||
|
|
||||||
label pRefCell = 0;
|
label pRefCell = 0;
|
||||||
|
|||||||
@ -46,6 +46,7 @@ for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
|
|||||||
|
|
||||||
#include "continuityErrs.H"
|
#include "continuityErrs.H"
|
||||||
|
|
||||||
|
// Explicitly relax pressure for momentum corrector
|
||||||
p.relax();
|
p.relax();
|
||||||
|
|
||||||
// Make the fluxes relative to the mesh motion
|
// Make the fluxes relative to the mesh motion
|
||||||
|
|||||||
@ -21,7 +21,7 @@ solvers
|
|||||||
{
|
{
|
||||||
solver PCG;
|
solver PCG;
|
||||||
preconditioner DIC;
|
preconditioner DIC;
|
||||||
tolerance 0.01;
|
tolerance 0.02;
|
||||||
relTol 0;
|
relTol 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -30,7 +30,7 @@ solvers
|
|||||||
solver PCG;
|
solver PCG;
|
||||||
preconditioner DIC;
|
preconditioner DIC;
|
||||||
tolerance 1e-06;
|
tolerance 1e-06;
|
||||||
relTol 0.05;
|
relTol 0.01;
|
||||||
}
|
}
|
||||||
|
|
||||||
pFinal
|
pFinal
|
||||||
@ -66,10 +66,16 @@ solvers
|
|||||||
|
|
||||||
PIMPLE
|
PIMPLE
|
||||||
{
|
{
|
||||||
|
correctPhi yes;
|
||||||
nOuterCorrectors 2;
|
nOuterCorrectors 2;
|
||||||
nCorrectors 1;
|
nCorrectors 1;
|
||||||
nNonOrthogonalCorrectors 0;
|
nNonOrthogonalCorrectors 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
relaxationFactors
|
||||||
|
{
|
||||||
|
U 1;
|
||||||
|
UFinal 1;
|
||||||
|
}
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
Reference in New Issue
Block a user