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 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 and internal field
96  (
97  const fvPatch&,
99  );
100 
101  //- Construct from patch, internal field and dictionary
103  (
104  const fvPatch&,
106  const dictionary&,
107  const bool valueRequired=true
108  );
109 
110  //- Construct by mapping given fixedValueInletOutletFvPatchField
111  // onto a new patch
113  (
115  const fvPatch&,
117  const fvPatchFieldMapper&,
118  const bool mappingRequired=true
119  );
120 
121  //- Disallow copy without setting internal field reference
123  (
125  ) = delete;
126 
127  //- Copy constructor setting internal field reference
129  (
132  );
133 
134  //- Construct and return a clone setting internal field reference
136  (
138  ) const
139  {
140  return tmp<fvPatchField<Type>>
141  (
143  );
144  }
146 
147  // Member Functions
148 
149  // Evaluation functions
150 
151  //- Return the matrix diagonal coefficients corresponding to the
152  // evaluation of the value of this patchField with given weights
154  (
155  const tmp<scalarField>&
156  ) const;
157 
158  //- Return the matrix source coefficients corresponding to the
159  // evaluation of the value of this patchField with given weights
161  (
162  const tmp<scalarField>&
163  ) const;
164 
165  //- Write
166  virtual void write(Ostream&) const;
167 };
168 
169 
170 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
171 
172 } // End namespace Foam
173 
174 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
175 
176 #ifdef NoRepository
178 #endif
179 
180 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
181 
182 #endif
183 
184 // ************************************************************************* //
fixedValueInletOutletFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:63
TypeName("fixedValueInletOutlet")
Runtime type information.
This boundary condition sets a fixed value. When the flow direction is inwards this acts exactly like...
Foam::fvPatchFieldMapper.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:54
virtual tmp< Field< Type > > valueInternalCoeffs(const tmp< scalarField > &) const
Return the matrix diagonal coefficients corresponding to the.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
A class for managing temporary objects.
Definition: PtrList.H:53
virtual tmp< Field< Type > > valueBoundaryCoeffs(const tmp< scalarField > &) const
Return the matrix source coefficients corresponding to the.
tmp< fvPatchField< Type > > clone() const
Disallow clone without setting internal field reference.
Definition: fvPatchField.H:199
Namespace for OpenFOAM.