Skip to content
Snippets Groups Projects
Commit a4d235af authored by Kutalmış Berçin's avatar Kutalmış Berçin
Browse files

BUG: porousBafflePressure: read fixedJump entries - apply under-relaxation (fixes #2626)

parent dffac4d8
Branches
Tags
No related merge requests found
......@@ -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());
......
......@@ -162,7 +162,8 @@ public:
(
const fvPatch&,
const DimensionedField<scalar, volMesh>&,
const dictionary&
const dictionary&,
const bool valueRequired = true
);
//- Construct by mapping given porousBafflePressureFvPatchField
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment