BUG: SRFModel: tmp() abuse. Fixes #3038.

This commit is contained in:
mattijs
2023-11-27 18:02:26 +00:00
parent 1c0f59c0e2
commit b4b022f283
2 changed files with 6 additions and 3 deletions

View File

@ -185,6 +185,7 @@ Foam::tmp<Foam::volVectorField> Foam::SRF::SRFModel::U() const
const int oldLocal = volVectorField::Boundary::localConsistency; const int oldLocal = volVectorField::Boundary::localConsistency;
volVectorField::Boundary::localConsistency = 0; volVectorField::Boundary::localConsistency = 0;
tmp<volVectorField> relPos(mesh_.C() - origin_); tmp<volVectorField> relPos(mesh_.C() - origin_);
tmp<volVectorField> tU tmp<volVectorField> tU
( (
new volVectorField new volVectorField
@ -197,7 +198,7 @@ Foam::tmp<Foam::volVectorField> Foam::SRF::SRFModel::U() const
IOobject::NO_READ, IOobject::NO_READ,
IOobject::NO_WRITE IOobject::NO_WRITE
), ),
omega_ ^ (relPos - axis_*(axis_ & relPos)) omega_ ^ (relPos() - axis_*(axis_ & relPos()))
) )
); );
volVectorField::Boundary::localConsistency = oldLocal; volVectorField::Boundary::localConsistency = oldLocal;

View File

@ -102,8 +102,7 @@ class fvPatchFieldBase
word patchType_; word patchType_;
//protected: protected:
public:
// Protected Member Functions // Protected Member Functions
@ -111,6 +110,9 @@ public:
// Useful when initially constructed without a dictionary // Useful when initially constructed without a dictionary
virtual void readDict(const dictionary& dict); virtual void readDict(const dictionary& dict);
public:
//- Set updated state //- Set updated state
void setUpdated(bool state) noexcept void setUpdated(bool state) noexcept
{ {