STYLE: correct documentation for fanFvPatchField (#1229)

- for more clarity, make read/write of rpm and mean-diameter contingent
  on nonDimensional == true
This commit is contained in:
Mark Olesen
2019-03-14 08:19:15 +01:00
committed by Andrew Heather
parent 8bd6568d05
commit 98e8b7ffed
4 changed files with 50 additions and 37 deletions

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 | Copyright (C) 2017 OpenCFD Ltd. \\ / A nd | Copyright (C) 2017-2019 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
| Copyright (C) 2011-2015 OpenFOAM Foundation | Copyright (C) 2011-2015 OpenFOAM Foundation
@ -53,8 +53,8 @@ Foam::fanFvPatchField<Type>::fanFvPatchField
rhoName_("rho"), rhoName_("rho"),
uniformJump_(false), uniformJump_(false),
nonDimensional_(false), nonDimensional_(false),
rpm_(0.0), rpm_(0),
dm_(0.0) dm_(0)
{} {}
@ -71,8 +71,8 @@ Foam::fanFvPatchField<Type>::fanFvPatchField
rhoName_(dict.lookupOrDefault<word>("rho", "rho")), rhoName_(dict.lookupOrDefault<word>("rho", "rho")),
uniformJump_(dict.lookupOrDefault("uniformJump", false)), uniformJump_(dict.lookupOrDefault("uniformJump", false)),
nonDimensional_(dict.lookupOrDefault("nonDimensional", false)), nonDimensional_(dict.lookupOrDefault("nonDimensional", false)),
rpm_(dict.lookupOrDefault<scalar>("rpm", 0.0)), rpm_(0),
dm_(dict.lookupOrDefault<scalar>("dm", 0.0)) dm_(0)
{ {
if (nonDimensional_) if (nonDimensional_)
{ {
@ -158,9 +158,13 @@ void Foam::fanFvPatchField<Type>::write(Ostream& os) const
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_); os.writeEntryIfDifferent<bool>("uniformJump", false, uniformJump_);
os.writeEntryIfDifferent<bool>("nonDimensional", false, nonDimensional_);
os.writeEntryIfDifferent<scalar>("rpm", false, rpm_); if (nonDimensional_)
os.writeEntryIfDifferent<scalar>("dm", false, dm_); {
os.writeEntry("nonDimensional", nonDimensional_);
os.writeEntry("rpm", rpm_);
os.writeEntry("dm", dm_);
}
} }

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 | Copyright (C) 2017-2018 OpenCFD Ltd. \\ / A nd | Copyright (C) 2017-2019 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
| Copyright (C) 2011-2016 OpenFOAM Foundation | Copyright (C) 2011-2016 OpenFOAM Foundation
@ -34,38 +34,42 @@ Description
condition as a base. condition as a base.
The jump is specified as a \c Function1 type, to enable the use of, e.g. The jump is specified as a \c Function1 type, to enable the use of, e.g.
contant, polynomial, table values. constant, polynomial, table values.
The switch nonDimensional can be used for a non-dimensional table. It needs The switch nonDimensional can be used for a non-dimensional table,
inputs rpm and dm of the fan. It should be used with uniformJump true. in combination with uniformJump = true.
As inputs it needs the fan RPM (rpm) and the mean diameter (dm).
The nonDimensional U for the table is calculate as : The non-dimensional U for the table is calculated as follows:
\verbatim
phi = 120*Un/(PI^3*dm*rpm) phi = 120*Un/(PI^3*dm*rpm)
where: where:
dm is the mean diameter. dm is the mean diameter.
rpm is the RPM of the fan. rpm is the RPM of the fan.
\endverbatim
The nonDimensinal pressure : The non-dimensional pressure:
\verbatim
Psi = 2 deltaP/(rho*(sqr(PI*omega*dm))) Psi = 2 deltaP/(rho*(sqr(PI*omega*dm)))
where: where:
deltaP is the pressure drop deltaP is the pressure drop
\endverbatim
The non-dimensional table should be given as Psi = F(phi). The non-dimensional table should be given as Psi = F(phi).
Usage Usage
\table \table
Property | Description | Required | Default value Property | Description | Required | Default
patchType | underlying patch type should be \c cyclic| yes | patchType | underlying patch type should be \c cyclic | yes |
jumpTable | jump data, e.g. \c csvFile | yes | jumpTable | jump data, e.g. \c csvFile | yes |
phi | flux field name | no | phi phi | flux field name | no | phi
rho | density field name | no | none rho | density field name | no | rho
uniformJump | applies a uniform pressure based on the averaged uniformJump | apply uniform pressure based on avg velocity | no | false
velocity | no | false nonDimensional | use non-dimensional table | no | false
nonDimensional | uses non-dimensional table | no | false rpm | fan rpm (non-dimensional table) | no | 0
rpm | fan rpm for non-dimensional table | no | 0.0 dm | mean diameter (non-dimensional table) | no | 0
dm | mean diameter for non-dimensional table | no | 0.0
\endtable \endtable
Example of the boundary condition specification: Example of the boundary condition specification:
@ -75,7 +79,8 @@ Usage
type fan; type fan;
patchType cyclic; patchType cyclic;
jumpTable csvFile; jumpTable csvFile;
csvFileCoeffs
jumpTableCoeffs
{ {
nHeaderLine 1; nHeaderLine 1;
refColumn 0; refColumn 0;
@ -109,7 +114,6 @@ SourceFiles
#define fanFvPatchField_H #define fanFvPatchField_H
#include "uniformJumpFvPatchField.H" #include "uniformJumpFvPatchField.H"
#include "Function1.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -130,14 +134,13 @@ class fanFvPatchField
//- Name of the flux transporting the field //- Name of the flux transporting the field
word phiName_; word phiName_;
//- Name of the density field used to normalise the mass flux //- Name of the density field for normalising the mass flux if necessary
//- if necessary
word rhoName_; word rhoName_;
//- Uniform pressure drop //- Apply uniform pressure drop
bool uniformJump_; bool uniformJump_;
//- Swtich for using non-dimensional curve //- Use non-dimensional curve
bool nonDimensional_; bool nonDimensional_;
// Parameters for non-dimensional table // Parameters for non-dimensional table
@ -228,7 +231,7 @@ public:
virtual void updateCoeffs(); virtual void updateCoeffs();
//- Write //- Write
virtual void write(Ostream&) const; virtual void write(Ostream& os) const;
}; };

View File

@ -100,9 +100,15 @@ Foam::fanFvPatchField<Foam::scalar>::fanFvPatchField
rhoName_(dict.lookupOrDefault<word>("rho", "rho")), rhoName_(dict.lookupOrDefault<word>("rho", "rho")),
uniformJump_(dict.lookupOrDefault("uniformJump", false)), uniformJump_(dict.lookupOrDefault("uniformJump", false)),
nonDimensional_(dict.lookupOrDefault("nonDimensional", false)), nonDimensional_(dict.lookupOrDefault("nonDimensional", false)),
rpm_(dict.lookupOrDefault<scalar>("rpm", 0.0)), rpm_(0),
dm_(dict.lookupOrDefault<scalar>("dm", 0.0)) dm_(0)
{ {
if (nonDimensional_)
{
dict.readEntry("rpm", rpm_);
dict.readEntry("dm", dm_);
}
if (this->cyclicPatch().owner()) if (this->cyclicPatch().owner())
{ {
this->jumpTable_ = Function1<scalar>::New("jumpTable", dict); this->jumpTable_ = Function1<scalar>::New("jumpTable", dict);

View File

@ -36,8 +36,8 @@ Description
Usage Usage
\table \table
Property | Description | Required | Default value Property | Description | Required | Default
patchType | underlying patch type should be \c cyclic| yes | patchType | underlying patch type should be \c cyclic | yes |
jumpTable | jump value | yes | jumpTable | jump value | yes |
\endtable \endtable
@ -171,7 +171,7 @@ public:
virtual void updateCoeffs(); virtual void updateCoeffs();
//- Write //- Write
virtual void write(Ostream&) const; virtual void write(Ostream& os) const;
}; };