OpenMPCD
AnalyticQuantitiesGaussianDumbbell.cpp
2 
3 #include <boost/math/constants/constants.hpp>
4 #include <cmath>
5 #include <gsl/gsl_poly.h>
6 #include <stdexcept>
7 
8 using namespace OpenMPCD;
9 
10 static const FP pi = boost::math::constants::pi<FP>();
11 
12 FP AnalyticQuantitiesGaussianDumbbell::lagrangianMultiplier(const FP rootMeanSquareBondLength, const FP shearRate,
13  const FP zeroShearRelaxationTime)
14 {
15  const FP lambda_0 = zeroShearLagrangianMultiplier(rootMeanSquareBondLength);
17 
18  return lambda_0 * mu;
19 }
20 
21 FP AnalyticQuantitiesGaussianDumbbell::zeroShearRelaxationTime(const FP rootMeanSquareBondLength, const FP mpcSelfDiffusionCoefficient,
22  const FP mpcHydrodynamicRadius)
23 {
24  const FP l = rootMeanSquareBondLength;
25  const FP D = mpcSelfDiffusionCoefficient;
26  const FP R_H = mpcHydrodynamicRadius;
27 
28  const FP denominator1 = 6*D;
29  const FP denominator2 = 1 - R_H / l * sqrt(6 / pi);
30 
31  return l*l / (denominator1 * denominator2);
32 }
33 
35 {
36  if(weissenbergNumber==0)
37  return 1; //if weissenbergNumber is 0, this means that the shear rate is 0, in which case we do not want the ratio 0, but 1.
38 
39  double x, y, z;
40 
41  const double c = - weissenbergNumber * weissenbergNumber / 6.0;
42 
43  const int rootCount = gsl_poly_solve_cubic(-1, 0, c, &x, &y, &z);
44 
45  if(rootCount!=1)
46  throw std::runtime_error("Unexpected number of roots in AnalyticQuantitiesGaussianDumbbell::lagrangianMultiplierRatio");
47 
48  return x;
49 }
OpenMPCD::AnalyticQuantitiesGaussianDumbbell::lagrangianMultiplierRatio
static FP lagrangianMultiplierRatio(const FP weissenbergNumber)
Returns the ratio of the Lagrangian multipliers with and without shear flow.
Definition: AnalyticQuantitiesGaussianDumbbell.cpp:34
OpenMPCD::AnalyticQuantitiesGaussianDumbbell::zeroShearLagrangianMultiplier
static FP zeroShearLagrangianMultiplier(const FP rootMeanSquareBondLength)
Returns the zero-shear Lagrangian multiplier .
Definition: AnalyticQuantitiesGaussianDumbbell.hpp:31
OpenMPCD::Utility::MathematicalConstants::pi
OPENMPCD_CUDA_HOST_AND_DEVICE T pi()
Returns the value of .
Definition: MathematicalConstants.hpp:29
OpenMPCD::AnalyticQuantitiesGaussianDumbbell::zeroShearRelaxationTime
static FP zeroShearRelaxationTime(const FP rootMeanSquareBondLength, const FP mpcSelfDiffusionCoefficient, const FP mpcHydrodynamicRadius)
Returns the zero-shear relaxation time of the dumbbell.
Definition: AnalyticQuantitiesGaussianDumbbell.cpp:21
OpenMPCD::FP
double FP
Default floating point type.
Definition: Types.hpp:13
AnalyticQuantitiesGaussianDumbbell.hpp
OpenMPCD::Utility::MathematicalFunctions::sqrt
OPENMPCD_CUDA_HOST_AND_DEVICE T sqrt(const T x)
Returns the sqaure root of the argument.
OpenMPCD::AnalyticQuantitiesGaussianDumbbell::weissenbergNumber
static FP weissenbergNumber(const FP shearRate, const FP zeroShearRelaxationTime)
Returns the Weissenberg number .
Definition: AnalyticQuantitiesGaussianDumbbell.hpp:60
OpenMPCD::AnalyticQuantitiesGaussianDumbbell::lagrangianMultiplier
static FP lagrangianMultiplier(const FP rootMeanSquareBondLength, const FP shearRate, const FP zeroShearRelaxationTime)
Returns the Lagrangian multiplier .
Definition: AnalyticQuantitiesGaussianDumbbell.cpp:12