From 86bf75dee90a7efce38ad9a2a97f8f25b7ea4bb0 Mon Sep 17 00:00:00 2001 From: andy Date: Wed, 2 May 2012 13:08:22 +0100 Subject: [PATCH] ENH: Enable flowRateInletVelocity BC to operate as VFR by setting 'rho' to 'none' when phi is kg/s --- .../flowRateInletVelocityFvPatchVectorField.C | 16 ++++++++++++---- .../flowRateInletVelocityFvPatchVectorField.H | 7 +++++-- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/src/finiteVolume/fields/fvPatchFields/derived/flowRateInletVelocity/flowRateInletVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/flowRateInletVelocity/flowRateInletVelocityFvPatchVectorField.C index c64b616a86..64c1120cc9 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/flowRateInletVelocity/flowRateInletVelocityFvPatchVectorField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/flowRateInletVelocity/flowRateInletVelocityFvPatchVectorField.C @@ -129,11 +129,19 @@ void Foam::flowRateInletVelocityFvPatchVectorField::updateCoeffs() } else if (phi.dimensions() == dimDensity*dimVelocity*dimArea) { - const fvPatchField& rhop = - patch().lookupPatchField(rhoName_); + if (rhoName_ == "none") + { + // volumetric flow-rate if density not given + operator==(n*avgU); + } + else + { + // mass flow-rate + const fvPatchField& rhop = + patch().lookupPatchField(rhoName_); - // mass flow-rate - operator==(n*avgU/rhop); + operator==(n*avgU/rhop); + } } else { diff --git a/src/finiteVolume/fields/fvPatchFields/derived/flowRateInletVelocity/flowRateInletVelocityFvPatchVectorField.H b/src/finiteVolume/fields/fvPatchFields/derived/flowRateInletVelocity/flowRateInletVelocityFvPatchVectorField.H index f40674ea01..7410e5290f 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/flowRateInletVelocity/flowRateInletVelocityFvPatchVectorField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/flowRateInletVelocity/flowRateInletVelocityFvPatchVectorField.H @@ -30,8 +30,10 @@ Description The basis of the patch (volumetric or mass) is determined by the dimensions of the flux, phi. - The current density is used to correct the velocity when applying the - mass basis. + + If the flux is mass-based + - the current density is used to correct the velocity + - volumetric flow rate can be applied by setting the 'rho' entry to 'none' Example of the boundary condition specification: \verbatim @@ -39,6 +41,7 @@ Description { type flowRateInletVelocity; flowRate 0.2; // Volumetric/mass flow rate [m3/s or kg/s] + rho rho; // none | rho [m3/s or kg/s] value uniform (0 0 0); // placeholder } \endverbatim