fvOptionList.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-2016 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::optionList
26 
27 Description
28  List of finite volume options
29 
30 SourceFile
31  optionList.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef fvOptionList_H
36 #define fvOptionList_H
37 
38 #include "fvOption.H"
39 #include "PtrList.H"
40 #include "GeometricField.H"
41 #include "geometricOneField.H"
42 #include "fvPatchField.H"
43 
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 
46 namespace Foam
47 {
48 
49 // Forward declaration of friend functions and operators
50 
51 namespace fv
52 {
53  class optionList;
54 }
55 
56 Ostream& operator<<(Ostream& os, const fv::optionList& options);
57 
58 namespace fv
59 {
60 
61 /*---------------------------------------------------------------------------*\
62  Class optionList Declaration
63 \*---------------------------------------------------------------------------*/
64 
65 class optionList
66 :
67  public PtrList<option>
68 {
69 protected:
70 
71  // Protected data
72 
73  //- Reference to the mesh database
74  const fvMesh& mesh_;
75 
76  //- Time index to check that all defined sources have been applied
77  label checkTimeIndex_;
78 
79 
80  // Protected Member Functions
81 
82  //- Return the "options" sub-dictionary if present otherwise return dict
83  const dictionary& optionsDict(const dictionary& dict) const;
84 
85  //- Read options dictionary
86  bool readOptions(const dictionary& dict);
87 
88  //- Check that all sources have been applied
89  void checkApplied() const;
90 
91  //- Disallow default bitwise copy construct
92  optionList(const optionList&);
93 
94  //- Disallow default bitwise assignment
95  void operator=(const optionList&);
96 
97 
98 public:
99 
100  //- Runtime type information
101  TypeName("optionList");
102 
103 
104  // Constructors
105 
106  //- Construct null
107  optionList(const fvMesh& mesh);
108 
109  //- Construct from mesh and dictionary
110  optionList(const fvMesh& mesh, const dictionary& dict);
111 
112 
113  //- Destructor
114  virtual ~optionList()
115  {}
116 
117 
118  // Member Functions
119 
120  //- Reset the source list
121  void reset(const dictionary& dict);
122 
123 
124  // Sources
125 
126  //- Return source for equation
127  template<class Type>
128  tmp<fvMatrix<Type>> operator()
129  (
131  );
132 
133  //- Return source for equation with specified name
134  template<class Type>
135  tmp<fvMatrix<Type>> operator()
136  (
138  const word& fieldName
139  );
140 
141  //- Return source for equation
142  template<class Type>
143  tmp<fvMatrix<Type>> operator()
144  (
145  const volScalarField& rho,
147  );
148 
149  //- Return source for equation with specified name
150  template<class Type>
151  tmp<fvMatrix<Type>> operator()
152  (
153  const volScalarField& rho,
155  const word& fieldName
156  );
157 
158  //- Return source for equation
159  template<class Type>
160  tmp<fvMatrix<Type>> operator()
161  (
162  const volScalarField& alpha,
163  const volScalarField& rho,
165  );
166 
167  //- Return source for equation with specified name
168  template<class Type>
169  tmp<fvMatrix<Type>> operator()
170  (
171  const volScalarField& alpha,
172  const volScalarField& rho,
174  const word& fieldName
175  );
176 
177  //- Return source for equation
178  template<class Type>
179  tmp<fvMatrix<Type>> operator()
180  (
181  const volScalarField& alpha,
182  const geometricOneField& rho,
184  );
185 
186  //- Return source for equation
187  template<class Type>
188  tmp<fvMatrix<Type>> operator()
189  (
190  const geometricOneField& alpha,
191  const volScalarField& rho,
193  );
194 
195  //- Return source for equation
196  template<class Type>
197  tmp<fvMatrix<Type>> operator()
198  (
199  const geometricOneField& alpha,
200  const geometricOneField& rho,
202  );
203 
204 
205  // Constraints
206 
207  //- Apply constraints to equation
208  template<class Type>
209  void constrain(fvMatrix<Type>& eqn);
210 
211 
212  // Correction
213 
214  //- Apply correction to field
215  template<class Type>
217 
218 
219  // IO
220 
221  //- Read dictionary
222  virtual bool read(const dictionary& dict);
223 
224  //- Write data to Ostream
225  virtual bool writeData(Ostream& os) const;
226 
227  //- Ostream operator
228  friend Ostream& operator<<
229  (
230  Ostream& os,
231  const optionList& options
232  );
233 };
234 
235 
236 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
237 
238 } // End namespace fv
239 } // End namespace Foam
240 
241 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
242 
243 #ifdef NoRepository
244  #include "fvOptionListTemplates.C"
245 #endif
246 
247 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
248 
249 #endif
250 
251 // ************************************************************************* //
dictionary dict
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
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
Generic GeometricField class.
Finite-volume options.
Definition: fvOptions.H:52
bool read(const char *, int32_t &)
Definition: int32IO.C:85
dynamicFvMesh & mesh
A class representing the concept of a GeometricField of 1 used to avoid unnecessary manipulations for...
A class for handling words, derived from string.
Definition: word.H:59
labelList fv(nPoints)
A special matrix type and solver, designed for finite volume solutions of scalar equations. Face addressing is used to make all matrix assembly and solution loops vectorise.
Definition: fvPatchField.H:72
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:70
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:53
Info<< "Predicted p max-min : "<< max(p).value()<< " "<< min(p).value()<< endl;rho==max(psi *p+alphal *rhol0+((alphav *psiv+alphal *psil) - psi) *pSat, rhoMin);# 1 "/home/ubuntu/OpenFOAM-5.0/applications/solvers/multiphase/cavitatingFoam/alphavPsi.H" 1{ alphav=max(min((rho - rholSat)/(rhovSat - rholSat), scalar(1)), scalar(0));alphal=1.0 - alphav;Info<< "max-min alphav: "<< max(alphav).value()<< " "<< min(alphav).value()<< endl;psiModel-> correct()
Definition: pEqn.H:72
const bool writeData(readBool(pdfDictionary.lookup("writeData")))
Ostream & operator<<(Ostream &, const SemiImplicitSource< Type > &)
fvOptions constrain(rhoEqn)
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
Definition: List.H:63
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
List of finite volume options.
Definition: fvOptionList.H:64
A class for managing temporary objects.
Definition: PtrList.H:53
const dimensionedScalar alpha
Fine-structure constant: default SI units: [].
Namespace for OpenFOAM.