Generalised to support static pressure as well as "pd".
authorhenry <henry>
Mon, 8 Jun 2009 16:42:18 +0000 (8 17:42 +0100)
committerhenry <henry>
Mon, 8 Jun 2009 16:42:18 +0000 (8 17:42 +0100)
src/finiteVolume/fields/fvPatchFields/derived/fixedFluxBuoyantPressure/fixedFluxBuoyantPressureFvPatchScalarField.C

index 796a11e..b6f48ff 100644 (file)
@@ -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<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();
 }