1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
11 OpenFOAM is free software: you can redistribute it and/or modify it
12 under the terms of the GNU General Public License as published by
13 the Free Software Foundation, either version 3 of the License, or
14 (at your option) any later version.
16 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 You should have received a copy of the GNU General Public License
22 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 Foam::fanPressureFvPatchScalarField
28 Assigns pressure inlet or outlet total pressure condition for a fan.
31 - pressure drop vs volumetric flow rate table (fan curve) file name;
32 - direction of normal flow through the fan, in or out;
33 - total pressure of the environment.
35 Example of the boundary condition specification:
40 fileName "fanCurve"; // Fan curve file name
41 outOfBounds clamp; // (error|warn|clamp|repeat)
42 direction in; // Direction of flow through fan
43 p0 uniform 0; // Environmental total pressure
44 value uniform 0; // Initial pressure
50 fileName "fanCurve"; // Fan curve file name
51 outOfBounds clamp; // (error|warn|clamp|repeat)
52 direction out; // Direction of flow through fan
53 p0 uniform 0; // Environmental total pressure
54 value uniform 0; // Initial pressure
59 Foam::totalPressureFvPatchScalarField and
60 Foam::interpolationTable
63 fanPressureFvPatchScalarField.C
65 \*---------------------------------------------------------------------------*/
67 #ifndef fanPressureFvPatchScalarField_H
68 #define fanPressureFvPatchScalarField_H
70 #include "totalPressureFvPatchScalarField.H"
71 #include "interpolationTable.H"
73 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
78 /*---------------------------------------------------------------------------*\
79 Class fanPressureFvPatchScalarField Declaration
80 \*---------------------------------------------------------------------------*/
82 class fanPressureFvPatchScalarField
84 public totalPressureFvPatchScalarField
89 //- Fan flow direction
96 static const NamedEnum<fanFlowDirection, 2> fanFlowDirectionNames_;
102 //- Tabulated fan curve
103 interpolationTable<scalar> fanCurve_;
105 //- Direction of flow through the fan relative to patch
106 fanFlowDirection direction_;
111 //- Runtime type information
112 TypeName("fanPressure");
117 //- Construct from patch and internal field
118 fanPressureFvPatchScalarField
121 const DimensionedField<scalar, volMesh>&
124 //- Construct from patch, internal field and dictionary
125 fanPressureFvPatchScalarField
128 const DimensionedField<scalar, volMesh>&,
132 //- Construct by mapping given
133 // fanPressureFvPatchScalarField
135 fanPressureFvPatchScalarField
137 const fanPressureFvPatchScalarField&,
139 const DimensionedField<scalar, volMesh>&,
140 const fvPatchFieldMapper&
143 //- Construct as copy
144 fanPressureFvPatchScalarField
146 const fanPressureFvPatchScalarField&
149 //- Construct and return a clone
150 virtual tmp<fvPatchScalarField> clone() const
152 return tmp<fvPatchScalarField>
154 new fanPressureFvPatchScalarField(*this)
158 //- Construct as copy setting internal field reference
159 fanPressureFvPatchScalarField
161 const fanPressureFvPatchScalarField&,
162 const DimensionedField<scalar, volMesh>&
165 //- Construct and return a clone setting internal field reference
166 virtual tmp<fvPatchScalarField> clone
168 const DimensionedField<scalar, volMesh>& iF
171 return tmp<fvPatchScalarField>
173 new fanPressureFvPatchScalarField
184 //- Update the coefficients associated with the patch field
185 virtual void updateCoeffs();
188 virtual void write(Ostream&) const;
192 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
194 } // End namespace Foam
196 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
200 // ************************************************************************* //