ENH: add guarded lookup for dimensionedSet

STYLE: use standard dimensionedSets
This commit is contained in:
Mark Olesen
2019-01-02 16:53:41 +01:00
parent 2ce944a748
commit 505b4b9c1c
22 changed files with 58 additions and 80 deletions

View File

@ -71,9 +71,8 @@
const surfaceVectorField& Sf = mesh.Sf();
forAll(faces, i)
for (const label facei : faces)
{
label facei = faces[i];
murf[facei] = muri;
Mrf[facei] = Mri*(orientationi & Sf[facei]);
}

View File

@ -1,7 +1,7 @@
Info<< "Constructing momentum equations" << endl;
fvVectorMatrix U1Eqn(U1, rho1.dimensions()*U1.dimensions()*dimVol/dimTime);
fvVectorMatrix U2Eqn(U2, rho2.dimensions()*U2.dimensions()*dimVol/dimTime);
fvVectorMatrix U1Eqn(U1, rho1.dimensions()*U1.dimensions()*dimVolume/dimTime);
fvVectorMatrix U2Eqn(U2, rho2.dimensions()*U2.dimensions()*dimVolume/dimTime);
{
autoPtr<phaseSystem::momentumTransferTable>

View File

@ -1,7 +1,7 @@
Info<< "Constructing face momentum equations" << endl;
fvVectorMatrix U1Eqn(U1, rho1.dimensions()*U1.dimensions()*dimVol/dimTime);
fvVectorMatrix U2Eqn(U2, rho2.dimensions()*U2.dimensions()*dimVol/dimTime);
fvVectorMatrix U1Eqn(U1, rho1.dimensions()*U1.dimensions()*dimVolume/dimTime);
fvVectorMatrix U2Eqn(U2, rho2.dimensions()*U2.dimensions()*dimVolume/dimTime);
{
volScalarField Vm(fluid.Vm());

View File

@ -57,7 +57,7 @@ Foam::kineticTheoryModels::conductivityModels::HrenyaSinclair::HrenyaSinclair
:
conductivityModel(dict),
coeffDict_(dict.optionalSubDict(typeName + "Coeffs")),
L_("L", dimensionSet(0, 1, 0, 0, 0), coeffDict_)
L_("L", dimLength, coeffDict_)
{}

View File

@ -57,7 +57,7 @@ Foam::kineticTheoryModels::viscosityModels::HrenyaSinclair::HrenyaSinclair
:
viscosityModel(dict),
coeffDict_(dict.optionalSubDict(typeName + "Coeffs")),
L_("L", dimensionSet(0, 1, 0, 0, 0), coeffDict_)
L_("L", dimLength, coeffDict_)
{}

View File

@ -60,12 +60,7 @@ Foam::RASModels::phasePressureModel::phasePressureModel
alphaMax_(coeffDict_.get<scalar>("alphaMax")),
preAlphaExp_(coeffDict_.get<scalar>("preAlphaExp")),
expMax_(coeffDict_.get<scalar>("expMax")),
g0_
(
"g0",
dimensionSet(1, -1, -2, 0, 0),
coeffDict_.lookup("g0")
)
g0_("g0", dimPressure, coeffDict_)
{
nut_ == dimensionedScalar(nut_.dimensions(), Zero);
@ -76,12 +71,6 @@ Foam::RASModels::phasePressureModel::phasePressureModel
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::RASModels::phasePressureModel::~phasePressureModel()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
bool Foam::RASModels::phasePressureModel::read()
@ -101,10 +90,8 @@ bool Foam::RASModels::phasePressureModel::read()
return true;
}
else
{
return false;
}
return false;
}
@ -138,7 +125,7 @@ Foam::RASModels::phasePressureModel::R() const
IOobject::NO_WRITE
),
mesh_,
dimensioned<symmTensor>(dimensionSet(0, 2, -2, 0, 0)) //Zero
dimensioned<symmTensor>(dimensionSet(0, 2, -2, 0, 0), Zero)
);
}

View File

@ -132,7 +132,7 @@ public:
//- Destructor
virtual ~phasePressureModel();
virtual ~phasePressureModel() = default;
// Member Functions

View File

@ -4,8 +4,8 @@ MRF.correctBoundaryVelocity(U1);
MRF.correctBoundaryVelocity(U2);
MRF.correctBoundaryVelocity(U);
fvVectorMatrix U1Eqn(U1, rho1.dimensions()*U1.dimensions()*dimVol/dimTime);
fvVectorMatrix U2Eqn(U2, rho2.dimensions()*U2.dimensions()*dimVol/dimTime);
fvVectorMatrix U1Eqn(U1, rho1.dimensions()*U1.dimensions()*dimVolume/dimTime);
fvVectorMatrix U2Eqn(U2, rho2.dimensions()*U2.dimensions()*dimVolume/dimTime);
volScalarField Kd(fluid.Kd());

