diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fixedFluxBuoyantPressure/fixedFluxBuoyantPressureFvPatchScalarField.C b/src/finiteVolume/fields/fvPatchFields/derived/fixedFluxBuoyantPressure/fixedFluxBuoyantPressureFvPatchScalarField.C index c31f5acc5c3888b49479e7f11b791ae28d51c25c..b6f48ff6ada8e214e41f83c848bafabdb32de46e 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/fixedFluxBuoyantPressure/fixedFluxBuoyantPressureFvPatchScalarField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/fixedFluxBuoyantPressure/fixedFluxBuoyantPressureFvPatchScalarField.C @@ -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(); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fixedFluxBuoyantPressure/fixedFluxBuoyantPressureFvPatchScalarField.H b/src/finiteVolume/fields/fvPatchFields/derived/fixedFluxBuoyantPressure/fixedFluxBuoyantPressureFvPatchScalarField.H index 3ce584bf873cef5a8a88804dd0076b82145be4c5..8e433cb8f167f0304ec840bb270c4521c9230e5b 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/fixedFluxBuoyantPressure/fixedFluxBuoyantPressureFvPatchScalarField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/fixedFluxBuoyantPressure/fixedFluxBuoyantPressureFvPatchScalarField.H @@ -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