From 8e76925c0befce9fc21b9a464b3cba531efdf13b Mon Sep 17 00:00:00 2001 From: mattijs Date: Thu, 10 Sep 2009 12:14:38 +0100 Subject: [PATCH] clipping pressure jump --- .../fvPatchFields/derived/fan/fanFvPatchFields.C | 31 +++++++++++++--------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchFields.C b/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchFields.C index 100fe188..4280698c 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchFields.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchFields.C @@ -29,19 +29,18 @@ License #include "volFields.H" #include "surfaceFields.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam { + makePatchTypeField(fvPatchScalarField, fanFvPatchScalarField); +} -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -makePatchTypeField(fvPatchScalarField, fanFvPatchScalarField); - +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // //- Specialisation of the jump-condition for the pressure template<> -void fanFvPatchField::updateCoeffs() +void Foam::fanFvPatchField::updateCoeffs() { if (updated()) { @@ -58,27 +57,33 @@ void fanFvPatchField::updateCoeffs() const fvsPatchField& phip = patch().patchField(phi); - scalarField Un = + scalarField Un = max + ( scalarField::subField(phip, size()/2) - /scalarField::subField(patch().magSf(), size()/2); + /scalarField::subField(patch().magSf(), size()/2), + 0.0 + ); if (phi.dimensions() == dimDensity*dimVelocity*dimArea) { - Un /= patch().lookupPatchField("rho"); + Un /= + scalarField::subField + ( + patch().lookupPatchField("rho"), + size()/2 + ); } for(label i=1; i::updateCoeffs(); } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - // ************************************************************************* // -- 2.11.4.GIT