diff --git a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/porousBafflePressure/porousBafflePressureFvPatchField.C b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/porousBafflePressure/porousBafflePressureFvPatchField.C index f249e419bc9f1d592400c3ff280a82bcfed0b21c..b045715f87d917b162ac4209da73cd969398cd77 100644 --- a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/porousBafflePressure/porousBafflePressureFvPatchField.C +++ b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/porousBafflePressure/porousBafflePressureFvPatchField.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation - Copyright (C) 2020 OpenCFD Ltd. + Copyright (C) 2020-2022 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -53,10 +53,11 @@ Foam::porousBafflePressureFvPatchField::porousBafflePressureFvPatchField ( const fvPatch& p, const DimensionedField<scalar, volMesh>& iF, - const dictionary& dict + const dictionary& dict, + const bool valueRequired ) : - fixedJumpFvPatchField<scalar>(p, iF), + fixedJumpFvPatchField<scalar>(p, iF, dict, false), phiName_(dict.getOrDefault<word>("phi", "phi")), rhoName_(dict.getOrDefault<word>("rho", "rho")), D_(Function1<scalar>::New("D", dict, &db())), @@ -64,10 +65,20 @@ Foam::porousBafflePressureFvPatchField::porousBafflePressureFvPatchField length_(dict.get<scalar>("length")), uniformJump_(dict.getOrDefault("uniformJump", false)) { - fvPatchField<scalar>::operator= - ( - Field<scalar>("value", dict, p.size()) - ); + if (valueRequired) + { + if (dict.found("value")) + { + fvPatchField<scalar>::operator= + ( + Field<scalar>("value", dict, p.size()) + ); + } + else + { + this->evaluate(Pstream::commsTypes::blocking); + } + } } @@ -178,6 +189,8 @@ void Foam::porousBafflePressureFvPatchField::updateCoeffs() ); } + this->relax(); + if (debug) { scalar avePressureJump = gAverage(jump()); diff --git a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/porousBafflePressure/porousBafflePressureFvPatchField.H b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/porousBafflePressure/porousBafflePressureFvPatchField.H index f7fd802fc640a8028953763a00cfc4700afe7dc3..0fb4f64e3f6e91ec24dc575e68eb93f8cd75d221 100644 --- a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/porousBafflePressure/porousBafflePressureFvPatchField.H +++ b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/porousBafflePressure/porousBafflePressureFvPatchField.H @@ -162,7 +162,8 @@ public: ( const fvPatch&, const DimensionedField<scalar, volMesh>&, - const dictionary& + const dictionary&, + const bool valueRequired = true ); //- Construct by mapping given porousBafflePressureFvPatchField