diff --git a/applications/solvers/compressible/rhoSimpleFoam/rhoPorousSimpleFoam/createZones.H b/applications/solvers/compressible/rhoSimpleFoam/rhoPorousSimpleFoam/createZones.H index fe3d118608..a5123dd754 100644 --- a/applications/solvers/compressible/rhoSimpleFoam/rhoPorousSimpleFoam/createZones.H +++ b/applications/solvers/compressible/rhoSimpleFoam/rhoPorousSimpleFoam/createZones.H @@ -3,7 +3,7 @@ // nUCorrectors used for pressureImplicitPorosity int nUCorr = 0; - if (pZones.active()) + if (pZones.UPtrList::size()) { // nUCorrectors for pressureImplicitPorosity simple.dict().readIfPresent("nUCorrectors", nUCorr); diff --git a/applications/solvers/incompressible/simpleFoam/porousSimpleFoam/createPorousZones.H b/applications/solvers/incompressible/simpleFoam/porousSimpleFoam/createPorousZones.H index 5c6dbea19c..c8cd7af9bd 100644 --- a/applications/solvers/incompressible/simpleFoam/porousSimpleFoam/createPorousZones.H +++ b/applications/solvers/incompressible/simpleFoam/porousSimpleFoam/createPorousZones.H @@ -3,7 +3,7 @@ // nUCorrectors used for pressureImplicitPorosity int nUCorr = 0; - if (pZones.active()) + if (pZones.UPtrList::size()) { // nUCorrectors for pressureImplicitPorosity nUCorr = simple.dict().lookupOrDefault("nUCorrectors", 0); diff --git a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterFilmFoam/VoFSolidificationMeltingSource/VoFSolidificationMeltingSource.H b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterFilmFoam/VoFSolidificationMeltingSource/VoFSolidificationMeltingSource.H index dc4b16435b..a253045162 100644 --- a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterFilmFoam/VoFSolidificationMeltingSource/VoFSolidificationMeltingSource.H +++ b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterFilmFoam/VoFSolidificationMeltingSource/VoFSolidificationMeltingSource.H @@ -41,7 +41,6 @@ Usage VoFSolidificationMeltingSource1 { type VoFSolidificationMeltingSource; - active yes; selectionMode cellZone; cellZone solidZone; diff --git a/etc/caseDicts/general/fvOptions/porosity/porousZone b/etc/caseDicts/general/fvOptions/porosity/porousZone index 015ea60b9d..096f428b1b 100644 --- a/etc/caseDicts/general/fvOptions/porosity/porousZone +++ b/etc/caseDicts/general/fvOptions/porosity/porousZone @@ -17,7 +17,6 @@ FoamFile porousZone // Change to something more descriptive { type explicitPorositySource; - active true; explicitPorositySourceCoeffs { diff --git a/etc/caseDicts/solvers/lagrangian/cloudProperties b/etc/caseDicts/solvers/lagrangian/cloudProperties index 17e9b46c62..66ffce831b 100644 --- a/etc/caseDicts/solvers/lagrangian/cloudProperties +++ b/etc/caseDicts/solvers/lagrangian/cloudProperties @@ -16,7 +16,6 @@ FoamFile solution { - active true; transient true; coupled true; cellValueSourceCorrection off; diff --git a/etc/templates/closedVolumeRotating/constant/MRFProperties b/etc/templates/closedVolumeRotating/constant/MRFProperties index cc50e0ef01..aee11d0c07 100644 --- a/etc/templates/closedVolumeRotating/constant/MRFProperties +++ b/etc/templates/closedVolumeRotating/constant/MRFProperties @@ -18,7 +18,6 @@ FoamFile MRF1 { cellZone rotatingZone; - active yes; #include "rotatingZoneProperties" } diff --git a/etc/templates/inflowOutflowRotating/constant/MRFProperties b/etc/templates/inflowOutflowRotating/constant/MRFProperties index cc50e0ef01..aee11d0c07 100644 --- a/etc/templates/inflowOutflowRotating/constant/MRFProperties +++ b/etc/templates/inflowOutflowRotating/constant/MRFProperties @@ -18,7 +18,6 @@ FoamFile MRF1 { cellZone rotatingZone; - active yes; #include "rotatingZoneProperties" } diff --git a/etc/templates/singleFluidCHT/templates/constant/solid/fvOptions b/etc/templates/singleFluidCHT/templates/constant/solid/fvOptions index 4b92eb10ed..0992ce8a3d 100644 --- a/etc/templates/singleFluidCHT/templates/constant/solid/fvOptions +++ b/etc/templates/singleFluidCHT/templates/constant/solid/fvOptions @@ -14,35 +14,35 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -fixedTemperature -{ - type fixedTemperatureConstraint; - active no; - selectionMode all; +// fixedTemperature +// { +// type fixedTemperatureConstraint; +// active no; +// selectionMode all; - mode uniform; +// mode uniform; - temperature constant 300; // Set temperature (K) -} +// temperature constant 300; // Set temperature (K) +// } -fixedPower -{ - type semiImplicitSource; - active no; - selectionMode all; +// fixedPower +// { +// type semiImplicitSource; +// active no; +// selectionMode all; - volumeMode absolute; +// volumeMode absolute; - power 100; // Set power (W) +// power 100; // Set power (W) - sources - { - e - { - explicit $power; - implicit 0; - } - } -} +// sources +// { +// e +// { +// explicit $power; +// implicit 0; +// } +// } +// } //************************************************************************** // diff --git a/src/OpenFOAM/primitives/subModelBase/subModelBase.C b/src/OpenFOAM/primitives/subModelBase/subModelBase.C index 02628e73f8..0c66de3f05 100644 --- a/src/OpenFOAM/primitives/subModelBase/subModelBase.C +++ b/src/OpenFOAM/primitives/subModelBase/subModelBase.C @@ -151,22 +151,10 @@ bool Foam::subModelBase::defaultCoeffs(const bool printMsg) const } -bool Foam::subModelBase::active() const -{ - return true; -} - - void Foam::subModelBase::cacheFields(const bool) {} -bool Foam::subModelBase::writeTime() const -{ - return active(); -} - - void Foam::subModelBase::write(Ostream& os) const { os << coeffDict_; diff --git a/src/OpenFOAM/primitives/subModelBase/subModelBase.H b/src/OpenFOAM/primitives/subModelBase/subModelBase.H index 1632fe676e..187b284586 100644 --- a/src/OpenFOAM/primitives/subModelBase/subModelBase.H +++ b/src/OpenFOAM/primitives/subModelBase/subModelBase.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -141,14 +141,11 @@ public: //- Returns true if defaultCoeffs is true and outputs on printMsg virtual bool defaultCoeffs(const bool printMsg) const; - //- Return the model 'active' status - default active = true - virtual bool active() const; - //- Cache dependent sub-model fields virtual void cacheFields(const bool store); //- Flag to indicate when to write a property - virtual bool writeTime() const; + virtual bool writeTime() const = 0; // Edit diff --git a/src/finiteVolume/cfdTools/general/MRF/IOMRFZoneList.H b/src/finiteVolume/cfdTools/general/MRF/IOMRFZoneList.H index a4cd70e3ed..f08a806903 100644 --- a/src/finiteVolume/cfdTools/general/MRF/IOMRFZoneList.H +++ b/src/finiteVolume/cfdTools/general/MRF/IOMRFZoneList.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2012-2019 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -32,14 +32,12 @@ Description zone1 { cellZone rotor1; - active yes; ... } zone2 { cellZone rotor2; - active yes; ... } \endverbatim diff --git a/src/finiteVolume/cfdTools/general/MRF/MRFZone.C b/src/finiteVolume/cfdTools/general/MRF/MRFZone.C index 048381d59e..119408073e 100644 --- a/src/finiteVolume/cfdTools/general/MRF/MRFZone.C +++ b/src/finiteVolume/cfdTools/general/MRF/MRFZone.C @@ -244,7 +244,6 @@ Foam::MRFZone::MRFZone mesh_(mesh), name_(name), coeffs_(dict), - active_(coeffs_.lookupOrDefault("active", true)), cellZoneName_(cellZoneName), cellZoneID_(), excludedPatchNames_ @@ -260,42 +259,35 @@ Foam::MRFZone::MRFZone coeffs_.lookup("cellZone") >> cellZoneName_; } - if (!active_) - { - cellZoneID_ = -1; - } - else - { cellZoneID_ = mesh_.cellZones().findZoneID(cellZoneName_); - axis_ = axis_/mag(axis_); + axis_ = axis_/mag(axis_); - const labelHashSet excludedPatchSet - ( - mesh_.boundaryMesh().patchSet(excludedPatchNames_) - ); + const labelHashSet excludedPatchSet + ( + mesh_.boundaryMesh().patchSet(excludedPatchNames_) + ); - excludedPatchLabels_.setSize(excludedPatchSet.size()); + excludedPatchLabels_.setSize(excludedPatchSet.size()); - label i = 0; - forAllConstIter(labelHashSet, excludedPatchSet, iter) - { - excludedPatchLabels_[i++] = iter.key(); - } - - bool cellZoneFound = (cellZoneID_ != -1); - - reduce(cellZoneFound, orOp()); - - if (!cellZoneFound) - { - FatalErrorInFunction - << "cannot find MRF cellZone " << cellZoneName_ - << exit(FatalError); - } - - setMRFFaces(); + label i = 0; + forAllConstIter(labelHashSet, excludedPatchSet, iter) + { + excludedPatchLabels_[i++] = iter.key(); } + + bool cellZoneFound = (cellZoneID_ != -1); + + reduce(cellZoneFound, orOp()); + + if (!cellZoneFound) + { + FatalErrorInFunction + << "cannot find MRF cellZone " << cellZoneName_ + << exit(FatalError); + } + + setMRFFaces(); } @@ -540,11 +532,6 @@ void Foam::MRFZone::makeAbsolute void Foam::MRFZone::correctBoundaryVelocity(volVectorField& U) const { - if (!active_) - { - return; - } - const vector Omega = this->Omega(); // Included patches @@ -573,7 +560,6 @@ void Foam::MRFZone::writeData(Ostream& os) const os << nl; os.write(name_) << nl; os << token::BEGIN_BLOCK << incrIndent << nl; - writeEntry(os, "active", active_); writeEntry(os, "cellZone", cellZoneName_); writeEntry(os, "origin", origin_); writeEntry(os, "axis", axis_); @@ -592,7 +578,6 @@ bool Foam::MRFZone::read(const dictionary& dict) { coeffs_ = dict; - active_ = coeffs_.lookupOrDefault("active", true); coeffs_.lookup("cellZone") >> cellZoneName_; cellZoneID_ = mesh_.cellZones().findZoneID(cellZoneName_); diff --git a/src/finiteVolume/cfdTools/general/MRF/MRFZone.H b/src/finiteVolume/cfdTools/general/MRF/MRFZone.H index 51aa743e4f..de7b163a43 100644 --- a/src/finiteVolume/cfdTools/general/MRF/MRFZone.H +++ b/src/finiteVolume/cfdTools/general/MRF/MRFZone.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -76,9 +76,6 @@ class MRFZone //- Coefficients dictionary dictionary coeffs_; - //- MRF region active flag - bool active_; - //- Name of cell zone word cellZoneName_; @@ -180,9 +177,6 @@ public: //- Return const access to the MRF region name inline const word& name() const; - //- Return const access to the MRF active flag - inline bool active() const; - //- Return the current Omega vector vector Omega() const; diff --git a/src/finiteVolume/cfdTools/general/MRF/MRFZoneI.H b/src/finiteVolume/cfdTools/general/MRF/MRFZoneI.H index 9adb724e24..01836793a0 100644 --- a/src/finiteVolume/cfdTools/general/MRF/MRFZoneI.H +++ b/src/finiteVolume/cfdTools/general/MRF/MRFZoneI.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2012-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -29,10 +29,4 @@ inline const Foam::word& Foam::MRFZone::name() const } -inline bool Foam::MRFZone::active() const -{ - return active_; -} - - // ************************************************************************* // diff --git a/src/finiteVolume/cfdTools/general/MRF/MRFZoneList.C b/src/finiteVolume/cfdTools/general/MRF/MRFZoneList.C index 4544931fe9..dd89b3e63d 100644 --- a/src/finiteVolume/cfdTools/general/MRF/MRFZoneList.C +++ b/src/finiteVolume/cfdTools/general/MRF/MRFZoneList.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2012-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -39,8 +39,6 @@ Foam::MRFZoneList::MRFZoneList mesh_(mesh) { reset(dict); - - active(true); } @@ -52,23 +50,6 @@ Foam::MRFZoneList::~MRFZoneList() // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -bool Foam::MRFZoneList::active(const bool warn) const -{ - bool a = false; - forAll(*this, i) - { - a = a || this->operator[](i).active(); - } - - if (warn && this->size() && !a) - { - Info<< " No MRF zones active" << endl; - } - - return a; -} - - void Foam::MRFZoneList::reset(const dictionary& dict) { label count = 0; diff --git a/src/finiteVolume/cfdTools/general/MRF/MRFZoneTemplates.C b/src/finiteVolume/cfdTools/general/MRF/MRFZoneTemplates.C index 2027b27d9a..db6fb06d6a 100644 --- a/src/finiteVolume/cfdTools/general/MRF/MRFZoneTemplates.C +++ b/src/finiteVolume/cfdTools/general/MRF/MRFZoneTemplates.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -38,11 +38,6 @@ void Foam::MRFZone::makeRelativeRhoFlux surfaceScalarField& phi ) const { - if (!active_) - { - return; - } - const surfaceVectorField& Cf = mesh_.Cf(); const surfaceVectorField& Sf = mesh_.Sf(); @@ -70,11 +65,6 @@ void Foam::MRFZone::makeRelativeRhoFlux FieldField& phi ) const { - if (!active_) - { - return; - } - const surfaceVectorField& Cf = mesh_.Cf(); const surfaceVectorField& Sf = mesh_.Sf(); @@ -115,11 +105,6 @@ void Foam::MRFZone::makeRelativeRhoFlux const label patchi ) const { - if (!active_) - { - return; - } - const surfaceVectorField& Cf = mesh_.Cf(); const surfaceVectorField& Sf = mesh_.Sf(); @@ -153,11 +138,6 @@ void Foam::MRFZone::makeAbsoluteRhoFlux surfaceScalarField& phi ) const { - if (!active_) - { - return; - } - const surfaceVectorField& Cf = mesh_.Cf(); const surfaceVectorField& Sf = mesh_.Sf(); @@ -213,11 +193,6 @@ void Foam::MRFZone::zero GeometricField& phi ) const { - if (!active_) - { - return; - } - Field& phii = phi.primitiveFieldRef(); forAll(internalFaces_, i) diff --git a/src/finiteVolume/cfdTools/general/fvOptions/fvOption.C b/src/finiteVolume/cfdTools/general/fvOptions/fvOption.C index 6f27f96c4e..5cd0a44240 100644 --- a/src/finiteVolume/cfdTools/general/fvOptions/fvOption.C +++ b/src/finiteVolume/cfdTools/general/fvOptions/fvOption.C @@ -53,7 +53,6 @@ Foam::fv::option::option mesh_(mesh), dict_(dict), coeffs_(dict.optionalSubDict(modelType + "Coeffs")), - active_(dict_.lookupOrDefault("active", true)), fieldNames_(), applied_() { @@ -104,12 +103,6 @@ Foam::fv::option::~option() // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -bool Foam::fv::option::isActive() const -{ - return active_; -} - - Foam::label Foam::fv::option::applyToField(const word& fieldName) const { return findIndex(fieldNames_, fieldName); diff --git a/src/finiteVolume/cfdTools/general/fvOptions/fvOption.H b/src/finiteVolume/cfdTools/general/fvOptions/fvOption.H index f7d049c3ca..2e44cfc686 100644 --- a/src/finiteVolume/cfdTools/general/fvOptions/fvOption.H +++ b/src/finiteVolume/cfdTools/general/fvOptions/fvOption.H @@ -29,7 +29,6 @@ Description controls, e.g.: \verbatim type scalarExplicitSource // source type - active on; // on/off switch \endverbatim Note @@ -85,9 +84,6 @@ protected: //- Dictionary containing source coefficients dictionary coeffs_; - //- Source active flag - Switch active_; - //- Field names to apply source to - populated by derived models wordList fieldNames_; @@ -198,24 +194,12 @@ public: //- Return dictionary inline const dictionary& coeffs() const; - //- Return const access to the source active flag - inline bool active() const; - //- Set the applied flag to true for field index fieldi inline void setApplied(const label fieldi) const; - // Edit - - //- Return access to the source active flag - inline Switch& active(); - - // Checks - //- Is the source active? - virtual bool isActive() const; - //- Return index of field name if found in fieldNames list virtual label applyToField(const word& fieldName) const; diff --git a/src/finiteVolume/cfdTools/general/fvOptions/fvOptionI.H b/src/finiteVolume/cfdTools/general/fvOptions/fvOptionI.H index 428c85de14..da87037116 100644 --- a/src/finiteVolume/cfdTools/general/fvOptions/fvOptionI.H +++ b/src/finiteVolume/cfdTools/general/fvOptions/fvOptionI.H @@ -43,22 +43,10 @@ inline const Foam::dictionary& Foam::fv::option::coeffs() const } -inline bool Foam::fv::option::active() const -{ - return active_; -} - - inline void Foam::fv::option::setApplied(const label fieldi) const { applied_[fieldi] = true; } -inline Foam::Switch& Foam::fv::option::active() -{ - return active_; -} - - // ************************************************************************* // diff --git a/src/finiteVolume/cfdTools/general/fvOptions/fvOptionIO.C b/src/finiteVolume/cfdTools/general/fvOptions/fvOptionIO.C index 2a9c6dedeb..ad4811f3ce 100644 --- a/src/finiteVolume/cfdTools/general/fvOptions/fvOptionIO.C +++ b/src/finiteVolume/cfdTools/general/fvOptions/fvOptionIO.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -43,7 +43,6 @@ void Foam::fv::option::writeFooter(Ostream& os) const void Foam::fv::option::writeData(Ostream& os) const { writeEntry(os, "type", type()); - writeEntry(os, "active", active_); os << nl; os << indent << word(type() + "Coeffs"); coeffs_.write(os); @@ -52,8 +51,6 @@ void Foam::fv::option::writeData(Ostream& os) const bool Foam::fv::option::read(const dictionary& dict) { - dict.readIfPresent("active", active_); - coeffs_ = dict.optionalSubDict(modelType_ + "Coeffs"); return true; diff --git a/src/finiteVolume/cfdTools/general/fvOptions/fvOptionListTemplates.C b/src/finiteVolume/cfdTools/general/fvOptions/fvOptionListTemplates.C index 56995efa91..4aee341f41 100644 --- a/src/finiteVolume/cfdTools/general/fvOptions/fvOptionListTemplates.C +++ b/src/finiteVolume/cfdTools/general/fvOptions/fvOptionListTemplates.C @@ -48,16 +48,13 @@ Foam::tmp> Foam::fv::optionList::source { source.setApplied(fieldi); - if (source.isActive()) + if (debug) { - if (debug) - { - Info<< "Applying source " << source.name() << " to field " - << fieldName << endl; - } - - source.addSup(mtx, fieldi); + Info<< "Applying source " << source.name() << " to field " + << fieldName << endl; } + + source.addSup(mtx, fieldi); } } @@ -125,16 +122,13 @@ Foam::tmp> Foam::fv::optionList::operator() { source.setApplied(fieldi); - if (source.isActive()) + if (debug) { - if (debug) - { - Info<< "Applying source " << source.name() << " to field " - << fieldName << endl; - } - - source.addSup(rho, mtx, fieldi); + Info<< "Applying source " << source.name() << " to field " + << fieldName << endl; } + + source.addSup(rho, mtx, fieldi); } } @@ -184,16 +178,13 @@ Foam::tmp> Foam::fv::optionList::operator() { source.setApplied(fieldi); - if (source.isActive()) + if (debug) { - if (debug) - { - Info<< "Applying source " << source.name() << " to field " - << fieldName << endl; - } - - source.addSup(alpha, rho, mtx, fieldi); + Info<< "Applying source " << source.name() << " to field " + << fieldName << endl; } + + source.addSup(alpha, rho, mtx, fieldi); } } @@ -288,16 +279,13 @@ void Foam::fv::optionList::constrain(fvMatrix& eqn) const { source.setApplied(fieldi); - if (source.isActive()) + if (debug) { - if (debug) - { - Info<< "Applying constraint " << source.name() - << " to field " << eqn.psi().name() << endl; - } - - source.constrain(eqn, fieldi); + Info<< "Applying constraint " << source.name() + << " to field " << eqn.psi().name() << endl; } + + source.constrain(eqn, fieldi); } } } @@ -321,16 +309,13 @@ void Foam::fv::optionList::correct { source.setApplied(fieldi); - if (source.isActive()) + if (debug) { - if (debug) - { - Info<< "Correcting source " << source.name() - << " for field " << fieldName << endl; - } - - source.correct(field); + Info<< "Correcting source " << source.name() + << " for field " << fieldName << endl; } + + source.correct(field); } } } diff --git a/src/finiteVolume/cfdTools/general/porosityModel/porosityModel/porosityModel.C b/src/finiteVolume/cfdTools/general/porosityModel/porosityModel/porosityModel.C index 9b50a9d7ab..9d2cb62dd5 100644 --- a/src/finiteVolume/cfdTools/general/porosityModel/porosityModel/porosityModel.C +++ b/src/finiteVolume/cfdTools/general/porosityModel/porosityModel/porosityModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2012-2019 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -100,14 +100,12 @@ Foam::porosityModel::porosityModel mesh_(mesh), dict_(dict), coeffs_(dict.optionalSubDict(modelType + "Coeffs")), - active_(true), zoneName_(cellZoneName), cellZoneIDs_(), coordSys_(coordinateSystem::New(mesh, coeffs_)) { if (zoneName_ == word::null) { - dict.readIfPresent("active", active_); dict_.lookup("cellZone") >> zoneName_; } @@ -229,8 +227,6 @@ bool Foam::porosityModel::writeData(Ostream& os) const bool Foam::porosityModel::read(const dictionary& dict) { - dict.readIfPresent("active", active_); - coeffs_ = dict.optionalSubDict(type() + "Coeffs"); dict.lookup("cellZone") >> zoneName_; diff --git a/src/finiteVolume/cfdTools/general/porosityModel/porosityModel/porosityModel.H b/src/finiteVolume/cfdTools/general/porosityModel/porosityModel/porosityModel.H index f677a35884..207455c8ea 100644 --- a/src/finiteVolume/cfdTools/general/porosityModel/porosityModel/porosityModel.H +++ b/src/finiteVolume/cfdTools/general/porosityModel/porosityModel/porosityModel.H @@ -82,9 +82,6 @@ protected: //- Model coefficients dictionary dictionary coeffs_; - //- Porosity active flag - bool active_; - //- Name(s) of cell-zone wordRe zoneName_; @@ -217,9 +214,6 @@ public: //- Return const access to the porosity model name inline const word& name() const; - //- Return const access to the porosity active flag - inline bool active() const; - //- Return const access to the cell zone IDs inline const labelList& cellZoneIDs() const; diff --git a/src/finiteVolume/cfdTools/general/porosityModel/porosityModel/porosityModelI.H b/src/finiteVolume/cfdTools/general/porosityModel/porosityModel/porosityModelI.H index 148de0d05d..1c15082c0e 100644 --- a/src/finiteVolume/cfdTools/general/porosityModel/porosityModel/porosityModelI.H +++ b/src/finiteVolume/cfdTools/general/porosityModel/porosityModel/porosityModelI.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2012-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -29,12 +29,6 @@ inline const Foam::word& Foam::porosityModel::name() const } -inline bool Foam::porosityModel::active() const -{ - return active_; -} - - inline const Foam::dictionary& Foam::porosityModel::dict() const { return dict_; diff --git a/src/finiteVolume/cfdTools/general/porosityModel/porosityModel/porosityModelList.C b/src/finiteVolume/cfdTools/general/porosityModel/porosityModel/porosityModelList.C index 982f3c254f..e16d4e9ab0 100644 --- a/src/finiteVolume/cfdTools/general/porosityModel/porosityModel/porosityModelList.C +++ b/src/finiteVolume/cfdTools/general/porosityModel/porosityModel/porosityModelList.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2012-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -38,8 +38,6 @@ Foam::porosityModelList::porosityModelList mesh_(mesh) { reset(dict); - - active(true); } @@ -51,23 +49,6 @@ Foam::porosityModelList::~porosityModelList() // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -bool Foam::porosityModelList::active(const bool warn) const -{ - bool a = false; - forAll(*this, i) - { - a = a || this->operator[](i).active(); - } - - if (warn && this->size() && !a) - { - Info<< "No porosity models active" << endl; - } - - return a; -} - - void Foam::porosityModelList::reset(const dictionary& dict) { label count = 0; @@ -153,7 +134,7 @@ void Foam::porosityModelList::addResistance ( const fvVectorMatrix& UEqn, volTensorField& AU, - bool correctAUprocBC + bool correctAUprocBC ) { forAll(*this, i) diff --git a/src/finiteVolume/cfdTools/general/porosityModel/porosityModel/porosityModelList.H b/src/finiteVolume/cfdTools/general/porosityModel/porosityModel/porosityModelList.H index 2a876edafe..9b84e13e64 100644 --- a/src/finiteVolume/cfdTools/general/porosityModel/porosityModel/porosityModelList.H +++ b/src/finiteVolume/cfdTools/general/porosityModel/porosityModel/porosityModelList.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2012-2019 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -81,9 +81,6 @@ public: // Member Functions - //- Return active status - bool active(const bool active = false) const; - //- Reset the source list void reset(const dictionary& dict); diff --git a/src/fvOptions/cellSetOption/cellSetOption.C b/src/fvOptions/cellSetOption/cellSetOption.C index 3c46116c7e..68cf6a4515 100644 --- a/src/fvOptions/cellSetOption/cellSetOption.C +++ b/src/fvOptions/cellSetOption/cellSetOption.C @@ -215,19 +215,6 @@ Foam::fv::cellSetOption::~cellSetOption() // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -bool Foam::fv::cellSetOption::isActive() const -{ - if (option::isActive() && inTimeLimits(mesh_.time().value())) - { - return true; - } - else - { - return false; - } -} - - void Foam::fv::cellSetOption::updateMesh(const mapPolyMesh&) { setCellSet(); diff --git a/src/fvOptions/cellSetOption/cellSetOption.H b/src/fvOptions/cellSetOption/cellSetOption.H index 744a2513f3..86d3179306 100644 --- a/src/fvOptions/cellSetOption/cellSetOption.H +++ b/src/fvOptions/cellSetOption/cellSetOption.H @@ -29,7 +29,6 @@ Description e.g.: \verbatim type scalarExplicitSource // Source type - active on; // on/off switch timeStart 0.0; // Start time duration 1000.0; // Duration @@ -182,12 +181,6 @@ public: inline scalar& duration(); - // Checks - - //- Is the source active? - virtual bool isActive() const; - - // Mesh changes //- Update for mesh changes diff --git a/src/fvOptions/constraints/fixedTemperatureConstraint/fixedTemperatureConstraint.H b/src/fvOptions/constraints/fixedTemperatureConstraint/fixedTemperatureConstraint.H index a64a27e209..76f99cd84e 100644 --- a/src/fvOptions/constraints/fixedTemperatureConstraint/fixedTemperatureConstraint.H +++ b/src/fvOptions/constraints/fixedTemperatureConstraint/fixedTemperatureConstraint.H @@ -32,7 +32,6 @@ Usage fixedTemperature { type fixedTemperatureConstraint; - active yes; mode uniform; // uniform or lookup diff --git a/src/fvOptions/constraints/fixedValueConstraint/FixedValueConstraint.H b/src/fvOptions/constraints/fixedValueConstraint/FixedValueConstraint.H index 30cab76cd8..fc7d9e7fca 100644 --- a/src/fvOptions/constraints/fixedValueConstraint/FixedValueConstraint.H +++ b/src/fvOptions/constraints/fixedValueConstraint/FixedValueConstraint.H @@ -33,7 +33,6 @@ Usage porosityTurbulence { type scalarFixedValueConstraint; - active yes; selectionMode cellZone; cellZone porosity; diff --git a/src/fvOptions/corrections/limitTemperature/limitTemperature.H b/src/fvOptions/corrections/limitTemperature/limitTemperature.H index 1833e872d6..73711a5326 100644 --- a/src/fvOptions/corrections/limitTemperature/limitTemperature.H +++ b/src/fvOptions/corrections/limitTemperature/limitTemperature.H @@ -34,7 +34,6 @@ Usage limitT { type limitTemperature; - active yes; selectionMode all; min 200; diff --git a/src/fvOptions/corrections/limitVelocity/limitVelocity.H b/src/fvOptions/corrections/limitVelocity/limitVelocity.H index 993ed5c280..2e9712ccc3 100644 --- a/src/fvOptions/corrections/limitVelocity/limitVelocity.H +++ b/src/fvOptions/corrections/limitVelocity/limitVelocity.H @@ -33,7 +33,6 @@ Usage limitU { type limitVelocity; - active yes; selectionMode all; max 100; diff --git a/src/fvOptions/interRegionOption/interRegionOption.C b/src/fvOptions/interRegionOption/interRegionOption.C index 1d34979a70..1bb8c9df0d 100644 --- a/src/fvOptions/interRegionOption/interRegionOption.C +++ b/src/fvOptions/interRegionOption/interRegionOption.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -105,10 +105,7 @@ Foam::fv::interRegionOption::interRegionOption nbrRegionName_(coeffs_.lookup("nbrRegionName")), meshInterpPtr_() { - if (active()) - { - setMapper(); - } + setMapper(); } diff --git a/src/fvOptions/sources/derived/accelerationSource/accelerationSource.H b/src/fvOptions/sources/derived/accelerationSource/accelerationSource.H index 53563bedc6..04bb7588e5 100644 --- a/src/fvOptions/sources/derived/accelerationSource/accelerationSource.H +++ b/src/fvOptions/sources/derived/accelerationSource/accelerationSource.H @@ -34,7 +34,7 @@ Usage accelerationSource { type accelerationSource; - active on; + selectionMode all; U U; velocity scale; diff --git a/src/fvOptions/sources/derived/effectivenessHeatExchangerSource/effectivenessHeatExchangerSource.H b/src/fvOptions/sources/derived/effectivenessHeatExchangerSource/effectivenessHeatExchangerSource.H index 7fd26ebecd..1a4d54294a 100644 --- a/src/fvOptions/sources/derived/effectivenessHeatExchangerSource/effectivenessHeatExchangerSource.H +++ b/src/fvOptions/sources/derived/effectivenessHeatExchangerSource/effectivenessHeatExchangerSource.H @@ -65,7 +65,6 @@ Usage effectivenessHeatExchangerSource1 { type effectivenessHeatExchangerSource; - active yes; selectionMode cellZone; cellZone porosity; diff --git a/src/fvOptions/sources/derived/sixDoFAccelerationSource/sixDoFAccelerationSource.H b/src/fvOptions/sources/derived/sixDoFAccelerationSource/sixDoFAccelerationSource.H index c20c07f67b..2a959db516 100644 --- a/src/fvOptions/sources/derived/sixDoFAccelerationSource/sixDoFAccelerationSource.H +++ b/src/fvOptions/sources/derived/sixDoFAccelerationSource/sixDoFAccelerationSource.H @@ -33,7 +33,6 @@ Usage SBM { type sixDoFAccelerationSource; - active yes; accelerations ; } diff --git a/src/fvOptions/sources/derived/solidificationMeltingSource/solidificationMeltingSource.H b/src/fvOptions/sources/derived/solidificationMeltingSource/solidificationMeltingSource.H index f2a8306cfe..4bf93871f4 100644 --- a/src/fvOptions/sources/derived/solidificationMeltingSource/solidificationMeltingSource.H +++ b/src/fvOptions/sources/derived/solidificationMeltingSource/solidificationMeltingSource.H @@ -79,7 +79,6 @@ Usage solidificationMeltingSource1 { type solidificationMeltingSource; - active yes; selectionMode cellZone; cellZone iceZone; diff --git a/src/fvOptions/sources/general/codedSource/CodedSource.H b/src/fvOptions/sources/general/codedSource/CodedSource.H index 55df261587..16011324d8 100644 --- a/src/fvOptions/sources/general/codedSource/CodedSource.H +++ b/src/fvOptions/sources/general/codedSource/CodedSource.H @@ -34,8 +34,6 @@ Usage { type scalarCodedSource; - active yes; - name sourceTime; scalarCodedSourceCoeffs diff --git a/src/fvOptions/sources/interRegion/interRegionExplicitPorositySource/interRegionExplicitPorositySource.C b/src/fvOptions/sources/interRegion/interRegionExplicitPorositySource/interRegionExplicitPorositySource.C index 9ef31f58bb..aa30693243 100644 --- a/src/fvOptions/sources/interRegion/interRegionExplicitPorositySource/interRegionExplicitPorositySource.C +++ b/src/fvOptions/sources/interRegion/interRegionExplicitPorositySource/interRegionExplicitPorositySource.C @@ -121,11 +121,8 @@ Foam::fv::interRegionExplicitPorositySource::interRegionExplicitPorositySource UName_(coeffs_.lookupOrDefault("U", "U")), muName_(coeffs_.lookupOrDefault("mu", "thermo:mu")) { - if (active_) - { - fieldNames_.setSize(1, UName_); - applied_.setSize(1, false); - } + fieldNames_.setSize(1, UName_); + applied_.setSize(1, false); } diff --git a/src/fvOptions/sources/interRegion/interRegionHeatTransfer/constantHeatTransfer/constantHeatTransfer.C b/src/fvOptions/sources/interRegion/interRegionHeatTransfer/constantHeatTransfer/constantHeatTransfer.C index a7030a02c9..b0fe4e438f 100644 --- a/src/fvOptions/sources/interRegion/interRegionHeatTransfer/constantHeatTransfer/constantHeatTransfer.C +++ b/src/fvOptions/sources/interRegion/interRegionHeatTransfer/constantHeatTransfer/constantHeatTransfer.C @@ -57,7 +57,7 @@ Foam::fv::constantHeatTransfer::constantHeatTransfer htcConst_(), AoV_() { - if (active() && master_) + if (master_) { htcConst_.reset ( diff --git a/src/fvOptions/sources/interRegion/interRegionHeatTransfer/interRegionHeatTransferModel/interRegionHeatTransferModel.C b/src/fvOptions/sources/interRegion/interRegionHeatTransfer/interRegionHeatTransferModel/interRegionHeatTransferModel.C index d73b07184c..0b747e14af 100644 --- a/src/fvOptions/sources/interRegion/interRegionHeatTransfer/interRegionHeatTransferModel/interRegionHeatTransferModel.C +++ b/src/fvOptions/sources/interRegion/interRegionHeatTransfer/interRegionHeatTransferModel/interRegionHeatTransferModel.C @@ -145,13 +145,10 @@ Foam::fv::interRegionHeatTransferModel::interRegionHeatTransferModel TName_(coeffs_.lookupOrDefault("T", "T")), TNbrName_(coeffs_.lookupOrDefault("TNbr", "T")) { - if (active()) - { - coeffs_.lookup("fields") >> fieldNames_; - applied_.setSize(fieldNames_.size(), false); + coeffs_.lookup("fields") >> fieldNames_; + applied_.setSize(fieldNames_.size(), false); - coeffs_.lookup("semiImplicit") >> semiImplicit_; - } + coeffs_.lookup("semiImplicit") >> semiImplicit_; } diff --git a/src/lagrangian/DSMC/clouds/Templates/DSMCCloud/DSMCCloud.C b/src/lagrangian/DSMC/clouds/Templates/DSMCCloud/DSMCCloud.C index 766d0c8eaa..d74a56c35e 100644 --- a/src/lagrangian/DSMC/clouds/Templates/DSMCCloud/DSMCCloud.C +++ b/src/lagrangian/DSMC/clouds/Templates/DSMCCloud/DSMCCloud.C @@ -24,7 +24,7 @@ License \*---------------------------------------------------------------------------*/ #include "DSMCCloud.H" -#include "BinaryCollisionModel.H" +#include "NoBinaryCollision.H" #include "WallInteractionModel.H" #include "InflowBoundaryModel.H" #include "constants.H" @@ -204,7 +204,7 @@ void Foam::DSMCCloud::initialise template void Foam::DSMCCloud::collisions() { - if (!binaryCollision().active()) + if (isType>>(binaryCollision())) { return; } diff --git a/src/lagrangian/DSMC/submodels/BinaryCollisionModel/BinaryCollisionModel/BinaryCollisionModel.H b/src/lagrangian/DSMC/submodels/BinaryCollisionModel/BinaryCollisionModel/BinaryCollisionModel.H index 9d085b503e..d1d73edd43 100644 --- a/src/lagrangian/DSMC/submodels/BinaryCollisionModel/BinaryCollisionModel/BinaryCollisionModel.H +++ b/src/lagrangian/DSMC/submodels/BinaryCollisionModel/BinaryCollisionModel/BinaryCollisionModel.H @@ -126,9 +126,6 @@ public: // Member Functions - //- Flag to indicate whether model activates collision model - virtual bool active() const = 0; - //- Return the collision cross section * relative velocity product virtual scalar sigmaTcR ( diff --git a/src/lagrangian/DSMC/submodels/BinaryCollisionModel/LarsenBorgnakkeVariableHardSphere/LarsenBorgnakkeVariableHardSphere.C b/src/lagrangian/DSMC/submodels/BinaryCollisionModel/LarsenBorgnakkeVariableHardSphere/LarsenBorgnakkeVariableHardSphere.C index 5a2ceab8f6..c5a3af4a33 100644 --- a/src/lagrangian/DSMC/submodels/BinaryCollisionModel/LarsenBorgnakkeVariableHardSphere/LarsenBorgnakkeVariableHardSphere.C +++ b/src/lagrangian/DSMC/submodels/BinaryCollisionModel/LarsenBorgnakkeVariableHardSphere/LarsenBorgnakkeVariableHardSphere.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -116,13 +116,6 @@ Foam::LarsenBorgnakkeVariableHardSphere:: // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -template -bool Foam::LarsenBorgnakkeVariableHardSphere::active() const -{ - return true; -} - - template Foam::scalar Foam::LarsenBorgnakkeVariableHardSphere::sigmaTcR ( diff --git a/src/lagrangian/DSMC/submodels/BinaryCollisionModel/LarsenBorgnakkeVariableHardSphere/LarsenBorgnakkeVariableHardSphere.H b/src/lagrangian/DSMC/submodels/BinaryCollisionModel/LarsenBorgnakkeVariableHardSphere/LarsenBorgnakkeVariableHardSphere.H index 85dc1a1616..19d69aaa04 100644 --- a/src/lagrangian/DSMC/submodels/BinaryCollisionModel/LarsenBorgnakkeVariableHardSphere/LarsenBorgnakkeVariableHardSphere.H +++ b/src/lagrangian/DSMC/submodels/BinaryCollisionModel/LarsenBorgnakkeVariableHardSphere/LarsenBorgnakkeVariableHardSphere.H @@ -90,9 +90,6 @@ public: // Member Functions - //- Flag to indicate whether model activates collision model - virtual bool active() const; - //- Return the collision cross section * relative velocity product virtual scalar sigmaTcR ( diff --git a/src/lagrangian/DSMC/submodels/BinaryCollisionModel/NoBinaryCollision/NoBinaryCollision.C b/src/lagrangian/DSMC/submodels/BinaryCollisionModel/NoBinaryCollision/NoBinaryCollision.C index ea9d6a4088..c43dcc1543 100644 --- a/src/lagrangian/DSMC/submodels/BinaryCollisionModel/NoBinaryCollision/NoBinaryCollision.C +++ b/src/lagrangian/DSMC/submodels/BinaryCollisionModel/NoBinaryCollision/NoBinaryCollision.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -50,13 +50,6 @@ Foam::NoBinaryCollision::~NoBinaryCollision() // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -template -bool Foam::NoBinaryCollision::active() const -{ - return false; -} - - template Foam::scalar Foam::NoBinaryCollision::sigmaTcR ( @@ -67,11 +60,13 @@ Foam::scalar Foam::NoBinaryCollision::sigmaTcR FatalErrorInFunction << "sigmaTcR called on NoBinaryCollision model, this should " << "not happen, this is not an actual model." << nl - << "Enclose calls to sigmaTcR within a if (binaryCollision().active()) " + << "Enclose calls to sigmaTcR within an " + << "if (!isType>>" + "(binaryCollision()))" << " check." << abort(FatalError); - return 0.0; + return 0; } diff --git a/src/lagrangian/DSMC/submodels/BinaryCollisionModel/NoBinaryCollision/NoBinaryCollision.H b/src/lagrangian/DSMC/submodels/BinaryCollisionModel/NoBinaryCollision/NoBinaryCollision.H index 98c0fd60cb..09af2bb088 100644 --- a/src/lagrangian/DSMC/submodels/BinaryCollisionModel/NoBinaryCollision/NoBinaryCollision.H +++ b/src/lagrangian/DSMC/submodels/BinaryCollisionModel/NoBinaryCollision/NoBinaryCollision.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -69,9 +69,6 @@ public: // Member Functions - //- Flag to indicate whether model activates collision model - virtual bool active() const; - //- Return the collision cross section * relative velocity product virtual scalar sigmaTcR ( diff --git a/src/lagrangian/DSMC/submodels/BinaryCollisionModel/VariableHardSphere/VariableHardSphere.C b/src/lagrangian/DSMC/submodels/BinaryCollisionModel/VariableHardSphere/VariableHardSphere.C index f0e1931420..02aa136e96 100644 --- a/src/lagrangian/DSMC/submodels/BinaryCollisionModel/VariableHardSphere/VariableHardSphere.C +++ b/src/lagrangian/DSMC/submodels/BinaryCollisionModel/VariableHardSphere/VariableHardSphere.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -51,13 +51,6 @@ Foam::VariableHardSphere::~VariableHardSphere() // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -template -bool Foam::VariableHardSphere::active() const -{ - return true; -} - - template Foam::scalar Foam::VariableHardSphere::sigmaTcR ( diff --git a/src/lagrangian/DSMC/submodels/BinaryCollisionModel/VariableHardSphere/VariableHardSphere.H b/src/lagrangian/DSMC/submodels/BinaryCollisionModel/VariableHardSphere/VariableHardSphere.H index 1f892cbf7f..851b1c67bc 100644 --- a/src/lagrangian/DSMC/submodels/BinaryCollisionModel/VariableHardSphere/VariableHardSphere.H +++ b/src/lagrangian/DSMC/submodels/BinaryCollisionModel/VariableHardSphere/VariableHardSphere.H @@ -75,9 +75,6 @@ public: // Member Functions - //- Flag to indicate whether model activates collision model - virtual bool active() const; - //- Return the collision cross section * relative velocity product virtual scalar sigmaTcR ( diff --git a/src/lagrangian/parcel/clouds/Templates/CollidingCloud/CollidingCloud.C b/src/lagrangian/parcel/clouds/Templates/CollidingCloud/CollidingCloud.C index 495e92a9fb..f82e77e244 100644 --- a/src/lagrangian/parcel/clouds/Templates/CollidingCloud/CollidingCloud.C +++ b/src/lagrangian/parcel/clouds/Templates/CollidingCloud/CollidingCloud.C @@ -99,26 +99,23 @@ Foam::CollidingCloud::CollidingCloud constProps_(this->particleProperties()), collisionModel_(nullptr) { - if (this->solution().active()) + setModels(); + + if (readFields) { - setModels(); + parcelType::readFields(*this); + this->deleteLostParticles(); + } - if (readFields) - { - parcelType::readFields(*this); - this->deleteLostParticles(); - } - - if - ( - this->solution().steadyState() - && !isType>>(collisionModel_()) - ) - { - FatalErrorInFunction - << "Collision modelling not currently available " - << "for steady state calculations" << exit(FatalError); - } + if + ( + this->solution().steadyState() + && !isType>>(collisionModel_()) + ) + { + FatalErrorInFunction + << "Collision modelling not currently available " + << "for steady state calculations" << exit(FatalError); } } diff --git a/src/lagrangian/parcel/clouds/Templates/MPPICCloud/MPPICCloud.C b/src/lagrangian/parcel/clouds/Templates/MPPICCloud/MPPICCloud.C index ebbaf30801..d434e75836 100644 --- a/src/lagrangian/parcel/clouds/Templates/MPPICCloud/MPPICCloud.C +++ b/src/lagrangian/parcel/clouds/Templates/MPPICCloud/MPPICCloud.C @@ -24,10 +24,10 @@ License \*---------------------------------------------------------------------------*/ #include "MPPICCloud.H" -#include "PackingModel.H" +#include "NoPacking.H" #include "ParticleStressModel.H" -#include "DampingModel.H" -#include "IsotropyModel.H" +#include "NoDamping.H" +#include "NoIsotropy.H" #include "TimeScaleModel.H" // * * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * // @@ -87,15 +87,12 @@ Foam::MPPICCloud::MPPICCloud << exit(FatalError); } - if (this->solution().active()) - { - setModels(); + setModels(); - if (readFields) - { - parcelType::readFields(*this); - this->deleteLostParticles(); - } + if (readFields) + { + parcelType::readFields(*this); + this->deleteLostParticles(); } } @@ -213,7 +210,7 @@ void Foam::MPPICCloud::motion // Damping // ~~~~~~~ - if (dampingModel_->active()) + if (!isType>(dampingModel_())) { if (this->mesh().moving()) { @@ -244,7 +241,7 @@ void Foam::MPPICCloud::motion // Packing // ~~~~~~~ - if (packingModel_->active()) + if (!isType>(packingModel_())) { if (this->mesh().moving()) { @@ -267,7 +264,7 @@ void Foam::MPPICCloud::motion // Isotropy // ~~~~~~~~ - if (isotropyModel_->active()) + if (!isType>(isotropyModel_())) { // update averages td.updateAverages(cloud); diff --git a/src/lagrangian/parcel/clouds/Templates/MPPICCloud/MPPICCloud.H b/src/lagrangian/parcel/clouds/Templates/MPPICCloud/MPPICCloud.H index fc4079eb51..c0052cdcae 100644 --- a/src/lagrangian/parcel/clouds/Templates/MPPICCloud/MPPICCloud.H +++ b/src/lagrangian/parcel/clouds/Templates/MPPICCloud/MPPICCloud.H @@ -106,7 +106,8 @@ protected: // References to the cloud sub-models //- Packing model - autoPtr>> packingModel_; + autoPtr>> + packingModel_; //- Damping model autoPtr>> diff --git a/src/lagrangian/parcel/clouds/Templates/MomentumCloud/MomentumCloud.C b/src/lagrangian/parcel/clouds/Templates/MomentumCloud/MomentumCloud.C index c2d95dd8b9..a202ac0fe8 100644 --- a/src/lagrangian/parcel/clouds/Templates/MomentumCloud/MomentumCloud.C +++ b/src/lagrangian/parcel/clouds/Templates/MomentumCloud/MomentumCloud.C @@ -317,7 +317,7 @@ Foam::MomentumCloud::MomentumCloud constProps_(particleProperties_), subModelProperties_ ( - particleProperties_.subOrEmptyDict("subModels", solution_.active()) + particleProperties_.subOrEmptyDict("subModels", true) ), rndGen_(0), cellOccupancyPtr_(), @@ -334,15 +334,15 @@ Foam::MomentumCloud::MomentumCloud subModelProperties_.subOrEmptyDict ( "particleForces", - solution_.active() + true ), - solution_.active() + true ), functions_ ( *this, particleProperties_.subOrEmptyDict("cloudFunctions"), - solution_.active() + true ), injectors_ ( @@ -387,15 +387,12 @@ Foam::MomentumCloud::MomentumCloud ) ) { - if (solution_.active()) - { - setModels(); + setModels(); - if (readFields) - { - parcelType::readFields(*this); - this->deleteLostParticles(); - } + if (readFields) + { + parcelType::readFields(*this); + this->deleteLostParticles(); } if (solution_.resetSourcesOnStartup()) diff --git a/src/lagrangian/parcel/clouds/Templates/MomentumCloud/cloudSolution/cloudSolution.C b/src/lagrangian/parcel/clouds/Templates/MomentumCloud/cloudSolution/cloudSolution.C index 17e45f34ba..e5710fedd7 100644 --- a/src/lagrangian/parcel/clouds/Templates/MomentumCloud/cloudSolution/cloudSolution.C +++ b/src/lagrangian/parcel/clouds/Templates/MomentumCloud/cloudSolution/cloudSolution.C @@ -37,7 +37,6 @@ Foam::cloudSolution::cloudSolution : mesh_(mesh), dict_(dict), - active_(dict.lookup("active")), transient_(false), calcFrequency_(1), maxCo_(0.3), @@ -49,10 +48,7 @@ Foam::cloudSolution::cloudSolution resetSourcesOnStartup_(true), schemes_() { - if (active_) - { - read(); - } + read(); } @@ -63,7 +59,6 @@ Foam::cloudSolution::cloudSolution : mesh_(cs.mesh_), dict_(cs.dict_), - active_(cs.active_), transient_(cs.transient_), calcFrequency_(cs.calcFrequency_), maxCo_(cs.maxCo_), @@ -84,7 +79,6 @@ Foam::cloudSolution::cloudSolution : mesh_(mesh), dict_(dictionary::null), - active_(false), transient_(false), calcFrequency_(0), maxCo_(great), @@ -224,7 +218,7 @@ bool Foam::cloudSolution::semiImplicit(const word& fieldName) const bool Foam::cloudSolution::solveThisStep() const { - return active_ && (mesh_.time().timeIndex() % calcFrequency_ == 0); + return (mesh_.time().timeIndex() % calcFrequency_ == 0); } @@ -245,7 +239,7 @@ bool Foam::cloudSolution::canEvolve() bool Foam::cloudSolution::output() const { - return active_ && mesh_.time().writeTime(); + return mesh_.time().writeTime(); } diff --git a/src/lagrangian/parcel/clouds/Templates/MomentumCloud/cloudSolution/cloudSolution.H b/src/lagrangian/parcel/clouds/Templates/MomentumCloud/cloudSolution/cloudSolution.H index 2ceaff14f2..16b313ef31 100644 --- a/src/lagrangian/parcel/clouds/Templates/MomentumCloud/cloudSolution/cloudSolution.H +++ b/src/lagrangian/parcel/clouds/Templates/MomentumCloud/cloudSolution/cloudSolution.H @@ -59,9 +59,6 @@ class cloudSolution //- Dictionary used during construction dictionary dict_; - //- Cloud active flag - const Switch active_; - //- Transient flag Switch transient_; @@ -141,9 +138,6 @@ public: //- Return const access to the dictionary inline const dictionary& dict() const; - //- Return the active flag - inline const Switch active() const; - //- Return const access to the transient flag inline const Switch transient() const; diff --git a/src/lagrangian/parcel/clouds/Templates/MomentumCloud/cloudSolution/cloudSolutionI.H b/src/lagrangian/parcel/clouds/Templates/MomentumCloud/cloudSolution/cloudSolutionI.H index 48c005de3d..828aa57b40 100644 --- a/src/lagrangian/parcel/clouds/Templates/MomentumCloud/cloudSolution/cloudSolutionI.H +++ b/src/lagrangian/parcel/clouds/Templates/MomentumCloud/cloudSolution/cloudSolutionI.H @@ -35,12 +35,6 @@ inline const Foam::dictionary& Foam::cloudSolution::dict() const } -inline const Foam::Switch Foam::cloudSolution::active() const -{ - return active_; -} - - inline const Foam::dictionary& Foam::cloudSolution::sourceTermDict() const { return dict_.subDict("sourceTerms"); diff --git a/src/lagrangian/parcel/clouds/Templates/ReactingCloud/ReactingCloud.C b/src/lagrangian/parcel/clouds/Templates/ReactingCloud/ReactingCloud.C index c07e40e0aa..713abb2159 100644 --- a/src/lagrangian/parcel/clouds/Templates/ReactingCloud/ReactingCloud.C +++ b/src/lagrangian/parcel/clouds/Templates/ReactingCloud/ReactingCloud.C @@ -102,15 +102,12 @@ Foam::ReactingCloud::ReactingCloud phaseChangeModel_(nullptr), rhoTrans_(this->thermo().carrier().species().size()) { - if (this->solution().active()) - { - setModels(); + setModels(); - if (readFields) - { - parcelType::readFields(*this, this->composition()); - this->deleteLostParticles(); - } + if (readFields) + { + parcelType::readFields(*this, this->composition()); + this->deleteLostParticles(); } // Set storage for mass source fields and initialise to zero @@ -193,7 +190,6 @@ Foam::ReactingCloud::ReactingCloud cloudCopyPtr_(nullptr), constProps_(), compositionModel_(c.compositionModel_->clone()), -// compositionModel_(nullptr), phaseChangeModel_(nullptr), rhoTrans_(0) {} diff --git a/src/lagrangian/parcel/clouds/Templates/ReactingMultiphaseCloud/ReactingMultiphaseCloud.C b/src/lagrangian/parcel/clouds/Templates/ReactingMultiphaseCloud/ReactingMultiphaseCloud.C index fdec97e872..7ead2306b3 100644 --- a/src/lagrangian/parcel/clouds/Templates/ReactingMultiphaseCloud/ReactingMultiphaseCloud.C +++ b/src/lagrangian/parcel/clouds/Templates/ReactingMultiphaseCloud/ReactingMultiphaseCloud.C @@ -90,15 +90,12 @@ Foam::ReactingMultiphaseCloud::ReactingMultiphaseCloud dMassDevolatilisation_(0.0), dMassSurfaceReaction_(0.0) { - if (this->solution().active()) - { - setModels(); + setModels(); - if (readFields) - { - parcelType::readFields(*this, this->composition()); - this->deleteLostParticles(); - } + if (readFields) + { + parcelType::readFields(*this, this->composition()); + this->deleteLostParticles(); } if (this->solution().resetSourcesOnStartup()) diff --git a/src/lagrangian/parcel/clouds/Templates/SprayCloud/SprayCloud.C b/src/lagrangian/parcel/clouds/Templates/SprayCloud/SprayCloud.C index 2e7f4f35d5..0ff3125f2d 100644 --- a/src/lagrangian/parcel/clouds/Templates/SprayCloud/SprayCloud.C +++ b/src/lagrangian/parcel/clouds/Templates/SprayCloud/SprayCloud.C @@ -84,21 +84,18 @@ Foam::SprayCloud::SprayCloud atomizationModel_(nullptr), breakupModel_(nullptr) { - if (this->solution().active()) + setModels(); + + averageParcelMass_ = this->injectors().averageParcelMass(); + + if (readFields) { - setModels(); - - averageParcelMass_ = this->injectors().averageParcelMass(); - - if (readFields) - { - parcelType::readFields(*this, this->composition()); - this->deleteLostParticles(); - } - - Info << "Average parcel mass: " << averageParcelMass_ << endl; + parcelType::readFields(*this, this->composition()); + this->deleteLostParticles(); } + Info << "Average parcel mass: " << averageParcelMass_ << endl; + if (this->solution().resetSourcesOnStartup()) { CloudType::resetSourceTerms(); diff --git a/src/lagrangian/parcel/clouds/Templates/ThermoCloud/ThermoCloud.C b/src/lagrangian/parcel/clouds/Templates/ThermoCloud/ThermoCloud.C index 8a451a0518..f2b96c40fb 100644 --- a/src/lagrangian/parcel/clouds/Templates/ThermoCloud/ThermoCloud.C +++ b/src/lagrangian/parcel/clouds/Templates/ThermoCloud/ThermoCloud.C @@ -182,15 +182,12 @@ Foam::ThermoCloud::ThermoCloud ) ) { - if (this->solution().active()) - { - setModels(); + setModels(); - if (readFields) - { - parcelType::readFields(*this); - this->deleteLostParticles(); - } + if (readFields) + { + parcelType::readFields(*this); + this->deleteLostParticles(); } if (this->solution().resetSourcesOnStartup()) diff --git a/src/lagrangian/parcel/parcels/Templates/MomentumParcel/MomentumParcel.C b/src/lagrangian/parcel/parcels/Templates/MomentumParcel/MomentumParcel.C index e80a06d9a3..ab3f06eadc 100644 --- a/src/lagrangian/parcel/parcels/Templates/MomentumParcel/MomentumParcel.C +++ b/src/lagrangian/parcel/parcels/Templates/MomentumParcel/MomentumParcel.C @@ -237,7 +237,7 @@ Foam::MomentumParcel::MomentumParcel ) : ParcelType(p), - active_(p.active_), + moving_(p.moving_), typeId_(p.typeId_), nParticle_(p.nParticle_), d_(p.d_), @@ -258,7 +258,7 @@ Foam::MomentumParcel::MomentumParcel ) : ParcelType(p, mesh), - active_(p.active_), + moving_(p.moving_), typeId_(p.typeId_), nParticle_(p.nParticle_), d_(p.d_), @@ -314,14 +314,14 @@ bool Foam::MomentumParcel::move scalar f = 1 - p.stepFraction(); f = min(f, maxCo); f = min(f, maxCo*l/max(small*l, mag(s))); - if (p.active()) + if (p.moving()) { // Track to the next face p.trackToFace(f*s - d, f); } else { - // At present the only thing that sets active_ to false is a stick + // At present the only thing that sets moving_ to false is a stick // wall interaction. We want the position of the particle to remain // the same relative to the face that it is on. The local // coordinates therefore do not change. We still advance in time and @@ -349,14 +349,14 @@ bool Foam::MomentumParcel::move p.age() += dt; - if (p.active() && p.onFace()) + if (p.moving() && p.onFace()) { cloud.functions().postFace(p, ttd.keepParticle); } cloud.functions().postMove(p, dt, start, ttd.keepParticle); - if (p.active() && p.onFace() && ttd.keepParticle) + if (p.moving() && p.onFace() && ttd.keepParticle) { p.hitFace(f*s - d, f, cloud, ttd); } diff --git a/src/lagrangian/parcel/parcels/Templates/MomentumParcel/MomentumParcel.H b/src/lagrangian/parcel/parcels/Templates/MomentumParcel/MomentumParcel.H index 33547ec965..738f0860d2 100644 --- a/src/lagrangian/parcel/parcels/Templates/MomentumParcel/MomentumParcel.H +++ b/src/lagrangian/parcel/parcels/Templates/MomentumParcel/MomentumParcel.H @@ -243,8 +243,8 @@ protected: // Parcel properties - //- Active flag - tracking inactive when active = false - bool active_; + //- Moving flag - tracking stopped when moving = false + bool moving_; //- Parcel type id label typeId_; @@ -300,7 +300,7 @@ public: AddToPropertyList ( ParcelType, - " active" + " moving" + " typeId" + " nParticle" + " d" @@ -388,8 +388,8 @@ public: // Access - //- Return const access to active flag - inline bool active() const; + //- Return const access to moving flag + inline bool moving() const; //- Return const access to type id inline label typeId() const; @@ -421,8 +421,8 @@ public: // Edit - //- Return const access to active flag - inline bool& active(); + //- Return const access to moving flag + inline bool& moving(); //- Return access to type id inline label& typeId(); diff --git a/src/lagrangian/parcel/parcels/Templates/MomentumParcel/MomentumParcelI.H b/src/lagrangian/parcel/parcels/Templates/MomentumParcel/MomentumParcelI.H index 28bd961757..b94377f926 100644 --- a/src/lagrangian/parcel/parcels/Templates/MomentumParcel/MomentumParcelI.H +++ b/src/lagrangian/parcel/parcels/Templates/MomentumParcel/MomentumParcelI.H @@ -80,7 +80,7 @@ inline Foam::MomentumParcel::MomentumParcel ) : ParcelType(owner, coordinates, celli, tetFacei, tetPti), - active_(true), + moving_(true), typeId_(-1), nParticle_(0), d_(0.0), @@ -102,7 +102,7 @@ inline Foam::MomentumParcel::MomentumParcel ) : ParcelType(owner, position, celli), - active_(true), + moving_(true), typeId_(-1), nParticle_(0), d_(0.0), @@ -160,9 +160,9 @@ Foam::MomentumParcel::constantProperties::minParcelMass() const // * * * * * * * MomentumParcel Member Functions * * * * * * * // template -inline bool Foam::MomentumParcel::active() const +inline bool Foam::MomentumParcel::moving() const { - return active_; + return moving_; } @@ -230,9 +230,9 @@ inline const Foam::vector& Foam::MomentumParcel::UTurb() const template -inline bool& Foam::MomentumParcel::active() +inline bool& Foam::MomentumParcel::moving() { - return active_; + return moving_; } diff --git a/src/lagrangian/parcel/parcels/Templates/MomentumParcel/MomentumParcelIO.C b/src/lagrangian/parcel/parcels/Templates/MomentumParcel/MomentumParcelIO.C index 0573af1348..5999a65e06 100644 --- a/src/lagrangian/parcel/parcels/Templates/MomentumParcel/MomentumParcelIO.C +++ b/src/lagrangian/parcel/parcels/Templates/MomentumParcel/MomentumParcelIO.C @@ -38,7 +38,7 @@ template const std::size_t Foam::MomentumParcel::sizeofFields_ ( sizeof(MomentumParcel) - - offsetof(MomentumParcel, active_) + - offsetof(MomentumParcel, moving_) ); @@ -53,7 +53,7 @@ Foam::MomentumParcel::MomentumParcel ) : ParcelType(mesh, is, readFields), - active_(false), + moving_(false), typeId_(0), nParticle_(0.0), d_(0.0), @@ -68,7 +68,7 @@ Foam::MomentumParcel::MomentumParcel { if (is.format() == IOstream::ASCII) { - active_ = readBool(is); + moving_ = readBool(is); typeId_ = readLabel(is); nParticle_ = readScalar(is); d_ = readScalar(is); @@ -81,7 +81,7 @@ Foam::MomentumParcel::MomentumParcel } else { - is.read(reinterpret_cast(&active_), sizeofFields_); + is.read(reinterpret_cast(&moving_), sizeofFields_); } } @@ -102,12 +102,12 @@ void Foam::MomentumParcel::readFields(CloudType& c) ParcelType::readFields(c); - IOField