Skip to content
Snippets Groups Projects
Commit 0d16e1a7 authored by Andrew Heather's avatar Andrew Heather
Browse files

ENH: variableHeightFlowRateInletVelocity BC - update for moving meshes. See #3012

Dynamic mesh updates trigger a velocity field update. For [this] BC the update
can fail if the dependent alpha field has not already been updated.
parent 513fe05c
No related branches found
No related tags found
No related merge requests found
...@@ -101,18 +101,29 @@ Foam::variableHeightFlowRateInletVelocityFvPatchVectorField ...@@ -101,18 +101,29 @@ Foam::variableHeightFlowRateInletVelocityFvPatchVectorField
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::variableHeightFlowRateInletVelocityFvPatchVectorField void Foam::variableHeightFlowRateInletVelocityFvPatchVectorField::updateCoeffs()
::updateCoeffs()
{ {
if (updated()) if (updated())
{ {
return; return;
} }
scalarField alphap const auto& mesh = patch().boundaryMesh().mesh();
( auto& alpha = mesh.lookupObjectRef<volScalarField>(alphaName_);
patch().lookupPatchField<volScalarField>(alphaName_)
); // Update alpha boundary (if needed) due to mesh changes
if (!mesh.upToDatePoints(alpha))
{
auto& alphabf = alpha.boundaryFieldRef();
if (!alphabf[patch().index()].updated())
{
DebugInfo<< "Updating alpha BC due to mesh changes" << endl;
alphabf.evaluateSelected(labelList({ patch().index() }));
}
}
scalarField alphap(alpha.boundaryField()[patch().index()]);
alphap = max(alphap, scalar(0)); alphap = max(alphap, scalar(0));
alphap = min(alphap, scalar(1)); alphap = min(alphap, scalar(1));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment