2010-09-22 18:13:13 +00:00
|
|
|
Info<< "Reading field p_rgh\n" << endl;
|
|
|
|
volScalarField p_rgh
|
2010-05-12 13:27:55 +00:00
|
|
|
(
|
|
|
|
IOobject
|
|
|
|
(
|
2010-09-22 18:13:13 +00:00
|
|
|
"p_rgh",
|
2010-05-12 13:27:55 +00:00
|
|
|
runTime.timeName(),
|
|
|
|
mesh,
|
|
|
|
IOobject::MUST_READ,
|
|
|
|
IOobject::AUTO_WRITE
|
|
|
|
),
|
|
|
|
mesh
|
|
|
|
);
|
|
|
|
|
2010-09-22 18:13:13 +00:00
|
|
|
Info<< "Reading field alpha1\n" << endl;
|
|
|
|
volScalarField alpha1
|
2010-05-12 13:27:55 +00:00
|
|
|
(
|
|
|
|
IOobject
|
|
|
|
(
|
2010-09-22 18:13:13 +00:00
|
|
|
"alpha1",
|
2010-05-12 13:27:55 +00:00
|
|
|
runTime.timeName(),
|
|
|
|
mesh,
|
|
|
|
IOobject::MUST_READ,
|
|
|
|
IOobject::AUTO_WRITE
|
|
|
|
),
|
|
|
|
mesh
|
|
|
|
);
|
|
|
|
|
|
|
|
Info<< "Reading field U\n" << endl;
|
|
|
|
volVectorField U
|
|
|
|
(
|
|
|
|
IOobject
|
|
|
|
(
|
|
|
|
"U",
|
|
|
|
runTime.timeName(),
|
|
|
|
mesh,
|
|
|
|
IOobject::MUST_READ,
|
|
|
|
IOobject::AUTO_WRITE
|
|
|
|
),
|
|
|
|
mesh
|
|
|
|
);
|
|
|
|
|
2010-09-22 18:13:13 +00:00
|
|
|
#include "createPhi.H"
|
2010-05-12 13:27:55 +00:00
|
|
|
|
|
|
|
Info<< "Reading transportProperties\n" << endl;
|
2010-09-22 18:13:13 +00:00
|
|
|
twoPhaseMixture twoPhaseProperties(U, phi);
|
|
|
|
|
2010-05-12 13:27:55 +00:00
|
|
|
const dimensionedScalar& rho1 = twoPhaseProperties.rho1();
|
|
|
|
const dimensionedScalar& rho2 = twoPhaseProperties.rho2();
|
|
|
|
|
|
|
|
dimensionedScalar Dab(twoPhaseProperties.lookup("Dab"));
|
|
|
|
|
2010-09-22 18:13:13 +00:00
|
|
|
// Read the reciprocal of the turbulent Schmidt number
|
|
|
|
dimensionedScalar alphatab(twoPhaseProperties.lookup("alphatab"));
|
|
|
|
|
2010-05-12 13:27:55 +00:00
|
|
|
// Need to store rho for ddt(rho, U)
|
2010-09-22 18:13:13 +00:00
|
|
|
volScalarField rho("rho", alpha1*rho1 + (scalar(1) - alpha1)*rho2);
|
2010-05-12 13:27:55 +00:00
|
|
|
rho.oldTime();
|
|
|
|
|
|
|
|
|
|
|
|
// Mass flux
|
|
|
|
// Initialisation does not matter because rhoPhi is reset after the
|
2010-09-22 18:13:13 +00:00
|
|
|
// alpha1 solution before it is used in the U equation.
|
2010-05-12 13:27:55 +00:00
|
|
|
surfaceScalarField rhoPhi
|
|
|
|
(
|
|
|
|
IOobject
|
|
|
|
(
|
|
|
|
"rho*phi",
|
|
|
|
runTime.timeName(),
|
|
|
|
mesh,
|
|
|
|
IOobject::NO_READ,
|
|
|
|
IOobject::NO_WRITE
|
|
|
|
),
|
|
|
|
rho1*phi
|
|
|
|
);
|
|
|
|
|
2010-09-22 18:13:13 +00:00
|
|
|
Info<< "Calculating field (g.h)f\n" << endl;
|
|
|
|
volScalarField gh("gh", g & mesh.C());
|
|
|
|
surfaceScalarField ghf = surfaceScalarField("gh", g & mesh.Cf());
|
2010-05-12 13:27:55 +00:00
|
|
|
|
2010-09-22 18:13:13 +00:00
|
|
|
volScalarField p
|
|
|
|
(
|
|
|
|
IOobject
|
|
|
|
(
|
|
|
|
"p",
|
|
|
|
runTime.timeName(),
|
|
|
|
mesh,
|
|
|
|
IOobject::NO_READ,
|
|
|
|
IOobject::AUTO_WRITE
|
|
|
|
),
|
|
|
|
p_rgh + rho*gh
|
|
|
|
);
|
2010-05-12 13:27:55 +00:00
|
|
|
|
2010-09-22 18:13:13 +00:00
|
|
|
label p_rghRefCell = 0;
|
|
|
|
scalar p_rghRefValue = 0.0;
|
2016-05-28 02:11:10 +00:00
|
|
|
setRefCell(p_rgh, pimple.dict(), p_rghRefCell, p_rghRefValue);
|
|
|
|
mesh.schemesDict().setFluxRequired(p_rgh.name());
|
2010-09-22 18:13:13 +00:00
|
|
|
|
|
|
|
scalar pRefValue = 0.0;
|
|
|
|
|
|
|
|
if (p_rgh.needReference())
|
|
|
|
{
|
2016-05-28 02:11:10 +00:00
|
|
|
pRefValue = readScalar(pimple.dict().lookup("pRefValue"));
|
2010-05-12 13:27:55 +00:00
|
|
|
|
2010-09-22 18:13:13 +00:00
|
|
|
p += dimensionedScalar
|
|
|
|
(
|
|
|
|
"p",
|
|
|
|
p.dimensions(),
|
|
|
|
pRefValue - getRefCellValue(p, p_rghRefCell)
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Construct incompressible turbulence model
|
|
|
|
autoPtr<incompressible::turbulenceModel> turbulence
|
|
|
|
(
|
|
|
|
incompressible::turbulenceModel::New(U, phi, twoPhaseProperties)
|
|
|
|
);
|