diff --git a/applications/solvers/electromagnetics/magneticFoam/createFields.H b/applications/solvers/electromagnetics/magneticFoam/createFields.H index 4db509c0434cc04940dd3cfe285bf2d31cad59a1..3c99aa939d61def9606146e6ad0bd7c1d29105e2 100644 --- a/applications/solvers/electromagnetics/magneticFoam/createFields.H +++ b/applications/solvers/electromagnetics/magneticFoam/createFields.H @@ -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]); } diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/pU/UEqns.H b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/pU/UEqns.H index 99bc95cfd67e05ed3b5c2a1d8786b2b3fa253778..e325f6eca4e494d069ba6bf8919795be9695584f 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/pU/UEqns.H +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/pU/UEqns.H @@ -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> diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/pUf/UEqns.H b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/pUf/UEqns.H index cfaaeef81b43e9ef7597f25f5263b87b0be306d7..160212a069ac1b1d2f833225f1059cdfa19974b6 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/pUf/UEqns.H +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/pUf/UEqns.H @@ -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()); diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/conductivityModel/HrenyaSinclair/HrenyaSinclairConductivity.C b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/conductivityModel/HrenyaSinclair/HrenyaSinclairConductivity.C index a1794a78207bc71a4072656fca4ea909ff5cd89c..a437eacb510b1707872b9d579f41a060c15aef48 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/conductivityModel/HrenyaSinclair/HrenyaSinclairConductivity.C +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/conductivityModel/HrenyaSinclair/HrenyaSinclairConductivity.C @@ -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_) {} diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/HrenyaSinclair/HrenyaSinclairViscosity.C b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/HrenyaSinclair/HrenyaSinclairViscosity.C index 6607b16443d31daffa3edfbe6b628a1bd37adc70..68e0c14cf4393f522aabb055f90b40d4ac940a94 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/HrenyaSinclair/HrenyaSinclairViscosity.C +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/HrenyaSinclair/HrenyaSinclairViscosity.C @@ -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_) {} diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/phasePressureModel/phasePressureModel.C b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/phasePressureModel/phasePressureModel.C index 05cf94b90b24f928b979a567b99a29b28ff90d42..d15d19d939432ce2f6243c5a810eecbb23b2e076 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/phasePressureModel/phasePressureModel.C +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/phasePressureModel/phasePressureModel.C @@ -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) ); } diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/phasePressureModel/phasePressureModel.H b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/phasePressureModel/phasePressureModel.H index 48957ebeb82225c8d4806538c7ef7660bde23a07..66120ac933c88c1a610683dab60bbd9fd9cd8de1 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/phasePressureModel/phasePressureModel.H +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/phasePressureModel/phasePressureModel.H @@ -132,7 +132,7 @@ public: //- Destructor - virtual ~phasePressureModel(); + virtual ~phasePressureModel() = default; // Member Functions diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/pU/UEqns.H b/applications/solvers/multiphase/twoPhaseEulerFoam/pU/UEqns.H index bc8ad0f556eea8f8da0d8bdd9f0415f7c7ced230..f79037e33a2f51770cd1983268728867a7a0028a 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/pU/UEqns.H +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/pU/UEqns.H @@ -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()); diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/pUf/UEqns.H b/applications/solvers/multiphase/twoPhaseEulerFoam/pUf/UEqns.H index 0f46ae5b85bb16829242a8d27fad80baee254a10..e230ec234a611ac6e726c28521fad4f612d2b751 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/pUf/UEqns.H +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/pUf/UEqns.H @@ -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()); diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/conductivityModel/HrenyaSinclair/HrenyaSinclairConductivity.C b/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/conductivityModel/HrenyaSinclair/HrenyaSinclairConductivity.C index a1794a78207bc71a4072656fca4ea909ff5cd89c..a437eacb510b1707872b9d579f41a060c15aef48 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/conductivityModel/HrenyaSinclair/HrenyaSinclairConductivity.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/conductivityModel/HrenyaSinclair/HrenyaSinclairConductivity.C @@ -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_) {} diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.C b/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.C index 71fdca8d880a63095d7a1852afd1ebcab994fe40..e5e7f8bf97d308b37047603fca17e5519b9c2d24 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.C @@ -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) diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/HrenyaSinclair/HrenyaSinclairViscosity.C b/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/HrenyaSinclair/HrenyaSinclairViscosity.C index 6607b16443d31daffa3edfbe6b628a1bd37adc70..68e0c14cf4393f522aabb055f90b40d4ac940a94 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/HrenyaSinclair/HrenyaSinclairViscosity.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/HrenyaSinclair/HrenyaSinclairViscosity.C @@ -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_) {} diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/phasePressureModel/phasePressureModel.C b/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/phasePressureModel/phasePressureModel.C index 64fb24755ed0d1189581143ccd6e479265528121..d699973ef0cb3ce7e6dd57f8369112ace86f8dbf 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/phasePressureModel/phasePressureModel.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/phasePressureModel/phasePressureModel.C @@ -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; } diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/phasePressureModel/phasePressureModel.H b/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/phasePressureModel/phasePressureModel.H index f927e6194a8ae58d192f64f5d6dcb4df3b7975d0..bd3ab139473e6a351b3f0e42cabdfb9e13201749 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/phasePressureModel/phasePressureModel.H +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/phasePressureModel/phasePressureModel.H @@ -136,7 +136,7 @@ public: //- Destructor - virtual ~phasePressureModel(); + virtual ~phasePressureModel() = default; // Member Functions diff --git a/applications/utilities/preProcessing/createZeroDirectory/solverTemplate.C b/applications/utilities/preProcessing/createZeroDirectory/solverTemplate.C index 1e07af5e0c5337b4097bda4e53069590e675ecda..ab3effa5457f0184dd7acb71dfd2dd145291bed4 100644 --- a/applications/utilities/preProcessing/createZeroDirectory/solverTemplate.C +++ b/applications/utilities/preProcessing/createZeroDirectory/solverTemplate.C @@ -221,7 +221,7 @@ void Foam::solverTemplate::setRegionProperties fieldDimensions_[regionI].set ( i, - new dimensionSet(dict.lookup("dimensions")) + new dimensionSet(dict, "dimensions") ); } } diff --git a/src/OpenFOAM/dimensionSet/dimensionSet.H b/src/OpenFOAM/dimensionSet/dimensionSet.H index 4c2dc86ebb2c93ced96af075d9fe98b13a54196f..6218815af5b8bf75f406181aec107a526152a01c 100644 --- a/src/OpenFOAM/dimensionSet/dimensionSet.H +++ b/src/OpenFOAM/dimensionSet/dimensionSet.H @@ -68,14 +68,14 @@ public: typedef FixedList<scalar,7> list_type; - // Member constants + // Member Constants enum { nDimensions = 7 //!< 7 base dimensions }; - //- Define an enumeration for the names of the dimension exponents + //- Enumeration for the dimension exponents enum dimensionType { MASS, //!< kilogram kg @@ -189,9 +189,12 @@ public: //- Construct from exponents for all seven dimensions dimensionSet(const FixedList<scalar,7>& dimensions); - //- Copy constructor + //- Copy construct dimensionSet(const dimensionSet& ds); + //- Construct from dictionary entry - usually "dimensions". + dimensionSet(const dictionary& dict, const word& entryName); + //- Construct and return a clone autoPtr<dimensionSet> clone() const { diff --git a/src/OpenFOAM/dimensionSet/dimensionSetIO.C b/src/OpenFOAM/dimensionSet/dimensionSetIO.C index b1e0d296c55868abaf31dd909908dac13369cf77..4b1f1f7bc3415926d2396b62b7e860af0270454d 100644 --- a/src/OpenFOAM/dimensionSet/dimensionSetIO.C +++ b/src/OpenFOAM/dimensionSet/dimensionSetIO.C @@ -3,7 +3,7 @@ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation - \\/ M anipulation | + \\/ M anipulation | Copyright (C) 2019 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -30,6 +30,17 @@ License // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // +Foam::dimensionSet::dimensionSet(const dictionary& dict, const word& entryName) +{ + const entry& e = dict.lookupEntry(entryName, keyType::REGEX); + ITstream& is = e.stream(); + + is >> *this; + + e.checkITstream(is); +} + + Foam::dimensionSet::dimensionSet(Istream& is) { is >> *this; @@ -57,7 +68,7 @@ void Foam::dimensionSet::tokeniser::push(const token& t) } else { - size_++; + ++size_; } } @@ -620,7 +631,7 @@ Foam::Ostream& Foam::dimensionSet::write if (writeUnits.valid() && os.format() == IOstream::ASCII) { scalarField exponents(dimensionSet::nDimensions); - for (int d=0; d<dimensionSet::nDimensions; d++) + for (int d=0; d<dimensionSet::nDimensions; ++d) { exponents[d] = exponents_[d]; } diff --git a/src/OpenFOAM/dimensionSet/dimensionSets.H b/src/OpenFOAM/dimensionSet/dimensionSets.H index 643c8c4bb882758e61f68ec23ac32daf770bc8df..c7bd730d17e177c4ee815a7c8d8de56b3ae702e5 100644 --- a/src/OpenFOAM/dimensionSet/dimensionSets.H +++ b/src/OpenFOAM/dimensionSet/dimensionSets.H @@ -47,6 +47,7 @@ namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +//- Dimensionless extern const dimensionSet dimless; extern const dimensionSet dimMass; @@ -59,6 +60,9 @@ extern const dimensionSet dimLuminousIntensity; extern const dimensionSet dimArea; extern const dimensionSet dimVolume; + +//- Older spelling for dimVolume +// \deprecated(2019-01) use dimVolume instead extern const dimensionSet dimVol; extern const dimensionSet dimDensity; @@ -76,6 +80,7 @@ extern const dimensionSet dimViscosity; extern const dimensionSet dimDynamicViscosity; +//- Construction of unit sets class dimensionSets { // Private data @@ -120,7 +125,6 @@ public: //- (if valid) obtain set of coefficients of unitNames void coefficients(scalarField& exponents) const; - }; diff --git a/src/OpenFOAM/fields/DimensionedFields/DimensionedField/DimensionedFieldIO.C b/src/OpenFOAM/fields/DimensionedFields/DimensionedField/DimensionedFieldIO.C index cb1895f52583c6630e491a9a3e5013ff1156df83..dd54753ca4a4837b7b4bf704ee55d48c8c458150 100644 --- a/src/OpenFOAM/fields/DimensionedFields/DimensionedField/DimensionedFieldIO.C +++ b/src/OpenFOAM/fields/DimensionedFields/DimensionedField/DimensionedFieldIO.C @@ -35,7 +35,7 @@ void Foam::DimensionedField<Type, GeoMesh>::readField const word& fieldDictEntry ) { - dimensions_.reset(dimensionSet(fieldDict.lookup("dimensions"))); + dimensions_.reset(dimensionSet(fieldDict, "dimensions")); // Note: oriented state may have already been set on construction // - if so - do not reset by re-reading diff --git a/src/OpenFOAM/fields/UniformDimensionedFields/UniformDimensionedField.C b/src/OpenFOAM/fields/UniformDimensionedFields/UniformDimensionedField.C index 123c3b68146614a21fd744511df5bb7eeb423b80..b0422bf269b0ce059cf5a03456907d464dcfe61c 100644 --- a/src/OpenFOAM/fields/UniformDimensionedFields/UniformDimensionedField.C +++ b/src/OpenFOAM/fields/UniformDimensionedFields/UniformDimensionedField.C @@ -85,6 +85,7 @@ bool Foam::UniformDimensionedField<Type>::readData(Istream& is) dictionary dict(is); scalar multiplier; this->dimensions().read(dict.lookup("dimensions"), multiplier); + dict.readEntry("value", this->value()); this->value() *= multiplier; diff --git a/src/combustionModels/FSD/reactionRateFlameAreaModels/relaxation/relaxation.C b/src/combustionModels/FSD/reactionRateFlameAreaModels/relaxation/relaxation.C index f242e6e61fb1788c9b8cc604456ed4b7ae5cc5cb..a1c8b7627136babda87b2119e9ab6e29278138c1 100644 --- a/src/combustionModels/FSD/reactionRateFlameAreaModels/relaxation/relaxation.C +++ b/src/combustionModels/FSD/reactionRateFlameAreaModels/relaxation/relaxation.C @@ -113,8 +113,6 @@ void Foam::reactionRateFlameAreaModels::relaxation::correct const volScalarField omegaInf(correlation_.omega0Sigma(sigmaTotal)); - dimensionedScalar sigma0("sigma0", sigma.dimensions(), Zero); - const volScalarField tau(C_*mag(sigmaTotal)); volScalarField Rc @@ -157,10 +155,8 @@ bool Foam::reactionRateFlameAreaModels::relaxation::read ); return true; } - else - { - return false; - } + + return false; } // ************************************************************************* // diff --git a/tutorials/basic/potentialFoam/cylinder/system/controlDict b/tutorials/basic/potentialFoam/cylinder/system/controlDict index d3ac50be4debd4625a0e756bd487213187e64699..0dc0fde47f3dc84bf6eb8496cb9f5cfd82f37ede 100644 --- a/tutorials/basic/potentialFoam/cylinder/system/controlDict +++ b/tutorials/basic/potentialFoam/cylinder/system/controlDict @@ -70,12 +70,7 @@ functions } reduce(ULeft, maxOp<scalar>()); - dimensionedScalar uInfX - ( - "uInfx", - dimensionSet(0, 1, -1, 0, 0), - ULeft - ); + dimensionedScalar uInfX("uInfx", dimVelocity, ULeft); Info << "U at inlet = " << uInfX.value() << " m/s" << endl; @@ -89,12 +84,7 @@ functions } reduce(magCylinder, maxOp<scalar>()); - dimensionedScalar radius - ( - "radius", - dimensionSet(0, 1, 0, 0, 0), - magCylinder - ); + dimensionedScalar radius("radius", dimLength, magCylinder); Info << "Cylinder radius = " << radius.value() << " m" << endl;