ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/OpenMD/trunk/src/applications/hydrodynamics/ApproximationModel.cpp
(Generate patch)

Comparing trunk/src/applications/hydrodynamics/ApproximationModel.cpp (file contents):
Revision 1177 by xsun, Tue Aug 14 17:40:33 2007 UTC vs.
Revision 1390 by gezelter, Wed Nov 25 20:02:06 2009 UTC

# Line 6 | Line 6
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.
# Line 37 | Line 28
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, 24107 (2008).          
39 + * [4]  Vardeman & Gezelter, in progress (2009).                        
40   */
41  
42   #include "applications/hydrodynamics/ApproximationModel.hpp"
43   #include "math/LU.hpp"
44   #include "math/DynamicRectMatrix.hpp"
45   #include "math/SquareMatrix3.hpp"
46 < #include "utils/OOPSEConstant.hpp"
46 > #include "utils/PhysicalConstants.hpp"
47   #include "hydrodynamics/Sphere.hpp"
48   #include "hydrodynamics/Ellipsoid.hpp"
49   #include "applications/hydrodynamics/CompositeShape.hpp"
50   #include "math/LU.hpp"
51   #include "utils/simError.h"
52 < namespace oopse {
52 > namespace OpenMD {
53   /**
54   * Reference:
55   * Beatriz Carrasco and Jose Gracia de la Torre, Hydrodynamic Properties of Rigid Particles:
# Line 145 | Line 145 | namespace oopse {
145          
146          Xiott += Cij;
147          Xiotr += U[i] * Cij;
148 <        //Xiorr += -U[i] * Cij * U[j] + (6 * viscosity * volume) * I;    
148 >        // uncorrected here.  Volume correction is added after we assemble Xiorr
149          Xiorr += -U[i] * Cij * U[j];
150        }
151      }
152 +
153 +    // add the volume correction
154 +    Xiorr += (6.0 * viscosity * volume) * I;    
155      
156 <    const RealType convertConstant = 6.023; //convert poise.angstrom to amu/fs
157 <    Xiott *= convertConstant;
158 <    Xiotr *= convertConstant;
156 <    Xiorr *= convertConstant;
156 >    Xiott *= PhysicalConstants::viscoConvert;
157 >    Xiotr *= PhysicalConstants::viscoConvert;
158 >    Xiorr *= PhysicalConstants::viscoConvert;
159      
158    
159    
160      Mat3x3d tmp;
161      Mat3x3d tmpInv;
162      Vector3d tmpVec;
# Line 203 | Line 203 | namespace oopse {
203      Dr6x6.getSubMatrix(0, 3, Drrt);
204      Dr6x6.getSubMatrix(3, 0, Drtr);
205      Dr6x6.getSubMatrix(3, 3, Drrr);
206 <    RealType kt = OOPSEConstant::kB * temperature ;
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  
# Line 318 | Line 318 | namespace oopse {
318              
319          Xitt += Cij;
320          Xitr += U[i] * Cij;
321 <            //Xirr += -U[i] * Cij * U[j] + (6 * viscosity * volume) * I;            
321 >        // uncorrected here.  Volume correction is added after we assemble Xiorr
322          Xirr += -U[i] * Cij * U[j];
323        }
324      }
325 +    // add the volume correction here:
326 +    Xirr += (6.0 * viscosity * volume) * I;    
327      
328 <    const RealType convertConstant = 6.023; //convert poise.angstrom to amu/fs
329 <    Xitt *= convertConstant;
330 <    Xitr *= convertConstant;
329 <    Xirr *= convertConstant;
328 >    Xitt *= PhysicalConstants::viscoConvert;
329 >    Xitr *= PhysicalConstants::viscoConvert;
330 >    Xirr *= PhysicalConstants::viscoConvert;
331      
332 <    RealType kt = OOPSEConstant::kB * temperature;
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
# Line 401 | Line 402 | namespace oopse {
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  
# Line 422 | Line 423 | namespace oopse {
423      std::cout << "center of diffusion :" << std::endl;
424      std::cout << rod << std::endl;
425      std::cout << "diffusion tensor at center of diffusion " << std::endl;
426 <    std::cout << "translation(A^2/fs) :" << std::endl;
426 >    std::cout << "translation(A^2 / fs) :" << std::endl;
427      std::cout << Ddtt << std::endl;
428 <    std::cout << "translation-rotation(A^3/fs):" << std::endl;
428 >    std::cout << "translation-rotation(A / fs):" << std::endl;
429      std::cout << Ddtr << std::endl;
430 <    std::cout << "rotation(A^4/fs):" << std::endl;
430 >    std::cout << "rotation(fs^-1):" << std::endl;
431      std::cout << Ddrr << std::endl;
432  
433      std::cout << "resistance tensor at center of diffusion " << std::endl;
# Line 442 | Line 443 | namespace oopse {
443      Xid.getSubMatrix(3, 3, Xidrr);
444  
445      std::cout << Xidtt << std::endl;
446 <    std::cout << "rotation-translation (kcal*fs*mol^-1*Ang^-3):" << std::endl;
446 >    std::cout << "rotation-translation (kcal*fs*mol^-1*Ang^-1):" << std::endl;
447      std::cout << Xidrt << std::endl;
448 <    std::cout << "translation-rotation(kcal*fs*mol^-1*Ang^-3):" << std::endl;
448 >    std::cout << "translation-rotation(kcal*fs*mol^-1*Ang^-1):" << std::endl;
449      std::cout << Xidtr << std::endl;
450 <    std::cout << "rotation(kcal*fs*mol^-1*Ang^-4):" << std::endl;
450 >    std::cout << "rotation(kcal*fs*mol^-1):" << std::endl;
451      std::cout << Xidrr << std::endl;
452  
453      return true;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines