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

This commit is contained in:
henry
2009-05-29 11:57:15 +01:00
parent 20dcad4e57
commit 80175df2dd
2 changed files with 15 additions and 2 deletions

View File

@ -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();
}

View File

@ -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