ENH: Updated fan BC - now derived from uniformJump BC

This commit is contained in:
andy
2012-10-25 16:27:01 +01:00
parent 10af522789
commit 29162ece83
3 changed files with 17 additions and 42 deletions

View File

@ -34,8 +34,7 @@ Foam::fanFvPatchField<Type>::fanFvPatchField
const DimensionedField<Type, volMesh>& iF const DimensionedField<Type, volMesh>& iF
) )
: :
fixedJumpFvPatchField<Type>(p, iF), uniformJumpFvPatchField<Type>(p, iF)
jumpTable_(0)
{} {}
@ -48,8 +47,7 @@ Foam::fanFvPatchField<Type>::fanFvPatchField
const fvPatchFieldMapper& mapper const fvPatchFieldMapper& mapper
) )
: :
fixedJumpFvPatchField<Type>(ptf, p, iF, mapper), uniformJumpFvPatchField<Type>(ptf, p, iF, mapper)
jumpTable_(ptf.jumpTable_().clone().ptr())
{} {}
@ -61,8 +59,7 @@ Foam::fanFvPatchField<Type>::fanFvPatchField
const dictionary& dict const dictionary& dict
) )
: :
fixedJumpFvPatchField<Type>(p, iF), uniformJumpFvPatchField<Type>(p, iF, dict)
jumpTable_(DataEntry<Type>::New("jumpTable", dict))
{} {}
@ -72,9 +69,7 @@ Foam::fanFvPatchField<Type>::fanFvPatchField
const fanFvPatchField<Type>& ptf const fanFvPatchField<Type>& ptf
) )
: :
cyclicLduInterfaceField(), uniformJumpFvPatchField<Type>(ptf)
fixedJumpFvPatchField<Type>(ptf),
jumpTable_(ptf.jumpTable_().clone().ptr())
{} {}
@ -85,23 +80,8 @@ Foam::fanFvPatchField<Type>::fanFvPatchField
const DimensionedField<Type, volMesh>& iF const DimensionedField<Type, volMesh>& iF
) )
: :
fixedJumpFvPatchField<Type>(ptf, iF), uniformJumpFvPatchField<Type>(ptf, iF)
jumpTable_(ptf.jumpTable_().clone().ptr())
{} {}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class Type>
void Foam::fanFvPatchField<Type>::write(Ostream& os) const
{
fixedJumpFvPatchField<Type>::write(os);
if (this->cyclicPatch().owner())
{
jumpTable_->writeData(os);
}
}
// ************************************************************************* // // ************************************************************************* //

View File

@ -83,7 +83,7 @@ SourceFiles
#ifndef fanFvPatchField_H #ifndef fanFvPatchField_H
#define fanFvPatchField_H #define fanFvPatchField_H
#include "fixedJumpFvPatchField.H" #include "uniformJumpFvPatchField.H"
#include "DataEntry.H" #include "DataEntry.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -98,13 +98,8 @@ namespace Foam
template<class Type> template<class Type>
class fanFvPatchField class fanFvPatchField
: :
public fixedJumpFvPatchField<Type> public uniformJumpFvPatchField<Type>
{ {
// Private data
//- Interpolation table
autoPtr<DataEntry<Type> > jumpTable_;
public: public:
@ -179,10 +174,6 @@ public:
//- Update the coefficients associated with the patch field //- Update the coefficients associated with the patch field
virtual void updateCoeffs(); virtual void updateCoeffs();
//- Write
virtual void write(Ostream&) const;
}; };

View File

@ -53,8 +53,7 @@ Foam::fanFvPatchField<Foam::scalar>::fanFvPatchField
const dictionary& dict const dictionary& dict
) )
: :
fixedJumpFvPatchField<scalar>(p, iF), uniformJumpFvPatchField<scalar>(p, iF)
jumpTable_(new DataEntry<scalar>("jumpTable"))
{ {
if (this->cyclicPatch().owner()) if (this->cyclicPatch().owner())
{ {
@ -83,7 +82,7 @@ Foam::fanFvPatchField<Foam::scalar>::fanFvPatchField
} }
} }
jumpTable_.reset this->jumpTable_.reset
( (
new polynomial("jumpTable", coeffs) new polynomial("jumpTable", coeffs)
); );
@ -91,9 +90,14 @@ Foam::fanFvPatchField<Foam::scalar>::fanFvPatchField
else else
{ {
// Generic input constructed from dictionary // Generic input constructed from dictionary
jumpTable_ = DataEntry<scalar>::New("jumpTable", dict); this->jumpTable_ = DataEntry<scalar>::New("jumpTable", dict);
} }
} }
else
{
// Generic input constructed from dictionary
this->jumpTable_.reset(new DataEntry<scalar>("jumpTable"));
}
if (dict.found("value")) if (dict.found("value"))
@ -136,10 +140,10 @@ void Foam::fanFvPatchField<Foam::scalar>::updateCoeffs()
Un /= patch().lookupPatchField<volScalarField, scalar>("rho"); Un /= patch().lookupPatchField<volScalarField, scalar>("rho");
} }
jump_ = jumpTable_->value(Un); this->jump_ = this->jumpTable_->value(Un);
} }
fixedJumpFvPatchField<scalar>::updateCoeffs(); uniformJumpFvPatchField<scalar>::updateCoeffs();
} }