mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Merge branch 'master' of /home/dm4/OpenFOAM/OpenFOAM-dev
This commit is contained in:
@ -86,7 +86,7 @@ int main(int argc, char *argv[])
|
|||||||
for (int corr=1; corr<=1; corr++)
|
for (int corr=1; corr<=1; corr++)
|
||||||
{
|
{
|
||||||
volScalarField rAU(1.0/UEqn.A());
|
volScalarField rAU(1.0/UEqn.A());
|
||||||
surfaceScalarField Dp("Dp", fvc::interpolate(rAU));
|
surfaceScalarField rAUf("rAUf", fvc::interpolate(rAU));
|
||||||
volVectorField HbyA("HbyA", U);
|
volVectorField HbyA("HbyA", U);
|
||||||
HbyA = rAU*UEqn.H();
|
HbyA = rAU*UEqn.H();
|
||||||
|
|
||||||
@ -94,12 +94,12 @@ int main(int argc, char *argv[])
|
|||||||
(
|
(
|
||||||
"phiHbyA",
|
"phiHbyA",
|
||||||
(fvc::interpolate(HbyA) & mesh.Sf())
|
(fvc::interpolate(HbyA) & mesh.Sf())
|
||||||
+ Dp*fvc::ddtCorr(U, phi)
|
+ rAUf*fvc::ddtCorr(U, phi)
|
||||||
);
|
);
|
||||||
|
|
||||||
fvScalarMatrix pEqn
|
fvScalarMatrix pEqn
|
||||||
(
|
(
|
||||||
fvm::laplacian(Dp, p) == fvc::div(phiHbyA)
|
fvm::laplacian(rAUf, p) == fvc::div(phiHbyA)
|
||||||
);
|
);
|
||||||
|
|
||||||
pEqn.solve();
|
pEqn.solve();
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
rho = thermo.rho();
|
rho = thermo.rho();
|
||||||
|
|
||||||
volScalarField rAU(1.0/UEqn.A());
|
volScalarField rAU(1.0/UEqn.A());
|
||||||
surfaceScalarField Dp("Dp", fvc::interpolate(rho*rAU));
|
surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho*rAU));
|
||||||
|
|
||||||
volVectorField HbyA("HbyA", U);
|
volVectorField HbyA("HbyA", U);
|
||||||
HbyA = rAU*UEqn.H();
|
HbyA = rAU*UEqn.H();
|
||||||
@ -14,7 +14,7 @@ if (pimple.transonic())
|
|||||||
fvc::interpolate(psi)
|
fvc::interpolate(psi)
|
||||||
*(
|
*(
|
||||||
(fvc::interpolate(rho*HbyA) & mesh.Sf())
|
(fvc::interpolate(rho*HbyA) & mesh.Sf())
|
||||||
+ Dp*fvc::ddtCorr(rho, U, phi)
|
+ rhorAUf*fvc::ddtCorr(rho, U, phi)
|
||||||
)/fvc::interpolate(rho)
|
)/fvc::interpolate(rho)
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -26,7 +26,7 @@ if (pimple.transonic())
|
|||||||
(
|
(
|
||||||
fvm::ddt(psi, p)
|
fvm::ddt(psi, p)
|
||||||
+ fvm::div(phid, p)
|
+ fvm::div(phid, p)
|
||||||
- fvm::laplacian(Dp, p)
|
- fvm::laplacian(rhorAUf, p)
|
||||||
==
|
==
|
||||||
fvOptions(psi, p, rho.name())
|
fvOptions(psi, p, rho.name())
|
||||||
);
|
);
|
||||||
@ -48,7 +48,7 @@ else
|
|||||||
"phiHbyA",
|
"phiHbyA",
|
||||||
(
|
(
|
||||||
(fvc::interpolate(rho*HbyA) & mesh.Sf())
|
(fvc::interpolate(rho*HbyA) & mesh.Sf())
|
||||||
+ Dp*fvc::ddtCorr(rho, U, phi)
|
+ rhorAUf*fvc::ddtCorr(rho, U, phi)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -60,7 +60,7 @@ else
|
|||||||
(
|
(
|
||||||
fvm::ddt(psi, p)
|
fvm::ddt(psi, p)
|
||||||
+ fvc::div(phiHbyA)
|
+ fvc::div(phiHbyA)
|
||||||
- fvm::laplacian(Dp, p)
|
- fvm::laplacian(rhorAUf, p)
|
||||||
==
|
==
|
||||||
fvOptions(psi, p, rho.name())
|
fvOptions(psi, p, rho.name())
|
||||||
);
|
);
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
rho = thermo.rho();
|
rho = thermo.rho();
|
||||||
|
|
||||||
volScalarField rAU(1.0/UEqn.A());
|
volScalarField rAU(1.0/UEqn.A());
|
||||||
surfaceScalarField Dp("Dp", fvc::interpolate(rho*rAU));
|
surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho*rAU));
|
||||||
|
|
||||||
volVectorField HbyA("HbyA", U);
|
volVectorField HbyA("HbyA", U);
|
||||||
HbyA = rAU*UEqn.H();
|
HbyA = rAU*UEqn.H();
|
||||||
@ -15,7 +15,7 @@ if (pimple.transonic())
|
|||||||
*(
|
*(
|
||||||
(
|
(
|
||||||
(fvc::interpolate(rho*HbyA) & mesh.Sf())
|
(fvc::interpolate(rho*HbyA) & mesh.Sf())
|
||||||
//***HGW + Dp*fvc::ddtCorr(rho, U, phi)
|
//***HGW + rhorAUf*fvc::ddtCorr(rho, U, phi)
|
||||||
)/fvc::interpolate(rho)
|
)/fvc::interpolate(rho)
|
||||||
- fvc::meshPhi(rho, U)
|
- fvc::meshPhi(rho, U)
|
||||||
)
|
)
|
||||||
@ -51,7 +51,7 @@ else
|
|||||||
"phiHbyA",
|
"phiHbyA",
|
||||||
(
|
(
|
||||||
(fvc::interpolate(rho*HbyA) & mesh.Sf())
|
(fvc::interpolate(rho*HbyA) & mesh.Sf())
|
||||||
//***HGW + Dp*fvc::ddtCorr(rho, U, phi)
|
//***HGW + rhorAUf*fvc::ddtCorr(rho, U, phi)
|
||||||
)
|
)
|
||||||
- fvc::interpolate(rho)*fvc::meshPhi(rho, U)
|
- fvc::interpolate(rho)*fvc::meshPhi(rho, U)
|
||||||
);
|
);
|
||||||
|
|||||||
@ -41,6 +41,7 @@ Description
|
|||||||
#include "psiCombustionModel.H"
|
#include "psiCombustionModel.H"
|
||||||
#include "pimpleControl.H"
|
#include "pimpleControl.H"
|
||||||
#include "fvIOoptionList.H"
|
#include "fvIOoptionList.H"
|
||||||
|
#include "fixedFluxPressureFvPatchScalarField.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
|||||||
@ -1,27 +1,35 @@
|
|||||||
rho = thermo.rho();
|
rho = thermo.rho();
|
||||||
|
|
||||||
volScalarField rAU(1.0/UEqn.A());
|
volScalarField rAU(1.0/UEqn.A());
|
||||||
surfaceScalarField Dp("Dp", fvc::interpolate(rho*rAU));
|
surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho*rAU));
|
||||||
|
|
||||||
volVectorField HbyA("HbyA", U);
|
volVectorField HbyA("HbyA", U);
|
||||||
HbyA = rAU*UEqn.H();
|
HbyA = rAU*UEqn.H();
|
||||||
phi.boundaryField() =
|
|
||||||
fvc::interpolate(rho.boundaryField()*U.boundaryField())
|
|
||||||
& mesh.Sf().boundaryField();
|
|
||||||
|
|
||||||
surfaceScalarField phig(-Dp*ghf*fvc::snGrad(rho)*mesh.magSf());
|
surfaceScalarField phig(-rhorAUf*ghf*fvc::snGrad(rho)*mesh.magSf());
|
||||||
|
|
||||||
surfaceScalarField phiHbyA
|
surfaceScalarField phiHbyA
|
||||||
(
|
(
|
||||||
"phiHbyA",
|
"phiHbyA",
|
||||||
(
|
(
|
||||||
(fvc::interpolate(rho*HbyA) & mesh.Sf())
|
(fvc::interpolate(rho*HbyA) & mesh.Sf())
|
||||||
+ Dp*fvc::ddtCorr(rho, U, phi)
|
+ rhorAUf*fvc::ddtCorr(rho, U, phi)
|
||||||
)
|
)
|
||||||
+ phig
|
+ phig
|
||||||
);
|
);
|
||||||
|
|
||||||
fvOptions.makeRelative(phiHbyA);
|
fvOptions.makeRelative(fvc::interpolate(rho), phiHbyA);
|
||||||
|
|
||||||
|
// Update the fixedFluxPressure BCs to ensure flux consistency
|
||||||
|
setSnGrad<fixedFluxPressureFvPatchScalarField>
|
||||||
|
(
|
||||||
|
p_rgh.boundaryField(),
|
||||||
|
(
|
||||||
|
phiHbyA.boundaryField()
|
||||||
|
- fvOptions.relative(mesh.Sf().boundaryField() & U.boundaryField())
|
||||||
|
*rho.boundaryField()
|
||||||
|
)/(mesh.magSf().boundaryField()*rhorAUf.boundaryField())
|
||||||
|
);
|
||||||
|
|
||||||
while (pimple.correctNonOrthogonal())
|
while (pimple.correctNonOrthogonal())
|
||||||
{
|
{
|
||||||
@ -30,7 +38,7 @@ while (pimple.correctNonOrthogonal())
|
|||||||
fvc::ddt(psi, rho)*gh
|
fvc::ddt(psi, rho)*gh
|
||||||
+ fvc::div(phiHbyA)
|
+ fvc::div(phiHbyA)
|
||||||
+ fvm::ddt(psi, p_rgh)
|
+ fvm::ddt(psi, p_rgh)
|
||||||
- fvm::laplacian(Dp, p_rgh)
|
- fvm::laplacian(rhorAUf, p_rgh)
|
||||||
==
|
==
|
||||||
parcels.Srho()
|
parcels.Srho()
|
||||||
+ surfaceFilm.Srho()
|
+ surfaceFilm.Srho()
|
||||||
@ -44,7 +52,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)/Dp);
|
U = HbyA + rAU*fvc::reconstruct((p_rghEqn.flux() + phig)/rhorAUf);
|
||||||
U.correctBoundaryConditions();
|
U.correctBoundaryConditions();
|
||||||
fvOptions.correct(U);
|
fvOptions.correct(U);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
rho = thermo.rho();
|
rho = thermo.rho();
|
||||||
|
|
||||||
volScalarField rAU(1.0/UEqn.A());
|
volScalarField rAU(1.0/UEqn.A());
|
||||||
surfaceScalarField Dp("Dp", fvc::interpolate(rho*rAU));
|
surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho*rAU));
|
||||||
|
|
||||||
volVectorField HbyA("HbyA", U);
|
volVectorField HbyA("HbyA", U);
|
||||||
HbyA = rAU*UEqn.H();
|
HbyA = rAU*UEqn.H();
|
||||||
@ -14,7 +14,7 @@ if (pimple.transonic())
|
|||||||
fvc::interpolate(psi)
|
fvc::interpolate(psi)
|
||||||
*(
|
*(
|
||||||
(fvc::interpolate(rho*HbyA) & mesh.Sf())
|
(fvc::interpolate(rho*HbyA) & mesh.Sf())
|
||||||
+ Dp*fvc::ddtCorr(rho, U, phi)
|
+ rhorAUf*fvc::ddtCorr(rho, U, phi)
|
||||||
)/fvc::interpolate(rho)
|
)/fvc::interpolate(rho)
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -48,7 +48,7 @@ else
|
|||||||
"phiHbyA",
|
"phiHbyA",
|
||||||
(
|
(
|
||||||
(fvc::interpolate(rho*HbyA) & mesh.Sf())
|
(fvc::interpolate(rho*HbyA) & mesh.Sf())
|
||||||
+ Dp*fvc::ddtCorr(rho, U, phi)
|
+ rhorAUf*fvc::ddtCorr(rho, U, phi)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@ -6,25 +6,36 @@
|
|||||||
thermo.rho() -= psi*p;
|
thermo.rho() -= psi*p;
|
||||||
|
|
||||||
volScalarField rAU(1.0/UEqn.A());
|
volScalarField rAU(1.0/UEqn.A());
|
||||||
surfaceScalarField Dp("Dp", fvc::interpolate(rho*rAU));
|
surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho*rAU));
|
||||||
|
|
||||||
volVectorField HbyA("HbyA", U);
|
volVectorField HbyA("HbyA", U);
|
||||||
HbyA = rAU*UEqn.H();
|
HbyA = rAU*UEqn.H();
|
||||||
|
|
||||||
surfaceScalarField phig(-Dp*ghf*fvc::snGrad(rho)*mesh.magSf());
|
surfaceScalarField phig(-rhorAUf*ghf*fvc::snGrad(rho)*mesh.magSf());
|
||||||
|
|
||||||
surfaceScalarField phiHbyA
|
surfaceScalarField phiHbyA
|
||||||
(
|
(
|
||||||
"phiHbyA",
|
"phiHbyA",
|
||||||
(
|
(
|
||||||
(fvc::interpolate(rho*HbyA) & mesh.Sf())
|
(fvc::interpolate(rho*HbyA) & mesh.Sf())
|
||||||
+ Dp*fvc::ddtCorr(rho, U, phi)
|
+ rhorAUf*fvc::ddtCorr(rho, U, phi)
|
||||||
)
|
)
|
||||||
+ phig
|
+ phig
|
||||||
);
|
);
|
||||||
|
|
||||||
fvOptions.makeRelative(fvc::interpolate(rho), phiHbyA);
|
fvOptions.makeRelative(fvc::interpolate(rho), phiHbyA);
|
||||||
|
|
||||||
|
// Update the fixedFluxPressure BCs to ensure flux consistency
|
||||||
|
setSnGrad<fixedFluxPressureFvPatchScalarField>
|
||||||
|
(
|
||||||
|
p_rgh.boundaryField(),
|
||||||
|
(
|
||||||
|
phiHbyA.boundaryField()
|
||||||
|
- fvOptions.relative(mesh.Sf().boundaryField() & U.boundaryField())
|
||||||
|
*rho.boundaryField()
|
||||||
|
)/(mesh.magSf().boundaryField()*rhorAUf.boundaryField())
|
||||||
|
);
|
||||||
|
|
||||||
fvScalarMatrix p_rghDDtEqn
|
fvScalarMatrix p_rghDDtEqn
|
||||||
(
|
(
|
||||||
fvc::ddt(rho) + psi*correction(fvm::ddt(p_rgh))
|
fvc::ddt(rho) + psi*correction(fvm::ddt(p_rgh))
|
||||||
@ -38,7 +49,7 @@
|
|||||||
fvScalarMatrix p_rghEqn
|
fvScalarMatrix p_rghEqn
|
||||||
(
|
(
|
||||||
p_rghDDtEqn
|
p_rghDDtEqn
|
||||||
- fvm::laplacian(Dp, p_rgh)
|
- fvm::laplacian(rhorAUf, p_rgh)
|
||||||
);
|
);
|
||||||
|
|
||||||
fvOptions.constrain(p_rghEqn);
|
fvOptions.constrain(p_rghEqn);
|
||||||
@ -55,7 +66,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())/Dp);
|
U = HbyA + rAU*fvc::reconstruct((phig + p_rghEqn.flux())/rhorAUf);
|
||||||
U.correctBoundaryConditions();
|
U.correctBoundaryConditions();
|
||||||
fvOptions.correct(U);
|
fvOptions.correct(U);
|
||||||
K = 0.5*magSqr(U);
|
K = 0.5*magSqr(U);
|
||||||
|
|||||||
@ -36,6 +36,7 @@ Description
|
|||||||
#include "multivariateScheme.H"
|
#include "multivariateScheme.H"
|
||||||
#include "pimpleControl.H"
|
#include "pimpleControl.H"
|
||||||
#include "fvIOoptionList.H"
|
#include "fvIOoptionList.H"
|
||||||
|
#include "fixedFluxPressureFvPatchScalarField.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
thermo.rho() -= psi*p;
|
thermo.rho() -= psi*p;
|
||||||
|
|
||||||
volScalarField rAU(1.0/UEqn.A());
|
volScalarField rAU(1.0/UEqn.A());
|
||||||
surfaceScalarField Dp("Dp", fvc::interpolate(rho*rAU));
|
surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho*rAU));
|
||||||
|
|
||||||
volVectorField HbyA("HbyA", U);
|
volVectorField HbyA("HbyA", U);
|
||||||
HbyA = rAU*UEqn.H();
|
HbyA = rAU*UEqn.H();
|
||||||
@ -18,7 +18,7 @@
|
|||||||
"phiHbyA",
|
"phiHbyA",
|
||||||
(
|
(
|
||||||
(fvc::interpolate(rho*HbyA) & mesh.Sf())
|
(fvc::interpolate(rho*HbyA) & mesh.Sf())
|
||||||
+ Dp*fvc::ddtCorr(rho, U, phi)
|
+ rhorAUf*fvc::ddtCorr(rho, U, phi)
|
||||||
)/fvc::interpolate(rho)
|
)/fvc::interpolate(rho)
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -39,7 +39,7 @@
|
|||||||
fvScalarMatrix pEqn
|
fvScalarMatrix pEqn
|
||||||
(
|
(
|
||||||
pDDtEqn
|
pDDtEqn
|
||||||
- fvm::laplacian(Dp, p)
|
- fvm::laplacian(rhorAUf, p)
|
||||||
==
|
==
|
||||||
fvOptions(psi, p, rho.name())
|
fvOptions(psi, p, rho.name())
|
||||||
);
|
);
|
||||||
@ -61,7 +61,7 @@
|
|||||||
"phiHbyA",
|
"phiHbyA",
|
||||||
(
|
(
|
||||||
(fvc::interpolate(rho*HbyA) & mesh.Sf())
|
(fvc::interpolate(rho*HbyA) & mesh.Sf())
|
||||||
+ Dp*fvc::ddtCorr(rho, U, phi)
|
+ rhorAUf*fvc::ddtCorr(rho, U, phi)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -80,7 +80,7 @@
|
|||||||
fvScalarMatrix pEqn
|
fvScalarMatrix pEqn
|
||||||
(
|
(
|
||||||
pDDtEqn
|
pDDtEqn
|
||||||
- fvm::laplacian(Dp, p)
|
- fvm::laplacian(rhorAUf, p)
|
||||||
);
|
);
|
||||||
|
|
||||||
fvOptions.constrain(pEqn);
|
fvOptions.constrain(pEqn);
|
||||||
|
|||||||
@ -4,7 +4,7 @@ rho = min(rho, rhoMax);
|
|||||||
rho.relax();
|
rho.relax();
|
||||||
|
|
||||||
volScalarField rAU(1.0/UEqn().A());
|
volScalarField rAU(1.0/UEqn().A());
|
||||||
surfaceScalarField Dp("Dp", fvc::interpolate(rho*rAU));
|
surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho*rAU));
|
||||||
|
|
||||||
volVectorField HbyA("HbyA", U);
|
volVectorField HbyA("HbyA", U);
|
||||||
HbyA = rAU*UEqn().H();
|
HbyA = rAU*UEqn().H();
|
||||||
@ -22,7 +22,7 @@ if (pimple.transonic())
|
|||||||
fvc::interpolate(psi)
|
fvc::interpolate(psi)
|
||||||
*(
|
*(
|
||||||
(fvc::interpolate(rho*HbyA) & mesh.Sf())
|
(fvc::interpolate(rho*HbyA) & mesh.Sf())
|
||||||
+ Dp*fvc::ddtCorr(rho, U, phi)
|
+ rhorAUf*fvc::ddtCorr(rho, U, phi)
|
||||||
)/fvc::interpolate(rho)
|
)/fvc::interpolate(rho)
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -34,7 +34,7 @@ if (pimple.transonic())
|
|||||||
(
|
(
|
||||||
fvm::ddt(psi, p)
|
fvm::ddt(psi, p)
|
||||||
+ fvm::div(phid, p)
|
+ fvm::div(phid, p)
|
||||||
- fvm::laplacian(Dp, p)
|
- fvm::laplacian(rhorAUf, p)
|
||||||
==
|
==
|
||||||
fvOptions(psi, p, rho.name())
|
fvOptions(psi, p, rho.name())
|
||||||
);
|
);
|
||||||
@ -56,14 +56,12 @@ else
|
|||||||
"phiHbyA",
|
"phiHbyA",
|
||||||
(
|
(
|
||||||
(fvc::interpolate(rho*HbyA) & mesh.Sf())
|
(fvc::interpolate(rho*HbyA) & mesh.Sf())
|
||||||
+ Dp*fvc::ddtCorr(rho, U, phi)
|
+ rhorAUf*fvc::ddtCorr(rho, U, phi)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
fvOptions.makeRelative(fvc::interpolate(rho), phiHbyA);
|
fvOptions.makeRelative(fvc::interpolate(rho), phiHbyA);
|
||||||
|
|
||||||
volScalarField Dp("Dp", rho*rAU);
|
|
||||||
|
|
||||||
while (pimple.correctNonOrthogonal())
|
while (pimple.correctNonOrthogonal())
|
||||||
{
|
{
|
||||||
// Pressure corrector
|
// Pressure corrector
|
||||||
@ -71,7 +69,7 @@ else
|
|||||||
(
|
(
|
||||||
fvm::ddt(psi, p)
|
fvm::ddt(psi, p)
|
||||||
+ fvc::div(phiHbyA)
|
+ fvc::div(phiHbyA)
|
||||||
- fvm::laplacian(Dp, p)
|
- fvm::laplacian(rhorAUf, p)
|
||||||
==
|
==
|
||||||
fvOptions(psi, p, rho.name())
|
fvOptions(psi, p, rho.name())
|
||||||
);
|
);
|
||||||
|
|||||||
@ -4,7 +4,7 @@ rho = min(rho, rhoMax);
|
|||||||
rho.relax();
|
rho.relax();
|
||||||
|
|
||||||
volScalarField rAU(1.0/UEqn().A());
|
volScalarField rAU(1.0/UEqn().A());
|
||||||
surfaceScalarField Dp("Dp", fvc::interpolate(rho*rAU));
|
surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho*rAU));
|
||||||
|
|
||||||
volVectorField HbyA("HbyA", U);
|
volVectorField HbyA("HbyA", U);
|
||||||
HbyA = rAU*UEqn().H();
|
HbyA = rAU*UEqn().H();
|
||||||
@ -22,7 +22,7 @@ if (pimple.transonic())
|
|||||||
fvc::interpolate(psi)
|
fvc::interpolate(psi)
|
||||||
*(
|
*(
|
||||||
(fvc::interpolate(rho*HbyA) & mesh.Sf())
|
(fvc::interpolate(rho*HbyA) & mesh.Sf())
|
||||||
+ Dp*fvc::ddtCorr(rho, U, phiAbs)
|
+ rhorAUf*fvc::ddtCorr(rho, U, phiAbs)
|
||||||
)/fvc::interpolate(rho)
|
)/fvc::interpolate(rho)
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -34,7 +34,7 @@ if (pimple.transonic())
|
|||||||
(
|
(
|
||||||
fvm::ddt(psi, p)
|
fvm::ddt(psi, p)
|
||||||
+ fvm::div(phid, p)
|
+ fvm::div(phid, p)
|
||||||
- fvm::laplacian(Dp, p)
|
- fvm::laplacian(rhorAUf, p)
|
||||||
==
|
==
|
||||||
fvOptions(psi, p, rho.name())
|
fvOptions(psi, p, rho.name())
|
||||||
);
|
);
|
||||||
@ -55,7 +55,7 @@ else
|
|||||||
(
|
(
|
||||||
"phiHbyA",
|
"phiHbyA",
|
||||||
(fvc::interpolate(rho*HbyA) & mesh.Sf())
|
(fvc::interpolate(rho*HbyA) & mesh.Sf())
|
||||||
+ Dp*fvc::ddtCorr(rho, U, phiAbs)
|
+ rhorAUf*fvc::ddtCorr(rho, U, phiAbs)
|
||||||
);
|
);
|
||||||
|
|
||||||
fvOptions.makeRelative(fvc::interpolate(rho), phiHbyA);
|
fvOptions.makeRelative(fvc::interpolate(rho), phiHbyA);
|
||||||
@ -67,7 +67,7 @@ else
|
|||||||
(
|
(
|
||||||
fvm::ddt(psi, p)
|
fvm::ddt(psi, p)
|
||||||
+ fvc::div(phiHbyA)
|
+ fvc::div(phiHbyA)
|
||||||
- fvm::laplacian(Dp, p)
|
- fvm::laplacian(rhorAUf, p)
|
||||||
==
|
==
|
||||||
fvOptions(psi, p, rho.name())
|
fvOptions(psi, p, rho.name())
|
||||||
);
|
);
|
||||||
|
|||||||
@ -35,7 +35,7 @@ if (pimple.transonic())
|
|||||||
|
|
||||||
HbyA -= (rAU - rAtU)*fvc::grad(p);
|
HbyA -= (rAU - rAtU)*fvc::grad(p);
|
||||||
|
|
||||||
volScalarField Dp("Dp", rho*rAtU);
|
volScalarField rhorAtU("rhorAtU", rho*rAtU);
|
||||||
|
|
||||||
while (pimple.correctNonOrthogonal())
|
while (pimple.correctNonOrthogonal())
|
||||||
{
|
{
|
||||||
@ -44,7 +44,7 @@ if (pimple.transonic())
|
|||||||
fvm::ddt(psi, p)
|
fvm::ddt(psi, p)
|
||||||
+ fvm::div(phid, p)
|
+ fvm::div(phid, p)
|
||||||
+ fvc::div(phic)
|
+ fvc::div(phic)
|
||||||
- fvm::laplacian(Dp, p)
|
- fvm::laplacian(rhorAtU, p)
|
||||||
==
|
==
|
||||||
fvOptions(psi, p, rho.name())
|
fvOptions(psi, p, rho.name())
|
||||||
);
|
);
|
||||||
@ -75,7 +75,7 @@ else
|
|||||||
phiHbyA += fvc::interpolate(rho*(rAtU - rAU))*fvc::snGrad(p)*mesh.magSf();
|
phiHbyA += fvc::interpolate(rho*(rAtU - rAU))*fvc::snGrad(p)*mesh.magSf();
|
||||||
HbyA -= (rAU - rAtU)*fvc::grad(p);
|
HbyA -= (rAU - rAtU)*fvc::grad(p);
|
||||||
|
|
||||||
volScalarField Dp("Dp", rho*rAtU);
|
volScalarField rhorAtU("rhorAtU", rho*rAtU);
|
||||||
|
|
||||||
while (pimple.correctNonOrthogonal())
|
while (pimple.correctNonOrthogonal())
|
||||||
{
|
{
|
||||||
@ -83,7 +83,7 @@ else
|
|||||||
(
|
(
|
||||||
fvm::ddt(psi, p)
|
fvm::ddt(psi, p)
|
||||||
+ fvc::div(phiHbyA)
|
+ fvc::div(phiHbyA)
|
||||||
- fvm::laplacian(Dp, p)
|
- fvm::laplacian(rhorAtU, p)
|
||||||
==
|
==
|
||||||
fvOptions(psi, p, rho.name())
|
fvOptions(psi, p, rho.name())
|
||||||
);
|
);
|
||||||
|
|||||||
@ -26,7 +26,7 @@ if (simple.transonic())
|
|||||||
|
|
||||||
HbyA -= (rAU - rAtU)*fvc::grad(p);
|
HbyA -= (rAU - rAtU)*fvc::grad(p);
|
||||||
|
|
||||||
volScalarField Dp("Dp", rho*rAtU);
|
volScalarField rhorAtU("rhorAtU", rho*rAtU);
|
||||||
|
|
||||||
while (simple.correctNonOrthogonal())
|
while (simple.correctNonOrthogonal())
|
||||||
{
|
{
|
||||||
@ -34,7 +34,7 @@ if (simple.transonic())
|
|||||||
(
|
(
|
||||||
fvm::div(phid, p)
|
fvm::div(phid, p)
|
||||||
+ fvc::div(phic)
|
+ fvc::div(phic)
|
||||||
- fvm::laplacian(Dp, p)
|
- fvm::laplacian(rhorAtU, p)
|
||||||
==
|
==
|
||||||
fvOptions(psi, p, rho.name())
|
fvOptions(psi, p, rho.name())
|
||||||
);
|
);
|
||||||
@ -67,14 +67,14 @@ else
|
|||||||
phiHbyA += fvc::interpolate(rho*(rAtU - rAU))*fvc::snGrad(p)*mesh.magSf();
|
phiHbyA += fvc::interpolate(rho*(rAtU - rAU))*fvc::snGrad(p)*mesh.magSf();
|
||||||
HbyA -= (rAU - rAtU)*fvc::grad(p);
|
HbyA -= (rAU - rAtU)*fvc::grad(p);
|
||||||
|
|
||||||
volScalarField Dp("Dp", rho*rAtU);
|
volScalarField rhorAtU("rhorAtU", rho*rAtU);
|
||||||
|
|
||||||
while (simple.correctNonOrthogonal())
|
while (simple.correctNonOrthogonal())
|
||||||
{
|
{
|
||||||
fvScalarMatrix pEqn
|
fvScalarMatrix pEqn
|
||||||
(
|
(
|
||||||
fvc::div(phiHbyA)
|
fvc::div(phiHbyA)
|
||||||
- fvm::laplacian(Dp, p)
|
- fvm::laplacian(rhorAtU, p)
|
||||||
==
|
==
|
||||||
fvOptions(psi, p, rho.name())
|
fvOptions(psi, p, rho.name())
|
||||||
);
|
);
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
rho = thermo.rho();
|
rho = thermo.rho();
|
||||||
|
|
||||||
volScalarField rAU(1.0/UEqn.A());
|
volScalarField rAU(1.0/UEqn.A());
|
||||||
surfaceScalarField Dp("Dp", fvc::interpolate(rho*rAU));
|
surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho*rAU));
|
||||||
|
|
||||||
volVectorField HbyA("HbyA", U);
|
volVectorField HbyA("HbyA", U);
|
||||||
HbyA = rAU*UEqn.H();
|
HbyA = rAU*UEqn.H();
|
||||||
@ -12,7 +12,7 @@ surfaceScalarField phid
|
|||||||
fvc::interpolate(psi)*
|
fvc::interpolate(psi)*
|
||||||
(
|
(
|
||||||
(mesh.Sf() & fvc::interpolate(rho*HbyA))
|
(mesh.Sf() & fvc::interpolate(rho*HbyA))
|
||||||
+ Dp*fvc::ddtCorr(rho, U, phi)
|
+ rhorAUf*fvc::ddtCorr(rho, U, phi)
|
||||||
)/fvc::interpolate(rho)
|
)/fvc::interpolate(rho)
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -23,7 +23,7 @@ while (pimple.correctNonOrthogonal())
|
|||||||
(
|
(
|
||||||
fvm::ddt(psi, p)
|
fvm::ddt(psi, p)
|
||||||
+ fvm::div(phid, p)
|
+ fvm::div(phid, p)
|
||||||
- fvm::laplacian(Dp, p)
|
- fvm::laplacian(rhorAUf, p)
|
||||||
);
|
);
|
||||||
|
|
||||||
pEqn.solve();
|
pEqn.solve();
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
rho = thermo.rho();
|
rho = thermo.rho();
|
||||||
|
|
||||||
volScalarField rAU(1.0/UEqn.A());
|
volScalarField rAU(1.0/UEqn.A());
|
||||||
surfaceScalarField Dp("Dp", fvc::interpolate(rho*rAU));
|
surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho*rAU));
|
||||||
|
|
||||||
volVectorField HbyA("HbyA", U);
|
volVectorField HbyA("HbyA", U);
|
||||||
HbyA = rAU*UEqn.H();
|
HbyA = rAU*UEqn.H();
|
||||||
@ -13,7 +13,7 @@ surfaceScalarField phid
|
|||||||
*(
|
*(
|
||||||
(
|
(
|
||||||
(fvc::interpolate(rho*HbyA) & mesh.Sf())
|
(fvc::interpolate(rho*HbyA) & mesh.Sf())
|
||||||
//***HGW + Dp*fvc::ddtCorr(rho, U, phi)
|
//***HGW + rhorAUf*fvc::ddtCorr(rho, U, phi)
|
||||||
)/fvc::interpolate(rho)
|
)/fvc::interpolate(rho)
|
||||||
- fvc::meshPhi(rho, U)
|
- fvc::meshPhi(rho, U)
|
||||||
)
|
)
|
||||||
@ -25,7 +25,7 @@ for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
|
|||||||
(
|
(
|
||||||
fvm::ddt(psi, p)
|
fvm::ddt(psi, p)
|
||||||
+ fvm::div(phid, p)
|
+ fvm::div(phid, p)
|
||||||
- fvm::laplacian(Dp, p)
|
- fvm::laplacian(rhorAUf, p)
|
||||||
);
|
);
|
||||||
|
|
||||||
pEqn.solve();
|
pEqn.solve();
|
||||||
|
|||||||
@ -75,8 +75,12 @@ int main(int argc, char *argv[])
|
|||||||
// --- Pressure corrector loop
|
// --- Pressure corrector loop
|
||||||
while (pimple.correct())
|
while (pimple.correct())
|
||||||
{
|
{
|
||||||
volScalarField rAU(1.0/UEqn.A());
|
volScalarField rAU("rAU", 1.0/UEqn.A());
|
||||||
surfaceScalarField Dp("Dp", fvc::interpolate(rho*rAU));
|
surfaceScalarField rhorAUf
|
||||||
|
(
|
||||||
|
"rhorAUf",
|
||||||
|
fvc::interpolate(rho*rAU)
|
||||||
|
);
|
||||||
|
|
||||||
U = rAU*UEqn.H();
|
U = rAU*UEqn.H();
|
||||||
|
|
||||||
@ -86,7 +90,7 @@ int main(int argc, char *argv[])
|
|||||||
psi
|
psi
|
||||||
*(
|
*(
|
||||||
(fvc::interpolate(rho*U) & mesh.Sf())
|
(fvc::interpolate(rho*U) & mesh.Sf())
|
||||||
+ Dp*fvc::ddtCorr(rho, U, phi)
|
+ rhorAUf*fvc::ddtCorr(rho, U, phi)
|
||||||
)/fvc::interpolate(rho)
|
)/fvc::interpolate(rho)
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -97,7 +101,7 @@ int main(int argc, char *argv[])
|
|||||||
fvm::ddt(psi, p)
|
fvm::ddt(psi, p)
|
||||||
+ fvc::div(phi)
|
+ fvc::div(phi)
|
||||||
+ fvm::div(phid, p)
|
+ fvm::div(phid, p)
|
||||||
- fvm::laplacian(Dp, p)
|
- fvm::laplacian(rhorAUf, p)
|
||||||
);
|
);
|
||||||
|
|
||||||
pEqn.solve();
|
pEqn.solve();
|
||||||
|
|||||||
@ -93,7 +93,7 @@ int main(int argc, char *argv[])
|
|||||||
for (int corr=0; corr<nCorr; corr++)
|
for (int corr=0; corr<nCorr; corr++)
|
||||||
{
|
{
|
||||||
volScalarField rAU(1.0/UEqn.A());
|
volScalarField rAU(1.0/UEqn.A());
|
||||||
surfaceScalarField Dp("Dp", fvc::interpolate(rAU));
|
surfaceScalarField rAUf("rAUf", fvc::interpolate(rAU));
|
||||||
|
|
||||||
volVectorField HbyA("HbyA", U);
|
volVectorField HbyA("HbyA", U);
|
||||||
HbyA = rAU*UEqn.H();
|
HbyA = rAU*UEqn.H();
|
||||||
@ -102,14 +102,14 @@ int main(int argc, char *argv[])
|
|||||||
(
|
(
|
||||||
"phiHbyA",
|
"phiHbyA",
|
||||||
(fvc::interpolate(HbyA) & mesh.Sf())
|
(fvc::interpolate(HbyA) & mesh.Sf())
|
||||||
+ Dp*fvc::ddtCorr(U, phi)
|
+ rAUf*fvc::ddtCorr(U, phi)
|
||||||
);
|
);
|
||||||
|
|
||||||
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
|
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
|
||||||
{
|
{
|
||||||
fvScalarMatrix pEqn
|
fvScalarMatrix pEqn
|
||||||
(
|
(
|
||||||
fvm::laplacian(Dp, p) == fvc::div(phiHbyA)
|
fvm::laplacian(rAUf, p) == fvc::div(phiHbyA)
|
||||||
);
|
);
|
||||||
|
|
||||||
pEqn.setReference(pRefCell, pRefValue);
|
pEqn.setReference(pRefCell, pRefValue);
|
||||||
@ -143,14 +143,14 @@ int main(int argc, char *argv[])
|
|||||||
BEqn.solve();
|
BEqn.solve();
|
||||||
|
|
||||||
volScalarField rAB(1.0/BEqn.A());
|
volScalarField rAB(1.0/BEqn.A());
|
||||||
surfaceScalarField DpB("DpB", fvc::interpolate(rAB));
|
surfaceScalarField rABf("rABf", fvc::interpolate(rAB));
|
||||||
|
|
||||||
phiB = (fvc::interpolate(B) & mesh.Sf())
|
phiB = (fvc::interpolate(B) & mesh.Sf())
|
||||||
+ DpB*fvc::ddtCorr(B, phiB);
|
+ rABf*fvc::ddtCorr(B, phiB);
|
||||||
|
|
||||||
fvScalarMatrix pBEqn
|
fvScalarMatrix pBEqn
|
||||||
(
|
(
|
||||||
fvm::laplacian(DpB, pB) == fvc::div(phiB)
|
fvm::laplacian(rABf, pB) == fvc::div(phiB)
|
||||||
);
|
);
|
||||||
pBEqn.solve();
|
pBEqn.solve();
|
||||||
|
|
||||||
|
|||||||
@ -51,6 +51,7 @@ Description
|
|||||||
#include "radiationModel.H"
|
#include "radiationModel.H"
|
||||||
#include "fvIOoptionList.H"
|
#include "fvIOoptionList.H"
|
||||||
#include "pimpleControl.H"
|
#include "pimpleControl.H"
|
||||||
|
#include "fixedFluxPressureFvPatchScalarField.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
|||||||
@ -1,25 +1,35 @@
|
|||||||
{
|
{
|
||||||
volScalarField rAU("rAU", 1.0/UEqn.A());
|
volScalarField rAU("rAU", 1.0/UEqn.A());
|
||||||
surfaceScalarField Dp("Dp", fvc::interpolate(rAU));
|
surfaceScalarField rAUf("rAUf", fvc::interpolate(rAU));
|
||||||
|
|
||||||
volVectorField HbyA("HbyA", U);
|
volVectorField HbyA("HbyA", U);
|
||||||
HbyA = rAU*UEqn.H();
|
HbyA = rAU*UEqn.H();
|
||||||
|
|
||||||
surfaceScalarField phig(-Dp*ghf*fvc::snGrad(rhok)*mesh.magSf());
|
surfaceScalarField phig(-rAUf*ghf*fvc::snGrad(rhok)*mesh.magSf());
|
||||||
|
|
||||||
surfaceScalarField phiHbyA
|
surfaceScalarField phiHbyA
|
||||||
(
|
(
|
||||||
"phiHbyA",
|
"phiHbyA",
|
||||||
(fvc::interpolate(HbyA) & mesh.Sf())
|
(fvc::interpolate(HbyA) & mesh.Sf())
|
||||||
+ Dp*fvc::ddtCorr(U, phi)
|
+ rAUf*fvc::ddtCorr(U, phi)
|
||||||
+ phig
|
+ phig
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// Update the fixedFluxPressure BCs to ensure flux consistency
|
||||||
|
setSnGrad<fixedFluxPressureFvPatchScalarField>
|
||||||
|
(
|
||||||
|
p_rgh.boundaryField(),
|
||||||
|
(
|
||||||
|
phiHbyA.boundaryField()
|
||||||
|
- (mesh.Sf().boundaryField() & U.boundaryField())
|
||||||
|
)/(mesh.magSf().boundaryField()*rAUf.boundaryField())
|
||||||
|
);
|
||||||
|
|
||||||
while (pimple.correctNonOrthogonal())
|
while (pimple.correctNonOrthogonal())
|
||||||
{
|
{
|
||||||
fvScalarMatrix p_rghEqn
|
fvScalarMatrix p_rghEqn
|
||||||
(
|
(
|
||||||
fvm::laplacian(Dp, p_rgh) == fvc::div(phiHbyA)
|
fvm::laplacian(rAUf, p_rgh) == fvc::div(phiHbyA)
|
||||||
);
|
);
|
||||||
|
|
||||||
p_rghEqn.setReference(pRefCell, getRefCellValue(p_rgh, pRefCell));
|
p_rghEqn.setReference(pRefCell, getRefCellValue(p_rgh, pRefCell));
|
||||||
@ -36,7 +46,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())/Dp);
|
U = HbyA + rAU*fvc::reconstruct((phig - p_rghEqn.flux())/rAUf);
|
||||||
U.correctBoundaryConditions();
|
U.correctBoundaryConditions();
|
||||||
fvOptions.correct(U);
|
fvOptions.correct(U);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -50,6 +50,7 @@ Description
|
|||||||
#include "RASModel.H"
|
#include "RASModel.H"
|
||||||
#include "fvIOoptionList.H"
|
#include "fvIOoptionList.H"
|
||||||
#include "simpleControl.H"
|
#include "simpleControl.H"
|
||||||
|
#include "fixedFluxPressureFvPatchScalarField.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
volScalarField rAU("rAU", 1.0/UEqn().A());
|
volScalarField rAU("rAU", 1.0/UEqn().A());
|
||||||
surfaceScalarField rAUf("Dp", fvc::interpolate(rAU));
|
surfaceScalarField rAUf("rAUf", fvc::interpolate(rAU));
|
||||||
|
|
||||||
volVectorField HbyA("HbyA", U);
|
volVectorField HbyA("HbyA", U);
|
||||||
HbyA = rAU*UEqn().H();
|
HbyA = rAU*UEqn().H();
|
||||||
@ -18,6 +18,16 @@
|
|||||||
|
|
||||||
phiHbyA += phig;
|
phiHbyA += phig;
|
||||||
|
|
||||||
|
// Update the fixedFluxPressure BCs to ensure flux consistency
|
||||||
|
setSnGrad<fixedFluxPressureFvPatchScalarField>
|
||||||
|
(
|
||||||
|
p_rgh.boundaryField(),
|
||||||
|
(
|
||||||
|
phiHbyA.boundaryField()
|
||||||
|
- (mesh.Sf().boundaryField() & U.boundaryField())
|
||||||
|
)/(mesh.magSf().boundaryField()*rAUf.boundaryField())
|
||||||
|
);
|
||||||
|
|
||||||
while (simple.correctNonOrthogonal())
|
while (simple.correctNonOrthogonal())
|
||||||
{
|
{
|
||||||
fvScalarMatrix p_rghEqn
|
fvScalarMatrix p_rghEqn
|
||||||
|
|||||||
@ -39,6 +39,7 @@ Description
|
|||||||
#include "radiationModel.H"
|
#include "radiationModel.H"
|
||||||
#include "fvIOoptionList.H"
|
#include "fvIOoptionList.H"
|
||||||
#include "pimpleControl.H"
|
#include "pimpleControl.H"
|
||||||
|
#include "fixedFluxPressureFvPatchScalarField.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
|||||||
@ -6,25 +6,36 @@
|
|||||||
thermo.rho() -= psi*p_rgh;
|
thermo.rho() -= psi*p_rgh;
|
||||||
|
|
||||||
volScalarField rAU(1.0/UEqn.A());
|
volScalarField rAU(1.0/UEqn.A());
|
||||||
surfaceScalarField Dp("Dp", fvc::interpolate(rho*rAU));
|
surfaceScalarField rAUf("rAUf", fvc::interpolate(rho*rAU));
|
||||||
|
|
||||||
volVectorField HbyA("HbyA", U);
|
volVectorField HbyA("HbyA", U);
|
||||||
HbyA = rAU*UEqn.H();
|
HbyA = rAU*UEqn.H();
|
||||||
|
|
||||||
surfaceScalarField phig(-Dp*ghf*fvc::snGrad(rho)*mesh.magSf());
|
surfaceScalarField phig(-rAUf*ghf*fvc::snGrad(rho)*mesh.magSf());
|
||||||
|
|
||||||
surfaceScalarField phiHbyA
|
surfaceScalarField phiHbyA
|
||||||
(
|
(
|
||||||
"phiHbyA",
|
"phiHbyA",
|
||||||
(
|
(
|
||||||
(fvc::interpolate(rho*U) & mesh.Sf())
|
(fvc::interpolate(rho*U) & mesh.Sf())
|
||||||
+ Dp*fvc::ddtCorr(rho, U, phi)
|
+ rAUf*fvc::ddtCorr(rho, U, phi)
|
||||||
)
|
)
|
||||||
+ phig
|
+ phig
|
||||||
);
|
);
|
||||||
|
|
||||||
fvOptions.makeRelative(fvc::interpolate(rho), phiHbyA);
|
fvOptions.makeRelative(fvc::interpolate(rho), phiHbyA);
|
||||||
|
|
||||||
|
// Update the fixedFluxPressure BCs to ensure flux consistency
|
||||||
|
setSnGrad<fixedFluxPressureFvPatchScalarField>
|
||||||
|
(
|
||||||
|
p_rgh.boundaryField(),
|
||||||
|
(
|
||||||
|
phiHbyA.boundaryField()
|
||||||
|
- fvOptions.relative(mesh.Sf().boundaryField() & U.boundaryField())
|
||||||
|
*rho.boundaryField()
|
||||||
|
)/(mesh.magSf().boundaryField()*rAUf.boundaryField())
|
||||||
|
);
|
||||||
|
|
||||||
fvScalarMatrix p_rghDDtEqn
|
fvScalarMatrix p_rghDDtEqn
|
||||||
(
|
(
|
||||||
fvc::ddt(rho) + psi*correction(fvm::ddt(p_rgh))
|
fvc::ddt(rho) + psi*correction(fvm::ddt(p_rgh))
|
||||||
@ -38,7 +49,7 @@
|
|||||||
fvScalarMatrix p_rghEqn
|
fvScalarMatrix p_rghEqn
|
||||||
(
|
(
|
||||||
p_rghDDtEqn
|
p_rghDDtEqn
|
||||||
- fvm::laplacian(Dp, p_rgh)
|
- fvm::laplacian(rAUf, p_rgh)
|
||||||
);
|
);
|
||||||
|
|
||||||
fvOptions.constrain(p_rghEqn);
|
fvOptions.constrain(p_rghEqn);
|
||||||
@ -55,7 +66,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())/Dp);
|
U = HbyA + rAU*fvc::reconstruct((phig + p_rghEqn.flux())/rAUf);
|
||||||
U.correctBoundaryConditions();
|
U.correctBoundaryConditions();
|
||||||
fvOptions.correct(U);
|
fvOptions.correct(U);
|
||||||
K = 0.5*magSqr(U);
|
K = 0.5*magSqr(U);
|
||||||
|
|||||||
@ -36,6 +36,7 @@ Description
|
|||||||
#include "radiationModel.H"
|
#include "radiationModel.H"
|
||||||
#include "simpleControl.H"
|
#include "simpleControl.H"
|
||||||
#include "fvIOoptionList.H"
|
#include "fvIOoptionList.H"
|
||||||
|
#include "fixedFluxPressureFvPatchScalarField.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
|||||||
@ -2,8 +2,8 @@
|
|||||||
rho = thermo.rho();
|
rho = thermo.rho();
|
||||||
rho.relax();
|
rho.relax();
|
||||||
|
|
||||||
volScalarField rAU(1.0/UEqn().A());
|
volScalarField rAU("rAU", 1.0/UEqn().A());
|
||||||
surfaceScalarField rhorAUf("Dp", fvc::interpolate(rho*rAU));
|
surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho*rAU));
|
||||||
|
|
||||||
volVectorField HbyA("HbyA", U);
|
volVectorField HbyA("HbyA", U);
|
||||||
HbyA = rAU*UEqn().H();
|
HbyA = rAU*UEqn().H();
|
||||||
@ -23,6 +23,17 @@
|
|||||||
|
|
||||||
phiHbyA += phig;
|
phiHbyA += phig;
|
||||||
|
|
||||||
|
// Update the fixedFluxPressure BCs to ensure flux consistency
|
||||||
|
setSnGrad<fixedFluxPressureFvPatchScalarField>
|
||||||
|
(
|
||||||
|
p_rgh.boundaryField(),
|
||||||
|
(
|
||||||
|
phiHbyA.boundaryField()
|
||||||
|
- fvOptions.relative(mesh.Sf().boundaryField() & U.boundaryField())
|
||||||
|
*rho.boundaryField()
|
||||||
|
)/(mesh.magSf().boundaryField()*rhorAUf.boundaryField())
|
||||||
|
);
|
||||||
|
|
||||||
while (simple.correctNonOrthogonal())
|
while (simple.correctNonOrthogonal())
|
||||||
{
|
{
|
||||||
fvScalarMatrix p_rghEqn
|
fvScalarMatrix p_rghEqn
|
||||||
|
|||||||
@ -45,6 +45,7 @@ Description
|
|||||||
#include "radiationModel.H"
|
#include "radiationModel.H"
|
||||||
#include "fvIOoptionList.H"
|
#include "fvIOoptionList.H"
|
||||||
#include "coordinateSystem.H"
|
#include "coordinateSystem.H"
|
||||||
|
#include "fixedFluxPressureFvPatchScalarField.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
|||||||
@ -38,6 +38,7 @@ Description
|
|||||||
#include "radiationModel.H"
|
#include "radiationModel.H"
|
||||||
#include "fvIOoptionList.H"
|
#include "fvIOoptionList.H"
|
||||||
#include "coordinateSystem.H"
|
#include "coordinateSystem.H"
|
||||||
|
#include "fixedFluxPressureFvPatchScalarField.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
|||||||
@ -4,8 +4,8 @@
|
|||||||
rho = min(rho, rhoMax[i]);
|
rho = min(rho, rhoMax[i]);
|
||||||
rho.relax();
|
rho.relax();
|
||||||
|
|
||||||
volScalarField rAU(1.0/UEqn().A());
|
volScalarField rAU("rAU", 1.0/UEqn().A());
|
||||||
surfaceScalarField rhorAUf("Dp", fvc::interpolate(rho*rAU));
|
surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho*rAU));
|
||||||
|
|
||||||
volVectorField HbyA("HbyA", U);
|
volVectorField HbyA("HbyA", U);
|
||||||
HbyA = rAU*UEqn().H();
|
HbyA = rAU*UEqn().H();
|
||||||
@ -25,6 +25,17 @@
|
|||||||
|
|
||||||
phiHbyA += phig;
|
phiHbyA += phig;
|
||||||
|
|
||||||
|
// Update the fixedFluxPressure BCs to ensure flux consistency
|
||||||
|
setSnGrad<fixedFluxPressureFvPatchScalarField>
|
||||||
|
(
|
||||||
|
p_rgh.boundaryField(),
|
||||||
|
(
|
||||||
|
phiHbyA.boundaryField()
|
||||||
|
- fvOptions.relative(mesh.Sf().boundaryField() & U.boundaryField())
|
||||||
|
*rho.boundaryField()
|
||||||
|
)/(mesh.magSf().boundaryField()*rhorAUf.boundaryField())
|
||||||
|
);
|
||||||
|
|
||||||
dimensionedScalar compressibility = fvc::domainIntegrate(psi);
|
dimensionedScalar compressibility = fvc::domainIntegrate(psi);
|
||||||
bool compressible = (compressibility.value() > SMALL);
|
bool compressible = (compressibility.value() > SMALL);
|
||||||
|
|
||||||
|
|||||||
@ -5,26 +5,37 @@
|
|||||||
|
|
||||||
rho = thermo.rho();
|
rho = thermo.rho();
|
||||||
|
|
||||||
volScalarField rAU(1.0/UEqn().A());
|
volScalarField rAU("rAU", 1.0/UEqn().A());
|
||||||
surfaceScalarField Dp("Dp", fvc::interpolate(rho*rAU));
|
surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho*rAU));
|
||||||
|
|
||||||
volVectorField HbyA("HbyA", U);
|
volVectorField HbyA("HbyA", U);
|
||||||
HbyA = rAU*UEqn().H();
|
HbyA = rAU*UEqn().H();
|
||||||
|
|
||||||
surfaceScalarField phig(-Dp*ghf*fvc::snGrad(rho)*mesh.magSf());
|
surfaceScalarField phig(-rhorAUf*ghf*fvc::snGrad(rho)*mesh.magSf());
|
||||||
|
|
||||||
surfaceScalarField phiHbyA
|
surfaceScalarField phiHbyA
|
||||||
(
|
(
|
||||||
"phiHbyA",
|
"phiHbyA",
|
||||||
(
|
(
|
||||||
(fvc::interpolate(rho*HbyA) & mesh.Sf())
|
(fvc::interpolate(rho*HbyA) & mesh.Sf())
|
||||||
+ Dp*fvc::ddtCorr(rho, U, phi)
|
+ rhorAUf*fvc::ddtCorr(rho, U, phi)
|
||||||
)
|
)
|
||||||
+ phig
|
+ phig
|
||||||
);
|
);
|
||||||
|
|
||||||
fvOptions.makeRelative(fvc::interpolate(rho), phiHbyA);
|
fvOptions.makeRelative(fvc::interpolate(rho), phiHbyA);
|
||||||
|
|
||||||
|
// Update the fixedFluxPressure BCs to ensure flux consistency
|
||||||
|
setSnGrad<fixedFluxPressureFvPatchScalarField>
|
||||||
|
(
|
||||||
|
p_rgh.boundaryField(),
|
||||||
|
(
|
||||||
|
phiHbyA.boundaryField()
|
||||||
|
- fvOptions.relative(mesh.Sf().boundaryField() & U.boundaryField())
|
||||||
|
*rho.boundaryField()
|
||||||
|
)/(mesh.magSf().boundaryField()*rhorAUf.boundaryField())
|
||||||
|
);
|
||||||
|
|
||||||
{
|
{
|
||||||
fvScalarMatrix p_rghDDtEqn
|
fvScalarMatrix p_rghDDtEqn
|
||||||
(
|
(
|
||||||
@ -41,7 +52,7 @@
|
|||||||
fvScalarMatrix p_rghEqn
|
fvScalarMatrix p_rghEqn
|
||||||
(
|
(
|
||||||
p_rghDDtEqn
|
p_rghDDtEqn
|
||||||
- fvm::laplacian(Dp, p_rgh)
|
- fvm::laplacian(rhorAUf, p_rgh)
|
||||||
);
|
);
|
||||||
|
|
||||||
p_rghEqn.solve
|
p_rghEqn.solve
|
||||||
@ -63,7 +74,7 @@
|
|||||||
{
|
{
|
||||||
phi = phiHbyA + p_rghEqn.flux();
|
phi = phiHbyA + p_rghEqn.flux();
|
||||||
U = HbyA
|
U = HbyA
|
||||||
+ rAU*fvc::reconstruct((phig + p_rghEqn.flux())/Dp);
|
+ rAU*fvc::reconstruct((phig + p_rghEqn.flux())/rhorAUf);
|
||||||
U.correctBoundaryConditions();
|
U.correctBoundaryConditions();
|
||||||
fvOptions.correct(U);
|
fvOptions.correct(U);
|
||||||
K = 0.5*magSqr(U);
|
K = 0.5*magSqr(U);
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
surfaceScalarField Dp("Dp", fvc::interpolate(rAU));
|
surfaceScalarField rAUf("rAUf", fvc::interpolate(rAU));
|
||||||
|
|
||||||
volVectorField HbyA("HbyA", U);
|
volVectorField HbyA("HbyA", U);
|
||||||
HbyA = rAU*UEqn().H();
|
HbyA = rAU*UEqn().H();
|
||||||
@ -12,7 +12,7 @@ surfaceScalarField phiHbyA
|
|||||||
(
|
(
|
||||||
"phiHbyA",
|
"phiHbyA",
|
||||||
(fvc::interpolate(HbyA) & mesh.Sf())
|
(fvc::interpolate(HbyA) & mesh.Sf())
|
||||||
+ Dp*fvc::ddtCorr(U, phi)
|
+ rAUf*fvc::ddtCorr(U, phi)
|
||||||
);
|
);
|
||||||
|
|
||||||
fvOptions.makeRelative(phiHbyA);
|
fvOptions.makeRelative(phiHbyA);
|
||||||
@ -25,7 +25,7 @@ while (pimple.correctNonOrthogonal())
|
|||||||
// Pressure corrector
|
// Pressure corrector
|
||||||
fvScalarMatrix pEqn
|
fvScalarMatrix pEqn
|
||||||
(
|
(
|
||||||
fvm::laplacian(Dp, p) == fvc::div(phiHbyA)
|
fvm::laplacian(rAUf, p) == fvc::div(phiHbyA)
|
||||||
);
|
);
|
||||||
|
|
||||||
pEqn.setReference(pRefCell, pRefValue);
|
pEqn.setReference(pRefCell, pRefValue);
|
||||||
|
|||||||
@ -1,13 +0,0 @@
|
|||||||
wordList pcorrTypes
|
|
||||||
(
|
|
||||||
p.boundaryField().size(),
|
|
||||||
zeroGradientFvPatchScalarField::typeName
|
|
||||||
);
|
|
||||||
|
|
||||||
for (label i=0; i<p.boundaryField().size(); i++)
|
|
||||||
{
|
|
||||||
if (p.boundaryField()[i].fixesValue())
|
|
||||||
{
|
|
||||||
pcorrTypes[i] = fixedValueFvPatchScalarField::typeName;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,4 +1,4 @@
|
|||||||
surfaceScalarField Dp("Dp", fvc::interpolate(rAU));
|
surfaceScalarField rAUf("rAUf", fvc::interpolate(rAU));
|
||||||
|
|
||||||
volVectorField HbyA("HbyA", U);
|
volVectorField HbyA("HbyA", U);
|
||||||
HbyA = rAU*UEqn().H();
|
HbyA = rAU*UEqn().H();
|
||||||
@ -12,7 +12,7 @@ surfaceScalarField phiHbyA
|
|||||||
(
|
(
|
||||||
"phiHbyA",
|
"phiHbyA",
|
||||||
(fvc::interpolate(HbyA) & mesh.Sf())
|
(fvc::interpolate(HbyA) & mesh.Sf())
|
||||||
+ Dp*fvc::ddtCorr(U, Uf)
|
+ rAUf*fvc::ddtCorr(U, Uf)
|
||||||
);
|
);
|
||||||
|
|
||||||
if (p.needReference())
|
if (p.needReference())
|
||||||
@ -26,7 +26,7 @@ while (pimple.correctNonOrthogonal())
|
|||||||
{
|
{
|
||||||
fvScalarMatrix pEqn
|
fvScalarMatrix pEqn
|
||||||
(
|
(
|
||||||
fvm::laplacian(Dp, p) == fvc::div(phiHbyA)
|
fvm::laplacian(rAUf, p) == fvc::div(phiHbyA)
|
||||||
);
|
);
|
||||||
|
|
||||||
pEqn.setReference(pRefCell, pRefValue);
|
pEqn.setReference(pRefCell, pRefValue);
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
rho = thermo.rho();
|
rho = thermo.rho();
|
||||||
|
|
||||||
volScalarField rAU(1.0/UEqn.A());
|
volScalarField rAU(1.0/UEqn.A());
|
||||||
surfaceScalarField Dp("Dp", fvc::interpolate(rho*rAU));
|
surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho*rAU));
|
||||||
|
|
||||||
volVectorField HbyA("HbyA", U);
|
volVectorField HbyA("HbyA", U);
|
||||||
HbyA = rAU*UEqn.H();
|
HbyA = rAU*UEqn.H();
|
||||||
@ -14,7 +14,7 @@ if (pimple.transonic())
|
|||||||
fvc::interpolate(psi)
|
fvc::interpolate(psi)
|
||||||
*(
|
*(
|
||||||
(fvc::interpolate(rho*HbyA) & mesh.Sf())
|
(fvc::interpolate(rho*HbyA) & mesh.Sf())
|
||||||
+ Dp*fvc::ddtCorr(rho, U, phi)
|
+ rhorAUf*fvc::ddtCorr(rho, U, phi)
|
||||||
)/fvc::interpolate(rho)
|
)/fvc::interpolate(rho)
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -26,7 +26,7 @@ if (pimple.transonic())
|
|||||||
(
|
(
|
||||||
fvm::ddt(psi, p)
|
fvm::ddt(psi, p)
|
||||||
+ fvm::div(phid, p)
|
+ fvm::div(phid, p)
|
||||||
- fvm::laplacian(Dp, p)
|
- fvm::laplacian(rhorAUf, p)
|
||||||
==
|
==
|
||||||
coalParcels.Srho()
|
coalParcels.Srho()
|
||||||
+ fvOptions(psi, p, rho.name())
|
+ fvOptions(psi, p, rho.name())
|
||||||
@ -49,7 +49,7 @@ else
|
|||||||
"phiHbyA",
|
"phiHbyA",
|
||||||
(
|
(
|
||||||
(fvc::interpolate(rho*HbyA) & mesh.Sf())
|
(fvc::interpolate(rho*HbyA) & mesh.Sf())
|
||||||
+ Dp*fvc::ddtCorr(rho, U, phi)
|
+ rhorAUf*fvc::ddtCorr(rho, U, phi)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -61,7 +61,7 @@ else
|
|||||||
(
|
(
|
||||||
fvm::ddt(psi, p)
|
fvm::ddt(psi, p)
|
||||||
+ fvc::div(phiHbyA)
|
+ fvc::div(phiHbyA)
|
||||||
- fvm::laplacian(Dp, p)
|
- fvm::laplacian(rhorAUf, p)
|
||||||
==
|
==
|
||||||
coalParcels.Srho()
|
coalParcels.Srho()
|
||||||
+ fvOptions(psi, p, rho.name())
|
+ fvOptions(psi, p, rho.name())
|
||||||
|
|||||||
@ -1,25 +1,36 @@
|
|||||||
rho = thermo.rho();
|
rho = thermo.rho();
|
||||||
|
|
||||||
volScalarField rAU(1.0/UEqn.A());
|
volScalarField rAU(1.0/UEqn.A());
|
||||||
surfaceScalarField Dp("Dp", fvc::interpolate(rho*rAU));
|
surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho*rAU));
|
||||||
|
|
||||||
volVectorField HbyA("HbyA", U);
|
volVectorField HbyA("HbyA", U);
|
||||||
HbyA = rAU*UEqn.H();
|
HbyA = rAU*UEqn.H();
|
||||||
|
|
||||||
surfaceScalarField phig(-Dp*ghf*fvc::snGrad(rho)*mesh.magSf());
|
surfaceScalarField phig(-rhorAUf*ghf*fvc::snGrad(rho)*mesh.magSf());
|
||||||
|
|
||||||
surfaceScalarField phiHbyA
|
surfaceScalarField phiHbyA
|
||||||
(
|
(
|
||||||
"phiHbyA",
|
"phiHbyA",
|
||||||
(
|
(
|
||||||
(fvc::interpolate(rho*HbyA) & mesh.Sf())
|
(fvc::interpolate(rho*HbyA) & mesh.Sf())
|
||||||
+ Dp*fvc::ddtCorr(rho, U, phi)
|
+ rhorAUf*fvc::ddtCorr(rho, U, phi)
|
||||||
)
|
)
|
||||||
+ phig
|
+ phig
|
||||||
);
|
);
|
||||||
|
|
||||||
fvOptions.makeRelative(fvc::interpolate(rho), phiHbyA);
|
fvOptions.makeRelative(fvc::interpolate(rho), phiHbyA);
|
||||||
|
|
||||||
|
// Update the fixedFluxPressure BCs to ensure flux consistency
|
||||||
|
setSnGrad<fixedFluxPressureFvPatchScalarField>
|
||||||
|
(
|
||||||
|
p_rgh.boundaryField(),
|
||||||
|
(
|
||||||
|
phiHbyA.boundaryField()
|
||||||
|
- fvOptions.relative(mesh.Sf().boundaryField() & U.boundaryField())
|
||||||
|
*rho.boundaryField()
|
||||||
|
)/(mesh.magSf().boundaryField()*rhorAUf.boundaryField())
|
||||||
|
);
|
||||||
|
|
||||||
while (pimple.correctNonOrthogonal())
|
while (pimple.correctNonOrthogonal())
|
||||||
{
|
{
|
||||||
fvScalarMatrix p_rghEqn
|
fvScalarMatrix p_rghEqn
|
||||||
@ -27,7 +38,7 @@ while (pimple.correctNonOrthogonal())
|
|||||||
fvc::ddt(psi, rho)*gh
|
fvc::ddt(psi, rho)*gh
|
||||||
+ fvc::div(phiHbyA)
|
+ fvc::div(phiHbyA)
|
||||||
+ fvm::ddt(psi, p_rgh)
|
+ fvm::ddt(psi, p_rgh)
|
||||||
- fvm::laplacian(Dp, p_rgh)
|
- fvm::laplacian(rhorAUf, p_rgh)
|
||||||
==
|
==
|
||||||
parcels.Srho()
|
parcels.Srho()
|
||||||
+ surfaceFilm.Srho()
|
+ surfaceFilm.Srho()
|
||||||
@ -41,7 +52,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)/Dp);
|
U = HbyA + rAU*fvc::reconstruct((p_rghEqn.flux() + phig)/rhorAUf);
|
||||||
U.correctBoundaryConditions();
|
U.correctBoundaryConditions();
|
||||||
fvOptions.correct(U);
|
fvOptions.correct(U);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -39,6 +39,7 @@ Description
|
|||||||
#include "SLGThermo.H"
|
#include "SLGThermo.H"
|
||||||
#include "fvIOoptionList.H"
|
#include "fvIOoptionList.H"
|
||||||
#include "pimpleControl.H"
|
#include "pimpleControl.H"
|
||||||
|
#include "fixedFluxPressureFvPatchScalarField.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
thermo.rho() -= psi*p;
|
thermo.rho() -= psi*p;
|
||||||
|
|
||||||
volScalarField rAU(1.0/UEqn.A());
|
volScalarField rAU(1.0/UEqn.A());
|
||||||
surfaceScalarField Dp("Dp", fvc::interpolate(rho*rAU));
|
surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho*rAU));
|
||||||
|
|
||||||
volVectorField HbyA("HbyA", U);
|
volVectorField HbyA("HbyA", U);
|
||||||
HbyA = rAU*UEqn.H();
|
HbyA = rAU*UEqn.H();
|
||||||
@ -16,7 +16,7 @@
|
|||||||
"phiHbyA",
|
"phiHbyA",
|
||||||
(
|
(
|
||||||
(fvc::interpolate(rho*HbyA) & mesh.Sf())
|
(fvc::interpolate(rho*HbyA) & mesh.Sf())
|
||||||
+ Dp*fvc::ddtCorr(rho, U, phi)
|
+ rhorAUf*fvc::ddtCorr(rho, U, phi)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -36,7 +36,7 @@
|
|||||||
fvScalarMatrix pEqn
|
fvScalarMatrix pEqn
|
||||||
(
|
(
|
||||||
pDDtEqn
|
pDDtEqn
|
||||||
- fvm::laplacian(Dp, p)
|
- fvm::laplacian(rhorAUf, p)
|
||||||
);
|
);
|
||||||
|
|
||||||
fvOptions.constrain(pEqn);
|
fvOptions.constrain(pEqn);
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
rho = thermo.rho();
|
rho = thermo.rho();
|
||||||
|
|
||||||
volScalarField rAU(1.0/UEqn.A());
|
volScalarField rAU(1.0/UEqn.A());
|
||||||
surfaceScalarField Dp("Dp", fvc::interpolate(rho*rAU));
|
surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho*rAU));
|
||||||
|
|
||||||
volVectorField HbyA("HbyA", U);
|
volVectorField HbyA("HbyA", U);
|
||||||
HbyA = rAU*UEqn.H();
|
HbyA = rAU*UEqn.H();
|
||||||
@ -14,7 +14,7 @@ if (pimple.transonic())
|
|||||||
fvc::interpolate(psi)
|
fvc::interpolate(psi)
|
||||||
*(
|
*(
|
||||||
(fvc::interpolate(rho*HbyA) & mesh.Sf())
|
(fvc::interpolate(rho*HbyA) & mesh.Sf())
|
||||||
+ Dp*fvc::ddtCorr(rho, U, phi)
|
+ rhorAUf*fvc::ddtCorr(rho, U, phi)
|
||||||
)/fvc::interpolate(rho)
|
)/fvc::interpolate(rho)
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -26,7 +26,7 @@ if (pimple.transonic())
|
|||||||
(
|
(
|
||||||
fvm::ddt(psi, p)
|
fvm::ddt(psi, p)
|
||||||
+ fvm::div(phid, p)
|
+ fvm::div(phid, p)
|
||||||
- fvm::laplacian(Dp, p)
|
- fvm::laplacian(rhorAUf, p)
|
||||||
==
|
==
|
||||||
parcels.Srho()
|
parcels.Srho()
|
||||||
+ fvOptions(psi, p, rho.name())
|
+ fvOptions(psi, p, rho.name())
|
||||||
@ -49,7 +49,7 @@ else
|
|||||||
"phiHbyA",
|
"phiHbyA",
|
||||||
(
|
(
|
||||||
(fvc::interpolate(rho*HbyA) & mesh.Sf())
|
(fvc::interpolate(rho*HbyA) & mesh.Sf())
|
||||||
+ Dp*fvc::ddtCorr(rho, U, phi)
|
+ rhorAUf*fvc::ddtCorr(rho, U, phi)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -61,7 +61,7 @@ else
|
|||||||
(
|
(
|
||||||
fvm::ddt(psi, p)
|
fvm::ddt(psi, p)
|
||||||
+ fvc::div(phiHbyA)
|
+ fvc::div(phiHbyA)
|
||||||
- fvm::laplacian(Dp, p)
|
- fvm::laplacian(rhorAUf, p)
|
||||||
==
|
==
|
||||||
parcels.Srho()
|
parcels.Srho()
|
||||||
+ fvOptions(psi, p, rho.name())
|
+ fvOptions(psi, p, rho.name())
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
rho = thermo.rho();
|
rho = thermo.rho();
|
||||||
|
|
||||||
volScalarField rAU(1.0/UEqn.A());
|
volScalarField rAU(1.0/UEqn.A());
|
||||||
surfaceScalarField Dp("Dp", fvc::interpolate(rho*rAU));
|
surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho*rAU));
|
||||||
|
|
||||||
volVectorField HbyA("HbyA", U);
|
volVectorField HbyA("HbyA", U);
|
||||||
HbyA = rAU*UEqn.H();
|
HbyA = rAU*UEqn.H();
|
||||||
@ -15,7 +15,7 @@ if (pimple.transonic())
|
|||||||
*(
|
*(
|
||||||
(
|
(
|
||||||
(fvc::interpolate(rho*HbyA) & mesh.Sf())
|
(fvc::interpolate(rho*HbyA) & mesh.Sf())
|
||||||
//***HGW + Dp*fvc::ddtCorr(rho, U, phi)
|
//***HGW + rhorAUf*fvc::ddtCorr(rho, U, phi)
|
||||||
)/fvc::interpolate(rho)
|
)/fvc::interpolate(rho)
|
||||||
- fvc::meshPhi(rho, U)
|
- fvc::meshPhi(rho, U)
|
||||||
)
|
)
|
||||||
@ -29,7 +29,7 @@ if (pimple.transonic())
|
|||||||
(
|
(
|
||||||
fvm::ddt(psi, p)
|
fvm::ddt(psi, p)
|
||||||
+ fvm::div(phid, p)
|
+ fvm::div(phid, p)
|
||||||
- fvm::laplacian(Dp, p)
|
- fvm::laplacian(rhorAUf, p)
|
||||||
==
|
==
|
||||||
parcels.Srho()
|
parcels.Srho()
|
||||||
+ fvOptions(psi, p, rho.name())
|
+ fvOptions(psi, p, rho.name())
|
||||||
@ -52,7 +52,7 @@ else
|
|||||||
"phiHbyA",
|
"phiHbyA",
|
||||||
(
|
(
|
||||||
(fvc::interpolate(HbyA) & mesh.Sf())
|
(fvc::interpolate(HbyA) & mesh.Sf())
|
||||||
//***HGW + Dp*fvc::ddtCorr(rho, U, phi)
|
//***HGW + rhorAUf*fvc::ddtCorr(rho, U, phi)
|
||||||
)
|
)
|
||||||
- fvc::interpolate(rho)*fvc::meshPhi(rho, U)
|
- fvc::interpolate(rho)*fvc::meshPhi(rho, U)
|
||||||
);
|
);
|
||||||
@ -65,7 +65,7 @@ else
|
|||||||
(
|
(
|
||||||
fvm::ddt(psi, p)
|
fvm::ddt(psi, p)
|
||||||
+ fvc::div(phiHbyA)
|
+ fvc::div(phiHbyA)
|
||||||
- fvm::laplacian(Dp, p)
|
- fvm::laplacian(rhorAUf, p)
|
||||||
==
|
==
|
||||||
parcels.Srho()
|
parcels.Srho()
|
||||||
+ fvOptions(psi, p, rho.name())
|
+ fvOptions(psi, p, rho.name())
|
||||||
|
|||||||
@ -12,16 +12,16 @@
|
|||||||
surfaceScalarField rhof("rhof", fvc::interpolate(rho));
|
surfaceScalarField rhof("rhof", fvc::interpolate(rho));
|
||||||
|
|
||||||
volScalarField rAU(1.0/UEqn.A());
|
volScalarField rAU(1.0/UEqn.A());
|
||||||
surfaceScalarField Dp("Dp", fvc::interpolate(rho*rAU));
|
surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho*rAU));
|
||||||
|
|
||||||
volVectorField HbyA("HbyA", U);
|
volVectorField HbyA("HbyA", U);
|
||||||
HbyA = rAU*UEqn.H();
|
HbyA = rAU*UEqn.H();
|
||||||
|
|
||||||
phiv = (fvc::interpolate(HbyA) & mesh.Sf())
|
phiv = (fvc::interpolate(HbyA) & mesh.Sf())
|
||||||
+ Dp*fvc::ddtCorr(U, phivAbs);
|
+ rhorAUf*fvc::ddtCorr(U, phivAbs);
|
||||||
fvc::makeRelative(phiv, U);
|
fvc::makeRelative(phiv, U);
|
||||||
|
|
||||||
surfaceScalarField phiGradp(Dp*mesh.magSf()*fvc::snGrad(p));
|
surfaceScalarField phiGradp(rhorAUf*mesh.magSf()*fvc::snGrad(p));
|
||||||
|
|
||||||
phiv -= phiGradp/rhof;
|
phiv -= phiGradp/rhof;
|
||||||
|
|
||||||
@ -35,7 +35,7 @@
|
|||||||
+ psi*correction(fvm::ddt(p))
|
+ psi*correction(fvm::ddt(p))
|
||||||
+ fvc::div(phiv, rho)
|
+ fvc::div(phiv, rho)
|
||||||
+ fvc::div(phiGradp)
|
+ fvc::div(phiGradp)
|
||||||
- fvm::laplacian(Dp, p)
|
- fvm::laplacian(rhorAUf, p)
|
||||||
);
|
);
|
||||||
|
|
||||||
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
|
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
|
||||||
|
|||||||
@ -12,15 +12,15 @@
|
|||||||
surfaceScalarField rhof("rhof", fvc::interpolate(rho));
|
surfaceScalarField rhof("rhof", fvc::interpolate(rho));
|
||||||
|
|
||||||
volScalarField rAU(1.0/UEqn.A());
|
volScalarField rAU(1.0/UEqn.A());
|
||||||
surfaceScalarField Dp("Dp", fvc::interpolate(rho*rAU));
|
surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho*rAU));
|
||||||
|
|
||||||
volVectorField HbyA("HbyA", U);
|
volVectorField HbyA("HbyA", U);
|
||||||
HbyA = rAU*UEqn.H();
|
HbyA = rAU*UEqn.H();
|
||||||
|
|
||||||
phiv = (fvc::interpolate(HbyA) & mesh.Sf())
|
phiv = (fvc::interpolate(HbyA) & mesh.Sf())
|
||||||
+ Dp*fvc::ddtCorr(U, phiv);
|
+ rhorAUf*fvc::ddtCorr(U, phiv);
|
||||||
|
|
||||||
surfaceScalarField phiGradp(Dp*mesh.magSf()*fvc::snGrad(p));
|
surfaceScalarField phiGradp(rhorAUf*mesh.magSf()*fvc::snGrad(p));
|
||||||
|
|
||||||
phiv -= phiGradp/rhof;
|
phiv -= phiGradp/rhof;
|
||||||
|
|
||||||
@ -32,7 +32,7 @@
|
|||||||
- (rhol0 + (psil - psiv)*pSat)*fvc::ddt(alphav) - pSat*fvc::ddt(psi)
|
- (rhol0 + (psil - psiv)*pSat)*fvc::ddt(alphav) - pSat*fvc::ddt(psi)
|
||||||
+ fvc::div(phiv, rho)
|
+ fvc::div(phiv, rho)
|
||||||
+ fvc::div(phiGradp)
|
+ fvc::div(phiGradp)
|
||||||
- fvm::laplacian(Dp, p)
|
- fvm::laplacian(rhorAUf, p)
|
||||||
);
|
);
|
||||||
|
|
||||||
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
|
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
|
||||||
|
|||||||
@ -46,6 +46,7 @@ Description
|
|||||||
#include "twoPhaseMixtureThermo.H"
|
#include "twoPhaseMixtureThermo.H"
|
||||||
#include "turbulenceModel.H"
|
#include "turbulenceModel.H"
|
||||||
#include "pimpleControl.H"
|
#include "pimpleControl.H"
|
||||||
|
#include "fixedFluxPressureFvPatchScalarField.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -61,7 +62,7 @@ int main(int argc, char *argv[])
|
|||||||
#include "readControls.H"
|
#include "readControls.H"
|
||||||
#include "initContinuityErrs.H"
|
#include "initContinuityErrs.H"
|
||||||
#include "createFields.H"
|
#include "createFields.H"
|
||||||
#include "createPcorrTypes.H"
|
#include "createPrghCorrTypes.H"
|
||||||
#include "CourantNo.H"
|
#include "CourantNo.H"
|
||||||
#include "setInitialDeltaT.H"
|
#include "setInitialDeltaT.H"
|
||||||
|
|
||||||
|
|||||||
@ -44,6 +44,7 @@ Description
|
|||||||
#include "twoPhaseMixtureThermo.H"
|
#include "twoPhaseMixtureThermo.H"
|
||||||
#include "turbulenceModel.H"
|
#include "turbulenceModel.H"
|
||||||
#include "pimpleControl.H"
|
#include "pimpleControl.H"
|
||||||
|
#include "fixedFluxPressureFvPatchScalarField.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
volScalarField rAU("rAU", 1.0/UEqn.A());
|
volScalarField rAU("rAU", 1.0/UEqn.A());
|
||||||
surfaceScalarField Dp("Dp", fvc::interpolate(rAU));
|
surfaceScalarField rAUf("rAUf", fvc::interpolate(rAU));
|
||||||
|
|
||||||
volVectorField HbyA("HbyA", U);
|
volVectorField HbyA("HbyA", U);
|
||||||
HbyA = rAU*UEqn.H();
|
HbyA = rAU*UEqn.H();
|
||||||
@ -11,18 +11,27 @@
|
|||||||
(fvc::interpolate(HbyA) & mesh.Sf())
|
(fvc::interpolate(HbyA) & mesh.Sf())
|
||||||
+ fvc::interpolate(rho*rAU)*fvc::ddtCorr(U, phi)
|
+ fvc::interpolate(rho*rAU)*fvc::ddtCorr(U, phi)
|
||||||
);
|
);
|
||||||
phi = phiHbyA;
|
|
||||||
|
|
||||||
surfaceScalarField phig
|
surfaceScalarField phig
|
||||||
(
|
(
|
||||||
(
|
(
|
||||||
fvc::interpolate(interface.sigmaK())*fvc::snGrad(alpha1)
|
fvc::interpolate(interface.sigmaK())*fvc::snGrad(alpha1)
|
||||||
- ghf*fvc::snGrad(rho)
|
- ghf*fvc::snGrad(rho)
|
||||||
)*Dp*mesh.magSf()
|
)*rAUf*mesh.magSf()
|
||||||
);
|
);
|
||||||
|
|
||||||
phiHbyA += phig;
|
phiHbyA += phig;
|
||||||
|
|
||||||
|
// Update the fixedFluxPressure BCs to ensure flux consistency
|
||||||
|
setSnGrad<fixedFluxPressureFvPatchScalarField>
|
||||||
|
(
|
||||||
|
p_rgh.boundaryField(),
|
||||||
|
(
|
||||||
|
phiHbyA.boundaryField()
|
||||||
|
- (mesh.Sf().boundaryField() & U.boundaryField())
|
||||||
|
)/(mesh.magSf().boundaryField()*rAUf.boundaryField())
|
||||||
|
);
|
||||||
|
|
||||||
tmp<fvScalarMatrix> p_rghEqnComp1;
|
tmp<fvScalarMatrix> p_rghEqnComp1;
|
||||||
tmp<fvScalarMatrix> p_rghEqnComp2;
|
tmp<fvScalarMatrix> p_rghEqnComp2;
|
||||||
|
|
||||||
@ -70,7 +79,7 @@
|
|||||||
fvScalarMatrix p_rghEqnIncomp
|
fvScalarMatrix p_rghEqnIncomp
|
||||||
(
|
(
|
||||||
fvc::div(phiHbyA)
|
fvc::div(phiHbyA)
|
||||||
- fvm::laplacian(Dp, p_rgh)
|
- fvm::laplacian(rAUf, p_rgh)
|
||||||
);
|
);
|
||||||
|
|
||||||
solve
|
solve
|
||||||
@ -97,7 +106,7 @@
|
|||||||
phi = phiHbyA + p_rghEqnIncomp.flux();
|
phi = phiHbyA + p_rghEqnIncomp.flux();
|
||||||
|
|
||||||
U = HbyA
|
U = HbyA
|
||||||
+ rAU*fvc::reconstruct((phig + p_rghEqnIncomp.flux())/Dp);
|
+ rAU*fvc::reconstruct((phig + p_rghEqnIncomp.flux())/rAUf);
|
||||||
U.correctBoundaryConditions();
|
U.correctBoundaryConditions();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -46,6 +46,7 @@ Description
|
|||||||
#include "fvcSmooth.H"
|
#include "fvcSmooth.H"
|
||||||
#include "pimpleControl.H"
|
#include "pimpleControl.H"
|
||||||
#include "fvIOoptionList.H"
|
#include "fvIOoptionList.H"
|
||||||
|
#include "fixedFluxPressureFvPatchScalarField.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
|||||||
@ -45,6 +45,7 @@ Description
|
|||||||
#include "IOMRFZoneList.H"
|
#include "IOMRFZoneList.H"
|
||||||
#include "pimpleControl.H"
|
#include "pimpleControl.H"
|
||||||
#include "fvIOoptionList.H"
|
#include "fvIOoptionList.H"
|
||||||
|
#include "fixedFluxPressureFvPatchScalarField.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
volScalarField rAU("rAU", 1.0/UEqn.A());
|
volScalarField rAU("rAU", 1.0/UEqn.A());
|
||||||
surfaceScalarField Dp("Dp", fvc::interpolate(rAU));
|
surfaceScalarField rAUf("rAUf", fvc::interpolate(rAU));
|
||||||
|
|
||||||
volVectorField HbyA("HbyA", U);
|
volVectorField HbyA("HbyA", U);
|
||||||
HbyA = rAU*UEqn.H();
|
HbyA = rAU*UEqn.H();
|
||||||
@ -13,23 +13,32 @@
|
|||||||
);
|
);
|
||||||
adjustPhi(phiHbyA, U, p_rgh);
|
adjustPhi(phiHbyA, U, p_rgh);
|
||||||
mrfZones.makeRelative(phiHbyA);
|
mrfZones.makeRelative(phiHbyA);
|
||||||
phi = phiHbyA;
|
|
||||||
|
|
||||||
surfaceScalarField phig
|
surfaceScalarField phig
|
||||||
(
|
(
|
||||||
(
|
(
|
||||||
fvc::interpolate(interface.sigmaK())*fvc::snGrad(alpha1)
|
fvc::interpolate(interface.sigmaK())*fvc::snGrad(alpha1)
|
||||||
- ghf*fvc::snGrad(rho)
|
- ghf*fvc::snGrad(rho)
|
||||||
)*Dp*mesh.magSf()
|
)*rAUf*mesh.magSf()
|
||||||
);
|
);
|
||||||
|
|
||||||
phiHbyA += phig;
|
phiHbyA += phig;
|
||||||
|
|
||||||
|
// Update the fixedFluxPressure BCs to ensure flux consistency
|
||||||
|
setSnGrad<fixedFluxPressureFvPatchScalarField>
|
||||||
|
(
|
||||||
|
p_rgh.boundaryField(),
|
||||||
|
(
|
||||||
|
phiHbyA.boundaryField()
|
||||||
|
- mrfZones.relative(mesh.Sf().boundaryField() & U.boundaryField())
|
||||||
|
)/(mesh.magSf().boundaryField()*rAUf.boundaryField())
|
||||||
|
);
|
||||||
|
|
||||||
while (pimple.correctNonOrthogonal())
|
while (pimple.correctNonOrthogonal())
|
||||||
{
|
{
|
||||||
fvScalarMatrix p_rghEqn
|
fvScalarMatrix p_rghEqn
|
||||||
(
|
(
|
||||||
fvm::laplacian(Dp, p_rgh) == fvc::div(phiHbyA)
|
fvm::laplacian(rAUf, p_rgh) == fvc::div(phiHbyA)
|
||||||
);
|
);
|
||||||
|
|
||||||
p_rghEqn.setReference(pRefCell, getRefCellValue(p_rgh, pRefCell));
|
p_rghEqn.setReference(pRefCell, getRefCellValue(p_rgh, pRefCell));
|
||||||
@ -40,7 +49,7 @@
|
|||||||
{
|
{
|
||||||
phi = phiHbyA - p_rghEqn.flux();
|
phi = phiHbyA - p_rghEqn.flux();
|
||||||
|
|
||||||
U = HbyA + rAU*fvc::reconstruct((phig - p_rghEqn.flux())/Dp);
|
U = HbyA + rAU*fvc::reconstruct((phig - p_rghEqn.flux())/rAUf);
|
||||||
U.correctBoundaryConditions();
|
U.correctBoundaryConditions();
|
||||||
fvOptions.correct(U);
|
fvOptions.correct(U);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,13 +0,0 @@
|
|||||||
wordList pcorrTypes
|
|
||||||
(
|
|
||||||
p_rgh.boundaryField().size(),
|
|
||||||
zeroGradientFvPatchScalarField::typeName
|
|
||||||
);
|
|
||||||
|
|
||||||
for (label i=0; i<p_rgh.boundaryField().size(); i++)
|
|
||||||
{
|
|
||||||
if (p_rgh.boundaryField()[i].fixesValue())
|
|
||||||
{
|
|
||||||
pcorrTypes[i] = fixedValueFvPatchScalarField::typeName;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,56 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 2013 OpenFOAM Foundation
|
|
||||||
\\/ M anipulation |
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
License
|
|
||||||
This file is part of OpenFOAM.
|
|
||||||
|
|
||||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
|
||||||
under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
Global
|
|
||||||
createUf
|
|
||||||
|
|
||||||
Description
|
|
||||||
Creates and initialises the velocity velocity field Uf.
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#ifndef createUf_H
|
|
||||||
#define createUf_H
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Info<< "Reading/calculating face velocity Uf\n" << endl;
|
|
||||||
|
|
||||||
surfaceVectorField Uf
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"Uf",
|
|
||||||
runTime.timeName(),
|
|
||||||
mesh,
|
|
||||||
IOobject::READ_IF_PRESENT,
|
|
||||||
IOobject::AUTO_WRITE
|
|
||||||
),
|
|
||||||
linearInterpolate(U)
|
|
||||||
);
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -41,6 +41,7 @@ Description
|
|||||||
#include "turbulenceModel.H"
|
#include "turbulenceModel.H"
|
||||||
#include "pimpleControl.H"
|
#include "pimpleControl.H"
|
||||||
#include "fvIOoptionList.H"
|
#include "fvIOoptionList.H"
|
||||||
|
#include "fixedFluxPressureFvPatchScalarField.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -56,7 +57,7 @@ int main(int argc, char *argv[])
|
|||||||
#include "createFields.H"
|
#include "createFields.H"
|
||||||
#include "createUf.H"
|
#include "createUf.H"
|
||||||
#include "readTimeControls.H"
|
#include "readTimeControls.H"
|
||||||
#include "createPcorrTypes.H"
|
#include "createPrghCorrTypes.H"
|
||||||
#include "correctPhi.H"
|
#include "correctPhi.H"
|
||||||
#include "CourantNo.H"
|
#include "CourantNo.H"
|
||||||
#include "setInitialDeltaT.H"
|
#include "setInitialDeltaT.H"
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
volScalarField rAU("rAU", 1.0/UEqn.A());
|
volScalarField rAU("rAU", 1.0/UEqn.A());
|
||||||
surfaceScalarField Dp("Dp", fvc::interpolate(rAU));
|
surfaceScalarField rAUf("rAUf", fvc::interpolate(rAU));
|
||||||
|
|
||||||
volVectorField HbyA("HbyA", U);
|
volVectorField HbyA("HbyA", U);
|
||||||
HbyA = rAU*UEqn.H();
|
HbyA = rAU*UEqn.H();
|
||||||
@ -19,23 +19,31 @@
|
|||||||
fvc::makeAbsolute(phiHbyA, U);
|
fvc::makeAbsolute(phiHbyA, U);
|
||||||
}
|
}
|
||||||
|
|
||||||
surfaceScalarField phiAbs("phiAbs", phiHbyA);
|
|
||||||
|
|
||||||
surfaceScalarField phig
|
surfaceScalarField phig
|
||||||
(
|
(
|
||||||
(
|
(
|
||||||
fvc::interpolate(interface.sigmaK())*fvc::snGrad(alpha1)
|
fvc::interpolate(interface.sigmaK())*fvc::snGrad(alpha1)
|
||||||
- ghf*fvc::snGrad(rho)
|
- ghf*fvc::snGrad(rho)
|
||||||
)*Dp*mesh.magSf()
|
)*rAUf*mesh.magSf()
|
||||||
);
|
);
|
||||||
|
|
||||||
phiHbyA += phig;
|
phiHbyA += phig;
|
||||||
|
|
||||||
|
// Update the fixedFluxPressure BCs to ensure flux consistency
|
||||||
|
setSnGrad<fixedFluxPressureFvPatchScalarField>
|
||||||
|
(
|
||||||
|
p_rgh.boundaryField(),
|
||||||
|
(
|
||||||
|
phiHbyA.boundaryField()
|
||||||
|
- (mesh.Sf().boundaryField() & U.boundaryField())
|
||||||
|
)/(mesh.magSf().boundaryField()*rAUf.boundaryField())
|
||||||
|
);
|
||||||
|
|
||||||
while (pimple.correctNonOrthogonal())
|
while (pimple.correctNonOrthogonal())
|
||||||
{
|
{
|
||||||
fvScalarMatrix p_rghEqn
|
fvScalarMatrix p_rghEqn
|
||||||
(
|
(
|
||||||
fvm::laplacian(Dp, p_rgh) == fvc::div(phiHbyA)
|
fvm::laplacian(rAUf, p_rgh) == fvc::div(phiHbyA)
|
||||||
);
|
);
|
||||||
|
|
||||||
p_rghEqn.setReference(pRefCell, getRefCellValue(p_rgh, pRefCell));
|
p_rghEqn.setReference(pRefCell, getRefCellValue(p_rgh, pRefCell));
|
||||||
@ -46,7 +54,7 @@
|
|||||||
{
|
{
|
||||||
phi = phiHbyA - p_rghEqn.flux();
|
phi = phiHbyA - p_rghEqn.flux();
|
||||||
|
|
||||||
U = HbyA + rAU*fvc::reconstruct((phig - p_rghEqn.flux())/Dp);
|
U = HbyA + rAU*fvc::reconstruct((phig - p_rghEqn.flux())/rAUf);
|
||||||
U.correctBoundaryConditions();
|
U.correctBoundaryConditions();
|
||||||
fvOptions.correct(U);
|
fvOptions.correct(U);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -45,6 +45,7 @@ Description
|
|||||||
#include "turbulenceModel.H"
|
#include "turbulenceModel.H"
|
||||||
#include "pimpleControl.H"
|
#include "pimpleControl.H"
|
||||||
#include "fvIOoptionList.H"
|
#include "fvIOoptionList.H"
|
||||||
|
#include "fixedFluxPressureFvPatchScalarField.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
|||||||
@ -38,6 +38,7 @@ Description
|
|||||||
#include "turbulenceModel.H"
|
#include "turbulenceModel.H"
|
||||||
#include "pimpleControl.H"
|
#include "pimpleControl.H"
|
||||||
#include "fvIOoptionList.H"
|
#include "fvIOoptionList.H"
|
||||||
|
#include "fixedFluxPressureFvPatchScalarField.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
volScalarField rAU("rAU", 1.0/UEqn.A());
|
volScalarField rAU("rAU", 1.0/UEqn.A());
|
||||||
surfaceScalarField Dp("Dp", fvc::interpolate(rAU));
|
surfaceScalarField rAUf("rAUf", fvc::interpolate(rAU));
|
||||||
|
|
||||||
volVectorField HbyA("HbyA", U);
|
volVectorField HbyA("HbyA", U);
|
||||||
HbyA = rAU*UEqn.H();
|
HbyA = rAU*UEqn.H();
|
||||||
@ -13,23 +13,32 @@
|
|||||||
);
|
);
|
||||||
|
|
||||||
adjustPhi(phiHbyA, U, p_rgh);
|
adjustPhi(phiHbyA, U, p_rgh);
|
||||||
phi = phiHbyA;
|
|
||||||
|
|
||||||
surfaceScalarField phig
|
surfaceScalarField phig
|
||||||
(
|
(
|
||||||
(
|
(
|
||||||
fvc::interpolate(interface.sigmaK())*fvc::snGrad(alpha1)
|
fvc::interpolate(interface.sigmaK())*fvc::snGrad(alpha1)
|
||||||
- ghf*fvc::snGrad(rho)
|
- ghf*fvc::snGrad(rho)
|
||||||
)*Dp*mesh.magSf()
|
)*rAUf*mesh.magSf()
|
||||||
);
|
);
|
||||||
|
|
||||||
phiHbyA += phig;
|
phiHbyA += phig;
|
||||||
|
|
||||||
|
// Update the fixedFluxPressure BCs to ensure flux consistency
|
||||||
|
setSnGrad<fixedFluxPressureFvPatchScalarField>
|
||||||
|
(
|
||||||
|
p_rgh.boundaryField(),
|
||||||
|
(
|
||||||
|
phiHbyA.boundaryField()
|
||||||
|
- (mesh.Sf().boundaryField() & U.boundaryField())
|
||||||
|
)/(mesh.magSf().boundaryField()*rAUf.boundaryField())
|
||||||
|
);
|
||||||
|
|
||||||
while (pimple.correctNonOrthogonal())
|
while (pimple.correctNonOrthogonal())
|
||||||
{
|
{
|
||||||
fvScalarMatrix p_rghEqn
|
fvScalarMatrix p_rghEqn
|
||||||
(
|
(
|
||||||
fvm::laplacian(Dp, p_rgh) == fvc::div(phiHbyA)
|
fvm::laplacian(rAUf, p_rgh) == fvc::div(phiHbyA)
|
||||||
);
|
);
|
||||||
|
|
||||||
p_rghEqn.setReference(pRefCell, getRefCellValue(p_rgh, pRefCell));
|
p_rghEqn.setReference(pRefCell, getRefCellValue(p_rgh, pRefCell));
|
||||||
@ -40,7 +49,7 @@
|
|||||||
{
|
{
|
||||||
phi = phiHbyA - p_rghEqn.flux();
|
phi = phiHbyA - p_rghEqn.flux();
|
||||||
|
|
||||||
U = HbyA + rAU*fvc::reconstruct((phig - p_rghEqn.flux())/Dp);
|
U = HbyA + rAU*fvc::reconstruct((phig - p_rghEqn.flux())/rAUf);
|
||||||
U.correctBoundaryConditions();
|
U.correctBoundaryConditions();
|
||||||
fvOptions.correct(U);
|
fvOptions.correct(U);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -47,6 +47,7 @@ Description
|
|||||||
#include "IOporosityModelList.H"
|
#include "IOporosityModelList.H"
|
||||||
#include "pimpleControl.H"
|
#include "pimpleControl.H"
|
||||||
#include "fvIOoptionList.H"
|
#include "fvIOoptionList.H"
|
||||||
|
#include "fixedFluxPressureFvPatchScalarField.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
|||||||
@ -50,6 +50,7 @@ Description
|
|||||||
#include "turbulenceModel.H"
|
#include "turbulenceModel.H"
|
||||||
#include "pimpleControl.H"
|
#include "pimpleControl.H"
|
||||||
#include "fvIOoptionList.H"
|
#include "fvIOoptionList.H"
|
||||||
|
#include "fixedFluxPressureFvPatchScalarField.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -64,9 +65,9 @@ int main(int argc, char *argv[])
|
|||||||
pimpleControl pimple(mesh);
|
pimpleControl pimple(mesh);
|
||||||
|
|
||||||
#include "createFields.H"
|
#include "createFields.H"
|
||||||
#include "../interFoam/interDyMFoam/createUf.H"
|
#include "createUf.H"
|
||||||
#include "readTimeControls.H"
|
#include "readTimeControls.H"
|
||||||
#include "../interFoam/interDyMFoam/createPcorrTypes.H"
|
#include "createPcorrTypes.H"
|
||||||
#include "../interFoam/interDyMFoam/correctPhi.H"
|
#include "../interFoam/interDyMFoam/correctPhi.H"
|
||||||
#include "CourantNo.H"
|
#include "CourantNo.H"
|
||||||
#include "setInitialDeltaT.H"
|
#include "setInitialDeltaT.H"
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
volScalarField rAU("rAU", 1.0/UEqn.A());
|
volScalarField rAU("rAU", 1.0/UEqn.A());
|
||||||
surfaceScalarField Dp("Dp", fvc::interpolate(rAU));
|
surfaceScalarField rAUf("rAUf", fvc::interpolate(rAU));
|
||||||
|
|
||||||
volVectorField HbyA("HbyA", U);
|
volVectorField HbyA("HbyA", U);
|
||||||
HbyA = rAU*UEqn.H();
|
HbyA = rAU*UEqn.H();
|
||||||
@ -19,18 +19,26 @@
|
|||||||
fvc::makeAbsolute(phiHbyA, U);
|
fvc::makeAbsolute(phiHbyA, U);
|
||||||
}
|
}
|
||||||
|
|
||||||
surfaceScalarField phiAbs("phiAbs", phiHbyA);
|
|
||||||
|
|
||||||
surfaceScalarField phig
|
surfaceScalarField phig
|
||||||
(
|
(
|
||||||
(
|
(
|
||||||
fvc::interpolate(interface.sigmaK())*fvc::snGrad(alpha1)
|
fvc::interpolate(interface.sigmaK())*fvc::snGrad(alpha1)
|
||||||
- ghf*fvc::snGrad(rho)
|
- ghf*fvc::snGrad(rho)
|
||||||
)*Dp*mesh.magSf()
|
)*rAUf*mesh.magSf()
|
||||||
);
|
);
|
||||||
|
|
||||||
phiHbyA += phig;
|
phiHbyA += phig;
|
||||||
|
|
||||||
|
// Update the fixedFluxPressure BCs to ensure flux consistency
|
||||||
|
setSnGrad<fixedFluxPressureFvPatchScalarField>
|
||||||
|
(
|
||||||
|
p_rgh.boundaryField(),
|
||||||
|
(
|
||||||
|
phiHbyA.boundaryField()
|
||||||
|
- (mesh.Sf().boundaryField() & U.boundaryField())
|
||||||
|
)/(mesh.magSf().boundaryField()*rAUf.boundaryField())
|
||||||
|
);
|
||||||
|
|
||||||
Pair<tmp<volScalarField> > vDotP = twoPhaseProperties->vDotP();
|
Pair<tmp<volScalarField> > vDotP = twoPhaseProperties->vDotP();
|
||||||
const volScalarField& vDotcP = vDotP[0]();
|
const volScalarField& vDotcP = vDotP[0]();
|
||||||
const volScalarField& vDotvP = vDotP[1]();
|
const volScalarField& vDotvP = vDotP[1]();
|
||||||
@ -39,7 +47,7 @@
|
|||||||
{
|
{
|
||||||
fvScalarMatrix p_rghEqn
|
fvScalarMatrix p_rghEqn
|
||||||
(
|
(
|
||||||
fvc::div(phiHbyA) - fvm::laplacian(Dp, p_rgh)
|
fvc::div(phiHbyA) - fvm::laplacian(rAUf, p_rgh)
|
||||||
- (vDotvP - vDotcP)*(pSat - rho*gh) + fvm::Sp(vDotvP - vDotcP, p_rgh)
|
- (vDotvP - vDotcP)*(pSat - rho*gh) + fvm::Sp(vDotvP - vDotcP, p_rgh)
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -51,7 +59,7 @@
|
|||||||
{
|
{
|
||||||
phi = phiHbyA + p_rghEqn.flux();
|
phi = phiHbyA + p_rghEqn.flux();
|
||||||
|
|
||||||
U = HbyA + rAU*fvc::reconstruct((phig + p_rghEqn.flux())/Dp);
|
U = HbyA + rAU*fvc::reconstruct((phig + p_rghEqn.flux())/rAUf);
|
||||||
U.correctBoundaryConditions();
|
U.correctBoundaryConditions();
|
||||||
fvOptions.correct(U);
|
fvOptions.correct(U);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -48,6 +48,7 @@ Description
|
|||||||
#include "turbulenceModel.H"
|
#include "turbulenceModel.H"
|
||||||
#include "pimpleControl.H"
|
#include "pimpleControl.H"
|
||||||
#include "fvIOoptionList.H"
|
#include "fvIOoptionList.H"
|
||||||
|
#include "fixedFluxPressureFvPatchScalarField.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
volScalarField rAU("rAU", 1.0/UEqn.A());
|
volScalarField rAU("rAU", 1.0/UEqn.A());
|
||||||
surfaceScalarField Dp("Dp", fvc::interpolate(rAU));
|
surfaceScalarField rAUf("rAUf", fvc::interpolate(rAU));
|
||||||
|
|
||||||
volVectorField HbyA("HbyA", U);
|
volVectorField HbyA("HbyA", U);
|
||||||
HbyA = rAU*UEqn.H();
|
HbyA = rAU*UEqn.H();
|
||||||
@ -12,18 +12,27 @@
|
|||||||
+ fvc::interpolate(rho*rAU)*fvc::ddtCorr(U, phi)
|
+ fvc::interpolate(rho*rAU)*fvc::ddtCorr(U, phi)
|
||||||
);
|
);
|
||||||
adjustPhi(phiHbyA, U, p_rgh);
|
adjustPhi(phiHbyA, U, p_rgh);
|
||||||
phi = phiHbyA;
|
|
||||||
|
|
||||||
surfaceScalarField phig
|
surfaceScalarField phig
|
||||||
(
|
(
|
||||||
(
|
(
|
||||||
fvc::interpolate(interface.sigmaK())*fvc::snGrad(alpha1)
|
fvc::interpolate(interface.sigmaK())*fvc::snGrad(alpha1)
|
||||||
- ghf*fvc::snGrad(rho)
|
- ghf*fvc::snGrad(rho)
|
||||||
)*Dp*mesh.magSf()
|
)*rAUf*mesh.magSf()
|
||||||
);
|
);
|
||||||
|
|
||||||
phiHbyA += phig;
|
phiHbyA += phig;
|
||||||
|
|
||||||
|
// Update the fixedFluxPressure BCs to ensure flux consistency
|
||||||
|
setSnGrad<fixedFluxPressureFvPatchScalarField>
|
||||||
|
(
|
||||||
|
p_rgh.boundaryField(),
|
||||||
|
(
|
||||||
|
phiHbyA.boundaryField()
|
||||||
|
- (mesh.Sf().boundaryField() & U.boundaryField())
|
||||||
|
)/(mesh.magSf().boundaryField()*rAUf.boundaryField())
|
||||||
|
);
|
||||||
|
|
||||||
Pair<tmp<volScalarField> > vDotP = twoPhaseProperties->vDotP();
|
Pair<tmp<volScalarField> > vDotP = twoPhaseProperties->vDotP();
|
||||||
const volScalarField& vDotcP = vDotP[0]();
|
const volScalarField& vDotcP = vDotP[0]();
|
||||||
const volScalarField& vDotvP = vDotP[1]();
|
const volScalarField& vDotvP = vDotP[1]();
|
||||||
@ -32,7 +41,7 @@
|
|||||||
{
|
{
|
||||||
fvScalarMatrix p_rghEqn
|
fvScalarMatrix p_rghEqn
|
||||||
(
|
(
|
||||||
fvc::div(phiHbyA) - fvm::laplacian(Dp, p_rgh)
|
fvc::div(phiHbyA) - fvm::laplacian(rAUf, p_rgh)
|
||||||
- (vDotvP - vDotcP)*(pSat - rho*gh) + fvm::Sp(vDotvP - vDotcP, p_rgh)
|
- (vDotvP - vDotcP)*(pSat - rho*gh) + fvm::Sp(vDotvP - vDotcP, p_rgh)
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -44,7 +53,7 @@
|
|||||||
{
|
{
|
||||||
phi = phiHbyA + p_rghEqn.flux();
|
phi = phiHbyA + p_rghEqn.flux();
|
||||||
|
|
||||||
U = HbyA + rAU*fvc::reconstruct((phig + p_rghEqn.flux())/Dp);
|
U = HbyA + rAU*fvc::reconstruct((phig + p_rghEqn.flux())/rAUf);
|
||||||
U.correctBoundaryConditions();
|
U.correctBoundaryConditions();
|
||||||
fvOptions.correct(U);
|
fvOptions.correct(U);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -35,12 +35,12 @@ Description
|
|||||||
#include "phaseModel.H"
|
#include "phaseModel.H"
|
||||||
#include "dragModel.H"
|
#include "dragModel.H"
|
||||||
#include "heatTransferModel.H"
|
#include "heatTransferModel.H"
|
||||||
#include "pimpleControl.H"
|
|
||||||
|
|
||||||
#include "singlePhaseTransportModel.H"
|
#include "singlePhaseTransportModel.H"
|
||||||
#include "LESModel.H"
|
#include "LESModel.H"
|
||||||
|
#include "pimpleControl.H"
|
||||||
#include "IOMRFZoneList.H"
|
#include "IOMRFZoneList.H"
|
||||||
|
#include "fixedFluxPressureFvPatchScalarField.H"
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
|||||||
@ -97,6 +97,8 @@
|
|||||||
+ rAlphaAUfs[phasei]*fvc::ddtCorr(phase.U(), phase.phi())
|
+ rAlphaAUfs[phasei]*fvc::ddtCorr(phase.U(), phase.phi())
|
||||||
);
|
);
|
||||||
mrfZones.makeRelative(phiHbyAs[phasei]);
|
mrfZones.makeRelative(phiHbyAs[phasei]);
|
||||||
|
mrfZones.makeRelative(phase.phi().oldTime());
|
||||||
|
mrfZones.makeRelative(phase.phi());
|
||||||
|
|
||||||
phiHbyAs[phasei] +=
|
phiHbyAs[phasei] +=
|
||||||
rAlphaAUfs[phasei]
|
rAlphaAUfs[phasei]
|
||||||
@ -157,54 +159,58 @@
|
|||||||
phasei++;
|
phasei++;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Reset phi BCs
|
surfaceScalarField rAUf
|
||||||
phi.boundaryField() = 0;
|
|
||||||
|
|
||||||
phasei = 0;
|
|
||||||
forAllIter(PtrDictionary<phaseModel>, fluid.phases(), iter)
|
|
||||||
{
|
|
||||||
phaseModel& phase = iter();
|
|
||||||
|
|
||||||
phase.phi().boundaryField() ==
|
|
||||||
(mesh.Sf().boundaryField() & phase.U().boundaryField());
|
|
||||||
|
|
||||||
mrfZones.makeRelative(phase.phi().oldTime());
|
|
||||||
mrfZones.makeRelative(phase.phi());
|
|
||||||
|
|
||||||
// Update phi BCs before pEqn
|
|
||||||
phi.boundaryField() +=
|
|
||||||
alphafs[phasei].boundaryField()*phase.phi().boundaryField();
|
|
||||||
|
|
||||||
phasei++;
|
|
||||||
}
|
|
||||||
|
|
||||||
surfaceScalarField Dp
|
|
||||||
(
|
(
|
||||||
IOobject
|
IOobject
|
||||||
(
|
(
|
||||||
"Dp",
|
"rAUf",
|
||||||
runTime.timeName(),
|
runTime.timeName(),
|
||||||
mesh
|
mesh
|
||||||
),
|
),
|
||||||
mesh,
|
mesh,
|
||||||
dimensionedScalar("Dp", dimensionSet(-1, 3, 1, 0, 0), 0)
|
dimensionedScalar("rAUf", dimensionSet(-1, 3, 1, 0, 0), 0)
|
||||||
);
|
);
|
||||||
|
|
||||||
phasei = 0;
|
phasei = 0;
|
||||||
forAllIter(PtrDictionary<phaseModel>, fluid.phases(), iter)
|
forAllIter(PtrDictionary<phaseModel>, fluid.phases(), iter)
|
||||||
{
|
{
|
||||||
phaseModel& phase = iter();
|
phaseModel& phase = iter();
|
||||||
Dp += mag(alphafs[phasei]*rAlphaAUfs[phasei])/phase.rho();
|
rAUf += mag(alphafs[phasei]*rAlphaAUfs[phasei])/phase.rho();
|
||||||
|
|
||||||
phasei++;
|
phasei++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Update the fixedFluxPressure BCs to ensure flux consistency
|
||||||
|
{
|
||||||
|
surfaceScalarField::GeometricBoundaryField phib(phi.boundaryField());
|
||||||
|
phib = 0;
|
||||||
|
phasei = 0;
|
||||||
|
forAllIter(PtrDictionary<phaseModel>, fluid.phases(), iter)
|
||||||
|
{
|
||||||
|
phaseModel& phase = iter();
|
||||||
|
|
||||||
|
phib +=
|
||||||
|
alphafs[phasei].boundaryField()
|
||||||
|
*(mesh.Sf().boundaryField() & phase.U().boundaryField());
|
||||||
|
|
||||||
|
phasei++;
|
||||||
|
}
|
||||||
|
|
||||||
|
setSnGrad<fixedFluxPressureFvPatchScalarField>
|
||||||
|
(
|
||||||
|
p.boundaryField(),
|
||||||
|
(
|
||||||
|
phiHbyA.boundaryField() - mrfZones.relative(phib)
|
||||||
|
)/(mesh.magSf().boundaryField()*rAUf.boundaryField())
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
while (pimple.correctNonOrthogonal())
|
while (pimple.correctNonOrthogonal())
|
||||||
{
|
{
|
||||||
fvScalarMatrix pEqnIncomp
|
fvScalarMatrix pEqnIncomp
|
||||||
(
|
(
|
||||||
fvc::div(phiHbyA)
|
fvc::div(phiHbyA)
|
||||||
- fvm::laplacian(Dp, p)
|
- fvm::laplacian(rAUf, p)
|
||||||
);
|
);
|
||||||
|
|
||||||
pEqnIncomp.setReference(pRefCell, pRefValue);
|
pEqnIncomp.setReference(pRefCell, pRefValue);
|
||||||
@ -221,7 +227,7 @@
|
|||||||
|
|
||||||
if (pimple.finalNonOrthogonalIter())
|
if (pimple.finalNonOrthogonalIter())
|
||||||
{
|
{
|
||||||
surfaceScalarField mSfGradp(pEqnIncomp.flux()/Dp);
|
surfaceScalarField mSfGradp(pEqnIncomp.flux()/rAUf);
|
||||||
|
|
||||||
phasei = 0;
|
phasei = 0;
|
||||||
phi = dimensionedScalar("phi", phi.dimensions(), 0);
|
phi = dimensionedScalar("phi", phi.dimensions(), 0);
|
||||||
@ -248,7 +254,7 @@
|
|||||||
// );
|
// );
|
||||||
|
|
||||||
p.relax();
|
p.relax();
|
||||||
mSfGradp = pEqnIncomp.flux()/Dp;
|
mSfGradp = pEqnIncomp.flux()/rAUf;
|
||||||
|
|
||||||
U = dimensionedVector("U", dimVelocity, vector::zero);
|
U = dimensionedVector("U", dimVelocity, vector::zero);
|
||||||
|
|
||||||
|
|||||||
@ -37,6 +37,7 @@ Description
|
|||||||
#include "turbulenceModel.H"
|
#include "turbulenceModel.H"
|
||||||
#include "IOMRFZoneList.H"
|
#include "IOMRFZoneList.H"
|
||||||
#include "pimpleControl.H"
|
#include "pimpleControl.H"
|
||||||
|
#include "fixedFluxPressureFvPatchScalarField.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
volScalarField rAU("rAU", 1.0/UEqn.A());
|
volScalarField rAU("rAU", 1.0/UEqn.A());
|
||||||
surfaceScalarField Dp("Dp", fvc::interpolate(rAU));
|
surfaceScalarField rAUf("rAUf", fvc::interpolate(rAU));
|
||||||
|
|
||||||
volVectorField HbyA("HbyA", U);
|
volVectorField HbyA("HbyA", U);
|
||||||
HbyA = rAU*UEqn.H();
|
HbyA = rAU*UEqn.H();
|
||||||
@ -13,20 +13,29 @@
|
|||||||
);
|
);
|
||||||
adjustPhi(phiHbyA, U, p_rgh);
|
adjustPhi(phiHbyA, U, p_rgh);
|
||||||
mrfZones.makeRelative(phiHbyA);
|
mrfZones.makeRelative(phiHbyA);
|
||||||
phi = phiHbyA;
|
|
||||||
|
|
||||||
surfaceScalarField phig
|
surfaceScalarField phig
|
||||||
(
|
(
|
||||||
- ghf*fvc::snGrad(rho)*Dp*mesh.magSf()
|
- ghf*fvc::snGrad(rho)*rAUf*mesh.magSf()
|
||||||
);
|
);
|
||||||
|
|
||||||
phiHbyA += phig;
|
phiHbyA += phig;
|
||||||
|
|
||||||
|
// Update the fixedFluxPressure BCs to ensure flux consistency
|
||||||
|
setSnGrad<fixedFluxPressureFvPatchScalarField>
|
||||||
|
(
|
||||||
|
p_rgh.boundaryField(),
|
||||||
|
(
|
||||||
|
phiHbyA.boundaryField()
|
||||||
|
- mrfZones.relative(mesh.Sf().boundaryField() & U.boundaryField())
|
||||||
|
)/(mesh.magSf().boundaryField()*rAUf.boundaryField())
|
||||||
|
);
|
||||||
|
|
||||||
while (pimple.correctNonOrthogonal())
|
while (pimple.correctNonOrthogonal())
|
||||||
{
|
{
|
||||||
fvScalarMatrix p_rghEqn
|
fvScalarMatrix p_rghEqn
|
||||||
(
|
(
|
||||||
fvm::laplacian(Dp, p_rgh) == fvc::div(phiHbyA)
|
fvm::laplacian(rAUf, p_rgh) == fvc::div(phiHbyA)
|
||||||
);
|
);
|
||||||
|
|
||||||
p_rghEqn.setReference(pRefCell, getRefCellValue(p_rgh, pRefCell));
|
p_rghEqn.setReference(pRefCell, getRefCellValue(p_rgh, pRefCell));
|
||||||
@ -37,7 +46,7 @@
|
|||||||
{
|
{
|
||||||
phi = phiHbyA - p_rghEqn.flux();
|
phi = phiHbyA - p_rghEqn.flux();
|
||||||
|
|
||||||
U = HbyA + rAU*fvc::reconstruct((phig - p_rghEqn.flux())/Dp);
|
U = HbyA + rAU*fvc::reconstruct((phig - p_rghEqn.flux())/rAUf);
|
||||||
U.correctBoundaryConditions();
|
U.correctBoundaryConditions();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -36,6 +36,7 @@ Description
|
|||||||
#include "multiphaseMixture.H"
|
#include "multiphaseMixture.H"
|
||||||
#include "turbulenceModel.H"
|
#include "turbulenceModel.H"
|
||||||
#include "pimpleControl.H"
|
#include "pimpleControl.H"
|
||||||
|
#include "fixedFluxPressureFvPatchScalarField.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
volScalarField rAU("rAU", 1.0/UEqn.A());
|
volScalarField rAU("rAU", 1.0/UEqn.A());
|
||||||
surfaceScalarField Dp("Dp", fvc::interpolate(rAU));
|
surfaceScalarField rAUf("rAUf", fvc::interpolate(rAU));
|
||||||
|
|
||||||
volVectorField HbyA("HbyA", U);
|
volVectorField HbyA("HbyA", U);
|
||||||
HbyA = rAU*UEqn.H();
|
HbyA = rAU*UEqn.H();
|
||||||
@ -12,23 +12,32 @@
|
|||||||
+ fvc::interpolate(rho*rAU)*fvc::ddtCorr(U, phi)
|
+ fvc::interpolate(rho*rAU)*fvc::ddtCorr(U, phi)
|
||||||
);
|
);
|
||||||
adjustPhi(phiHbyA, U, p_rgh);
|
adjustPhi(phiHbyA, U, p_rgh);
|
||||||
phi = phiHbyA;
|
|
||||||
|
|
||||||
surfaceScalarField phig
|
surfaceScalarField phig
|
||||||
(
|
(
|
||||||
(
|
(
|
||||||
mixture.surfaceTensionForce()
|
mixture.surfaceTensionForce()
|
||||||
- ghf*fvc::snGrad(rho)
|
- ghf*fvc::snGrad(rho)
|
||||||
)*Dp*mesh.magSf()
|
)*rAUf*mesh.magSf()
|
||||||
);
|
);
|
||||||
|
|
||||||
phiHbyA += phig;
|
phiHbyA += phig;
|
||||||
|
|
||||||
|
// Update the fixedFluxPressure BCs to ensure flux consistency
|
||||||
|
setSnGrad<fixedFluxPressureFvPatchScalarField>
|
||||||
|
(
|
||||||
|
p_rgh.boundaryField(),
|
||||||
|
(
|
||||||
|
phiHbyA.boundaryField()
|
||||||
|
- (mesh.Sf().boundaryField() & U.boundaryField())
|
||||||
|
)/(mesh.magSf().boundaryField()*rAUf.boundaryField())
|
||||||
|
);
|
||||||
|
|
||||||
while (pimple.correctNonOrthogonal())
|
while (pimple.correctNonOrthogonal())
|
||||||
{
|
{
|
||||||
fvScalarMatrix p_rghEqn
|
fvScalarMatrix p_rghEqn
|
||||||
(
|
(
|
||||||
fvm::laplacian(Dp, p_rgh) == fvc::div(phiHbyA)
|
fvm::laplacian(rAUf, p_rgh) == fvc::div(phiHbyA)
|
||||||
);
|
);
|
||||||
|
|
||||||
p_rghEqn.setReference(pRefCell, getRefCellValue(p_rgh, pRefCell));
|
p_rghEqn.setReference(pRefCell, getRefCellValue(p_rgh, pRefCell));
|
||||||
@ -39,7 +48,7 @@
|
|||||||
{
|
{
|
||||||
phi = phiHbyA - p_rghEqn.flux();
|
phi = phiHbyA - p_rghEqn.flux();
|
||||||
|
|
||||||
U = HbyA + rAU*fvc::reconstruct((phig - p_rghEqn.flux())/Dp);
|
U = HbyA + rAU*fvc::reconstruct((phig - p_rghEqn.flux())/rAUf);
|
||||||
U.correctBoundaryConditions();
|
U.correctBoundaryConditions();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -20,8 +20,15 @@ adjustPhi(phiHbyA, U, p_gh);
|
|||||||
|
|
||||||
fvOptions.makeRelative(phiHbyA);
|
fvOptions.makeRelative(phiHbyA);
|
||||||
|
|
||||||
// Update the phi BCs from U before p BCs are updated
|
// Update the fixedFluxPressure BCs to ensure flux consistency
|
||||||
phi.boundaryField() = mesh.Sf().boundaryField() & U.boundaryField();
|
setSnGrad<fixedFluxPressureFvPatchScalarField>
|
||||||
|
(
|
||||||
|
p_gh.boundaryField(),
|
||||||
|
(
|
||||||
|
phiHbyA.boundaryField()
|
||||||
|
- (mesh.Sf().boundaryField() & U.boundaryField())
|
||||||
|
)/(mesh.magSf().boundaryField()*rAUf.boundaryField())
|
||||||
|
);
|
||||||
|
|
||||||
// Non-orthogonal pressure corrector loop
|
// Non-orthogonal pressure corrector loop
|
||||||
while (pimple.correctNonOrthogonal())
|
while (pimple.correctNonOrthogonal())
|
||||||
|
|||||||
@ -39,6 +39,7 @@ Description
|
|||||||
#include "turbulenceModel.H"
|
#include "turbulenceModel.H"
|
||||||
#include "pimpleControl.H"
|
#include "pimpleControl.H"
|
||||||
#include "fvIOoptionList.H"
|
#include "fvIOoptionList.H"
|
||||||
|
#include "fixedFluxPressureFvPatchScalarField.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
volScalarField rAU("rAU", 1.0/UEqn.A());
|
volScalarField rAU("rAU", 1.0/UEqn.A());
|
||||||
surfaceScalarField Dp("Dp", fvc::interpolate(rho*rAU));
|
surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho*rAU));
|
||||||
|
|
||||||
volVectorField HbyA("HbyA", U);
|
volVectorField HbyA("HbyA", U);
|
||||||
HbyA = rAU*UEqn.H();
|
HbyA = rAU*UEqn.H();
|
||||||
@ -10,23 +10,33 @@
|
|||||||
"phiHbyA",
|
"phiHbyA",
|
||||||
(
|
(
|
||||||
(fvc::interpolate(rho*HbyA) & mesh.Sf())
|
(fvc::interpolate(rho*HbyA) & mesh.Sf())
|
||||||
+ Dp*fvc::ddtCorr(rho, U, phi)
|
+ rhorAUf*fvc::ddtCorr(rho, U, phi)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
phi = phiHbyA;
|
|
||||||
|
|
||||||
surfaceScalarField phig
|
surfaceScalarField phig
|
||||||
(
|
(
|
||||||
- ghf*fvc::snGrad(rho)*Dp*mesh.magSf()
|
- ghf*fvc::snGrad(rho)*rhorAUf*mesh.magSf()
|
||||||
);
|
);
|
||||||
|
|
||||||
phiHbyA += phig;
|
phiHbyA += phig;
|
||||||
|
|
||||||
|
// Update the fixedFluxPressure BCs to ensure flux consistency
|
||||||
|
setSnGrad<fixedFluxPressureFvPatchScalarField>
|
||||||
|
(
|
||||||
|
p_rgh.boundaryField(),
|
||||||
|
(
|
||||||
|
phiHbyA.boundaryField()
|
||||||
|
- (mesh.Sf().boundaryField() & U.boundaryField())
|
||||||
|
*rho.boundaryField()
|
||||||
|
)/(mesh.magSf().boundaryField()*rhorAUf.boundaryField())
|
||||||
|
);
|
||||||
|
|
||||||
while (pimple.correctNonOrthogonal())
|
while (pimple.correctNonOrthogonal())
|
||||||
{
|
{
|
||||||
fvScalarMatrix p_rghEqn
|
fvScalarMatrix p_rghEqn
|
||||||
(
|
(
|
||||||
fvm::laplacian(Dp, p_rgh) == fvc::ddt(rho) + fvc::div(phiHbyA)
|
fvm::laplacian(rhorAUf, p_rgh) == fvc::ddt(rho) + fvc::div(phiHbyA)
|
||||||
);
|
);
|
||||||
|
|
||||||
p_rghEqn.setReference(pRefCell, getRefCellValue(p_rgh, pRefCell));
|
p_rghEqn.setReference(pRefCell, getRefCellValue(p_rgh, pRefCell));
|
||||||
@ -37,7 +47,7 @@
|
|||||||
{
|
{
|
||||||
phi = phiHbyA - p_rghEqn.flux();
|
phi = phiHbyA - p_rghEqn.flux();
|
||||||
|
|
||||||
U = HbyA + rAU*fvc::reconstruct((phig - p_rghEqn.flux())/Dp);
|
U = HbyA + rAU*fvc::reconstruct((phig - p_rghEqn.flux())/rhorAUf);
|
||||||
U.correctBoundaryConditions();
|
U.correctBoundaryConditions();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -38,6 +38,7 @@ Description
|
|||||||
#include "plasticViscosity.H"
|
#include "plasticViscosity.H"
|
||||||
#include "yieldStress.H"
|
#include "yieldStress.H"
|
||||||
#include "pimpleControl.H"
|
#include "pimpleControl.H"
|
||||||
|
#include "fixedFluxPressureFvPatchScalarField.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
volScalarField rAU("rAU", 1.0/UEqn.A());
|
volScalarField rAU("rAU", 1.0/UEqn.A());
|
||||||
surfaceScalarField Dp("Dp", fvc::interpolate(rAU));
|
surfaceScalarField rAUf("rAUf", fvc::interpolate(rAU));
|
||||||
|
|
||||||
volVectorField HbyA("HbyA", U);
|
volVectorField HbyA("HbyA", U);
|
||||||
HbyA = rAU*UEqn.H();
|
HbyA = rAU*UEqn.H();
|
||||||
@ -12,20 +12,29 @@
|
|||||||
+ fvc::interpolate(rho*rAU)*fvc::ddtCorr(U, phi)
|
+ fvc::interpolate(rho*rAU)*fvc::ddtCorr(U, phi)
|
||||||
);
|
);
|
||||||
adjustPhi(phiHbyA, U, p_rgh);
|
adjustPhi(phiHbyA, U, p_rgh);
|
||||||
phi = phiHbyA;
|
|
||||||
|
|
||||||
surfaceScalarField phig
|
surfaceScalarField phig
|
||||||
(
|
(
|
||||||
- ghf*fvc::snGrad(rho)*Dp*mesh.magSf()
|
- ghf*fvc::snGrad(rho)*rAUf*mesh.magSf()
|
||||||
);
|
);
|
||||||
|
|
||||||
phiHbyA += phig;
|
phiHbyA += phig;
|
||||||
|
|
||||||
|
// Update the fixedFluxPressure BCs to ensure flux consistency
|
||||||
|
setSnGrad<fixedFluxPressureFvPatchScalarField>
|
||||||
|
(
|
||||||
|
p_rgh.boundaryField(),
|
||||||
|
(
|
||||||
|
phiHbyA.boundaryField()
|
||||||
|
- (mesh.Sf().boundaryField() & U.boundaryField())
|
||||||
|
)/(mesh.magSf().boundaryField()*rAUf.boundaryField())
|
||||||
|
);
|
||||||
|
|
||||||
while (pimple.correctNonOrthogonal())
|
while (pimple.correctNonOrthogonal())
|
||||||
{
|
{
|
||||||
fvScalarMatrix p_rghEqn
|
fvScalarMatrix p_rghEqn
|
||||||
(
|
(
|
||||||
fvm::laplacian(Dp, p_rgh) == fvc::div(phiHbyA)
|
fvm::laplacian(rAUf, p_rgh) == fvc::div(phiHbyA)
|
||||||
);
|
);
|
||||||
|
|
||||||
p_rghEqn.setReference(pRefCell, getRefCellValue(p_rgh, pRefCell));
|
p_rghEqn.setReference(pRefCell, getRefCellValue(p_rgh, pRefCell));
|
||||||
@ -36,7 +45,7 @@
|
|||||||
{
|
{
|
||||||
phi = phiHbyA - p_rghEqn.flux();
|
phi = phiHbyA - p_rghEqn.flux();
|
||||||
|
|
||||||
U = HbyA + rAU*fvc::reconstruct((phig - p_rghEqn.flux())/Dp);
|
U = HbyA + rAU*fvc::reconstruct((phig - p_rghEqn.flux())/rAUf);
|
||||||
U.correctBoundaryConditions();
|
U.correctBoundaryConditions();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -37,6 +37,7 @@ Description
|
|||||||
#include "incompressibleTwoPhaseMixture.H"
|
#include "incompressibleTwoPhaseMixture.H"
|
||||||
#include "turbulenceModel.H"
|
#include "turbulenceModel.H"
|
||||||
#include "pimpleControl.H"
|
#include "pimpleControl.H"
|
||||||
|
#include "fixedFluxPressureFvPatchScalarField.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
|||||||
@ -80,22 +80,12 @@
|
|||||||
|
|
||||||
surfaceScalarField phiHbyA("phiHbyA", alpha1f*phiHbyA1 + alpha2f*phiHbyA2);
|
surfaceScalarField phiHbyA("phiHbyA", alpha1f*phiHbyA1 + alpha2f*phiHbyA2);
|
||||||
|
|
||||||
// Update phi BCs before pEqn
|
|
||||||
phi.boundaryField() =
|
|
||||||
mrfZones.relative
|
|
||||||
(
|
|
||||||
alpha1f.boundaryField()
|
|
||||||
*(mesh.Sf().boundaryField() & U1.boundaryField())
|
|
||||||
+ alpha2f.boundaryField()
|
|
||||||
*(mesh.Sf().boundaryField() & U2.boundaryField())
|
|
||||||
);
|
|
||||||
|
|
||||||
HbyA1 += (1.0/rho1)*rAU1*dragCoeff*U2;
|
HbyA1 += (1.0/rho1)*rAU1*dragCoeff*U2;
|
||||||
HbyA2 += (1.0/rho2)*rAU2*dragCoeff*U1;
|
HbyA2 += (1.0/rho2)*rAU2*dragCoeff*U1;
|
||||||
|
|
||||||
surfaceScalarField Dp
|
surfaceScalarField rAUf
|
||||||
(
|
(
|
||||||
"Dp",
|
"rAUf",
|
||||||
mag
|
mag
|
||||||
(
|
(
|
||||||
alpha1f*rAlphaAU1f/fvc::interpolate(rho1)
|
alpha1f*rAlphaAU1f/fvc::interpolate(rho1)
|
||||||
@ -103,6 +93,22 @@
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// Update the fixedFluxPressure BCs to ensure flux consistency
|
||||||
|
setSnGrad<fixedFluxPressureFvPatchScalarField>
|
||||||
|
(
|
||||||
|
p.boundaryField(),
|
||||||
|
(
|
||||||
|
phiHbyA.boundaryField()
|
||||||
|
- mrfZones.relative
|
||||||
|
(
|
||||||
|
alpha1f.boundaryField()
|
||||||
|
*(mesh.Sf().boundaryField() & U1.boundaryField())
|
||||||
|
+ alpha2f.boundaryField()
|
||||||
|
*(mesh.Sf().boundaryField() & U2.boundaryField())
|
||||||
|
)
|
||||||
|
)/(mesh.magSf().boundaryField()*rAUf.boundaryField())
|
||||||
|
);
|
||||||
|
|
||||||
tmp<fvScalarMatrix> pEqnComp1;
|
tmp<fvScalarMatrix> pEqnComp1;
|
||||||
tmp<fvScalarMatrix> pEqnComp2;
|
tmp<fvScalarMatrix> pEqnComp2;
|
||||||
|
|
||||||
@ -160,7 +166,7 @@
|
|||||||
fvScalarMatrix pEqnIncomp
|
fvScalarMatrix pEqnIncomp
|
||||||
(
|
(
|
||||||
fvc::div(phiHbyA)
|
fvc::div(phiHbyA)
|
||||||
- fvm::laplacian(Dp, p)
|
- fvm::laplacian(rAUf, p)
|
||||||
);
|
);
|
||||||
|
|
||||||
solve
|
solve
|
||||||
@ -175,7 +181,7 @@
|
|||||||
|
|
||||||
if (pimple.finalNonOrthogonalIter())
|
if (pimple.finalNonOrthogonalIter())
|
||||||
{
|
{
|
||||||
surfaceScalarField mSfGradp(pEqnIncomp.flux()/Dp);
|
surfaceScalarField mSfGradp(pEqnIncomp.flux()/rAUf);
|
||||||
|
|
||||||
phi1.boundaryField() ==
|
phi1.boundaryField() ==
|
||||||
mrfZones.relative
|
mrfZones.relative
|
||||||
@ -200,7 +206,7 @@
|
|||||||
);
|
);
|
||||||
|
|
||||||
p.relax();
|
p.relax();
|
||||||
mSfGradp = pEqnIncomp.flux()/Dp;
|
mSfGradp = pEqnIncomp.flux()/rAUf;
|
||||||
|
|
||||||
U1 = HbyA1
|
U1 = HbyA1
|
||||||
+ fvc::reconstruct
|
+ fvc::reconstruct
|
||||||
|
|||||||
@ -40,6 +40,7 @@ Description
|
|||||||
#include "PhaseIncompressibleTurbulenceModel.H"
|
#include "PhaseIncompressibleTurbulenceModel.H"
|
||||||
#include "pimpleControl.H"
|
#include "pimpleControl.H"
|
||||||
#include "IOMRFZoneList.H"
|
#include "IOMRFZoneList.H"
|
||||||
|
#include "fixedFluxPressureFvPatchScalarField.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
|||||||
@ -154,7 +154,6 @@ $(derivedFvPatchFields)/mappedFixedValue/mappedFixedValueFvPatchFields.C
|
|||||||
$(derivedFvPatchFields)/mappedFlowRate/mappedFlowRateFvPatchVectorField.C
|
$(derivedFvPatchFields)/mappedFlowRate/mappedFlowRateFvPatchVectorField.C
|
||||||
$(derivedFvPatchFields)/mappedVelocityFluxFixedValue/mappedVelocityFluxFixedValueFvPatchField.C
|
$(derivedFvPatchFields)/mappedVelocityFluxFixedValue/mappedVelocityFluxFixedValueFvPatchField.C
|
||||||
$(derivedFvPatchFields)/movingWallVelocity/movingWallVelocityFvPatchVectorField.C
|
$(derivedFvPatchFields)/movingWallVelocity/movingWallVelocityFvPatchVectorField.C
|
||||||
$(derivedFvPatchFields)/multiphaseFixedFluxPressure/multiphaseFixedFluxPressureFvPatchScalarField.C
|
|
||||||
$(derivedFvPatchFields)/oscillatingFixedValue/oscillatingFixedValueFvPatchFields.C
|
$(derivedFvPatchFields)/oscillatingFixedValue/oscillatingFixedValueFvPatchFields.C
|
||||||
$(derivedFvPatchFields)/outletInlet/outletInletFvPatchFields.C
|
$(derivedFvPatchFields)/outletInlet/outletInletFvPatchFields.C
|
||||||
$(derivedFvPatchFields)/outletMappedUniformInlet/outletMappedUniformInletFvPatchFields.C
|
$(derivedFvPatchFields)/outletMappedUniformInlet/outletMappedUniformInletFvPatchFields.C
|
||||||
|
|||||||
@ -22,15 +22,15 @@ License
|
|||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
Global
|
Global
|
||||||
createUf
|
createRhoUf
|
||||||
|
|
||||||
Description
|
Description
|
||||||
Creates and initialises the velocity velocity field Uf.
|
Creates and initialises the velocity velocity field rhoUf.
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#ifndef createUf_H
|
#ifndef createRhoUf_H
|
||||||
#define createUf_H
|
#define createRhoUf_H
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -461,6 +461,28 @@ void Foam::MRFZone::makeRelative(volVectorField& U) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::MRFZone::makeRelative(surfaceScalarField& phi) const
|
||||||
|
{
|
||||||
|
makeRelativeRhoFlux(geometricOneField(), phi);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::MRFZone::makeRelative(FieldField<fvsPatchField, scalar>& phi) const
|
||||||
|
{
|
||||||
|
makeRelativeRhoFlux(oneFieldField(), phi);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::MRFZone::makeRelative
|
||||||
|
(
|
||||||
|
const surfaceScalarField& rho,
|
||||||
|
surfaceScalarField& phi
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
makeRelativeRhoFlux(rho, phi);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void Foam::MRFZone::makeAbsolute(volVectorField& U) const
|
void Foam::MRFZone::makeAbsolute(volVectorField& U) const
|
||||||
{
|
{
|
||||||
const volVectorField& C = mesh_.C();
|
const volVectorField& C = mesh_.C();
|
||||||
@ -499,28 +521,6 @@ void Foam::MRFZone::makeAbsolute(volVectorField& U) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Foam::MRFZone::makeRelative(surfaceScalarField& phi) const
|
|
||||||
{
|
|
||||||
makeRelativeRhoFlux(geometricOneField(), phi);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Foam::MRFZone::makeRelative(FieldField<fvsPatchField, scalar>& phi) const
|
|
||||||
{
|
|
||||||
return makeRelativeRhoFlux(oneFieldField(), phi);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Foam::MRFZone::makeRelative
|
|
||||||
(
|
|
||||||
const surfaceScalarField& rho,
|
|
||||||
surfaceScalarField& phi
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
makeRelativeRhoFlux(rho, phi);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Foam::MRFZone::makeAbsolute(surfaceScalarField& phi) const
|
void Foam::MRFZone::makeAbsolute(surfaceScalarField& phi) const
|
||||||
{
|
{
|
||||||
makeAbsoluteRhoFlux(geometricOneField(), phi);
|
makeAbsoluteRhoFlux(geometricOneField(), phi);
|
||||||
|
|||||||
@ -218,9 +218,6 @@ public:
|
|||||||
//- Make the given absolute velocity relative within the MRF region
|
//- Make the given absolute velocity relative within the MRF region
|
||||||
void makeRelative(volVectorField& U) const;
|
void makeRelative(volVectorField& U) const;
|
||||||
|
|
||||||
//- Make the given relative velocity absolute within the MRF region
|
|
||||||
void makeAbsolute(volVectorField& U) const;
|
|
||||||
|
|
||||||
//- Make the given absolute flux relative within the MRF region
|
//- Make the given absolute flux relative within the MRF region
|
||||||
void makeRelative(surfaceScalarField& phi) const;
|
void makeRelative(surfaceScalarField& phi) const;
|
||||||
|
|
||||||
@ -235,6 +232,9 @@ public:
|
|||||||
surfaceScalarField& phi
|
surfaceScalarField& phi
|
||||||
) const;
|
) const;
|
||||||
|
|
||||||
|
//- Make the given relative velocity absolute within the MRF region
|
||||||
|
void makeAbsolute(volVectorField& U) const;
|
||||||
|
|
||||||
//- Make the given relative flux absolute within the MRF region
|
//- Make the given relative flux absolute within the MRF region
|
||||||
void makeAbsolute(surfaceScalarField& phi) const;
|
void makeAbsolute(surfaceScalarField& phi) const;
|
||||||
|
|
||||||
|
|||||||
@ -169,15 +169,6 @@ void Foam::MRFZoneList::makeRelative(volVectorField& U) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Foam::MRFZoneList::makeAbsolute(volVectorField& U) const
|
|
||||||
{
|
|
||||||
forAll(*this, i)
|
|
||||||
{
|
|
||||||
operator[](i).makeAbsolute(U);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Foam::MRFZoneList::makeRelative(surfaceScalarField& phi) const
|
void Foam::MRFZoneList::makeRelative(surfaceScalarField& phi) const
|
||||||
{
|
{
|
||||||
forAll(*this, i)
|
forAll(*this, i)
|
||||||
@ -193,7 +184,7 @@ Foam::MRFZoneList::relative
|
|||||||
const tmp<FieldField<fvsPatchField, scalar> >& phi
|
const tmp<FieldField<fvsPatchField, scalar> >& phi
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
tmp<FieldField<fvsPatchField, scalar> > rphi(phi);
|
tmp<FieldField<fvsPatchField, scalar> > rphi(phi.ptr());
|
||||||
|
|
||||||
forAll(*this, i)
|
forAll(*this, i)
|
||||||
{
|
{
|
||||||
@ -217,6 +208,15 @@ void Foam::MRFZoneList::makeRelative
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::MRFZoneList::makeAbsolute(volVectorField& U) const
|
||||||
|
{
|
||||||
|
forAll(*this, i)
|
||||||
|
{
|
||||||
|
operator[](i).makeAbsolute(U);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void Foam::MRFZoneList::makeAbsolute(surfaceScalarField& phi) const
|
void Foam::MRFZoneList::makeAbsolute(surfaceScalarField& phi) const
|
||||||
{
|
{
|
||||||
forAll(*this, i)
|
forAll(*this, i)
|
||||||
|
|||||||
@ -38,11 +38,7 @@ Foam::fixedFluxPressureFvPatchScalarField::fixedFluxPressureFvPatchScalarField
|
|||||||
)
|
)
|
||||||
:
|
:
|
||||||
fixedGradientFvPatchScalarField(p, iF),
|
fixedGradientFvPatchScalarField(p, iF),
|
||||||
phiHbyAName_("phiHbyA"),
|
curTimeIndex_(-1)
|
||||||
phiName_("phi"),
|
|
||||||
rhoName_("rho"),
|
|
||||||
DpName_("Dp"),
|
|
||||||
adjoint_(false)
|
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
@ -55,11 +51,7 @@ Foam::fixedFluxPressureFvPatchScalarField::fixedFluxPressureFvPatchScalarField
|
|||||||
)
|
)
|
||||||
:
|
:
|
||||||
fixedGradientFvPatchScalarField(ptf, p, iF, mapper),
|
fixedGradientFvPatchScalarField(ptf, p, iF, mapper),
|
||||||
phiHbyAName_(ptf.phiHbyAName_),
|
curTimeIndex_(-1)
|
||||||
phiName_(ptf.phiName_),
|
|
||||||
rhoName_(ptf.rhoName_),
|
|
||||||
DpName_(ptf.DpName_),
|
|
||||||
adjoint_(ptf.adjoint_)
|
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
@ -71,11 +63,7 @@ Foam::fixedFluxPressureFvPatchScalarField::fixedFluxPressureFvPatchScalarField
|
|||||||
)
|
)
|
||||||
:
|
:
|
||||||
fixedGradientFvPatchScalarField(p, iF),
|
fixedGradientFvPatchScalarField(p, iF),
|
||||||
phiHbyAName_(dict.lookupOrDefault<word>("phiHbyA", "phiHbyA")),
|
curTimeIndex_(-1)
|
||||||
phiName_(dict.lookupOrDefault<word>("phi", "phi")),
|
|
||||||
rhoName_(dict.lookupOrDefault<word>("rho", "rho")),
|
|
||||||
DpName_(dict.lookupOrDefault<word>("Dp", "Dp")),
|
|
||||||
adjoint_(dict.lookupOrDefault<Switch>("adjoint", false))
|
|
||||||
{
|
{
|
||||||
if (dict.found("value") && dict.found("gradient"))
|
if (dict.found("value") && dict.found("gradient"))
|
||||||
{
|
{
|
||||||
@ -99,11 +87,7 @@ Foam::fixedFluxPressureFvPatchScalarField::fixedFluxPressureFvPatchScalarField
|
|||||||
)
|
)
|
||||||
:
|
:
|
||||||
fixedGradientFvPatchScalarField(wbppsf),
|
fixedGradientFvPatchScalarField(wbppsf),
|
||||||
phiHbyAName_(wbppsf.phiHbyAName_),
|
curTimeIndex_(-1)
|
||||||
phiName_(wbppsf.phiName_),
|
|
||||||
rhoName_(wbppsf.rhoName_),
|
|
||||||
DpName_(wbppsf.DpName_),
|
|
||||||
adjoint_(wbppsf.adjoint_)
|
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
@ -114,16 +98,29 @@ Foam::fixedFluxPressureFvPatchScalarField::fixedFluxPressureFvPatchScalarField
|
|||||||
)
|
)
|
||||||
:
|
:
|
||||||
fixedGradientFvPatchScalarField(wbppsf, iF),
|
fixedGradientFvPatchScalarField(wbppsf, iF),
|
||||||
phiHbyAName_(wbppsf.phiHbyAName_),
|
curTimeIndex_(-1)
|
||||||
phiName_(wbppsf.phiName_),
|
|
||||||
rhoName_(wbppsf.rhoName_),
|
|
||||||
DpName_(wbppsf.DpName_),
|
|
||||||
adjoint_(wbppsf.adjoint_)
|
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
void Foam::fixedFluxPressureFvPatchScalarField::updateCoeffs
|
||||||
|
(
|
||||||
|
const scalarField& snGradp
|
||||||
|
)
|
||||||
|
{
|
||||||
|
if (updated())
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
curTimeIndex_ = this->db().time().timeIndex();
|
||||||
|
|
||||||
|
gradient() = snGradp;
|
||||||
|
fixedGradientFvPatchScalarField::updateCoeffs();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void Foam::fixedFluxPressureFvPatchScalarField::updateCoeffs()
|
void Foam::fixedFluxPressureFvPatchScalarField::updateCoeffs()
|
||||||
{
|
{
|
||||||
if (updated())
|
if (updated())
|
||||||
@ -131,76 +128,19 @@ void Foam::fixedFluxPressureFvPatchScalarField::updateCoeffs()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const surfaceScalarField& phiHbyA =
|
if (curTimeIndex_ != this->db().time().timeIndex())
|
||||||
db().lookupObject<surfaceScalarField>(phiHbyAName_);
|
|
||||||
|
|
||||||
const surfaceScalarField& phi =
|
|
||||||
db().lookupObject<surfaceScalarField>(phiName_);
|
|
||||||
|
|
||||||
fvsPatchField<scalar> phiHbyAp =
|
|
||||||
patch().patchField<surfaceScalarField, scalar>(phiHbyA);
|
|
||||||
|
|
||||||
fvsPatchField<scalar> phip =
|
|
||||||
patch().patchField<surfaceScalarField, scalar>(phi);
|
|
||||||
|
|
||||||
/*
|
|
||||||
if (phi.dimensions() == dimDensity*dimVelocity*dimArea)
|
|
||||||
{
|
{
|
||||||
const fvPatchField<scalar>& rhop =
|
FatalErrorIn("fixedFluxPressureFvPatchScalarField::updateCoeffs()")
|
||||||
patch().lookupPatchField<volScalarField, scalar>(rhoName_);
|
<< "updateCoeffs(const scalarField& snGradp) MUST be called before"
|
||||||
|
" updateCoeffs() or evaluate() to set the boundary gradient."
|
||||||
phip /= rhop;
|
<< exit(FatalError);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (phiHbyA.dimensions() == dimDensity*dimVelocity*dimArea)
|
|
||||||
{
|
|
||||||
const fvPatchField<scalar>& rhop =
|
|
||||||
patch().lookupPatchField<volScalarField, scalar>(rhoName_);
|
|
||||||
|
|
||||||
phiHbyAp /= rhop;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
const scalarField *DppPtr = NULL;
|
|
||||||
|
|
||||||
if (db().foundObject<volScalarField>(DpName_))
|
|
||||||
{
|
|
||||||
DppPtr =
|
|
||||||
&patch().lookupPatchField<volScalarField, scalar>(DpName_);
|
|
||||||
}
|
|
||||||
else if (db().foundObject<surfaceScalarField>(DpName_))
|
|
||||||
{
|
|
||||||
const surfaceScalarField& Dp =
|
|
||||||
db().lookupObject<surfaceScalarField>(DpName_);
|
|
||||||
|
|
||||||
DppPtr =
|
|
||||||
&patch().patchField<surfaceScalarField, scalar>(Dp);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (adjoint_)
|
|
||||||
{
|
|
||||||
gradient() = (phip - phiHbyAp)/patch().magSf()/(*DppPtr);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
gradient() = (phiHbyAp - phip)/patch().magSf()/(*DppPtr);
|
|
||||||
}
|
|
||||||
|
|
||||||
fixedGradientFvPatchScalarField::updateCoeffs();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Foam::fixedFluxPressureFvPatchScalarField::write(Ostream& os) const
|
void Foam::fixedFluxPressureFvPatchScalarField::write(Ostream& os) const
|
||||||
{
|
{
|
||||||
fixedGradientFvPatchScalarField::write(os);
|
fixedGradientFvPatchScalarField::write(os);
|
||||||
writeEntryIfDifferent<word>(os, "phiHbyA", "phiHbyA", phiHbyAName_);
|
|
||||||
writeEntryIfDifferent<word>(os, "phi", "phi", phiName_);
|
|
||||||
writeEntryIfDifferent<word>(os, "rho", "rho", rhoName_);
|
|
||||||
writeEntryIfDifferent<word>(os, "Dp", "Dp", DpName_);
|
|
||||||
if (adjoint_)
|
|
||||||
{
|
|
||||||
os.writeKeyword("adjoint") << adjoint_ << token::END_STATEMENT << nl;
|
|
||||||
}
|
|
||||||
writeEntry("value", os);
|
writeEntry("value", os);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -216,4 +156,5 @@ namespace Foam
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -28,44 +28,15 @@ Group
|
|||||||
grpInletBoundaryConditions grpWallBoundaryConditions
|
grpInletBoundaryConditions grpWallBoundaryConditions
|
||||||
|
|
||||||
Description
|
Description
|
||||||
This boundary condition adjusts the pressure gradient such that the flux
|
This boundary condition sets the pressure gradient to the provided value
|
||||||
on the boundary is that specified by the velocity boundary condition.
|
such that the flux on the boundary is that specified by the velocity
|
||||||
|
boundary condition.
|
||||||
The predicted flux to be compensated by the pressure gradient is evaluated
|
|
||||||
as \f$(\phi - \phi_{H/A})\f$, both of which are looked-up from the database,
|
|
||||||
as is the pressure diffusivity used to calculate the gradient using:
|
|
||||||
|
|
||||||
\f[
|
|
||||||
\nabla(p) = \frac{\phi_{H/A} - \phi}{|Sf| D_p}
|
|
||||||
\f]
|
|
||||||
|
|
||||||
where
|
|
||||||
|
|
||||||
\vartable
|
|
||||||
phi | flux
|
|
||||||
D_p | pressure diffusivity
|
|
||||||
Sf | patch face areas [m2]
|
|
||||||
\endvartable
|
|
||||||
|
|
||||||
\heading Patch usage
|
|
||||||
|
|
||||||
\table
|
|
||||||
Property | Description | Required | Default value
|
|
||||||
phiHbyA | name of predicted flux field | no | phiHbyA
|
|
||||||
phi | name of flux field | no | phi
|
|
||||||
rho | name of density field | no | rho
|
|
||||||
Dp | name of pressure diffusivity field | no | Dp
|
|
||||||
\endtable
|
|
||||||
|
|
||||||
Example of the boundary condition specification:
|
Example of the boundary condition specification:
|
||||||
\verbatim
|
\verbatim
|
||||||
myPatch
|
myPatch
|
||||||
{
|
{
|
||||||
type fixedFluxPressure;
|
type fixedFluxPressure;
|
||||||
phiHbyA phiHbyA;
|
|
||||||
phi phi;
|
|
||||||
rho rho;
|
|
||||||
Dp Dp;
|
|
||||||
}
|
}
|
||||||
\endverbatim
|
\endverbatim
|
||||||
|
|
||||||
@ -99,21 +70,8 @@ class fixedFluxPressureFvPatchScalarField
|
|||||||
{
|
{
|
||||||
// Private data
|
// Private data
|
||||||
|
|
||||||
//- Name of the predicted flux transporting the field
|
//- Current time index (used for updating)
|
||||||
word phiHbyAName_;
|
label curTimeIndex_;
|
||||||
|
|
||||||
//- Name of the flux transporting the field
|
|
||||||
word phiName_;
|
|
||||||
|
|
||||||
//- Name of the density field used to normalise the mass flux
|
|
||||||
// if neccessary
|
|
||||||
word rhoName_;
|
|
||||||
|
|
||||||
//- Name of the pressure diffusivity field
|
|
||||||
word DpName_;
|
|
||||||
|
|
||||||
//- Is the pressure adjoint, i.e. has the opposite sign
|
|
||||||
Switch adjoint_;
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@ -186,7 +144,10 @@ public:
|
|||||||
|
|
||||||
// Member functions
|
// Member functions
|
||||||
|
|
||||||
//- Update the coefficients associated with the patch field
|
//- Update the patch pressure gradient field from the given snGradp
|
||||||
|
virtual void updateCoeffs(const scalarField& snGradp);
|
||||||
|
|
||||||
|
//- Update the patch pressure gradient field
|
||||||
virtual void updateCoeffs();
|
virtual void updateCoeffs();
|
||||||
|
|
||||||
//- Write
|
//- Write
|
||||||
@ -200,6 +161,39 @@ public:
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#include "volFields.H"
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
template<class GradBC>
|
||||||
|
inline void setSnGrad
|
||||||
|
(
|
||||||
|
volScalarField::GeometricBoundaryField& bf,
|
||||||
|
const FieldField<fvsPatchField, scalar>& snGrad
|
||||||
|
)
|
||||||
|
{
|
||||||
|
forAll(bf, patchi)
|
||||||
|
{
|
||||||
|
if (isA<GradBC>(bf[patchi]))
|
||||||
|
{
|
||||||
|
refCast<GradBC>(bf[patchi]).updateCoeffs(snGrad[patchi]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
template<class GradBC>
|
||||||
|
inline void setSnGrad
|
||||||
|
(
|
||||||
|
volScalarField::GeometricBoundaryField& bf,
|
||||||
|
const tmp<FieldField<fvsPatchField, scalar> >& tsnGrad
|
||||||
|
)
|
||||||
|
{
|
||||||
|
setSnGrad<GradBC>(bf, tsnGrad());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -1,197 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
|
||||||
\\/ M anipulation |
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
License
|
|
||||||
This file is part of OpenFOAM.
|
|
||||||
|
|
||||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
|
||||||
under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#include "multiphaseFixedFluxPressureFvPatchScalarField.H"
|
|
||||||
#include "fvPatchFieldMapper.H"
|
|
||||||
#include "volFields.H"
|
|
||||||
#include "surfaceFields.H"
|
|
||||||
#include "addToRunTimeSelectionTable.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::multiphaseFixedFluxPressureFvPatchScalarField::
|
|
||||||
multiphaseFixedFluxPressureFvPatchScalarField
|
|
||||||
(
|
|
||||||
const fvPatch& p,
|
|
||||||
const DimensionedField<scalar, volMesh>& iF
|
|
||||||
)
|
|
||||||
:
|
|
||||||
fixedGradientFvPatchScalarField(p, iF),
|
|
||||||
phiHbyAName_("phiHbyA"),
|
|
||||||
phiName_("phi"),
|
|
||||||
rhoName_("rho"),
|
|
||||||
DpName_("Dp")
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::multiphaseFixedFluxPressureFvPatchScalarField::
|
|
||||||
multiphaseFixedFluxPressureFvPatchScalarField
|
|
||||||
(
|
|
||||||
const multiphaseFixedFluxPressureFvPatchScalarField& ptf,
|
|
||||||
const fvPatch& p,
|
|
||||||
const DimensionedField<scalar, volMesh>& iF,
|
|
||||||
const fvPatchFieldMapper& mapper
|
|
||||||
)
|
|
||||||
:
|
|
||||||
fixedGradientFvPatchScalarField(ptf, p, iF, mapper),
|
|
||||||
phiHbyAName_(ptf.phiHbyAName_),
|
|
||||||
phiName_(ptf.phiName_),
|
|
||||||
rhoName_(ptf.rhoName_),
|
|
||||||
DpName_(ptf.DpName_)
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::multiphaseFixedFluxPressureFvPatchScalarField::
|
|
||||||
multiphaseFixedFluxPressureFvPatchScalarField
|
|
||||||
(
|
|
||||||
const fvPatch& p,
|
|
||||||
const DimensionedField<scalar, volMesh>& iF,
|
|
||||||
const dictionary& dict
|
|
||||||
)
|
|
||||||
:
|
|
||||||
fixedGradientFvPatchScalarField(p, iF),
|
|
||||||
phiHbyAName_(dict.lookupOrDefault<word>("phiHbyA", "phiHbyA")),
|
|
||||||
phiName_(dict.lookupOrDefault<word>("phi", "phi")),
|
|
||||||
rhoName_(dict.lookupOrDefault<word>("rho", "rho")),
|
|
||||||
DpName_(dict.lookupOrDefault<word>("Dp", "Dp"))
|
|
||||||
{
|
|
||||||
if (dict.found("gradient"))
|
|
||||||
{
|
|
||||||
gradient() = scalarField("gradient", dict, p.size());
|
|
||||||
fixedGradientFvPatchScalarField::updateCoeffs();
|
|
||||||
fixedGradientFvPatchScalarField::evaluate();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
fvPatchField<scalar>::operator=(patchInternalField());
|
|
||||||
gradient() = 0.0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::multiphaseFixedFluxPressureFvPatchScalarField::
|
|
||||||
multiphaseFixedFluxPressureFvPatchScalarField
|
|
||||||
(
|
|
||||||
const multiphaseFixedFluxPressureFvPatchScalarField& mfppsf
|
|
||||||
)
|
|
||||||
:
|
|
||||||
fixedGradientFvPatchScalarField(mfppsf),
|
|
||||||
phiHbyAName_(mfppsf.phiHbyAName_),
|
|
||||||
phiName_(mfppsf.phiName_),
|
|
||||||
rhoName_(mfppsf.rhoName_),
|
|
||||||
DpName_(mfppsf.DpName_)
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::multiphaseFixedFluxPressureFvPatchScalarField::
|
|
||||||
multiphaseFixedFluxPressureFvPatchScalarField
|
|
||||||
(
|
|
||||||
const multiphaseFixedFluxPressureFvPatchScalarField& mfppsf,
|
|
||||||
const DimensionedField<scalar, volMesh>& iF
|
|
||||||
)
|
|
||||||
:
|
|
||||||
fixedGradientFvPatchScalarField(mfppsf, iF),
|
|
||||||
phiHbyAName_(mfppsf.phiHbyAName_),
|
|
||||||
phiName_(mfppsf.phiName_),
|
|
||||||
rhoName_(mfppsf.rhoName_),
|
|
||||||
DpName_(mfppsf.DpName_)
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
void Foam::multiphaseFixedFluxPressureFvPatchScalarField::updateCoeffs()
|
|
||||||
{
|
|
||||||
if (updated())
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const surfaceScalarField& phiHbyA =
|
|
||||||
db().lookupObject<surfaceScalarField>(phiHbyAName_);
|
|
||||||
|
|
||||||
const surfaceScalarField& phi =
|
|
||||||
db().lookupObject<surfaceScalarField>(phiName_);
|
|
||||||
|
|
||||||
fvsPatchField<scalar> phiHbyAp =
|
|
||||||
patch().patchField<surfaceScalarField, scalar>(phiHbyA);
|
|
||||||
|
|
||||||
fvsPatchField<scalar> phip =
|
|
||||||
patch().patchField<surfaceScalarField, scalar>(phi);
|
|
||||||
|
|
||||||
/*
|
|
||||||
if (phi.dimensions() == dimDensity*dimVelocity*dimArea)
|
|
||||||
{
|
|
||||||
const fvPatchField<scalar>& rhop =
|
|
||||||
patch().lookupPatchField<volScalarField, scalar>(rhoName_);
|
|
||||||
|
|
||||||
phip /= rhop;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (phiHbyA.dimensions() == dimDensity*dimVelocity*dimArea)
|
|
||||||
{
|
|
||||||
const fvPatchField<scalar>& rhop =
|
|
||||||
patch().lookupPatchField<volScalarField, scalar>(rhoName_);
|
|
||||||
|
|
||||||
phiHbyAp /= rhop;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
const fvsPatchField<scalar>& Dpp =
|
|
||||||
patch().lookupPatchField<surfaceScalarField, scalar>(DpName_);
|
|
||||||
|
|
||||||
gradient() = (phiHbyAp - phip)/patch().magSf()/Dpp;
|
|
||||||
|
|
||||||
fixedGradientFvPatchScalarField::updateCoeffs();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Foam::multiphaseFixedFluxPressureFvPatchScalarField::write
|
|
||||||
(
|
|
||||||
Ostream& os
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
fvPatchScalarField::write(os);
|
|
||||||
writeEntryIfDifferent<word>(os, "phiHbyA", "phiHbyA", phiHbyAName_);
|
|
||||||
writeEntryIfDifferent<word>(os, "phi", "phi", phiName_);
|
|
||||||
writeEntryIfDifferent<word>(os, "rho", "rho", rhoName_);
|
|
||||||
writeEntryIfDifferent<word>(os, "Dp", "Dp", DpName_);
|
|
||||||
gradient().writeEntry("gradient", os);
|
|
||||||
writeEntry("value", os);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
makePatchTypeField
|
|
||||||
(
|
|
||||||
fvPatchScalarField,
|
|
||||||
multiphaseFixedFluxPressureFvPatchScalarField
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,199 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
|
||||||
\\/ M anipulation |
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
License
|
|
||||||
This file is part of OpenFOAM.
|
|
||||||
|
|
||||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
|
||||||
under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
Class
|
|
||||||
Foam::multiphaseFixedFluxPressureFvPatchScalarField
|
|
||||||
|
|
||||||
Group
|
|
||||||
grpWallBoundaryConditions grpGenericBoundaryConditions
|
|
||||||
|
|
||||||
Description
|
|
||||||
This boundary condition adjusts the pressure gradient such that the flux
|
|
||||||
on the boundary is that specified by the velocity boundary condition.
|
|
||||||
|
|
||||||
The predicted flux to be compensated by the pressure gradient is evaluated
|
|
||||||
as \f$(\phi - \phi_{H/A})\f$, both of which are looked-up from the database,
|
|
||||||
as is the pressure diffusivity Dp used to calculate the gradient using:
|
|
||||||
|
|
||||||
\f[
|
|
||||||
\nabla(p) = \frac{\phi_{H/A} - \phi}{|Sf| Dp}
|
|
||||||
\f]
|
|
||||||
|
|
||||||
where
|
|
||||||
|
|
||||||
\vartable
|
|
||||||
\phi | flux
|
|
||||||
Dp | pressure diffusivity
|
|
||||||
Sf | patch face areas [m2]
|
|
||||||
\endvartable
|
|
||||||
|
|
||||||
\heading Patch usage
|
|
||||||
|
|
||||||
\table
|
|
||||||
Property | Description | Required | Default value
|
|
||||||
phiHbyA | name of predicted flux field | no | phiHbyA
|
|
||||||
phi | name of flux field | no | phi
|
|
||||||
rho | name of density field | no | rho
|
|
||||||
Dp | name of pressure diffusivity field | no | Dp
|
|
||||||
\endtable
|
|
||||||
|
|
||||||
Example of the boundary condition specification:
|
|
||||||
\verbatim
|
|
||||||
myPatch
|
|
||||||
{
|
|
||||||
type multiphaseFixedFluxPressure;
|
|
||||||
phiHbyA phiHbyA;
|
|
||||||
phi phi;
|
|
||||||
rho rho;
|
|
||||||
Dp Dp;
|
|
||||||
}
|
|
||||||
\endverbatim
|
|
||||||
|
|
||||||
SourceFiles
|
|
||||||
multiphaseFixedFluxPressureFvPatchScalarField.C
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#ifndef multiphaseFixedFluxPressureFvPatchScalarFields_H
|
|
||||||
#define multiphaseFixedFluxPressureFvPatchScalarFields_H
|
|
||||||
|
|
||||||
#include "fvPatchFields.H"
|
|
||||||
#include "fixedGradientFvPatchFields.H"
|
|
||||||
#include "Switch.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
Class multiphaseFixedFluxPressureFvPatch Declaration
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
class multiphaseFixedFluxPressureFvPatchScalarField
|
|
||||||
:
|
|
||||||
public fixedGradientFvPatchScalarField
|
|
||||||
{
|
|
||||||
// Private data
|
|
||||||
|
|
||||||
//- Name of the predicted flux transporting the field
|
|
||||||
word phiHbyAName_;
|
|
||||||
|
|
||||||
//- Name of the flux transporting the field
|
|
||||||
word phiName_;
|
|
||||||
|
|
||||||
//- Name of the density field used to normalise the mass flux
|
|
||||||
// if neccessary
|
|
||||||
word rhoName_;
|
|
||||||
|
|
||||||
//- Name of the pressure diffusivity field
|
|
||||||
word DpName_;
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
//- Runtime type information
|
|
||||||
TypeName("multiphaseFixedFluxPressure");
|
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
|
||||||
|
|
||||||
//- Construct from patch and internal field
|
|
||||||
multiphaseFixedFluxPressureFvPatchScalarField
|
|
||||||
(
|
|
||||||
const fvPatch&,
|
|
||||||
const DimensionedField<scalar, volMesh>&
|
|
||||||
);
|
|
||||||
|
|
||||||
//- Construct from patch, internal field and dictionary
|
|
||||||
multiphaseFixedFluxPressureFvPatchScalarField
|
|
||||||
(
|
|
||||||
const fvPatch&,
|
|
||||||
const DimensionedField<scalar, volMesh>&,
|
|
||||||
const dictionary&
|
|
||||||
);
|
|
||||||
|
|
||||||
//- Construct by mapping given
|
|
||||||
// multiphaseFixedFluxPressureFvPatchScalarField onto a new patch
|
|
||||||
multiphaseFixedFluxPressureFvPatchScalarField
|
|
||||||
(
|
|
||||||
const multiphaseFixedFluxPressureFvPatchScalarField&,
|
|
||||||
const fvPatch&,
|
|
||||||
const DimensionedField<scalar, volMesh>&,
|
|
||||||
const fvPatchFieldMapper&
|
|
||||||
);
|
|
||||||
|
|
||||||
//- Construct as copy
|
|
||||||
multiphaseFixedFluxPressureFvPatchScalarField
|
|
||||||
(
|
|
||||||
const multiphaseFixedFluxPressureFvPatchScalarField&
|
|
||||||
);
|
|
||||||
|
|
||||||
//- Construct and return a clone
|
|
||||||
virtual tmp<fvPatchScalarField> clone() const
|
|
||||||
{
|
|
||||||
return tmp<fvPatchScalarField>
|
|
||||||
(
|
|
||||||
new multiphaseFixedFluxPressureFvPatchScalarField(*this)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
//- Construct as copy setting internal field reference
|
|
||||||
multiphaseFixedFluxPressureFvPatchScalarField
|
|
||||||
(
|
|
||||||
const multiphaseFixedFluxPressureFvPatchScalarField&,
|
|
||||||
const DimensionedField<scalar, volMesh>&
|
|
||||||
);
|
|
||||||
|
|
||||||
//- Construct and return a clone setting internal field reference
|
|
||||||
virtual tmp<fvPatchScalarField> clone
|
|
||||||
(
|
|
||||||
const DimensionedField<scalar, volMesh>& iF
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
return tmp<fvPatchScalarField>
|
|
||||||
(
|
|
||||||
new multiphaseFixedFluxPressureFvPatchScalarField(*this, iF)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Member functions
|
|
||||||
|
|
||||||
//- Update the coefficients associated with the patch field
|
|
||||||
virtual void updateCoeffs();
|
|
||||||
|
|
||||||
//- Write
|
|
||||||
virtual void write(Ostream&) const;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -27,6 +27,7 @@ License
|
|||||||
#include "fvMesh.H"
|
#include "fvMesh.H"
|
||||||
#include "fvMatrices.H"
|
#include "fvMatrices.H"
|
||||||
#include "volFields.H"
|
#include "volFields.H"
|
||||||
|
#include "fvsPatchFields.H"
|
||||||
#include "ListOps.H"
|
#include "ListOps.H"
|
||||||
#include "addToRunTimeSelectionTable.H"
|
#include "addToRunTimeSelectionTable.H"
|
||||||
|
|
||||||
@ -480,6 +481,15 @@ void Foam::fv::option::makeRelative(surfaceScalarField& phi) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::fv::option::makeRelative
|
||||||
|
(
|
||||||
|
FieldField<fvsPatchField, scalar>& phi
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
// do nothing
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void Foam::fv::option::makeRelative
|
void Foam::fv::option::makeRelative
|
||||||
(
|
(
|
||||||
const surfaceScalarField& rho,
|
const surfaceScalarField& rho,
|
||||||
|
|||||||
@ -427,6 +427,12 @@ public:
|
|||||||
//- Make the given absolute flux relative
|
//- Make the given absolute flux relative
|
||||||
virtual void makeRelative(surfaceScalarField& phi) const;
|
virtual void makeRelative(surfaceScalarField& phi) const;
|
||||||
|
|
||||||
|
//- Make the given absolute boundary flux relative
|
||||||
|
virtual void makeRelative
|
||||||
|
(
|
||||||
|
FieldField<fvsPatchField, scalar>& phi
|
||||||
|
) const;
|
||||||
|
|
||||||
//- Make the given absolute mass-flux relative
|
//- Make the given absolute mass-flux relative
|
||||||
virtual void makeRelative
|
virtual void makeRelative
|
||||||
(
|
(
|
||||||
|
|||||||
@ -26,6 +26,7 @@ License
|
|||||||
#include "fvOptionList.H"
|
#include "fvOptionList.H"
|
||||||
#include "addToRunTimeSelectionTable.H"
|
#include "addToRunTimeSelectionTable.H"
|
||||||
#include "fvMesh.H"
|
#include "fvMesh.H"
|
||||||
|
#include "surfaceFields.H"
|
||||||
#include "Time.H"
|
#include "Time.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
@ -129,6 +130,23 @@ void Foam::fv::optionList::makeRelative
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::tmp<Foam::FieldField<Foam::fvsPatchField, Foam::scalar> >
|
||||||
|
Foam::fv::optionList::relative
|
||||||
|
(
|
||||||
|
const tmp<FieldField<fvsPatchField, scalar> >& phi
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
tmp<FieldField<fvsPatchField, scalar> > rphi(phi.ptr());
|
||||||
|
|
||||||
|
forAll(*this, i)
|
||||||
|
{
|
||||||
|
operator[](i).makeRelative(rphi());
|
||||||
|
}
|
||||||
|
|
||||||
|
return rphi;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void Foam::fv::optionList::makeAbsolute(surfaceScalarField& phi) const
|
void Foam::fv::optionList::makeAbsolute(surfaceScalarField& phi) const
|
||||||
{
|
{
|
||||||
forAll(*this, i)
|
forAll(*this, i)
|
||||||
|
|||||||
@ -166,6 +166,12 @@ public:
|
|||||||
surfaceScalarField& phi
|
surfaceScalarField& phi
|
||||||
) const;
|
) const;
|
||||||
|
|
||||||
|
//- Return the given absolute boundary flux relative
|
||||||
|
tmp<FieldField<fvsPatchField, scalar> > relative
|
||||||
|
(
|
||||||
|
const tmp<FieldField<fvsPatchField, scalar> >& tphi
|
||||||
|
) const;
|
||||||
|
|
||||||
//- Make the given relative flux absolute
|
//- Make the given relative flux absolute
|
||||||
void makeAbsolute(surfaceScalarField& phi) const;
|
void makeAbsolute(surfaceScalarField& phi) const;
|
||||||
|
|
||||||
|
|||||||
@ -126,6 +126,15 @@ void Foam::fv::MRFSource::makeRelative(surfaceScalarField& phi) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::fv::MRFSource::makeRelative
|
||||||
|
(
|
||||||
|
FieldField<fvsPatchField, scalar>& phi
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
mrfPtr_->makeRelative(phi);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void Foam::fv::MRFSource::makeRelative
|
void Foam::fv::MRFSource::makeRelative
|
||||||
(
|
(
|
||||||
const surfaceScalarField& rho,
|
const surfaceScalarField& rho,
|
||||||
|
|||||||
@ -140,6 +140,12 @@ public:
|
|||||||
//- Make the given absolute flux relative
|
//- Make the given absolute flux relative
|
||||||
virtual void makeRelative(surfaceScalarField& phi) const;
|
virtual void makeRelative(surfaceScalarField& phi) const;
|
||||||
|
|
||||||
|
//- Make the given absolute boundary flux relative
|
||||||
|
virtual void makeRelative
|
||||||
|
(
|
||||||
|
FieldField<fvsPatchField, scalar>& phi
|
||||||
|
) const;
|
||||||
|
|
||||||
//- Make the given absolute mass-flux relative
|
//- Make the given absolute mass-flux relative
|
||||||
virtual void makeRelative
|
virtual void makeRelative
|
||||||
(
|
(
|
||||||
|
|||||||
@ -23,7 +23,6 @@ boundaryField
|
|||||||
walls
|
walls
|
||||||
{
|
{
|
||||||
type fixedFluxPressure;
|
type fixedFluxPressure;
|
||||||
value uniform 1e5;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
defaultFaces
|
defaultFaces
|
||||||
|
|||||||
@ -30,14 +30,3 @@ boundaryField
|
|||||||
p0 uniform 0;
|
p0 uniform 0;
|
||||||
value uniform 0;
|
value uniform 0;
|
||||||
}
|
}
|
||||||
walls
|
|
||||||
{
|
|
||||||
type fixedFluxPressure;
|
|
||||||
gradient uniform 0;
|
|
||||||
phi phiAbs;
|
|
||||||
value uniform 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
|
|||||||
@ -31,8 +31,6 @@ boundaryField
|
|||||||
walls
|
walls
|
||||||
{
|
{
|
||||||
type fixedFluxPressure;
|
type fixedFluxPressure;
|
||||||
phi phiAbs;
|
|
||||||
value uniform 0;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user