diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchField.C index 6885bd7d4d..3f855d52fa 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -46,7 +46,23 @@ Foam::fanFvPatchField::fanFvPatchField const DimensionedField& iF ) : - uniformJumpFvPatchField(p, iF) + uniformJumpFvPatchField(p, iF), + phiName_("phi"), + rhoName_("rho") +{} + + +template +Foam::fanFvPatchField::fanFvPatchField +( + const fvPatch& p, + const DimensionedField& iF, + const dictionary& dict +) +: + uniformJumpFvPatchField(p, iF, dict), + phiName_(dict.lookupOrDefault("phi", "phi")), + rhoName_(dict.lookupOrDefault("rho", "rho")) {} @@ -59,19 +75,9 @@ Foam::fanFvPatchField::fanFvPatchField const fvPatchFieldMapper& mapper ) : - uniformJumpFvPatchField(ptf, p, iF, mapper) -{} - - -template -Foam::fanFvPatchField::fanFvPatchField -( - const fvPatch& p, - const DimensionedField& iF, - const dictionary& dict -) -: - uniformJumpFvPatchField(p, iF, dict) + uniformJumpFvPatchField(ptf, p, iF, mapper), + phiName_(ptf.phiName_), + rhoName_(ptf.rhoName_) {} @@ -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 +{ + uniformJumpFvPatchField::write(os); + this->template writeEntryIfDifferent(os, "phi", "phi", phiName_); + this->template writeEntryIfDifferent(os, "rho", "rho", rhoName_); +} + + // ************************************************************************* // 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; }; diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchFields.C b/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchFields.C index ea9ecdea57..81adcbf2b8 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchFields.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchFields.C @@ -78,7 +78,7 @@ Foam::fanFvPatchField::fanFvPatchField : uniformJumpFvPatchField(p, iF), phiName_(dict.lookupOrDefault("phi", "phi")), - rhoName_(dict.lookupOrDefault("rho", "none")) + rhoName_(dict.lookupOrDefault("rho", "rho")) { if (this->cyclicPatch().owner()) { diff --git a/src/finiteVolume/fields/fvPatchFields/derived/freestreamPressure/freestreamPressureFvPatchScalarField.C b/src/finiteVolume/fields/fvPatchFields/derived/freestreamPressure/freestreamPressureFvPatchScalarField.C index b50eac91b8..a32d667709 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/freestreamPressure/freestreamPressureFvPatchScalarField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/freestreamPressure/freestreamPressureFvPatchScalarField.C @@ -42,7 +42,7 @@ freestreamPressureFvPatchScalarField zeroGradientFvPatchScalarField(p, iF), UName_("U"), phiName_("phi"), - rhoName_("none") + rhoName_("rho") {} @@ -57,7 +57,7 @@ freestreamPressureFvPatchScalarField zeroGradientFvPatchScalarField(p, iF, dict), UName_(dict.lookupOrDefault("U", "U")), phiName_(dict.lookupOrDefault("phi", "phi")), - rhoName_(dict.lookupOrDefault("rho", "none")) + rhoName_(dict.lookupOrDefault("rho", "rho")) {} @@ -153,6 +153,16 @@ void Foam::freestreamPressureFvPatchScalarField::updateCoeffs() } +void Foam::freestreamPressureFvPatchScalarField::write(Ostream& os) const +{ + fvPatchScalarField::write(os); + writeEntryIfDifferent(os, "U", "U", UName_); + writeEntryIfDifferent(os, "phi", "phi", phiName_); + writeEntryIfDifferent(os, "rho", "rho", rhoName_); + writeEntry("value", os); +} + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam diff --git a/src/finiteVolume/fields/fvPatchFields/derived/freestreamPressure/freestreamPressureFvPatchScalarField.H b/src/finiteVolume/fields/fvPatchFields/derived/freestreamPressure/freestreamPressureFvPatchScalarField.H index 4d8c5d1807..49687b0ec9 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/freestreamPressure/freestreamPressureFvPatchScalarField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/freestreamPressure/freestreamPressureFvPatchScalarField.H @@ -167,6 +167,10 @@ public: //- Update the coefficients associated with the patch field virtual void updateCoeffs(); + + + //- Write + virtual void write(Ostream&) const; }; diff --git a/src/finiteVolume/fields/fvPatchFields/derived/syringePressure/syringePressureFvPatchScalarField.C b/src/finiteVolume/fields/fvPatchFields/derived/syringePressure/syringePressureFvPatchScalarField.C index 20690258a3..3407e259ab 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/syringePressure/syringePressureFvPatchScalarField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/syringePressure/syringePressureFvPatchScalarField.C @@ -243,6 +243,7 @@ void Foam::syringePressureFvPatchScalarField::write(Ostream& os) const os.writeKeyword("psI") << psI_ << token::END_STATEMENT << nl; os.writeKeyword("psi") << psi_ << token::END_STATEMENT << nl; os.writeKeyword("ams") << ams_ << token::END_STATEMENT << nl; + writeEntryIfDifferent(os, "phi", "phi", phiName_); writeEntry("value", os); }