diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/readPIMPLEControls.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/readPIMPLEControls.H index f6371c47cb..82ac8a2fd2 100644 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/readPIMPLEControls.H +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/readPIMPLEControls.H @@ -1,9 +1,9 @@ // We do not have a top-level mesh. Construct the fvSolution for // the runTime instead. + runTime.readOpt() = IOobject::MUST_READ_IF_MODIFIED; fvSolution solutionDict(runTime); const dictionary& pimple = solutionDict.subDict("PIMPLE"); const int nOuterCorr = pimple.lookupOrDefault("nOuterCorrectors", 1); - diff --git a/applications/solvers/multiphase/bubbleFoam/UEqns.H b/applications/solvers/multiphase/bubbleFoam/UEqns.H index 82d53d84b0..3239df21cb 100644 --- a/applications/solvers/multiphase/bubbleFoam/UEqns.H +++ b/applications/solvers/multiphase/bubbleFoam/UEqns.H @@ -2,7 +2,7 @@ fvVectorMatrix UaEqn(Ua, Ua.dimensions()*dimVol/dimTime); fvVectorMatrix UbEqn(Ub, Ub.dimensions()*dimVol/dimTime); { - volTensorField Rca(-nuEffa*(fvc::grad(Ua)().T())); + volTensorField Rca(-nuEffa*(T(fvc::grad(Ua)))); Rca = Rca + (2.0/3.0)*sqr(Ct)*I*k - (2.0/3.0)*I*tr(Rca); surfaceScalarField phiRa @@ -36,7 +36,7 @@ fvVectorMatrix UbEqn(Ub, Ub.dimensions()*dimVol/dimTime); UaEqn.relax(); - volTensorField Rcb(-nuEffb*fvc::grad(Ub)().T()); + volTensorField Rcb(-nuEffb*T(fvc::grad(Ub))); Rcb = Rcb + (2.0/3.0)*I*k - (2.0/3.0)*I*tr(Rcb); surfaceScalarField phiRb diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/UEqns.H b/applications/solvers/multiphase/twoPhaseEulerFoam/UEqns.H index b07f3e70dd..0a590e6bf9 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/UEqns.H +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/UEqns.H @@ -3,7 +3,7 @@ fvVectorMatrix UbEqn(Ub, Ub.dimensions()*dimVol/dimTime); { { - volTensorField gradUaT(fvc::grad(Ua)().T()); + volTensorField gradUaT(T(fvc::grad(Ua))); if (kineticTheory.on()) { @@ -58,7 +58,7 @@ fvVectorMatrix UbEqn(Ub, Ub.dimensions()*dimVol/dimTime); } { - volTensorField gradUbT(fvc::grad(Ub)().T()); + volTensorField gradUbT(T(fvc::grad(Ub))); volTensorField Rcb ( "Rcb", diff --git a/src/finiteVolume/fvMatrices/fvMatrix/fvMatrix.C b/src/finiteVolume/fvMatrices/fvMatrix/fvMatrix.C index 618959fb79..85ab9c341b 100644 --- a/src/finiteVolume/fvMatrices/fvMatrix/fvMatrix.C +++ b/src/finiteVolume/fvMatrices/fvMatrix/fvMatrix.C @@ -1180,6 +1180,43 @@ void Foam::fvMatrix::operator*= } +template +void Foam::fvMatrix::operator*= +( + const volScalarField& vsf +) +{ + dimensions_ *= vsf.dimensions(); + lduMatrix::operator*=(vsf.field()); + source_ *= vsf.field(); + + forAll(vsf.boundaryField(), patchI) + { + const fvPatchScalarField& psf = vsf.boundaryField()[patchI]; + + if (psf.coupled()) + { + internalCoeffs_[patchI] *= psf.patchInternalField(); + boundaryCoeffs_[patchI] *= psf.patchNeighbourField(); + } + else + { + internalCoeffs_[patchI] *= psf.patchInternalField(); + boundaryCoeffs_[patchI] *= psf; + } + } + + if (faceFluxCorrectionPtr_) + { + FatalErrorIn + ( + "fvMatrix::operator*=" + "(const DimensionedField&)" + ) << "cannot scale a matrix containing a faceFluxCorrection" + << abort(FatalError); + } +} + template void Foam::fvMatrix::operator*= ( diff --git a/src/finiteVolume/fvMatrices/fvMatrix/fvMatrix.H b/src/finiteVolume/fvMatrices/fvMatrix/fvMatrix.H index 8e53051af6..0d1ba42623 100644 --- a/src/finiteVolume/fvMatrices/fvMatrix/fvMatrix.H +++ b/src/finiteVolume/fvMatrices/fvMatrix/fvMatrix.H @@ -460,6 +460,7 @@ public: void operator*=(const DimensionedField&); void operator*=(const tmp >&); + void operator*=(const volScalarField&); void operator*=(const tmp&); void operator*=(const dimensioned&); diff --git a/src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/LocalInteraction/LocalInteraction.C b/src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/LocalInteraction/LocalInteraction.C index 457517b0cd..77fcefb2d9 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/LocalInteraction/LocalInteraction.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/LocalInteraction/LocalInteraction.C @@ -27,24 +27,6 @@ License // * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * // -template -Foam::label Foam::LocalInteraction::applyToPatch -( - const label globalPatchI -) const -{ - forAll(patchIDs_, patchI) - { - if (patchIDs_[patchI] == globalPatchI) - { - return patchI; - } - } - - return -1; -} - - template void Foam::LocalInteraction::readProps() { @@ -131,7 +113,6 @@ Foam::LocalInteraction::LocalInteraction : PatchInteractionModel(dict, cloud, typeName), patchData_(cloud.mesh(), this->coeffDict()), - patchIDs_(patchData_.size()), nEscape0_(patchData_.size(), 0), massEscape0_(patchData_.size(), 0.0), nStick0_(patchData_.size(), 0), @@ -173,7 +154,6 @@ Foam::LocalInteraction::LocalInteraction : PatchInteractionModel(pim), patchData_(pim.patchData_), - patchIDs_(pim.patchIDs_), nEscape0_(pim.nEscape0_), massEscape0_(pim.massEscape0_), nStick0_(pim.nStick0_), @@ -208,7 +188,7 @@ bool Foam::LocalInteraction::correct bool& active = p.active(); - label patchI = applyToPatch(pp.index()); + label patchI = patchData_.applyToPatch(pp.index()); if (patchI >= 0) { diff --git a/src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/LocalInteraction/LocalInteraction.H b/src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/LocalInteraction/LocalInteraction.H index 5d6962b595..624dd73d25 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/LocalInteraction/LocalInteraction.H +++ b/src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/LocalInteraction/LocalInteraction.H @@ -53,9 +53,6 @@ class LocalInteraction //- List of participating patches const patchInteractionDataList patchData_; - //- List of participating patch ids - List