STYLE: group bool members together for better packing

This commit is contained in:
Mark Olesen
2019-08-22 10:12:49 +02:00
committed by Andrew Heather
parent 922ef9b879
commit a6581d3082
8 changed files with 69 additions and 66 deletions

View File

@ -54,9 +54,9 @@ Foam::fanPressureFvPatchScalarField::fanPressureFvPatchScalarField
totalPressureFvPatchScalarField(p, iF), totalPressureFvPatchScalarField(p, iF),
fanCurve_(), fanCurve_(),
direction_(ffdOut), direction_(ffdOut),
nonDimensional_(false), rpm_(0),
rpm_(0.0), dm_(0),
dm_(0.0) nonDimensional_(false)
{} {}
@ -71,9 +71,9 @@ Foam::fanPressureFvPatchScalarField::fanPressureFvPatchScalarField
totalPressureFvPatchScalarField(ptf, p, iF, mapper), totalPressureFvPatchScalarField(ptf, p, iF, mapper),
fanCurve_(ptf.fanCurve_), fanCurve_(ptf.fanCurve_),
direction_(ptf.direction_), direction_(ptf.direction_),
nonDimensional_(ptf.nonDimensional_),
rpm_(ptf.rpm_), rpm_(ptf.rpm_),
dm_(ptf.dm_) dm_(ptf.dm_),
nonDimensional_(ptf.nonDimensional_)
{} {}
@ -87,9 +87,9 @@ Foam::fanPressureFvPatchScalarField::fanPressureFvPatchScalarField
totalPressureFvPatchScalarField(p, iF, dict), totalPressureFvPatchScalarField(p, iF, dict),
fanCurve_(dict), fanCurve_(dict),
direction_(fanFlowDirectionNames_.get("direction", dict)), direction_(fanFlowDirectionNames_.get("direction", dict)),
nonDimensional_(dict.lookupOrDefault<Switch>("nonDimensional", false)), rpm_(0),
rpm_(dict.lookupOrDefault<scalar>("rpm", 0.0)), dm_(0),
dm_(dict.lookupOrDefault<scalar>("dm", 0.0)) nonDimensional_(dict.lookupOrDefault("nonDimensional", false))
{ {
if (nonDimensional_) if (nonDimensional_)
{ {
@ -107,9 +107,9 @@ Foam::fanPressureFvPatchScalarField::fanPressureFvPatchScalarField
totalPressureFvPatchScalarField(pfopsf), totalPressureFvPatchScalarField(pfopsf),
fanCurve_(pfopsf.fanCurve_), fanCurve_(pfopsf.fanCurve_),
direction_(pfopsf.direction_), direction_(pfopsf.direction_),
nonDimensional_(pfopsf.nonDimensional_),
rpm_(pfopsf.rpm_), rpm_(pfopsf.rpm_),
dm_(pfopsf.dm_) dm_(pfopsf.dm_),
nonDimensional_(pfopsf.nonDimensional_)
{} {}
@ -122,9 +122,9 @@ Foam::fanPressureFvPatchScalarField::fanPressureFvPatchScalarField
totalPressureFvPatchScalarField(pfopsf, iF), totalPressureFvPatchScalarField(pfopsf, iF),
fanCurve_(pfopsf.fanCurve_), fanCurve_(pfopsf.fanCurve_),
direction_(pfopsf.direction_), direction_(pfopsf.direction_),
nonDimensional_(pfopsf.nonDimensional_),
rpm_(pfopsf.rpm_), rpm_(pfopsf.rpm_),
dm_(pfopsf.dm_) dm_(pfopsf.dm_),
nonDimensional_(pfopsf.nonDimensional_)
{} {}
@ -198,9 +198,12 @@ void Foam::fanPressureFvPatchScalarField::write(Ostream& os) const
totalPressureFvPatchScalarField::write(os); totalPressureFvPatchScalarField::write(os);
fanCurve_.write(os); fanCurve_.write(os);
os.writeEntry("direction", fanFlowDirectionNames_[direction_]); os.writeEntry("direction", fanFlowDirectionNames_[direction_]);
os.writeEntry("nonDimensional", nonDimensional_); if (nonDimensional_)
os.writeEntry("rpm", rpm_); {
os.writeEntry("dm", dm_); os.writeEntry("nonDimensional", "true");
os.writeEntry("rpm", rpm_);
os.writeEntry("dm", dm_);
}
} }

View File

@ -131,7 +131,7 @@ public:
private: private:
// Private data // Private Data
//- Tabulated fan curve //- Tabulated fan curve
interpolationTable<scalar> fanCurve_; interpolationTable<scalar> fanCurve_;
@ -139,16 +139,14 @@ private:
//- Direction of flow through the fan relative to patch //- Direction of flow through the fan relative to patch
fanFlowDirection direction_; fanFlowDirection direction_;
//- Switch for using non-dimensional curve //- Fan rpm (for non-dimensional curve)
Switch nonDimensional_; scalar rpm_;
// Parameters for non-dimensional table //- Fan mean diameter (for non-dimensional curve)
scalar dm_;
//- Fan rpm //- Use non-dimensional curve
scalar rpm_; bool nonDimensional_;
//- Fan mean diameter
scalar dm_;
public: public:
@ -230,7 +228,7 @@ public:
virtual void updateCoeffs(); virtual void updateCoeffs();
//- Write //- Write
virtual void write(Ostream&) const; virtual void write(Ostream& os) const;
}; };

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | \\ / A nd | Copyright (C) 2019 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
| Copyright (C) 2011-2017 OpenFOAM Foundation | Copyright (C) 2011-2017 OpenFOAM Foundation
@ -41,9 +41,9 @@ flowRateInletVelocityFvPatchVectorField
: :
fixedValueFvPatchField<vector>(p, iF), fixedValueFvPatchField<vector>(p, iF),
flowRate_(), flowRate_(),
volumetric_(false),
rhoName_("rho"), rhoName_("rho"),
rhoInlet_(0.0), rhoInlet_(0.0),
volumetric_(false),
extrapolateProfile_(false) extrapolateProfile_(false)
{} {}
@ -57,7 +57,9 @@ flowRateInletVelocityFvPatchVectorField
) )
: :
fixedValueFvPatchField<vector>(p, iF, dict, false), fixedValueFvPatchField<vector>(p, iF, dict, false),
rhoName_("rho"),
rhoInlet_(dict.lookupOrDefault<scalar>("rhoInlet", -VGREAT)), rhoInlet_(dict.lookupOrDefault<scalar>("rhoInlet", -VGREAT)),
volumetric_(false),
extrapolateProfile_ extrapolateProfile_
( (
dict.lookupOrDefault<Switch>("extrapolateProfile", false) dict.lookupOrDefault<Switch>("extrapolateProfile", false)
@ -67,7 +69,6 @@ flowRateInletVelocityFvPatchVectorField
{ {
volumetric_ = true; volumetric_ = true;
flowRate_ = Function1<scalar>::New("volumetricFlowRate", dict); flowRate_ = Function1<scalar>::New("volumetricFlowRate", dict);
rhoName_ = "rho";
} }
else if (dict.found("massFlowRate")) else if (dict.found("massFlowRate"))
{ {
@ -79,7 +80,8 @@ flowRateInletVelocityFvPatchVectorField
{ {
FatalIOErrorInFunction(dict) FatalIOErrorInFunction(dict)
<< "Please supply either 'volumetricFlowRate' or" << "Please supply either 'volumetricFlowRate' or"
<< " 'massFlowRate' and 'rho'" << exit(FatalIOError); << " 'massFlowRate' and 'rho'" << nl
<< exit(FatalIOError);
} }
// Value field require if mass based // Value field require if mass based
@ -108,9 +110,9 @@ flowRateInletVelocityFvPatchVectorField
: :
fixedValueFvPatchField<vector>(ptf, p, iF, mapper), fixedValueFvPatchField<vector>(ptf, p, iF, mapper),
flowRate_(ptf.flowRate_.clone()), flowRate_(ptf.flowRate_.clone()),
volumetric_(ptf.volumetric_),
rhoName_(ptf.rhoName_), rhoName_(ptf.rhoName_),
rhoInlet_(ptf.rhoInlet_), rhoInlet_(ptf.rhoInlet_),
volumetric_(ptf.volumetric_),
extrapolateProfile_(ptf.extrapolateProfile_) extrapolateProfile_(ptf.extrapolateProfile_)
{} {}
@ -123,9 +125,9 @@ flowRateInletVelocityFvPatchVectorField
: :
fixedValueFvPatchField<vector>(ptf), fixedValueFvPatchField<vector>(ptf),
flowRate_(ptf.flowRate_.clone()), flowRate_(ptf.flowRate_.clone()),
volumetric_(ptf.volumetric_),
rhoName_(ptf.rhoName_), rhoName_(ptf.rhoName_),
rhoInlet_(ptf.rhoInlet_), rhoInlet_(ptf.rhoInlet_),
volumetric_(ptf.volumetric_),
extrapolateProfile_(ptf.extrapolateProfile_) extrapolateProfile_(ptf.extrapolateProfile_)
{} {}
@ -139,9 +141,9 @@ flowRateInletVelocityFvPatchVectorField
: :
fixedValueFvPatchField<vector>(ptf, iF), fixedValueFvPatchField<vector>(ptf, iF),
flowRate_(ptf.flowRate_.clone()), flowRate_(ptf.flowRate_.clone()),
volumetric_(ptf.volumetric_),
rhoName_(ptf.rhoName_), rhoName_(ptf.rhoName_),
rhoInlet_(ptf.rhoInlet_), rhoInlet_(ptf.rhoInlet_),
volumetric_(ptf.volumetric_),
extrapolateProfile_(ptf.extrapolateProfile_) extrapolateProfile_(ptf.extrapolateProfile_)
{} {}

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | \\ / A nd | Copyright (C) 2019 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
| Copyright (C) 2011-2017 OpenFOAM Foundation | Copyright (C) 2011-2017 OpenFOAM Foundation
@ -121,15 +121,15 @@ class flowRateInletVelocityFvPatchVectorField
//- Inlet integral flow rate //- Inlet integral flow rate
autoPtr<Function1<scalar>> flowRate_; autoPtr<Function1<scalar>> flowRate_;
//- Is volumetric?
bool volumetric_;
//- Name of the density field used to normalize the mass flux //- Name of the density field used to normalize the mass flux
word rhoName_; word rhoName_;
//- Rho initialisation value (for start; if value not supplied) //- Rho initialisation value (for start; if value not supplied)
scalar rhoInlet_; scalar rhoInlet_;
//- Is volumetric?
bool volumetric_;
//- Set true to extrapolate the velocity profile from the interior //- Set true to extrapolate the velocity profile from the interior
Switch extrapolateProfile_; Switch extrapolateProfile_;

View File

@ -123,9 +123,9 @@ Foam::swirlFanVelocityFvPatchField::swirlFanVelocityFvPatchField
rpm_(), rpm_(),
rEff_(0.0), rEff_(0.0),
fanEff_(1.0), fanEff_(1.0),
useRealRadius_(false),
rInner_(0.0), rInner_(0.0),
rOuter_(0.0) rOuter_(0.0),
useRealRadius_(false)
{} {}
@ -158,9 +158,9 @@ Foam::swirlFanVelocityFvPatchField::swirlFanVelocityFvPatchField
), ),
rEff_(dict.lookupOrDefault<scalar>("rEff", 0)), rEff_(dict.lookupOrDefault<scalar>("rEff", 0)),
fanEff_(dict.lookupOrDefault<scalar>("fanEff", 1)), fanEff_(dict.lookupOrDefault<scalar>("fanEff", 1)),
useRealRadius_(dict.lookupOrDefault("useRealRadius", false)),
rInner_(dict.lookupOrDefault<scalar>("rInner", 0)), rInner_(dict.lookupOrDefault<scalar>("rInner", 0)),
rOuter_(dict.lookupOrDefault<scalar>("rOuter", 0)) rOuter_(dict.lookupOrDefault<scalar>("rOuter", 0)),
useRealRadius_(dict.lookupOrDefault("useRealRadius", false))
{} {}
@ -180,9 +180,9 @@ Foam::swirlFanVelocityFvPatchField::swirlFanVelocityFvPatchField
rpm_(ptf.rpm_.clone()), rpm_(ptf.rpm_.clone()),
rEff_(ptf.rEff_), rEff_(ptf.rEff_),
fanEff_(ptf.fanEff_), fanEff_(ptf.fanEff_),
useRealRadius_(ptf.useRealRadius_),
rInner_(ptf.rInner_), rInner_(ptf.rInner_),
rOuter_(ptf.rOuter_) rOuter_(ptf.rOuter_),
useRealRadius_(ptf.useRealRadius_)
{} {}
@ -198,9 +198,9 @@ Foam::swirlFanVelocityFvPatchField::swirlFanVelocityFvPatchField
origin_(ptf.origin_), origin_(ptf.origin_),
rpm_(ptf.rpm_.clone()), rpm_(ptf.rpm_.clone()),
rEff_(ptf.rEff_), rEff_(ptf.rEff_),
useRealRadius_(ptf.useRealRadius_),
rInner_(ptf.rInner_), rInner_(ptf.rInner_),
rOuter_(ptf.rOuter_) rOuter_(ptf.rOuter_),
useRealRadius_(ptf.useRealRadius_)
{} {}
@ -217,9 +217,9 @@ Foam::swirlFanVelocityFvPatchField::swirlFanVelocityFvPatchField
origin_(ptf.origin_), origin_(ptf.origin_),
rpm_(ptf.rpm_.clone()), rpm_(ptf.rpm_.clone()),
rEff_(ptf.rEff_), rEff_(ptf.rEff_),
useRealRadius_(ptf.useRealRadius_),
rInner_(ptf.rInner_), rInner_(ptf.rInner_),
rOuter_(ptf.rOuter_) rOuter_(ptf.rOuter_),
useRealRadius_(ptf.useRealRadius_)
{} {}

View File

@ -141,15 +141,15 @@ class swirlFanVelocityFvPatchField
//- Fan efficiency //- Fan efficiency
scalar fanEff_; scalar fanEff_;
//- Switch to use effective radius or inner and outer radius
bool useRealRadius_;
//- Inner radius //- Inner radius
scalar rInner_; scalar rInner_;
//- Outer radius //- Outer radius
scalar rOuter_; scalar rOuter_;
//- Switch to use effective radius or inner and outer radius
bool useRealRadius_;
// Private Member Functions // Private Member Functions

View File

@ -737,10 +737,10 @@ turbulentDFSEMInletFvPatchVectorField
mapMethod_("planarInterpolation"), mapMethod_("planarInterpolation"),
mapperPtr_(nullptr), mapperPtr_(nullptr),
interpolateR_(false), interpolateR_(false),
R_(),
interpolateL_(false), interpolateL_(false),
L_(),
interpolateU_(false), interpolateU_(false),
R_(),
L_(),
U_(), U_(),
UMean_(Zero), UMean_(Zero),
@ -783,10 +783,10 @@ turbulentDFSEMInletFvPatchVectorField
mapMethod_(ptf.mapMethod_), mapMethod_(ptf.mapMethod_),
mapperPtr_(nullptr), mapperPtr_(nullptr),
interpolateR_(ptf.interpolateR_), interpolateR_(ptf.interpolateR_),
R_(ptf.R_, mapper),
interpolateL_(ptf.interpolateL_), interpolateL_(ptf.interpolateL_),
L_(ptf.L_, mapper),
interpolateU_(ptf.interpolateU_), interpolateU_(ptf.interpolateU_),
R_(ptf.R_, mapper),
L_(ptf.L_, mapper),
U_(ptf.U_, mapper), U_(ptf.U_, mapper),
UMean_(ptf.UMean_), UMean_(ptf.UMean_),
@ -828,10 +828,10 @@ turbulentDFSEMInletFvPatchVectorField
mapMethod_(dict.lookup("mapMethod")), mapMethod_(dict.lookup("mapMethod")),
mapperPtr_(nullptr), mapperPtr_(nullptr),
interpolateR_(false), interpolateR_(false),
R_(interpolateOrRead<symmTensor>("R", dict, interpolateR_)),
interpolateL_(false), interpolateL_(false),
L_(interpolateOrRead<scalar>("L", dict, interpolateL_)),
interpolateU_(false), interpolateU_(false),
R_(interpolateOrRead<symmTensor>("R", dict, interpolateR_)),
L_(interpolateOrRead<scalar>("L", dict, interpolateL_)),
U_(interpolateOrRead<vector>("U", dict, interpolateU_)), U_(interpolateOrRead<vector>("U", dict, interpolateU_)),
UMean_(Zero), UMean_(Zero),
@ -878,10 +878,10 @@ turbulentDFSEMInletFvPatchVectorField
mapMethod_(ptf.mapMethod_), mapMethod_(ptf.mapMethod_),
mapperPtr_(nullptr), mapperPtr_(nullptr),
interpolateR_(ptf.interpolateR_), interpolateR_(ptf.interpolateR_),
R_(ptf.R_),
interpolateL_(ptf.interpolateL_), interpolateL_(ptf.interpolateL_),
L_(ptf.L_),
interpolateU_(ptf.interpolateU_), interpolateU_(ptf.interpolateU_),
R_(ptf.R_),
L_(ptf.L_),
U_(ptf.U_), U_(ptf.U_),
UMean_(ptf.UMean_), UMean_(ptf.UMean_),
@ -922,10 +922,10 @@ turbulentDFSEMInletFvPatchVectorField
mapMethod_(ptf.mapMethod_), mapMethod_(ptf.mapMethod_),
mapperPtr_(nullptr), mapperPtr_(nullptr),
interpolateR_(ptf.interpolateR_), interpolateR_(ptf.interpolateR_),
R_(ptf.R_),
interpolateL_(ptf.interpolateL_), interpolateL_(ptf.interpolateL_),
L_(ptf.L_),
interpolateU_(ptf.interpolateU_), interpolateU_(ptf.interpolateU_),
R_(ptf.R_),
L_(ptf.L_),
U_(ptf.U_), U_(ptf.U_),
UMean_(ptf.UMean_), UMean_(ptf.UMean_),

View File

@ -104,7 +104,7 @@ class turbulentDFSEMInletFvPatchVectorField
: :
public fixedValueFvPatchVectorField public fixedValueFvPatchVectorField
{ {
// Private data // Private Data
//- Maximum number of attempts when seeding eddies //- Maximum number of attempts when seeding eddies
static label seedIterMax_; static label seedIterMax_;
@ -136,18 +136,18 @@ class turbulentDFSEMInletFvPatchVectorField
//- Flag to identify to interpolate the R field //- Flag to identify to interpolate the R field
bool interpolateR_; bool interpolateR_;
//- Reynolds stress tensor
symmTensorField R_;
//- Flag to identify to interpolate the L field //- Flag to identify to interpolate the L field
bool interpolateL_; bool interpolateL_;
//- Length scale
scalarField L_;
//- Flag to identify to interpolate the U field //- Flag to identify to interpolate the U field
bool interpolateU_; bool interpolateU_;
//- Reynolds stress tensor
symmTensorField R_;
//- Length scale
scalarField L_;
//- Inlet velocity //- Inlet velocity
vectorField U_; vectorField U_;