ExplicitSetValue.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 | Copyright (C) 2011-2015 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::fv::explicitSetValue
26 
27 Description
28  Set values field values explicity.
29 
30  Sources described by:
31 
32  \verbatim
33  <Type>ExplicitSetValueCoeffs
34  {
35  injectionRate
36  {
37  k 30.7;
38  epsilon 1.5;
39  }
40  }
41  \endverbatim
42 
43 SeeAlso
44  Foam::fvOption
45 
46 SourceFiles
47  explicitSetValue.C
48 
49 \*---------------------------------------------------------------------------*/
50 
51 #ifndef ExplicitSetValue_H
52 #define ExplicitSetValue_H
53 
54 #include "cellSetOption.H"
55 #include "Tuple2.H"
56 
57 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
58 
59 namespace Foam
60 {
61 namespace fv
62 {
63 
64 /*---------------------------------------------------------------------------*\
65  Class explicitSetValue Declaration
66 \*---------------------------------------------------------------------------*/
67 
68 template<class Type>
69 class ExplicitSetValue
70 :
71  public cellSetOption
72 {
73 
74 protected:
75 
76  // Protected data
77 
78  //- Source value per field
80 
81 
82  // Protected functions
83 
84  //- Set the local field data
85  void setFieldData(const dictionary& dict);
86 
87 
88 public:
89 
90  //- Runtime type information
91  TypeName("explicitSetValue");
92 
93 
94  // Constructors
95 
96  //- Construct from components
98  (
99  const word& name,
100  const word& modelType,
101  const dictionary& dict,
102  const fvMesh& mesh
103  );
104 
105 
106  // Member Functions
107 
108  // Evaluation
109 
110  //- Set value on field
111  virtual void constrain(fvMatrix<Type>& eqn, const label fieldI);
112 
113 
114  // IO
115 
116  //- Read source dictionary
117  virtual bool read(const dictionary& dict);
118 };
119 
120 
121 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
122 
123 } // End namespace fv
124 } // End namespace Foam
125 
126 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
127 
128 #ifdef NoRepository
129 # include "ExplicitSetValue.C"
130 # include "ExplicitSetValueIO.C"
131 #endif
132 
133 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
134 
135 #endif
136 
137 // ************************************************************************* //
Foam::word
A class for handling words, derived from string.
Definition: word.H:59
Foam::fv::cellSetOption
Cell-set options abtract base class. Provides a base set of controls, e.g.
Definition: cellSetOption.H:71
Tuple2.H
Foam::fv::option::name
const word & name() const
Return const access to the source name.
Definition: fvOptionI.H:28
cellSetOption.H
Foam::label
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
Foam::fv::ExplicitSetValue::constrain
virtual void constrain(fvMatrix< Type > &eqn, const label fieldI)
Set value on field.
Definition: ExplicitSetValue.C:73
Foam::fv::ExplicitSetValue::setFieldData
void setFieldData(const dictionary &dict)
Set the local field data.
Definition: ExplicitSetValue.C:34
ExplicitSetValue.C
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:137
Foam::fv::ExplicitSetValue::ExplicitSetValue
ExplicitSetValue(const word &name, const word &modelType, const dictionary &dict, const fvMesh &mesh)
Construct from components.
Definition: ExplicitSetValue.C:55
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::fv::ExplicitSetValue
Definition: ExplicitSetValue.H:68
Foam::fv::ExplicitSetValue::injectionRate_
List< Type > injectionRate_
Source value per field.
Definition: ExplicitSetValue.H:78
fv
labelList fv(nPoints)
Foam::fv::ExplicitSetValue::TypeName
TypeName("explicitSetValue")
Runtime type information.
Foam::List< Type >
ExplicitSetValueIO.C
Foam::fv::ExplicitSetValue::read
virtual bool read(const dictionary &dict)
Read source dictionary.
Definition: ExplicitSetValueIO.C:31
Foam::fv::option::mesh
const fvMesh & mesh() const
Return const access to the mesh database.
Definition: fvOptionI.H:34
Foam::fvMatrix< Type >