6 |
|
* redistribute this software in source and binary code form, provided |
7 |
|
* that the following conditions are met: |
8 |
|
* |
9 |
< |
* 1. Acknowledgement of the program authors must be made in any |
10 |
< |
* publication of scientific results based in part on use of the |
11 |
< |
* program. An acceptable form of acknowledgement is citation of |
12 |
< |
* the article in which the program was described (Matthew |
13 |
< |
* A. Meineke, Charles F. Vardeman II, Teng Lin, Christopher |
14 |
< |
* J. Fennell and J. Daniel Gezelter, "OOPSE: An Object-Oriented |
15 |
< |
* Parallel Simulation Engine for Molecular Dynamics," |
16 |
< |
* J. Comput. Chem. 26, pp. 252-271 (2005)) |
17 |
< |
* |
18 |
< |
* 2. Redistributions of source code must retain the above copyright |
9 |
> |
* 1. Redistributions of source code must retain the above copyright |
10 |
|
* notice, this list of conditions and the following disclaimer. |
11 |
|
* |
12 |
< |
* 3. Redistributions in binary form must reproduce the above copyright |
12 |
> |
* 2. Redistributions in binary form must reproduce the above copyright |
13 |
|
* notice, this list of conditions and the following disclaimer in the |
14 |
|
* documentation and/or other materials provided with the |
15 |
|
* distribution. |
28 |
|
* arising out of the use of or inability to use software, even if the |
29 |
|
* University of Notre Dame has been advised of the possibility of |
30 |
|
* such damages. |
31 |
+ |
* |
32 |
+ |
* SUPPORT OPEN SCIENCE! If you use OpenMD or its source code in your |
33 |
+ |
* research, please cite the appropriate papers when you publish your |
34 |
+ |
* work. Good starting points are: |
35 |
+ |
* |
36 |
+ |
* [1] Meineke, et al., J. Comp. Chem. 26, 252-271 (2005). |
37 |
+ |
* [2] Fennell & Gezelter, J. Chem. Phys. 124, 234104 (2006). |
38 |
+ |
* [3] Sun, Lin & Gezelter, J. Chem. Phys. 128, 234107 (2008). |
39 |
+ |
* [4] Kuang & Gezelter, J. Chem. Phys. 133, 164101 (2010). |
40 |
+ |
* [5] Vardeman, Stocker & Gezelter, J. Chem. Theory Comput. 7, 834 (2011). |
41 |
|
*/ |
42 |
|
|
43 |
|
#include "applications/hydrodynamics/ApproximationModel.hpp" |
44 |
|
#include "math/LU.hpp" |
45 |
|
#include "math/DynamicRectMatrix.hpp" |
46 |
|
#include "math/SquareMatrix3.hpp" |
47 |
< |
#include "utils/OOPSEConstant.hpp" |
47 |
> |
#include "utils/PhysicalConstants.hpp" |
48 |
|
#include "hydrodynamics/Sphere.hpp" |
49 |
|
#include "hydrodynamics/Ellipsoid.hpp" |
50 |
|
#include "applications/hydrodynamics/CompositeShape.hpp" |
51 |
|
#include "math/LU.hpp" |
52 |
|
#include "utils/simError.h" |
53 |
< |
namespace oopse { |
53 |
> |
namespace OpenMD { |
54 |
|
/** |
55 |
|
* Reference: |
56 |
|
* Beatriz Carrasco and Jose Gracia de la Torre, Hydrodynamic Properties of Rigid Particles: |
72 |
|
|
73 |
|
bool ApproximationModel::calcHydroProps(Shape* shape, RealType viscosity, RealType temperature) { |
74 |
|
|
74 |
– |
bool ret = true; |
75 |
|
HydroProp* cr = new HydroProp(); |
76 |
|
HydroProp* cd = new HydroProp(); |
77 |
|
calcHydroPropsAtCR(beads_, viscosity, temperature, cr); |
83 |
|
|
84 |
|
bool ApproximationModel::calcHydroPropsAtCR(std::vector<BeadParam>& beads, RealType viscosity, RealType temperature, HydroProp* cr) { |
85 |
|
|
86 |
< |
int nbeads = beads.size(); |
86 |
> |
unsigned int nbeads = beads.size(); |
87 |
|
DynamicRectMatrix<RealType> B(3*nbeads, 3*nbeads); |
88 |
|
DynamicRectMatrix<RealType> C(3*nbeads, 3*nbeads); |
89 |
|
Mat3x3d I; |
120 |
|
|
121 |
|
//prepare U Matrix relative to arbitrary origin O(0.0, 0.0, 0.0) |
122 |
|
std::vector<Mat3x3d> U; |
123 |
< |
for (int i = 0; i < nbeads; ++i) { |
123 |
> |
for (unsigned int i = 0; i < nbeads; ++i) { |
124 |
|
Mat3x3d currU; |
125 |
|
currU.setupSkewMat(beads[i].pos); |
126 |
|
U.push_back(currU); |
151 |
|
} |
152 |
|
|
153 |
|
// add the volume correction |
154 |
< |
Xiorr += (6.0 * viscosity * volume) * I; |
154 |
> |
Xiorr += (RealType(6.0) * viscosity * volume) * I; |
155 |
|
|
156 |
< |
Xiott *= OOPSEConstant::viscoConvert; |
157 |
< |
Xiotr *= OOPSEConstant::viscoConvert; |
158 |
< |
Xiorr *= OOPSEConstant::viscoConvert; |
156 |
> |
Xiott *= PhysicalConstants::viscoConvert; |
157 |
> |
Xiotr *= PhysicalConstants::viscoConvert; |
158 |
> |
Xiorr *= PhysicalConstants::viscoConvert; |
159 |
|
|
160 |
|
Mat3x3d tmp; |
161 |
|
Mat3x3d tmpInv; |
203 |
|
Dr6x6.getSubMatrix(0, 3, Drrt); |
204 |
|
Dr6x6.getSubMatrix(3, 0, Drtr); |
205 |
|
Dr6x6.getSubMatrix(3, 3, Drrr); |
206 |
< |
RealType kt = OOPSEConstant::kb * temperature ; // in kcal mol^-1 |
206 |
> |
RealType kt = PhysicalConstants::kb * temperature ; // in kcal mol^-1 |
207 |
|
Drtt *= kt; |
208 |
|
Drrt *= kt; |
209 |
|
Drtr *= kt; |
210 |
|
Drrr *= kt; |
211 |
< |
//Xirtt *= OOPSEConstant::kb * temperature; |
212 |
< |
//Xirtr *= OOPSEConstant::kb * temperature; |
213 |
< |
//Xirrr *= OOPSEConstant::kb * temperature; |
211 |
> |
//Xirtt *= PhysicalConstants::kb * temperature; |
212 |
> |
//Xirtr *= PhysicalConstants::kb * temperature; |
213 |
> |
//Xirrr *= PhysicalConstants::kb * temperature; |
214 |
|
|
215 |
|
Mat6x6d Xi, D; |
216 |
|
|
256 |
|
|
257 |
|
bool ApproximationModel::calcHydroPropsAtCD(std::vector<BeadParam>& beads, RealType viscosity, RealType temperature, HydroProp* cd) { |
258 |
|
|
259 |
< |
int nbeads = beads.size(); |
259 |
> |
unsigned int nbeads = beads.size(); |
260 |
|
DynamicRectMatrix<RealType> B(3*nbeads, 3*nbeads); |
261 |
|
DynamicRectMatrix<RealType> C(3*nbeads, 3*nbeads); |
262 |
|
Mat3x3d I; |
293 |
|
|
294 |
|
//prepare U Matrix relative to arbitrary origin O(0.0, 0.0, 0.0) |
295 |
|
std::vector<Mat3x3d> U; |
296 |
< |
for (int i = 0; i < nbeads; ++i) { |
296 |
> |
for (unsigned int i = 0; i < nbeads; ++i) { |
297 |
|
Mat3x3d currU; |
298 |
|
currU.setupSkewMat(beads[i].pos); |
299 |
|
U.push_back(currU); |
323 |
|
} |
324 |
|
} |
325 |
|
// add the volume correction here: |
326 |
< |
Xirr += (6.0 * viscosity * volume) * I; |
326 |
> |
Xirr += (RealType(6.0) * viscosity * volume) * I; |
327 |
|
|
328 |
< |
Xitt *= OOPSEConstant::viscoConvert; |
329 |
< |
Xitr *= OOPSEConstant::viscoConvert; |
330 |
< |
Xirr *= OOPSEConstant::viscoConvert; |
328 |
> |
Xitt *= PhysicalConstants::viscoConvert; |
329 |
> |
Xitr *= PhysicalConstants::viscoConvert; |
330 |
> |
Xirr *= PhysicalConstants::viscoConvert; |
331 |
|
|
332 |
< |
RealType kt = OOPSEConstant::kb * temperature; // in kcal mol^-1 |
332 |
> |
RealType kt = PhysicalConstants::kb * temperature; // in kcal mol^-1 |
333 |
|
|
334 |
|
Mat3x3d Dott; //translational diffusion tensor at arbitrary origin O |
335 |
|
Mat3x3d Dorr; //rotational diffusion tensor at arbitrary origin O |
402 |
|
|
403 |
|
|
404 |
|
//Xidtt in units of kcal*fs*mol^-1*Ang^-2 |
405 |
< |
//Xid /= OOPSEConstant::energyConvert; |
406 |
< |
Xid *= OOPSEConstant::kb * temperature; |
405 |
> |
//Xid /= PhysicalConstants::energyConvert; |
406 |
> |
Xid *= PhysicalConstants::kb * temperature; |
407 |
|
|
408 |
|
Mat6x6d Xi, D; |
409 |
|
|