View File

@ -5,8 +5,8 @@ MRF.correctBoundaryVelocity(U2);
MRF.correctBoundaryVelocity(U);
Info<< "Constructing face momentum equations" << endl;
fvVectorMatrix U1Eqn(U1, rho1.dimensions()*U1.dimensions()*dimVol/dimTime);
fvVectorMatrix U2Eqn(U2, rho2.dimensions()*U2.dimensions()*dimVol/dimTime);
fvVectorMatrix U1Eqn(U1, rho1.dimensions()*U1.dimensions()*dimVolume/dimTime);
fvVectorMatrix U2Eqn(U2, rho2.dimensions()*U2.dimensions()*dimVolume/dimTime);
{
volScalarField Vm(fluid.Vm());

View File

@ -57,7 +57,7 @@ Foam::kineticTheoryModels::conductivityModels::HrenyaSinclair::HrenyaSinclair
:
conductivityModel(dict),
coeffDict_(dict.optionalSubDict(typeName + "Coeffs")),
L_("L", dimensionSet(0, 1, 0, 0, 0), coeffDict_)
L_("L", dimLength, coeffDict_)
{}

View File

@ -114,7 +114,7 @@ Foam::RASModels::kineticTheoryModel::kineticTheoryModel
maxNut_
(
"maxNut",
dimensionSet(0,2,-1,0,0),
dimViscosity,
coeffDict_.lookupOrDefault<scalar>("maxNut",1000)
),
@ -142,7 +142,7 @@ Foam::RASModels::kineticTheoryModel::kineticTheoryModel
IOobject::NO_WRITE
),
U.mesh(),
dimensionedScalar(dimensionSet(0, 2, -1, 0, 0), Zero)
dimensionedScalar(dimViscosity, Zero)
),
gs0_
@ -156,7 +156,7 @@ Foam::RASModels::kineticTheoryModel::kineticTheoryModel
IOobject::NO_WRITE
),
U.mesh(),
dimensionedScalar(dimensionSet(0, 0, 0, 0, 0), Zero)
dimensionedScalar(dimless, Zero)
),
kappa_
@ -184,7 +184,7 @@ Foam::RASModels::kineticTheoryModel::kineticTheoryModel
IOobject::AUTO_WRITE
),
U.mesh(),
dimensionedScalar(dimensionSet(0, 2, -1, 0, 0), Zero)
dimensionedScalar(dimViscosity, Zero)
)
{
if (type == typeName)

View File

@ -57,7 +57,7 @@ Foam::kineticTheoryModels::viscosityModels::HrenyaSinclair::HrenyaSinclair
:
viscosityModel(dict),
coeffDict_(dict.optionalSubDict(typeName + "Coeffs")),
L_("L", dimensionSet(0, 1, 0, 0, 0), coeffDict_)
L_("L", dimLength, coeffDict_)
{}

View File

@ -63,12 +63,7 @@ Foam::RASModels::phasePressureModel::phasePressureModel
alphaMax_(coeffDict_.get<scalar>("alphaMax")),
preAlphaExp_(coeffDict_.get<scalar>("preAlphaExp")),
expMax_(coeffDict_.get<scalar>("expMax")),
g0_
(
"g0",
dimensionSet(1, -1, -2, 0, 0),
coeffDict_.lookup("g0")
)
g0_("g0", dimPressure, coeffDict_)
{
nut_ == dimensionedScalar(nut_.dimensions(), Zero);
@ -79,12 +74,6 @@ Foam::RASModels::phasePressureModel::phasePressureModel
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::RASModels::phasePressureModel::~phasePressureModel()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
bool Foam::RASModels::phasePressureModel::read()
@ -107,10 +96,8 @@ bool Foam::RASModels::phasePressureModel::read()
return true;
}
else
{
return false;
}
return false;
}

View File

@ -136,7 +136,7 @@ public:
//- Destructor
virtual ~phasePressureModel();
virtual ~phasePressureModel() = default;
// Member Functions

View File

@ -221,7 +221,7 @@ void Foam::solverTemplate::setRegionProperties
fieldDimensions_[regionI].set
(
i,
new dimensionSet(dict.lookup("dimensions"))
new dimensionSet(dict, "dimensions")
);
}
}