mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Changed the BC to switch between "pd" and static pressure according to the variable name.
This commit is contained in:
@ -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
|
||||
|
||||
Reference in New Issue
Block a user