variableHeightFlowRateFvPatchField.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
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.
15 
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
19  for more details.
20 
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/>.
23 
24 Class
25  Foam::variableHeightFlowRateFvPatchScalarField
26 
27 Group
28  grpInletBoundaryConditions
29 
30 Description
31  This boundary condition provides a phase fraction condition based on the
32  local flow conditions, whereby the values are constrained to lay between
33  user-specified upper and lower bounds. The behaviour is described by:
34 
35  if alpha > upperBound:
36  - apply a fixed value condition, with a uniform level of the upper bound
37 
38  if lower bound <= alpha <= upper bound:
39  - apply a zero-gradient condition
40 
41  if alpha < lowerBound:
42  - apply a fixed value condition, with a uniform level of the lower bound
43 
44 Usage
45  \table
46  Property | Description | Required | Default value
47  phi | flux field name | no | phi
48  lowerBound | lower bound for clipping | yes |
49  upperBound | upper bound for clipping | yes |
50  \endtable
51 
52  Example of the boundary condition specification:
53  \verbatim
54  <patchName>
55  {
56  type variableHeightFlowRate;
57  lowerBound 0.0;
58  upperBound 0.9;
59  value uniform 0;
60  }
61  \endverbatim
62 
63 SourceFiles
64  variableHeightFlowRateFvPatchScalarField.C
65 
66 \*---------------------------------------------------------------------------*/
67 
68 #ifndef variableHeightFlowRateFvPatchScalarField_H
69 #define variableHeightFlowRateFvPatchScalarField_H
70 
71 #include "mixedFvPatchFields.H"
72 
73 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
74 
75 namespace Foam
76 {
77 
78 /*---------------------------------------------------------------------------*\
79  Class variableHeightFlowRateFvPatchScalarField Declaration
80 \*---------------------------------------------------------------------------*/
81 
82 class variableHeightFlowRateFvPatchScalarField
83 :
84  public mixedFvPatchScalarField
85 {
86 
87 protected:
88 
89  // Protected data
90 
91  //- Name of flux field
92  word phiName_;
93 
94  //- Lower bound for alpha1
95  scalar lowerBound_;
96 
97  //- Upper bound for alpha1
98  scalar upperBound_;
99 
100 
101 public:
102 
103  //- Runtime scalar information
104  TypeName("variableHeightFlowRate");
105 
106 
107  // Constructors
108 
109  //- Construct from patch and internal field
111  (
112  const fvPatch&,
114  );
115 
116  //- Construct from patch, internal field and dictionary
118  (
119  const fvPatch&,
121  const dictionary&
122  );
123 
124  //- Construct by mapping given
125  // variableHeightFlowRateFvPatchScalarField onto a new patch
127  (
129  const fvPatch&,
131  const fvPatchFieldMapper&
132  );
133 
134  //- Construct as copy
136  (
138  );
139 
140  //- Construct and return a clone
141  virtual tmp<fvPatchField<scalar>> clone() const
142  {
144  (
146  );
147  }
148 
149  //- Construct as copy setting internal field reference
151  (
154  );
155 
156  //- Construct and return a clone setting internal field reference
158  (
160  ) const
161  {
163  (
165  );
166  }
167 
168 
169  // Member functions
170 
171  //- Update the coefficients associated with the patch field
172  virtual void updateCoeffs();
173 
174  //- Write
175  virtual void write(Ostream&) const;
176 };
178 
179 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
180 
181 } // End namespace Foam
182 
183 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
184 
185 #endif
186 
187 // ************************************************************************* //
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:61
This boundary condition provides a phase fraction condition based on the local flow conditions...
Foam::fvPatchFieldMapper.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:53
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
virtual tmp< fvPatchField< scalar > > clone() const
Construct and return a clone.
A class for managing temporary objects.
Definition: PtrList.H:53
variableHeightFlowRateFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
TypeName("variableHeightFlowRate")
Runtime scalar information.
Namespace for OpenFOAM.