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 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  \heading Patch usage
45 
46  \table
47  Property | Description | Required | Default value
48  phi | flux field name | no | phi
49  lowerBound | lower bound for clipping | yes |
50  upperBound | upper bound for clipping | yes |
51  \endtable
52 
53  Example of the boundary condition specification:
54  \verbatim
55  myPatch
56  {
57  type variableHeightFlowRate;
58  lowerBound 0.0;
59  upperBound 0.9;
60  value uniform 0;
61  }
62  \endverbatim
63 
64 SourceFiles
65  variableHeightFlowRateFvPatchScalarField.C
66 
67 \*---------------------------------------------------------------------------*/
68 
69 #ifndef variableHeightFlowRateFvPatchScalarField_H
70 #define variableHeightFlowRateFvPatchScalarField_H
71 
72 #include "mixedFvPatchFields.H"
73 
74 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
75 
76 namespace Foam
77 {
78 
79 /*---------------------------------------------------------------------------*\
80  Class variableHeightFlowRateFvPatchScalarField Declaration
81 \*---------------------------------------------------------------------------*/
82 
83 class variableHeightFlowRateFvPatchScalarField
84 :
85  public mixedFvPatchScalarField
86 {
87 
88 protected:
89 
90  // Protected data
91 
92  //- Name of flux field
93  word phiName_;
94 
95  //- Lower bound for alpha1
96  scalar lowerBound_;
97 
98  //- Upper bound for alpha1
99  scalar upperBound_;
100 
101 
102 public:
103 
104  //- Runtime scalar information
105  TypeName("variableHeightFlowRate");
106 
107 
108  // Constructors
109 
110  //- Construct from patch and internal field
112  (
113  const fvPatch&,
115  );
116 
117  //- Construct from patch, internal field and dictionary
119  (
120  const fvPatch&,
122  const dictionary&
123  );
124 
125  //- Construct by mapping given
126  // variableHeightFlowRateFvPatchScalarField onto a new patch
128  (
130  const fvPatch&,
132  const fvPatchFieldMapper&
133  );
134 
135  //- Construct as copy
137  (
139  );
140 
141  //- Construct and return a clone
142  virtual tmp<fvPatchField<scalar> > clone() const
143  {
144  return tmp<fvPatchField<scalar> >
145  (
147  );
148  }
149 
150  //- Construct as copy setting internal field reference
152  (
155  );
156 
157  //- Construct and return a clone setting internal field reference
159  (
161  ) const
162  {
163  return tmp<fvPatchField<scalar> >
164  (
166  );
167  }
168 
169 
170  // Member functions
171 
172  //- Update the coefficients associated with the patch field
173  virtual void updateCoeffs();
174 
175  //- Write
176  virtual void write(Ostream&) const;
177 };
178 
179 
180 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
181 
182 } // End namespace Foam
183 
184 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
185 
186 #endif
187 
188 // ************************************************************************* //
Foam::variableHeightFlowRateFvPatchScalarField::lowerBound_
scalar lowerBound_
Lower bound for alpha1.
Definition: variableHeightFlowRateFvPatchField.H:115
Foam::word
A class for handling words, derived from string.
Definition: word.H:59
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:118
Foam::variableHeightFlowRateFvPatchScalarField::upperBound_
scalar upperBound_
Upper bound for alpha1.
Definition: variableHeightFlowRateFvPatchField.H:118
Foam::variableHeightFlowRateFvPatchScalarField::updateCoeffs
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Definition: variableHeightFlowRateFvPatchField.C:129
Foam::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:61
Foam::variableHeightFlowRateFvPatchScalarField::clone
virtual tmp< fvPatchField< scalar > > clone() const
Construct and return a clone.
Definition: variableHeightFlowRateFvPatchField.H:161
Foam::variableHeightFlowRateFvPatchScalarField::phiName_
word phiName_
Name of flux field.
Definition: variableHeightFlowRateFvPatchField.H:112
Foam::dictionary
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:137
Foam::variableHeightFlowRateFvPatchScalarField
This boundary condition provides a phase fraction condition based on the local flow conditions,...
Definition: variableHeightFlowRateFvPatchField.H:102
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
mixedFvPatchFields.H
Foam::fvPatchFieldMapper
Foam::fvPatchFieldMapper.
Definition: fvPatchFieldMapper.H:45
Foam::variableHeightFlowRateFvPatchScalarField::write
virtual void write(Ostream &) const
Write.
Definition: variableHeightFlowRateFvPatchField.C:172
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:53
Foam::variableHeightFlowRateFvPatchScalarField::TypeName
TypeName("variableHeightFlowRate")
Runtime scalar information.
Foam::variableHeightFlowRateFvPatchScalarField::variableHeightFlowRateFvPatchScalarField
variableHeightFlowRateFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
Definition: variableHeightFlowRateFvPatchField.C:36
Foam::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:51