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