From a47a1b55772720a5926566ccbd9b7a2d0b847cdd Mon Sep 17 00:00:00 2001 From: Hrvoje Jasak Date: Mon, 26 Aug 2013 11:59:53 +0100 Subject: [PATCH] Safe execution when phi is not present --- ...sureInletOutletVelocityFvPatchVectorField.C | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/finiteVolume/fields/fvPatchFields/derived/pressureInletOutletVelocity/pressureInletOutletVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/pressureInletOutletVelocity/pressureInletOutletVelocityFvPatchVectorField.C index 9e470b5d2..9b6ff6b8f 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/pressureInletOutletVelocity/pressureInletOutletVelocityFvPatchVectorField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/pressureInletOutletVelocity/pressureInletOutletVelocityFvPatchVectorField.C @@ -175,10 +175,22 @@ void pressureInletOutletVelocityFvPatchVectorField::updateCoeffs() return; } - const fvsPatchField& phip = - lookupPatchField(phiName_); + if (this->db().objectRegistry::found(phiName_)) + { + const fvsPatchField& phip = + lookupPatchField(phiName_); - valueFraction() = neg(phip)*(I - sqr(patch().nf())); + valueFraction() = neg(phip)*(I - sqr(patch().nf())); + } + else + { + InfoIn + ( + "pressureInletOutletVelocityFvPatchVectorField::updateCoeffs()" + )<< "Cannot find phi. Return" << endl; + + valueFraction() = symmTensor::one; + } directionMixedFvPatchVectorField::updateCoeffs(); directionMixedFvPatchVectorField::evaluate();