1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd.
7 -------------------------------------------------------------------------------
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
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/>.
34 \*---------------------------------------------------------------------------*/
36 #ifndef moleculeCloud_H
37 #define moleculeCloud_H
41 #include "IOdictionary.H"
42 #include "potential.H"
43 #include "InteractionLists.H"
44 #include "labelVector.H"
48 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
53 /*---------------------------------------------------------------------------*\
54 Class moleculeCloud Declaration
55 \*---------------------------------------------------------------------------*/
59 public Cloud<molecule>
66 const polyMesh& mesh_;
68 const potential& pot_;
70 List<DynamicList<molecule*> > cellOccupancy_;
72 InteractionLists<molecule> il_;
74 List<molecule::constantProperties> constPropList_;
79 // Private Member Functions
81 void buildConstProps();
83 void setSiteSizesAndPositions();
85 //- Determine which molecules are in which cells
86 void buildCellOccupancy();
88 void calculatePairForce();
90 inline void evaluatePair
96 inline bool evaluatePotentialLimit
102 void calculateTetherForce();
104 void calculateExternalForce();
106 void removeHighEnergyOverlaps();
108 void initialiseMolecules
110 const IOdictionary& mdInitialiseDict
115 const point& position,
122 const vector& bulkVelocity
125 label nSites() const;
127 inline vector equipartitionLinearVelocity
133 inline vector equipartitionAngularMomentum
136 const molecule::constantProperties& cP
139 //- Disallow default bitwise copy construct
140 moleculeCloud(const moleculeCloud&);
142 //- Disallow default bitwise assignment
143 void operator=(const moleculeCloud&);
150 //- Construct given mesh and potential references
153 const polyMesh& mesh,
154 const potential& pot,
155 bool readFields = true
158 //- Construct given mesh, potential and mdInitialiseDict
161 const polyMesh& mesh,
162 const potential& pot,
163 const IOdictionary& mdInitialiseDict,
164 bool readFields = true
170 //- Evolve the molecules (move, calculate forces, control state etc)
173 void calculateForce();
175 void applyConstraintsAndThermostats
177 const scalar targetTemperature,
178 const scalar measuredTemperature
184 inline const polyMesh& mesh() const;
186 inline const potential& pot() const;
188 inline const List<DynamicList<molecule*> >& cellOccupancy() const;
190 inline const InteractionLists<molecule>& il() const;
192 inline const List<molecule::constantProperties> constProps() const;
194 inline const molecule::constantProperties&
195 constProps(label id) const;
197 inline Random& rndGen();
202 //- Write molecule sites in XYZ format
203 void writeXYZ(const fileName& fName) const;
207 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
209 } // End namespace Foam
211 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
213 #include "moleculeCloudI.H"
215 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
219 // ************************************************************************* //