limitHeight.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) 2022 OpenCFD Ltd.
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::fa::limitHeight
28 
29 Description
30  Limits the film height to a specified \c max value.
31 
32  The \c limitHeight applies an explicit correction to limit the max film
33  height to the user-specified value. This will ensure that the max value
34  is adhered to, but may become unstable if the limiting instigates an
35  oscillatory/destabilising effect into neighbouring faces that then spreads.
36 
37 Usage
38  Minimal example by using \c constant/faOptions:
39  \verbatim
40  <faOption>
41  {
42  // Mandatory entries
43  type limitHeight;
44  active yes;
45  selectionMode all;
46  max <scalar>;
47 
48  // Optional entries
49  h <word>;
50 
51  // Inherited entries
52  ...
53  }
54  \endverbatim
55 
56  where the entries mean:
57  \table
58  Property | Description | Type | Reqd | Deflt
59  type | Type name: limitHeight | word | yes | -
60  max | Maximum height limit [m] | scalar | yes | -
61  h | Name of operand height field | word | no | h
62  \endtable
63 
64  The inherited entries are elaborated in:
65  - \link faceSetOption.H \endlink
66 
67 SourceFiles
68  limitHeight.C
69 
70 \*---------------------------------------------------------------------------*/
71 
72 #ifndef fa_limitHeight_H
73 #define fa_limitHeight_H
74 
75 #include "faceSetOption.H"
76 
77 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
78 
79 namespace Foam
80 {
81 namespace fa
82 {
83 
84 /*---------------------------------------------------------------------------*\
85  Class limitHeight Declaration
86 \*---------------------------------------------------------------------------*/
87 
88 class limitHeight
89 :
90  public faceSetOption
91 {
92 protected:
93 
94  // Protected Data
95 
96  //- Name of operand height field
97  word hName_;
98 
99  //- Maximum height [m]
100  scalar max_;
101 
102 
103  // Protected Member Functions
104 
105  //- No copy construct
106  limitHeight(const limitHeight&) = delete;
108  //- No copy assignment
109  void operator=(const limitHeight&) = delete;
110 
111 
112 public:
113 
114  //- Runtime type information
115  TypeName("limitHeight");
116 
117 
118  // Constructors
119 
120  //- Construct from components
122  (
123  const word& name,
124  const word& modelType,
125  const dictionary& dict,
126  const fvMesh& mesh
127  );
128 
129 
130  //- Destructor
131  virtual ~limitHeight() = default;
132 
133 
134  // Member Functions
135 
136  //- Read dictionary
137  virtual bool read(const dictionary& dict);
138 
139  //- Correct the height field
140  virtual void correct(areaScalarField& h);
141 };
142 
143 
144 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
145 
146 } // End namespace fv
147 } // End namespace Foam
148 
149 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
150 
151 #endif
152 
153 // ************************************************************************* //
const fvMesh & mesh() const noexcept
Return const access to the mesh database.
Definition: faOptionI.H:29
dictionary dict
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:129
TypeName("limitHeight")
Runtime type information.
scalar max_
Maximum height [m].
Definition: limitHeight.H:123
virtual ~limitHeight()=default
Destructor.
void operator=(const limitHeight &)=delete
No copy assignment.
A class for handling words, derived from Foam::string.
Definition: word.H:63
const word & name() const noexcept
Return const access to the source name.
Definition: faOptionI.H:23
limitHeight(const limitHeight &)=delete
No copy construct.
Limits the film height to a specified max value.
Definition: limitHeight.H:107
const dimensionedScalar h
Planck constant.
word hName_
Name of operand height field.
Definition: limitHeight.H:118
virtual void correct(areaScalarField &h)
Correct the height field.
Definition: limitHeight.C:80
virtual bool read(const dictionary &dict)
Read dictionary.
Definition: limitHeight.C:62
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
Namespace for OpenFOAM.