BUG: UListIO: byteSize overflowing on really big faceLists
[OpenFOAM-2.0.x.git] / src / lagrangian / intermediate / clouds / Templates / KinematicCloud / cloudSolution / cloudSolution.H
blobe155abc375b3250e3e7ee5620eb6d363df559dcf
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 2011 OpenFOAM Foundation
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
9     This file is part of OpenFOAM.
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.
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.
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/>.
24 Class
25     Foam::cloudSolution
27 Description
28     Stores all relevant solution info for cloud
30 SourceFiles
31     cloudSolutionI.H
32     cloudSolution.C
34 \*---------------------------------------------------------------------------*/
36 #ifndef cloudSolution_H
37 #define cloudSolution_H
39 #include "fvMesh.H"
40 #include "Switch.H"
41 #include "Tuple2.H"
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 namespace Foam
48 /*---------------------------------------------------------------------------*\
49                        Class cloudSolution Declaration
50 \*---------------------------------------------------------------------------*/
52 class cloudSolution
54     // Private Data
56         //- Reference to the mesh
57         const fvMesh& mesh_;
59         //- Dictionary used during construction
60         dictionary dict_;
62         //- Cloud active flag
63         const Switch active_;
65         //- Transient flag
66         Switch transient_;
68         //- Calculation frequency - carrier steps per cloud step
69         //  NOTE: Steady operation only
70         label calcFrequency_;
72         //- Maximum particle Courant number
73         //  Max fraction of current cell that can be traversed in a single
74         //  step
75         scalar maxCo_;
77         //- Current cloud iteration
78         label iter_;
80         //- Particle track time
81         scalar trackTime_;
84         // Run-time options
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_;
91             //- Flag to correct cell values with latest transfer information
92             //  during the lagrangian timestep
93             Switch cellValueSourceCorrection_;
95             //- Maximum particle track time [s]
96             scalar maxTrackTime_;
98             //- Flag to indicate whether coupling source terms should be
99             //  reset on start-up/first read
100             Switch resetSourcesOnStartup_;
102             //- List schemes, e.g. U semiImplicit 1
103             List<Tuple2<word, Tuple2<bool, scalar> > > schemes_;
106     // Private Member Functions
108         //- Disallow default bitwise assignment
109         void operator=(const cloudSolution&);
112 public:
114     // Constructors
116         //- Construct null from mesh reference
117         cloudSolution(const fvMesh& mesh);
119         //- Construct from mesh and dictionary
120         cloudSolution(const fvMesh& mesh, const dictionary& dict);
122         //- Construct copy
123         cloudSolution(const cloudSolution& cs);
126     //- Destructor
127     virtual ~cloudSolution();
130     // Member functions
132         //- Read properties from dictionary
133         void read();
136         // Access
138             //- Return relaxation coefficient for field
139             scalar relaxCoeff(const word& fieldName) const;
141             //- Return semi-implicit flag coefficient for field
142             bool semiImplicit(const word& fieldName) const;
144             //- Return reference to the mesh
145             inline const fvMesh& mesh() const;
147             //- Return const access to the dictionary
148             inline const dictionary& dict() const;
150             //- Return the active flag
151             inline const Switch active() const;
153             //- Return const access to the transient flag
154             inline const Switch transient() const;
156             //- Return const access to the steady flag
157             inline const Switch steadyState() const;
159             //- Return const access to the calculation frequency
160             inline label calcFrequency() const;
162             //- Return const access to the max particle Courant number
163             inline scalar maxCo() const;
165             //- Return const access to the current cloud iteration
166             inline label iter() const;
168             //- Increment and return iter counter
169             inline label nextIter();
171             //- Return the particle track time
172             inline scalar trackTime() const;
174             //- Return const access to the coupled flag
175             inline const Switch coupled() const;
177             //- Return non-const access to the coupled flag
178             inline Switch& coupled();
180             //- Return const access to the cell value correction flag
181             inline const Switch cellValueSourceCorrection() const;
183             //- Return const access to the particle track time
184             inline scalar maxTrackTime() const;
186             //- Return const access to the reset sources flag
187             inline const Switch resetSourcesOnStartup() const;
189             //- Source terms dictionary
190             inline const dictionary& sourceTermDict() const;
192             //- Interpolation schemes dictionary
193             inline const dictionary& interpolationSchemes() const;
195             //- Integration schemes dictionary
196             inline const dictionary& integrationSchemes() const;
199     // Helper functions
201         //- Returns true if performing a cloud iteration this calc step
202         bool solveThisStep() const;
204         //- Returns true if possible to evolve the cloud and sets timestep
205         //  parameters
206         bool canEvolve();
208         //- Returns true if writing this step
209         bool output() const;
213 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
215 } // End namespace Foam
217 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
219 #include "cloudSolutionI.H"
221 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
223 #endif
225 // ************************************************************************* //