From af02f92b9e45b49edbfe574d5f84cfabee3ec5c8 Mon Sep 17 00:00:00 2001 From: Henry Weller Date: Wed, 16 Aug 2017 14:22:02 +0100 Subject: [PATCH] swirlFlowRateInletVelocityFvPatchVectorField: Avoid calculating origin and axis for patches with no faces Resolves problem with reconstructPar --- .../swirlFlowRateInletVelocityFvPatchVectorField.C | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/finiteVolume/fields/fvPatchFields/derived/swirlFlowRateInletVelocity/swirlFlowRateInletVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/swirlFlowRateInletVelocity/swirlFlowRateInletVelocityFvPatchVectorField.C index beca9fea9..861bac7f9 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/swirlFlowRateInletVelocity/swirlFlowRateInletVelocityFvPatchVectorField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/swirlFlowRateInletVelocity/swirlFlowRateInletVelocityFvPatchVectorField.C @@ -65,7 +65,9 @@ swirlFlowRateInletVelocityFvPatchVectorField dict.lookupOrDefault ( "origin", - gSum(patch().Cf()*patch().magSf())/gSum(patch().magSf()) + patch().size() + ? gSum(patch().Cf()*patch().magSf())/gSum(patch().magSf()) + : Zero ) ), axis_ @@ -73,7 +75,9 @@ swirlFlowRateInletVelocityFvPatchVectorField dict.lookupOrDefault ( "axis", - -gSum(patch().Sf())/gSum(patch().magSf()) + patch().size() + ? -gSum(patch().Sf())/gSum(patch().magSf()) + : Zero ) ), flowRate_(Function1::New("flowRate", dict)),