Skip to content
Snippets Groups Projects
Commit 80175df2 authored by henry's avatar henry
Browse files

Changed the BC to switch between "pd" and static pressure according to the variable name.

parent 20dcad4e
Branches
Tags
No related merge requests found
......@@ -113,7 +113,17 @@ void fixedFluxBuoyantPressureFvPatchScalarField::updateCoeffs()
const fvPatchField<scalar>& rho =
patch().lookupPatchField<volScalarField, scalar>("rho");
gradient() = -rho.snGrad()*(g.value() & patch().Cf());
// If the variable name is "pd" assume it is p - rho*g.h
// and set the gradient appropriately.
// Otherwise assume the variable is the static pressure.
if (dimensionedInternalField().name() == "pd")
{
gradient() = -rho.snGrad()*(g.value() & patch().Cf());
}
else
{
gradient() = rho*(g.value() & patch().nf());
}
fixedGradientFvPatchScalarField::updateCoeffs();
}
......
......@@ -26,7 +26,10 @@ Class
Foam::fixedFluxBuoyantPressureFvPatchScalarField
Description
Foam::fixedFluxBuoyantPressureFvPatchScalarField
Set the pressure gradient boundary condition appropriately for buoyant flow.
If the variable name is "pd" assume it is p - rho*g.h and set the gradient
appropriately. Otherwise assume the variable is the static pressure.
SourceFiles
fixedFluxBuoyantPressureFvPatchScalarField.C
......
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