From 6629d6721dd660c2a258b05b46f3225bdb2d39d8 Mon Sep 17 00:00:00 2001 From: henry Date: Mon, 8 Jun 2009 17:42:18 +0100 Subject: [PATCH] Generalised to support static pressure as well as "pd". --- .../fixedFluxBuoyantPressureFvPatchScalarField.C | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fixedFluxBuoyantPressure/fixedFluxBuoyantPressureFvPatchScalarField.C b/src/finiteVolume/fields/fvPatchFields/derived/fixedFluxBuoyantPressure/fixedFluxBuoyantPressureFvPatchScalarField.C index 796a11e..b6f48ff 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/fixedFluxBuoyantPressure/fixedFluxBuoyantPressureFvPatchScalarField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/fixedFluxBuoyantPressure/fixedFluxBuoyantPressureFvPatchScalarField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2008 OpenCFD Ltd. + \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -113,7 +113,17 @@ void fixedFluxBuoyantPressureFvPatchScalarField::updateCoeffs() const fvPatchField& rho = patch().lookupPatchField("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(); } -- 2.11.4.GIT