cloudSolution.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::cloudSolution
26 
27 Description
28  Stores all relevant solution info for cloud
29 
30 SourceFiles
31  cloudSolutionI.H
32  cloudSolution.C
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef cloudSolution_H
37 #define cloudSolution_H
38 
39 #include "fvMesh.H"
40 #include "Switch.H"
41 #include "Tuple2.H"
42 
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 
45 namespace Foam
46 {
47 
48 /*---------------------------------------------------------------------------*\
49  Class cloudSolution Declaration
50 \*---------------------------------------------------------------------------*/
51 
52 class cloudSolution
53 {
54  // Private Data
55 
56  //- Reference to the mesh
57  const fvMesh& mesh_;
58 
59  //- Dictionary used during construction
60  dictionary dict_;
61 
62  //- Cloud active flag
63  const Switch active_;
64 
65  //- Transient flag
66  Switch transient_;
67 
68  //- Calculation frequency - carrier steps per cloud step
69  // NOTE: Steady operation only
70  label calcFrequency_;
71 
72  //- Maximum particle Courant number
73  // Max fraction of current cell that can be traversed in a single
74  // step
75  scalar maxCo_;
76 
77  //- Current cloud iteration
78  label iter_;
79 
80  //- Particle track time
81  scalar trackTime_;
82 
83 
84  // Run-time options
85 
86  //- Flag to indicate whether parcels are coupled to the carrier
87  // phase, i.e. whether or not to generate source terms for
88  // carrier phase
89  Switch coupled_;
90 
91  //- Flag to correct cell values with latest transfer information
92  // during the lagrangian timestep
93  Switch cellValueSourceCorrection_;
94 
95  //- Maximum particle track time [s]
96  scalar maxTrackTime_;
97 
98  //- Flag to indicate whether coupling source terms should be
99  // reset on start-up/first read
100  Switch resetSourcesOnStartup_;
101 
102  //- List schemes, e.g. U semiImplicit 1
104 
105 
106  // Private Member Functions
107 
108  //- Disallow default bitwise assignment
109  void operator=(const cloudSolution&);
110 
111 
112 public:
113 
114  // Constructors
115 
116  //- Construct null from mesh reference
117  cloudSolution(const fvMesh& mesh);
118 
119  //- Construct from mesh and dictionary
120  cloudSolution(const fvMesh& mesh, const dictionary& dict);
121 
122  //- Construct copy
123  cloudSolution(const cloudSolution& cs);
124 
125 
126  //- Destructor
127  virtual ~cloudSolution();
128 
129 
130  // Member functions
131 
132  //- Read properties from dictionary
133  void read();
134 
135 
136  // Access
137 
138  //- Return relaxation coefficient for field
139  scalar relaxCoeff(const word& fieldName) const;
140 
141  //- Return semi-implicit flag coefficient for field
142  bool semiImplicit(const word& fieldName) const;
143 
144  //- Return reference to the mesh
145  inline const fvMesh& mesh() const;
146 
147  //- Return const access to the dictionary
148  inline const dictionary& dict() const;
149 
150  //- Return the active flag
151  inline const Switch active() const;
152 
153  //- Return const access to the transient flag
154  inline const Switch transient() const;
155 
156  //- Return const access to the steady flag
157  inline const Switch steadyState() const;
158 
159  //- Return const access to the calculation frequency
160  inline label calcFrequency() const;
161 
162  //- Return const access to the max particle Courant number
163  inline scalar maxCo() const;
164 
165  //- Return const access to the current cloud iteration
166  inline label iter() const;
167 
168  //- Increment and return iter counter
169  inline label nextIter();
170 
171  //- Return the particle track time
172  inline scalar trackTime() const;
173 
174  //- Return const access to the coupled flag
175  inline const Switch coupled() const;
176 
177  //- Return non-const access to the coupled flag
178  inline Switch& coupled();
179 
180  //- Return const access to the cell value correction flag
181  inline const Switch cellValueSourceCorrection() const;
182 
183  //- Return const access to the particle track time
184  inline scalar maxTrackTime() const;
185 
186  //- Return const access to the reset sources flag
187  inline const Switch resetSourcesOnStartup() const;
188 
189  //- Source terms dictionary
190  inline const dictionary& sourceTermDict() const;
191 
192  //- Interpolation schemes dictionary
193  inline const dictionary& interpolationSchemes() const;
194 
195  //- Integration schemes dictionary
196  inline const dictionary& integrationSchemes() const;
197 
198 
199  // Helper functions
200 
201  //- Returns true if performing a cloud iteration this calc step
202  bool solveThisStep() const;
203 
204  //- Returns true if possible to evolve the cloud and sets timestep
205  // parameters
206  bool canEvolve();
207 
208  //- Returns true if writing this step
209  bool output() const;
210 };
211 
212 
213 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
214 
215 } // End namespace Foam
216 
217 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
218 
219 #include "cloudSolutionI.H"
220 
221 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
222 
223 #endif
224 
225 // ************************************************************************* //
virtual ~cloudSolution()
Destructor.
label iter() const
Return const access to the current cloud iteration.
cloudSolution(const fvMesh &mesh)
Construct null from mesh reference.
Definition: cloudSolution.C:80
const Switch cellValueSourceCorrection() const
Return const access to the cell value correction flag.
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
label calcFrequency() const
Return const access to the calculation frequency.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
scalar relaxCoeff(const word &fieldName) const
Return relaxation coefficient for field.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: HashTable.H:60
const fvMesh & mesh() const
Return reference to the mesh.
const dictionary & interpolationSchemes() const
Interpolation schemes dictionary.
A simple wrapper around bool so that it can be read as a word: true/false, on/off, yes/no, y/n, t/f, or none.
Definition: Switch.H:60
scalar maxCo() const
Return const access to the max particle Courant number.
bool semiImplicit(const word &fieldName) const
Return semi-implicit flag coefficient for field.
A class for handling words, derived from string.
Definition: word.H:59
scalar trackTime() const
Return the particle track time.
bool solveThisStep() const
Returns true if performing a cloud iteration this calc step.
scalar maxTrackTime() const
Return const access to the particle track time.
const Switch active() const
Return the active flag.
const Switch coupled() const
Return const access to the coupled flag.
const dictionary & dict() const
Return const access to the dictionary.
Stores all relevant solution info for cloud.
Definition: cloudSolution.H:51
const Switch steadyState() const
Return const access to the steady flag.
label nextIter()
Increment and return iter counter.
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
const dictionary & integrationSchemes() const
Integration schemes dictionary.
const dictionary & sourceTermDict() const
Source terms dictionary.
void read()
Read properties from dictionary.
bool output() const
Returns true if writing this step.
const Switch resetSourcesOnStartup() const
Return const access to the reset sources flag.
Namespace for OpenFOAM.
bool canEvolve()
Returns true if possible to evolve the cloud and sets timestep.