mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: Updated reading of dimensioned types from transportProperties dictionary to avoid the need to provide the dimension set
This commit is contained in:
@ -1,37 +1,39 @@
|
||||
Info<< "Reading field T\n" << endl;
|
||||
Info<< "Reading field T\n" << endl;
|
||||
|
||||
volScalarField T
|
||||
volScalarField T
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"T",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh
|
||||
);
|
||||
"T",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh
|
||||
);
|
||||
|
||||
|
||||
Info<< "Reading transportProperties\n" << endl;
|
||||
Info<< "Reading transportProperties\n" << endl;
|
||||
|
||||
IOdictionary transportProperties
|
||||
IOdictionary transportProperties
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"transportProperties",
|
||||
runTime.constant(),
|
||||
mesh,
|
||||
IOobject::MUST_READ_IF_MODIFIED,
|
||||
IOobject::NO_WRITE
|
||||
)
|
||||
);
|
||||
"transportProperties",
|
||||
runTime.constant(),
|
||||
mesh,
|
||||
IOobject::MUST_READ_IF_MODIFIED,
|
||||
IOobject::NO_WRITE
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
Info<< "Reading diffusivity DT\n" << endl;
|
||||
Info<< "Reading diffusivity DT\n" << endl;
|
||||
|
||||
dimensionedScalar DT
|
||||
(
|
||||
transportProperties.lookup("DT")
|
||||
);
|
||||
dimensionedScalar DT
|
||||
(
|
||||
"DT",
|
||||
dimArea/dimTime,
|
||||
transportProperties
|
||||
);
|
||||
|
||||
@ -1,55 +1,57 @@
|
||||
Info<< "Reading field T\n" << endl;
|
||||
Info<< "Reading field T\n" << endl;
|
||||
|
||||
volScalarField T
|
||||
volScalarField T
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"T",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh
|
||||
);
|
||||
"T",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh
|
||||
);
|
||||
|
||||
|
||||
Info<< "Reading field U\n" << endl;
|
||||
Info<< "Reading field U\n" << endl;
|
||||
|
||||
volVectorField U
|
||||
volVectorField U
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"U",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh
|
||||
);
|
||||
"U",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh
|
||||
);
|
||||
|
||||
|
||||
Info<< "Reading transportProperties\n" << endl;
|
||||
Info<< "Reading transportProperties\n" << endl;
|
||||
|
||||
IOdictionary transportProperties
|
||||
IOdictionary transportProperties
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"transportProperties",
|
||||
runTime.constant(),
|
||||
mesh,
|
||||
IOobject::MUST_READ_IF_MODIFIED,
|
||||
IOobject::NO_WRITE
|
||||
)
|
||||
);
|
||||
"transportProperties",
|
||||
runTime.constant(),
|
||||
mesh,
|
||||
IOobject::MUST_READ_IF_MODIFIED,
|
||||
IOobject::NO_WRITE
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
Info<< "Reading diffusivity DT\n" << endl;
|
||||
Info<< "Reading diffusivity DT\n" << endl;
|
||||
|
||||
dimensionedScalar DT
|
||||
(
|
||||
transportProperties.lookup("DT")
|
||||
);
|
||||
dimensionedScalar DT
|
||||
(
|
||||
"DT",
|
||||
dimArea/dimTime,
|
||||
transportProperties
|
||||
);
|
||||
|
||||
#include "createPhi.H"
|
||||
#include "createPhi.H"
|
||||
|
||||
@ -1,37 +1,37 @@
|
||||
Info<< "Reading thermodynamicProperties\n" << endl;
|
||||
Info<< "Reading thermodynamicProperties\n" << endl;
|
||||
|
||||
IOdictionary thermodynamicProperties
|
||||
IOdictionary thermodynamicProperties
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"thermodynamicProperties",
|
||||
runTime.constant(),
|
||||
mesh,
|
||||
IOobject::MUST_READ_IF_MODIFIED,
|
||||
IOobject::NO_WRITE
|
||||
)
|
||||
);
|
||||
"thermodynamicProperties",
|
||||
runTime.constant(),
|
||||
mesh,
|
||||
IOobject::MUST_READ_IF_MODIFIED,
|
||||
IOobject::NO_WRITE
|
||||
)
|
||||
);
|
||||
|
||||
dimensionedScalar rho0
|
||||
(
|
||||
"rho0",
|
||||
dimDensity,
|
||||
thermodynamicProperties
|
||||
);
|
||||
dimensionedScalar rho0
|
||||
(
|
||||
"rho0",
|
||||
dimDensity,
|
||||
thermodynamicProperties
|
||||
);
|
||||
|
||||
dimensionedScalar p0
|
||||
(
|
||||
"p0",
|
||||
dimPressure,
|
||||
thermodynamicProperties
|
||||
);
|
||||
dimensionedScalar p0
|
||||
(
|
||||
"p0",
|
||||
dimPressure,
|
||||
thermodynamicProperties
|
||||
);
|
||||
|
||||
dimensionedScalar psi
|
||||
(
|
||||
"psi",
|
||||
dimCompressibility,
|
||||
thermodynamicProperties
|
||||
);
|
||||
dimensionedScalar psi
|
||||
(
|
||||
"psi",
|
||||
dimCompressibility,
|
||||
thermodynamicProperties
|
||||
);
|
||||
|
||||
// Density offset, i.e. the constant part of the density
|
||||
dimensionedScalar rhoO("rhoO", rho0 - psi*p0);
|
||||
// Density offset, i.e. the constant part of the density
|
||||
dimensionedScalar rhoO("rhoO", rho0 - psi*p0);
|
||||
|
||||
@ -93,8 +93,6 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
Info<< "Time = " << runTime.timeName() << nl << endl;
|
||||
|
||||
laminarTransport.lookup("lambda") >> lambda;
|
||||
|
||||
//alpha +=
|
||||
// mesh.relaxationFactor("alpha")
|
||||
// *(lambda*max(Ua & U, zeroSensitivity) - alpha);
|
||||
|
||||
@ -89,8 +89,19 @@ autoPtr<incompressible::turbulenceModel> turbulence
|
||||
dimensionedScalar zeroSensitivity("0", dimVelocity*dimVelocity, 0.0);
|
||||
dimensionedScalar zeroAlpha("0", dimless/dimTime, 0.0);
|
||||
|
||||
dimensionedScalar lambda(laminarTransport.lookup("lambda"));
|
||||
dimensionedScalar alphaMax(laminarTransport.lookup("alphaMax"));
|
||||
dimensionedScalar lambda
|
||||
(
|
||||
"lambda",
|
||||
dimTime/sqr(dimLength),
|
||||
laminarTransport
|
||||
);
|
||||
|
||||
dimensionedScalar alphaMax
|
||||
(
|
||||
"alphaMax",
|
||||
dimless/dimTime,
|
||||
laminarTransport
|
||||
);
|
||||
|
||||
const labelList& inletCells = mesh.boundary()["inlet"].faceCells();
|
||||
//const labelList& outletCells = mesh.boundary()["outlet"].faceCells();
|
||||
|
||||
Reference in New Issue
Block a user