diff --git a/applications/solvers/basic/laplacianFoam/createFields.H b/applications/solvers/basic/laplacianFoam/createFields.H index 2c38779b3ae9c08a5b7eab2543bd7d56ca34d42f..dbddccb904936402d36f7330d82e00cfae71992d 100644 --- a/applications/solvers/basic/laplacianFoam/createFields.H +++ b/applications/solvers/basic/laplacianFoam/createFields.H @@ -31,11 +31,6 @@ IOdictionary transportProperties Info<< "Reading diffusivity DT\n" << endl; -dimensionedScalar DT -( - "DT", - dimArea/dimTime, - transportProperties -); +dimensionedScalar DT("DT", dimViscosity, transportProperties); #include "createFvOptions.H" diff --git a/applications/solvers/basic/laplacianFoam/overLaplacianDyMFoam/createFields.H b/applications/solvers/basic/laplacianFoam/overLaplacianDyMFoam/createFields.H index d14935caab629c166e286d9cdbb1aed8bae50561..fc66a21b162a5710cc040d6118d2d3c78ba7010b 100644 --- a/applications/solvers/basic/laplacianFoam/overLaplacianDyMFoam/createFields.H +++ b/applications/solvers/basic/laplacianFoam/overLaplacianDyMFoam/createFields.H @@ -47,7 +47,4 @@ Info<< "Reading diffusivity DT\n" << endl; - dimensionedScalar DT - ( - transportProperties.lookup("DT") - ); + dimensionedScalar DT("DT", dimViscosity, transportProperties); diff --git a/applications/solvers/basic/scalarTransportFoam/createFields.H b/applications/solvers/basic/scalarTransportFoam/createFields.H index 390ac4e47303bcbfafcd2f911805a4ef9d32c999..ec2b2263c33af17983b977872a4dd15a071a72be 100644 --- a/applications/solvers/basic/scalarTransportFoam/createFields.H +++ b/applications/solvers/basic/scalarTransportFoam/createFields.H @@ -47,12 +47,7 @@ IOdictionary transportProperties Info<< "Reading diffusivity DT\n" << endl; -dimensionedScalar DT -( - "DT", - dimArea/dimTime, - transportProperties -); +dimensionedScalar DT("DT", dimViscosity, transportProperties); #include "createPhi.H" diff --git a/applications/solvers/combustion/PDRFoam/XiModels/XiGModels/instabilityG/instabilityG.C b/applications/solvers/combustion/PDRFoam/XiModels/XiGModels/instabilityG/instabilityG.C index a516bf0e46b2ce97718c4d1526236dc1e2efbff1..595f6887effbc5ec82663550cf369dc2650c4336 100644 --- a/applications/solvers/combustion/PDRFoam/XiModels/XiGModels/instabilityG/instabilityG.C +++ b/applications/solvers/combustion/PDRFoam/XiModels/XiGModels/instabilityG/instabilityG.C @@ -49,8 +49,8 @@ Foam::XiGModels::instabilityG::instabilityG ) : XiGModel(XiGProperties, thermo, turbulence, Su), - GIn_(XiGModelCoeffs_.lookup("GIn")), - lambdaIn_(XiGModelCoeffs_.lookup("lambdaIn")), + GIn_("GIn", dimless/dimTime, XiGModelCoeffs_), + lambdaIn_("lambdaIn", dimLength, XiGModelCoeffs_), XiGModel_(XiGModel::New(XiGModelCoeffs_, thermo, turbulence, Su)) {} diff --git a/applications/solvers/combustion/PDRFoam/laminarFlameSpeed/SCOPE/SCOPELaminarFlameSpeed.C b/applications/solvers/combustion/PDRFoam/laminarFlameSpeed/SCOPE/SCOPELaminarFlameSpeed.C index 979828413806640335c8e998f84e27f8be39bd77..b56d31a2283439ce7b4fb17a46c928957cb54ed6 100644 --- a/applications/solvers/combustion/PDRFoam/laminarFlameSpeed/SCOPE/SCOPELaminarFlameSpeed.C +++ b/applications/solvers/combustion/PDRFoam/laminarFlameSpeed/SCOPE/SCOPELaminarFlameSpeed.C @@ -408,7 +408,7 @@ Foam::laminarFlameSpeedModels::SCOPE::Ma() const ( dimensionedScalar ( - psiuReactionThermo_.lookup("stoichiometricAirFuelMassRatio") + "stoichiometricAirFuelMassRatio", dimless, psiuReactionThermo_ )*ft/(scalar(1) - ft) ); } @@ -449,7 +449,7 @@ Foam::laminarFlameSpeedModels::SCOPE::operator()() const psiuReactionThermo_.Tu(), dimensionedScalar ( - psiuReactionThermo_.lookup("stoichiometricAirFuelMassRatio") + "stoichiometricAirFuelMassRatio", dimless, psiuReactionThermo_ )*ft/(scalar(1) - ft) ); } diff --git a/applications/solvers/combustion/XiFoam/readCombustionProperties.H b/applications/solvers/combustion/XiFoam/readCombustionProperties.H index 58b0626fb415105c78eb5cfc8d05ba0670956cc7..46c1d3ef5222ffc6c5485161f4c00f6fabba14df 100644 --- a/applications/solvers/combustion/XiFoam/readCombustionProperties.H +++ b/applications/solvers/combustion/XiFoam/readCombustionProperties.H @@ -12,34 +12,34 @@ ) ); - word SuModel + const word SuModel ( - combustionProperties.lookup("SuModel") + combustionProperties.get<word>("SuModel") ); dimensionedScalar sigmaExt ( - combustionProperties.lookup("sigmaExt") + "sigmaExt", dimless/dimTime, combustionProperties ); - word XiModel + const word XiModel ( - combustionProperties.lookup("XiModel") + combustionProperties.get<word>("XiModel") ); dimensionedScalar XiCoef ( - combustionProperties.lookup("XiCoef") + "XiCoef", dimless, combustionProperties ); dimensionedScalar XiShapeCoef ( - combustionProperties.lookup("XiShapeCoef") + "XiShapeCoef", dimless, combustionProperties ); dimensionedScalar uPrimeCoef ( - combustionProperties.lookup("uPrimeCoef") + "uPrimeCoef", dimless, combustionProperties ); ignition ign(combustionProperties, runTime, mesh); diff --git a/applications/solvers/electromagnetics/electrostaticFoam/createFields.H b/applications/solvers/electromagnetics/electrostaticFoam/createFields.H index 04c86c4edb5655fdea66b7f96ff89e392f353380..e9c51b59a5bb86fc6381524ea5cf391add19f910 100644 --- a/applications/solvers/electromagnetics/electrostaticFoam/createFields.H +++ b/applications/solvers/electromagnetics/electrostaticFoam/createFields.H @@ -14,12 +14,16 @@ dimensionedScalar epsilon0 ( - physicalProperties.lookup("epsilon0") + "epsilon0", + dimensionSet(-1, -3, 4, 0, 0, 2, 0), + physicalProperties ); dimensionedScalar k ( - physicalProperties.lookup("k") + "k", + dimensionSet(-1, 0, 2, 0, 0, 1, 0), + physicalProperties ); diff --git a/applications/solvers/financial/financialFoam/createFields.H b/applications/solvers/financial/financialFoam/createFields.H index a64337e794a2f278d7cd5a1154182d7645b6d225..14bddd8adb6039d000069369fcabfd079950ef5e 100644 --- a/applications/solvers/financial/financialFoam/createFields.H +++ b/applications/solvers/financial/financialFoam/createFields.H @@ -16,21 +16,21 @@ dimensionedScalar strike ( "strike", dimLength, - financialProperties.lookup("strike") + financialProperties ); dimensionedScalar r ( "r", dimless/dimTime, - financialProperties.lookup("r") + financialProperties ); dimensionedScalar sigma ( "sigma", dimensionSet(0, 0, -0.5, 0, 0), - financialProperties.lookup("sigma") + financialProperties ); dimensionedScalar sigmaSqr = sqr(sigma); diff --git a/applications/solvers/finiteArea/liquidFilmFoam/readTransportProperties.H b/applications/solvers/finiteArea/liquidFilmFoam/readTransportProperties.H index 2f2c99ffda77789e16235e7e8213a0dcd0e874c6..caa0fd34417ee4e03b5a260a14fcc2f687e4e6a9 100644 --- a/applications/solvers/finiteArea/liquidFilmFoam/readTransportProperties.H +++ b/applications/solvers/finiteArea/liquidFilmFoam/readTransportProperties.H @@ -10,32 +10,12 @@ IOdictionary transportProperties ) ); -dimensionedScalar mug -( - transportProperties.lookup("mug") -); - -dimensionedScalar mul -( - transportProperties.lookup("mul") -); - -dimensionedScalar sigma -( - transportProperties.lookup("sigma") -); +dimensionedScalar mug("mug", dimViscosity, transportProperties); +dimensionedScalar mul("mul", dimViscosity, transportProperties); -dimensionedScalar rhol -( - transportProperties.lookup("rhol") -); +dimensionedScalar rhog("rhog", dimDensity, transportProperties); +dimensionedScalar rhol("rhol", dimDensity, transportProperties); -dimensionedScalar rhog -( - transportProperties.lookup("rhog") -); +dimensionedScalar sigma("sigma", dimMass/sqr(dimTime), transportProperties); -dimensionedScalar h0 -( - transportProperties.lookup("h0") -); +dimensionedScalar h0("h0", dimLength, transportProperties); diff --git a/applications/solvers/finiteArea/sphereSurfactantFoam/createFaFields.H b/applications/solvers/finiteArea/sphereSurfactantFoam/createFaFields.H index b26d288801230e17defc4cf7d644ece3fce132ec..76ad60e90cdf1e1a656191ca358959b0b24263ab 100644 --- a/applications/solvers/finiteArea/sphereSurfactantFoam/createFaFields.H +++ b/applications/solvers/finiteArea/sphereSurfactantFoam/createFaFields.H @@ -12,25 +12,13 @@ areaScalarField Cs aMesh ); -dimensioned<scalar> Cs0 -( - "Cs0", - dimensionSet(1, -2, 0, 0, 0, 0, 0), - 1.0 -); +dimensionedScalar Cs0("Cs0", dimMass/dimArea, 1.0); const areaVectorField& R = aMesh.areaCentres(); Cs = Cs0*(1.0 + R.component(vector::X)/mag(R)); - -dimensioned<scalar> Ds -( - "Ds", - dimensionSet(0, 2, -1, 0, 0, 0, 0), - 1.0 -); - +dimensionedScalar Ds("Ds", dimViscosity, 1.0); areaVectorField Us ( diff --git a/applications/solvers/finiteArea/surfactantFoam/createFaFields.H b/applications/solvers/finiteArea/surfactantFoam/createFaFields.H index a285b21cee0cd930f7024973f84659e40a690219..2ad74fa266fb128b3fe28d9b14dfb526d78dc065 100644 --- a/applications/solvers/finiteArea/surfactantFoam/createFaFields.H +++ b/applications/solvers/finiteArea/surfactantFoam/createFaFields.H @@ -29,10 +29,7 @@ IOdictionary transportProperties Info<< "Reading diffusivity D\n" << endl; -dimensionedScalar Ds -( - transportProperties.lookup("Ds") -); +dimensionedScalar Ds("Ds", dimViscosity, transportProperties); areaVectorField Us ( diff --git a/applications/solvers/incompressible/icoFoam/createFields.H b/applications/solvers/incompressible/icoFoam/createFields.H index bdaef3a7bf6194d53e3dc60eef68ba297aad9fc3..02d916bcba9143ad80556b32886ee55bbefc197f 100644 --- a/applications/solvers/incompressible/icoFoam/createFields.H +++ b/applications/solvers/incompressible/icoFoam/createFields.H @@ -16,7 +16,7 @@ dimensionedScalar nu ( "nu", dimViscosity, - transportProperties.lookup("nu") + transportProperties ); Info<< "Reading field p\n" << endl; diff --git a/applications/solvers/incompressible/shallowWaterFoam/readGravitationalAcceleration.H b/applications/solvers/incompressible/shallowWaterFoam/readGravitationalAcceleration.H index b960a2f6406ec7762d27f7a0a9a8b7eb82552dc1..6443bf967e441ecc5eaa6faa93dcb2c3c9bb7267 100644 --- a/applications/solvers/incompressible/shallowWaterFoam/readGravitationalAcceleration.H +++ b/applications/solvers/incompressible/shallowWaterFoam/readGravitationalAcceleration.H @@ -12,12 +12,13 @@ IOdictionary gravitationalProperties ) ); -const dimensionedVector g(gravitationalProperties.lookup("g")); +const dimensionedVector g("g", dimAcceleration, gravitationalProperties); const bool rotating(gravitationalProperties.get<bool>("rotating")); const dimensionedVector Omega = ( - rotating ? gravitationalProperties.lookup("Omega") - : dimensionedVector("Omega", -dimTime, vector(0,0,0)) + rotating + ? dimensionedVector("Omega", dimless/dimTime, gravitationalProperties) + : dimensionedVector("Omega", dimless/dimTime, Zero) ); const dimensionedScalar magg = mag(g); const dimensionedVector gHat = g/magg; diff --git a/applications/solvers/lagrangian/DPMFoam/createFields.H b/applications/solvers/lagrangian/DPMFoam/createFields.H index 55c3608ac92de8847c0de0acf05d6185161a5aa2..527e4651773ef353753c9604366a236f962f3ed5 100644 --- a/applications/solvers/lagrangian/DPMFoam/createFields.H +++ b/applications/solvers/lagrangian/DPMFoam/createFields.H @@ -72,10 +72,7 @@ dimensionedScalar rhocValue ( IOobject::groupName("rho", continuousPhaseName), dimDensity, - continuousPhaseTransport.lookup - ( - IOobject::groupName("rho", continuousPhaseName) - ) + continuousPhaseTransport ); volScalarField rhoc diff --git a/applications/solvers/multiphase/icoReactingMultiphaseInterFoam/phasesSystem/interfaceModels/surfaceTensionModels/constantSurfaceTensionCoefficient/constantSurfaceTensionCoefficient.C b/applications/solvers/multiphase/icoReactingMultiphaseInterFoam/phasesSystem/interfaceModels/surfaceTensionModels/constantSurfaceTensionCoefficient/constantSurfaceTensionCoefficient.C index 37af91206b753025a5b732876d4a46ed937f545e..31a741ef9b46729fbc5c967ec7280fd0eb26d763 100644 --- a/applications/solvers/multiphase/icoReactingMultiphaseInterFoam/phasesSystem/interfaceModels/surfaceTensionModels/constantSurfaceTensionCoefficient/constantSurfaceTensionCoefficient.C +++ b/applications/solvers/multiphase/icoReactingMultiphaseInterFoam/phasesSystem/interfaceModels/surfaceTensionModels/constantSurfaceTensionCoefficient/constantSurfaceTensionCoefficient.C @@ -55,7 +55,7 @@ constantSurfaceTensionCoefficient ) : surfaceTensionModel(dict, pair, registerObject), - sigma_("sigma", dimensionSet(1, 0, -2, 0, 0), dict.lookup("sigma")) + sigma_("sigma", dimMass/sqr(dimTime), dict) {} diff --git a/applications/solvers/multiphase/interCondensatingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/constant/constant.C b/applications/solvers/multiphase/interCondensatingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/constant/constant.C index f82f1f197c9eae16291efdd60b057c53224c3961..6da1c0997268675e33ef166bf33585f26d670167 100644 --- a/applications/solvers/multiphase/interCondensatingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/constant/constant.C +++ b/applications/solvers/multiphase/interCondensatingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/constant/constant.C @@ -53,10 +53,15 @@ Foam::temperaturePhaseChangeTwoPhaseMixtures::constant::constant ) : temperaturePhaseChangeTwoPhaseMixture(mixture, mesh), - coeffC_(subDict(type() + "Coeffs").lookup("coeffC")), - coeffE_(subDict(type() + "Coeffs").lookup("coeffE")) -{ -} + coeffC_ + ( + "coeffC", dimless/dimTime/dimTemperature, subDict(type() + "Coeffs") + ), + coeffE_ + ( + "coeffE", dimless/dimTime/dimTemperature, subDict(type() + "Coeffs") + ) +{} // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // @@ -163,10 +168,8 @@ bool Foam::temperaturePhaseChangeTwoPhaseMixtures::constant::read() return true; } - else - { - return false; - } + + return false; } diff --git a/applications/solvers/multiphase/interFoam/interMixingFoam/threePhaseInterfaceProperties/threePhaseInterfaceProperties.C b/applications/solvers/multiphase/interFoam/interMixingFoam/threePhaseInterfaceProperties/threePhaseInterfaceProperties.C index 03b8bc9aad439be5e8e4ca51b7659e25cd68b573..9de37d62b82d29dd3953ef4e32253c59b18c3d11 100644 --- a/applications/solvers/multiphase/interFoam/interMixingFoam/threePhaseInterfaceProperties/threePhaseInterfaceProperties.C +++ b/applications/solvers/multiphase/interFoam/interMixingFoam/threePhaseInterfaceProperties/threePhaseInterfaceProperties.C @@ -160,8 +160,8 @@ Foam::threePhaseInterfaceProperties::threePhaseInterfaceProperties mixture_.alpha1().name() ).get<scalar>("cAlpha") ), - sigma12_("sigma12", dimensionSet(1, 0, -2, 0, 0), mixture), - sigma13_("sigma13", dimensionSet(1, 0, -2, 0, 0), mixture), + sigma12_("sigma12", dimMass/sqr(dimTime), mixture), + sigma13_("sigma13", dimMass/sqr(dimTime), mixture), deltaN_ ( diff --git a/applications/test/parallelOverset/createFields.H b/applications/test/parallelOverset/createFields.H index d14935caab629c166e286d9cdbb1aed8bae50561..fc66a21b162a5710cc040d6118d2d3c78ba7010b 100644 --- a/applications/test/parallelOverset/createFields.H +++ b/applications/test/parallelOverset/createFields.H @@ -47,7 +47,4 @@ Info<< "Reading diffusivity DT\n" << endl; - dimensionedScalar DT - ( - transportProperties.lookup("DT") - ); + dimensionedScalar DT("DT", dimViscosity, transportProperties); diff --git a/applications/utilities/preProcessing/applyBoundaryLayer/createFields.H b/applications/utilities/preProcessing/applyBoundaryLayer/createFields.H index d82d9ffbf59665c56d14efdb22ced1cd8335a6d8..629d27467302f6a979e038ff265f6d90ae705d72 100644 --- a/applications/utilities/preProcessing/applyBoundaryLayer/createFields.H +++ b/applications/utilities/preProcessing/applyBoundaryLayer/createFields.H @@ -57,7 +57,7 @@ y.correctBoundaryConditions(); // Set the mean boundary-layer thickness -dimensionedScalar ybl("ybl", dimLength, 0); +dimensionedScalar ybl("ybl", dimLength, Zero); if (args.found("ybl")) { diff --git a/applications/utilities/preProcessing/engineSwirl/createFields.H b/applications/utilities/preProcessing/engineSwirl/createFields.H index bb8b2b0d23a15ba0d7b669315ef38372e1ef61cb..5cfe5cb2fbd58925610411b16986ff92a7de2650 100644 --- a/applications/utilities/preProcessing/engineSwirl/createFields.H +++ b/applications/utilities/preProcessing/engineSwirl/createFields.H @@ -12,35 +12,17 @@ IOdictionary engineGeometry ) ); -vector swirlAxis -( - engineGeometry.lookup("swirlAxis") -); +vector swirlAxis(engineGeometry.get<vector>("swirlAxis")); -vector swirlCenter -( - engineGeometry.lookup("swirlCenter") -); +vector swirlCenter(engineGeometry.get<vector>("swirlCenter")); -dimensionedScalar swirlRPMRatio -( - engineGeometry.lookup("swirlRPMRatio") -); +dimensionedScalar swirlRPMRatio("swirlRPMRatio", engineGeometry); -dimensionedScalar swirlProfile -( - engineGeometry.lookup("swirlProfile") -); +dimensionedScalar swirlProfile("swirlProfile", engineGeometry); -dimensionedScalar bore -( - engineGeometry.lookup("bore") -); +dimensionedScalar bore("bore", dimLength, engineGeometry); -dimensionedScalar rpm -( - engineGeometry.lookup("rpm") -); +dimensionedScalar rpm("rpm", dimless/dimTime, engineGeometry); Info<< "Reading field U\n" << endl; diff --git a/src/OpenFOAM/dimensionSet/dimensionSet.C b/src/OpenFOAM/dimensionSet/dimensionSet.C index b9c9be7b39de440399747dd378e34668a7fd6131..d2ec48e3f8943c4b2c6a28a4172c70b552236611 100644 --- a/src/OpenFOAM/dimensionSet/dimensionSet.C +++ b/src/OpenFOAM/dimensionSet/dimensionSet.C @@ -25,19 +25,25 @@ License #include "dimensionSet.H" #include "dimensionedScalar.H" -#include "StringStream.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam { -defineTypeNameAndDebug(dimensionSet, 1); -const scalar dimensionSet::smallExponent = SMALL; + defineTypeNameAndDebug(dimensionSet, 1); } +const Foam::scalar Foam::dimensionSet::smallExponent = SMALL; + // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // +Foam::dimensionSet::dimensionSet() +: + exponents_(Zero) +{} + + Foam::dimensionSet::dimensionSet ( const scalar mass, @@ -48,6 +54,8 @@ Foam::dimensionSet::dimensionSet const scalar current, const scalar luminousIntensity ) +: + exponents_() { exponents_[MASS] = mass; exponents_[LENGTH] = length; @@ -66,9 +74,9 @@ Foam::dimensionSet::dimensionSet(const FixedList<scalar,7>& dims) Foam::dimensionSet::dimensionSet(const dimensionSet& ds) -{ - reset(ds); -} +: + exponents_(ds.exponents_) +{} // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // diff --git a/src/OpenFOAM/dimensionSet/dimensionSet.H b/src/OpenFOAM/dimensionSet/dimensionSet.H index c84e8c683091c1c5277305ffd714a4cb1d591f96..7c102b852c62b035d70f5244c8ccd69556be6f5b 100644 --- a/src/OpenFOAM/dimensionSet/dimensionSet.H +++ b/src/OpenFOAM/dimensionSet/dimensionSet.H @@ -229,6 +229,9 @@ public: // Constructors + //- Construct null (dimensionless). + dimensionSet(); + //- Construct from exponents for the first five or all seven dimensions dimensionSet ( @@ -254,7 +257,7 @@ public: } //- Construct from Istream - dimensionSet(Istream& is); + explicit dimensionSet(Istream& is); // Member functions @@ -377,48 +380,48 @@ public: // Friend operators - friend dimensionSet operator-(const dimensionSet&); + friend dimensionSet operator-(const dimensionSet& ds); friend dimensionSet operator+ ( - const dimensionSet&, - const dimensionSet& + const dimensionSet& ds1, + const dimensionSet& ds2 ); friend dimensionSet operator- ( - const dimensionSet&, - const dimensionSet& + const dimensionSet& ds1, + const dimensionSet& ds2 ); friend dimensionSet operator* ( - const dimensionSet&, - const dimensionSet& + const dimensionSet& ds1, + const dimensionSet& ds2 ); friend dimensionSet operator/ ( - const dimensionSet&, - const dimensionSet& + const dimensionSet& ds1, + const dimensionSet& ds2 ); friend dimensionSet operator& ( - const dimensionSet&, - const dimensionSet& + const dimensionSet& ds1, + const dimensionSet& ds2 ); friend dimensionSet operator^ ( - const dimensionSet&, - const dimensionSet& + const dimensionSet& ds1, + const dimensionSet& ds2 ); friend dimensionSet operator&& ( - const dimensionSet&, - const dimensionSet& + const dimensionSet& ds1, + const dimensionSet& ds2 ); diff --git a/src/OpenFOAM/dimensionSet/dimensionSets.H b/src/OpenFOAM/dimensionSet/dimensionSets.H index cf74ae85b402d6db71075ae9d98029557e7d1b6b..ecaa3cf8d55e5d67f880824fa855b2c9e9b501ac 100644 --- a/src/OpenFOAM/dimensionSet/dimensionSets.H +++ b/src/OpenFOAM/dimensionSet/dimensionSets.H @@ -119,7 +119,7 @@ public: } //- (if valid) obtain set of coefficients of unitNames - void coefficients(scalarField&) const; + void coefficients(scalarField& exponents) const; }; diff --git a/src/OpenFOAM/dimensionedTypes/dimensionedType/dimensionedType.C b/src/OpenFOAM/dimensionedTypes/dimensionedType/dimensionedType.C index 5cf0a09c63760fd70c9598146bfda501c73eca29..822113e3aa90788b1d95c726f86dc1bbd4934fd6 100644 --- a/src/OpenFOAM/dimensionedTypes/dimensionedType/dimensionedType.C +++ b/src/OpenFOAM/dimensionedTypes/dimensionedType/dimensionedType.C @@ -30,13 +30,12 @@ License // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // template<class Type> -void Foam::dimensioned<Type>::initialize(Istream& is) +void Foam::dimensioned<Type>::initialize(Istream& is, bool checkDims) { token nextToken(is); is.putBack(nextToken); - // Check if the original format is used in which the name is provided - // and reset the name to that read + // Optional name found - use it if (nextToken.isWord()) { is >> name_; @@ -44,26 +43,27 @@ void Foam::dimensioned<Type>::initialize(Istream& is) is.putBack(nextToken); } - // If the dimensions are provided compare with the argument - scalar multiplier = 1.0; + scalar mult(1.0); if (nextToken == token::BEGIN_SQR) { - dimensionSet dims(dimless); - dims.read(is, multiplier); + // Optional dimensions found - use them + const dimensionSet curr(dimensions_); + dimensions_.read(is, mult); - if (dims != dimensions_) + if (checkDims && curr != dimensions_) { FatalIOErrorInFunction(is) - << "The dimensions " << dims - << " provided do not match the required dimensions " - << dimensions_ + << "The dimensions " << dimensions_ + << " provided do not match the expected dimensions " + << curr << endl << abort(FatalIOError); } } + // Read value is >> value_; - value_ *= multiplier; + value_ *= mult; } @@ -124,10 +124,7 @@ Foam::dimensioned<Type>::dimensioned template<class Type> -Foam::dimensioned<Type>::dimensioned -( - Istream& is -) +Foam::dimensioned<Type>::dimensioned(Istream& is) : dimensions_(dimless) { @@ -145,10 +142,13 @@ Foam::dimensioned<Type>::dimensioned name_(name), dimensions_(dimless) { - scalar multiplier; - dimensions_.read(is, multiplier); + // Read dimensionSet + multiplier + scalar mult(1.0); + dimensions_.read(is, mult); + + // Read value is >> value_; - value_ *= multiplier; + value_ *= mult; } @@ -164,7 +164,7 @@ Foam::dimensioned<Type>::dimensioned dimensions_(dims), value_(Zero) { - initialize(is); + initialize(is, true); // checkDims } @@ -172,15 +172,32 @@ template<class Type> Foam::dimensioned<Type>::dimensioned ( const word& name, - const dimensionSet& dims, const dictionary& dict ) +: + dimensioned<Type>(name, dimless, dict, false) // no checkDims +{} + + +template<class Type> +Foam::dimensioned<Type>::dimensioned +( + const word& name, + const dimensionSet& dims, + const dictionary& dict, + const bool checkDims +) : name_(name), dimensions_(dims), value_(Zero) { - initialize(dict.lookup(name)); + // Like dictionary::lookup(), but in two stages to detect input errors + const entry& e = dict.lookupEntry(name, keyType::REGEX); + ITstream& is = e.stream(); + + initialize(is, checkDims); + e.checkITstream(is); } @@ -195,12 +212,13 @@ Foam::dimensioned<Type> Foam::dimensioned<Type>::lookupOrDefault const Type& defaultValue ) { - if (dict.found(name)) - { - return dimensioned<Type>(name, dims, dict.get<Type>(name)); - } - - return dimensioned<Type>(name, dims, defaultValue); + return + dimensioned<Type> + ( + name, + dims, + dict.lookupOrDefault<Type>(name, defaultValue) + ); } @@ -326,15 +344,14 @@ bool Foam::dimensioned<Type>::readIfPresent(const dictionary& dict) template<class Type> -Foam::Istream& -Foam::dimensioned<Type>::read(Istream& is, const dictionary& readSet) +Foam::Istream& Foam::dimensioned<Type>::read(Istream& is) { // Read name is >> name_; // Read dimensionSet + multiplier - scalar mult; - dimensions_.read(is, mult, readSet); + scalar mult(1.0); + dimensions_.read(is, mult); // Read value is >> value_; @@ -346,17 +363,14 @@ Foam::dimensioned<Type>::read(Istream& is, const dictionary& readSet) template<class Type> -Foam::Istream& Foam::dimensioned<Type>::read -( - Istream& is, - const HashTable<dimensionedScalar>& readSet -) +Foam::Istream& +Foam::dimensioned<Type>::read(Istream& is, const dictionary& readSet) { // Read name is >> name_; // Read dimensionSet + multiplier - scalar mult; + scalar mult(1.0); dimensions_.read(is, mult, readSet); // Read value @@ -369,14 +383,18 @@ Foam::Istream& Foam::dimensioned<Type>::read template<class Type> -Foam::Istream& Foam::dimensioned<Type>::read(Istream& is) +Foam::Istream& Foam::dimensioned<Type>::read +( + Istream& is, + const HashTable<dimensionedScalar>& readSet +) { // Read name is >> name_; // Read dimensionSet + multiplier - scalar mult; - dimensions_.read(is, mult); + scalar mult(1.0); + dimensions_.read(is, mult, readSet); // Read value is >> value_; @@ -574,29 +592,7 @@ Foam::dimensioned<Type> Foam::min template<class Type> Foam::Istream& Foam::operator>>(Istream& is, dimensioned<Type>& dt) { - token nextToken(is); - is.putBack(nextToken); - - // Check if the original format is used in which the name is provided - // and reset the name to that read - if (nextToken.isWord()) - { - is >> dt.name_; - is >> nextToken; - is.putBack(nextToken); - } - - // If the dimensions are provided reset the dimensions to those read - scalar multiplier = 1.0; - if (nextToken == token::BEGIN_SQR) - { - dt.dimensions_.read(is, multiplier); - } - - // Read the value - is >> dt.value_; - dt.value_ *= multiplier; - + dt.initialize(is, false); // no checkDims is.check(FUNCTION_NAME); return is; } @@ -609,7 +605,7 @@ Foam::Ostream& Foam::operator<<(Ostream& os, const dimensioned<Type>& dt) os << dt.name() << token::SPACE; // Write the dimensions - scalar mult; + scalar mult(1.0); dt.dimensions().write(os, mult); os << token::SPACE; diff --git a/src/OpenFOAM/dimensionedTypes/dimensionedType/dimensionedType.H b/src/OpenFOAM/dimensionedTypes/dimensionedType/dimensionedType.H index b761462ab315589566ab476d27aefd4555b9c3a4..0b84e6cc62bd63860b619d7aecf6a38058f5b6fd 100644 --- a/src/OpenFOAM/dimensionedTypes/dimensionedType/dimensionedType.H +++ b/src/OpenFOAM/dimensionedTypes/dimensionedType/dimensionedType.H @@ -3,7 +3,7 @@ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation - \\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd. + \\/ M anipulation | Copyright (C) 2016-2018 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -79,9 +79,16 @@ class dimensioned // Private member functions - //- Initialize from Istream - // Helper-function for constructors - void initialize(Istream& is); + //- Constructor helper. + // Requires a value, optional preceded with name and/or dimensions. + // \verbatim + // [name] [dims] value + // \endverbatim + // If the name is present, it is used to rename. + // If dimensions are present, they are read. + // With checkDims = true, the dimensions read are verified + // against the current (expected) dimensions. + void initialize(Istream& is, bool checkDims); public: @@ -92,7 +99,7 @@ public: // Constructors - //- Null constructor: a dimensionless Zero, named "0" + //- Construct null: a dimensionless Zero, named "0" dimensioned(); //- A dimensioned Zero, named "0" @@ -101,7 +108,7 @@ public: //- A dimensioned Zero, named "0" explicit dimensioned(const dimensionSet& dims, const zero); - //- Construct dimensionless from given value. + //- Implicit construct dimensionless from given value. dimensioned(const Type& val) : name_(::Foam::name(val)), @@ -109,7 +116,7 @@ public: value_(val) {} - //- Copy construct a dimensioned Type with a new name + //- Copy construct dimensioned Type with a new name dimensioned(const word& name, const dimensioned<Type>& dt); //- Construct from components: name, dimensionSet and a value. @@ -120,21 +127,31 @@ public: const Type& val ); - //- Construct from Istream. - dimensioned(Istream& is); - - //- Construct from Istream with a given name - dimensioned(const word& name, Istream& is); - - //- Construct from Istream with a given name and dimensions - dimensioned(const word& name, const dimensionSet& dims, Istream& is); - - //- Construct from dictionary lookup with a given name and dimensions + //- Construct from dictionary lookup with a given name. + // The dictionary entry may contain optional name and dimensions. + // \verbatim + // [name] [dims] value + // \endverbatim + // If the optional name is found, it is used for renaming. + // If the optional dimensions are present, they are read and + // used without further verification. + // If no dimensions are found, the quantity is dimensionless. + dimensioned(const word& name, const dictionary& dict); + + //- Construct from dictionary lookup with a given name and dimensions. + // The dictionary entry may contain optional name and dimensions. + // \verbatim + // [name] [dims] value + // \endverbatim + // If the optional name is found, it is used for renaming. + // If the optional dimensions are present, they are read and + // normally verified against the expected dimensions. dimensioned ( const word& name, const dimensionSet& dims, - const dictionary& dict + const dictionary& dict, + const bool checkDims = true //!< verify dimensions read ); @@ -181,7 +198,7 @@ public: ); - // Member functions + // Member Functions //- Return const reference to name. const word& name() const; @@ -210,26 +227,29 @@ public: //- Return transpose. dimensioned<Type> T() const; - //- Update the value of dimensioned<Type> + //- Update the value of dimensioned\<Type\> void read(const dictionary& dict); - //- Update the value of dimensioned<Type> if found in the dictionary. + //- Update the value of dimensioned\<Type\> if found in the dictionary. bool readIfPresent(const dictionary& dict); - // I/O + // IO + + //- Read name, dimensions, value from stream, + //- using units from system table + Istream& read(Istream& is); - //- Read value from stream and units from dictionary + //- Read name, dimensions, value from stream, + //- using units from dictionary Istream& read(Istream& is, const dictionary& readSet); - //- Read value from stream and units from table + //- Read name, dimensions, value from stream, + //- using units from table Istream& read(Istream& is, const HashTable<dimensionedScalar>& readSet); - //- Read value from stream and units from system table - Istream& read(Istream& is); - - // Member operators + // Member Operators //- Return a component as a dimensioned<cmptType> dimensioned<cmptType> operator[](const direction d) const; @@ -242,6 +262,9 @@ public: // IOstream operators + //- Read from stream. The name and dimensions are optional. + // If the optional dimensions are present, they are used + // used without further verification. friend Istream& operator>> <Type> ( Istream& is, @@ -253,6 +276,33 @@ public: Ostream& os, const dimensioned<Type>& dt ); + + + // Housekeeping + + //- Deprecated(2018-11) Construct from Istream + //- (expects name, dimensions, value) + // \deprecated(2018-11) - should generally use one of the construct + // from dictionary constructors instead. They provide additional + // checks on the input stream. + explicit dimensioned(Istream& is); + + //- Deprecated(2018-11) Construct from Istream with given name + //- (expects dimensions, value) + // \deprecated(2018-11) - should generally use one of the construct + // from dictionary constructors instead. They provide additional + // checks on the input stream. + dimensioned(const word& name, Istream& is); + + //- Deprecated(2018-11) Construct from Istream with given name + //- and expected dimensions. + // Expects value, but supports optional name and dimensions. + // If the optional dimensions are present, they are read and + // verified against the expected dimensions. + // \deprecated(2018-11) - should generally use one of the construct + // from dictionary constructors instead. They provide additional + // checks on the input stream. + dimensioned(const word& name, const dimensionSet& dims, Istream& is); }; diff --git a/src/OpenFOAM/global/constants/dimensionedConstants.C b/src/OpenFOAM/global/constants/dimensionedConstants.C index 56527dbfd68150be8db44ba44f9219d8b5a6eb98..3f0e9d1c5c5376721340f32fef0d3d8bc139cce4 100644 --- a/src/OpenFOAM/global/constants/dimensionedConstants.C +++ b/src/OpenFOAM/global/constants/dimensionedConstants.C @@ -3,7 +3,7 @@ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation - \\/ M anipulation | + \\/ M anipulation | Copyright (C) 2018 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -25,16 +25,17 @@ License #include "dimensionedConstants.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam { + dictionary* dimensionedConstantsPtr_(nullptr); +} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -dictionary* dimensionedConstantsPtr_(nullptr); +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -dictionary& dimensionedConstants() +Foam::dictionary& Foam::dimensionedConstants() { return debug::switchSet ( @@ -44,7 +45,7 @@ dictionary& dimensionedConstants() } -dimensionedScalar dimensionedConstant +Foam::dimensionedScalar Foam::dimensionedConstant ( const word& group, const word& varName @@ -57,28 +58,24 @@ dimensionedScalar dimensionedConstant if (!dict.found("unitSet")) { - std::cerr<< "Cannot find unitSet in dictionary " << dict.name() + std::cerr + << "Cannot find unitSet in dictionary " << dict.name() << std::endl; } const word unitSetCoeffs(dict.get<word>("unitSet") + "Coeffs"); - if (!dict.found(unitSetCoeffs)) + const dictionary* unitDictPtr = dict.findDict(unitSetCoeffs); + + if (!unitDictPtr) { - std::cerr<< "Cannot find " << unitSetCoeffs << " in dictionary " + std::cerr + << "Cannot find " << unitSetCoeffs << " in dictionary " << dict.name() << std::endl; } - dictionary& unitDict = dict.subDict(unitSetCoeffs); - - dictionary& groupDict = unitDict.subDict(group); - - return dimensionedScalar(groupDict.lookup(varName)); + return dimensionedScalar(varName, unitDictPtr->subDict(group)); } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - // ************************************************************************* // diff --git a/src/engine/engineTime/crankConRod/crankConRod.C b/src/engine/engineTime/crankConRod/crankConRod.C index ca8bb64147e9d7c398e895c382d26fa6fb737a8a..243269767ab06cbb73ed9f3e4f5f9d7114a30085 100644 --- a/src/engine/engineTime/crankConRod/crankConRod.C +++ b/src/engine/engineTime/crankConRod/crankConRod.C @@ -74,11 +74,11 @@ Foam::crankConRod::crankConRod systemName, constantName ), - rpm_(dict_.lookup("rpm")), - conRodLength_(dimensionedScalar("conRodLength", dimLength, 0)), - bore_(dimensionedScalar("bore", dimLength, 0)), - stroke_(dimensionedScalar("stroke", dimLength, 0)), - clearance_(dimensionedScalar("clearance", dimLength, 0)) + rpm_("rpm", dimless/dimTime, dict_), + conRodLength_("conRodLength", dimLength, Zero), + bore_("bore", dimLength, Zero), + stroke_("stroke", dimLength, Zero), + clearance_("clearance", dimLength, Zero) { // geometric parameters are not strictly required for Time dict_.readIfPresent("conRodLength", conRodLength_); @@ -112,10 +112,8 @@ bool Foam::crankConRod::read() timeAdjustment(); return true; } - else - { - return false; - } + + return false; } diff --git a/src/engine/include/StCorr.H b/src/engine/include/StCorr.H index b49fee326270a87c20c57224bbef08fa8dde683c..735bd090f2415b01bdb92ae6881b04194768adfc 100644 --- a/src/engine/include/StCorr.H +++ b/src/engine/include/StCorr.H @@ -4,7 +4,7 @@ { // Calculate volume of ignition kernel dimensionedScalar Vk("Vk", dimVolume, gSum(c*mesh.V().field())); - dimensionedScalar Ak("Ak", dimArea, 0.0); + dimensionedScalar Ak("Ak", dimArea, Zero); if (Vk.value() > SMALL) { @@ -39,7 +39,7 @@ // Assume it is part-circular dimensionedScalar thickness ( - combustionProperties.lookup("ignitionThickness") + "ignitionThickness", dimLength, combustionProperties ); scalar circleFraction @@ -67,7 +67,7 @@ // Assume it is plane or two planes Ak = dimensionedScalar ( - combustionProperties.lookup("ignitionKernelArea") + "ignitionKernelArea", dimArea, combustionProperties ); break; } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fixedPressureCompressibleDensity/fixedPressureCompressibleDensityFvPatchScalarField.C b/src/finiteVolume/fields/fvPatchFields/derived/fixedPressureCompressibleDensity/fixedPressureCompressibleDensityFvPatchScalarField.C index cc1b0f4ff93e58158e795c386419b8772d5a6b77..529c6f1aaf525eb9908ec54c8cf793927af961d5 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/fixedPressureCompressibleDensity/fixedPressureCompressibleDensityFvPatchScalarField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/fixedPressureCompressibleDensity/fixedPressureCompressibleDensityFvPatchScalarField.C @@ -3,7 +3,7 @@ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | + \\/ M anipulation | Copyright (C) 2018 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -108,13 +108,11 @@ void Foam::fixedPressureCompressibleDensityFvPatchScalarField::updateCoeffs() const dictionary& thermoProps = db().lookupObject<IOdictionary>("thermodynamicProperties"); - const scalar rholSat = - dimensionedScalar(thermoProps.lookup("rholSat")).value(); + const scalar rholSat = dimensionedScalar("rholSat", thermoProps).value(); - const scalar pSat = - dimensionedScalar(thermoProps.lookup("pSat")).value(); + const scalar pSat = dimensionedScalar("pSat", thermoProps).value(); - const scalar psil = dimensionedScalar(thermoProps.lookup("psil")).value(); + const scalar psil = dimensionedScalar("psil", thermoProps).value(); operator==(rholSat + psil*(pp - pSat)); diff --git a/src/functionObjects/field/PecletNo/PecletNo.C b/src/functionObjects/field/PecletNo/PecletNo.C index c63524651c00a7bdd441eb3378118af1a1eecf05..084733fe6a4bd911ba31c490fb6890cacbc5c480 100644 --- a/src/functionObjects/field/PecletNo/PecletNo.C +++ b/src/functionObjects/field/PecletNo/PecletNo.C @@ -93,7 +93,7 @@ bool Foam::functionObjects::PecletNo::calc() IOobject::NO_WRITE ), mesh_, - dimensionedScalar(model.lookup("nu")) + dimensionedScalar("nu", dimViscosity, model) ); } else diff --git a/src/functionObjects/field/heatTransferCoeff/heatTransferCoeffModels/ReynoldsAnalogy/ReynoldsAnalogy.C b/src/functionObjects/field/heatTransferCoeff/heatTransferCoeffModels/ReynoldsAnalogy/ReynoldsAnalogy.C index a7df02d563d15482600d14263c74c8f6877ba57f..2c5de30fbe43116259c774db57992e7484d51f23 100644 --- a/src/functionObjects/field/heatTransferCoeff/heatTransferCoeffModels/ReynoldsAnalogy/ReynoldsAnalogy.C +++ b/src/functionObjects/field/heatTransferCoeff/heatTransferCoeffModels/ReynoldsAnalogy/ReynoldsAnalogy.C @@ -141,7 +141,7 @@ Foam::heatTransferCoeffModels::ReynoldsAnalogy::devReff() const const dictionary& transportProperties = mesh_.lookupObject<dictionary>("transportProperties"); - dimensionedScalar nu(transportProperties.lookup("nu")); + dimensionedScalar nu("nu", dimViscosity, transportProperties); const volVectorField& U = mesh_.lookupObject<volVectorField>(UName_); diff --git a/src/lagrangian/solidParticle/solidParticleCloud.C b/src/lagrangian/solidParticle/solidParticleCloud.C index 8e1727b2391ad2c2007f2eab4d2c205e2554d204..91bd1bae090869f4cc063e4e8f0e9cd74cfd15d3 100644 --- a/src/lagrangian/solidParticle/solidParticleCloud.C +++ b/src/lagrangian/solidParticle/solidParticleCloud.C @@ -50,9 +50,9 @@ Foam::solidParticleCloud::solidParticleCloud IOobject::NO_WRITE ) ), - rhop_(dimensionedScalar(particleProperties_.lookup("rhop")).value()), - e_(dimensionedScalar(particleProperties_.lookup("e")).value()), - mu_(dimensionedScalar(particleProperties_.lookup("mu")).value()) + rhop_(dimensionedScalar("rhop", particleProperties_).value()), + e_(dimensionedScalar("e", particleProperties_).value()), + mu_(dimensionedScalar("mu", particleProperties_).value()) { if (readFields) { diff --git a/src/thermophysicalModels/laminarFlameSpeed/Gulders/Gulders.C b/src/thermophysicalModels/laminarFlameSpeed/Gulders/Gulders.C index c1dbfacc4d232462808a64791221c91defbe3be2..445b5f893c79e4cba95beb6f426f69b4c9323b83 100644 --- a/src/thermophysicalModels/laminarFlameSpeed/Gulders/Gulders.C +++ b/src/thermophysicalModels/laminarFlameSpeed/Gulders/Gulders.C @@ -222,7 +222,7 @@ Foam::laminarFlameSpeedModels::Gulders::operator()() const psiuReactionThermo_.Tu(), dimensionedScalar ( - psiuReactionThermo_.lookup("stoichiometricAirFuelMassRatio") + "stoichiometricAirFuelMassRatio", dimless, psiuReactionThermo_ )*ft/max(1 - ft, SMALL) ); } diff --git a/src/thermophysicalModels/laminarFlameSpeed/GuldersEGR/GuldersEGR.C b/src/thermophysicalModels/laminarFlameSpeed/GuldersEGR/GuldersEGR.C index 97c10ebb2771a237ec35c25adaed1ae1b3b6e715..4b035b71935ec51266b098afae6823f237907909 100644 --- a/src/thermophysicalModels/laminarFlameSpeed/GuldersEGR/GuldersEGR.C +++ b/src/thermophysicalModels/laminarFlameSpeed/GuldersEGR/GuldersEGR.C @@ -226,7 +226,7 @@ Foam::laminarFlameSpeedModels::GuldersEGR::operator()() const psiuReactionThermo_.Tu(), dimensionedScalar ( - psiuReactionThermo_.lookup("stoichiometricAirFuelMassRatio") + "stoichiometricAirFuelMassRatio", dimless, psiuReactionThermo_ )/ ( scalar(1)/psiuReactionThermo_.composition().Y("ft") diff --git a/src/thermophysicalModels/laminarFlameSpeed/RaviPetersen/RaviPetersen.C b/src/thermophysicalModels/laminarFlameSpeed/RaviPetersen/RaviPetersen.C index 7bca4b045958b8e3d247f6bec91c4d1c184c11c5..d775e1b7ae2190a5554c6efd3cac8918c37969ad 100644 --- a/src/thermophysicalModels/laminarFlameSpeed/RaviPetersen/RaviPetersen.C +++ b/src/thermophysicalModels/laminarFlameSpeed/RaviPetersen/RaviPetersen.C @@ -313,7 +313,7 @@ Foam::laminarFlameSpeedModels::RaviPetersen::operator()() const EqR = dimensionedScalar ( - psiuReactionThermo_.lookup("stoichiometricAirFuelMassRatio") + "stoichiometricAirFuelMassRatio", dimless, psiuReactionThermo_ )*ft/max(1 - ft, SMALL); } else diff --git a/src/thermophysicalModels/laminarFlameSpeed/constant/constant.C b/src/thermophysicalModels/laminarFlameSpeed/constant/constant.C index 37ba46fbb195544d753f536e7564443e2f9a7a00..406a455c74469ef0b38e1befea950b1583ad3147 100644 --- a/src/thermophysicalModels/laminarFlameSpeed/constant/constant.C +++ b/src/thermophysicalModels/laminarFlameSpeed/constant/constant.C @@ -54,7 +54,7 @@ Foam::laminarFlameSpeedModels::constant::constant : laminarFlameSpeed(dict, ct), - Su_(dict.lookup("Su")) + Su_("Su", dimVelocity, dict) {} diff --git a/src/thermophysicalModels/laminarFlameSpeed/laminarFlameSpeed/laminarFlameSpeed.C b/src/thermophysicalModels/laminarFlameSpeed/laminarFlameSpeed/laminarFlameSpeed.C index 9f097c96f8a8d6bd5c72e0f28e0027e8cfab7d29..a8267d78c1d738cc2c3a51c1bcc7a53f4eb54e3b 100644 --- a/src/thermophysicalModels/laminarFlameSpeed/laminarFlameSpeed/laminarFlameSpeed.C +++ b/src/thermophysicalModels/laminarFlameSpeed/laminarFlameSpeed/laminarFlameSpeed.C @@ -50,7 +50,7 @@ Foam::laminarFlameSpeed::laminarFlameSpeed if (!psiuReactionThermo_.composition().contains("ft")) { equivalenceRatio_ = - dimensionedScalar(dict.lookup("equivalenceRatio")).value(); + dimensionedScalar("equivalenceRatio", dimless, dict).value(); } } diff --git a/src/thermophysicalModels/radiation/submodels/absorptionEmissionModel/constantAbsorptionEmission/constantAbsorptionEmission.C b/src/thermophysicalModels/radiation/submodels/absorptionEmissionModel/constantAbsorptionEmission/constantAbsorptionEmission.C index 6fd866c6d97a7361d128002a2a2639ae3a56c699..df44b6a83eb0b40c3b53e95beb9f654f2090458c 100644 --- a/src/thermophysicalModels/radiation/submodels/absorptionEmissionModel/constantAbsorptionEmission/constantAbsorptionEmission.C +++ b/src/thermophysicalModels/radiation/submodels/absorptionEmissionModel/constantAbsorptionEmission/constantAbsorptionEmission.C @@ -54,15 +54,9 @@ Foam::radiation::constantAbsorptionEmission::constantAbsorptionEmission : absorptionEmissionModel(dict, mesh), coeffsDict_(dict.optionalSubDict(typeName + "Coeffs")), - a_(coeffsDict_.lookup("absorptivity")), - e_(coeffsDict_.lookup("emissivity")), - E_(coeffsDict_.lookup("E")) -{} - - -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::radiation::constantAbsorptionEmission::~constantAbsorptionEmission() + a_("absorptivity", coeffsDict_), + e_("emissivity", coeffsDict_), + E_("E", coeffsDict_) {} diff --git a/src/thermophysicalModels/radiation/submodels/absorptionEmissionModel/constantAbsorptionEmission/constantAbsorptionEmission.H b/src/thermophysicalModels/radiation/submodels/absorptionEmissionModel/constantAbsorptionEmission/constantAbsorptionEmission.H index 18fc7f349e11a408b3f29c8ce01befe6b5a47c73..537a22bd37b07d6375f167a2d549a4d6a9f740b2 100644 --- a/src/thermophysicalModels/radiation/submodels/absorptionEmissionModel/constantAbsorptionEmission/constantAbsorptionEmission.H +++ b/src/thermophysicalModels/radiation/submodels/absorptionEmissionModel/constantAbsorptionEmission/constantAbsorptionEmission.H @@ -84,7 +84,7 @@ public: //- Destructor - virtual ~constantAbsorptionEmission(); + virtual ~constantAbsorptionEmission() = default; // Member Functions diff --git a/src/thermophysicalModels/radiation/submodels/scatterModel/constantScatter/constantScatter.C b/src/thermophysicalModels/radiation/submodels/scatterModel/constantScatter/constantScatter.C index dd552d0a66853c6613d401207cdaa3d34e14ae52..fc99cb0189af9d39ac2d79b043251ae331e6edb4 100644 --- a/src/thermophysicalModels/radiation/submodels/scatterModel/constantScatter/constantScatter.C +++ b/src/thermophysicalModels/radiation/submodels/scatterModel/constantScatter/constantScatter.C @@ -54,14 +54,8 @@ Foam::radiation::constantScatter::constantScatter : scatterModel(dict, mesh), coeffsDict_(dict.optionalSubDict(typeName + "Coeffs")), - sigma_(coeffsDict_.lookup("sigma")), - C_(coeffsDict_.lookup("C")) -{} - - -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::radiation::constantScatter::~constantScatter() + sigma_("sigma", dimless/dimLength, coeffsDict_), + C_("C", dimless, coeffsDict_) {} diff --git a/src/thermophysicalModels/radiation/submodels/scatterModel/constantScatter/constantScatter.H b/src/thermophysicalModels/radiation/submodels/scatterModel/constantScatter/constantScatter.H index ccf024e6b2216eff0231e2ea237ca243fcad9cce..c7253fd884e00ee31584fb485305a07c14dddc3b 100644 --- a/src/thermophysicalModels/radiation/submodels/scatterModel/constantScatter/constantScatter.H +++ b/src/thermophysicalModels/radiation/submodels/scatterModel/constantScatter/constantScatter.H @@ -85,7 +85,7 @@ public: //- Destructor - virtual ~constantScatter(); + virtual ~constantScatter() = default; // Member Functions diff --git a/src/thermophysicalModels/radiation/submodels/scatterModel/noScatter/noScatter.C b/src/thermophysicalModels/radiation/submodels/scatterModel/noScatter/noScatter.C index 999b09866bff49022727bf62b3636b0d7f14b426..b412b52bd1944fa7816ecf40e53af14ddfa73afc 100644 --- a/src/thermophysicalModels/radiation/submodels/scatterModel/noScatter/noScatter.C +++ b/src/thermophysicalModels/radiation/submodels/scatterModel/noScatter/noScatter.C @@ -50,12 +50,6 @@ Foam::radiation::noScatter::noScatter {} -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::radiation::noScatter::~noScatter() -{} - - // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // Foam::tmp<Foam::volScalarField> Foam::radiation::noScatter::sigmaEff() const diff --git a/src/thermophysicalModels/radiation/submodels/scatterModel/noScatter/noScatter.H b/src/thermophysicalModels/radiation/submodels/scatterModel/noScatter/noScatter.H index 2fb19569df2179e8b58e53236d8089b48aa84c56..b01eb9e0daa0e7f2ba8baaba70adb125e56c8b87 100644 --- a/src/thermophysicalModels/radiation/submodels/scatterModel/noScatter/noScatter.H +++ b/src/thermophysicalModels/radiation/submodels/scatterModel/noScatter/noScatter.H @@ -69,7 +69,7 @@ public: //- Destructor - virtual ~noScatter(); + virtual ~noScatter() = default; // Member Functions diff --git a/src/thermophysicalModels/reactionThermo/mixtures/egrMixture/egrMixture.C b/src/thermophysicalModels/reactionThermo/mixtures/egrMixture/egrMixture.C index d5e368ca9f11bdfc7fc1f172878b34dd3ed46fed..2a36c957fc8b992634e8dd9ae846d13dd9d3c2e1 100644 --- a/src/thermophysicalModels/reactionThermo/mixtures/egrMixture/egrMixture.C +++ b/src/thermophysicalModels/reactionThermo/mixtures/egrMixture/egrMixture.C @@ -50,7 +50,7 @@ Foam::egrMixture<ThermoType>::egrMixture phaseName ), - stoicRatio_(thermoDict.lookup("stoichiometricAirFuelMassRatio")), + stoicRatio_("stoichiometricAirFuelMassRatio", dimless, thermoDict), fuel_(thermoDict.subDict("fuel")), oxidant_(thermoDict.subDict("oxidant")), @@ -101,7 +101,7 @@ const ThermoType& Foam::egrMixture<ThermoType>::mixture template<class ThermoType> void Foam::egrMixture<ThermoType>::read(const dictionary& thermoDict) { - stoicRatio_ = thermoDict.lookup("stoichiometricAirFuelMassRatio"); + thermoDict.readEntry("stoichiometricAirFuelMassRatio", stoicRatio_); fuel_ = ThermoType(thermoDict.subDict("fuel")); oxidant_ = ThermoType(thermoDict.subDict("oxidant")); diff --git a/src/thermophysicalModels/reactionThermo/mixtures/egrMixture/egrMixture.H b/src/thermophysicalModels/reactionThermo/mixtures/egrMixture/egrMixture.H index 43425d5116edc4d3ccf4a34757d9cc606f9f2bca..d3f64ce274893a6aedc1122be2107ae54486d209 100644 --- a/src/thermophysicalModels/reactionThermo/mixtures/egrMixture/egrMixture.H +++ b/src/thermophysicalModels/reactionThermo/mixtures/egrMixture/egrMixture.H @@ -93,8 +93,7 @@ public: //- Destructor - virtual ~egrMixture() - {} + virtual ~egrMixture() = default; // Member functions diff --git a/src/thermophysicalModels/reactionThermo/mixtures/inhomogeneousMixture/inhomogeneousMixture.C b/src/thermophysicalModels/reactionThermo/mixtures/inhomogeneousMixture/inhomogeneousMixture.C index ef7d739f51a25a5de3017ca81d4043d19e423552..53346cbbe16798afdbaa9ea14cb6975ec73709a9 100644 --- a/src/thermophysicalModels/reactionThermo/mixtures/inhomogeneousMixture/inhomogeneousMixture.C +++ b/src/thermophysicalModels/reactionThermo/mixtures/inhomogeneousMixture/inhomogeneousMixture.C @@ -54,7 +54,7 @@ Foam::inhomogeneousMixture<ThermoType>::inhomogeneousMixture phaseName ), - stoicRatio_(thermoDict.lookup("stoichiometricAirFuelMassRatio")), + stoicRatio_("stoichiometricAirFuelMassRatio", dimless, thermoDict), fuel_(thermoDict.subDict("fuel")), oxidant_(thermoDict.subDict("oxidant")), @@ -98,7 +98,7 @@ const ThermoType& Foam::inhomogeneousMixture<ThermoType>::mixture template<class ThermoType> void Foam::inhomogeneousMixture<ThermoType>::read(const dictionary& thermoDict) { - stoicRatio_ = thermoDict.lookup("stoichiometricAirFuelMassRatio"); + thermoDict.readEntry("stoichiometricAirFuelMassRatio", stoicRatio_); fuel_ = ThermoType(thermoDict.subDict("fuel")); oxidant_ = ThermoType(thermoDict.subDict("oxidant")); diff --git a/src/thermophysicalModels/reactionThermo/mixtures/inhomogeneousMixture/inhomogeneousMixture.H b/src/thermophysicalModels/reactionThermo/mixtures/inhomogeneousMixture/inhomogeneousMixture.H index 55be584e702c70529ed8790ac9a10cf5c649a72f..28078850599902cf1fc9c6b993cfd2e8d8e8f64a 100644 --- a/src/thermophysicalModels/reactionThermo/mixtures/inhomogeneousMixture/inhomogeneousMixture.H +++ b/src/thermophysicalModels/reactionThermo/mixtures/inhomogeneousMixture/inhomogeneousMixture.H @@ -90,8 +90,7 @@ public: //- Destructor - virtual ~inhomogeneousMixture() - {} + virtual ~inhomogeneousMixture() = default; // Member functions diff --git a/src/thermophysicalModels/reactionThermo/mixtures/singleStepReactingMixture/singleStepReactingMixture.H b/src/thermophysicalModels/reactionThermo/mixtures/singleStepReactingMixture/singleStepReactingMixture.H index 22ef714a89d26e0d9af81695d7fb3619ad2bd0b1..0c541925addaafb1fe9091b5c191902c8cba3d88 100644 --- a/src/thermophysicalModels/reactionThermo/mixtures/singleStepReactingMixture/singleStepReactingMixture.H +++ b/src/thermophysicalModels/reactionThermo/mixtures/singleStepReactingMixture/singleStepReactingMixture.H @@ -129,8 +129,7 @@ public: //- Destructor - virtual ~singleStepReactingMixture() - {} + virtual ~singleStepReactingMixture() = default; // Member functions diff --git a/src/thermophysicalModels/reactionThermo/mixtures/veryInhomogeneousMixture/veryInhomogeneousMixture.C b/src/thermophysicalModels/reactionThermo/mixtures/veryInhomogeneousMixture/veryInhomogeneousMixture.C index 28d71d5f86acedc853ae705eeeb6a66c79b5e007..a745c41d3ac0c6251dca5a652b4ea80bef072237 100644 --- a/src/thermophysicalModels/reactionThermo/mixtures/veryInhomogeneousMixture/veryInhomogeneousMixture.C +++ b/src/thermophysicalModels/reactionThermo/mixtures/veryInhomogeneousMixture/veryInhomogeneousMixture.C @@ -55,7 +55,7 @@ Foam::veryInhomogeneousMixture<ThermoType>::veryInhomogeneousMixture phaseName ), - stoicRatio_(thermoDict.lookup("stoichiometricAirFuelMassRatio")), + stoicRatio_("stoichiometricAirFuelMassRatio", dimless, thermoDict), fuel_(thermoDict.subDict("fuel")), oxidant_(thermoDict.subDict("oxidant")), diff --git a/src/thermophysicalModels/reactionThermo/mixtures/veryInhomogeneousMixture/veryInhomogeneousMixture.H b/src/thermophysicalModels/reactionThermo/mixtures/veryInhomogeneousMixture/veryInhomogeneousMixture.H index 390f6390add740292fbe79413bad53784e6216de..fe662be352916b7dc23c67a9aa0d1dfff6a74b7d 100644 --- a/src/thermophysicalModels/reactionThermo/mixtures/veryInhomogeneousMixture/veryInhomogeneousMixture.H +++ b/src/thermophysicalModels/reactionThermo/mixtures/veryInhomogeneousMixture/veryInhomogeneousMixture.H @@ -98,8 +98,7 @@ public: //- Destructor - virtual ~veryInhomogeneousMixture() - {} + virtual ~veryInhomogeneousMixture() = default; // Member functions diff --git a/src/transportModels/interfaceProperties/surfaceTensionModels/constant/constantSurfaceTension.C b/src/transportModels/interfaceProperties/surfaceTensionModels/constant/constantSurfaceTension.C index 82470fdba76b90c1a894fd74bd1f6b343a5bc030..6277ca6153bd3a3c550c766b87f25187055bc073 100644 --- a/src/transportModels/interfaceProperties/surfaceTensionModels/constant/constantSurfaceTension.C +++ b/src/transportModels/interfaceProperties/surfaceTensionModels/constant/constantSurfaceTension.C @@ -48,7 +48,7 @@ Foam::surfaceTensionModels::constant::constant ) : surfaceTensionModel(mesh), - sigma_("sigma", dimensionSet(1, 0, -2, 0, 0), dict) + sigma_("sigma", dimMass/sqr(dimTime), dict) {} diff --git a/tutorials/incompressible/pimpleFoam/laminar/planarPoiseuille/validation/WatersKing/createFields.H b/tutorials/incompressible/pimpleFoam/laminar/planarPoiseuille/validation/WatersKing/createFields.H index 6ad317ff9be7d292a5bd9fa0e074f20987a52f0a..dcc9f5265643af2a3f8c5a0d1883d7621943949b 100644 --- a/tutorials/incompressible/pimpleFoam/laminar/planarPoiseuille/validation/WatersKing/createFields.H +++ b/tutorials/incompressible/pimpleFoam/laminar/planarPoiseuille/validation/WatersKing/createFields.H @@ -15,7 +15,7 @@ const scalar nu2 = ( "nu", dimViscosity, - transportProperties.lookup("nu") + transportProperties ).value(); Info<< "Reading viscoelastic properties\n" << endl;