Commit 365f9b00 authored by Henry Weller's avatar Henry Weller
Browse files

dimensioned<Type>: Added constructor from name, dimensions and dictionary

to simplify construction of dimensionedScalar properties and avoid the
duplication of the name string in the constructor call.
parent 4c21f24a
......@@ -14,5 +14,7 @@
dimensionedScalar nu
(
transportProperties.lookup("nu")
"nu",
dimViscosity,
transportProperties
);
......@@ -51,8 +51,8 @@ Foam::PDRDragModels::basic::basic
)
:
PDRDragModel(PDRProperties, turbulence, rho, U, phi),
Csu("Csu", dimless, PDRDragModelCoeffs_.lookup("Csu")),
Csk("Csk", dimless, PDRDragModelCoeffs_.lookup("Csk")),
Csu("Csu", dimless, PDRDragModelCoeffs_),
Csk("Csk", dimless, PDRDragModelCoeffs_),
Aw_
(
......
......@@ -14,17 +14,23 @@
dimensionedScalar rho0
(
thermodynamicProperties.lookup("rho0")
"rho0",
dimDensity,
thermodynamicProperties
);
dimensionedScalar p0
(
thermodynamicProperties.lookup("p0")
"p0",
dimPressure,
thermodynamicProperties
);
dimensionedScalar psi
(
thermodynamicProperties.lookup("psi")
"psi",
dimCompressibility,
thermodynamicProperties
);
// Density offset, i.e. the constant part of the density
......
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
)
);
dimensionedScalar mu
(
transportProperties.lookup("mu")
);
dimensionedScalar mu
(
"mu",
dimDynamicViscosity,
transportProperties
);
......@@ -14,22 +14,30 @@ IOdictionary transportProperties
dimensionedScalar rho
(
transportProperties.lookup("rho")
"rho",
dimDensity,
transportProperties
);
dimensionedScalar nu
(
transportProperties.lookup("nu")
"nu",
dimViscosity,
transportProperties
);
dimensionedScalar mu
(
transportProperties.lookup("mu")
"mu",
dimensionSet(1, 1, -2, 0, 0, -2, 0),
transportProperties
);
dimensionedScalar sigma
(
transportProperties.lookup("sigma")
"sigma",
dimensionSet(-1, -3, 3, 0, 0, 2, 0),
transportProperties
);
Info<< "Reading field p\n" << endl;
......
......@@ -5,14 +5,14 @@ dimensionedScalar beta
(
"beta",
dimless/dimTemperature,
laminarTransport.lookup("beta")
laminarTransport
);
// Reference temperature [K]
dimensionedScalar TRef("TRef", dimTemperature, laminarTransport.lookup("TRef"));
dimensionedScalar TRef("TRef", dimTemperature, laminarTransport);
// Laminar Prandtl number
dimensionedScalar Pr("Pr", dimless, laminarTransport.lookup("Pr"));
dimensionedScalar Pr("Pr", dimless, laminarTransport);
// Turbulent Prandtl number
dimensionedScalar Prt("Prt", dimless, laminarTransport.lookup("Prt"));
dimensionedScalar Prt("Prt", dimless, laminarTransport);
......@@ -36,7 +36,7 @@ autoPtr<incompressible::RASModel> turbulence
incompressible::RASModel::New(U, phi, laminarTransport)
);
dimensionedVector Ubar("Ubar", dimVelocity, laminarTransport.lookup("Ubar"));
dimensionedVector Ubar("Ubar", dimVelocity, laminarTransport);
vector flowDirection = (Ubar/mag(Ubar)).value();
tensor flowMask = sqr(flowDirection);
......
......@@ -14,6 +14,8 @@ IOdictionary transportProperties
dimensionedScalar nu
(
"nu",
dimViscosity,
transportProperties.lookup("nu")
);
......
......@@ -20,7 +20,7 @@
(
"rhoInf",
dimDensity,
laminarTransport.lookup("rhoInf")
laminarTransport
);
volScalarField rhoInf
......
......@@ -16,28 +16,28 @@ dimensionedScalar psil
(
"psil",
dimCompressibility,
thermodynamicProperties.lookup("psil")
thermodynamicProperties
);
dimensionedScalar rholSat
(
"rholSat",
dimDensity,
thermodynamicProperties.lookup("rholSat")
thermodynamicProperties
);
dimensionedScalar psiv
(
"psiv",
dimCompressibility,
thermodynamicProperties.lookup("psiv")
thermodynamicProperties
);
dimensionedScalar pSat
(
"pSat",
dimPressure,
thermodynamicProperties.lookup("pSat")
thermodynamicProperties
);
dimensionedScalar rhovSat("rhovSat", psiv*pSat);
......@@ -48,5 +48,5 @@ dimensionedScalar rhoMin
(
"rhoMin",
dimDensity,
thermodynamicProperties.lookup("rhoMin")
thermodynamicProperties
);
......@@ -61,7 +61,7 @@ dimensionedScalar pMin
(
"pMin",
dimPressure,
mixture.lookup("pMin")
mixture
);
mesh.setFluxRequired(p_rgh.name());
......
......@@ -46,7 +46,7 @@ volScalarField rho
mixture.rho()
);
dimensionedScalar pMin("pMin", dimPressure, mixture.lookup("pMin"));
dimensionedScalar pMin("pMin", dimPressure, mixture);
mesh.setFluxRequired(p_rgh.name());
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2014 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2014-2015 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -80,8 +80,8 @@ incompressibleTwoPhaseInteractingMixture
)
),
rhod_("rho", dimDensity, muModel_->viscosityProperties().lookup("rho")),
rhoc_("rho", dimDensity, nucModel_->viscosityProperties().lookup("rho")),
rhod_("rho", dimDensity, muModel_->viscosityProperties()),
rhoc_("rho", dimDensity, nucModel_->viscosityProperties()),
dd_
(
"d",
......
......@@ -60,19 +60,19 @@ Foam::mixtureViscosityModels::BinghamPlastic::BinghamPlastic
(
"BinghamCoeff",
dimensionSet(1, -1, -2, 0, 0),
plasticCoeffs_.lookup("BinghamCoeff")
plasticCoeffs_
),
yieldStressExponent_
(
"BinghamExponent",
dimless,
plasticCoeffs_.lookup("BinghamExponent")
plasticCoeffs_
),
yieldStressOffset_
(
"BinghamOffset",
dimless,
plasticCoeffs_.lookup("BinghamOffset")
plasticCoeffs_
),
U_(U)
{}
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2014 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2014-2015 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -47,9 +47,9 @@ Foam::relativeVelocityModels::general::general
)
:
relativeVelocityModel(dict, mixture),
a_("a", dimless, dict.lookup("a")),
a1_("a1", dimless, dict.lookup("a1")),
V0_("V0", dimVelocity, dict.lookup("V0")),
a_("a", dimless, dict),
a1_("a1", dimless, dict),
V0_("V0", dimVelocity, dict),
residualAlpha_(dict.lookup("residualAlpha"))
{}
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2014 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2014-2015 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -47,9 +47,9 @@ Foam::relativeVelocityModels::simple::simple
)
:
relativeVelocityModel(dict, mixture),
a_("a", dimless, dict.lookup("a")),
V0_("V0", dimVelocity, dict.lookup("V0")),
residualAlpha_("residualAlpha", dimless, dict.lookup("residualAlpha"))
a_("a", dimless, dict),
V0_("V0", dimVelocity, dict),
residualAlpha_("residualAlpha", dimless, dict)
{}
......
......@@ -152,9 +152,9 @@ Foam::incompressibleThreePhaseMixture::incompressibleThreePhaseMixture
)
),
rho1_("rho", dimDensity, nuModel1_->viscosityProperties().lookup("rho")),
rho2_("rho", dimDensity, nuModel2_->viscosityProperties().lookup("rho")),
rho3_("rho", dimDensity, nuModel3_->viscosityProperties().lookup("rho"))
rho1_("rho", dimDensity, nuModel1_->viscosityProperties()),
rho2_("rho", dimDensity, nuModel2_->viscosityProperties()),
rho3_("rho", dimDensity, nuModel3_->viscosityProperties())
{
alpha3_ == 1.0 - alpha1_ - alpha2_;
calcNu();
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -53,7 +53,7 @@ Foam::diameterModels::constant::constant
)
:
diameterModel(dict, phase),
d_("d", dimLength, dict.lookup("d"))
d_("d", dimLength, dict)
{}
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -53,8 +53,8 @@ Foam::diameterModels::isothermal::isothermal
)
:
diameterModel(dict, phase),
d0_("d0", dimLength, dict.lookup("d0")),
p0_("p0", dimPressure, dict.lookup("p0"))
d0_("d0", dimLength, dict),
p0_("p0", dimPressure, dict)
{}
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -57,25 +57,25 @@ Foam::phaseModel::phaseModel
(
"nu",
dimensionSet(0, 2, -1, 0, 0),
phaseDict_.lookup("nu")
phaseDict_
),
kappa_
(
"kappa",
dimensionSet(1, 1, -3, -1, 0),
phaseDict_.lookup("kappa")
phaseDict_
),
Cp_
(
"Cp",
dimensionSet(0, 2, -2, -1, 0),
phaseDict_.lookup("Cp")
phaseDict_
),
rho_
(
"rho",
dimDensity,
phaseDict_.lookup("rho")
phaseDict_
),
U_
(
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment