ENH: modified laplacianFoam to use dimScalar or volScalar for DT (#1388)

This commit is contained in:
sergio
2019-10-07 12:59:39 -07:00
committed by Mark Olesen
parent 01b4519f27
commit d04de0d481
2 changed files with 36 additions and 11 deletions

View File

@ -14,10 +14,26 @@ volScalarField T
); );
Info<< "Reading transportProperties\n" << endl; Info<< "Reading diffusivity DT\n" << endl;
IOdictionary transportProperties volScalarField DT
( (
IOobject
(
"DT",
runTime.timeName(),
mesh,
IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE
),
mesh,
dimensionedScalar(dimViscosity, Zero)
);
if (!DT.headerOk())
{
IOdictionary transportProperties
(
IOobject IOobject
( (
"transportProperties", "transportProperties",
@ -26,11 +42,8 @@ IOdictionary transportProperties
IOobject::MUST_READ_IF_MODIFIED, IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE IOobject::NO_WRITE
) )
); );
DT = dimensionedScalar("DT", dimViscosity, transportProperties);
}
Info<< "Reading diffusivity DT\n" << endl;
dimensionedScalar DT("DT", dimViscosity, transportProperties);
#include "createFvOptions.H" #include "createFvOptions.H"

View File

@ -41,6 +41,18 @@
gradT.component(vector::Z) gradT.component(vector::Z)
); );
volVectorField DTgradT
(
IOobject
(
"flux",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
DT*gradT
);
runTime.write(); runTime.write();
} }