mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: fanPressureFvPatchScalarField - adjust compatibility handling
COMP: add missing clone() for fanCurve member STYLE: reduce padding in data members
This commit is contained in:
@ -56,9 +56,9 @@ Foam::fanPressureFvPatchScalarField::fanPressureFvPatchScalarField
|
||||
totalPressureFvPatchScalarField(p, iF),
|
||||
fanCurve_(nullptr),
|
||||
direction_(ffdOut),
|
||||
nonDimensional_(false),
|
||||
rpm_(0),
|
||||
dm_(0),
|
||||
nonDimensional_(false)
|
||||
dm_(0)
|
||||
{}
|
||||
|
||||
|
||||
@ -71,11 +71,11 @@ Foam::fanPressureFvPatchScalarField::fanPressureFvPatchScalarField
|
||||
)
|
||||
:
|
||||
totalPressureFvPatchScalarField(ptf, p, iF, mapper),
|
||||
fanCurve_(ptf.fanCurve_),
|
||||
fanCurve_(ptf.fanCurve_.clone()),
|
||||
direction_(ptf.direction_),
|
||||
nonDimensional_(ptf.nonDimensional_),
|
||||
rpm_(ptf.rpm_),
|
||||
dm_(ptf.dm_),
|
||||
nonDimensional_(ptf.nonDimensional_)
|
||||
dm_(ptf.dm_)
|
||||
{}
|
||||
|
||||
|
||||
@ -89,13 +89,13 @@ Foam::fanPressureFvPatchScalarField::fanPressureFvPatchScalarField
|
||||
totalPressureFvPatchScalarField(p, iF, dict),
|
||||
fanCurve_(nullptr),
|
||||
direction_(fanFlowDirectionNames_.get("direction", dict)),
|
||||
nonDimensional_(dict.getOrDefault("nonDimensional", false)),
|
||||
rpm_(0),
|
||||
dm_(0),
|
||||
nonDimensional_(dict.getOrDefault("nonDimensional", false))
|
||||
dm_(0)
|
||||
{
|
||||
if (dict.found("file") && !dict.found("fanCurve"))
|
||||
// Backwards compatibility
|
||||
if (dict.found("file"))
|
||||
{
|
||||
// Backwards compatibility (2006 and earlier)
|
||||
fanCurve_.reset
|
||||
(
|
||||
new Function1Types::TableFile<scalar>("fanCurve", dict)
|
||||
@ -125,9 +125,9 @@ Foam::fanPressureFvPatchScalarField::fanPressureFvPatchScalarField
|
||||
totalPressureFvPatchScalarField(fppsf),
|
||||
fanCurve_(fppsf.fanCurve_.clone()),
|
||||
direction_(fppsf.direction_),
|
||||
nonDimensional_(fppsf.nonDimensional_),
|
||||
rpm_(fppsf.rpm_),
|
||||
dm_(fppsf.dm_),
|
||||
nonDimensional_(fppsf.nonDimensional_)
|
||||
dm_(fppsf.dm_)
|
||||
{}
|
||||
|
||||
|
||||
@ -140,9 +140,9 @@ Foam::fanPressureFvPatchScalarField::fanPressureFvPatchScalarField
|
||||
totalPressureFvPatchScalarField(fppsf, iF),
|
||||
fanCurve_(fppsf.fanCurve_.clone()),
|
||||
direction_(fppsf.direction_),
|
||||
nonDimensional_(fppsf.nonDimensional_),
|
||||
rpm_(fppsf.rpm_),
|
||||
dm_(fppsf.dm_),
|
||||
nonDimensional_(fppsf.nonDimensional_)
|
||||
dm_(fppsf.dm_)
|
||||
{}
|
||||
|
||||
|
||||
|
||||
@ -56,13 +56,13 @@ Usage
|
||||
\table
|
||||
Property | Description | Required | Default
|
||||
fanCurve | Pressure vs flow-rate | yes |
|
||||
outOfBounds | out of bounds handling | yes |
|
||||
direction | direction of flow through fan [in/out] | yes |
|
||||
p0 | environmental total pressure | yes |
|
||||
nonDimensional | uses non-dimensional table | no | false
|
||||
rpm | fan rpm for non-dimensional table | no | 0
|
||||
dm | mean diameter for non-dimensional table | no | 0.0
|
||||
file | fan curve file name | legacy |
|
||||
outOfBounds | out of bounds handling | legacy |
|
||||
\endtable
|
||||
|
||||
Example of the boundary condition specification:
|
||||
@ -104,7 +104,7 @@ See also
|
||||
Foam::Function1
|
||||
|
||||
SourceFiles
|
||||
fanPressureFvPatchScalarField.C
|
||||
fanPressureFvPatchScalarField.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -127,11 +127,10 @@ class fanPressureFvPatchScalarField
|
||||
:
|
||||
public totalPressureFvPatchScalarField
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
//- Fan flow direction
|
||||
enum fanFlowDirection
|
||||
enum fanFlowDirection : uint8_t
|
||||
{
|
||||
ffdIn,
|
||||
ffdOut
|
||||
@ -151,15 +150,15 @@ private:
|
||||
//- Direction of flow through the fan relative to patch
|
||||
fanFlowDirection direction_;
|
||||
|
||||
//- Use non-dimensional curve
|
||||
bool nonDimensional_;
|
||||
|
||||
//- Fan rpm (for non-dimensional curve)
|
||||
scalar rpm_;
|
||||
|
||||
//- Fan mean diameter (for non-dimensional curve)
|
||||
scalar dm_;
|
||||
|
||||
//- Use non-dimensional curve
|
||||
bool nonDimensional_;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user