OpenMPCD
AnalyticQuantities.cpp
2 
3 #include <boost/math/constants/constants.hpp>
4 #include <cmath>
5 
6 using namespace OpenMPCD;
7 
8 static const FP pi = boost::math::constants::pi<FP>();
9 
10 FP AnalyticQuantities::meanFreePath(const FP kT, const FP m, const FP timestep)
11 {
12  return timestep*sqrt(kT/m);
13 }
14 
16  const FP kT, const FP m, const FP meanParticleCountPerCell, const FP srdAngle, const FP timestep)
17 {
18  const FP M = meanParticleCountPerCell;
19 
20  const FP factor1 = kT*timestep/(2*m);
21  const FP denominator1 = M - 1 + exp(-M);
22  const FP denominator2 = 2 - cos(srdAngle) - cos(2*srdAngle);
23  const FP factor2 = 5*M / (denominator1 * denominator2) - 1;
24 
25  return factor1 * factor2;
26 }
27 
29  const FP kT, const FP m, const FP linearCellSize, const FP meanParticleCountPerCell,
30  const FP srdAngle, const FP timestep)
31 {
32  const FP cellVolume = pow(linearCellSize, 3);
33  const FP particleDensity = meanParticleCountPerCell / cellVolume;
34  const FP massDensity = particleDensity * m;
35 
37  kT, m, meanParticleCountPerCell, srdAngle, timestep);
38 }
39 
41  const FP linearCellSize, const FP meanParticleCountPerCell, const FP srdAngle, const FP timestep)
42 {
43  const FP M = meanParticleCountPerCell;
44 
45  const FP factor1 = linearCellSize * linearCellSize / (6*3*timestep);
46  const FP factor2 = (M - 1 + exp(-M)) / M;
47  const FP factor3 = 1 - cos(srdAngle);
48 
49  return factor1 * factor2 * factor3;
50 }
51 
53  const FP m, const FP linearCellSize, const FP meanParticleCountPerCell, const FP srdAngle,
54  const FP timestep)
55 {
56  const FP cellVolume = pow(linearCellSize, 3);
57  const FP particleDensity = meanParticleCountPerCell / cellVolume;
58  const FP massDensity = particleDensity * m;
59 
61  linearCellSize, meanParticleCountPerCell, srdAngle, timestep);
62 }
63 
65  const FP kT, const FP m, const FP linearCellSize, const FP meanParticleCountPerCell,
66  const FP srdAngle, const FP timestep)
67 {
69  kT, m, meanParticleCountPerCell, srdAngle, timestep);
71  linearCellSize, meanParticleCountPerCell, srdAngle, timestep);
72 
73  return nu_kin + nu_col;
74 }
75 
77  const FP kT, const FP m, const FP linearCellSize, const FP meanParticleCountPerCell,
78  const FP srdAngle, const FP timestep)
79 {
81  kT, m, linearCellSize, meanParticleCountPerCell, srdAngle, timestep);
83  m, linearCellSize, meanParticleCountPerCell, srdAngle, timestep);
84 
85  return mu_kin + mu_col;
86 }
87 
88 FP AnalyticQuantities::approximateSelfDiffusionCoefficient(const unsigned int dimensions, const FP kT, const FP m,
89  const FP meanParticleCountPerCell, const FP srdAngle, const FP timestep)
90 {
91  const FP M = meanParticleCountPerCell;
92 
93  const FP factor1 = kT * timestep / (2.0 * m);
94  const FP term2 = dimensions * M / ( (1 - cos(srdAngle)) * (M - 1 + exp(-M)));
95 
96  return factor1 * (term2 - 1);
97 }
98 
99 FP AnalyticQuantities::hydrodynamicRadius(const FP kT, const FP dynamicStressViscosity,
100  const FP selfDiffusionCoefficient)
101 {
102  return kT/(6 * pi * dynamicStressViscosity * selfDiffusionCoefficient);
103 }
AnalyticQuantities.hpp
OpenMPCD::AnalyticQuantities::collisionalContributionsToSRDKinematicShearViscosity
static FP collisionalContributionsToSRDKinematicShearViscosity(const FP linearCellSize, const FP meanParticleCountPerCell, const FP srdAngle, const FP timestep)
Returns the collisional contributions to the kinematic shear viscosity in SRD.
Definition: AnalyticQuantities.cpp:40
OpenMPCD::AnalyticQuantities::collisionalContributionsToSRDDynamicShearViscosity
static FP collisionalContributionsToSRDDynamicShearViscosity(const FP m, const FP linearCellSize, const FP meanParticleCountPerCell, const FP srdAngle, const FP timestep)
Returns the collisional contributions to the dynamic shear viscosity in SRD.
Definition: AnalyticQuantities.cpp:52
OpenMPCD::Utility::MathematicalFunctions::cos
OPENMPCD_CUDA_HOST_AND_DEVICE T cos(const T x)
Returns the cosine of the argument.
OpenMPCD::AnalyticQuantities::SRDKinematicShearViscosity
static FP SRDKinematicShearViscosity(const FP kT, const FP m, const FP linearCellSize, const FP meanParticleCountPerCell, const FP srdAngle, const FP timestep)
Returns the kinematic shear viscosity in SRD.
Definition: AnalyticQuantities.cpp:64
OpenMPCD::CUDA::DeviceCode::pow
OPENMPCD_CUDA_HOST_AND_DEVICE boost::enable_if< boost::is_integral< B >, double >::type pow(const B base, const double exponent)
The power function.
Definition: Utilities.hpp:50
OpenMPCD::AnalyticQuantities::hydrodynamicRadius
static FP hydrodynamicRadius(const FP kT, const FP dynamicStressViscosity, const FP selfDiffusionCoefficient)
Returns the hydrodynamic radius (Stokes-Einstein radius) of a spherical particle.
Definition: AnalyticQuantities.cpp:99
OpenMPCD::Utility::MathematicalConstants::pi
OPENMPCD_CUDA_HOST_AND_DEVICE T pi()
Returns the value of .
Definition: MathematicalConstants.hpp:29
OpenMPCD::AnalyticQuantities::kineticContributionsToSRDKinematicShearViscosity
static FP kineticContributionsToSRDKinematicShearViscosity(const FP kT, const FP m, const FP meanParticleCountPerCell, const FP srdAngle, const FP timestep)
Returns the kinetic contributions to the kinematic shear viscosity in SRD.
Definition: AnalyticQuantities.cpp:15
OpenMPCD::FP
double FP
Default floating point type.
Definition: Types.hpp:13
OpenMPCD::AnalyticQuantities::approximateSelfDiffusionCoefficient
static FP approximateSelfDiffusionCoefficient(const unsigned int dimensions, const FP kT, const FP m, const FP meanParticleCountPerCell, const FP srdAngle, const FP timestep)
Returns an approximation for the self-diffusion coefficient $D$.
Definition: AnalyticQuantities.cpp:88
OpenMPCD::AnalyticQuantities::SRDDynamicShearViscosity
static FP SRDDynamicShearViscosity(const FP kT, const FP m, const FP linearCellSize, const FP meanParticleCountPerCell, const FP srdAngle, const FP timestep)
Returns the dynamic shear viscosity in SRD.
Definition: AnalyticQuantities.cpp:76
OpenMPCD::Utility::MathematicalFunctions::sqrt
OPENMPCD_CUDA_HOST_AND_DEVICE T sqrt(const T x)
Returns the sqaure root of the argument.
OpenMPCD::AnalyticQuantities::meanFreePath
static FP meanFreePath(const FP kT, const FP m, const FP timestep)
Returns the analytical value for the mean free path for a point particle.
Definition: AnalyticQuantities.cpp:10
OpenMPCD::AnalyticQuantities::kineticContributionsToSRDDynamicShearViscosity
static FP kineticContributionsToSRDDynamicShearViscosity(const FP kT, const FP m, const FP linearCellSize, const FP meanParticleCountPerCell, const FP srdAngle, const FP timestep)
Returns the kinetic contributions to the dynamic shear viscosity in SRD.
Definition: AnalyticQuantities.cpp:28