mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: fanPressure - use fanCurve entry if present
- only use implicit legacy handling if the "fanCurve" entry is missing and the "file" entry is present.
This commit is contained in:
@ -54,7 +54,7 @@ Foam::fanPressureFvPatchScalarField::fanPressureFvPatchScalarField
|
|||||||
)
|
)
|
||||||
:
|
:
|
||||||
totalPressureFvPatchScalarField(p, iF),
|
totalPressureFvPatchScalarField(p, iF),
|
||||||
fanCurve_(),
|
fanCurve_(nullptr),
|
||||||
direction_(ffdOut),
|
direction_(ffdOut),
|
||||||
rpm_(0),
|
rpm_(0),
|
||||||
dm_(0),
|
dm_(0),
|
||||||
@ -87,15 +87,15 @@ Foam::fanPressureFvPatchScalarField::fanPressureFvPatchScalarField
|
|||||||
)
|
)
|
||||||
:
|
:
|
||||||
totalPressureFvPatchScalarField(p, iF, dict),
|
totalPressureFvPatchScalarField(p, iF, dict),
|
||||||
fanCurve_(),
|
fanCurve_(nullptr),
|
||||||
direction_(fanFlowDirectionNames_.get("direction", dict)),
|
direction_(fanFlowDirectionNames_.get("direction", dict)),
|
||||||
rpm_(0),
|
rpm_(0),
|
||||||
dm_(0),
|
dm_(0),
|
||||||
nonDimensional_(dict.getOrDefault("nonDimensional", false))
|
nonDimensional_(dict.getOrDefault("nonDimensional", false))
|
||||||
{
|
{
|
||||||
// Backwards compatibility
|
if (dict.found("file") && !dict.found("fanCurve"))
|
||||||
if (dict.found("file"))
|
|
||||||
{
|
{
|
||||||
|
// Backwards compatibility (2006 and earlier)
|
||||||
fanCurve_.reset
|
fanCurve_.reset
|
||||||
(
|
(
|
||||||
new Function1Types::TableFile<scalar>("fanCurve", dict)
|
new Function1Types::TableFile<scalar>("fanCurve", dict)
|
||||||
@ -160,7 +160,7 @@ void Foam::fanPressureFvPatchScalarField::updateCoeffs()
|
|||||||
|
|
||||||
const auto& phip = patch().patchField<surfaceScalarField, scalar>(phi);
|
const auto& phip = patch().patchField<surfaceScalarField, scalar>(phi);
|
||||||
|
|
||||||
int dir = 2*direction_ - 1;
|
const int dir = 2*direction_ - 1;
|
||||||
|
|
||||||
// Average volumetric flow rate
|
// Average volumetric flow rate
|
||||||
scalar volFlowRate = 0;
|
scalar volFlowRate = 0;
|
||||||
@ -193,7 +193,7 @@ void Foam::fanPressureFvPatchScalarField::updateCoeffs()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Pressure drop for this flow rate
|
// Pressure drop for this flow rate
|
||||||
scalar pdFan = fanCurve_->value(max(volFlowRate, 0.0));
|
scalar pdFan = fanCurve_->value(max(volFlowRate, scalar(0)));
|
||||||
|
|
||||||
if (nonDimensional_)
|
if (nonDimensional_)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -34,10 +34,10 @@ Description
|
|||||||
This boundary condition can be applied to assign either a pressure inlet
|
This boundary condition can be applied to assign either a pressure inlet
|
||||||
or outlet total pressure condition for a fan.
|
or outlet total pressure condition for a fan.
|
||||||
|
|
||||||
The switch nonDimensional can be used for a non-dimensional table. It needs
|
The switch nonDimensional can be used for a non-dimensional fan curve.
|
||||||
inputs rpm and dm of the fan.
|
It needs inputs rpm and dm of the fan.
|
||||||
|
|
||||||
The nonDimensional flux for the table is calculate as :
|
The nonDimensional flux is calculate as :
|
||||||
|
|
||||||
phi = 4.0*mDot/(rho*sqr(PI)*dm^3*omega)
|
phi = 4.0*mDot/(rho*sqr(PI)*dm^3*omega)
|
||||||
where:
|
where:
|
||||||
@ -54,14 +54,15 @@ Description
|
|||||||
|
|
||||||
Usage
|
Usage
|
||||||
\table
|
\table
|
||||||
Property | Description | Required | Default value
|
Property | Description | Required | Default
|
||||||
file | fan curve file name | yes |
|
fanCurve | Pressure vs flow-rate | yes |
|
||||||
outOfBounds | out of bounds handling | yes |
|
outOfBounds | out of bounds handling | yes |
|
||||||
direction | direction of flow through fan [in/out] | yes |
|
direction | direction of flow through fan [in/out] | yes |
|
||||||
p0 | environmental total pressure | yes |
|
p0 | environmental total pressure | yes |
|
||||||
nonDimensional | uses non-dimensional table | no | false
|
nonDimensional | uses non-dimensional table | no | false
|
||||||
rpm | fan rpm for non-dimensional table | no | 0.0
|
rpm | fan rpm for non-dimensional table | no | 0
|
||||||
dm | mean diameter for non-dimensional table | no | 0.0
|
dm | mean diameter for non-dimensional table | no | 0.0
|
||||||
|
file | fan curve file name | legacy |
|
||||||
\endtable
|
\endtable
|
||||||
|
|
||||||
Example of the boundary condition specification:
|
Example of the boundary condition specification:
|
||||||
@ -69,26 +70,34 @@ Usage
|
|||||||
inlet
|
inlet
|
||||||
{
|
{
|
||||||
type fanPressure;
|
type fanPressure;
|
||||||
fanCurve tableFile;
|
|
||||||
file "fanCurve";
|
|
||||||
outOfBounds clamp;
|
|
||||||
direction in;
|
direction in;
|
||||||
|
fanCurve tableFile;
|
||||||
|
fanCurveCoeffs
|
||||||
|
{
|
||||||
|
file "<constant>/fanCurve";
|
||||||
|
outOfBounds clamp;
|
||||||
|
}
|
||||||
p0 uniform 0;
|
p0 uniform 0;
|
||||||
value uniform 0;
|
value uniform 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Legacy specification
|
||||||
outlet
|
outlet
|
||||||
{
|
{
|
||||||
type fanPressure;
|
type fanPressure;
|
||||||
fanCurve tableFile;
|
|
||||||
file "fanCurve";
|
|
||||||
outOfBounds clamp;
|
|
||||||
direction out;
|
direction out;
|
||||||
|
file "<constant>/fanCurve";
|
||||||
|
outOfBounds clamp;
|
||||||
p0 uniform 0;
|
p0 uniform 0;
|
||||||
value uniform 0;
|
value uniform 0;
|
||||||
}
|
}
|
||||||
\endverbatim
|
\endverbatim
|
||||||
|
|
||||||
|
Note
|
||||||
|
For compatibility with older versions (OpenFOAM-v2006 and earlier),
|
||||||
|
a missing \c fanCurve keyword is treated as a tableFile and makes
|
||||||
|
the \c file keyword mandatory.
|
||||||
|
|
||||||
See also
|
See also
|
||||||
Foam::fanFvPatchField
|
Foam::fanFvPatchField
|
||||||
Foam::totalPressureFvPatchScalarField
|
Foam::totalPressureFvPatchScalarField
|
||||||
|
|||||||
@ -24,14 +24,17 @@ boundaryField
|
|||||||
inlet
|
inlet
|
||||||
{
|
{
|
||||||
type fanPressure;
|
type fanPressure;
|
||||||
outOfBounds clamp;
|
|
||||||
direction in;
|
direction in;
|
||||||
readerType openFoam;
|
fanCurve tableFile;
|
||||||
|
fanCurveCoeffs
|
||||||
|
{
|
||||||
file "<constant>/FluxVsdP.dat";
|
file "<constant>/FluxVsdP.dat";
|
||||||
|
// readerType openFoam; // Default
|
||||||
|
// outOfBounds clamp; // Default
|
||||||
|
}
|
||||||
//nonDimensional true;
|
//nonDimensional true;
|
||||||
//rpm 300;
|
//rpm 300;
|
||||||
//dm 2e-2;
|
//dm 2e-2;
|
||||||
outOfBounds clamp;
|
|
||||||
p0 uniform 30;
|
p0 uniform 30;
|
||||||
}
|
}
|
||||||
outlet1
|
outlet1
|
||||||
|
|||||||
Reference in New Issue
Block a user