fixedValueInletOutletFvPatchField.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2021-2023 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::fixedValueInletOutletFvPatchField
26 
27 Description
28  This boundary condition sets a fixed value. When the flow direction is
29  inwards this acts exactly like a fixed value condition. In the presence of
30  outflow, however, this condition approximates the fixed value constraint in
31  advective terms by fixing the gradient instead.
32 
33  This condition is not likely to be used on its own. It is more suitable as
34  a base class for conditions that need to specify the value of a field even
35  when the flow reverses.
36 
37 Usage
38  \table
39  Property | Description | Required | Default value
40  phi | Name of the flux field | no | phi
41  \endtable
42 
43  Example of the boundary condition specification:
44  \verbatim
45  <patchName>
46  {
47  type fixedValueInletOutlet;
48  phi phi;
49  value 0;
50  }
51  \endverbatim
52 
53 See also
54  Foam::fixedValueFvPatchField
55 
56 SourceFiles
57  fixedValueInletOutletFvPatchField.C
58 
59 \*---------------------------------------------------------------------------*/
60 
61 #ifndef fixedValueInletOutletFvPatchField_H
62 #define fixedValueInletOutletFvPatchField_H
63 
65 
66 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
67 
68 namespace Foam
69 {
70 
71 /*---------------------------------------------------------------------------*\
72  Class fixedValueInletOutletFvPatchField Declaration
73 \*---------------------------------------------------------------------------*/
74 
75 template<class Type>
76 class fixedValueInletOutletFvPatchField
77 :
78  public fixedValueFvPatchField<Type>
79 {
80  // Private Data
81 
82  //- Name of the flux field
83  const word phiName_;
84 
85 
86 public:
87 
88  //- Runtime type information
89  TypeName("fixedValueInletOutlet");
90 
91 
92  // Constructors
93 
94  //- Construct from patch, internal field and dictionary
96  (
97  const fvPatch&,
99  const dictionary&,
100  const bool valueRequired=true
101  );
102 
103  //- Construct by mapping given fixedValueInletOutletFvPatchField
104  // onto a new patch
106  (
108  const fvPatch&,
110  const fvPatchFieldMapper&,
111  const bool mappingRequired=true
112  );
113 
114  //- Disallow copy without setting internal field reference
116  (
118  ) = delete;
119 
120  //- Copy constructor setting internal field reference
122  (
125  );
126 
127  //- Construct and return a clone setting internal field reference
129  (
131  ) const
132  {
133  return tmp<fvPatchField<Type>>
134  (
136  );
137  }
138 
139 
140  // Member Functions
141 
142  // Evaluation functions
143 
144  //- Return the matrix diagonal coefficients corresponding to the
145  // evaluation of the value of this patchField with given weights
147  (
148  const tmp<scalarField>&
149  ) const;
150 
151  //- Return the matrix source coefficients corresponding to the
152  // evaluation of the value of this patchField with given weights
154  (
155  const tmp<scalarField>&
156  ) const;
157 
158  //- Write
159  virtual void write(Ostream&) const;
160 };
161 
162 
163 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
164 
165 } // End namespace Foam
166 
167 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
168 
169 #ifdef NoRepository
171 #endif
172 
173 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
174 
175 #endif
176 
177 // ************************************************************************* //
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:57
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:160
This boundary condition sets a fixed value. When the flow direction is inwards this acts exactly like...
virtual tmp< Field< Type > > valueInternalCoeffs(const tmp< scalarField > &) const
Return the matrix diagonal coefficients corresponding to the.
virtual tmp< Field< Type > > valueBoundaryCoeffs(const tmp< scalarField > &) const
Return the matrix source coefficients corresponding to the.
TypeName("fixedValueInletOutlet")
Runtime type information.
fixedValueInletOutletFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &, const dictionary &, const bool valueRequired=true)
Construct from patch, internal field and dictionary.
Foam::fvPatchFieldMapper.
tmp< fvPatchField< Type > > clone() const
Disallow clone without setting internal field reference.
Definition: fvPatchField.H:203
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:64
A class for managing temporary objects.
Definition: tmp.H:55
Namespace for OpenFOAM.