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

View File

@ -131,7 +131,7 @@ public:
private:
// Private data
// Private Data
//- Tabulated fan curve
interpolationTable<scalar> fanCurve_;
@ -139,17 +139,15 @@ private:
//- Direction of flow through the fan relative to patch
fanFlowDirection direction_;
//- Switch for using non-dimensional curve
Switch nonDimensional_;
// Parameters for non-dimensional table
//- Fan rpm
//- Fan rpm (for non-dimensional curve)
scalar rpm_;
//- Fan mean diameter
//- Fan mean diameter (for non-dimensional curve)
scalar dm_;
//- Use non-dimensional curve
bool nonDimensional_;
public:
@ -230,7 +228,7 @@ public:
virtual void updateCoeffs();
//- 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
\\ / O peration |
\\ / A nd |
\\ / A nd | Copyright (C) 2019 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2011-2017 OpenFOAM Foundation
@ -41,9 +41,9 @@ flowRateInletVelocityFvPatchVectorField
:
fixedValueFvPatchField<vector>(p, iF),
flowRate_(),
volumetric_(false),
rhoName_("rho"),
rhoInlet_(0.0),
volumetric_(false),
extrapolateProfile_(false)
{}
@ -57,7 +57,9 @@ flowRateInletVelocityFvPatchVectorField
)
:
fixedValueFvPatchField<vector>(p, iF, dict, false),
rhoName_("rho"),
rhoInlet_(dict.lookupOrDefault<scalar>("rhoInlet", -VGREAT)),
volumetric_(false),
extrapolateProfile_
(
dict.lookupOrDefault<Switch>("extrapolateProfile", false)
@ -67,7 +69,6 @@ flowRateInletVelocityFvPatchVectorField
{
volumetric_ = true;
flowRate_ = Function1<scalar>::New("volumetricFlowRate", dict);
rhoName_ = "rho";
}
else if (dict.found("massFlowRate"))
{
@ -79,7 +80,8 @@ flowRateInletVelocityFvPatchVectorField
{
FatalIOErrorInFunction(dict)
<< "Please supply either 'volumetricFlowRate' or"
<< " 'massFlowRate' and 'rho'" << exit(FatalIOError);
<< " 'massFlowRate' and 'rho'" << nl
<< exit(FatalIOError);
}
// Value field require if mass based
@ -108,9 +110,9 @@ flowRateInletVelocityFvPatchVectorField
:
fixedValueFvPatchField<vector>(ptf, p, iF, mapper),
flowRate_(ptf.flowRate_.clone()),
volumetric_(ptf.volumetric_),
rhoName_(ptf.rhoName_),
rhoInlet_(ptf.rhoInlet_),
volumetric_(ptf.volumetric_),
extrapolateProfile_(ptf.extrapolateProfile_)
{}
@ -123,9 +125,9 @@ flowRateInletVelocityFvPatchVectorField
:
fixedValueFvPatchField<vector>(ptf),
flowRate_(ptf.flowRate_.clone()),
volumetric_(ptf.volumetric_),
rhoName_(ptf.rhoName_),
rhoInlet_(ptf.rhoInlet_),
volumetric_(ptf.volumetric_),
extrapolateProfile_(ptf.extrapolateProfile_)
{}
@ -139,9 +141,9 @@ flowRateInletVelocityFvPatchVectorField
:
fixedValueFvPatchField<vector>(ptf, iF),
flowRate_(ptf.flowRate_.clone()),
volumetric_(ptf.volumetric_),
rhoName_(ptf.rhoName_),
rhoInlet_(ptf.rhoInlet_),
volumetric_(ptf.volumetric_),
extrapolateProfile_(ptf.extrapolateProfile_)
{}

View File

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

View File

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

View File

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

View File

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

View File

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