diff --git a/applications/solvers/basic/potentialFoam/createFields.H b/applications/solvers/basic/potentialFoam/createFields.H index fcf3537bda..9aa23ef1fe 100644 --- a/applications/solvers/basic/potentialFoam/createFields.H +++ b/applications/solvers/basic/potentialFoam/createFields.H @@ -15,11 +15,10 @@ volVectorField U // Initialise the velocity internal field to zero // Note: explicitly bypass evaluation of contraint patch overrides // (e.g. swirlFanVelocity might lookup phi,rho) -//U = dimensionedVector(U.dimensions(), Zero); +//U = Zero; { - const dimensionedVector dt(U.dimensions(), Zero); - U.internalFieldRef() = dt; - U.boundaryFieldRef() = dt.value(); + U.internalFieldRef() = Zero; + U.boundaryFieldRef() = Zero; } surfaceScalarField phi diff --git a/applications/solvers/multiphase/compressibleMultiphaseInterFoam/multiphaseMixtureThermo/multiphaseMixtureThermo.C b/applications/solvers/multiphase/compressibleMultiphaseInterFoam/multiphaseMixtureThermo/multiphaseMixtureThermo.C index a190682c4a..85b0b50aec 100644 --- a/applications/solvers/multiphase/compressibleMultiphaseInterFoam/multiphaseMixtureThermo/multiphaseMixtureThermo.C +++ b/applications/solvers/multiphase/compressibleMultiphaseInterFoam/multiphaseMixtureThermo/multiphaseMixtureThermo.C @@ -1086,7 +1086,7 @@ void Foam::multiphaseMixtureThermo::solveAlphas MULES::limitSum(alphaPhiCorrs); - rhoPhi_ = dimensionedScalar(dimensionSet(1, 0, -1, 0, 0), Zero); + rhoPhi_ = Zero; volScalarField sumAlpha ( diff --git a/applications/solvers/multiphase/icoReactingMultiphaseInterFoam/laserDTRM/laserDTRM.C b/applications/solvers/multiphase/icoReactingMultiphaseInterFoam/laserDTRM/laserDTRM.C index a106c8e5aa..44d1484874 100644 --- a/applications/solvers/multiphase/icoReactingMultiphaseInterFoam/laserDTRM/laserDTRM.C +++ b/applications/solvers/multiphase/icoReactingMultiphaseInterFoam/laserDTRM/laserDTRM.C @@ -557,7 +557,7 @@ void Foam::radiation::laserDTRM::calculate() // Reset the field - Q_ == dimensionedScalar(Q_.dimensions(), Zero); + Q_ == Zero; a_ = absorptionEmission_->a(); e_ = absorptionEmission_->e(); diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/pEqn.H b/applications/solvers/multiphase/multiphaseEulerFoam/pEqn.H index 8861561888..23f5e126b9 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/pEqn.H +++ b/applications/solvers/multiphase/multiphaseEulerFoam/pEqn.H @@ -232,7 +232,7 @@ surfaceScalarField mSfGradp("mSfGradp", pEqnIncomp.flux()/rAUf); phasei = 0; - phi = dimensionedScalar("phi", phi.dimensions(), Zero); + phi = Zero; for (phaseModel& phase : fluid.phases()) { @@ -261,7 +261,7 @@ mSfGradp = pEqnIncomp.flux()/rAUf; - U = dimensionedVector("U", dimVelocity, Zero); + U = Zero; phasei = 0; for (phaseModel& phase : fluid.phases()) diff --git a/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/multiphaseMixture.C b/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/multiphaseMixture.C index 67db0089ab..b24b20a631 100644 --- a/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/multiphaseMixture.C +++ b/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/multiphaseMixture.C @@ -626,7 +626,7 @@ void Foam::multiphaseMixture::solveAlphas MULES::limitSum(alphaPhiCorrs); - rhoPhi_ = dimensionedScalar(dimMass/dimTime, Zero); + rhoPhi_ = Zero; volScalarField sumAlpha ( diff --git a/applications/solvers/stressAnalysis/solidEquilibriumDisplacementFoam/kineticEnergyLimiter.H b/applications/solvers/stressAnalysis/solidEquilibriumDisplacementFoam/kineticEnergyLimiter.H index 60a89e8ace..482237856e 100644 --- a/applications/solvers/stressAnalysis/solidEquilibriumDisplacementFoam/kineticEnergyLimiter.H +++ b/applications/solvers/stressAnalysis/solidEquilibriumDisplacementFoam/kineticEnergyLimiter.H @@ -14,6 +14,6 @@ if (!(runTime.timeIndex() % 5)) if (smi < -SMALL) { Info<< "Resetting Dcorr to 0" << endl; - Dcorr == dimensionedVector(Dcorr.dimensions(), Zero); + Dcorr == Zero; } } diff --git a/src/OpenFOAM/dimensionSet/dimensionSet.C b/src/OpenFOAM/dimensionSet/dimensionSet.C index 9c8ebcc5ae..c8042e6210 100644 --- a/src/OpenFOAM/dimensionSet/dimensionSet.C +++ b/src/OpenFOAM/dimensionSet/dimensionSet.C @@ -70,7 +70,7 @@ static inline bool checkDims Foam::dimensionSet::dimensionSet() : - exponents_(Zero) + exponents_(Foam::zero{}) {} @@ -142,7 +142,7 @@ Foam::dimensionSet::values() noexcept void Foam::dimensionSet::clear() { - exponents_ = Zero; + exponents_ = Foam::zero{}; } @@ -166,13 +166,13 @@ Foam::scalar& Foam::dimensionSet::operator[](const dimensionType type) } -Foam::scalar Foam::dimensionSet::operator[](const label type) const +Foam::scalar Foam::dimensionSet::operator[](const int type) const { return exponents_[type]; } -Foam::scalar& Foam::dimensionSet::operator[](const label type) +Foam::scalar& Foam::dimensionSet::operator[](const int type) { return exponents_[type]; } diff --git a/src/OpenFOAM/dimensionSet/dimensionSet.H b/src/OpenFOAM/dimensionSet/dimensionSet.H index c82f97b813..d54b6013e0 100644 --- a/src/OpenFOAM/dimensionSet/dimensionSet.H +++ b/src/OpenFOAM/dimensionSet/dimensionSet.H @@ -329,17 +329,26 @@ public: scalar operator[](const dimensionType) const; scalar& operator[](const dimensionType); - scalar operator[](const label) const; - scalar& operator[](const label); + scalar operator[](const int) const; + scalar& operator[](const int); bool operator==(const dimensionSet&) const; bool operator!=(const dimensionSet&) const; + //- Assignment operation, checks for identical dimensions. + //- Use reset() to change the dimensions. bool operator=(const dimensionSet&) const; + //- Addition operation, checks for identical dimensions. bool operator+=(const dimensionSet&) const; + + //- Subtraction operation, checks for identical dimensions. bool operator-=(const dimensionSet&) const; + + //- Multiplication, modifies the exponents. bool operator*=(const dimensionSet&); + + //- Division, modifies the exponents. bool operator/=(const dimensionSet&); }; @@ -414,7 +423,7 @@ dimensionSet invTransform(const dimensionSet& ds); //- The dimensionSet inverted dimensionSet operator~(const dimensionSet& ds); -//- Unary negation. +//- Unary negation; does not change the dimensions dimensionSet operator-(const dimensionSet& ds); dimensionSet operator+(const dimensionSet& ds1, const dimensionSet& ds2); diff --git a/src/OpenFOAM/fields/DimensionedFields/DimensionedField/DimensionedField.C b/src/OpenFOAM/fields/DimensionedFields/DimensionedField/DimensionedField.C index 79b4c0a879..6322c38f7c 100644 --- a/src/OpenFOAM/fields/DimensionedFields/DimensionedField/DimensionedField.C +++ b/src/OpenFOAM/fields/DimensionedFields/DimensionedField/DimensionedField.C @@ -560,6 +560,13 @@ void Foam::DimensionedField::operator= } +template +void Foam::DimensionedField::operator=(Foam::zero) +{ + Field::operator=(Foam::zero{}); +} + + #define COMPUTED_ASSIGNMENT(TYPE, op) \ \ template \ diff --git a/src/OpenFOAM/fields/DimensionedFields/DimensionedField/DimensionedField.H b/src/OpenFOAM/fields/DimensionedFields/DimensionedField/DimensionedField.H index 699ab87dd1..a2741b89e9 100644 --- a/src/OpenFOAM/fields/DimensionedFields/DimensionedField/DimensionedField.H +++ b/src/OpenFOAM/fields/DimensionedFields/DimensionedField/DimensionedField.H @@ -631,9 +631,12 @@ public: void operator=(const DimensionedField& df); void operator=(const tmp>& tdf); - //- Assign dimensions and value. + //- Assign value (with dimension check) void operator=(const dimensioned& dt); + //- Assign value zero (no dimension checks) + void operator=(Foam::zero); + void operator+=(const DimensionedField& df); void operator+=(const tmp>& tdf); diff --git a/src/OpenFOAM/fields/FieldFields/FieldField/FieldField.C b/src/OpenFOAM/fields/FieldFields/FieldField/FieldField.C index 7b21f1d7ea..8f7de39c30 100644 --- a/src/OpenFOAM/fields/FieldFields/FieldField/FieldField.C +++ b/src/OpenFOAM/fields/FieldFields/FieldField/FieldField.C @@ -450,9 +450,9 @@ void FieldField::operator=(const tmp& tf) template class Field, class Type> void FieldField::operator=(const Type& val) { - forAll(*this, i) + for (auto& pfld : *this) { - this->operator[](i) = val; + pfld = val; } } @@ -460,9 +460,9 @@ void FieldField::operator=(const Type& val) template class Field, class Type> void FieldField::operator=(Foam::zero) { - forAll(*this, i) + for (auto& pfld : *this) { - this->operator[](i) = Foam::zero{}; + pfld = Foam::zero{}; } } @@ -489,11 +489,11 @@ void FieldField::operator op \ } \ \ template class Field, class Type> \ -void FieldField::operator op(const TYPE& t) \ +void FieldField::operator op(const TYPE& val) \ { \ - forAll(*this, i) \ + for (auto& pfld : *this) \ { \ - this->operator[](i) op t; \ + pfld op val; \ } \ } diff --git a/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricBoundaryField.C b/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricBoundaryField.C index a5ec65e233..a82f8e5830 100644 --- a/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricBoundaryField.C +++ b/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricBoundaryField.C @@ -951,6 +951,16 @@ void Foam::GeometricBoundaryField::operator= } +template class PatchField, class GeoMesh> +void Foam::GeometricBoundaryField::operator= +( + Foam::zero +) +{ + FieldField::operator=(Foam::zero{}); +} + + template class PatchField, class GeoMesh> void Foam::GeometricBoundaryField::operator== ( @@ -983,9 +993,9 @@ void Foam::GeometricBoundaryField::operator== const Type& val ) { - forAll(*this, patchi) + for (auto& pfld : *this) { - this->operator[](patchi) == val; + pfld == val; } } diff --git a/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricBoundaryField.H b/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricBoundaryField.H index a726f84513..1794001ddb 100644 --- a/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricBoundaryField.H +++ b/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricBoundaryField.H @@ -260,6 +260,9 @@ public: //- Assignment to uniform value void operator=(const Type& val); + //- Assignment to zero + void operator=(Foam::zero); + //- Forced assignment from GeometricBoundaryField void operator==(const GeometricBoundaryField& bf); @@ -269,10 +272,14 @@ public: //- Forced assignment to uniform value void operator==(const Type& val); + //- Forced assignment to zero + void operator==(Foam::zero) { *this == Type(Foam::zero{}); } + // Prevent automatic comparison rewriting (c++20) bool operator!=(const GeometricBoundaryField&) = delete; bool operator!=(const FieldField&) = delete; bool operator!=(const Type&) = delete; + bool operator!=(Foam::zero) = delete; }; diff --git a/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricField.C b/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricField.C index c2ae24ad0e..e6fe9c335e 100644 --- a/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricField.C +++ b/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricField.C @@ -1478,6 +1478,21 @@ void Foam::GeometricField::operator= } +template class PatchField, class GeoMesh> +void Foam::GeometricField::operator=(Foam::zero) +{ + // No dimension checking + primitiveFieldRef() = Foam::zero{}; + boundaryFieldRef() = Foam::zero{}; + + // Make sure any e.g. jump-cyclic are updated. + boundaryFieldRef().evaluate_if + ( + [](const auto& pfld) { return pfld.constraintOverride(); } + ); +} + + template class PatchField, class GeoMesh> void Foam::GeometricField::operator== ( @@ -1520,6 +1535,21 @@ void Foam::GeometricField::operator== } +template class PatchField, class GeoMesh> +void Foam::GeometricField::operator==(Foam::zero) +{ + // No dimension checking + primitiveFieldRef() = Foam::zero{}; + boundaryFieldRef() == Foam::zero{}; + + // Make sure any e.g. jump-cyclic are updated. + boundaryFieldRef().evaluate_if + ( + [](const auto& pfld) { return pfld.constraintOverride(); } + ); +} + + #define COMPUTED_ASSIGNMENT(TYPE, op) \ \ template class PatchField, class GeoMesh> \ diff --git a/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricField.H b/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricField.H index cfe5504b07..dc4b0caaf2 100644 --- a/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricField.H +++ b/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricField.H @@ -1028,11 +1028,21 @@ public: void operator=(const GeometricField&); void operator=(const tmp>&); - void operator=(const dimensioned&); + + //- Assign value (with dimension check) + void operator=(const dimensioned& dt); + + //- Assign value zero (no dimension checks) + void operator=(Foam::zero); void operator==(const tmp>&); + + //- Assign value (with dimension check). Force assign for boundary. void operator==(const dimensioned&); + //- Assign value zero (no dimension checks). Force assign for boundary. + void operator==(Foam::zero); + void operator+=(const GeometricField&); void operator+=(const tmp>&); @@ -1061,6 +1071,7 @@ public: const tmp>& ) = delete; bool operator!=(const dimensioned&) = delete; + bool operator!=(Foam::zero) = delete; // Write diff --git a/src/TurbulenceModels/turbulenceModels/LES/LESdeltas/SLADelta/SLADelta.C b/src/TurbulenceModels/turbulenceModels/LES/LESdeltas/SLADelta/SLADelta.C index cdc256c7ec..e806592868 100644 --- a/src/TurbulenceModels/turbulenceModels/LES/LESdeltas/SLADelta/SLADelta.C +++ b/src/TurbulenceModels/turbulenceModels/LES/LESdeltas/SLADelta/SLADelta.C @@ -50,7 +50,7 @@ tmp sumNeighbours { const fvMesh& mesh = field.mesh(); - result == dimensioned(field.dimensions(), Zero); + result == Zero; auto tscaling = tmp::New(mesh.nCells(), Zero); auto& scaling = tscaling.ref(); diff --git a/src/combustionModels/FSD/FSD.C b/src/combustionModels/FSD/FSD.C index 03e4b93f68..8506a63dee 100644 --- a/src/combustionModels/FSD/FSD.C +++ b/src/combustionModels/FSD/FSD.C @@ -307,7 +307,7 @@ void FSD::calculateSourceNorm() template void FSD::correct() { - this->wFuel_ == dimensionedScalar(dimMass/dimTime/dimVolume, Zero); + this->wFuel_ == Zero; if (this->active()) { diff --git a/src/combustionModels/diffusion/diffusion.C b/src/combustionModels/diffusion/diffusion.C index 3c38be94ee..3acccfb632 100644 --- a/src/combustionModels/diffusion/diffusion.C +++ b/src/combustionModels/diffusion/diffusion.C @@ -69,7 +69,7 @@ diffusion::~diffusion() template void diffusion::correct() { - this->wFuel_ == dimensionedScalar(dimMass/dimVolume/dimTime, Zero); + this->wFuel_ == Zero; if (this->active()) { diff --git a/src/combustionModels/diffusionMulticomponent/diffusionMulticomponent.C b/src/combustionModels/diffusionMulticomponent/diffusionMulticomponent.C index 7a10ab2a17..354b0c958a 100644 --- a/src/combustionModels/diffusionMulticomponent/diffusionMulticomponent.C +++ b/src/combustionModels/diffusionMulticomponent/diffusionMulticomponent.C @@ -216,15 +216,13 @@ diffusionMulticomponent::correct() forAll(lhs, l) { const label lIndex = lhs[l].index; - this->chemistryPtr_->RR(lIndex) = - dimensionedScalar(dimMass/dimTime/dimVolume, Zero); + this->chemistryPtr_->RR(lIndex) = Zero; } forAll(rhs, l) { const label rIndex = rhs[l].index; - this->chemistryPtr_->RR(rIndex) = - dimensionedScalar(dimMass/dimTime/dimVolume, Zero); + this->chemistryPtr_->RR(rIndex) = Zero; } } diff --git a/src/combustionModels/eddyDissipationModelBase/eddyDissipationModelBase.C b/src/combustionModels/eddyDissipationModelBase/eddyDissipationModelBase.C index 3f4b1f6eac..197fb01bc5 100644 --- a/src/combustionModels/eddyDissipationModelBase/eddyDissipationModelBase.C +++ b/src/combustionModels/eddyDissipationModelBase/eddyDissipationModelBase.C @@ -81,7 +81,7 @@ eddyDissipationModelBase::rtTurb() const template void eddyDissipationModelBase::correct() { - this->wFuel_ == dimensionedScalar(dimMass/dimVolume/dimTime, Zero); + this->wFuel_ == Zero; if (this->active()) { diff --git a/src/combustionModels/infinitelyFastChemistry/infinitelyFastChemistry.C b/src/combustionModels/infinitelyFastChemistry/infinitelyFastChemistry.C index 4aad732a1b..dbf378fc85 100644 --- a/src/combustionModels/infinitelyFastChemistry/infinitelyFastChemistry.C +++ b/src/combustionModels/infinitelyFastChemistry/infinitelyFastChemistry.C @@ -67,7 +67,7 @@ infinitelyFastChemistry::~infinitelyFastChemistry() template void infinitelyFastChemistry::correct() { - this->wFuel_ == dimensionedScalar(dimMass/dimVolume/dimTime, Zero); + this->wFuel_ == Zero; if (this->active()) { diff --git a/src/finiteArea/faMatrices/faMatrix/faMatrix.H b/src/finiteArea/faMatrices/faMatrix/faMatrix.H index 0b4681537c..c74f3db1f6 100644 --- a/src/finiteArea/faMatrices/faMatrix/faMatrix.H +++ b/src/finiteArea/faMatrices/faMatrix/faMatrix.H @@ -510,8 +510,8 @@ public: void operator+=(const dimensioned&); void operator-=(const dimensioned&); - void operator+=(const Foam::zero) {} - void operator-=(const Foam::zero) {} + void operator+=(Foam::zero) {} + void operator-=(Foam::zero) {} void operator*=(const areaScalarField::Internal&); void operator*=(const tmp&); diff --git a/src/finiteVolume/cfdTools/compressible/createDpdt.H b/src/finiteVolume/cfdTools/compressible/createDpdt.H index b706984137..f374fc58df 100644 --- a/src/finiteVolume/cfdTools/compressible/createDpdt.H +++ b/src/finiteVolume/cfdTools/compressible/createDpdt.H @@ -27,6 +27,6 @@ volScalarField dpdt(dpdtHeader, fvc::ddt(p)); if (!thermo.dpdt()) { - dpdt == dimensionedScalar(dpdt.dimensions(), Zero); + dpdt == Zero; dpdt.writeOpt(IOobject::NO_WRITE); } diff --git a/src/finiteVolume/finiteVolume/snGradSchemes/skewCorrectedSnGrad/skewCorrectedSnGrad.C b/src/finiteVolume/finiteVolume/snGradSchemes/skewCorrectedSnGrad/skewCorrectedSnGrad.C index 6d1c26c514..c9e9078996 100644 --- a/src/finiteVolume/finiteVolume/snGradSchemes/skewCorrectedSnGrad/skewCorrectedSnGrad.C +++ b/src/finiteVolume/finiteVolume/snGradSchemes/skewCorrectedSnGrad/skewCorrectedSnGrad.C @@ -60,7 +60,7 @@ Foam::fv::skewCorrectedSnGrad::fullGradCorrection auto& ssf = tssf.ref(); ssf.setOriented(); - ssf = dimensioned(ssf.dimensions(), Zero); + ssf = Zero; typedef typename diff --git a/src/finiteVolume/fvMatrices/fvMatrix/fvMatrix.H b/src/finiteVolume/fvMatrices/fvMatrix/fvMatrix.H index 78f18d22c3..ff78e157b0 100644 --- a/src/finiteVolume/fvMatrices/fvMatrix/fvMatrix.H +++ b/src/finiteVolume/fvMatrices/fvMatrix/fvMatrix.H @@ -693,8 +693,8 @@ public: void operator+=(const dimensioned&); void operator-=(const dimensioned&); - void operator+=(const Foam::zero) {} - void operator-=(const Foam::zero) {} + void operator+=(Foam::zero) {} + void operator-=(Foam::zero) {} void operator*=(const volScalarField::Internal&); void operator*=(const tmp&); diff --git a/src/finiteVolume/fvMesh/fvMeshGeometry.C b/src/finiteVolume/fvMesh/fvMeshGeometry.C index 13b64832f1..de7858d917 100644 --- a/src/finiteVolume/fvMesh/fvMeshGeometry.C +++ b/src/finiteVolume/fvMesh/fvMeshGeometry.C @@ -427,7 +427,7 @@ const Foam::surfaceScalarField& Foam::fvMesh::phi() const // mesh motion fluxes if the time has been incremented if (!time().subCycling() && phiPtr_->timeIndex() != time().timeIndex()) { - (*phiPtr_) = dimensionedScalar(dimVolume/dimTime, Foam::zero{}); + (*phiPtr_) = Zero; } phiPtr_->setOriented(); diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/zoneBlended/zoneBlended.H b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/zoneBlended/zoneBlended.H index 49a2cb6c5e..f93a6e6bb6 100644 --- a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/zoneBlended/zoneBlended.H +++ b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/zoneBlended/zoneBlended.H @@ -310,7 +310,7 @@ public: auto tcorr = SurfaceField::New("correction", vf.mesh(), vf.dimensions()); auto& corr = tcorr.ref(); - corr = dimensioned(vf.dimensions(), Zero); + corr = Zero; // Set default scheme correction const auto& scheme0 = this->scheme(0); diff --git a/src/functionObjects/forces/forceCoeffs/forceCoeffs.C b/src/functionObjects/forces/forceCoeffs/forceCoeffs.C index bbad31544f..f78a491bd6 100644 --- a/src/functionObjects/forces/forceCoeffs/forceCoeffs.C +++ b/src/functionObjects/forces/forceCoeffs/forceCoeffs.C @@ -122,8 +122,8 @@ void Foam::functionObjects::forceCoeffs::reset() Cf_.reset(); Cm_.reset(); - forceCoeff() == dimensionedVector(dimless, Zero); - momentCoeff() == dimensionedVector(dimless, Zero); + forceCoeff() == Zero; + momentCoeff() == Zero; } diff --git a/src/functionObjects/forces/forces/forces.C b/src/functionObjects/forces/forces/forces.C index 3372d05fef..6be78db98b 100644 --- a/src/functionObjects/forces/forces/forces.C +++ b/src/functionObjects/forces/forces/forces.C @@ -200,8 +200,8 @@ void Foam::functionObjects::forces::reset() if (porosity_) { - force == dimensionedVector(force.dimensions(), Zero); - moment == dimensionedVector(moment.dimensions(), Zero); + force == Zero; + moment == Zero; } else { diff --git a/src/functionObjects/solvers/scalarTransport/scalarTransport.C b/src/functionObjects/solvers/scalarTransport/scalarTransport.C index 99af527a7b..49e1c749a9 100644 --- a/src/functionObjects/solvers/scalarTransport/scalarTransport.C +++ b/src/functionObjects/solvers/scalarTransport/scalarTransport.C @@ -195,7 +195,7 @@ Foam::functionObjects::scalarTransport::scalarTransport if (resetOnStartUp_) { - s == dimensionedScalar(dimless, Zero); + s == Zero; } } diff --git a/src/fused/finiteVolume/fusedGaussLaplacianScheme.C b/src/fused/finiteVolume/fusedGaussLaplacianScheme.C index 00553d55d9..733828511a 100644 --- a/src/fused/finiteVolume/fusedGaussLaplacianScheme.C +++ b/src/fused/finiteVolume/fusedGaussLaplacianScheme.C @@ -188,7 +188,7 @@ void fusedGaussLaplacianScheme::gradComponent GeometricField& gGrad ) { - gGrad = dimensioned(vf.dimensions()/dimLength, Zero); + gGrad = Zero; // Calculate grad of vf.component(cmpt) fvc::GaussOp diff --git a/src/fvMotionSolver/motionInterpolation/patchCorrected/patchCorrectedInterpolationTemplates.C b/src/fvMotionSolver/motionInterpolation/patchCorrected/patchCorrectedInterpolationTemplates.C index 5b79b23e7d..e896a84b06 100644 --- a/src/fvMotionSolver/motionInterpolation/patchCorrected/patchCorrectedInterpolationTemplates.C +++ b/src/fvMotionSolver/motionInterpolation/patchCorrected/patchCorrectedInterpolationTemplates.C @@ -109,7 +109,7 @@ void Foam::patchCorrectedInterpolation::interpolateDataFromPatchGroups dimensionedScalar(dimless, Zero), pointPatchFieldBase::zeroGradientType() ); - data = dimensioned(data.dimensions(), Zero); + data = Zero; forAll(patchGroups_, patchGroupI) { diff --git a/src/optimisation/adjointOptimisation/adjoint/objectives/incompressible/objectiveIncompressible/objectiveIncompressible.C b/src/optimisation/adjointOptimisation/adjoint/objectives/incompressible/objectiveIncompressible/objectiveIncompressible.C index 68ba25e6c7..80bb07f2df 100644 --- a/src/optimisation/adjointOptimisation/adjoint/objectives/incompressible/objectiveIncompressible/objectiveIncompressible.C +++ b/src/optimisation/adjointOptimisation/adjoint/objectives/incompressible/objectiveIncompressible/objectiveIncompressible.C @@ -240,29 +240,27 @@ void objectiveIncompressible::nullify() { if (hasdJdv()) { - dJdvPtr_() == dimensionedVector(dJdvPtr_().dimensions(), Zero); + dJdvPtr_() == Zero; } if (hasdJdp()) { - dJdpPtr_() == dimensionedScalar(dJdpPtr_().dimensions(), Zero); + dJdpPtr_() == Zero; } if (hasdJdT()) { - dJdTPtr_() == dimensionedScalar(dJdTPtr_().dimensions(), Zero); + dJdTPtr_() == Zero; } if (hasdJdTMVar1()) { - dJdTMvar1Ptr_() == - dimensionedScalar(dJdTMvar1Ptr_().dimensions(), Zero); + dJdTMvar1Ptr_() == Zero; } if (hasdJdTMVar2()) { - dJdTMvar2Ptr_() == - dimensionedScalar(dJdTMvar2Ptr_().dimensions(), Zero); + dJdTMvar2Ptr_() == Zero; } if (hasBoundarydJdv()) { - bdJdvPtr_() == vector::zero; + bdJdvPtr_() == Zero; } if (hasBoundarydJdvn()) { @@ -270,11 +268,11 @@ void objectiveIncompressible::nullify() } if (hasBoundarydJdvt()) { - bdJdvtPtr_() == vector::zero; + bdJdvtPtr_() == Zero; } if (hasBoundarydJdp()) { - bdJdpPtr_() == vector::zero; + bdJdpPtr_() == Zero; } if (hasBoundarydJdT()) { @@ -294,7 +292,7 @@ void objectiveIncompressible::nullify() } if (hasBoundarydJdGradU()) { - bdJdGradUPtr_() == tensor::zero; + bdJdGradUPtr_() == Zero; } // Nullify geometric fields and sets nullified_ to true diff --git a/src/optimisation/adjointOptimisation/adjoint/objectives/objective/objective.C b/src/optimisation/adjointOptimisation/adjoint/objectives/objective/objective.C index 04d8f96e2f..62edf8f6d8 100644 --- a/src/optimisation/adjointOptimisation/adjoint/objectives/objective/objective.C +++ b/src/optimisation/adjointOptimisation/adjoint/objectives/objective/objective.C @@ -484,7 +484,7 @@ void objective::nullify() { if (hasdJdb()) { - dJdbPtr_() == dimensionedScalar(dJdbPtr_().dimensions(), Zero); + dJdbPtr_() == Zero; } if (hasdJdbField()) { @@ -492,40 +492,38 @@ void objective::nullify() } if (hasBoundarydJdb()) { - bdJdbPtr_() == vector::zero; + bdJdbPtr_() == Zero; } if (hasdSdbMult()) { - bdSdbMultPtr_() == vector::zero; + bdSdbMultPtr_() == Zero; } if (hasdndbMult()) { - bdndbMultPtr_() == vector::zero; + bdndbMultPtr_() == Zero; } if (hasdxdbMult()) { - bdxdbMultPtr_() == vector::zero; + bdxdbMultPtr_() == Zero; } if (hasdxdbDirectMult()) { - bdxdbDirectMultPtr_() == vector::zero; + bdxdbDirectMultPtr_() == Zero; } if (hasBoundaryEdgeContribution()) { - for (Field& field : bEdgeContribution_()) + for (auto& field : bEdgeContribution_()) { - field = vector::zero; + field = Zero; } } if (hasDivDxDbMult()) { - divDxDbMultPtr_() == - dimensionedScalar(divDxDbMultPtr_().dimensions(), Zero); + divDxDbMultPtr_() == Zero; } if (hasGradDxDbMult()) { - gradDxDbMultPtr_() == - dimensionedTensor(gradDxDbMultPtr_().dimensions(), Zero); + gradDxDbMultPtr_() == Zero; } nullified_ = true; diff --git a/src/optimisation/adjointOptimisation/adjoint/optimisation/adjointSensitivity/adjointSensitivity/adjointEikonalSolver/adjointEikonalSolver.C b/src/optimisation/adjointOptimisation/adjoint/optimisation/adjointSensitivity/adjointSensitivity/adjointEikonalSolver/adjointEikonalSolver.C index 37e6b9d942..50cd348e92 100644 --- a/src/optimisation/adjointOptimisation/adjoint/optimisation/adjointSensitivity/adjointSensitivity/adjointEikonalSolver/adjointEikonalSolver.C +++ b/src/optimisation/adjointOptimisation/adjoint/optimisation/adjointSensitivity/adjointSensitivity/adjointEikonalSolver/adjointEikonalSolver.C @@ -266,8 +266,8 @@ void adjointEikonalSolver::solve() void adjointEikonalSolver::reset() { - source_ == dimensionedScalar(source_.dimensions(), Zero); - distanceSensPtr_() = vector::zero; + source_ == Zero; + distanceSensPtr_() = Zero; } diff --git a/src/optimisation/adjointOptimisation/adjoint/optimisation/adjointSensitivity/adjointSensitivity/shape/adjointMeshMovementSolver/adjointMeshMovementSolver.C b/src/optimisation/adjointOptimisation/adjoint/optimisation/adjointSensitivity/adjointSensitivity/shape/adjointMeshMovementSolver/adjointMeshMovementSolver.C index ea19da52b7..7de25450f9 100644 --- a/src/optimisation/adjointOptimisation/adjoint/optimisation/adjointSensitivity/adjointSensitivity/shape/adjointMeshMovementSolver/adjointMeshMovementSolver.C +++ b/src/optimisation/adjointOptimisation/adjoint/optimisation/adjointSensitivity/adjointSensitivity/shape/adjointMeshMovementSolver/adjointMeshMovementSolver.C @@ -187,7 +187,7 @@ void adjointMeshMovementSolver::solve() void adjointMeshMovementSolver::reset() { - source_ == dimensionedVector(source_.dimensions(), Zero); + source_ == Zero; meshMovementSensPtr_() = Zero; } diff --git a/src/optimisation/adjointOptimisation/adjoint/optimisation/adjointSensitivity/adjointSensitivity/shape/shapeSensitivityBase/ShapeSensitivitiesBase.C b/src/optimisation/adjointOptimisation/adjoint/optimisation/adjointSensitivity/adjointSensitivity/shape/shapeSensitivityBase/ShapeSensitivitiesBase.C index b788697ca1..a29af42cd0 100644 --- a/src/optimisation/adjointOptimisation/adjoint/optimisation/adjointSensitivity/adjointSensitivity/shape/shapeSensitivityBase/ShapeSensitivitiesBase.C +++ b/src/optimisation/adjointOptimisation/adjoint/optimisation/adjointSensitivity/adjointSensitivity/shape/shapeSensitivityBase/ShapeSensitivitiesBase.C @@ -237,7 +237,7 @@ void Foam::ShapeSensitivitiesBase::allocateMultipliers() void Foam::ShapeSensitivitiesBase::clearMultipliers() { - gradDxDbMult_() = dimensionedTensor(gradDxDbMult_().dimensions(), Zero); + gradDxDbMult_() = Zero; if (divDxDbMult_) { divDxDbMult_() = Zero; diff --git a/src/optimisation/adjointOptimisation/adjoint/solvers/variablesSet/incompressible/incompressibleVars.C b/src/optimisation/adjointOptimisation/adjoint/solvers/variablesSet/incompressible/incompressibleVars.C index 09b49f8336..a730ece872 100644 --- a/src/optimisation/adjointOptimisation/adjoint/solvers/variablesSet/incompressible/incompressibleVars.C +++ b/src/optimisation/adjointOptimisation/adjoint/solvers/variablesSet/incompressible/incompressibleVars.C @@ -402,9 +402,9 @@ void incompressibleVars::resetMeanFields() Info<< "Resetting mean fields to zero" << endl; // Reset fields to zero - pMeanPtr_() == dimensionedScalar(pInst().dimensions(), Zero); - UMeanPtr_() == dimensionedVector(UInst().dimensions(), Zero); - phiMeanPtr_() == dimensionedScalar(phiInst().dimensions(), Zero); + pMeanPtr_() == Zero; + UMeanPtr_() == Zero; + phiMeanPtr_() == Zero; RASModelVariables_().resetMeanFields(); // Reset averaging iteration index to 0 diff --git a/src/optimisation/adjointOptimisation/adjoint/solvers/variablesSet/incompressibleAdjoint/incompressibleAdjointVars.C b/src/optimisation/adjointOptimisation/adjoint/solvers/variablesSet/incompressibleAdjoint/incompressibleAdjointVars.C index 19695a6371..d6c81954e5 100644 --- a/src/optimisation/adjointOptimisation/adjoint/solvers/variablesSet/incompressibleAdjoint/incompressibleAdjointVars.C +++ b/src/optimisation/adjointOptimisation/adjoint/solvers/variablesSet/incompressibleAdjoint/incompressibleAdjointVars.C @@ -72,9 +72,9 @@ void incompressibleAdjointVars::restoreInitValues() if (solverControl_.storeInitValues()) { Info<< "Restoring adjoint field to initial ones" << endl; - paInst() == dimensionedScalar(paInst().dimensions(), Zero); - UaInst() == dimensionedVector(UaInst().dimensions(), Zero); - phiaInst() == dimensionedScalar(phiaInst().dimensions(), Zero); + paInst() == Zero; + UaInst() == Zero; + phiaInst() == Zero; adjointTurbulence_().restoreInitValues(); } } @@ -87,9 +87,9 @@ void incompressibleAdjointVars::resetMeanFields() Info<< "Resetting adjoint mean fields to zero" << endl; // Reset fields to zero - paMeanPtr_() == dimensionedScalar(paPtr_().dimensions(), Zero); - UaMeanPtr_() == dimensionedVector(UaPtr_().dimensions(), Zero); - phiaMeanPtr_() == dimensionedScalar(phiaPtr_().dimensions(), Zero); + paMeanPtr_() == Zero; + UaMeanPtr_() == Zero; + phiaMeanPtr_() == Zero; adjointTurbulence_().resetMeanFields(); // Reset averaging iteration index to 0 diff --git a/src/optimisation/adjointOptimisation/adjoint/solvers/variablesSet/variablesSet/variablesSetTemplates.C b/src/optimisation/adjointOptimisation/adjoint/solvers/variablesSet/variablesSet/variablesSetTemplates.C index d52815787e..2a0d58f81d 100644 --- a/src/optimisation/adjointOptimisation/adjoint/solvers/variablesSet/variablesSet/variablesSetTemplates.C +++ b/src/optimisation/adjointOptimisation/adjoint/solvers/variablesSet/variablesSet/variablesSetTemplates.C @@ -348,11 +348,10 @@ void variablesSet::nullifyField GeometricField& field ) { - typedef GeometricField fieldType; - field == dimensioned(field.dimensions(), Zero); + field == Zero; if (field.nOldTimes()) { - fieldType& oldTime = field.oldTime(); + auto& oldTime = field.oldTime(); variablesSet::nullifyField(oldTime); } } diff --git a/src/optimisation/adjointOptimisation/adjoint/turbulenceModels/incompressibleAdjoint/adjointRAS/adjointRASModel/adjointRASModel.C b/src/optimisation/adjointOptimisation/adjoint/turbulenceModels/incompressibleAdjoint/adjointRAS/adjointRASModel/adjointRASModel.C index c98b5d5e18..b5e76cfaa6 100644 --- a/src/optimisation/adjointOptimisation/adjoint/turbulenceModels/incompressibleAdjoint/adjointRAS/adjointRASModel/adjointRASModel.C +++ b/src/optimisation/adjointOptimisation/adjoint/turbulenceModels/incompressibleAdjoint/adjointRAS/adjointRASModel/adjointRASModel.C @@ -68,14 +68,12 @@ void adjointRASModel::restoreInitValues() { if (adjointTMVariable1Ptr_) { - volScalarField& var1 = adjointTMVariable1Ptr_.ref(); - var1 == dimensionedScalar(var1.dimensions(), Zero); + adjointTMVariable1Ptr_.ref() == Zero; } if (adjointTMVariable2Ptr_) { - volScalarField& var2 = adjointTMVariable2Ptr_.ref(); - var2 == dimensionedScalar(var2.dimensions(), Zero); + adjointTMVariable2Ptr_.ref() == Zero; } } } @@ -465,13 +463,11 @@ void adjointRASModel::resetMeanFields() { if (adjointTMVariable1MeanPtr_) { - adjointTMVariable1MeanPtr_() == - dimensionedScalar(adjointTMVariable1Ptr_().dimensions(), Zero); + adjointTMVariable1MeanPtr_.ref() == Zero; } if (adjointTMVariable2MeanPtr_) { - adjointTMVariable2MeanPtr_() == - dimensionedScalar(adjointTMVariable2Ptr_().dimensions(), Zero); + adjointTMVariable2MeanPtr_.ref() == Zero; } } } diff --git a/src/optimisation/adjointOptimisation/adjoint/turbulenceModels/turbulenceModelVariables/RAS/RASModelVariables/RASModelVariables.C b/src/optimisation/adjointOptimisation/adjoint/turbulenceModels/turbulenceModelVariables/RAS/RASModelVariables/RASModelVariables.C index 0765077177..f7ae6ecb45 100644 --- a/src/optimisation/adjointOptimisation/adjoint/turbulenceModels/turbulenceModelVariables/RAS/RASModelVariables/RASModelVariables.C +++ b/src/optimisation/adjointOptimisation/adjoint/turbulenceModels/turbulenceModelVariables/RAS/RASModelVariables/RASModelVariables.C @@ -363,18 +363,15 @@ void RASModelVariables::resetMeanFields() // Reset fields to zero if (TMVar1MeanPtr_) { - TMVar1MeanPtr_.ref() == - dimensionedScalar(TMVar1Inst().dimensions(), Zero); + TMVar1MeanPtr_.ref() == Zero; } if (TMVar2MeanPtr_) { - TMVar2MeanPtr_.ref() == - dimensionedScalar(TMVar2Inst().dimensions(), Zero); + TMVar2MeanPtr_.ref() == Zero; } if (nutMeanPtr_) { - nutMeanPtr_.ref() == - dimensionedScalar(nutRefInst().dimensions(), Zero); + nutMeanPtr_.ref() == Zero; } } } diff --git a/src/phaseSystemModels/multiphaseInter/phasesSystem/multiphaseSystem/multiphaseSystem.C b/src/phaseSystemModels/multiphaseInter/phasesSystem/multiphaseSystem/multiphaseSystem.C index 7e2538f964..40311311cd 100644 --- a/src/phaseSystemModels/multiphaseInter/phasesSystem/multiphaseSystem/multiphaseSystem.C +++ b/src/phaseSystemModels/multiphaseInter/phasesSystem/multiphaseSystem/multiphaseSystem.C @@ -262,8 +262,8 @@ void Foam::multiphaseInter::multiphaseSystem::solveAlphas() // Set Su and Sp to zero for (const multiphaseInter::phaseModel& phase : phases_) { - Su_[phase.name()] = dimensionedScalar("Su", dimless/dimTime, Zero); - Sp_[phase.name()] = dimensionedScalar("Sp", dimless/dimTime, Zero); + Su_[phase.name()] = Zero; + Sp_[phase.name()] = Zero; // Add alpha*div(U) //const volScalarField& alpha = phase; @@ -368,7 +368,7 @@ void Foam::multiphaseInter::multiphaseSystem::solveAlphas() ); // Reset rhoPhi - rhoPhi_ = dimensionedScalar("rhoPhi", dimMass/dimTime, Zero); + rhoPhi_ = Zero; for (multiphaseInter::phaseModel& phase : phases_) { diff --git a/src/phaseSystemModels/multiphaseInter/phasesSystem/phaseModel/StaticPhaseModel/StaticPhaseModel.C b/src/phaseSystemModels/multiphaseInter/phasesSystem/phaseModel/StaticPhaseModel/StaticPhaseModel.C index 74e80086dc..44576cc022 100644 --- a/src/phaseSystemModels/multiphaseInter/phasesSystem/phaseModel/StaticPhaseModel/StaticPhaseModel.C +++ b/src/phaseSystemModels/multiphaseInter/phasesSystem/phaseModel/StaticPhaseModel/StaticPhaseModel.C @@ -101,7 +101,7 @@ template const Foam::surfaceScalarField& Foam::StaticPhaseModel::phi() { - phi_ = dimensionedScalar(dimensionSet(0, 3, -1, 0, 0), Zero); + phi_ = Zero; return phi_; } @@ -128,7 +128,7 @@ template Foam::surfaceScalarField& Foam::StaticPhaseModel::alphaPhi() { - alphaPhi_ = dimensionedScalar(dimensionSet(0, 3, -1, 0, 0), Zero); + alphaPhi_ = Zero; return alphaPhi_; } diff --git a/src/phaseSystemModels/reactingEuler/multiphaseSystem/PhaseSystems/ThermalPhaseChangePhaseSystem/ThermalPhaseChangePhaseSystem.C b/src/phaseSystemModels/reactingEuler/multiphaseSystem/PhaseSystems/ThermalPhaseChangePhaseSystem/ThermalPhaseChangePhaseSystem.C index ac4ee7ca4c..0d596b2608 100644 --- a/src/phaseSystemModels/reactingEuler/multiphaseSystem/PhaseSystems/ThermalPhaseChangePhaseSystem/ThermalPhaseChangePhaseSystem.C +++ b/src/phaseSystemModels/reactingEuler/multiphaseSystem/PhaseSystems/ThermalPhaseChangePhaseSystem/ThermalPhaseChangePhaseSystem.C @@ -418,7 +418,7 @@ Foam::ThermalPhaseChangePhaseSystem::correctInterfaceThermo() } else { - iDmdtNew == dimensionedScalar(iDmdt.dimensions()); + iDmdtNew == Zero; } volScalarField H1(heatTransferModelIter().first()->K()); diff --git a/src/phaseSystemModels/reactingEuler/twoPhaseCompressibleTurbulenceModels/phasePressureModel/phasePressureModel.C b/src/phaseSystemModels/reactingEuler/twoPhaseCompressibleTurbulenceModels/phasePressureModel/phasePressureModel.C index 0f04837778..dfd0bbf6c0 100644 --- a/src/phaseSystemModels/reactingEuler/twoPhaseCompressibleTurbulenceModels/phasePressureModel/phasePressureModel.C +++ b/src/phaseSystemModels/reactingEuler/twoPhaseCompressibleTurbulenceModels/phasePressureModel/phasePressureModel.C @@ -63,7 +63,7 @@ Foam::RASModels::phasePressureModel::phasePressureModel expMax_(coeffDict_.get("expMax")), g0_("g0", dimPressure, coeffDict_) { - nut_ == dimensionedScalar(nut_.dimensions()); + nut_ == Zero; if (type == typeName) { @@ -205,11 +205,8 @@ Foam::RASModels::phasePressureModel::devRhoReff IOobject::groupName("devRhoReff", U.group()), IOobject::NO_REGISTER, mesh_, - dimensioned - ( - rho_.dimensions()*dimensionSet(0, 2, -2, 0, 0), - Zero - ) + Zero, + rho_.dimensions()*dimensionSet(0, 2, -2, 0, 0) ); } diff --git a/src/phaseSystemModels/reactingEuler/twoPhaseSystem/diameterModels/IATE/IATEsources/dummy/dummy.C b/src/phaseSystemModels/reactingEuler/twoPhaseSystem/diameterModels/IATE/IATEsources/dummy/dummy.C index e16fd9708e..ed2c5156c6 100644 --- a/src/phaseSystemModels/reactingEuler/twoPhaseSystem/diameterModels/IATE/IATEsources/dummy/dummy.C +++ b/src/phaseSystemModels/reactingEuler/twoPhaseSystem/diameterModels/IATE/IATEsources/dummy/dummy.C @@ -61,7 +61,7 @@ Foam::diameterModels::IATEsources::dummy::R iate_.phase().mesh() ), iate_.phase().mesh(), - dimensionedScalar(kappai.dimensions()/dimTime, 0) + dimensionedScalar(kappai.dimensions()/dimTime, Zero) ); return fvm::Su(R, kappai); diff --git a/src/phaseSystemModels/twoPhaseEuler/phaseCompressibleTurbulenceModels/phasePressureModel/phasePressureModel.C b/src/phaseSystemModels/twoPhaseEuler/phaseCompressibleTurbulenceModels/phasePressureModel/phasePressureModel.C index 3534b0abe3..ede79a0def 100644 --- a/src/phaseSystemModels/twoPhaseEuler/phaseCompressibleTurbulenceModels/phasePressureModel/phasePressureModel.C +++ b/src/phaseSystemModels/twoPhaseEuler/phaseCompressibleTurbulenceModels/phasePressureModel/phasePressureModel.C @@ -66,7 +66,7 @@ Foam::RASModels::phasePressureModel::phasePressureModel expMax_(coeffDict_.get("expMax")), g0_("g0", dimPressure, coeffDict_) { - nut_ == dimensionedScalar(nut_.dimensions(), Zero); + nut_ == Zero; if (type == typeName) { @@ -213,10 +213,8 @@ Foam::RASModels::phasePressureModel::devRhoReff IOobject::groupName("devRhoReff", U.group()), IOobject::NO_REGISTER, mesh_, - dimensioned - ( - rho_.dimensions()*dimensionSet(0, 2, -2, 0, 0), Zero - ) + Zero, + rho_.dimensions()*dimensionSet(0, 2, -2, 0, 0) ); } diff --git a/src/regionFaModels/liquidFilm/liquidFilmModel/liquidFilmModel.C b/src/regionFaModels/liquidFilm/liquidFilmModel/liquidFilmModel.C index 611e75abea..982b171123 100644 --- a/src/regionFaModels/liquidFilm/liquidFilmModel/liquidFilmModel.C +++ b/src/regionFaModels/liquidFilm/liquidFilmModel/liquidFilmModel.C @@ -266,8 +266,8 @@ void liquidFilmModel::preEvolveRegion() liquidFilmBase::preEvolveRegion(); - cloudMassTrans_ == dimensionedScalar(dimMass, Zero); - cloudDiameterTrans_ == dimensionedScalar(dimLength, Zero); + cloudMassTrans_ == Zero; + cloudDiameterTrans_ == Zero; const scalar deltaT = primaryMesh().time().deltaTValue(); const scalarField rAreaDeltaT(scalar(1)/deltaT/regionMesh().S().field()); diff --git a/src/regionModels/pyrolysisModels/reactingOneDim/reactingOneDim.C b/src/regionModels/pyrolysisModels/reactingOneDim/reactingOneDim.C index 2c81e9ac7c..d1a0779fe9 100644 --- a/src/regionModels/pyrolysisModels/reactingOneDim/reactingOneDim.C +++ b/src/regionModels/pyrolysisModels/reactingOneDim/reactingOneDim.C @@ -92,7 +92,7 @@ bool reactingOneDim::read(const dictionary& dict) void reactingOneDim::updateqr() { // Update local qr from coupled qr field - qr_ == dimensionedScalar(qr_.dimensions(), Zero); + qr_ == Zero; // Retrieve field from coupled region using mapped boundary conditions qr_.correctBoundaryConditions(); @@ -143,8 +143,8 @@ void reactingOneDim::updateqr() void reactingOneDim::updatePhiGas() { - phiHsGas_ == dimensionedScalar(phiHsGas_.dimensions(), Zero); - phiGas_ == dimensionedScalar(phiGas_.dimensions(), Zero); + phiHsGas_ == Zero; + phiGas_ == Zero; const speciesTable& gasTable = solidChemistry_->gasTable(); diff --git a/src/regionModels/surfaceFilmModels/kinematicSingleLayer/kinematicSingleLayer.C b/src/regionModels/surfaceFilmModels/kinematicSingleLayer/kinematicSingleLayer.C index 4e3ca4b73e..5d22ce7112 100644 --- a/src/regionModels/surfaceFilmModels/kinematicSingleLayer/kinematicSingleLayer.C +++ b/src/regionModels/surfaceFilmModels/kinematicSingleLayer/kinematicSingleLayer.C @@ -85,9 +85,9 @@ void kinematicSingleLayer::resetPrimaryRegionSourceTerms() { DebugInFunction << endl; - rhoSpPrimary_ == dimensionedScalar(rhoSp_.dimensions(), Zero); - USpPrimary_ == dimensionedVector(USp_.dimensions(), Zero); - pSpPrimary_ == dimensionedScalar(pSp_.dimensions(), Zero); + rhoSpPrimary_ == Zero; + USpPrimary_ == Zero; + pSpPrimary_ == Zero; } @@ -849,9 +849,9 @@ void kinematicSingleLayer::preEvolveRegion() // Reset transfer fields availableMass_ = mass(); - cloudMassTrans_ == dimensionedScalar(dimMass, Zero); - cloudDiameterTrans_ == dimensionedScalar(dimLength, Zero); - primaryMassTrans_ == dimensionedScalar(dimMass, Zero); + cloudMassTrans_ == Zero; + cloudDiameterTrans_ == Zero; + primaryMassTrans_ == Zero; } diff --git a/src/regionModels/surfaceFilmModels/thermoSingleLayer/thermoSingleLayer.C b/src/regionModels/surfaceFilmModels/thermoSingleLayer/thermoSingleLayer.C index b62a18da60..ed125352f3 100644 --- a/src/regionModels/surfaceFilmModels/thermoSingleLayer/thermoSingleLayer.C +++ b/src/regionModels/surfaceFilmModels/thermoSingleLayer/thermoSingleLayer.C @@ -98,7 +98,7 @@ void thermoSingleLayer::resetPrimaryRegionSourceTerms() kinematicSingleLayer::resetPrimaryRegionSourceTerms(); - hsSpPrimary_ == dimensionedScalar(hsSp_.dimensions(), Zero); + hsSpPrimary_ == Zero; } @@ -607,7 +607,7 @@ void thermoSingleLayer::preEvolveRegion() DebugInFunction << endl; kinematicSingleLayer::preEvolveRegion(); - primaryEnergyTrans_ == dimensionedScalar(dimEnergy, Zero); + primaryEnergyTrans_ == Zero; } diff --git a/src/thermophysicalModels/radiation/radiationModels/fvDOM/fvDOM/fvDOM.C b/src/thermophysicalModels/radiation/radiationModels/fvDOM/fvDOM/fvDOM.C index 234489340e..d6d6a7f7f9 100644 --- a/src/thermophysicalModels/radiation/radiationModels/fvDOM/fvDOM/fvDOM.C +++ b/src/thermophysicalModels/radiation/radiationModels/fvDOM/fvDOM/fvDOM.C @@ -725,10 +725,10 @@ void Foam::radiation::fvDOM::updateBlackBodyEmission() void Foam::radiation::fvDOM::updateG() { - G_ = dimensionedScalar(dimMass/pow3(dimTime), Zero); - qr_ = dimensionedScalar(dimMass/pow3(dimTime), Zero); - qem_ = dimensionedScalar(dimMass/pow3(dimTime), Zero); - qin_ = dimensionedScalar(dimMass/pow3(dimTime), Zero); + G_ = Zero; + qr_ = Zero; + qem_ = Zero; + qin_ = Zero; forAll(IRay_, rayI) { diff --git a/src/thermophysicalModels/radiation/radiationModels/fvDOM/radiativeIntensityRay/radiativeIntensityRay.C b/src/thermophysicalModels/radiation/radiationModels/fvDOM/radiativeIntensityRay/radiativeIntensityRay.C index 4fea2866a9..fa8719b970 100644 --- a/src/thermophysicalModels/radiation/radiationModels/fvDOM/radiativeIntensityRay/radiativeIntensityRay.C +++ b/src/thermophysicalModels/radiation/radiationModels/fvDOM/radiativeIntensityRay/radiativeIntensityRay.C @@ -300,7 +300,7 @@ Foam::scalar Foam::radiation::radiativeIntensityRay::correct() void Foam::radiation::radiativeIntensityRay::addIntensity() { - I_ = dimensionedScalar(dimMass/pow3(dimTime), Zero); + I_ = Zero; forAll(ILambda_, lambdaI) { diff --git a/src/thermophysicalModels/radiation/radiationModels/solarLoad/solarLoad.C b/src/thermophysicalModels/radiation/radiationModels/solarLoad/solarLoad.C index 15f2c414f8..c079d886f6 100644 --- a/src/thermophysicalModels/radiation/radiationModels/solarLoad/solarLoad.C +++ b/src/thermophysicalModels/radiation/radiationModels/solarLoad/solarLoad.C @@ -868,7 +868,7 @@ void Foam::radiation::solarLoad::calculate() if (firstIter_ || facesChanged || timeDependentLoad) { // Reset Ru - Ru_ = dimensionedScalar("Ru", dimMass/dimLength/pow3(dimTime), Zero); + Ru_ = Zero; solarCalc_.correctDirectSolarRad(); solarCalc_.correctDiffuseSolarRad(); diff --git a/src/thermophysicalModels/radiation/submodels/absorptionEmissionModel/wideBandAbsorptionEmission/wideBandAbsorptionEmission.C b/src/thermophysicalModels/radiation/submodels/absorptionEmissionModel/wideBandAbsorptionEmission/wideBandAbsorptionEmission.C index 3eb8adc9e5..6fb912f9ca 100644 --- a/src/thermophysicalModels/radiation/submodels/absorptionEmissionModel/wideBandAbsorptionEmission/wideBandAbsorptionEmission.C +++ b/src/thermophysicalModels/radiation/submodels/absorptionEmissionModel/wideBandAbsorptionEmission/wideBandAbsorptionEmission.C @@ -328,7 +328,7 @@ void Foam::radiation::wideBandAbsorptionEmission::correct PtrList& aLambda ) const { - a = dimensionedScalar(dimless/dimLength, Zero); + a = Zero; for (label j=0; j(mesh, phaseName) { calculate(); - this->mu_ == dimensionedScalar(this->mu_.dimensions(), Zero); - this->psi_ == dimensionedScalar(this->psi_.dimensions(), Zero); + this->mu_ == Zero; + this->psi_ == Zero; } @@ -168,8 +168,8 @@ heSolidThermo heThermo(mesh, dict, phaseName) { calculate(); - this->mu_ == dimensionedScalar(this->mu_.dimensions(), Zero); - this->psi_ == dimensionedScalar(this->psi_.dimensions(), Zero); + this->mu_ == Zero; + this->psi_ == Zero; } @@ -188,8 +188,8 @@ heSolidThermo // TBD. initialise psi, mu (at heThermo level) since these do not // get initialised. Move to heThermo constructor? - this->mu_ == dimensionedScalar(this->mu_.dimensions(), Zero); - this->psi_ == dimensionedScalar(this->psi_.dimensions(), Zero); + this->mu_ == Zero; + this->psi_ == Zero; } diff --git a/src/transportModels/geometricVoF/advectionSchemes/isoAdvection/isoAdvectionTemplates.C b/src/transportModels/geometricVoF/advectionSchemes/isoAdvection/isoAdvectionTemplates.C index b0dc0607d7..55f01dc3ea 100644 --- a/src/transportModels/geometricVoF/advectionSchemes/isoAdvection/isoAdvectionTemplates.C +++ b/src/transportModels/geometricVoF/advectionSchemes/isoAdvection/isoAdvectionTemplates.C @@ -150,7 +150,7 @@ void Foam::isoAdvection::limitFluxes DebugInfo << "boundAlpha... " << endl; DynamicList