Permalink
Browse files

BUG: nutUSpaldingWallFunction - was holding a reference to a tmp

  • Loading branch information...
1 parent 9822095 commit 2bc607589767ac4cebaff5e9c6b5a9c41eaae499 andy committed Nov 20, 2012
@@ -65,15 +65,19 @@ tmp<scalarField> nutUSpaldingWallFunctionFvPatchScalarField::calcUTau
const scalarField& magGradU
) const
{
+ const label patchI = patch().index();
+
const turbulenceModel& turbModel =
db().lookupObject<turbulenceModel>("turbulenceModel");
- const scalarField& y = turbModel.y()[patch().index()];
+ const scalarField& y = turbModel.y()[patchI];
- const fvPatchVectorField& Uw =
- turbModel.U().boundaryField()[patch().index()];
+ const fvPatchVectorField& Uw = turbModel.U().boundaryField()[patchI];
const scalarField magUp(mag(Uw.patchInternalField() - Uw));
- const scalarField& nuw = turbModel.nu()().boundaryField()[patch().index()];
+ const tmp<volScalarField> tnu = turbModel.nu();
+ const volScalarField& nu = tnu();
+ const scalarField& nuw = nu.boundaryField()[patchI];
+
const scalarField& nutw = *this;
tmp<scalarField> tuTau(new scalarField(patch().size(), 0.0));

0 comments on commit 2bc6075

Please sign in to comment.