mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: consistent specification of fan conditions (fixes #2279)
This commit is contained in:
@ -54,8 +54,8 @@ Foam::fanFvPatchField<Type>::fanFvPatchField
|
|||||||
rhoName_("rho"),
|
rhoName_("rho"),
|
||||||
uniformJump_(false),
|
uniformJump_(false),
|
||||||
nonDimensional_(false),
|
nonDimensional_(false),
|
||||||
rpm_(0),
|
rpm_(nullptr),
|
||||||
dm_(0)
|
dm_(nullptr)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
@ -72,14 +72,14 @@ Foam::fanFvPatchField<Type>::fanFvPatchField
|
|||||||
rhoName_(dict.getOrDefault<word>("rho", "rho")),
|
rhoName_(dict.getOrDefault<word>("rho", "rho")),
|
||||||
uniformJump_(dict.getOrDefault("uniformJump", false)),
|
uniformJump_(dict.getOrDefault("uniformJump", false)),
|
||||||
nonDimensional_(dict.getOrDefault("nonDimensional", false)),
|
nonDimensional_(dict.getOrDefault("nonDimensional", false)),
|
||||||
rpm_(0),
|
rpm_(nullptr),
|
||||||
dm_(0)
|
dm_(nullptr)
|
||||||
{
|
{
|
||||||
// Note that we've not read jumpTable_ etc
|
// Note that we've not read jumpTable_ etc
|
||||||
if (nonDimensional_)
|
if (nonDimensional_)
|
||||||
{
|
{
|
||||||
dict.readEntry("rpm", rpm_);
|
rpm_.reset(Function1<scalar>::New("rpm", dict, &this->db()));
|
||||||
dict.readEntry("dm", dm_);
|
dm_.reset(Function1<scalar>::New("dm", dict, &this->db()));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this->cyclicPatch().owner())
|
if (this->cyclicPatch().owner())
|
||||||
@ -104,52 +104,52 @@ Foam::fanFvPatchField<Type>::fanFvPatchField
|
|||||||
template<class Type>
|
template<class Type>
|
||||||
Foam::fanFvPatchField<Type>::fanFvPatchField
|
Foam::fanFvPatchField<Type>::fanFvPatchField
|
||||||
(
|
(
|
||||||
const fanFvPatchField<Type>& ptf,
|
const fanFvPatchField<Type>& rhs,
|
||||||
const fvPatch& p,
|
const fvPatch& p,
|
||||||
const DimensionedField<Type, volMesh>& iF,
|
const DimensionedField<Type, volMesh>& iF,
|
||||||
const fvPatchFieldMapper& mapper
|
const fvPatchFieldMapper& mapper
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
uniformJumpFvPatchField<Type>(ptf, p, iF, mapper),
|
uniformJumpFvPatchField<Type>(rhs, p, iF, mapper),
|
||||||
phiName_(ptf.phiName_),
|
phiName_(rhs.phiName_),
|
||||||
rhoName_(ptf.rhoName_),
|
rhoName_(rhs.rhoName_),
|
||||||
uniformJump_(ptf.uniformJump_),
|
uniformJump_(rhs.uniformJump_),
|
||||||
nonDimensional_(ptf.nonDimensional_),
|
nonDimensional_(rhs.nonDimensional_),
|
||||||
rpm_(ptf.rpm_),
|
rpm_(rhs.rpm_.clone()),
|
||||||
dm_(ptf.dm_)
|
dm_(rhs.dm_.clone())
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
template<class Type>
|
template<class Type>
|
||||||
Foam::fanFvPatchField<Type>::fanFvPatchField
|
Foam::fanFvPatchField<Type>::fanFvPatchField
|
||||||
(
|
(
|
||||||
const fanFvPatchField<Type>& ptf
|
const fanFvPatchField<Type>& rhs
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
uniformJumpFvPatchField<Type>(ptf),
|
uniformJumpFvPatchField<Type>(rhs),
|
||||||
phiName_(ptf.phiName_),
|
phiName_(rhs.phiName_),
|
||||||
rhoName_(ptf.rhoName_),
|
rhoName_(rhs.rhoName_),
|
||||||
uniformJump_(ptf.uniformJump_),
|
uniformJump_(rhs.uniformJump_),
|
||||||
nonDimensional_(ptf.nonDimensional_),
|
nonDimensional_(rhs.nonDimensional_),
|
||||||
rpm_(ptf.rpm_),
|
rpm_(rhs.rpm_.clone()),
|
||||||
dm_(ptf.dm_)
|
dm_(rhs.dm_.clone())
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
template<class Type>
|
template<class Type>
|
||||||
Foam::fanFvPatchField<Type>::fanFvPatchField
|
Foam::fanFvPatchField<Type>::fanFvPatchField
|
||||||
(
|
(
|
||||||
const fanFvPatchField<Type>& ptf,
|
const fanFvPatchField<Type>& rhs,
|
||||||
const DimensionedField<Type, volMesh>& iF
|
const DimensionedField<Type, volMesh>& iF
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
uniformJumpFvPatchField<Type>(ptf, iF),
|
uniformJumpFvPatchField<Type>(rhs, iF),
|
||||||
phiName_(ptf.phiName_),
|
phiName_(rhs.phiName_),
|
||||||
rhoName_(ptf.rhoName_),
|
rhoName_(rhs.rhoName_),
|
||||||
uniformJump_(ptf.uniformJump_),
|
uniformJump_(rhs.uniformJump_),
|
||||||
nonDimensional_(ptf.nonDimensional_),
|
nonDimensional_(rhs.nonDimensional_),
|
||||||
rpm_(ptf.rpm_),
|
rpm_(rhs.rpm_.clone()),
|
||||||
dm_(ptf.dm_)
|
dm_(rhs.dm_.clone())
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
@ -176,13 +176,17 @@ void Foam::fanFvPatchField<Type>::write(Ostream& os) const
|
|||||||
uniformJumpFvPatchField<Type>::write(os);
|
uniformJumpFvPatchField<Type>::write(os);
|
||||||
os.writeEntryIfDifferent<word>("phi", "phi", phiName_);
|
os.writeEntryIfDifferent<word>("phi", "phi", phiName_);
|
||||||
os.writeEntryIfDifferent<word>("rho", "rho", rhoName_);
|
os.writeEntryIfDifferent<word>("rho", "rho", rhoName_);
|
||||||
os.writeEntryIfDifferent<bool>("uniformJump", false, uniformJump_);
|
|
||||||
|
if (uniformJump_)
|
||||||
|
{
|
||||||
|
os.writeEntry("uniformJump", "true");
|
||||||
|
}
|
||||||
|
|
||||||
if (nonDimensional_)
|
if (nonDimensional_)
|
||||||
{
|
{
|
||||||
os.writeEntry("nonDimensional", nonDimensional_);
|
os.writeEntry("nonDimensional", "true");
|
||||||
os.writeEntry("rpm", rpm_);
|
rpm_->writeData(os);
|
||||||
os.writeEntry("dm", dm_);
|
dm_->writeData(os);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -69,8 +69,8 @@ Usage
|
|||||||
rho | density field name | no | rho
|
rho | density field name | no | rho
|
||||||
uniformJump | apply uniform pressure based on avg velocity | no | false
|
uniformJump | apply uniform pressure based on avg velocity | no | false
|
||||||
nonDimensional | use non-dimensional table | no | false
|
nonDimensional | use non-dimensional table | no | false
|
||||||
rpm | fan rpm (non-dimensional table) | no | 0
|
rpm | fan rpm (non-dimensional table) | no |
|
||||||
dm | mean diameter (non-dimensional table) | no | 0
|
dm | mean diameter (non-dimensional table) | no |
|
||||||
\endtable
|
\endtable
|
||||||
|
|
||||||
Example of the boundary condition specification:
|
Example of the boundary condition specification:
|
||||||
@ -115,6 +115,7 @@ SourceFiles
|
|||||||
#define fanFvPatchField_H
|
#define fanFvPatchField_H
|
||||||
|
|
||||||
#include "uniformJumpFvPatchField.H"
|
#include "uniformJumpFvPatchField.H"
|
||||||
|
#include "Function1.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -130,7 +131,7 @@ class fanFvPatchField
|
|||||||
:
|
:
|
||||||
public uniformJumpFvPatchField<Type>
|
public uniformJumpFvPatchField<Type>
|
||||||
{
|
{
|
||||||
// Private data
|
// Private Data
|
||||||
|
|
||||||
//- Name of the flux transporting the field
|
//- Name of the flux transporting the field
|
||||||
word phiName_;
|
word phiName_;
|
||||||
@ -144,13 +145,11 @@ class fanFvPatchField
|
|||||||
//- Use non-dimensional curve
|
//- Use non-dimensional curve
|
||||||
bool nonDimensional_;
|
bool nonDimensional_;
|
||||||
|
|
||||||
// Parameters for non-dimensional table
|
//- Fan rpm (for non-dimensional curve)
|
||||||
|
autoPtr<Function1<scalar>> rpm_;
|
||||||
|
|
||||||
//- Fan rpm
|
//- Fan mean diameter (for non-dimensional curve)
|
||||||
scalar rpm_;
|
autoPtr<Function1<scalar>> dm_;
|
||||||
|
|
||||||
//- Fan mean diameter
|
|
||||||
scalar dm_;
|
|
||||||
|
|
||||||
|
|
||||||
// Private Member Functions
|
// Private Member Functions
|
||||||
|
|||||||
@ -45,17 +45,35 @@ void Foam::fanFvPatchField<Foam::scalar>::calcFanJump()
|
|||||||
patch().patchField<surfaceScalarField, scalar>(phi);
|
patch().patchField<surfaceScalarField, scalar>(phi);
|
||||||
|
|
||||||
scalarField Un(max(phip/patch().magSf(), scalar(0)));
|
scalarField Un(max(phip/patch().magSf(), scalar(0)));
|
||||||
|
|
||||||
|
// The non-dimensional parameters
|
||||||
|
|
||||||
|
scalar rpm(0);
|
||||||
|
scalar meanDiam(0);
|
||||||
|
|
||||||
|
if (nonDimensional_)
|
||||||
|
{
|
||||||
|
rpm = rpm_->value(this->db().time().timeOutputValue());
|
||||||
|
meanDiam = dm_->value(this->db().time().timeOutputValue());
|
||||||
|
}
|
||||||
|
|
||||||
if (uniformJump_)
|
if (uniformJump_)
|
||||||
{
|
{
|
||||||
scalar area = gSum(patch().magSf());
|
const scalar area = gSum(patch().magSf());
|
||||||
Un = gSum(Un*patch().magSf())/area;
|
Un = gSum(Un*patch().magSf())/area;
|
||||||
|
|
||||||
if (nonDimensional_)
|
if (nonDimensional_)
|
||||||
{
|
{
|
||||||
// Create an non-dimensional velocity
|
// Create an non-dimensional velocity
|
||||||
Un =
|
Un =
|
||||||
120.0*Un/pow3(constant::mathematical::pi)
|
(
|
||||||
/ dm_/rpm_;
|
120.0*Un
|
||||||
|
/ stabilise
|
||||||
|
(
|
||||||
|
pow3(constant::mathematical::pi) * meanDiam * rpm,
|
||||||
|
VSMALL
|
||||||
|
)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -71,7 +89,8 @@ void Foam::fanFvPatchField<Foam::scalar>::calcFanJump()
|
|||||||
// Convert non-dimensional deltap from curve into deltaP
|
// Convert non-dimensional deltap from curve into deltaP
|
||||||
scalarField pdFan
|
scalarField pdFan
|
||||||
(
|
(
|
||||||
deltap*pow4(constant::mathematical::pi)*sqr(dm_*rpm_)/1800.0
|
deltap*pow4(constant::mathematical::pi)
|
||||||
|
* sqr(meanDiam*rpm)/1800.0
|
||||||
);
|
);
|
||||||
|
|
||||||
this->setJump(pdFan);
|
this->setJump(pdFan);
|
||||||
|
|||||||
@ -57,25 +57,25 @@ Foam::fanPressureFvPatchScalarField::fanPressureFvPatchScalarField
|
|||||||
fanCurve_(nullptr),
|
fanCurve_(nullptr),
|
||||||
direction_(ffdOut),
|
direction_(ffdOut),
|
||||||
nonDimensional_(false),
|
nonDimensional_(false),
|
||||||
rpm_(0),
|
rpm_(nullptr),
|
||||||
dm_(0)
|
dm_(nullptr)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
Foam::fanPressureFvPatchScalarField::fanPressureFvPatchScalarField
|
Foam::fanPressureFvPatchScalarField::fanPressureFvPatchScalarField
|
||||||
(
|
(
|
||||||
const fanPressureFvPatchScalarField& ptf,
|
const fanPressureFvPatchScalarField& rhs,
|
||||||
const fvPatch& p,
|
const fvPatch& p,
|
||||||
const DimensionedField<scalar, volMesh>& iF,
|
const DimensionedField<scalar, volMesh>& iF,
|
||||||
const fvPatchFieldMapper& mapper
|
const fvPatchFieldMapper& mapper
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
totalPressureFvPatchScalarField(ptf, p, iF, mapper),
|
totalPressureFvPatchScalarField(rhs, p, iF, mapper),
|
||||||
fanCurve_(ptf.fanCurve_.clone()),
|
fanCurve_(rhs.fanCurve_.clone()),
|
||||||
direction_(ptf.direction_),
|
direction_(rhs.direction_),
|
||||||
nonDimensional_(ptf.nonDimensional_),
|
nonDimensional_(rhs.nonDimensional_),
|
||||||
rpm_(ptf.rpm_),
|
rpm_(rhs.rpm_.clone()),
|
||||||
dm_(ptf.dm_)
|
dm_(rhs.dm_.clone())
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
@ -90,56 +90,56 @@ Foam::fanPressureFvPatchScalarField::fanPressureFvPatchScalarField
|
|||||||
fanCurve_(nullptr),
|
fanCurve_(nullptr),
|
||||||
direction_(fanFlowDirectionNames_.get("direction", dict)),
|
direction_(fanFlowDirectionNames_.get("direction", dict)),
|
||||||
nonDimensional_(dict.getOrDefault("nonDimensional", false)),
|
nonDimensional_(dict.getOrDefault("nonDimensional", false)),
|
||||||
rpm_(0),
|
rpm_(nullptr),
|
||||||
dm_(0)
|
dm_(nullptr)
|
||||||
{
|
{
|
||||||
// Backwards compatibility
|
// Backwards compatibility
|
||||||
if (dict.found("file"))
|
if (dict.found("file"))
|
||||||
{
|
{
|
||||||
fanCurve_.reset
|
fanCurve_.reset
|
||||||
(
|
(
|
||||||
new Function1Types::TableFile<scalar>("fanCurve", dict)
|
new Function1Types::TableFile<scalar>("fanCurve", dict, &this->db())
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
fanCurve_.reset(Function1<scalar>::New("fanCurve", dict, &db()));
|
fanCurve_.reset(Function1<scalar>::New("fanCurve", dict, &this->db()));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (nonDimensional_)
|
if (nonDimensional_)
|
||||||
{
|
{
|
||||||
dict.readEntry("rpm", rpm_);
|
rpm_.reset(Function1<scalar>::New("rpm", dict, &this->db()));
|
||||||
dict.readEntry("dm", dm_);
|
dm_.reset(Function1<scalar>::New("dm", dict, &this->db()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::fanPressureFvPatchScalarField::fanPressureFvPatchScalarField
|
Foam::fanPressureFvPatchScalarField::fanPressureFvPatchScalarField
|
||||||
(
|
(
|
||||||
const fanPressureFvPatchScalarField& fppsf
|
const fanPressureFvPatchScalarField& rhs
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
totalPressureFvPatchScalarField(fppsf),
|
totalPressureFvPatchScalarField(rhs),
|
||||||
fanCurve_(fppsf.fanCurve_.clone()),
|
fanCurve_(rhs.fanCurve_.clone()),
|
||||||
direction_(fppsf.direction_),
|
direction_(rhs.direction_),
|
||||||
nonDimensional_(fppsf.nonDimensional_),
|
nonDimensional_(rhs.nonDimensional_),
|
||||||
rpm_(fppsf.rpm_),
|
rpm_(rhs.rpm_.clone()),
|
||||||
dm_(fppsf.dm_)
|
dm_(rhs.dm_.clone())
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
Foam::fanPressureFvPatchScalarField::fanPressureFvPatchScalarField
|
Foam::fanPressureFvPatchScalarField::fanPressureFvPatchScalarField
|
||||||
(
|
(
|
||||||
const fanPressureFvPatchScalarField& fppsf,
|
const fanPressureFvPatchScalarField& rhs,
|
||||||
const DimensionedField<scalar, volMesh>& iF
|
const DimensionedField<scalar, volMesh>& iF
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
totalPressureFvPatchScalarField(fppsf, iF),
|
totalPressureFvPatchScalarField(rhs, iF),
|
||||||
fanCurve_(fppsf.fanCurve_.clone()),
|
fanCurve_(rhs.fanCurve_.clone()),
|
||||||
direction_(fppsf.direction_),
|
direction_(rhs.direction_),
|
||||||
nonDimensional_(fppsf.nonDimensional_),
|
nonDimensional_(rhs.nonDimensional_),
|
||||||
rpm_(fppsf.rpm_),
|
rpm_(rhs.rpm_.clone()),
|
||||||
dm_(fppsf.dm_)
|
dm_(rhs.dm_.clone())
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
@ -182,11 +182,24 @@ void Foam::fanPressureFvPatchScalarField::updateCoeffs()
|
|||||||
<< exit(FatalError);
|
<< exit(FatalError);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// The non-dimensional parameters
|
||||||
|
|
||||||
|
scalar rpm(0);
|
||||||
|
scalar meanDiam(0);
|
||||||
|
|
||||||
if (nonDimensional_)
|
if (nonDimensional_)
|
||||||
{
|
{
|
||||||
|
rpm = rpm_->value(this->db().time().timeOutputValue());
|
||||||
|
meanDiam = dm_->value(this->db().time().timeOutputValue());
|
||||||
|
|
||||||
// Create an non-dimensional flow rate
|
// Create an non-dimensional flow rate
|
||||||
volFlowRate =
|
volFlowRate =
|
||||||
120.0*volFlowRate/pow3(constant::mathematical::pi)/pow3(dm_)/rpm_;
|
120.0*volFlowRate
|
||||||
|
/ stabilise
|
||||||
|
(
|
||||||
|
pow3(constant::mathematical::pi * meanDiam) * rpm,
|
||||||
|
VSMALL
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Pressure drop for this flow rate
|
// Pressure drop for this flow rate
|
||||||
@ -195,7 +208,11 @@ void Foam::fanPressureFvPatchScalarField::updateCoeffs()
|
|||||||
if (nonDimensional_)
|
if (nonDimensional_)
|
||||||
{
|
{
|
||||||
// Convert the non-dimensional deltap from curve into deltaP
|
// Convert the non-dimensional deltap from curve into deltaP
|
||||||
pdFan = pdFan*pow4(constant::mathematical::pi)*sqr(dm_*rpm_)/1800;
|
pdFan =
|
||||||
|
(
|
||||||
|
pdFan*pow4(constant::mathematical::pi)
|
||||||
|
* sqr(rpm * meanDiam) / 1800.0
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
totalPressureFvPatchScalarField::updateCoeffs
|
totalPressureFvPatchScalarField::updateCoeffs
|
||||||
@ -215,8 +232,8 @@ void Foam::fanPressureFvPatchScalarField::write(Ostream& os) const
|
|||||||
if (nonDimensional_)
|
if (nonDimensional_)
|
||||||
{
|
{
|
||||||
os.writeEntry("nonDimensional", "true");
|
os.writeEntry("nonDimensional", "true");
|
||||||
os.writeEntry("rpm", rpm_);
|
rpm_->writeData(os);
|
||||||
os.writeEntry("dm", dm_);
|
dm_->writeData(os);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -59,8 +59,8 @@ Usage
|
|||||||
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
|
rpm | fan rpm for non-dimensional table | no |
|
||||||
dm | mean diameter for non-dimensional table | no | 0.0
|
dm | mean diameter for non-dimensional table | no |
|
||||||
file | fan curve file name | legacy |
|
file | fan curve file name | legacy |
|
||||||
outOfBounds | out of bounds handling | legacy |
|
outOfBounds | out of bounds handling | legacy |
|
||||||
\endtable
|
\endtable
|
||||||
@ -154,10 +154,10 @@ private:
|
|||||||
bool nonDimensional_;
|
bool nonDimensional_;
|
||||||
|
|
||||||
//- Fan rpm (for non-dimensional curve)
|
//- Fan rpm (for non-dimensional curve)
|
||||||
scalar rpm_;
|
autoPtr<Function1<scalar>> rpm_;
|
||||||
|
|
||||||
//- Fan mean diameter (for non-dimensional curve)
|
//- Fan mean diameter (for non-dimensional curve)
|
||||||
scalar dm_;
|
autoPtr<Function1<scalar>> dm_;
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|||||||
@ -84,7 +84,14 @@ void Foam::swirlFanVelocityFvPatchField::calcFanJump()
|
|||||||
if (rMag > rInner_ && rMag < rOuter_)
|
if (rMag > rInner_ && rMag < rOuter_)
|
||||||
{
|
{
|
||||||
magTangU[i] =
|
magTangU[i] =
|
||||||
deltaP[i]/rMag/fanEff_/rpmToRads(rpm);
|
(
|
||||||
|
deltaP[i]
|
||||||
|
/ stabilise
|
||||||
|
(
|
||||||
|
fanEff_ * rMag * rpmToRads(rpm),
|
||||||
|
VSMALL
|
||||||
|
)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -93,12 +100,19 @@ void Foam::swirlFanVelocityFvPatchField::calcFanJump()
|
|||||||
if (rEff_ <= 0)
|
if (rEff_ <= 0)
|
||||||
{
|
{
|
||||||
FatalErrorInFunction
|
FatalErrorInFunction
|
||||||
<< "Effective radius rEff should be specified in the "<< nl
|
<< "Effective radius 'rEff' was ill-specified in the "
|
||||||
<< "dictionary." << nl
|
<< "dictionary." << nl
|
||||||
<< exit(FatalError);
|
<< exit(FatalError);
|
||||||
}
|
}
|
||||||
magTangU =
|
magTangU =
|
||||||
deltaP/rEff_/fanEff_/rpmToRads(rpm);
|
(
|
||||||
|
deltaP
|
||||||
|
/ stabilise
|
||||||
|
(
|
||||||
|
fanEff_ * rEff_ * rpmToRads(rpm),
|
||||||
|
VSMALL
|
||||||
|
)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Calculate the tangential velocity
|
// Calculate the tangential velocity
|
||||||
@ -122,11 +136,11 @@ Foam::swirlFanVelocityFvPatchField::swirlFanVelocityFvPatchField
|
|||||||
pName_("p"),
|
pName_("p"),
|
||||||
rhoName_("rho"),
|
rhoName_("rho"),
|
||||||
origin_(),
|
origin_(),
|
||||||
rpm_(),
|
rpm_(nullptr),
|
||||||
rEff_(0.0),
|
fanEff_(1),
|
||||||
fanEff_(1.0),
|
rEff_(0),
|
||||||
rInner_(0.0),
|
rInner_(0),
|
||||||
rOuter_(0.0),
|
rOuter_(0),
|
||||||
useRealRadius_(false)
|
useRealRadius_(false)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
@ -158,8 +172,8 @@ Foam::swirlFanVelocityFvPatchField::swirlFanVelocityFvPatchField
|
|||||||
? Function1<scalar>::New("rpm", dict, &db())
|
? Function1<scalar>::New("rpm", dict, &db())
|
||||||
: nullptr
|
: nullptr
|
||||||
),
|
),
|
||||||
rEff_(dict.getOrDefault<scalar>("rEff", 0)),
|
|
||||||
fanEff_(dict.getOrDefault<scalar>("fanEff", 1)),
|
fanEff_(dict.getOrDefault<scalar>("fanEff", 1)),
|
||||||
|
rEff_(dict.getOrDefault<scalar>("rEff", 0)),
|
||||||
rInner_(dict.getOrDefault<scalar>("rInner", 0)),
|
rInner_(dict.getOrDefault<scalar>("rInner", 0)),
|
||||||
rOuter_(dict.getOrDefault<scalar>("rOuter", 0)),
|
rOuter_(dict.getOrDefault<scalar>("rOuter", 0)),
|
||||||
useRealRadius_(dict.getOrDefault("useRealRadius", false))
|
useRealRadius_(dict.getOrDefault("useRealRadius", false))
|
||||||
@ -168,60 +182,62 @@ Foam::swirlFanVelocityFvPatchField::swirlFanVelocityFvPatchField
|
|||||||
|
|
||||||
Foam::swirlFanVelocityFvPatchField::swirlFanVelocityFvPatchField
|
Foam::swirlFanVelocityFvPatchField::swirlFanVelocityFvPatchField
|
||||||
(
|
(
|
||||||
const swirlFanVelocityFvPatchField& ptf,
|
const swirlFanVelocityFvPatchField& rhs,
|
||||||
const fvPatch& p,
|
const fvPatch& p,
|
||||||
const DimensionedField<vector, volMesh>& iF,
|
const DimensionedField<vector, volMesh>& iF,
|
||||||
const fvPatchFieldMapper& mapper
|
const fvPatchFieldMapper& mapper
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
fixedJumpFvPatchField<vector>(ptf, p, iF, mapper),
|
fixedJumpFvPatchField<vector>(rhs, p, iF, mapper),
|
||||||
phiName_(ptf.phiName_),
|
phiName_(rhs.phiName_),
|
||||||
pName_(ptf.pName_),
|
pName_(rhs.pName_),
|
||||||
rhoName_(ptf.rhoName_),
|
rhoName_(rhs.rhoName_),
|
||||||
origin_(ptf.origin_),
|
origin_(rhs.origin_),
|
||||||
rpm_(ptf.rpm_.clone()),
|
rpm_(rhs.rpm_.clone()),
|
||||||
rEff_(ptf.rEff_),
|
fanEff_(rhs.fanEff_),
|
||||||
fanEff_(ptf.fanEff_),
|
rEff_(rhs.rEff_),
|
||||||
rInner_(ptf.rInner_),
|
rInner_(rhs.rInner_),
|
||||||
rOuter_(ptf.rOuter_),
|
rOuter_(rhs.rOuter_),
|
||||||
useRealRadius_(ptf.useRealRadius_)
|
useRealRadius_(rhs.useRealRadius_)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
Foam::swirlFanVelocityFvPatchField::swirlFanVelocityFvPatchField
|
Foam::swirlFanVelocityFvPatchField::swirlFanVelocityFvPatchField
|
||||||
(
|
(
|
||||||
const swirlFanVelocityFvPatchField& ptf
|
const swirlFanVelocityFvPatchField& rhs
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
fixedJumpFvPatchField<vector>(ptf),
|
fixedJumpFvPatchField<vector>(rhs),
|
||||||
phiName_(ptf.phiName_),
|
phiName_(rhs.phiName_),
|
||||||
pName_(ptf.pName_),
|
pName_(rhs.pName_),
|
||||||
rhoName_(ptf.rhoName_),
|
rhoName_(rhs.rhoName_),
|
||||||
origin_(ptf.origin_),
|
origin_(rhs.origin_),
|
||||||
rpm_(ptf.rpm_.clone()),
|
rpm_(rhs.rpm_.clone()),
|
||||||
rEff_(ptf.rEff_),
|
fanEff_(rhs.fanEff_),
|
||||||
rInner_(ptf.rInner_),
|
rEff_(rhs.rEff_),
|
||||||
rOuter_(ptf.rOuter_),
|
rInner_(rhs.rInner_),
|
||||||
useRealRadius_(ptf.useRealRadius_)
|
rOuter_(rhs.rOuter_),
|
||||||
|
useRealRadius_(rhs.useRealRadius_)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
Foam::swirlFanVelocityFvPatchField::swirlFanVelocityFvPatchField
|
Foam::swirlFanVelocityFvPatchField::swirlFanVelocityFvPatchField
|
||||||
(
|
(
|
||||||
const swirlFanVelocityFvPatchField& ptf,
|
const swirlFanVelocityFvPatchField& rhs,
|
||||||
const DimensionedField<vector, volMesh>& iF
|
const DimensionedField<vector, volMesh>& iF
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
fixedJumpFvPatchField<vector>(ptf, iF),
|
fixedJumpFvPatchField<vector>(rhs, iF),
|
||||||
phiName_(ptf.phiName_),
|
phiName_(rhs.phiName_),
|
||||||
pName_(ptf.pName_),
|
pName_(rhs.pName_),
|
||||||
rhoName_(ptf.rhoName_),
|
rhoName_(rhs.rhoName_),
|
||||||
origin_(ptf.origin_),
|
origin_(rhs.origin_),
|
||||||
rpm_(ptf.rpm_.clone()),
|
rpm_(rhs.rpm_.clone()),
|
||||||
rEff_(ptf.rEff_),
|
fanEff_(rhs.fanEff_),
|
||||||
rInner_(ptf.rInner_),
|
rEff_(rhs.rEff_),
|
||||||
rOuter_(ptf.rOuter_),
|
rInner_(rhs.rInner_),
|
||||||
useRealRadius_(ptf.useRealRadius_)
|
rOuter_(rhs.rOuter_),
|
||||||
|
useRealRadius_(rhs.useRealRadius_)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
@ -254,10 +270,18 @@ void Foam::swirlFanVelocityFvPatchField::write(Ostream& os) const
|
|||||||
rpm_->writeData(os);
|
rpm_->writeData(os);
|
||||||
}
|
}
|
||||||
|
|
||||||
os.writeEntryIfDifferent<scalar>("rEff", 0.0, rEff_);
|
os.writeEntryIfDifferent<scalar>("fanEff", 1, rEff_);
|
||||||
os.writeEntryIfDifferent<bool>("useRealRadius", false, useRealRadius_);
|
|
||||||
os.writeEntryIfDifferent<scalar>("rInner", 0.0, rInner_);
|
if (useRealRadius_)
|
||||||
os.writeEntryIfDifferent<scalar>("rOuter", 0.0, rOuter_);
|
{
|
||||||
|
os.writeEntry("useRealRadius", "true");
|
||||||
|
os.writeEntryIfDifferent<scalar>("rInner", 0, rInner_);
|
||||||
|
os.writeEntryIfDifferent<scalar>("rOuter", 0, rOuter_);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
os.writeEntryIfDifferent<scalar>("rEff", 0, rEff_);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -73,11 +73,11 @@ Usage
|
|||||||
p | pressure field name | no | p
|
p | pressure field name | no | p
|
||||||
origin | fan centre | no | calculated
|
origin | fan centre | no | calculated
|
||||||
rpm | RPM of the fan | yes
|
rpm | RPM of the fan | yes
|
||||||
rEff | Effective radius | no | 0.0
|
fanEff | Fan efficiency | no | 1
|
||||||
fanEff | Fan efficiency | no | 1.0
|
rEff | Effective radius | no | 0
|
||||||
useRealRadius| Use inner/outer radii | no | false
|
useRealRadius| Use inner/outer radii | no | false
|
||||||
rInner | Inner radius | no | 0.0
|
rInner | Inner radius | no | 0
|
||||||
rOuter | Outer radius | no | 0.0
|
rOuter | Outer radius | no | 0
|
||||||
\endtable
|
\endtable
|
||||||
|
|
||||||
Example of the boundary condition specification:
|
Example of the boundary condition specification:
|
||||||
@ -137,12 +137,12 @@ class swirlFanVelocityFvPatchField
|
|||||||
//- Fan rpm
|
//- Fan rpm
|
||||||
autoPtr<Function1<scalar>> rpm_;
|
autoPtr<Function1<scalar>> rpm_;
|
||||||
|
|
||||||
//- Effective fan radius
|
|
||||||
scalar rEff_;
|
|
||||||
|
|
||||||
//- Fan efficiency
|
//- Fan efficiency
|
||||||
scalar fanEff_;
|
scalar fanEff_;
|
||||||
|
|
||||||
|
//- Effective fan radius
|
||||||
|
scalar rEff_;
|
||||||
|
|
||||||
//- Inner radius
|
//- Inner radius
|
||||||
scalar rInner_;
|
scalar rInner_;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user