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-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::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 "fvPatchField.H"
42 
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 
45 namespace Foam
46 {
47 
48 // Forward declaration of friend functions and operators
49 
50 namespace fv
51 {
52  class optionList;
53 }
54 
55 Ostream& operator<<(Ostream& os, const fv::optionList& options);
56 
57 namespace fv
58 {
59 
60 /*---------------------------------------------------------------------------*\
61  Class optionList Declaration
62 \*---------------------------------------------------------------------------*/
63 
64 class optionList
65 :
66  public PtrList<option>
67 {
68 protected:
69 
70  // Protected data
71 
72  //- Reference to the mesh database
73  const fvMesh& mesh_;
74 
75  //- Time index to check that all defined sources have been applied
76  label checkTimeIndex_;
77 
78 
79  // Protected Member Functions
80 
81  //- Return the "options" sub-dictionary if present otherwise return dict
82  const dictionary& optionsDict(const dictionary& dict) const;
83 
84  //- Read options dictionary
85  bool readOptions(const dictionary& dict);
86 
87  //- Check that all sources have been applied
88  void checkApplied() const;
89 
90  //- Disallow default bitwise copy construct
91  optionList(const optionList&);
92 
93  //- Disallow default bitwise assignment
94  void operator=(const optionList&);
95 
96 
97 public:
98 
99  //- Runtime type information
100  TypeName("optionList");
101 
102 
103  // Constructors
104 
105  //- Construct null
106  optionList(const fvMesh& mesh);
107 
108  //- Construct from mesh and dictionary
109  optionList(const fvMesh& mesh, const dictionary& dict);
110 
111 
112  //- Destructor
113  virtual ~optionList()
114  {}
115 
116 
117  // Member Functions
118 
119  //- Reset the source list
120  void reset(const dictionary& dict);
121 
122 
123  // Sources
124 
125  //- Return source for equation
126  template<class Type>
127  tmp<fvMatrix<Type> > operator()
128  (
130  );
131 
132  //- Return source for equation with specified name
133  template<class Type>
134  tmp<fvMatrix<Type> > operator()
135  (
137  const word& fieldName
138  );
139 
140  //- Return source for equation
141  template<class Type>
142  tmp<fvMatrix<Type> > operator()
143  (
144  const volScalarField& rho,
146  );
147 
148  //- Return source for equation with specified name
149  template<class Type>
150  tmp<fvMatrix<Type> > operator()
151  (
152  const volScalarField& rho,
154  const word& fieldName
155  );
156 
157  //- Return source for equation
158  template<class Type>
159  tmp<fvMatrix<Type> > operator()
160  (
161  const volScalarField& alpha,
162  const volScalarField& rho,
164  );
165 
166  //- Return source for equation with specified name
167  template<class Type>
168  tmp<fvMatrix<Type> > operator()
169  (
170  const volScalarField& alpha,
171  const volScalarField& rho,
173  const word& fieldName
174  );
175 
176 
177  // Constraints
178 
179  //- Apply constraints to equation
180  template<class Type>
181  void constrain(fvMatrix<Type>& eqn);
182 
183 
184  // Correction
185 
186  //- Apply correction to field
187  template<class Type>
189 
190 
191  // IO
192 
193  //- Read dictionary
194  virtual bool read(const dictionary& dict);
195 
196  //- Write data to Ostream
197  virtual bool writeData(Ostream& os) const;
198 
199  //- Ostream operator
200  friend Ostream& operator<<
201  (
202  Ostream& os,
203  const optionList& options
204  );
205 };
206 
207 
208 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
209 
210 } // End namespace fv
211 } // End namespace Foam
212 
213 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
214 
215 #ifdef NoRepository
216  #include "fvOptionListTemplates.C"
217 #endif
218 
219 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
220 
221 #endif
222 
223 // ************************************************************************* //
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:70
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
Ostream & operator<<(Ostream &, const SemiImplicitSource< Type > &)
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
Definition: List.H:61
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/dm2/henry/OpenFOAM/OpenFOAM-3.0.x/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:74
A class for handling words, derived from string.
Definition: word.H:59
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 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:68
dynamicFvMesh & mesh
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
Namespace for OpenFOAM.
dictionary dict
const dimensionedScalar alpha
Fine-structure constant: default SI units: [].
const bool writeData(readBool(pdfDictionary.lookup("writeData")))
Generic GeometricField class.
List of finite volume options.
Definition: fvOptionList.H:63
labelList fv(nPoints)
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:53
bool read(const char *, int32_t &)
Definition: int32IO.C:87
fvOptions constrain(rhoEqn)
A class for managing temporary objects.
Definition: PtrList.H:118