diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchFields.C b/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchFields.C index 100fe188a20b3043123e7aab6f9e36912465b4f2..4280698c2eb01ac44ce283e5baf98a4d35555913 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<scalar>::updateCoeffs() +void Foam::fanFvPatchField<Foam::scalar>::updateCoeffs() { if (updated()) { @@ -58,27 +57,33 @@ void fanFvPatchField<scalar>::updateCoeffs() const fvsPatchField<scalar>& phip = patch().patchField<surfaceScalarField, scalar>(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<volScalarField, scalar>("rho"); + Un /= + scalarField::subField + ( + patch().lookupPatchField<volScalarField, scalar>("rho"), + size()/2 + ); } for(label i=1; i<f_.size(); i++) { jump_ += f_[i]*pow(Un, i); } + + jump_ = max(jump_, 0.0); } jumpCyclicFvPatchField<scalar>::updateCoeffs(); } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - // ************************************************************************* //