diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchField.C index 3a150c6f70792102426a0c851279fe19c0838c66..18d5b3324288146561b458c4a01b3d9487b0baf6 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchField.C @@ -84,4 +84,13 @@ Foam::fanFvPatchField<Type>::fanFvPatchField {} +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +template<class Type> +Foam::tmp<Foam::Field<Type> > Foam::fanFvPatchField<Type>::jump() const +{ + return uniformJumpFvPatchField<Type>::jump(); +} + + // ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchField.H index 463ebeb543602d0a1dd0e4291b626b6ef1101307..bf0762f4788ffed8dba16c2b3208df6fa4ec009d 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchField.H @@ -172,6 +172,9 @@ public: // Evaluation functions + //- Return the "jump" across the patch + tmp<Field<Type> > jump() const; + //- Update the coefficients associated with the patch field virtual void updateCoeffs(); }; @@ -185,6 +188,10 @@ fanFvPatchField<scalar>::fanFvPatchField const DimensionedField<scalar, volMesh>&, const dictionary& ); + +template<> +tmp<Field<scalar> > fanFvPatchField<scalar>::jump() const; + template<> void fanFvPatchField<scalar>::updateCoeffs(); diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchFields.C b/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchFields.C index 668d43483de22fd7e282f9d999bea437d36ee6a3..7922b66fe37a337e117501c2b5e2639ba66001b1 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchFields.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchFields.C @@ -30,18 +30,16 @@ License #include "Tuple2.H" #include "polynomial.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam { - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -makeTemplatePatchTypeField -( - fvPatchScalarField, - fanFvPatchScalarField -); + makeTemplatePatchTypeField + ( + fvPatchScalarField, + fanFvPatchScalarField + ); +} // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // @@ -115,15 +113,10 @@ Foam::fanFvPatchField<Foam::scalar>::fanFvPatchField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -//- Specialisation of the jump-condition for the pressure template<> -void Foam::fanFvPatchField<Foam::scalar>::updateCoeffs() +Foam::tmp<Foam::Field<Foam::scalar> > +Foam::fanFvPatchField<Foam::scalar>::jump() const { - if (this->updated()) - { - return; - } - if (this->cyclicPatch().owner()) { const surfaceScalarField& phi = @@ -139,15 +132,33 @@ void Foam::fanFvPatchField<Foam::scalar>::updateCoeffs() Un /= patch().lookupPatchField<volScalarField, scalar>("rho"); } - this->jump_ = this->jumpTable_->value(Un); + return this->jumpTable_->value(Un); + } + else + { + return refCast<const fanFvPatchField<scalar> > + ( + this->neighbourPatchField() + ).jump(); } - - uniformJumpFvPatchField<scalar>::updateCoeffs(); } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +template<> +void Foam::fanFvPatchField<Foam::scalar>::updateCoeffs() +{ + if (this->updated()) + { + return; + } + + if (this->cyclicPatch().owner()) + { + this->jump_ = jump(); + } + + uniformJumpFvPatchField<scalar>::updateCoeffs(); +} -} // End namespace Foam // ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fixedJump/fixedJumpFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/fixedJump/fixedJumpFvPatchField.C index e58270ec638df26b663319261278f6661d3f9b12..9ef4be21a407f055c7f5831627e1e14a4120e49f 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/fixedJump/fixedJumpFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/fixedJump/fixedJumpFvPatchField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -138,7 +138,8 @@ template<class Type> void Foam::fixedJumpFvPatchField<Type>::write(Ostream& os) const { fvPatchField<Type>::write(os); - os.writeKeyword("patchType") << "cyclic" << token::END_STATEMENT << nl; + os.writeKeyword("patchType") << this->interfaceFieldType() + << token::END_STATEMENT << nl; jump_.writeEntry("jump", os); this->writeEntry("value", os); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fixedJumpAMI/fixedJumpAMIFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/fixedJumpAMI/fixedJumpAMIFvPatchField.C index d9cdc383a3f56c64518e87484ee8a442e27eae72..4c3290cf2d7e1d5a8b4c5006cd9c69601bab82fe 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/fixedJumpAMI/fixedJumpAMIFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/fixedJumpAMI/fixedJumpAMIFvPatchField.C @@ -141,7 +141,8 @@ template<class Type> void Foam::fixedJumpAMIFvPatchField<Type>::write(Ostream& os) const { fvPatchField<Type>::write(os); - os.writeKeyword("patchType") << "cyclicAMI" << token::END_STATEMENT << nl; + os.writeKeyword("patchType") << this->interfaceFieldType() + << token::END_STATEMENT << nl; jump_.writeEntry("jump", os); this->writeEntry("value", os); }