diff --git a/src/finiteVolume/fields/fvPatchFields/derived/movingWallVelocity/movingWallVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/movingWallVelocity/movingWallVelocityFvPatchVectorField.C index 7a9c170d7a..65704e0b1a 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/movingWallVelocity/movingWallVelocityFvPatchVectorField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/movingWallVelocity/movingWallVelocityFvPatchVectorField.C @@ -94,7 +94,7 @@ movingWallVelocityFvPatchVectorField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // Foam::tmp -Foam::movingWallVelocityFvPatchVectorField::Uwall() const +Foam::movingWallVelocityFvPatchVectorField::Uwall() { const fvMesh& mesh = internalField().mesh(); const fvPatch& p = patch(); @@ -112,10 +112,13 @@ Foam::movingWallVelocityFvPatchVectorField::Uwall() const const vectorField Up((pp.faceCentres() - oldFc)/deltaT); - const auto& U = static_cast(internalField()); + const volVectorField& U = + static_cast(internalField()); - tmp phip = - p.patchField(fvc::meshPhi(U)); + scalarField phip + ( + p.patchField(fvc::meshPhi(U)) + ); const vectorField n(p.nf()); const scalarField& magSf = p.magSf(); @@ -136,7 +139,8 @@ void Foam::movingWallVelocityFvPatchVectorField::updateCoeffs() if (mesh.moving()) { - vectorField::operator=(Uwall()()); + const vectorField uwall(Uwall()); + vectorField::operator=(uwall); } fixedValueFvPatchVectorField::updateCoeffs(); diff --git a/src/finiteVolume/fields/fvPatchFields/derived/movingWallVelocity/movingWallVelocityFvPatchVectorField.H b/src/finiteVolume/fields/fvPatchFields/derived/movingWallVelocity/movingWallVelocityFvPatchVectorField.H index 9b5b05cd7e..f6a9ff2689 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/movingWallVelocity/movingWallVelocityFvPatchVectorField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/movingWallVelocity/movingWallVelocityFvPatchVectorField.H @@ -142,7 +142,7 @@ public: // Member Functions //- Return wall velocity field - tmp Uwall() const; + tmp Uwall(); //- Update the coefficients associated with the patch field virtual void updateCoeffs();