2010-05-12 13:27:55 +00:00
|
|
|
scalar totalVolume = sum(mesh.V()).value();
|
|
|
|
|
|
|
|
Info<< "Reading thermophysical properties\n" << endl;
|
|
|
|
|
2010-09-22 18:13:13 +00:00
|
|
|
autoPtr<basicPsiThermo> pThermo
|
2010-05-12 13:27:55 +00:00
|
|
|
(
|
2010-09-22 18:13:13 +00:00
|
|
|
basicPsiThermo::New(mesh)
|
2010-05-12 13:27:55 +00:00
|
|
|
);
|
2010-09-22 18:13:13 +00:00
|
|
|
basicPsiThermo& thermo = pThermo();
|
2010-05-12 13:27:55 +00:00
|
|
|
|
2011-03-22 12:29:57 +00:00
|
|
|
// Make density field with zero gradient boundary conditions to handle
|
|
|
|
// attach-detach cases. HJ, 20/Mar/2011
|
2010-05-12 13:27:55 +00:00
|
|
|
volScalarField rho
|
|
|
|
(
|
|
|
|
IOobject
|
|
|
|
(
|
|
|
|
"rho",
|
|
|
|
runTime.timeName(),
|
|
|
|
mesh,
|
|
|
|
IOobject::NO_READ,
|
|
|
|
IOobject::AUTO_WRITE
|
|
|
|
),
|
2011-03-22 12:29:57 +00:00
|
|
|
thermo.rho(),
|
|
|
|
zeroGradientFvPatchScalarField::typeName
|
2010-05-12 13:27:55 +00:00
|
|
|
);
|
|
|
|
rho.oldTime();
|
|
|
|
|
2010-09-22 18:13:13 +00:00
|
|
|
volScalarField& p = thermo.p();
|
2010-05-12 13:27:55 +00:00
|
|
|
p.oldTime();
|
2010-09-22 18:13:13 +00:00
|
|
|
|
|
|
|
const volScalarField& psi = thermo.psi();
|
|
|
|
const volScalarField& T = thermo.T();
|
|
|
|
volScalarField& h = thermo.h();
|
2010-05-12 13:27:55 +00:00
|
|
|
|
|
|
|
|
|
|
|
Info<< "\nReading field U\n" << endl;
|
|
|
|
volVectorField U
|
|
|
|
(
|
|
|
|
IOobject
|
|
|
|
(
|
|
|
|
"U",
|
|
|
|
runTime.timeName(),
|
|
|
|
mesh,
|
|
|
|
IOobject::MUST_READ,
|
|
|
|
IOobject::AUTO_WRITE
|
|
|
|
),
|
|
|
|
mesh
|
|
|
|
);
|
|
|
|
|
|
|
|
# include "compressibleCreatePhi.H"
|
|
|
|
|
|
|
|
|
|
|
|
Info<< "Creating turbulence model\n" << endl;
|
2010-09-22 18:13:13 +00:00
|
|
|
autoPtr<compressible::turbulenceModel> turbulence
|
2010-05-12 13:27:55 +00:00
|
|
|
(
|
2010-09-22 18:13:13 +00:00
|
|
|
compressible::turbulenceModel::New
|
2010-05-12 13:27:55 +00:00
|
|
|
(
|
|
|
|
rho,
|
|
|
|
U,
|
|
|
|
phi,
|
2010-09-22 18:13:13 +00:00
|
|
|
thermo
|
2010-05-12 13:27:55 +00:00
|
|
|
)
|
|
|
|
);
|
|
|
|
|
|
|
|
Info<< "Creating field DpDt\n" << endl;
|
|
|
|
volScalarField DpDt
|
|
|
|
(
|
|
|
|
IOobject
|
|
|
|
(
|
|
|
|
"DpDt",
|
|
|
|
runTime.timeName(),
|
|
|
|
mesh,
|
|
|
|
IOobject::NO_READ,
|
|
|
|
IOobject::NO_WRITE
|
|
|
|
),
|
|
|
|
fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p)
|
|
|
|
);
|
|
|
|
|
2011-03-22 12:29:57 +00:00
|
|
|
volScalarField dpdt = fvc::ddt(p);
|
2010-05-12 13:27:55 +00:00
|
|
|
|
|
|
|
volScalarField rUA
|
|
|
|
(
|
|
|
|
IOobject
|
|
|
|
(
|
|
|
|
"rUA",
|
|
|
|
runTime.timeName(),
|
|
|
|
mesh
|
|
|
|
),
|
|
|
|
mesh,
|
|
|
|
dimensionedScalar("rUA", dimensionSet(-1, 3, 1, 0, 0, 0, 0), 1),
|
|
|
|
zeroGradientFvPatchScalarField::typeName
|
|
|
|
);
|
|
|
|
|
|
|
|
volVectorField H
|
|
|
|
(
|
|
|
|
IOobject
|
|
|
|
(
|
|
|
|
"H",
|
|
|
|
runTime.timeName(),
|
|
|
|
mesh
|
|
|
|
),
|
|
|
|
mesh,
|
|
|
|
dimensionedVector("H", U.dimensions()/rUA.dimensions(), vector::zero),
|
|
|
|
zeroGradientFvPatchVectorField::typeName
|
|
|
|
);
|
|
|
|
|
|
|
|
volScalarField divPhi
|
|
|
|
(
|
|
|
|
IOobject
|
|
|
|
(
|
|
|
|
"divPhi",
|
|
|
|
runTime.timeName(),
|
|
|
|
mesh
|
|
|
|
),
|
|
|
|
fvc::div(phi)
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
surfaceScalarField meshFlux
|
|
|
|
(
|
|
|
|
IOobject
|
|
|
|
(
|
|
|
|
"meshFlux",
|
|
|
|
runTime.timeName(),
|
|
|
|
mesh,
|
|
|
|
IOobject::NO_READ,
|
|
|
|
IOobject::NO_WRITE
|
|
|
|
),
|
|
|
|
fvc::interpolate(rho) * fvc::meshPhi(U)
|
|
|
|
);
|