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 and return a clone
143  virtual tmp<fvPatchField<scalar>> clone() const
144  {
146  (
148  );
149  }
150 
151  //- Construct as copy setting internal field reference
153  (
156  );
157 
158  //- Construct and return a clone setting internal field reference
160  (
162  ) const
163  {
165  (
167  );
168  }
169 
170 
171  // Member functions
172 
173  //- Update the coefficients associated with the patch field
174  virtual void updateCoeffs();
175 
176  //- Write
177  virtual void write(Ostream&) const;
178 };
179 
180 
181 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
182 
183 } // End namespace Foam
184 
185 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
186 
187 #endif
188 
189 // ************************************************************************* //
Foam::variableHeightFlowRateFvPatchScalarField::lowerBound_
scalar lowerBound_
Lower bound for alpha1.
Definition: variableHeightFlowRateFvPatchField.H:116
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::variableHeightFlowRateFvPatchScalarField::upperBound_
scalar upperBound_
Upper bound for alpha1.
Definition: variableHeightFlowRateFvPatchField.H:119
Foam::variableHeightFlowRateFvPatchScalarField::updateCoeffs
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Definition: variableHeightFlowRateFvPatchField.C:133
Foam::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:65
Foam::variableHeightFlowRateFvPatchScalarField::clone
virtual tmp< fvPatchField< scalar > > clone() const
Construct and return a clone.
Definition: variableHeightFlowRateFvPatchField.H:162
Foam::variableHeightFlowRateFvPatchScalarField::phiName_
word phiName_
Name of flux field.
Definition: variableHeightFlowRateFvPatchField.H:113
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam::variableHeightFlowRateFvPatchScalarField
This boundary condition provides a phase fraction condition based on the local flow conditions,...
Definition: variableHeightFlowRateFvPatchField.H:103
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
mixedFvPatchFields.H
Foam::fvPatchFieldMapper
Foam::fvPatchFieldMapper.
Definition: fvPatchFieldMapper.H:47
Foam::variableHeightFlowRateFvPatchScalarField::write
virtual void write(Ostream &) const
Write.
Definition: variableHeightFlowRateFvPatchField.C:176
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
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:39
Foam::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:54