38 |
|
* University of Notre Dame has been advised of the possibility of |
39 |
|
* such damages. |
40 |
|
*/ |
41 |
< |
#include "applications/hydrodynamics/AnalyticalModel.hpp" |
42 |
< |
#include "applications/hydrodynamics/Spheric.hpp" |
43 |
< |
#include "applications/hydrodynamics/Ellipsoid.hpp" |
44 |
< |
#include "applications/hydrodynamics/CompositeShape.hpp" |
41 |
> |
#include "hydrodynamics/AnalyticalModel.hpp" |
42 |
> |
#include "hydrodynamics/Sphere.hpp" |
43 |
> |
#include "hydrodynamics/Ellipsoid.hpp" |
44 |
> |
#include "hydrodynamics/CompositeShape.hpp" |
45 |
|
#include "math/LU.hpp" |
46 |
|
namespace oopse { |
47 |
< |
bool AnalyticalModel::calcHydroProps(Spheric* spheric, double viscosity, double temperature) { |
48 |
< |
|
49 |
< |
double radius = spheric->getRadius(); |
47 |
> |
|
48 |
> |
bool AnalyticalModel::calcHydroProps(Sphere* sphere, double viscosity, double temperature) { |
49 |
> |
|
50 |
> |
double radius = sphere->getRadius(); |
51 |
|
HydroProps props; |
52 |
|
props.center =V3Zero; |
53 |
|
double Xitt = 6.0 * NumericConstant::PI * viscosity * radius; |
66 |
|
double kt = OOPSEConstant::kB * temperature; |
67 |
|
props.D *= kt; |
68 |
|
props.Xi *= OOPSEConstant::kb * temperature; |
69 |
< |
|
69 |
> |
|
70 |
|
setCR(props); |
71 |
|
setCD(props); |
71 |
– |
|
72 |
– |
return true; |
72 |
|
|
73 |
+ |
return true; |
74 |
|
} |
75 |
|
|
76 |
< |
/** |
77 |
< |
* Reference: |
78 |
< |
* (2) F. Perrin , J. Phys. Radium, [7] 5, 497-511, 1934 |
79 |
< |
* (3) F. Perrin, J. Phys. Radium, [7] 7, 1-11, 1936 |
80 |
< |
*/ |
81 |
< |
bool AnalyticalModel::calcHydroProps(Ellipsoid* ellipsoid, double viscosity, double temperature) { |
82 |
< |
|
76 |
> |
/** |
77 |
> |
* Reference: |
78 |
> |
* (2) F. Perrin , J. Phys. Radium, [7] 5, 497-511, 1934 |
79 |
> |
* (3) F. Perrin, J. Phys. Radium, [7] 7, 1-11, 1936 |
80 |
> |
*/ |
81 |
> |
bool AnalyticalModel::calcHydroProps(Ellipsoid* ellipsoid, double viscosity, double temperature) { |
82 |
> |
|
83 |
|
double rMajor = ellipsoid->getRMajor(); |
84 |
|
double rMinor = ellipsoid->getRMinor(); |
85 |
< |
|
85 |
> |
|
86 |
|
double a = rMinor; |
87 |
|
double b = rMajor; |
88 |
|
double a2 = a * a; |
91 |
|
double p = a /b; |
92 |
|
double S; |
93 |
|
if (p > 1.0) { //prolate |
94 |
< |
S = 2.0/sqrt(a2 - b2) * log((a + sqrt(a2-b2))/b); |
94 |
> |
S = 2.0/sqrt(a2 - b2) * log((a + sqrt(a2-b2))/b); |
95 |
|
} else { //oblate |
96 |
< |
S = 2.0/sqrt(b2 - a2) * atan(sqrt(b2-a2)/a); |
96 |
> |
S = 2.0/sqrt(b2 - a2) * atan(sqrt(b2-a2)/a); |
97 |
|
} |
98 |
< |
|
98 |
> |
|
99 |
|
double P = 1.0/(a2 - b2) * (S - 2.0/a); |
100 |
|
double Q = 0.5/(a2-b2) * (2.0*a/b2 - S); |
101 |
< |
|
101 |
> |
|
102 |
|
double transMinor = 16.0 * NumericConstant::PI * viscosity * (a2 - b2) /((2.0*a2-b2)*S -2.0*a); |
103 |
|
double transMajor = 32.0 * NumericConstant::PI * viscosity * (a2 - b2) /((2.0*a2-3.0*b2)*S +2.0*a); |
104 |
|
double rotMinor = 32.0/3.0 * NumericConstant::PI * viscosity *(a2 - b2) * b2 /(2.0*a -b2*S); |
105 |
|
double rotMajor = 32.0/3.0 * NumericConstant::PI * viscosity *(a2*a2 - b2*b2)/((2.0*a2-b2)*S-2.0*a); |
106 |
|
|
107 |
< |
|
107 |
> |
|
108 |
|
HydroProps props; |
109 |
< |
|
109 |
> |
|
110 |
|
props.Xi(0,0) = transMajor; |
111 |
|
props.Xi(1,1) = transMajor; |
112 |
|
props.Xi(2,2) = transMinor; |
125 |
|
|
126 |
|
setCR(props); |
127 |
|
setCD(props); |
128 |
< |
|
128 |
> |
|
129 |
|
return true; |
130 |
< |
} |
131 |
< |
|
132 |
< |
bool AnalyticalModel::calcHydroProps(CompositeShape* compositexShape, double viscosity, double temperature) { |
130 |
> |
} |
131 |
> |
|
132 |
> |
bool AnalyticalModel::calcHydroProps(CompositeShape* compositeShape, double viscosity, double temperature) { |
133 |
|
return false; |
134 |
+ |
} |
135 |
+ |
|
136 |
+ |
void AnalyticalModel::writeBeads(std::ostream& os) { |
137 |
+ |
os << "1\n"; |
138 |
+ |
os << "Generated by Hydro\n"; |
139 |
+ |
Vector3d pos = sd_->getPos(); |
140 |
+ |
os << sd_->getType() << "\t" << pos[0] << "\t" << pos[1] << "\t" << pos[2] << std::endl; |
141 |
+ |
} |
142 |
|
} |
135 |
– |
|
136 |
– |
|
137 |
– |
|
138 |
– |
} |