From 34bd3b59cbbba2dadf882f157803bf029224ddc3 Mon Sep 17 00:00:00 2001 From: Andrew Heather Date: Mon, 29 Feb 2016 17:22:14 +0000 Subject: [PATCH] BUG: Fan boundary condition - write phiName and rhoName if required --- .../derived/fan/fanFvPatchField.C | 29 +++++++++++++++---- .../derived/fan/fanFvPatchField.H | 3 ++ 2 files changed, 27 insertions(+), 5 deletions(-) diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchField.C index 6885bd7d4d..eb38f7391a 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchField.C @@ -46,7 +46,9 @@ Foam::fanFvPatchField::fanFvPatchField const DimensionedField& iF ) : - uniformJumpFvPatchField(p, iF) + uniformJumpFvPatchField(p, iF), + phiName_("phi"), + rhoName_("none") {} @@ -59,7 +61,9 @@ Foam::fanFvPatchField::fanFvPatchField const fvPatchFieldMapper& mapper ) : - uniformJumpFvPatchField(ptf, p, iF, mapper) + uniformJumpFvPatchField(ptf, p, iF, mapper), + phiName_(ptf.phiName_), + rhoName_(ptf.rhoName_) {} @@ -71,7 +75,9 @@ Foam::fanFvPatchField::fanFvPatchField const dictionary& dict ) : - uniformJumpFvPatchField(p, iF, dict) + uniformJumpFvPatchField(p, iF, dict), + phiName_(dict.lookupOrDefault("phi", "phi")), + rhoName_(dict.lookupOrDefault("rho", "none")) {} @@ -81,7 +87,9 @@ Foam::fanFvPatchField::fanFvPatchField const fanFvPatchField& ptf ) : - uniformJumpFvPatchField(ptf) + uniformJumpFvPatchField(ptf), + phiName_(ptf.phiName_), + rhoName_(ptf.rhoName_) {} @@ -92,7 +100,9 @@ Foam::fanFvPatchField::fanFvPatchField const DimensionedField& iF ) : - uniformJumpFvPatchField(ptf, iF) + uniformJumpFvPatchField(ptf, iF), + phiName_(ptf.phiName_), + rhoName_(ptf.rhoName_) {} @@ -113,4 +123,13 @@ void Foam::fanFvPatchField::updateCoeffs() } +template +void Foam::fanFvPatchField::write(Ostream& os) const +{ + this->template writeEntryIfDifferent(os, "phi", "phi", phiName_); + this->template writeEntryIfDifferent(os, "rho", "none", rhoName_); + uniformJumpFvPatchField::write(os); +} + + // ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchField.H index fd27dfecd3..2ad75b1da6 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchField.H @@ -187,6 +187,9 @@ public: //- Update the coefficients associated with the patch field virtual void updateCoeffs(); + + //- Write + virtual void write(Ostream&) const; };