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 | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2012-2016 OpenFOAM Foundation
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 Class
27  Foam::variableHeightFlowRateFvPatchScalarField
28 
29 Group
30  grpInletBoundaryConditions
31 
32 Description
33  This boundary condition provides a phase fraction condition based on the
34  local flow conditions, whereby the values are constrained to lay between
35  user-specified upper and lower bounds. The behaviour is described by:
36 
37  if alpha > upperBound:
38  - apply a fixed value condition, with a uniform level of the upper bound
39 
40  if lower bound <= alpha <= upper bound:
41  - apply a zero-gradient condition
42 
43  if alpha < lowerBound:
44  - apply a fixed value condition, with a uniform level of the lower bound
45 
46 Usage
47  \table
48  Property | Description | Required | Default value
49  phi | flux field name | no | phi
50  lowerBound | lower bound for clipping | yes |
51  upperBound | upper bound for clipping | yes |
52  \endtable
53 
54  Example of the boundary condition specification:
55  \verbatim
56  <patchName>
57  {
58  type variableHeightFlowRate;
59  lowerBound 0.0;
60  upperBound 0.9;
61  value uniform 0;
62  }
63  \endverbatim
64 
65 SourceFiles
66  variableHeightFlowRateFvPatchScalarField.C
67 
68 \*---------------------------------------------------------------------------*/
69 
70 #ifndef variableHeightFlowRateFvPatchScalarField_H
71 #define variableHeightFlowRateFvPatchScalarField_H
72 
73 #include "mixedFvPatchFields.H"
74 
75 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
76 
77 namespace Foam
78 {
79 
80 /*---------------------------------------------------------------------------*\
81  Class variableHeightFlowRateFvPatchScalarField Declaration
82 \*---------------------------------------------------------------------------*/
83 
84 class variableHeightFlowRateFvPatchScalarField
85 :
86  public mixedFvPatchScalarField
87 {
88 
89 protected:
90 
91  // Protected data
92 
93  //- Name of flux field
94  word phiName_;
95 
96  //- Lower bound for alpha1
97  scalar lowerBound_;
98 
99  //- Upper bound for alpha1
100  scalar upperBound_;
101 
102 
103 public:
104 
105  //- Runtime scalar information
106  TypeName("variableHeightFlowRate");
107 
108 
109  // Constructors
110 
111  //- Construct from patch and internal field
113  (
114  const fvPatch&,
116  );
117 
118  //- Construct from patch, internal field and dictionary
120  (
121  const fvPatch&,
123  const dictionary&
124  );
125 
126  //- Construct by mapping given
127  // variableHeightFlowRateFvPatchScalarField onto a new patch
129  (
131  const fvPatch&,
133  const fvPatchFieldMapper&
134  );
135 
136  //- Construct as copy
138  (
140  );
141 
142  //- Construct as copy setting internal field reference
144  (
147  );
148 
149  //- Return a clone
150  virtual tmp<fvPatchField<scalar>> clone() const
151  {
152  return fvPatchField<scalar>::Clone(*this);
153  }
154 
155  //- Clone with an internal field reference
157  (
159  ) const
160  {
161  return fvPatchField<scalar>::Clone(*this, iF);
162  }
163 
164 
165  // Member functions
166 
167  //- Update the coefficients associated with the patch field
168  virtual void updateCoeffs();
169 
170  //- Write
171  virtual void write(Ostream&) const;
172 };
173 
174 
175 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
176 
177 } // End namespace Foam
178 
179 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
180 
181 #endif
182 
183 // ************************************************************************* //
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:129
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:70
static tmp< fvPatchField< Type > > Clone(const DerivedPatchField &pf, Args &&... args)
Clone a patch field, optionally with internal field reference etc.
Definition: fvPatchField.H:597
This boundary condition provides a phase fraction condition based on the local flow conditions...
A FieldMapper for finite-volume patch fields.
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
Return a clone.
A class for managing temporary objects.
Definition: HashPtrTable.H:50
variableHeightFlowRateFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
TypeName("variableHeightFlowRate")
Runtime scalar information.
Namespace for OpenFOAM.