diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/setRegionFluidFields.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/setRegionFluidFields.H index 5832cba818..cf62a3a498 100644 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/setRegionFluidFields.H +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/setRegionFluidFields.H @@ -50,7 +50,7 @@ radiationModel& rad = radiation[i]; IOMRFZoneList& MRF = MRFfluid[i]; - fv::options& fvOptions = fluidFvOptions[i]; + const fv::options& fvOptions = fluidFvOptions[i]; const dimensionedScalar initialMass ( diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/setRegionSolidFields.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/setRegionSolidFields.H index 27433a0b0e..c3890fa3e8 100644 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/setRegionSolidFields.H +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/setRegionSolidFields.H @@ -28,6 +28,6 @@ volScalarField& e = thermo.he(); const volScalarField& betav = betavSolid[i]; -fv::options& fvOptions = solidHeatSources[i]; +const fv::options& fvOptions = solidHeatSources[i]; solidNoLoopControl& pimple = pimples.solid(i); diff --git a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterFilmFoam/VoFSolidificationMeltingSource/VoFSolidificationMeltingSource.C b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterFilmFoam/VoFSolidificationMeltingSource/VoFSolidificationMeltingSource.C index c6ebb3d05e..8b59af5317 100644 --- a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterFilmFoam/VoFSolidificationMeltingSource/VoFSolidificationMeltingSource.C +++ b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterFilmFoam/VoFSolidificationMeltingSource/VoFSolidificationMeltingSource.C @@ -48,7 +48,7 @@ namespace Foam // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // -void Foam::fv::VoFSolidificationMeltingSource::update() +void Foam::fv::VoFSolidificationMeltingSource::update() const { if (curTimeIndex_ == mesh_.time().timeIndex()) { @@ -156,7 +156,7 @@ void Foam::fv::VoFSolidificationMeltingSource::addSup ( fvMatrix& eqn, const label fieldi -) +) const { apply(geometricOneField(), eqn); } @@ -167,7 +167,7 @@ void Foam::fv::VoFSolidificationMeltingSource::addSup const volScalarField& rho, fvMatrix& eqn, const label fieldi -) +) const { apply(rho, eqn); } @@ -177,7 +177,7 @@ void Foam::fv::VoFSolidificationMeltingSource::addSup ( fvMatrix& eqn, const label fieldi -) +) const { if (debug) { @@ -209,7 +209,7 @@ void Foam::fv::VoFSolidificationMeltingSource::addSup const volScalarField& rho, fvMatrix& eqn, const label fieldi -) +) const { // Momentum source uses a Boussinesq approximation - redirect addSup(eqn, fieldi); diff --git a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterFilmFoam/VoFSolidificationMeltingSource/VoFSolidificationMeltingSource.H b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterFilmFoam/VoFSolidificationMeltingSource/VoFSolidificationMeltingSource.H index 9ac273b862..20719bda21 100644 --- a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterFilmFoam/VoFSolidificationMeltingSource/VoFSolidificationMeltingSource.H +++ b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterFilmFoam/VoFSolidificationMeltingSource/VoFSolidificationMeltingSource.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2017-2019 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2017-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -117,10 +117,10 @@ class VoFSolidificationMeltingSource scalar q_; //- Solid phase fraction - volScalarField alphaSolid_; + mutable volScalarField alphaSolid_; //- Current time index (used for updating) - label curTimeIndex_; + mutable label curTimeIndex_; // Private Member Functions @@ -129,11 +129,11 @@ class VoFSolidificationMeltingSource word alphaSolidName() const; //- Update the model - void update(); + void update() const; //- Helper function to apply to the energy equation template - void apply(const RhoFieldType& rho, fvMatrix& eqn); + void apply(const RhoFieldType& rho, fvMatrix& eqn) const; public: @@ -165,10 +165,18 @@ public: // Add explicit and implicit contributions //- Add explicit contribution to enthalpy equation - virtual void addSup(fvMatrix& eqn, const label fieldi); + virtual void addSup + ( + fvMatrix& eqn, + const label fieldi + ) const; //- Add implicit contribution to momentum equation - virtual void addSup(fvMatrix& eqn, const label fieldi); + virtual void addSup + ( + fvMatrix& eqn, + const label fieldi + ) const; // Add explicit and implicit contributions to compressible equation @@ -179,7 +187,7 @@ public: const volScalarField& rho, fvMatrix& eqn, const label fieldi - ); + ) const; //- Add implicit contribution to compressible momentum equation virtual void addSup @@ -187,7 +195,7 @@ public: const volScalarField& rho, fvMatrix& eqn, const label fieldi - ); + ) const; // IO diff --git a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterFilmFoam/VoFSolidificationMeltingSource/VoFSolidificationMeltingSourceTemplates.C b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterFilmFoam/VoFSolidificationMeltingSource/VoFSolidificationMeltingSourceTemplates.C index 8014c269d3..1bcceef623 100644 --- a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterFilmFoam/VoFSolidificationMeltingSource/VoFSolidificationMeltingSourceTemplates.C +++ b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterFilmFoam/VoFSolidificationMeltingSource/VoFSolidificationMeltingSourceTemplates.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2017-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2017-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -33,7 +33,7 @@ void Foam::fv::VoFSolidificationMeltingSource::apply ( const RhoFieldType& rho, fvMatrix& eqn -) +) const { if (debug) { diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseCompressibleMomentumTransportModels/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.C b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseCompressibleMomentumTransportModels/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.C index cc8cd047b5..647004576e 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseCompressibleMomentumTransportModels/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseCompressibleMomentumTransportModels/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.C @@ -477,7 +477,7 @@ void Foam::RASModels::kineticTheoryModel::correct() // 'thermal' conductivity (Table 3.3, p. 49) kappa_ = conductivityModel_->kappa(alpha, Theta_, gs0_, rho, da, e_); - fv::options& fvOptions(fv::options::New(mesh_)); + const fv::options& fvOptions(fv::options::New(mesh_)); // Construct the granular temperature equation (Eq. 3.20, p. 44) // NB. note that there are two typos in Eq. 3.20: diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseEulerFoam/createFieldRefs.H b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseEulerFoam/createFieldRefs.H index 8a629b017d..c7ded12d6a 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseEulerFoam/createFieldRefs.H +++ b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseEulerFoam/createFieldRefs.H @@ -1,4 +1,4 @@ surfaceScalarField& phi = fluid.phi(); const IOMRFZoneList& MRF = fluid.MRF(); -fv::options& fvOptions = fluid.fvOptions(); +const fv::options& fvOptions = fluid.fvOptions(); diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/diameterModels/IATE/IATE.C b/applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/diameterModels/IATE/IATE.C index 70ef27613c..17932efdf2 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/diameterModels/IATE/IATE.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/diameterModels/IATE/IATE.C @@ -144,7 +144,7 @@ void Foam::diameterModels::IATE::correct() R += sources_[j].R(alphaAv, kappai_); } - fv::options& fvOptions(fv::options::New(phase().mesh())); + const fv::options& fvOptions(fv::options::New(phase().mesh())); // Construct the interfacial curvature equation fvScalarMatrix kappaiEqn diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/phaseSystem/phaseSystem.H b/applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/phaseSystem/phaseSystem.H index d59e6ca7e4..7d98e03f7f 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/phaseSystem/phaseSystem.H +++ b/applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/phaseSystem/phaseSystem.H @@ -436,7 +436,7 @@ public: inline const IOMRFZoneList& MRF() const; //- Access the fvOptions - inline fv::options& fvOptions() const; + inline const fv::options& fvOptions() const; // Sub-model lookup diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/phaseSystem/phaseSystemI.H b/applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/phaseSystem/phaseSystemI.H index 869b7ba431..234f431c88 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/phaseSystem/phaseSystemI.H +++ b/applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/phaseSystem/phaseSystemI.H @@ -161,7 +161,7 @@ inline const Foam::IOMRFZoneList& Foam::phaseSystem::MRF() const } -inline Foam::fv::options& Foam::phaseSystem::fvOptions() const +inline const Foam::fv::options& Foam::phaseSystem::fvOptions() const { return fv::options::New(mesh_); } diff --git a/etc/codeTemplates/dynamicCode/codedFvOptionTemplate.C b/etc/codeTemplates/dynamicCode/codedFvOptionTemplate.C index cd8965f496..51f9e932fa 100644 --- a/etc/codeTemplates/dynamicCode/codedFvOptionTemplate.C +++ b/etc/codeTemplates/dynamicCode/codedFvOptionTemplate.C @@ -131,7 +131,7 @@ ${typeName}FvOption${SourceType}:: void ${typeName}FvOption${SourceType}::correct ( GeometricField<${TemplateType}, fvPatchField, volMesh>& fld -) +) const { if (${verbose:-false}) { @@ -148,7 +148,7 @@ void ${typeName}FvOption${SourceType}::addSup ( fvMatrix<${TemplateType}>& eqn, const label fieldi -) +) const { if (${verbose:-false}) { @@ -166,7 +166,7 @@ void ${typeName}FvOption${SourceType}::addSup const volScalarField& rho, fvMatrix<${TemplateType}>& eqn, const label fieldi -) +) const { if (${verbose:-false}) { @@ -183,7 +183,7 @@ void ${typeName}FvOption${SourceType}::constrain ( fvMatrix<${TemplateType}>& eqn, const label fieldi -) +) const { if (${verbose:-false}) { diff --git a/etc/codeTemplates/dynamicCode/codedFvOptionTemplate.H b/etc/codeTemplates/dynamicCode/codedFvOptionTemplate.H index f36230f40d..8cf77ac185 100644 --- a/etc/codeTemplates/dynamicCode/codedFvOptionTemplate.H +++ b/etc/codeTemplates/dynamicCode/codedFvOptionTemplate.H @@ -144,14 +144,14 @@ public: virtual void correct ( GeometricField<${TemplateType}, fvPatchField, volMesh>& - ); + ) const; //- Explicit and implicit matrix contributions virtual void addSup ( fvMatrix<${TemplateType}>& eqn, const label fieldi - ); + ) const; //- Explicit and implicit matrix contributions for compressible // equations @@ -160,14 +160,14 @@ public: const volScalarField& rho, fvMatrix<${TemplateType}>& eqn, const label fieldi - ); + ) const; //- Set value virtual void constrain ( fvMatrix<${TemplateType}>& eqn, const label fieldi - ); + ) const; }; diff --git a/etc/templates/singleFluidCHT/templates/system/solid/fvOptions b/etc/templates/singleFluidCHT/templates/constant/solid/fvOptions similarity index 100% rename from etc/templates/singleFluidCHT/templates/system/solid/fvOptions rename to etc/templates/singleFluidCHT/templates/constant/solid/fvOptions diff --git a/src/MomentumTransportModels/momentumTransportModels/Base/kOmegaSST/kOmegaSSTBase.C b/src/MomentumTransportModels/momentumTransportModels/Base/kOmegaSST/kOmegaSSTBase.C index adb9fe277e..839f817539 100644 --- a/src/MomentumTransportModels/momentumTransportModels/Base/kOmegaSST/kOmegaSSTBase.C +++ b/src/MomentumTransportModels/momentumTransportModels/Base/kOmegaSST/kOmegaSSTBase.C @@ -429,7 +429,7 @@ void kOmegaSST::correct() const surfaceScalarField& alphaRhoPhi = this->alphaRhoPhi_; const volVectorField& U = this->U_; volScalarField& nut = this->nut_; - fv::options& fvOptions(fv::options::New(this->mesh_)); + const fv::options& fvOptions(fv::options::New(this->mesh_)); BasicMomentumTransportModel::correct(); diff --git a/src/MomentumTransportModels/momentumTransportModels/LES/DeardorffDiffStress/DeardorffDiffStress.C b/src/MomentumTransportModels/momentumTransportModels/LES/DeardorffDiffStress/DeardorffDiffStress.C index deb1d07db2..8dbf81dc8f 100644 --- a/src/MomentumTransportModels/momentumTransportModels/LES/DeardorffDiffStress/DeardorffDiffStress.C +++ b/src/MomentumTransportModels/momentumTransportModels/LES/DeardorffDiffStress/DeardorffDiffStress.C @@ -163,7 +163,7 @@ void DeardorffDiffStress::correct() const surfaceScalarField& alphaRhoPhi = this->alphaRhoPhi_; const volVectorField& U = this->U_; volSymmTensorField& R = this->R_; - fv::options& fvOptions(fv::options::New(this->mesh_)); + const fv::options& fvOptions(fv::options::New(this->mesh_)); ReynoldsStress>::correct(); diff --git a/src/MomentumTransportModels/momentumTransportModels/LES/SpalartAllmarasDES/SpalartAllmarasDES.C b/src/MomentumTransportModels/momentumTransportModels/LES/SpalartAllmarasDES/SpalartAllmarasDES.C index b68b53162a..6d51491f88 100644 --- a/src/MomentumTransportModels/momentumTransportModels/LES/SpalartAllmarasDES/SpalartAllmarasDES.C +++ b/src/MomentumTransportModels/momentumTransportModels/LES/SpalartAllmarasDES/SpalartAllmarasDES.C @@ -454,7 +454,7 @@ void SpalartAllmarasDES::correct() const rhoField& rho = this->rho_; const surfaceScalarField& alphaRhoPhi = this->alphaRhoPhi_; const volVectorField& U = this->U_; - fv::options& fvOptions(fv::options::New(this->mesh_)); + const fv::options& fvOptions(fv::options::New(this->mesh_)); LESeddyViscosity::correct(); diff --git a/src/MomentumTransportModels/momentumTransportModels/LES/dynamicKEqn/dynamicKEqn.C b/src/MomentumTransportModels/momentumTransportModels/LES/dynamicKEqn/dynamicKEqn.C index 08811da91c..3e775e7a9c 100644 --- a/src/MomentumTransportModels/momentumTransportModels/LES/dynamicKEqn/dynamicKEqn.C +++ b/src/MomentumTransportModels/momentumTransportModels/LES/dynamicKEqn/dynamicKEqn.C @@ -233,7 +233,7 @@ void dynamicKEqn::correct() const surfaceScalarField& alphaRhoPhi = this->alphaRhoPhi_; const volVectorField& U = this->U_; volScalarField& nut = this->nut_; - fv::options& fvOptions(fv::options::New(this->mesh_)); + const fv::options& fvOptions(fv::options::New(this->mesh_)); LESeddyViscosity::correct(); diff --git a/src/MomentumTransportModels/momentumTransportModels/LES/dynamicLagrangian/dynamicLagrangian.C b/src/MomentumTransportModels/momentumTransportModels/LES/dynamicLagrangian/dynamicLagrangian.C index 49f07a6dec..e362885938 100644 --- a/src/MomentumTransportModels/momentumTransportModels/LES/dynamicLagrangian/dynamicLagrangian.C +++ b/src/MomentumTransportModels/momentumTransportModels/LES/dynamicLagrangian/dynamicLagrangian.C @@ -159,7 +159,7 @@ void dynamicLagrangian::correct() const rhoField& rho = this->rho_; const surfaceScalarField& alphaRhoPhi = this->alphaRhoPhi_; const volVectorField& U = this->U_; - fv::options& fvOptions(fv::options::New(this->mesh_)); + const fv::options& fvOptions(fv::options::New(this->mesh_)); LESeddyViscosity::correct(); diff --git a/src/MomentumTransportModels/momentumTransportModels/LES/kEqn/kEqn.C b/src/MomentumTransportModels/momentumTransportModels/LES/kEqn/kEqn.C index ceb43e101d..7041b30bca 100644 --- a/src/MomentumTransportModels/momentumTransportModels/LES/kEqn/kEqn.C +++ b/src/MomentumTransportModels/momentumTransportModels/LES/kEqn/kEqn.C @@ -159,7 +159,7 @@ void kEqn::correct() const surfaceScalarField& alphaRhoPhi = this->alphaRhoPhi_; const volVectorField& U = this->U_; volScalarField& nut = this->nut_; - fv::options& fvOptions(fv::options::New(this->mesh_)); + const fv::options& fvOptions(fv::options::New(this->mesh_)); LESeddyViscosity::correct(); diff --git a/src/MomentumTransportModels/momentumTransportModels/RAS/LRR/LRR.C b/src/MomentumTransportModels/momentumTransportModels/RAS/LRR/LRR.C index 39deae53fb..c4ba2ffe84 100644 --- a/src/MomentumTransportModels/momentumTransportModels/RAS/LRR/LRR.C +++ b/src/MomentumTransportModels/momentumTransportModels/RAS/LRR/LRR.C @@ -272,7 +272,7 @@ void LRR::correct() const surfaceScalarField& alphaRhoPhi = this->alphaRhoPhi_; const volVectorField& U = this->U_; volSymmTensorField& R = this->R_; - fv::options& fvOptions(fv::options::New(this->mesh_)); + const fv::options& fvOptions(fv::options::New(this->mesh_)); ReynoldsStress>::correct(); diff --git a/src/MomentumTransportModels/momentumTransportModels/RAS/LaunderSharmaKE/LaunderSharmaKE.C b/src/MomentumTransportModels/momentumTransportModels/RAS/LaunderSharmaKE/LaunderSharmaKE.C index 4a5c5bbc6d..6f1f65f94c 100644 --- a/src/MomentumTransportModels/momentumTransportModels/RAS/LaunderSharmaKE/LaunderSharmaKE.C +++ b/src/MomentumTransportModels/momentumTransportModels/RAS/LaunderSharmaKE/LaunderSharmaKE.C @@ -246,7 +246,7 @@ void LaunderSharmaKE::correct() const surfaceScalarField& alphaRhoPhi = this->alphaRhoPhi_; const volVectorField& U = this->U_; volScalarField& nut = this->nut_; - fv::options& fvOptions(fv::options::New(this->mesh_)); + const fv::options& fvOptions(fv::options::New(this->mesh_)); eddyViscosity>::correct(); diff --git a/src/MomentumTransportModels/momentumTransportModels/RAS/RNGkEpsilon/RNGkEpsilon.C b/src/MomentumTransportModels/momentumTransportModels/RAS/RNGkEpsilon/RNGkEpsilon.C index 806fb47eab..c461e3e85e 100644 --- a/src/MomentumTransportModels/momentumTransportModels/RAS/RNGkEpsilon/RNGkEpsilon.C +++ b/src/MomentumTransportModels/momentumTransportModels/RAS/RNGkEpsilon/RNGkEpsilon.C @@ -248,7 +248,7 @@ void RNGkEpsilon::correct() const surfaceScalarField& alphaRhoPhi = this->alphaRhoPhi_; const volVectorField& U = this->U_; volScalarField& nut = this->nut_; - fv::options& fvOptions(fv::options::New(this->mesh_)); + const fv::options& fvOptions(fv::options::New(this->mesh_)); eddyViscosity>::correct(); diff --git a/src/MomentumTransportModels/momentumTransportModels/RAS/SSG/SSG.C b/src/MomentumTransportModels/momentumTransportModels/RAS/SSG/SSG.C index ec84077055..0b752cbe8b 100644 --- a/src/MomentumTransportModels/momentumTransportModels/RAS/SSG/SSG.C +++ b/src/MomentumTransportModels/momentumTransportModels/RAS/SSG/SSG.C @@ -282,7 +282,7 @@ void SSG::correct() const surfaceScalarField& alphaRhoPhi = this->alphaRhoPhi_; const volVectorField& U = this->U_; volSymmTensorField& R = this->R_; - fv::options& fvOptions(fv::options::New(this->mesh_)); + const fv::options& fvOptions(fv::options::New(this->mesh_)); ReynoldsStress>::correct(); diff --git a/src/MomentumTransportModels/momentumTransportModels/RAS/SpalartAllmaras/SpalartAllmaras.C b/src/MomentumTransportModels/momentumTransportModels/RAS/SpalartAllmaras/SpalartAllmaras.C index 389f55e305..42f4172094 100644 --- a/src/MomentumTransportModels/momentumTransportModels/RAS/SpalartAllmaras/SpalartAllmaras.C +++ b/src/MomentumTransportModels/momentumTransportModels/RAS/SpalartAllmaras/SpalartAllmaras.C @@ -355,7 +355,7 @@ void SpalartAllmaras::correct() const alphaField& alpha = this->alpha_; const rhoField& rho = this->rho_; const surfaceScalarField& alphaRhoPhi = this->alphaRhoPhi_; - fv::options& fvOptions(fv::options::New(this->mesh_)); + const fv::options& fvOptions(fv::options::New(this->mesh_)); eddyViscosity>::correct(); diff --git a/src/MomentumTransportModels/momentumTransportModels/RAS/kEpsilon/kEpsilon.C b/src/MomentumTransportModels/momentumTransportModels/RAS/kEpsilon/kEpsilon.C index 743805c975..20767f1e8c 100644 --- a/src/MomentumTransportModels/momentumTransportModels/RAS/kEpsilon/kEpsilon.C +++ b/src/MomentumTransportModels/momentumTransportModels/RAS/kEpsilon/kEpsilon.C @@ -227,7 +227,7 @@ void kEpsilon::correct() const surfaceScalarField& alphaRhoPhi = this->alphaRhoPhi_; const volVectorField& U = this->U_; volScalarField& nut = this->nut_; - fv::options& fvOptions(fv::options::New(this->mesh_)); + const fv::options& fvOptions(fv::options::New(this->mesh_)); eddyViscosity>::correct(); diff --git a/src/MomentumTransportModels/momentumTransportModels/RAS/kOmega/kOmega.C b/src/MomentumTransportModels/momentumTransportModels/RAS/kOmega/kOmega.C index c5cb4bb40b..4a7eb6a6be 100644 --- a/src/MomentumTransportModels/momentumTransportModels/RAS/kOmega/kOmega.C +++ b/src/MomentumTransportModels/momentumTransportModels/RAS/kOmega/kOmega.C @@ -216,7 +216,7 @@ void kOmega::correct() const surfaceScalarField& alphaRhoPhi = this->alphaRhoPhi_; const volVectorField& U = this->U_; volScalarField& nut = this->nut_; - fv::options& fvOptions(fv::options::New(this->mesh_)); + const fv::options& fvOptions(fv::options::New(this->mesh_)); eddyViscosity>::correct(); diff --git a/src/MomentumTransportModels/momentumTransportModels/RAS/kOmegaSSTLM/kOmegaSSTLM.C b/src/MomentumTransportModels/momentumTransportModels/RAS/kOmegaSSTLM/kOmegaSSTLM.C index e0f1450c38..2ed6a5b7b0 100644 --- a/src/MomentumTransportModels/momentumTransportModels/RAS/kOmegaSSTLM/kOmegaSSTLM.C +++ b/src/MomentumTransportModels/momentumTransportModels/RAS/kOmegaSSTLM/kOmegaSSTLM.C @@ -497,7 +497,7 @@ void kOmegaSSTLM::correctReThetatGammaInt() const tmp tnu = this->nu(); const volScalarField::Internal& nu = tnu()(); const volScalarField::Internal& y = this->y_(); - fv::options& fvOptions(fv::options::New(this->mesh_)); + const fv::options& fvOptions(fv::options::New(this->mesh_)); // Fields derived from the velocity gradient tmp tgradU = fvc::grad(U); diff --git a/src/MomentumTransportModels/momentumTransportModels/RAS/realizableKE/realizableKE.C b/src/MomentumTransportModels/momentumTransportModels/RAS/realizableKE/realizableKE.C index 75c737a387..8483463795 100644 --- a/src/MomentumTransportModels/momentumTransportModels/RAS/realizableKE/realizableKE.C +++ b/src/MomentumTransportModels/momentumTransportModels/RAS/realizableKE/realizableKE.C @@ -256,7 +256,7 @@ void realizableKE::correct() const surfaceScalarField& alphaRhoPhi = this->alphaRhoPhi_; const volVectorField& U = this->U_; volScalarField& nut = this->nut_; - fv::options& fvOptions(fv::options::New(this->mesh_)); + const fv::options& fvOptions(fv::options::New(this->mesh_)); eddyViscosity>::correct(); diff --git a/src/MomentumTransportModels/momentumTransportModels/RAS/v2f/v2f.C b/src/MomentumTransportModels/momentumTransportModels/RAS/v2f/v2f.C index 5d9efc3010..ffbafbe4e4 100644 --- a/src/MomentumTransportModels/momentumTransportModels/RAS/v2f/v2f.C +++ b/src/MomentumTransportModels/momentumTransportModels/RAS/v2f/v2f.C @@ -282,7 +282,7 @@ void v2f::correct() const surfaceScalarField& alphaRhoPhi = this->alphaRhoPhi_; const volVectorField& U = this->U_; volScalarField& nut = this->nut_; - fv::options& fvOptions(fv::options::New(this->mesh_)); + const fv::options& fvOptions(fv::options::New(this->mesh_)); eddyViscosity>::correct(); diff --git a/src/MomentumTransportModels/momentumTransportModels/laminar/Maxwell/Maxwell.C b/src/MomentumTransportModels/momentumTransportModels/laminar/Maxwell/Maxwell.C index 329af8ec09..b81ddaf013 100644 --- a/src/MomentumTransportModels/momentumTransportModels/laminar/Maxwell/Maxwell.C +++ b/src/MomentumTransportModels/momentumTransportModels/laminar/Maxwell/Maxwell.C @@ -322,7 +322,7 @@ void Maxwell::correct() const rhoField& rho = this->rho_; const surfaceScalarField& alphaRhoPhi = this->alphaRhoPhi_; const volVectorField& U = this->U_; - fv::options& fvOptions(fv::options::New(this->mesh_)); + const fv::options& fvOptions(fv::options::New(this->mesh_)); laminarModel::correct(); diff --git a/src/MomentumTransportModels/phaseCompressible/RAS/mixtureKEpsilon/mixtureKEpsilon.C b/src/MomentumTransportModels/phaseCompressible/RAS/mixtureKEpsilon/mixtureKEpsilon.C index bf87fef351..682f4f0274 100644 --- a/src/MomentumTransportModels/phaseCompressible/RAS/mixtureKEpsilon/mixtureKEpsilon.C +++ b/src/MomentumTransportModels/phaseCompressible/RAS/mixtureKEpsilon/mixtureKEpsilon.C @@ -596,7 +596,7 @@ void mixtureKEpsilon::correct() volScalarField& km = km_(); volScalarField& epsilonm = epsilonm_(); - fv::options& fvOptions(fv::options::New(this->mesh_)); + const fv::options& fvOptions(fv::options::New(this->mesh_)); eddyViscosity>::correct(); diff --git a/src/atmosphericModels/kEpsilonLopesdaCosta/kEpsilonLopesdaCosta.C b/src/atmosphericModels/kEpsilonLopesdaCosta/kEpsilonLopesdaCosta.C index 22a17429a7..0486e425cd 100644 --- a/src/atmosphericModels/kEpsilonLopesdaCosta/kEpsilonLopesdaCosta.C +++ b/src/atmosphericModels/kEpsilonLopesdaCosta/kEpsilonLopesdaCosta.C @@ -98,7 +98,7 @@ template void kEpsilonLopesdaCosta:: setPorosityCoefficients() { - fv::options::optionList& fvOptions(fv::options::New(this->mesh_)); + const fv::options::optionList& fvOptions(fv::options::New(this->mesh_)); forAll(fvOptions, i) { @@ -398,7 +398,7 @@ void kEpsilonLopesdaCosta::correct() const surfaceScalarField& alphaRhoPhi = this->alphaRhoPhi_; const volVectorField& U = this->U_; volScalarField& nut = this->nut_; - fv::options& fvOptions(fv::options::New(this->mesh_)); + const fv::options& fvOptions(fv::options::New(this->mesh_)); eddyViscosity>::correct(); diff --git a/src/finiteVolume/cfdTools/general/fvOptions/fvOption.C b/src/finiteVolume/cfdTools/general/fvOptions/fvOption.C index 7a699b4e72..6f27f96c4e 100644 --- a/src/finiteVolume/cfdTools/general/fvOptions/fvOption.C +++ b/src/finiteVolume/cfdTools/general/fvOptions/fvOption.C @@ -104,7 +104,7 @@ Foam::fv::option::~option() // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -bool Foam::fv::option::isActive() +bool Foam::fv::option::isActive() const { return active_; } @@ -134,7 +134,7 @@ void Foam::fv::option::addSup ( fvMatrix& eqn, const label fieldi -) +) const {} @@ -142,7 +142,7 @@ void Foam::fv::option::addSup ( fvMatrix& eqn, const label fieldi -) +) const {} @@ -150,7 +150,7 @@ void Foam::fv::option::addSup ( fvMatrix& eqn, const label fieldi -) +) const {} @@ -158,7 +158,7 @@ void Foam::fv::option::addSup ( fvMatrix& eqn, const label fieldi -) +) const {} @@ -166,7 +166,7 @@ void Foam::fv::option::addSup ( fvMatrix& eqn, const label fieldi -) +) const {} @@ -175,7 +175,7 @@ void Foam::fv::option::addSup const volScalarField& rho, fvMatrix& eqn, const label fieldi -) +) const {} @@ -184,7 +184,7 @@ void Foam::fv::option::addSup const volScalarField& rho, fvMatrix& eqn, const label fieldi -) +) const {} @@ -193,7 +193,7 @@ void Foam::fv::option::addSup const volScalarField& rho, fvMatrix& eqn, const label fieldi -) +) const {} @@ -202,7 +202,7 @@ void Foam::fv::option::addSup const volScalarField& rho, fvMatrix& eqn, const label fieldi -) +) const {} @@ -211,7 +211,7 @@ void Foam::fv::option::addSup const volScalarField& rho, fvMatrix& eqn, const label fieldi -) +) const {} @@ -221,7 +221,7 @@ void Foam::fv::option::addSup const volScalarField& rho, fvMatrix& eqn, const label fieldi -) +) const { addSup(alpha*rho, eqn, fieldi); } @@ -233,7 +233,7 @@ void Foam::fv::option::addSup const volScalarField& rho, fvMatrix& eqn, const label fieldi -) +) const { addSup(alpha*rho, eqn, fieldi); } @@ -245,7 +245,7 @@ void Foam::fv::option::addSup const volScalarField& rho, fvMatrix& eqn, const label fieldi -) +) const { addSup(alpha*rho, eqn, fieldi); } @@ -257,7 +257,7 @@ void Foam::fv::option::addSup const volScalarField& rho, fvMatrix& eqn, const label fieldi -) +) const { addSup(alpha*rho, eqn, fieldi); } @@ -269,17 +269,25 @@ void Foam::fv::option::addSup const volScalarField& rho, fvMatrix& eqn, const label fieldi -) +) const { addSup(alpha*rho, eqn, fieldi); } -void Foam::fv::option::constrain(fvMatrix& eqn, const label fieldi) +void Foam::fv::option::constrain +( + fvMatrix& eqn, + const label fieldi +) const {} -void Foam::fv::option::constrain(fvMatrix& eqn, const label fieldi) +void Foam::fv::option::constrain +( + fvMatrix& eqn, + const label fieldi +) const {} @@ -287,7 +295,7 @@ void Foam::fv::option::constrain ( fvMatrix& eqn, const label fieldi -) +) const {} @@ -295,31 +303,34 @@ void Foam::fv::option::constrain ( fvMatrix& eqn, const label fieldi -) +) const {} -void Foam::fv::option::constrain(fvMatrix& eqn, const label fieldi) +void Foam::fv::option::constrain +( + fvMatrix& eqn, const label fieldi +) const {} -void Foam::fv::option::correct(volScalarField& field) +void Foam::fv::option::correct(volScalarField& field) const {} -void Foam::fv::option::correct(volVectorField& field) +void Foam::fv::option::correct(volVectorField& field) const {} -void Foam::fv::option::correct(volSphericalTensorField& field) +void Foam::fv::option::correct(volSphericalTensorField& field) const {} -void Foam::fv::option::correct(volSymmTensorField& field) +void Foam::fv::option::correct(volSymmTensorField& field) const {} -void Foam::fv::option::correct(volTensorField& field) +void Foam::fv::option::correct(volTensorField& field) const {} diff --git a/src/finiteVolume/cfdTools/general/fvOptions/fvOption.H b/src/finiteVolume/cfdTools/general/fvOptions/fvOption.H index 830c854b11..f7d049c3ca 100644 --- a/src/finiteVolume/cfdTools/general/fvOptions/fvOption.H +++ b/src/finiteVolume/cfdTools/general/fvOptions/fvOption.H @@ -48,7 +48,6 @@ SourceFiles #include "volFieldsFwd.H" #include "dictionary.H" #include "Switch.H" -#include "runTimeSelectionTables.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -93,7 +92,7 @@ protected: wordList fieldNames_; //- Applied flag list - corresponds to each fieldNames_ entry - List applied_; + mutable List applied_; public: @@ -203,7 +202,7 @@ public: inline bool active() const; //- Set the applied flag to true for field index fieldi - inline void setApplied(const label fieldi); + inline void setApplied(const label fieldi) const; // Edit @@ -215,7 +214,7 @@ public: // Checks //- Is the source active? - virtual bool isActive(); + virtual bool isActive() const; //- Return index of field name if found in fieldNames list virtual label applyToField(const word& fieldName) const; @@ -232,31 +231,31 @@ public: ( fvMatrix& eqn, const label fieldi - ); + ) const; virtual void addSup ( fvMatrix& eqn, const label fieldi - ); + ) const; virtual void addSup ( fvMatrix& eqn, const label fieldi - ); + ) const; virtual void addSup ( fvMatrix& eqn, const label fieldi - ); + ) const; virtual void addSup ( fvMatrix& eqn, const label fieldi - ); + ) const; // Explicit and implicit sources for compressible equations @@ -266,35 +265,35 @@ public: const volScalarField& rho, fvMatrix& eqn, const label fieldi - ); + ) const; virtual void addSup ( const volScalarField& rho, fvMatrix& eqn, const label fieldi - ); + ) const; virtual void addSup ( const volScalarField& rho, fvMatrix& eqn, const label fieldi - ); + ) const; virtual void addSup ( const volScalarField& rho, fvMatrix& eqn, const label fieldi - ); + ) const; virtual void addSup ( const volScalarField& rho, fvMatrix& eqn, const label fieldi - ); + ) const; // Explicit and implicit sources for phase equations @@ -305,7 +304,7 @@ public: const volScalarField& rho, fvMatrix& eqn, const label fieldi - ); + ) const; virtual void addSup ( @@ -313,7 +312,7 @@ public: const volScalarField& rho, fvMatrix& eqn, const label fieldi - ); + ) const; virtual void addSup ( @@ -321,7 +320,7 @@ public: const volScalarField& rho, fvMatrix& eqn, const label fieldi - ); + ) const; virtual void addSup ( @@ -329,7 +328,7 @@ public: const volScalarField& rho, fvMatrix& eqn, const label fieldi - ); + ) const; virtual void addSup ( @@ -337,7 +336,7 @@ public: const volScalarField& rho, fvMatrix& eqn, const label fieldi - ); + ) const; // Constraints @@ -346,40 +345,40 @@ public: ( fvMatrix& eqn, const label fieldi - ); + ) const; virtual void constrain ( fvMatrix& eqn, const label fieldi - ); + ) const; virtual void constrain ( fvMatrix& eqn, const label fieldi - ); + ) const; virtual void constrain ( fvMatrix& eqn, const label fieldi - ); + ) const; virtual void constrain ( fvMatrix& eqn, const label fieldi - ); + ) const; // Correction - virtual void correct(volScalarField& field); - virtual void correct(volVectorField& field); - virtual void correct(volSphericalTensorField& field); - virtual void correct(volSymmTensorField& field); - virtual void correct(volTensorField& field); + virtual void correct(volScalarField& field) const; + virtual void correct(volVectorField& field) const; + virtual void correct(volSphericalTensorField& field) const; + virtual void correct(volSymmTensorField& field) const; + virtual void correct(volTensorField& field) const; // Mesh changes diff --git a/src/finiteVolume/cfdTools/general/fvOptions/fvOptionI.H b/src/finiteVolume/cfdTools/general/fvOptions/fvOptionI.H index e05a565bd2..428c85de14 100644 --- a/src/finiteVolume/cfdTools/general/fvOptions/fvOptionI.H +++ b/src/finiteVolume/cfdTools/general/fvOptions/fvOptionI.H @@ -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 @@ -49,7 +49,7 @@ inline bool Foam::fv::option::active() const } -inline void Foam::fv::option::setApplied(const label fieldi) +inline void Foam::fv::option::setApplied(const label fieldi) const { applied_[fieldi] = true; } diff --git a/src/finiteVolume/cfdTools/general/fvOptions/fvOptionList.H b/src/finiteVolume/cfdTools/general/fvOptions/fvOptionList.H index 1122a0175d..3f779dfe6c 100644 --- a/src/finiteVolume/cfdTools/general/fvOptions/fvOptionList.H +++ b/src/finiteVolume/cfdTools/general/fvOptions/fvOptionList.H @@ -92,7 +92,7 @@ protected: GeometricField& field, const word& fieldName, const dimensionSet& ds - ); + ) const; private: @@ -142,7 +142,7 @@ public: tmp> operator() ( GeometricField& field - ); + ) const; //- Return source for equation with specified name template @@ -150,7 +150,7 @@ public: ( GeometricField& field, const word& fieldName - ); + ) const; //- Return source for equation template @@ -158,7 +158,7 @@ public: ( const volScalarField& rho, GeometricField& field - ); + ) const; //- Return source for equation with specified name template @@ -167,7 +167,7 @@ public: const volScalarField& rho, GeometricField& field, const word& fieldName - ); + ) const; //- Return source for equation template @@ -176,7 +176,7 @@ public: const volScalarField& alpha, const volScalarField& rho, GeometricField& field - ); + ) const; //- Return source for equation with specified name template @@ -186,7 +186,7 @@ public: const volScalarField& rho, GeometricField& field, const word& fieldName - ); + ) const; //- Return source for equation template @@ -195,7 +195,7 @@ public: const volScalarField& alpha, const geometricOneField& rho, GeometricField& field - ); + ) const; //- Return source for equation template @@ -204,7 +204,7 @@ public: const geometricOneField& alpha, const volScalarField& rho, GeometricField& field - ); + ) const; //- Return source for equation template @@ -213,14 +213,14 @@ public: const geometricOneField& alpha, const geometricOneField& rho, GeometricField& field - ); + ) const; //- Return source for equation with second time derivative template tmp> d2dt2 ( GeometricField& field - ); + ) const; //- Return source for equation with second time derivative template @@ -228,21 +228,24 @@ public: ( GeometricField& field, const word& fieldName - ); + ) const; // Constraints //- Apply constraints to equation template - void constrain(fvMatrix& eqn); + void constrain(fvMatrix& eqn) const; // Correction //- Apply correction to field template - void correct(GeometricField& field); + void correct + ( + GeometricField& field + ) const; // Mesh changes diff --git a/src/finiteVolume/cfdTools/general/fvOptions/fvOptionListTemplates.C b/src/finiteVolume/cfdTools/general/fvOptions/fvOptionListTemplates.C index ee9e22eb86..56995efa91 100644 --- a/src/finiteVolume/cfdTools/general/fvOptions/fvOptionListTemplates.C +++ b/src/finiteVolume/cfdTools/general/fvOptions/fvOptionListTemplates.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 @@ -31,7 +31,7 @@ Foam::tmp> Foam::fv::optionList::source GeometricField& field, const word& fieldName, const dimensionSet& ds -) +) const { checkApplied(); @@ -40,7 +40,7 @@ Foam::tmp> Foam::fv::optionList::source forAll(*this, i) { - option& source = this->operator[](i); + const option& source = this->operator[](i); label fieldi = source.applyToField(fieldName); @@ -69,7 +69,7 @@ template Foam::tmp> Foam::fv::optionList::operator() ( GeometricField& field -) +) const { return this->operator()(field, field.name()); } @@ -80,7 +80,7 @@ Foam::tmp> Foam::fv::optionList::operator() ( GeometricField& field, const word& fieldName -) +) const { return source(field, fieldName, field.dimensions()/dimTime*dimVolume); } @@ -91,7 +91,7 @@ Foam::tmp> Foam::fv::optionList::operator() ( const volScalarField& rho, GeometricField& field -) +) const { return this->operator()(rho, field, field.name()); } @@ -103,7 +103,7 @@ Foam::tmp> Foam::fv::optionList::operator() const volScalarField& rho, GeometricField& field, const word& fieldName -) +) const { checkApplied(); @@ -117,7 +117,7 @@ Foam::tmp> Foam::fv::optionList::operator() forAll(*this, i) { - option& source = this->operator[](i); + const option& source = this->operator[](i); label fieldi = source.applyToField(fieldName); @@ -148,7 +148,7 @@ Foam::tmp> Foam::fv::optionList::operator() const volScalarField& alpha, const volScalarField& rho, GeometricField& field -) +) const { return this->operator()(alpha, rho, field, field.name()); } @@ -161,7 +161,7 @@ Foam::tmp> Foam::fv::optionList::operator() const volScalarField& rho, GeometricField& field, const word& fieldName -) +) const { checkApplied(); @@ -176,7 +176,7 @@ Foam::tmp> Foam::fv::optionList::operator() forAll(*this, i) { - option& source = this->operator[](i); + const option& source = this->operator[](i); label fieldi = source.applyToField(fieldName); @@ -207,7 +207,7 @@ Foam::tmp> Foam::fv::optionList::operator() const geometricOneField& alpha, const geometricOneField& rho, GeometricField& field -) +) const { return this->operator()(field, field.name()); } @@ -219,7 +219,7 @@ Foam::tmp> Foam::fv::optionList::operator() const volScalarField& alpha, const geometricOneField& rho, GeometricField& field -) +) const { volScalarField one ( @@ -246,7 +246,7 @@ Foam::tmp> Foam::fv::optionList::operator() const geometricOneField& alpha, const volScalarField& rho, GeometricField& field -) +) const { return this->operator()(rho, field, field.name()); } @@ -256,7 +256,7 @@ template Foam::tmp> Foam::fv::optionList::d2dt2 ( GeometricField& field -) +) const { return this->d2dt2(field, field.name()); } @@ -267,20 +267,20 @@ Foam::tmp> Foam::fv::optionList::d2dt2 ( GeometricField& field, const word& fieldName -) +) const { return source(field, fieldName, field.dimensions()/sqr(dimTime)*dimVolume); } template -void Foam::fv::optionList::constrain(fvMatrix& eqn) +void Foam::fv::optionList::constrain(fvMatrix& eqn) const { checkApplied(); forAll(*this, i) { - option& source = this->operator[](i); + const option& source = this->operator[](i); label fieldi = source.applyToField(eqn.psi().name()); @@ -307,13 +307,13 @@ template void Foam::fv::optionList::correct ( GeometricField& field -) +) const { const word& fieldName = field.name(); forAll(*this, i) { - option& source = this->operator[](i); + const option& source = this->operator[](i); label fieldi = source.applyToField(fieldName); diff --git a/src/finiteVolume/cfdTools/general/fvOptions/fvOptions.H b/src/finiteVolume/cfdTools/general/fvOptions/fvOptions.H index ec8b444be5..4607d7d18f 100644 --- a/src/finiteVolume/cfdTools/general/fvOptions/fvOptions.H +++ b/src/finiteVolume/cfdTools/general/fvOptions/fvOptions.H @@ -75,17 +75,7 @@ public: //- Disallow default bitwise copy construction options(const options&) = delete; - // using MeshObject::New; - - //- Construct fvOptions and register to datbase if not present - // otherwise lookup and return - static options& New(const fvMesh& mesh) - { - return const_cast - ( - MeshObject::New(mesh) - ); - } + using MeshObject::New; //- Destructor diff --git a/src/finiteVolume/cfdTools/general/include/createFvOptions.H b/src/finiteVolume/cfdTools/general/include/createFvOptions.H index 796362fadd..d42c3b5b33 100644 --- a/src/finiteVolume/cfdTools/general/include/createFvOptions.H +++ b/src/finiteVolume/cfdTools/general/include/createFvOptions.H @@ -1,4 +1,4 @@ -fv::options& fvOptions(fv::options::New(mesh)); +const fv::options& fvOptions(fv::options::New(mesh)); if (!fvOptions.optionList::size()) { diff --git a/src/fvOptions/cellSetOption/cellSetOption.C b/src/fvOptions/cellSetOption/cellSetOption.C index 73a63d90a7..3c46116c7e 100644 --- a/src/fvOptions/cellSetOption/cellSetOption.C +++ b/src/fvOptions/cellSetOption/cellSetOption.C @@ -215,7 +215,7 @@ Foam::fv::cellSetOption::~cellSetOption() // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -bool Foam::fv::cellSetOption::isActive() +bool Foam::fv::cellSetOption::isActive() const { if (option::isActive() && inTimeLimits(mesh_.time().value())) { diff --git a/src/fvOptions/cellSetOption/cellSetOption.H b/src/fvOptions/cellSetOption/cellSetOption.H index d028d4c420..be8b6d1532 100644 --- a/src/fvOptions/cellSetOption/cellSetOption.H +++ b/src/fvOptions/cellSetOption/cellSetOption.H @@ -185,7 +185,7 @@ public: // Checks //- Is the source active? - virtual bool isActive(); + virtual bool isActive() const; // Mesh changes diff --git a/src/fvOptions/constraints/fixedTemperatureConstraint/fixedTemperatureConstraint.C b/src/fvOptions/constraints/fixedTemperatureConstraint/fixedTemperatureConstraint.C index b087da8f07..2747023e5a 100644 --- a/src/fvOptions/constraints/fixedTemperatureConstraint/fixedTemperatureConstraint.C +++ b/src/fvOptions/constraints/fixedTemperatureConstraint/fixedTemperatureConstraint.C @@ -115,7 +115,7 @@ void Foam::fv::fixedTemperatureConstraint::constrain ( fvMatrix& eqn, const label -) +) const { const basicThermo& thermo = mesh_.lookupObject diff --git a/src/fvOptions/constraints/fixedTemperatureConstraint/fixedTemperatureConstraint.H b/src/fvOptions/constraints/fixedTemperatureConstraint/fixedTemperatureConstraint.H index 0b35085774..a64a27e209 100644 --- a/src/fvOptions/constraints/fixedTemperatureConstraint/fixedTemperatureConstraint.H +++ b/src/fvOptions/constraints/fixedTemperatureConstraint/fixedTemperatureConstraint.H @@ -140,7 +140,11 @@ public: // Member Functions //- Constrain energy equation to fix the temperature - virtual void constrain(fvMatrix& eqn, const label fieldi); + virtual void constrain + ( + fvMatrix& eqn, + const label fieldi + ) const; //- Read dictionary virtual bool read(const dictionary& dict); diff --git a/src/fvOptions/constraints/fixedValueConstraint/FixedValueConstraint.C b/src/fvOptions/constraints/fixedValueConstraint/FixedValueConstraint.C index 869263b48e..125cdb00c0 100644 --- a/src/fvOptions/constraints/fixedValueConstraint/FixedValueConstraint.C +++ b/src/fvOptions/constraints/fixedValueConstraint/FixedValueConstraint.C @@ -81,7 +81,7 @@ void Foam::fv::FixedValueConstraint::constrain ( fvMatrix& eqn, const label fieldi -) +) const { DebugInfo << "FixedValueConstraint<" diff --git a/src/fvOptions/constraints/fixedValueConstraint/FixedValueConstraint.H b/src/fvOptions/constraints/fixedValueConstraint/FixedValueConstraint.H index 35cac863ae..1b13301ded 100644 --- a/src/fvOptions/constraints/fixedValueConstraint/FixedValueConstraint.H +++ b/src/fvOptions/constraints/fixedValueConstraint/FixedValueConstraint.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2016-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2016-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -105,7 +105,7 @@ public: virtual bool read(const dictionary& dict); //- Set value on field - virtual void constrain(fvMatrix& eqn, const label fieldi); + virtual void constrain(fvMatrix& eqn, const label fieldi) const; }; diff --git a/src/fvOptions/corrections/limitTemperature/limitTemperature.C b/src/fvOptions/corrections/limitTemperature/limitTemperature.C index 76dddacfa0..42adbc6347 100644 --- a/src/fvOptions/corrections/limitTemperature/limitTemperature.C +++ b/src/fvOptions/corrections/limitTemperature/limitTemperature.C @@ -92,7 +92,7 @@ bool Foam::fv::limitTemperature::read(const dictionary& dict) } -void Foam::fv::limitTemperature::correct(volScalarField& he) +void Foam::fv::limitTemperature::correct(volScalarField& he) const { const basicThermo& thermo = mesh_.lookupObject diff --git a/src/fvOptions/corrections/limitTemperature/limitTemperature.H b/src/fvOptions/corrections/limitTemperature/limitTemperature.H index 963dfc5c50..5819abb066 100644 --- a/src/fvOptions/corrections/limitTemperature/limitTemperature.H +++ b/src/fvOptions/corrections/limitTemperature/limitTemperature.H @@ -114,7 +114,7 @@ public: virtual bool read(const dictionary& dict); //- Correct the energy field - virtual void correct(volScalarField& he); + virtual void correct(volScalarField& he) const; // Member Operators diff --git a/src/fvOptions/corrections/limitVelocity/limitVelocity.C b/src/fvOptions/corrections/limitVelocity/limitVelocity.C index 72b25cfd92..714be548fc 100644 --- a/src/fvOptions/corrections/limitVelocity/limitVelocity.C +++ b/src/fvOptions/corrections/limitVelocity/limitVelocity.C @@ -80,7 +80,7 @@ bool Foam::fv::limitVelocity::read(const dictionary& dict) } -void Foam::fv::limitVelocity::correct(volVectorField& U) +void Foam::fv::limitVelocity::correct(volVectorField& U) const { const scalar maxSqrU = sqr(max_); diff --git a/src/fvOptions/corrections/limitVelocity/limitVelocity.H b/src/fvOptions/corrections/limitVelocity/limitVelocity.H index 25666babc8..bbd543c8bd 100644 --- a/src/fvOptions/corrections/limitVelocity/limitVelocity.H +++ b/src/fvOptions/corrections/limitVelocity/limitVelocity.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2016-2019 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2016-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -108,7 +108,7 @@ public: virtual bool read(const dictionary& dict); //- Correct the energy field - virtual void correct(volVectorField& U); + virtual void correct(volVectorField& U) const; // Member Operators diff --git a/src/fvOptions/sources/derived/accelerationSource/accelerationSource.C b/src/fvOptions/sources/derived/accelerationSource/accelerationSource.C index 9f94323d34..a585e85506 100644 --- a/src/fvOptions/sources/derived/accelerationSource/accelerationSource.C +++ b/src/fvOptions/sources/derived/accelerationSource/accelerationSource.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2018-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -64,7 +64,7 @@ void Foam::fv::accelerationSource::addSup ( fvMatrix& eqn, const label fieldi -) +) const { add(geometricOneField(), eqn, fieldi); } @@ -75,7 +75,7 @@ void Foam::fv::accelerationSource::addSup const volScalarField& rho, fvMatrix& eqn, const label fieldi -) +) const { add(rho, eqn, fieldi); } @@ -87,7 +87,7 @@ void Foam::fv::accelerationSource::addSup const volScalarField& rho, fvMatrix& eqn, const label fieldi -) +) const { add((alpha*rho)(), eqn, fieldi); } diff --git a/src/fvOptions/sources/derived/accelerationSource/accelerationSource.H b/src/fvOptions/sources/derived/accelerationSource/accelerationSource.H index 26d2d130f9..a7553283df 100644 --- a/src/fvOptions/sources/derived/accelerationSource/accelerationSource.H +++ b/src/fvOptions/sources/derived/accelerationSource/accelerationSource.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2018-2019 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2018-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -89,7 +89,7 @@ class accelerationSource const AlphaRhoFieldType& rho, fvMatrix& eqn, const label fieldi - ); + ) const; public: @@ -124,7 +124,7 @@ public: ( fvMatrix& eqn, const label fieldi - ); + ) const; //- Source term to compressible momentum equation virtual void addSup @@ -132,7 +132,7 @@ public: const volScalarField& rho, fvMatrix& eqn, const label fieldi - ); + ) const; //- Source term to phase momentum equation virtual void addSup @@ -141,7 +141,7 @@ public: const volScalarField& rho, fvMatrix& eqn, const label fieldi - ); + ) const; // IO diff --git a/src/fvOptions/sources/derived/accelerationSource/accelerationSourceTemplates.C b/src/fvOptions/sources/derived/accelerationSource/accelerationSourceTemplates.C index b97476691a..41f3bf2ed4 100644 --- a/src/fvOptions/sources/derived/accelerationSource/accelerationSourceTemplates.C +++ b/src/fvOptions/sources/derived/accelerationSource/accelerationSourceTemplates.C @@ -31,7 +31,7 @@ void Foam::fv::accelerationSource::add const AlphaRhoFieldType& alphaRho, fvMatrix& eqn, const label fieldi -) +) const { const DimensionedField& V = mesh_.V(); diff --git a/src/fvOptions/sources/derived/actuationDiskSource/actuationDiskSource.C b/src/fvOptions/sources/derived/actuationDiskSource/actuationDiskSource.C index cc55952505..a638fb7ab6 100644 --- a/src/fvOptions/sources/derived/actuationDiskSource/actuationDiskSource.C +++ b/src/fvOptions/sources/derived/actuationDiskSource/actuationDiskSource.C @@ -113,7 +113,7 @@ void Foam::fv::actuationDiskSource::addSup ( fvMatrix& eqn, const label fieldi -) +) const { const scalarField& cellsV = mesh_.V(); vectorField& Usource = eqn.source(); @@ -138,7 +138,7 @@ void Foam::fv::actuationDiskSource::addSup const volScalarField& rho, fvMatrix& eqn, const label fieldi -) +) const { const scalarField& cellsV = mesh_.V(); vectorField& Usource = eqn.source(); diff --git a/src/fvOptions/sources/derived/actuationDiskSource/actuationDiskSource.H b/src/fvOptions/sources/derived/actuationDiskSource/actuationDiskSource.H index 6510463536..a26a459bda 100644 --- a/src/fvOptions/sources/derived/actuationDiskSource/actuationDiskSource.H +++ b/src/fvOptions/sources/derived/actuationDiskSource/actuationDiskSource.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 @@ -187,7 +187,7 @@ public: ( fvMatrix& eqn, const label fieldi - ); + ) const; //- Source term to compressible momentum equation virtual void addSup @@ -195,7 +195,7 @@ public: const volScalarField& rho, fvMatrix& eqn, const label fieldi - ); + ) const; // IO diff --git a/src/fvOptions/sources/derived/buoyancyEnergy/buoyancyEnergy.C b/src/fvOptions/sources/derived/buoyancyEnergy/buoyancyEnergy.C index e9d8ded786..820faa112a 100644 --- a/src/fvOptions/sources/derived/buoyancyEnergy/buoyancyEnergy.C +++ b/src/fvOptions/sources/derived/buoyancyEnergy/buoyancyEnergy.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2015-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2015-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -77,7 +77,7 @@ void Foam::fv::buoyancyEnergy::addSup const volScalarField& rho, fvMatrix& eqn, const label fieldi -) +) const { const uniformDimensionedVectorField& g = mesh_.lookupObject("g"); diff --git a/src/fvOptions/sources/derived/buoyancyEnergy/buoyancyEnergy.H b/src/fvOptions/sources/derived/buoyancyEnergy/buoyancyEnergy.H index 3a38721bbc..40e1d3f642 100644 --- a/src/fvOptions/sources/derived/buoyancyEnergy/buoyancyEnergy.H +++ b/src/fvOptions/sources/derived/buoyancyEnergy/buoyancyEnergy.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2015-2019 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2015-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -97,7 +97,7 @@ public: const volScalarField& rho, fvMatrix& eqn, const label fieldi - ); + ) const; // IO diff --git a/src/fvOptions/sources/derived/buoyancyForce/buoyancyForce.C b/src/fvOptions/sources/derived/buoyancyForce/buoyancyForce.C index 2aa79cd048..53335fe627 100644 --- a/src/fvOptions/sources/derived/buoyancyForce/buoyancyForce.C +++ b/src/fvOptions/sources/derived/buoyancyForce/buoyancyForce.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2015-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2015-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -86,7 +86,7 @@ void Foam::fv::buoyancyForce::addSup ( fvMatrix& eqn, const label fieldi -) +) const { eqn += g_; } @@ -97,7 +97,7 @@ void Foam::fv::buoyancyForce::addSup const volScalarField& rho, fvMatrix& eqn, const label fieldi -) +) const { eqn += rho*g_; } diff --git a/src/fvOptions/sources/derived/buoyancyForce/buoyancyForce.H b/src/fvOptions/sources/derived/buoyancyForce/buoyancyForce.H index d76141ddae..36e9adecc1 100644 --- a/src/fvOptions/sources/derived/buoyancyForce/buoyancyForce.H +++ b/src/fvOptions/sources/derived/buoyancyForce/buoyancyForce.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2015-2019 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2015-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -95,7 +95,7 @@ public: ( fvMatrix& eqn, const label fieldi - ); + ) const; //- Add explicit contribution to compressible momentum equation virtual void addSup @@ -103,7 +103,7 @@ public: const volScalarField& rho, fvMatrix& eqn, const label fieldi - ); + ) const; // IO diff --git a/src/fvOptions/sources/derived/damping/isotropicDamping/isotropicDamping.C b/src/fvOptions/sources/derived/damping/isotropicDamping/isotropicDamping.C index 7c209e5f50..3a4486adb3 100644 --- a/src/fvOptions/sources/derived/damping/isotropicDamping/isotropicDamping.C +++ b/src/fvOptions/sources/derived/damping/isotropicDamping/isotropicDamping.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2019 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2019-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -46,7 +46,7 @@ void Foam::fv::isotropicDamping::add ( const volScalarField::Internal& forceCoeff, fvMatrix& eqn -) +) const { eqn -= fvm::Sp(forceCoeff, eqn.psi()); eqn += forceCoeff*value_; @@ -76,7 +76,7 @@ void Foam::fv::isotropicDamping::addSup ( fvMatrix& eqn, const label fieldi -) +) const { add(this->forceCoeff(), eqn); } @@ -87,7 +87,7 @@ void Foam::fv::isotropicDamping::addSup const volScalarField& rho, fvMatrix& eqn, const label fieldi -) +) const { add(rho*forceCoeff(), eqn); } @@ -99,7 +99,7 @@ void Foam::fv::isotropicDamping::addSup const volScalarField& rho, fvMatrix& eqn, const label fieldi -) +) const { add(alpha()*rho()*this->forceCoeff(), eqn); } diff --git a/src/fvOptions/sources/derived/damping/isotropicDamping/isotropicDamping.H b/src/fvOptions/sources/derived/damping/isotropicDamping/isotropicDamping.H index da791ac143..d26f96c985 100644 --- a/src/fvOptions/sources/derived/damping/isotropicDamping/isotropicDamping.H +++ b/src/fvOptions/sources/derived/damping/isotropicDamping/isotropicDamping.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2019 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2019-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -129,7 +129,7 @@ class isotropicDamping ( const volScalarField::Internal& forceCoeff, fvMatrix& eqn - ); + ) const; public: @@ -164,7 +164,7 @@ public: ( fvMatrix& eqn, const label fieldi - ); + ) const; //- Source term to compressible momentum equation virtual void addSup @@ -172,7 +172,7 @@ public: const volScalarField& rho, fvMatrix& eqn, const label fieldi - ); + ) const; //- Source term to phase momentum equation virtual void addSup @@ -181,7 +181,7 @@ public: const volScalarField& rho, fvMatrix& eqn, const label fieldi - ); + ) const; // IO diff --git a/src/fvOptions/sources/derived/damping/verticalDamping/verticalDamping.C b/src/fvOptions/sources/derived/damping/verticalDamping/verticalDamping.C index 133056bdf4..2cc981cf40 100644 --- a/src/fvOptions/sources/derived/damping/verticalDamping/verticalDamping.C +++ b/src/fvOptions/sources/derived/damping/verticalDamping/verticalDamping.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2017-2019 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2017-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -46,7 +46,7 @@ void Foam::fv::verticalDamping::add ( const volVectorField& alphaRhoU, fvMatrix& eqn -) +) const { const uniformDimensionedVectorField& g = mesh_.lookupObject("g"); @@ -79,7 +79,7 @@ void Foam::fv::verticalDamping::addSup ( fvMatrix& eqn, const label fieldi -) +) const { add(eqn.psi(), eqn); } @@ -90,7 +90,7 @@ void Foam::fv::verticalDamping::addSup const volScalarField& rho, fvMatrix& eqn, const label fieldi -) +) const { add(rho*eqn.psi(), eqn); } @@ -102,7 +102,7 @@ void Foam::fv::verticalDamping::addSup const volScalarField& rho, fvMatrix& eqn, const label fieldi -) +) const { add(alpha*rho*eqn.psi(), eqn); } diff --git a/src/fvOptions/sources/derived/damping/verticalDamping/verticalDamping.H b/src/fvOptions/sources/derived/damping/verticalDamping/verticalDamping.H index 90ff917786..165730ff7a 100644 --- a/src/fvOptions/sources/derived/damping/verticalDamping/verticalDamping.H +++ b/src/fvOptions/sources/derived/damping/verticalDamping/verticalDamping.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2017-2019 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2017-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -133,7 +133,7 @@ class verticalDamping ( const volVectorField& alphaRhoU, fvMatrix& eqn - ); + ) const; public: @@ -168,7 +168,7 @@ public: ( fvMatrix& eqn, const label fieldi - ); + ) const; //- Source term to compressible momentum equation virtual void addSup @@ -176,7 +176,7 @@ public: const volScalarField& rho, fvMatrix& eqn, const label fieldi - ); + ) const; //- Source term to phase momentum equation virtual void addSup @@ -185,7 +185,7 @@ public: const volScalarField& rho, fvMatrix& eqn, const label fieldi - ); + ) const; }; diff --git a/src/fvOptions/sources/derived/effectivenessHeatExchangerSource/effectivenessHeatExchangerSource.C b/src/fvOptions/sources/derived/effectivenessHeatExchangerSource/effectivenessHeatExchangerSource.C index 1d602b54ba..354e6c0bb8 100644 --- a/src/fvOptions/sources/derived/effectivenessHeatExchangerSource/effectivenessHeatExchangerSource.C +++ b/src/fvOptions/sources/derived/effectivenessHeatExchangerSource/effectivenessHeatExchangerSource.C @@ -121,7 +121,7 @@ void Foam::fv::effectivenessHeatExchangerSource::initialise() void Foam::fv::effectivenessHeatExchangerSource::calculateTotalArea ( scalar& area -) +) const { area = 0; forAll(faceId_, i) @@ -198,7 +198,7 @@ void Foam::fv::effectivenessHeatExchangerSource::addSup const volScalarField& rho, fvMatrix& eqn, const label -) +) const { const basicThermo& thermo = mesh_.lookupObject(basicThermo::dictName); diff --git a/src/fvOptions/sources/derived/effectivenessHeatExchangerSource/effectivenessHeatExchangerSource.H b/src/fvOptions/sources/derived/effectivenessHeatExchangerSource/effectivenessHeatExchangerSource.H index 6716b1f46f..bbaf88e750 100644 --- a/src/fvOptions/sources/derived/effectivenessHeatExchangerSource/effectivenessHeatExchangerSource.H +++ b/src/fvOptions/sources/derived/effectivenessHeatExchangerSource/effectivenessHeatExchangerSource.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2013-2019 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -201,7 +201,7 @@ private: void initialise(); //- Calculate total area of faceZone across processors - void calculateTotalArea(scalar& area); + void calculateTotalArea(scalar& area) const; public: @@ -242,7 +242,7 @@ public: ( fvMatrix& eqn, const label fieldi - ) + ) const { NotImplemented; } @@ -256,7 +256,7 @@ public: const volScalarField& rho, fvMatrix& eqn, const label fieldi - ); + ) const; // IO diff --git a/src/fvOptions/sources/derived/explicitPorositySource/explicitPorositySource.C b/src/fvOptions/sources/derived/explicitPorositySource/explicitPorositySource.C index 61dd0a0cb8..44c816b5f9 100644 --- a/src/fvOptions/sources/derived/explicitPorositySource/explicitPorositySource.C +++ b/src/fvOptions/sources/derived/explicitPorositySource/explicitPorositySource.C @@ -80,7 +80,7 @@ void Foam::fv::explicitPorositySource::addSup ( fvMatrix& eqn, const label fieldi -) +) const { fvMatrix porosityEqn(eqn.psi(), eqn.dimensions()); porosityPtr_->addResistance(porosityEqn); @@ -93,7 +93,7 @@ void Foam::fv::explicitPorositySource::addSup const volScalarField& rho, fvMatrix& eqn, const label fieldi -) +) const { fvMatrix porosityEqn(eqn.psi(), eqn.dimensions()); porosityPtr_->addResistance(porosityEqn); @@ -107,7 +107,7 @@ void Foam::fv::explicitPorositySource::addSup const volScalarField& rho, fvMatrix& eqn, const label fieldi -) +) const { fvMatrix porosityEqn(eqn.psi(), eqn.dimensions()); porosityPtr_->addResistance(porosityEqn); diff --git a/src/fvOptions/sources/derived/explicitPorositySource/explicitPorositySource.H b/src/fvOptions/sources/derived/explicitPorositySource/explicitPorositySource.H index 486b6dbdd8..ee13ce6502 100644 --- a/src/fvOptions/sources/derived/explicitPorositySource/explicitPorositySource.H +++ b/src/fvOptions/sources/derived/explicitPorositySource/explicitPorositySource.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 @@ -91,7 +91,7 @@ protected: // Protected data //- Run-time selectable porosity model - autoPtr porosityPtr_; + mutable autoPtr porosityPtr_; public: @@ -134,7 +134,7 @@ public: ( fvMatrix& eqn, const label fieldi - ); + ) const; //- Add implicit contribution to compressible momentum equation virtual void addSup @@ -142,7 +142,7 @@ public: const volScalarField& rho, fvMatrix& eqn, const label fieldi - ); + ) const; //- Add implicit contribution to phase momentum equation virtual void addSup @@ -151,7 +151,7 @@ public: const volScalarField& rho, fvMatrix& eqn, const label fieldi - ); + ) const; // IO diff --git a/src/fvOptions/sources/derived/meanVelocityForce/meanVelocityForce.C b/src/fvOptions/sources/derived/meanVelocityForce/meanVelocityForce.C index efdd63ba5d..0188774277 100644 --- a/src/fvOptions/sources/derived/meanVelocityForce/meanVelocityForce.C +++ b/src/fvOptions/sources/derived/meanVelocityForce/meanVelocityForce.C @@ -147,7 +147,7 @@ Foam::scalar Foam::fv::meanVelocityForce::magUbarAve } -void Foam::fv::meanVelocityForce::correct(volVectorField& U) +void Foam::fv::meanVelocityForce::correct(volVectorField& U) const { const scalarField& rAU = rAPtr_(); @@ -195,7 +195,7 @@ void Foam::fv::meanVelocityForce::addSup ( fvMatrix& eqn, const label fieldi -) +) const { volVectorField::Internal Su ( @@ -224,7 +224,7 @@ void Foam::fv::meanVelocityForce::addSup const volScalarField& rho, fvMatrix& eqn, const label fieldi -) +) const { this->addSup(eqn, fieldi); } @@ -234,7 +234,7 @@ void Foam::fv::meanVelocityForce::constrain ( fvMatrix& eqn, const label -) +) const { if (rAPtr_.empty()) { diff --git a/src/fvOptions/sources/derived/meanVelocityForce/meanVelocityForce.H b/src/fvOptions/sources/derived/meanVelocityForce/meanVelocityForce.H index 8cc64818b9..fd858470d7 100644 --- a/src/fvOptions/sources/derived/meanVelocityForce/meanVelocityForce.H +++ b/src/fvOptions/sources/derived/meanVelocityForce/meanVelocityForce.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 @@ -77,10 +77,10 @@ protected: vector Ubar_; //- Pressure gradient before correction - scalar gradP0_; + mutable scalar gradP0_; //- Change in pressure gradient - scalar dGradP_; + mutable scalar dGradP_; //- Flow direction vector flowDir_; @@ -89,7 +89,7 @@ protected: scalar relaxation_; //- Matrix 1/A coefficients field pointer - autoPtr rAPtr_; + mutable autoPtr rAPtr_; // Protected Member Functions @@ -102,7 +102,7 @@ protected: void writeProps(const scalar gradP) const; //- Correct driving force for a constant mass flow rate - void update(fvMatrix& eqn); + void update(fvMatrix& eqn) const; public: @@ -131,14 +131,14 @@ public: // Evaluate //- Correct the pressure gradient - virtual void correct(volVectorField& U); + virtual void correct(volVectorField& U) const; //- Add explicit contribution to momentum equation virtual void addSup ( fvMatrix& eqn, const label fieldi - ); + ) const; //- Add explicit contribution to compressible momentum equation virtual void addSup @@ -146,14 +146,14 @@ public: const volScalarField& rho, fvMatrix& eqn, const label fieldi - ); + ) const; //- Set 1/A coefficient virtual void constrain ( fvMatrix& eqn, const label fieldi - ); + ) const; // IO diff --git a/src/fvOptions/sources/derived/phaseLimitStabilization/PhaseLimitStabilization.C b/src/fvOptions/sources/derived/phaseLimitStabilization/PhaseLimitStabilization.C index ee57f3190e..18de0ccce5 100644 --- a/src/fvOptions/sources/derived/phaseLimitStabilization/PhaseLimitStabilization.C +++ b/src/fvOptions/sources/derived/phaseLimitStabilization/PhaseLimitStabilization.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2017-2019 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2017-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -58,7 +58,7 @@ void Foam::fv::PhaseLimitStabilization::addSup const volScalarField& rho, fvMatrix& eqn, const label fieldi -) +) const { const GeometricField& psi = eqn.psi(); diff --git a/src/fvOptions/sources/derived/phaseLimitStabilization/PhaseLimitStabilization.H b/src/fvOptions/sources/derived/phaseLimitStabilization/PhaseLimitStabilization.H index b966fe1f73..55fad3ecb1 100644 --- a/src/fvOptions/sources/derived/phaseLimitStabilization/PhaseLimitStabilization.H +++ b/src/fvOptions/sources/derived/phaseLimitStabilization/PhaseLimitStabilization.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2017-2019 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2017-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -122,7 +122,7 @@ public: const volScalarField& rho, fvMatrix& eqn, const label fieldi - ); + ) const; //- Read dictionary virtual bool read(const dictionary& dict); diff --git a/src/fvOptions/sources/derived/radialActuationDiskSource/radialActuationDiskSource.C b/src/fvOptions/sources/derived/radialActuationDiskSource/radialActuationDiskSource.C index f530e72f17..1b6879d70d 100644 --- a/src/fvOptions/sources/derived/radialActuationDiskSource/radialActuationDiskSource.C +++ b/src/fvOptions/sources/derived/radialActuationDiskSource/radialActuationDiskSource.C @@ -66,7 +66,7 @@ void Foam::fv::radialActuationDiskSource::addSup ( fvMatrix& eqn, const label fieldi -) +) const { const scalarField& cellsV = mesh_.V(); vectorField& Usource = eqn.source(); @@ -91,7 +91,7 @@ void Foam::fv::radialActuationDiskSource::addSup const volScalarField& rho, fvMatrix& eqn, const label fieldi -) +) const { const scalarField& cellsV = mesh_.V(); vectorField& Usource = eqn.source(); diff --git a/src/fvOptions/sources/derived/radialActuationDiskSource/radialActuationDiskSource.H b/src/fvOptions/sources/derived/radialActuationDiskSource/radialActuationDiskSource.H index fb5f99f0c1..791d241ba0 100644 --- a/src/fvOptions/sources/derived/radialActuationDiskSource/radialActuationDiskSource.H +++ b/src/fvOptions/sources/derived/radialActuationDiskSource/radialActuationDiskSource.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 @@ -143,7 +143,7 @@ public: ( fvMatrix& eqn, const label fieldi - ); + ) const; //- Source term to compressible momentum equation virtual void addSup @@ -151,7 +151,7 @@ public: const volScalarField& rho, fvMatrix& eqn, const label fieldi - ); + ) const; // IO diff --git a/src/fvOptions/sources/derived/rotorDiskSource/rotorDiskSource.C b/src/fvOptions/sources/derived/rotorDiskSource/rotorDiskSource.C index ce25aec6ae..5a16dff032 100644 --- a/src/fvOptions/sources/derived/rotorDiskSource/rotorDiskSource.C +++ b/src/fvOptions/sources/derived/rotorDiskSource/rotorDiskSource.C @@ -513,7 +513,7 @@ void Foam::fv::rotorDiskSource::addSup ( fvMatrix& eqn, const label fieldi -) +) const { volVectorField force ( @@ -554,7 +554,7 @@ void Foam::fv::rotorDiskSource::addSup const volScalarField& rho, fvMatrix& eqn, const label fieldi -) +) const { volVectorField force ( diff --git a/src/fvOptions/sources/derived/rotorDiskSource/rotorDiskSource.H b/src/fvOptions/sources/derived/rotorDiskSource/rotorDiskSource.H index 32e4043a81..2c10ad1fad 100644 --- a/src/fvOptions/sources/derived/rotorDiskSource/rotorDiskSource.H +++ b/src/fvOptions/sources/derived/rotorDiskSource/rotorDiskSource.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 @@ -158,7 +158,7 @@ protected: // Protected data //- Reference density for incompressible case - scalar rhoRef_; + mutable scalar rhoRef_; //- Rotational speed [rad/s] // Positive anti-clockwise when looking along -ve lift direction @@ -303,7 +303,7 @@ public: ( fvMatrix& eqn, const label fieldi - ); + ) const; //- Source term to compressible momentum equation virtual void addSup @@ -311,7 +311,7 @@ public: const volScalarField& rho, fvMatrix& eqn, const label fieldi - ); + ) const; // IO diff --git a/src/fvOptions/sources/derived/rotorDiskSource/trimModel/fixed/fixedTrim.C b/src/fvOptions/sources/derived/rotorDiskSource/trimModel/fixed/fixedTrim.C index b8dafeb650..1c1a3210b1 100644 --- a/src/fvOptions/sources/derived/rotorDiskSource/trimModel/fixed/fixedTrim.C +++ b/src/fvOptions/sources/derived/rotorDiskSource/trimModel/fixed/fixedTrim.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 @@ -90,7 +90,7 @@ void Foam::fixedTrim::correct ( const vectorField& U, vectorField& force -) +) const {} @@ -98,7 +98,8 @@ void Foam::fixedTrim::correct ( const volScalarField rho, const vectorField& U, - vectorField& force) + vectorField& force +) const {} diff --git a/src/fvOptions/sources/derived/rotorDiskSource/trimModel/fixed/fixedTrim.H b/src/fvOptions/sources/derived/rotorDiskSource/trimModel/fixed/fixedTrim.H index b78433d796..c18fe28d9c 100644 --- a/src/fvOptions/sources/derived/rotorDiskSource/trimModel/fixed/fixedTrim.H +++ b/src/fvOptions/sources/derived/rotorDiskSource/trimModel/fixed/fixedTrim.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 @@ -84,7 +84,7 @@ public: ( const vectorField& U, vectorField& force - ); + ) const; //- Correct the model for compressible flow virtual void correct @@ -92,7 +92,7 @@ public: const volScalarField rho, const vectorField& U, vectorField& force - ); + ) const; }; diff --git a/src/fvOptions/sources/derived/rotorDiskSource/trimModel/targetCoeff/targetCoeffTrim.C b/src/fvOptions/sources/derived/rotorDiskSource/trimModel/targetCoeff/targetCoeffTrim.C index 0f1b1ff9ec..460b7c503d 100644 --- a/src/fvOptions/sources/derived/rotorDiskSource/trimModel/targetCoeff/targetCoeffTrim.C +++ b/src/fvOptions/sources/derived/rotorDiskSource/trimModel/targetCoeff/targetCoeffTrim.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 @@ -101,7 +101,7 @@ void Foam::targetCoeffTrim::correctTrim const RhoFieldType& rho, const vectorField& U, vectorField& force -) +) const { if (rotor_.mesh().time().timeIndex() % calcFrequency_ == 0) { @@ -276,7 +276,7 @@ void Foam::targetCoeffTrim::correct ( const vectorField& U, vectorField& force -) +) const { correctTrim(geometricOneField(), U, force); } @@ -287,7 +287,7 @@ void Foam::targetCoeffTrim::correct const volScalarField rho, const vectorField& U, vectorField& force -) +) const { correctTrim(rho, U, force); } diff --git a/src/fvOptions/sources/derived/rotorDiskSource/trimModel/targetCoeff/targetCoeffTrim.H b/src/fvOptions/sources/derived/rotorDiskSource/trimModel/targetCoeff/targetCoeffTrim.H index 21f94cd731..2cbbcdf27e 100644 --- a/src/fvOptions/sources/derived/rotorDiskSource/trimModel/targetCoeff/targetCoeffTrim.H +++ b/src/fvOptions/sources/derived/rotorDiskSource/trimModel/targetCoeff/targetCoeffTrim.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 @@ -104,7 +104,7 @@ protected: vector target_; //- Pitch angles (collective, roll, pitch) [rad] - vector theta_; + mutable vector theta_; //- Maximum number of iterations in trim routine label nIter_; @@ -141,7 +141,7 @@ protected: const RhoFieldType& rho, const vectorField& U, vectorField& force - ); + ) const; public: @@ -169,7 +169,7 @@ public: ( const vectorField& U, vectorField& force - ); + ) const; //- Correct the model for compressible flow virtual void correct @@ -177,7 +177,7 @@ public: const volScalarField rho, const vectorField& U, vectorField& force - ); + ) const; }; diff --git a/src/fvOptions/sources/derived/rotorDiskSource/trimModel/trimModel/trimModel.H b/src/fvOptions/sources/derived/rotorDiskSource/trimModel/trimModel/trimModel.H index 4ab22d0058..f1bda92285 100644 --- a/src/fvOptions/sources/derived/rotorDiskSource/trimModel/trimModel/trimModel.H +++ b/src/fvOptions/sources/derived/rotorDiskSource/trimModel/trimModel/trimModel.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 @@ -124,7 +124,7 @@ public: ( const vectorField& U, vectorField& force - ) = 0; + ) const = 0; //- Correct the model for compressible flow virtual void correct @@ -132,7 +132,7 @@ public: const volScalarField rho, const vectorField& U, vectorField& force - ) = 0; + ) const = 0; }; diff --git a/src/fvOptions/sources/derived/solidEquilibriumEnergySource/solidEquilibriumEnergySource.C b/src/fvOptions/sources/derived/solidEquilibriumEnergySource/solidEquilibriumEnergySource.C index e5f8ee3c53..0474594089 100644 --- a/src/fvOptions/sources/derived/solidEquilibriumEnergySource/solidEquilibriumEnergySource.C +++ b/src/fvOptions/sources/derived/solidEquilibriumEnergySource/solidEquilibriumEnergySource.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2019 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2019-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -123,7 +123,7 @@ void Foam::fv::solidEquilibriumEnergySource::addSup const volScalarField& rho, fvMatrix& eqn, const label fieldi -) +) const { const volScalarField alphahe(thermo().alphahe()); @@ -147,7 +147,7 @@ void Foam::fv::solidEquilibriumEnergySource::addSup const volScalarField& rho, fvMatrix& eqn, const label fieldi -) +) const { const volScalarField alphahe(alpha*thermo().alphahe()); diff --git a/src/fvOptions/sources/derived/solidEquilibriumEnergySource/solidEquilibriumEnergySource.H b/src/fvOptions/sources/derived/solidEquilibriumEnergySource/solidEquilibriumEnergySource.H index d27fdc2fe3..c56e49b290 100644 --- a/src/fvOptions/sources/derived/solidEquilibriumEnergySource/solidEquilibriumEnergySource.H +++ b/src/fvOptions/sources/derived/solidEquilibriumEnergySource/solidEquilibriumEnergySource.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2019 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2019-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -125,7 +125,7 @@ public: const volScalarField&, fvMatrix&, const label - ); + ) const; //- Explicit and implicit sources for phase equations virtual void addSup @@ -134,7 +134,7 @@ public: const volScalarField&, fvMatrix&, const label - ); + ) const; // IO diff --git a/src/fvOptions/sources/derived/solidificationMeltingSource/solidificationMeltingSource.C b/src/fvOptions/sources/derived/solidificationMeltingSource/solidificationMeltingSource.C index 4aa5973f3a..c15ad6da71 100644 --- a/src/fvOptions/sources/derived/solidificationMeltingSource/solidificationMeltingSource.C +++ b/src/fvOptions/sources/derived/solidificationMeltingSource/solidificationMeltingSource.C @@ -131,7 +131,10 @@ Foam::vector Foam::fv::solidificationMeltingSource::g() const } -void Foam::fv::solidificationMeltingSource::update(const volScalarField& Cp) +void Foam::fv::solidificationMeltingSource::update +( + const volScalarField& Cp +) const { if (curTimeIndex_ == mesh_.time().timeIndex()) { @@ -264,7 +267,7 @@ void Foam::fv::solidificationMeltingSource::addSup ( fvMatrix& eqn, const label fieldi -) +) const { apply(geometricOneField(), eqn); } @@ -275,7 +278,7 @@ void Foam::fv::solidificationMeltingSource::addSup const volScalarField& rho, fvMatrix& eqn, const label fieldi -) +) const { apply(rho, eqn); } @@ -285,7 +288,7 @@ void Foam::fv::solidificationMeltingSource::addSup ( fvMatrix& eqn, const label fieldi -) +) const { if (debug) { @@ -325,7 +328,7 @@ void Foam::fv::solidificationMeltingSource::addSup const volScalarField& rho, fvMatrix& eqn, const label fieldi -) +) const { // Momentum source uses a Boussinesq approximation - redirect addSup(eqn, fieldi); diff --git a/src/fvOptions/sources/derived/solidificationMeltingSource/solidificationMeltingSource.H b/src/fvOptions/sources/derived/solidificationMeltingSource/solidificationMeltingSource.H index 210fd26fb0..f2a8306cfe 100644 --- a/src/fvOptions/sources/derived/solidificationMeltingSource/solidificationMeltingSource.H +++ b/src/fvOptions/sources/derived/solidificationMeltingSource/solidificationMeltingSource.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2014-2019 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -203,13 +203,13 @@ private: scalar beta_; //- Phase fraction indicator field - volScalarField alpha1_; + mutable volScalarField alpha1_; //- Current time index (used for updating) - label curTimeIndex_; + mutable label curTimeIndex_; //- Temperature change cached for source calculation when alpha1 updated - scalarField deltaT_; + mutable scalarField deltaT_; // Private Member Functions @@ -221,11 +221,11 @@ private: vector g() const; //- Update the model - void update(const volScalarField& Cp); + void update(const volScalarField& Cp) const; //- Helper function to apply to the energy equation template - void apply(const RhoFieldType& rho, fvMatrix& eqn); + void apply(const RhoFieldType& rho, fvMatrix& eqn) const; public: @@ -257,10 +257,18 @@ public: // Add explicit and implicit contributions //- Add explicit contribution to enthalpy equation - virtual void addSup(fvMatrix& eqn, const label fieldi); + virtual void addSup + ( + fvMatrix& eqn, + const label fieldi + ) const; //- Add implicit contribution to momentum equation - virtual void addSup(fvMatrix& eqn, const label fieldi); + virtual void addSup + ( + fvMatrix& eqn, + const label fieldi + ) const; // Add explicit and implicit contributions to compressible equation @@ -271,7 +279,7 @@ public: const volScalarField& rho, fvMatrix& eqn, const label fieldi - ); + ) const; //- Add implicit contribution to compressible momentum equation virtual void addSup @@ -279,7 +287,7 @@ public: const volScalarField& rho, fvMatrix& eqn, const label fieldi - ); + ) const; // IO diff --git a/src/fvOptions/sources/derived/solidificationMeltingSource/solidificationMeltingSourceTemplates.C b/src/fvOptions/sources/derived/solidificationMeltingSource/solidificationMeltingSourceTemplates.C index 0b7b412497..eeb9c097a3 100644 --- a/src/fvOptions/sources/derived/solidificationMeltingSource/solidificationMeltingSourceTemplates.C +++ b/src/fvOptions/sources/derived/solidificationMeltingSource/solidificationMeltingSourceTemplates.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2014-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -33,7 +33,7 @@ void Foam::fv::solidificationMeltingSource::apply ( const RhoFieldType& rho, fvMatrix& eqn -) +) const { if (debug) { diff --git a/src/fvOptions/sources/derived/tabulatedAccelerationSource/tabulatedAccelerationSource.C b/src/fvOptions/sources/derived/tabulatedAccelerationSource/tabulatedAccelerationSource.C index a5c2eba62b..32b215f4a9 100644 --- a/src/fvOptions/sources/derived/tabulatedAccelerationSource/tabulatedAccelerationSource.C +++ b/src/fvOptions/sources/derived/tabulatedAccelerationSource/tabulatedAccelerationSource.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2015-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2015-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -77,7 +77,7 @@ void Foam::fv::tabulatedAccelerationSource::addSup ( fvMatrix& eqn, const label fieldi -) +) const { addSup(geometricOneField(), eqn, fieldi); } @@ -88,7 +88,7 @@ void Foam::fv::tabulatedAccelerationSource::addSup const volScalarField& rho, fvMatrix& eqn, const label fieldi -) +) const { addSup(rho, eqn, fieldi); } diff --git a/src/fvOptions/sources/derived/tabulatedAccelerationSource/tabulatedAccelerationSource.H b/src/fvOptions/sources/derived/tabulatedAccelerationSource/tabulatedAccelerationSource.H index 0d90ed99a1..0afe05be1b 100644 --- a/src/fvOptions/sources/derived/tabulatedAccelerationSource/tabulatedAccelerationSource.H +++ b/src/fvOptions/sources/derived/tabulatedAccelerationSource/tabulatedAccelerationSource.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2015-2019 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2015-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -79,6 +79,7 @@ protected: dimensionedVector g0_; + private: // Private Member Functions @@ -90,7 +91,7 @@ private: const RhoFieldType& rho, fvMatrix& eqn, const label fieldi - ); + ) const; public: @@ -129,7 +130,7 @@ public: ( fvMatrix& eqn, const label fieldi - ); + ) const; //- Source term to compressible momentum equation virtual void addSup @@ -137,7 +138,7 @@ public: const volScalarField& rho, fvMatrix& eqn, const label fieldi - ); + ) const; //- Read dictionary virtual bool read(const dictionary& dict); diff --git a/src/fvOptions/sources/derived/tabulatedAccelerationSource/tabulatedAccelerationSourceTemplates.C b/src/fvOptions/sources/derived/tabulatedAccelerationSource/tabulatedAccelerationSourceTemplates.C index e3c43f3d24..12f4bcaea4 100644 --- a/src/fvOptions/sources/derived/tabulatedAccelerationSource/tabulatedAccelerationSourceTemplates.C +++ b/src/fvOptions/sources/derived/tabulatedAccelerationSource/tabulatedAccelerationSourceTemplates.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2015-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2015-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -36,7 +36,7 @@ void Foam::fv::tabulatedAccelerationSource::addSup const RhoFieldType& rho, fvMatrix& eqn, const label fieldi -) +) const { Vector acceleration(motion_.acceleration()); diff --git a/src/fvOptions/sources/derived/volumeFractionSource/volumeFractionSource.C b/src/fvOptions/sources/derived/volumeFractionSource/volumeFractionSource.C index 2004567b99..1a26927c1c 100644 --- a/src/fvOptions/sources/derived/volumeFractionSource/volumeFractionSource.C +++ b/src/fvOptions/sources/derived/volumeFractionSource/volumeFractionSource.C @@ -125,7 +125,7 @@ void Foam::fv::volumeFractionSource::addDivSup ( fvMatrix& eqn, const label fieldi -) +) const { const surfaceScalarField& phi = mesh().lookupObject(phiName_); @@ -140,7 +140,7 @@ void Foam::fv::volumeFractionSource::addUDivSup ( fvMatrix& eqn, const label fieldi -) +) const { const surfaceScalarField& phi = mesh().lookupObject(phiName_); @@ -157,7 +157,7 @@ void Foam::fv::volumeFractionSource::addRhoDivSup ( fvMatrix& eqn, const label fieldi -) +) const { const surfaceScalarField& phi = mesh().lookupObject(phiName_); @@ -174,7 +174,7 @@ void Foam::fv::volumeFractionSource::addLaplacianSup const AlphaFieldType& alpha, fvMatrix& eqn, const label fieldi -) +) const { const volScalarField B(1 - this->alpha()); @@ -220,7 +220,7 @@ void Foam::fv::volumeFractionSource::addSup ( fvMatrix& eqn, const label fieldi -) +) const { if (fieldNames_[fieldi] == rhoName_) { @@ -238,7 +238,7 @@ void Foam::fv::volumeFractionSource::addSup ( fvMatrix& eqn, const label fieldi -) +) const { if (fieldNames_[fieldi] == UName_) { @@ -256,7 +256,7 @@ void Foam::fv::volumeFractionSource::addSup ( fvMatrix& eqn, const label fieldi -) +) const { addDivSup(eqn, fieldi); addLaplacianSup(geometricOneField(), eqn, fieldi); @@ -267,7 +267,7 @@ void Foam::fv::volumeFractionSource::addSup ( fvMatrix& eqn, const label fieldi -) +) const { addDivSup(eqn, fieldi); addLaplacianSup(geometricOneField(), eqn, fieldi); @@ -278,7 +278,7 @@ void Foam::fv::volumeFractionSource::addSup ( fvMatrix& eqn, const label fieldi -) +) const { addDivSup(eqn, fieldi); addLaplacianSup(geometricOneField(), eqn, fieldi); @@ -290,7 +290,7 @@ void Foam::fv::volumeFractionSource::addSup const volScalarField& rho, fvMatrix& eqn, const label fieldi -) +) const { if (fieldNames_[fieldi] == rhoName_) { @@ -309,7 +309,7 @@ void Foam::fv::volumeFractionSource::addSup const volScalarField& rho, fvMatrix& eqn, const label fieldi -) +) const { if (fieldNames_[fieldi] == UName_) { @@ -328,7 +328,7 @@ void Foam::fv::volumeFractionSource::addSup const volScalarField& rho, fvMatrix& eqn, const label fieldi -) +) const { addDivSup(eqn, fieldi); addLaplacianSup(geometricOneField(), eqn, fieldi); @@ -340,7 +340,7 @@ void Foam::fv::volumeFractionSource::addSup const volScalarField& rho, fvMatrix& eqn, const label fieldi -) +) const { addDivSup(eqn, fieldi); addLaplacianSup(geometricOneField(), eqn, fieldi); @@ -352,7 +352,7 @@ void Foam::fv::volumeFractionSource::addSup const volScalarField& rho, fvMatrix& eqn, const label fieldi -) +) const { addDivSup(eqn, fieldi); addLaplacianSup(geometricOneField(), eqn, fieldi); @@ -365,7 +365,7 @@ void Foam::fv::volumeFractionSource::addSup const volScalarField& rho, fvMatrix& eqn, const label fieldi -) +) const { if (fieldNames_[fieldi] == rhoName_) { @@ -385,7 +385,7 @@ void Foam::fv::volumeFractionSource::addSup const volScalarField& rho, fvMatrix& eqn, const label fieldi -) +) const { if (fieldNames_[fieldi] == UName_) { @@ -405,7 +405,7 @@ void Foam::fv::volumeFractionSource::addSup const volScalarField& rho, fvMatrix& eqn, const label fieldi -) +) const { addDivSup(eqn, fieldi); addLaplacianSup(alpha, eqn, fieldi); @@ -418,7 +418,7 @@ void Foam::fv::volumeFractionSource::addSup const volScalarField& rho, fvMatrix& eqn, const label fieldi -) +) const { addDivSup(eqn, fieldi); addLaplacianSup(alpha, eqn, fieldi); @@ -431,7 +431,7 @@ void Foam::fv::volumeFractionSource::addSup const volScalarField& rho, fvMatrix& eqn, const label fieldi -) +) const { addDivSup(eqn, fieldi); addLaplacianSup(alpha, eqn, fieldi); diff --git a/src/fvOptions/sources/derived/volumeFractionSource/volumeFractionSource.H b/src/fvOptions/sources/derived/volumeFractionSource/volumeFractionSource.H index af2ab0eb0b..923128eedb 100644 --- a/src/fvOptions/sources/derived/volumeFractionSource/volumeFractionSource.H +++ b/src/fvOptions/sources/derived/volumeFractionSource/volumeFractionSource.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2019 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2019-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -115,11 +115,16 @@ class volumeFractionSource //- Add time-derivative terms to an equation template - void addDdtSup(fvMatrix&, const label); + void addDdtSup(fvMatrix&, const label) const; //- Add time-derivative terms to a compressible equation template - void addDdtSup(const volScalarField&, fvMatrix&, const label); + void addDdtSup + ( + const volScalarField&, + fvMatrix&, + const label + ) const; //- Add time-derivative terms to a phase-compressible equation template @@ -129,17 +134,17 @@ class volumeFractionSource const volScalarField&, fvMatrix&, const label - ); + ) const; //- Add divergence terms to an equation template - void addDivSup(fvMatrix&, const label); + void addDivSup(fvMatrix&, const label) const; //- Add divergence terms to the momentum equation - void addUDivSup(fvMatrix&, const label); + void addUDivSup(fvMatrix&, const label) const; //- Add divergence terms to the continuity equation - void addRhoDivSup(fvMatrix&, const label); + void addRhoDivSup(fvMatrix&, const label) const; //- Add Laplacian terms to an equation template @@ -148,7 +153,7 @@ class volumeFractionSource const AlphaFieldType& alpha, fvMatrix& eqn, const label fieldi - ); + ) const; public: @@ -182,15 +187,19 @@ public: // Explicit and implicit sources - virtual void addSup(fvMatrix&, const label); + virtual void addSup(fvMatrix&, const label) const; - virtual void addSup(fvMatrix&, const label); + virtual void addSup(fvMatrix&, const label) const; - virtual void addSup(fvMatrix&, const label); + virtual void addSup(fvMatrix&, const label) const; - virtual void addSup(fvMatrix&, const label); + virtual void addSup + ( + fvMatrix&, + const label + ) const; - virtual void addSup(fvMatrix&, const label); + virtual void addSup(fvMatrix&, const label) const; // Explicit and implicit sources for compressible equations @@ -200,35 +209,35 @@ public: const volScalarField&, fvMatrix&, const label - ); + ) const; virtual void addSup ( const volScalarField&, fvMatrix&, const label - ); + ) const; virtual void addSup ( const volScalarField&, fvMatrix&, const label - ); + ) const; virtual void addSup ( const volScalarField&, fvMatrix&, const label - ); + ) const; virtual void addSup ( const volScalarField&, fvMatrix&, const label - ); + ) const; // Explicit and implicit sources for phase equations @@ -239,7 +248,7 @@ public: const volScalarField&, fvMatrix&, const label - ); + ) const; virtual void addSup ( @@ -247,7 +256,7 @@ public: const volScalarField&, fvMatrix&, const label - ); + ) const; virtual void addSup ( @@ -255,7 +264,7 @@ public: const volScalarField&, fvMatrix&, const label - ); + ) const; virtual void addSup ( @@ -263,7 +272,7 @@ public: const volScalarField&, fvMatrix&, const label - ); + ) const; virtual void addSup ( @@ -271,7 +280,7 @@ public: const volScalarField&, fvMatrix&, const label - ); + ) const; // IO diff --git a/src/fvOptions/sources/general/codedSource/CodedSource.C b/src/fvOptions/sources/general/codedSource/CodedSource.C index ad8021baf6..1837ad7ca8 100644 --- a/src/fvOptions/sources/general/codedSource/CodedSource.C +++ b/src/fvOptions/sources/general/codedSource/CodedSource.C @@ -158,7 +158,7 @@ template void Foam::fv::CodedSource::correct ( GeometricField& field -) +) const { if (debug) { @@ -176,7 +176,7 @@ void Foam::fv::CodedSource::addSup ( fvMatrix& eqn, const label fieldi -) +) const { if (debug) { @@ -195,7 +195,7 @@ void Foam::fv::CodedSource::addSup const volScalarField& rho, fvMatrix& eqn, const label fieldi -) +) const { if (debug) { @@ -213,7 +213,7 @@ void Foam::fv::CodedSource::constrain ( fvMatrix& eqn, const label fieldi -) +) const { if (debug) { diff --git a/src/fvOptions/sources/general/codedSource/CodedSource.H b/src/fvOptions/sources/general/codedSource/CodedSource.H index 65f15414f5..920d5463d4 100644 --- a/src/fvOptions/sources/general/codedSource/CodedSource.H +++ b/src/fvOptions/sources/general/codedSource/CodedSource.H @@ -191,20 +191,21 @@ public: //- Dynamically compiled fvOption option& redirectFvOption() const; + // Evaluation //- Correct field virtual void correct ( GeometricField& - ); + ) const; //- Explicit and implicit matrix contributions virtual void addSup ( fvMatrix& eqn, const label fieldi - ); + ) const; //- Explicit and implicit matrix contributions // to compressible equation @@ -213,14 +214,14 @@ public: const volScalarField& rho, fvMatrix& eqn, const label fieldi - ); + ) const; //- Set value virtual void constrain ( fvMatrix& eqn, const label fieldi - ); + ) const; // IO diff --git a/src/fvOptions/sources/general/semiImplicitSource/semiImplicitSource.C b/src/fvOptions/sources/general/semiImplicitSource/semiImplicitSource.C index 298b0f4922..8952fc83db 100644 --- a/src/fvOptions/sources/general/semiImplicitSource/semiImplicitSource.C +++ b/src/fvOptions/sources/general/semiImplicitSource/semiImplicitSource.C @@ -64,7 +64,7 @@ void Foam::fv::semiImplicitSource::addSupType ( fvMatrix& eqn, const label fieldi -) +) const { if (debug) { @@ -132,7 +132,7 @@ void Foam::fv::semiImplicitSource::addSupType const volScalarField& rho, fvMatrix& eqn, const label fieldi -) +) const { if (debug) { @@ -174,7 +174,7 @@ void Foam::fv::semiImplicitSource::addSup ( fvMatrix& eqn, const label fieldi -) +) const { addSupType(eqn, fieldi); } @@ -184,7 +184,7 @@ void Foam::fv::semiImplicitSource::addSup ( fvMatrix& eqn, const label fieldi -) +) const { addSupType(eqn, fieldi); } @@ -194,7 +194,7 @@ void Foam::fv::semiImplicitSource::addSup ( fvMatrix& eqn, const label fieldi -) +) const { addSupType(eqn, fieldi); } @@ -204,7 +204,7 @@ void Foam::fv::semiImplicitSource::addSup ( fvMatrix& eqn, const label fieldi -) +) const { addSupType(eqn, fieldi); } @@ -214,7 +214,7 @@ void Foam::fv::semiImplicitSource::addSup ( fvMatrix& eqn, const label fieldi -) +) const { addSupType(eqn, fieldi); } @@ -225,7 +225,7 @@ void Foam::fv::semiImplicitSource::addSup const volScalarField& rho, fvMatrix& eqn, const label fieldi -) +) const { addSupType(eqn, fieldi); } @@ -236,7 +236,7 @@ void Foam::fv::semiImplicitSource::addSup const volScalarField& rho, fvMatrix& eqn, const label fieldi -) +) const { addSupType(eqn, fieldi); } @@ -247,7 +247,7 @@ void Foam::fv::semiImplicitSource::addSup const volScalarField& rho, fvMatrix& eqn, const label fieldi -) +) const { addSupType(eqn, fieldi); } @@ -258,7 +258,7 @@ void Foam::fv::semiImplicitSource::addSup const volScalarField& rho, fvMatrix& eqn, const label fieldi -) +) const { addSupType(eqn, fieldi); } @@ -269,7 +269,7 @@ void Foam::fv::semiImplicitSource::addSup const volScalarField& rho, fvMatrix& eqn, const label fieldi -) +) const { addSupType(eqn, fieldi); } @@ -281,7 +281,7 @@ void Foam::fv::semiImplicitSource::addSup const volScalarField& rho, fvMatrix& eqn, const label fieldi -) +) const { addSupType(eqn, fieldi); } @@ -293,7 +293,7 @@ void Foam::fv::semiImplicitSource::addSup const volScalarField& rho, fvMatrix& eqn, const label fieldi -) +) const { addSupType(eqn, fieldi); } @@ -305,7 +305,7 @@ void Foam::fv::semiImplicitSource::addSup const volScalarField& rho, fvMatrix& eqn, const label fieldi -) +) const { addSupType(eqn, fieldi); } @@ -317,7 +317,7 @@ void Foam::fv::semiImplicitSource::addSup const volScalarField& rho, fvMatrix& eqn, const label fieldi -) +) const { addSupType(eqn, fieldi); } @@ -329,7 +329,7 @@ void Foam::fv::semiImplicitSource::addSup const volScalarField& rho, fvMatrix& eqn, const label fieldi -) +) const { addSupType(eqn, fieldi); } @@ -393,4 +393,5 @@ bool Foam::fv::semiImplicitSource::read(const dictionary& dict) } } + // ************************************************************************* // diff --git a/src/fvOptions/sources/general/semiImplicitSource/semiImplicitSource.H b/src/fvOptions/sources/general/semiImplicitSource/semiImplicitSource.H index b1ec1fc006..eac23d6c45 100644 --- a/src/fvOptions/sources/general/semiImplicitSource/semiImplicitSource.H +++ b/src/fvOptions/sources/general/semiImplicitSource/semiImplicitSource.H @@ -147,11 +147,16 @@ private: //- Add divergence terms to an equation template - void addSupType(fvMatrix&, const label); + void addSupType(fvMatrix&, const label) const; //- Add divergence terms to an equation template - void addSupType(const volScalarField&, fvMatrix&, const label); + void addSupType + ( + const volScalarField&, + fvMatrix&, + const label + ) const; public: @@ -185,31 +190,31 @@ public: ( fvMatrix& eqn, const label fieldi - ); + ) const; virtual void addSup ( fvMatrix& eqn, const label fieldi - ); + ) const; virtual void addSup ( fvMatrix& eqn, const label fieldi - ); + ) const; virtual void addSup ( fvMatrix& eqn, const label fieldi - ); + ) const; virtual void addSup ( fvMatrix& eqn, const label fieldi - ); + ) const; // Explicit and implicit sources for compressible equations @@ -219,35 +224,35 @@ public: const volScalarField& rho, fvMatrix& eqn, const label fieldi - ); + ) const; virtual void addSup ( const volScalarField& rho, fvMatrix& eqn, const label fieldi - ); + ) const; virtual void addSup ( const volScalarField& rho, fvMatrix& eqn, const label fieldi - ); + ) const; virtual void addSup ( const volScalarField& rho, fvMatrix& eqn, const label fieldi - ); + ) const; virtual void addSup ( const volScalarField& rho, fvMatrix& eqn, const label fieldi - ); + ) const; // Explicit and implicit sources for phase equations @@ -258,7 +263,7 @@ public: const volScalarField& rho, fvMatrix& eqn, const label fieldi - ); + ) const; virtual void addSup ( @@ -266,7 +271,7 @@ public: const volScalarField& rho, fvMatrix& eqn, const label fieldi - ); + ) const; virtual void addSup ( @@ -274,7 +279,7 @@ public: const volScalarField& rho, fvMatrix& eqn, const label fieldi - ); + ) const; virtual void addSup ( @@ -282,7 +287,7 @@ public: const volScalarField& rho, fvMatrix& eqn, const label fieldi - ); + ) const; virtual void addSup ( @@ -290,7 +295,7 @@ public: const volScalarField& rho, fvMatrix& eqn, const label fieldi - ); + ) const; // IO diff --git a/src/fvOptions/sources/interRegion/interRegionExplicitPorositySource/interRegionExplicitPorositySource.C b/src/fvOptions/sources/interRegion/interRegionExplicitPorositySource/interRegionExplicitPorositySource.C index a320b63177..9ef31f58bb 100644 --- a/src/fvOptions/sources/interRegion/interRegionExplicitPorositySource/interRegionExplicitPorositySource.C +++ b/src/fvOptions/sources/interRegion/interRegionExplicitPorositySource/interRegionExplicitPorositySource.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 @@ -47,7 +47,7 @@ namespace fv // * * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * // -void Foam::fv::interRegionExplicitPorositySource::initialise() +void Foam::fv::interRegionExplicitPorositySource::initialise() const { if (!firstIter_) { @@ -135,7 +135,7 @@ void Foam::fv::interRegionExplicitPorositySource::addSup ( fvMatrix& eqn, const label fieldi -) +) const { initialise(); @@ -189,7 +189,7 @@ void Foam::fv::interRegionExplicitPorositySource::addSup const volScalarField& rho, fvMatrix& eqn, const label fieldi -) +) const { initialise(); diff --git a/src/fvOptions/sources/interRegion/interRegionExplicitPorositySource/interRegionExplicitPorositySource.H b/src/fvOptions/sources/interRegion/interRegionExplicitPorositySource/interRegionExplicitPorositySource.H index ca44a5b706..ea3eb32db7 100644 --- a/src/fvOptions/sources/interRegion/interRegionExplicitPorositySource/interRegionExplicitPorositySource.H +++ b/src/fvOptions/sources/interRegion/interRegionExplicitPorositySource/interRegionExplicitPorositySource.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 @@ -85,10 +85,10 @@ protected: // Protected data //- Run-time selectable porosity model - autoPtr porosityPtr_; + mutable autoPtr porosityPtr_; //- First iteration - bool firstIter_; + mutable bool firstIter_; //- Velocity field name, default = U word UName_; @@ -101,7 +101,7 @@ protected: // Protected Member Functions //- Initialise - void initialise(); + void initialise() const; public: @@ -142,7 +142,7 @@ public: ( fvMatrix& eqn, const label fieldi - ); + ) const; // Add explicit and implicit contributions to compressible equation @@ -153,7 +153,7 @@ public: const volScalarField& rho, fvMatrix& eqn, const label fieldi - ); + ) const; // IO diff --git a/src/fvOptions/sources/interRegion/interRegionHeatTransfer/constantHeatTransfer/constantHeatTransfer.C b/src/fvOptions/sources/interRegion/interRegionHeatTransfer/constantHeatTransfer/constantHeatTransfer.C index 25745a1b30..a7030a02c9 100644 --- a/src/fvOptions/sources/interRegion/interRegionHeatTransfer/constantHeatTransfer/constantHeatTransfer.C +++ b/src/fvOptions/sources/interRegion/interRegionHeatTransfer/constantHeatTransfer/constantHeatTransfer.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 @@ -104,7 +104,7 @@ Foam::fv::constantHeatTransfer::~constantHeatTransfer() // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -void Foam::fv::constantHeatTransfer::calculateHtc() +void Foam::fv::constantHeatTransfer::calculateHtc() const {} diff --git a/src/fvOptions/sources/interRegion/interRegionHeatTransfer/constantHeatTransfer/constantHeatTransfer.H b/src/fvOptions/sources/interRegion/interRegionHeatTransfer/constantHeatTransfer/constantHeatTransfer.H index 5f59b4c2b1..f8cff50a05 100644 --- a/src/fvOptions/sources/interRegion/interRegionHeatTransfer/constantHeatTransfer/constantHeatTransfer.H +++ b/src/fvOptions/sources/interRegion/interRegionHeatTransfer/constantHeatTransfer/constantHeatTransfer.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 @@ -85,7 +85,7 @@ public: // Public Functions //- Calculate the heat transfer coefficient - virtual void calculateHtc(); + virtual void calculateHtc() const; // IO diff --git a/src/fvOptions/sources/interRegion/interRegionHeatTransfer/interRegionHeatTransferModel/interRegionHeatTransferModel.C b/src/fvOptions/sources/interRegion/interRegionHeatTransfer/interRegionHeatTransferModel/interRegionHeatTransferModel.C index b0067f4986..d73b07184c 100644 --- a/src/fvOptions/sources/interRegion/interRegionHeatTransfer/interRegionHeatTransferModel/interRegionHeatTransferModel.C +++ b/src/fvOptions/sources/interRegion/interRegionHeatTransfer/interRegionHeatTransferModel/interRegionHeatTransferModel.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 @@ -43,7 +43,7 @@ namespace fv // * * * * * * * * * * * * Protected member functions * * * * * * * * * * * // -void Foam::fv::interRegionHeatTransferModel::setNbrModel() +void Foam::fv::interRegionHeatTransferModel::setNbrModel() const { if (!firstIter_) { @@ -84,7 +84,7 @@ void Foam::fv::interRegionHeatTransferModel::setNbrModel() } -void Foam::fv::interRegionHeatTransferModel::correct() +void Foam::fv::interRegionHeatTransferModel::correct() const { if (master_) { @@ -167,7 +167,7 @@ void Foam::fv::interRegionHeatTransferModel::addSup ( fvMatrix& eqn, const label fieldi -) +) const { setNbrModel(); @@ -254,7 +254,7 @@ void Foam::fv::interRegionHeatTransferModel::addSup const volScalarField& rho, fvMatrix& eqn, const label fieldi -) +) const { addSup(eqn, fieldi); } diff --git a/src/fvOptions/sources/interRegion/interRegionHeatTransfer/interRegionHeatTransferModel/interRegionHeatTransferModel.H b/src/fvOptions/sources/interRegion/interRegionHeatTransfer/interRegionHeatTransferModel/interRegionHeatTransferModel.H index 2d8e31af0d..41a2e3c692 100644 --- a/src/fvOptions/sources/interRegion/interRegionHeatTransfer/interRegionHeatTransferModel/interRegionHeatTransferModel.H +++ b/src/fvOptions/sources/interRegion/interRegionHeatTransfer/interRegionHeatTransferModel/interRegionHeatTransferModel.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 @@ -64,16 +64,16 @@ protected: word nbrModelName_; //- Pointer to neighbour interRegionHeatTransferModel - interRegionHeatTransferModel* nbrModel_; + mutable interRegionHeatTransferModel* nbrModel_; //- First iteration - bool firstIter_; + mutable bool firstIter_; //- Time index - used for updating htc - label timeIndex_; + mutable label timeIndex_; //- Heat transfer coefficient [W/m^2/k] times area/volume [1/m] - volScalarField htc_; + mutable volScalarField htc_; //- Flag to activate semi-implicit coupling bool semiImplicit_; @@ -88,13 +88,13 @@ protected: // Protected member functions //- Set the neighbour interRegionHeatTransferModel - void setNbrModel(); + void setNbrModel() const; //- Inherit correct from interRegionOption using interRegionOption::correct; //- Correct to calculate the inter-region heat transfer coefficient - void correct(); + void correct() const; //- Interpolate field with nbrModel specified template @@ -175,7 +175,7 @@ public: ( fvMatrix& eqn, const label fieldi - ); + ) const; //- Source term to compressible energy equation virtual void addSup @@ -183,10 +183,10 @@ public: const volScalarField& rho, fvMatrix& eqn, const label fieldi - ); + ) const; //- Calculate heat transfer coefficient - virtual void calculateHtc() = 0; + virtual void calculateHtc() const = 0; // IO diff --git a/src/fvOptions/sources/interRegion/interRegionHeatTransfer/tabulatedHeatTransfer/tabulatedHeatTransfer.C b/src/fvOptions/sources/interRegion/interRegionHeatTransfer/tabulatedHeatTransfer/tabulatedHeatTransfer.C index 61c486e9de..88db4cb5f9 100644 --- a/src/fvOptions/sources/interRegion/interRegionHeatTransfer/tabulatedHeatTransfer/tabulatedHeatTransfer.C +++ b/src/fvOptions/sources/interRegion/interRegionHeatTransfer/tabulatedHeatTransfer/tabulatedHeatTransfer.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 @@ -46,7 +46,7 @@ namespace fv // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // const Foam::interpolation2DTable& -Foam::fv::tabulatedHeatTransfer::hTable() +Foam::fv::tabulatedHeatTransfer::hTable() const { if (!hTable_.valid()) { @@ -57,7 +57,7 @@ Foam::fv::tabulatedHeatTransfer::hTable() } -const Foam::volScalarField& Foam::fv::tabulatedHeatTransfer::AoV() +const Foam::volScalarField& Foam::fv::tabulatedHeatTransfer::AoV() const { if (!AoV_.valid()) { @@ -109,7 +109,7 @@ Foam::fv::tabulatedHeatTransfer::~tabulatedHeatTransfer() // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -void Foam::fv::tabulatedHeatTransfer::calculateHtc() +void Foam::fv::tabulatedHeatTransfer::calculateHtc() const { const fvMesh& nbrMesh = mesh_.time().lookupObject(nbrRegionName()); diff --git a/src/fvOptions/sources/interRegion/interRegionHeatTransfer/tabulatedHeatTransfer/tabulatedHeatTransfer.H b/src/fvOptions/sources/interRegion/interRegionHeatTransfer/tabulatedHeatTransfer/tabulatedHeatTransfer.H index df6103893d..5d00ba561b 100644 --- a/src/fvOptions/sources/interRegion/interRegionHeatTransfer/tabulatedHeatTransfer/tabulatedHeatTransfer.H +++ b/src/fvOptions/sources/interRegion/interRegionHeatTransfer/tabulatedHeatTransfer/tabulatedHeatTransfer.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 @@ -62,16 +62,16 @@ class tabulatedHeatTransfer word UNbrName_; //- 2D look up table - autoPtr> hTable_; + mutable autoPtr> hTable_; //- Area per unit volume of heat exchanger - autoPtr AoV_; + mutable autoPtr AoV_; //- Heat transfer coefficient table - const interpolation2DTable& hTable(); + const interpolation2DTable& hTable() const; //- Field of area divided by volume - const volScalarField& AoV(); + const volScalarField& AoV() const; //- Start time name const word startTimeName_; @@ -102,7 +102,7 @@ public: // Public Functions //- Calculate the heat transfer coefficient - virtual void calculateHtc(); + virtual void calculateHtc() const; // IO diff --git a/src/fvOptions/sources/interRegion/interRegionHeatTransfer/variableHeatTransfer/variableHeatTransfer.C b/src/fvOptions/sources/interRegion/interRegionHeatTransfer/variableHeatTransfer/variableHeatTransfer.C index 5783cfe3a6..d945dd6c80 100644 --- a/src/fvOptions/sources/interRegion/interRegionHeatTransfer/variableHeatTransfer/variableHeatTransfer.C +++ b/src/fvOptions/sources/interRegion/interRegionHeatTransfer/variableHeatTransfer/variableHeatTransfer.C @@ -97,7 +97,7 @@ Foam::fv::variableHeatTransfer::~variableHeatTransfer() // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -void Foam::fv::variableHeatTransfer::calculateHtc() +void Foam::fv::variableHeatTransfer::calculateHtc() const { const fvMesh& nbrMesh = mesh_.time().lookupObject(nbrRegionName()); diff --git a/src/fvOptions/sources/interRegion/interRegionHeatTransfer/variableHeatTransfer/variableHeatTransfer.H b/src/fvOptions/sources/interRegion/interRegionHeatTransfer/variableHeatTransfer/variableHeatTransfer.H index fb73bc9213..b15edf45b7 100644 --- a/src/fvOptions/sources/interRegion/interRegionHeatTransfer/variableHeatTransfer/variableHeatTransfer.H +++ b/src/fvOptions/sources/interRegion/interRegionHeatTransfer/variableHeatTransfer/variableHeatTransfer.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 @@ -106,7 +106,7 @@ public: // Public Functions //- Calculate the heat transfer coefficient - virtual void calculateHtc(); + virtual void calculateHtc() const; // IO diff --git a/src/radiationModels/fvOptions/radiation/radiation.C b/src/radiationModels/fvOptions/radiation/radiation.C index 7180ea074b..2fa9642a41 100644 --- a/src/radiationModels/fvOptions/radiation/radiation.C +++ b/src/radiationModels/fvOptions/radiation/radiation.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2017-2019 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2017-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -82,7 +82,7 @@ void Foam::fv::radiation::addSup const volScalarField& rho, fvMatrix& eqn, const label fieldi -) +) const { const basicThermo& thermo = mesh_.lookupObject(basicThermo::dictName); diff --git a/src/radiationModels/fvOptions/radiation/radiation.H b/src/radiationModels/fvOptions/radiation/radiation.H index 16abdc4082..b8630ac9fe 100644 --- a/src/radiationModels/fvOptions/radiation/radiation.H +++ b/src/radiationModels/fvOptions/radiation/radiation.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2017-2019 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2017-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -66,7 +66,7 @@ class radiation // Private Data //- The radiation model pointer - autoPtr radiation_; + mutable autoPtr radiation_; public: @@ -100,7 +100,7 @@ public: const volScalarField& rho, fvMatrix& eqn, const label fieldi - ); + ) const; // IO diff --git a/tutorials/compressible/rhoPimpleFoam/RAS/aerofoilNACA0012/system/fvOptions b/tutorials/compressible/rhoPimpleFoam/RAS/aerofoilNACA0012/constant/fvOptions similarity index 100% rename from tutorials/compressible/rhoPimpleFoam/RAS/aerofoilNACA0012/system/fvOptions rename to tutorials/compressible/rhoPimpleFoam/RAS/aerofoilNACA0012/constant/fvOptions diff --git a/tutorials/compressible/rhoPimpleFoam/laminar/blockedChannel/system/fvOptions b/tutorials/compressible/rhoPimpleFoam/laminar/blockedChannel/constant/fvOptions similarity index 100% rename from tutorials/compressible/rhoPimpleFoam/laminar/blockedChannel/system/fvOptions rename to tutorials/compressible/rhoPimpleFoam/laminar/blockedChannel/constant/fvOptions diff --git a/tutorials/compressible/rhoSimpleFoam/aerofoilNACA0012/system/fvOptions b/tutorials/compressible/rhoSimpleFoam/aerofoilNACA0012/constant/fvOptions similarity index 100% rename from tutorials/compressible/rhoSimpleFoam/aerofoilNACA0012/system/fvOptions rename to tutorials/compressible/rhoSimpleFoam/aerofoilNACA0012/constant/fvOptions diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/coolingSphere/templates/system/solid/fvOptions b/tutorials/heatTransfer/chtMultiRegionFoam/coolingSphere/templates/constant/solid/fvOptions similarity index 100% rename from tutorials/heatTransfer/chtMultiRegionFoam/coolingSphere/templates/system/solid/fvOptions rename to tutorials/heatTransfer/chtMultiRegionFoam/coolingSphere/templates/constant/solid/fvOptions diff --git a/tutorials/incompressible/pimpleFoam/laminar/blockedChannel/system/fvOptions b/tutorials/incompressible/pimpleFoam/laminar/blockedChannel/constant/fvOptions similarity index 100% rename from tutorials/incompressible/pimpleFoam/laminar/blockedChannel/system/fvOptions rename to tutorials/incompressible/pimpleFoam/laminar/blockedChannel/constant/fvOptions diff --git a/tutorials/incompressible/simpleFoam/rotorDisk/system/fvOptions b/tutorials/incompressible/simpleFoam/rotorDisk/constant/fvOptions similarity index 100% rename from tutorials/incompressible/simpleFoam/rotorDisk/system/fvOptions rename to tutorials/incompressible/simpleFoam/rotorDisk/constant/fvOptions diff --git a/tutorials/multiphase/interFoam/laminar/damBreakWithObstacle/constant/fvOptions b/tutorials/multiphase/interFoam/laminar/damBreakWithObstacle/constant/fvOptions new file mode 100644 index 0000000000..1534d18804 --- /dev/null +++ b/tutorials/multiphase/interFoam/laminar/damBreakWithObstacle/constant/fvOptions @@ -0,0 +1,31 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object fvOptions; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +inletTurbulence +{ + type vectorFixedValueConstraint; + + selectionMode all; + + fieldValues + { + U (0 0 0); + } +} + + +// ************************************************************************* //