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