BUG: Fan boundary condition - write phiName and rhoName if required

This commit is contained in:
Andrew Heather
2016-02-29 17:22:14 +00:00
parent 14aee79198
commit 34bd3b59cb
2 changed files with 27 additions and 5 deletions

View File

@ -46,7 +46,9 @@ Foam::fanFvPatchField<Type>::fanFvPatchField
const DimensionedField<Type, volMesh>& iF const DimensionedField<Type, volMesh>& iF
) )
: :
uniformJumpFvPatchField<Type>(p, iF) uniformJumpFvPatchField<Type>(p, iF),
phiName_("phi"),
rhoName_("none")
{} {}
@ -59,7 +61,9 @@ Foam::fanFvPatchField<Type>::fanFvPatchField
const fvPatchFieldMapper& mapper const fvPatchFieldMapper& mapper
) )
: :
uniformJumpFvPatchField<Type>(ptf, p, iF, mapper) uniformJumpFvPatchField<Type>(ptf, p, iF, mapper),
phiName_(ptf.phiName_),
rhoName_(ptf.rhoName_)
{} {}
@ -71,7 +75,9 @@ Foam::fanFvPatchField<Type>::fanFvPatchField
const dictionary& dict const dictionary& dict
) )
: :
uniformJumpFvPatchField<Type>(p, iF, dict) uniformJumpFvPatchField<Type>(p, iF, dict),
phiName_(dict.lookupOrDefault<word>("phi", "phi")),
rhoName_(dict.lookupOrDefault<word>("rho", "none"))
{} {}
@ -81,7 +87,9 @@ Foam::fanFvPatchField<Type>::fanFvPatchField
const fanFvPatchField<Type>& ptf const fanFvPatchField<Type>& ptf
) )
: :
uniformJumpFvPatchField<Type>(ptf) uniformJumpFvPatchField<Type>(ptf),
phiName_(ptf.phiName_),
rhoName_(ptf.rhoName_)
{} {}
@ -92,7 +100,9 @@ Foam::fanFvPatchField<Type>::fanFvPatchField
const DimensionedField<Type, volMesh>& iF const DimensionedField<Type, volMesh>& iF
) )
: :
uniformJumpFvPatchField<Type>(ptf, iF) uniformJumpFvPatchField<Type>(ptf, iF),
phiName_(ptf.phiName_),
rhoName_(ptf.rhoName_)
{} {}
@ -113,4 +123,13 @@ void Foam::fanFvPatchField<Type>::updateCoeffs()
} }
template<class Type>
void Foam::fanFvPatchField<Type>::write(Ostream& os) const
{
this->template writeEntryIfDifferent<word>(os, "phi", "phi", phiName_);
this->template writeEntryIfDifferent<word>(os, "rho", "none", rhoName_);
uniformJumpFvPatchField<Type>::write(os);
}
// ************************************************************************* // // ************************************************************************* //

View File

@ -187,6 +187,9 @@ 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;
}; };