FixedValueConstraint.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) 2016-2017 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::fv::FixedValueConstraint
28 
29 Group
30  grpFvOptionsConstraints
31 
32 Description
33  Constrain the field values within a specified region.
34 
35 Usage
36  For example to set the turbulence properties within a porous region:
37  \verbatim
38  porosityTurbulence
39  {
40  type scalarFixedValueConstraint;
41  active yes;
42 
43  selectionMode cellZone;
44  cellZone porosity;
45  fieldValues
46  {
47  k 1;
48  epsilon 150;
49  }
50  }
51  \endverbatim
52 
53 See also
54  Foam::fvOption
55 
56 SourceFiles
57  FixedValueConstraint.C
58  fixedValueConstraints.C
59 
60 \*---------------------------------------------------------------------------*/
61 
62 #ifndef FixedValueConstraint_H
63 #define FixedValueConstraint_H
64 
65 #include "cellSetOption.H"
66 
67 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
68 
69 namespace Foam
70 {
71 namespace fv
72 {
73 
74 /*---------------------------------------------------------------------------*\
75  Class FixedValueConstraint Declaration
76 \*---------------------------------------------------------------------------*/
77 
78 template<class Type>
80 :
81  public cellSetOption
82 {
83  // Private member data
84 
85  //- Field values
86  List<Type> fieldValues_;
87 
88 
89 public:
90 
91  //- Runtime type information
92  TypeName("FixedValueConstraint");
93 
94 
95  // Constructors
96 
97  //- Construct from components
99  (
100  const word& name,
101  const word& modelType,
102  const dictionary& dict,
103  const fvMesh& mesh
104  );
105 
106 
107  // Member Functions
108 
109  //- Read source dictionary
110  virtual bool read(const dictionary& dict);
111 
112  //- Set value on field
113  virtual void constrain(fvMatrix<Type>& eqn, const label fieldi);
114 };
115 
116 
117 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
118 
119 } // End namespace fv
120 } // End namespace Foam
121 
122 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
123 
124 #ifdef NoRepository
125  #include "FixedValueConstraint.C"
126 #endif
127 
128 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
129 
130 #endif
131 
132 // ************************************************************************* //
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:62
Foam::fv::cellSetOption
Cell-set options abstract base class. Provides a base set of controls, e.g.:
Definition: cellSetOption.H:72
Foam::fv::option::name
const word & name() const
Return const access to the source name.
Definition: fvOptionI.H:30
Foam::fv::FixedValueConstraint
Constrain the field values within a specified region.
Definition: FixedValueConstraint.H:78
Foam::fv::FixedValueConstraint::read
virtual bool read(const dictionary &dict)
Read source dictionary.
Definition: FixedValueConstraint.C:53
cellSetOption.H
Foam::fv::FixedValueConstraint::FixedValueConstraint
FixedValueConstraint(const word &name, const word &modelType, const dictionary &dict, const fvMesh &mesh)
Construct from components.
Definition: FixedValueConstraint.C:37
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:121
FixedValueConstraint.C
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:84
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::fv::FixedValueConstraint::TypeName
TypeName("FixedValueConstraint")
Runtime type information.
fv
labelList fv(nPoints)
Foam::List< Type >
Foam::fv::FixedValueConstraint::constrain
virtual void constrain(fvMatrix< Type > &eqn, const label fieldi)
Set value on field.
Definition: FixedValueConstraint.C:83
Foam::fv::option::mesh
const fvMesh & mesh() const
Return const access to the mesh database.
Definition: fvOptionI.H:36
Foam::fvMatrix
A special matrix type and solver, designed for finite volume solutions of scalar equations....
Definition: fvPatchField.H:76