teqp 0.22.0
Loading...
Searching...
No Matches
2center_ljf.hpp
Go to the documentation of this file.
1#pragma once
2
3#include "teqp/types.hpp"
4#include "teqp/exceptions.hpp"
5#include <map>
6
7namespace teqp {
8
9 namespace twocenterljf {
10 // Implementation of the 2-center Lennard-Jones model
11 // 2 model variants are available:
12 // The Model of Mecke et al.:
13 // https://link.springer.com/article/10.1007/BF02575128
14 // and the revised Model of Lisal et al.:
15 // https://link.springer.com/article/10.1023/B:IJOT.0000022332.12319.06
16
17 // Note for dipolar contribution:
18 // The original model was developed by Saager et al. (https://www.sciencedirect.com/science/article/abs/pii/0378381292850195)
19 // these parameters are used here and the functional published by Kriebel and Winkelmann (https://aip.scitation.org/doi/10.1063/1.472764)
20 enum model_types_2CLJF { MECKE = 1, LISAL = 2 };
21
22 const std::map<std::string, model_types_2CLJF> modelmap = { {"2CLJF_Mecke",MECKE},{"2CLJF_Lisal",LISAL} };
23
25 public:
26 // Parameters for Mecke and Lisal model
27 // Density reducing parameters
28 const std::map<model_types_2CLJF, std::valarray<double>> p_alpha = {
29 {MECKE, {1.0, 0.5296092, -0.4531784, 0.4421075}},
30 {LISAL, {1.0, 0.5296092, -0.4531784, 0.4421075}}
31 };
32
33 auto get_alpha_star_parameter(const std::string& model) {
34 return p_alpha.at(modelmap.at(model));
35 };
36
37 const std::map<model_types_2CLJF, std::valarray<double>> p_eta_rho = {
38 {MECKE, {0.5256,3.2088804,-3.1499114,0.43049357}},
39 {LISAL, {0.5256,3.2088804,-3.1499114,0.43049357}}
40 };
41
42 auto get_eta_rho_parameter(const std::string& model) {
43 return p_eta_rho.at(modelmap.at(model));
44 };
45
46 const std::map<model_types_2CLJF, std::valarray<double>> p_rho = {
47 {MECKE, {0.3128,1.11519758,3.48878614,6.10644999}},
48 {LISAL, {0.31258137,1.2240569,3.7974509,6.5490937}}
49 };
50
51 auto get_rho_parameter(const std::string& model) {
52 return p_rho.at(modelmap.at(model));
53 };
54
55 // Temperature reducing parameters
56 const std::map<model_types_2CLJF, std::valarray<double>> p_t = {
57 {MECKE, {34.0122223,17.2324198,0.52922987,12.7653979}},
58 {LISAL, {34.037352,17.733741,0.53237307,12.860239}}
59 };
60
61 auto get_T_parameter(const std::string& model) {
62 return p_t.at(modelmap.at(model));
63 };
64
65 // Attractive parameteres
66 const std::map<model_types_2CLJF, std::valarray<double>> c = {
67 {MECKE, {-0.25359778252E+00,0.94270769752E-02,0.10937076431E-03,-0.45230360227E-05,-0.98945319827E+00,0.77816220730E+01,-0.19338901724E+02,0.16188444167E+02,-0.47837698146E+01,-0.37128104806E-05,0.11481369341E+01,-0.13600256513E+01,-0.34629572236E-05,-0.48388274860E+00,0.92061274747E+00,-0.38763633820E+00,-0.20652959726E+01,0.53102723110E+01,-0.45202666343E+01,0.12858167202E+01,0.31043103969E-03,0.76115392332E-05,-0.15141679018E+01,0.26132719232E+01,-0.88015285297E+00,-0.48730358072E-02,-0.14612399648E-01,-0.19908427778E-03,-0.29960728655E+00,0.25016932001E+00,0.16495699794E-01,0.35210453535E+00,-0.43243419699E+00,-0.31194438133E-01}},
68 {LISAL, {-0.64211055047e-1,0.17682583145e-2,-0.62963373291e0,-0.35320115512e0,0.11339264270e2,-0.33311941616e2,0.37022843830e2,-0.18683743554e2,0.34566448842e1,-0.11216048862e-5,0.69315597535e0,-0.95242644353e0,0.13303429920e-1,-0.17518819492e-4,0.30942693727e-5,0.44671277084e-1,-0.84065404026e0,0.12662354443e1,-0.43706789738e0,0.34751432401e-5,-0.52988956334e-6,0.37399304905e-1,-0.32905342462e0,0.63121341882e-1,-0.20913100716e-2,-0.26852824281e-1,0.70733527178e-1,0.58291227149e-1,-0.76337837062e-1,-0.37502524667e-1,0.19201247728e-2,-0.76922623587e-1,0.12939011597e0,-0.37539710780e-1}}
69 };
70
71 auto get_c_parameter(const std::string& model) {
72 return c.at(modelmap.at(model));
73 };
74
75 const std::map<model_types_2CLJF, std::valarray<double>> m = {
76 {MECKE, {-1.5,-1.5,-1.5,-1.5,-1.0,-1.0,-1.0,-1.0,-1.0,-1.0,-0.5,-0.5,-0.5,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,-2.0,-2.0,-2.0,-2.0,0.0,0.0,-4.0,-4.0,-4.0,-3.0,-3.0,-3.0}},
77 {LISAL, {-1.50,-1.50,-1.00,-1.00,-1.00,-1.00,-1.00,-1.00,-1.00,-1.00,-0.50,-0.50,-0.50,-0.50,-0.50,0.00,0.00,0.00,0.00,0.00,0.00,-3.00,-2.00,-2.00,-2.00,-1.00,0.00,-4.00,-4.00,-4.00,-4.00,0.00,0.00,0.00}}
78 };
79
80 auto get_m_parameter(const std::string& model) {
81 return m.at(modelmap.at(model));
82 };
83
84 const std::map<model_types_2CLJF, std::valarray<double>> n = {
85 {MECKE, {1.0,3.0,7.0,9.0,1.0,2.0,2.0,2.0,2.0,9.0,1.0,1.0,9.0,1.0,1.0,1.0,3.0,3.0,3.0,3.0,5.0,8.0,2.0,2.0,2.0,5.0,5.0,9.0,2.0,2.0,4.0,1.0,1.0,4}},
86 {LISAL, {2.0,5.0,1.0,1.0,2.0,2.0,2.0,2.0,2.0,10.0,1.0,1.0,3.0,9.0,10.0,1.0,2.0,2.0,2.0,9.0,10.0,1.0,1.0,3.0,6.0,3.0,3.0,1.0,1.0,2.0,6.0,1.0,1.0,1.0}}
87 };
88
89 auto get_n_parameter(const std::string& model) {
90 return n.at(modelmap.at(model));
91 };
92
93 const std::map<model_types_2CLJF, std::valarray<double>> o = {
94 {MECKE, {0,-1,-2,-3,0,-3,-2,-1,0,-3,-3,-2,-3,-3,-1,0,1,2,3,4,4,-1,-2,-1,0,-1,3,2,-3,-2,-1,-3,-1,4}},
95 {LISAL, {-3,-2,0,1,-3,-2,-1,0,1,-3,-3,-2,-1,-3,-2,0,-3,-2,-1,0,2,-2,0,0,1,2,-1,-3,0,-3,-2,-3,1,3}}
96 };
97
98 auto get_o_parameter(const std::string& model) {
99 return o.at(modelmap.at(model));
100 };
101
102 const std::map<model_types_2CLJF, std::valarray<double>> p = {
103 {MECKE, {0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,-1.0,-1.0,-1.0,-1.0,-1.0,-1.0,-1.0,-1.0,-1.0,-1.0,-1.0,-1}},
104 {LISAL, {0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,-1.0,-1.0,-1.0,-1.0,-1.0,-1.0,-1.0,-1.0,-1.0,-1.0,-1.0,-1.0,-1}}
105 };
106
107 auto get_p_parameter(const std::string& model) {
108 return p.at(modelmap.at(model));
109 };
110
111 const std::map<model_types_2CLJF, std::valarray<double>> q = {
112 {MECKE, {0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,2.0,2.0,2.0,2.0,2.0,2}},
113 {LISAL, {0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,2.0,2.0,2.0,2.0,2.0,2.0,2}}
114 };
115
116 auto get_q_parameter(const std::string& model) {
117 return q.at(modelmap.at(model));
118 };
119
120 // Parameters for the dipolar contribution (Parameters are from Saager et al: https://aip.scitation.org/doi/10.1063/1.472764
121 const std::map<model_types_2CLJF, std::valarray<double>> cd = {
122 {MECKE, {-0.423652173318e-01,0.204459397242e-01,0.664266837321e-01,-0.324168341478e-01,-0.741263275720e-02,-0.160855507113e-01,0.435623305093e-02,-0.105933370736e-03,-0.132000046519e-05,0.838157718194e-05,0.109144074057e-01,0.257960188278e-01,-0.544140085185e-03,0.349568484468e-02,-0.421407562467e-01,-0.745992658113e-02,0.146102252152e-03,0.566611094911e-03,-0.378643890614e-02,-0.365824539450e-01,0.169287932475e-01, 0.663866480778e-02,0.294409406715e-01,-0.112110434947e-01,-0.182144939032e-05,0.758594753989e-07,-0.216942306418e-04,-0.274025042954e-05}},
123 {LISAL, {-0.423652173318e-01,0.204459397242e-01,0.664266837321e-01,-0.324168341478e-01,-0.741263275720e-02,-0.160855507113e-01,0.435623305093e-02,-0.105933370736e-03,-0.132000046519e-05,0.838157718194e-05,0.109144074057e-01,0.257960188278e-01,-0.544140085185e-03,0.349568484468e-02,-0.421407562467e-01,-0.745992658113e-02,0.146102252152e-03,0.566611094911e-03,-0.378643890614e-02,-0.365824539450e-01,0.169287932475e-01, 0.663866480778e-02,0.294409406715e-01,-0.112110434947e-01,-0.182144939032e-05,0.758594753989e-07,-0.216942306418e-04,-0.274025042954e-05 }}
124 };
125
126 auto get_dipolar_c_parameter(const std::string& model) {
127 return cd.at(modelmap.at(model));
128 };
129
130 const std::map < model_types_2CLJF, std::valarray<double>> nd = {
131 {MECKE, {-5.0,-8.0,-4.0,-3.0,-10.0,-7.0,-10.0,-11.0,-15.0,-10.0,-2.0,-2.0,-1.0,-5.0,-3.0,-1.0,1.0,-9.0,-7.0,-2.0,-1.0,-5.0,-2.0,-1.0,-8.0,-5.0,1.0,-4.0}},
132 {LISAL, {-5.0,-8.0,-4.0,-3.0,-10.0,-7.0,-10.0,-11.0,-15.0,-10.0,-2.0,-2.0,-1.0,-5.0,-3.0,-1.0,1.0,-9.0,-7.0,-2.0,-1.0,-5.0,-2.0,-1.0,-8.0,-5.0,1.0,-4.0}}
133 };
134
135 auto get_dipolar_n_parameter(const std::string& model) {
136 return nd.at(modelmap.at(model));
137 };
138
139 const std::map < model_types_2CLJF, std::valarray<double>> md = {
140 {MECKE, {2.0,2.0,2.0,2.0,2.0,2.0,2.0,2.0,2.0,3.0,2.0,3.0,6.0,2.0,3.0,3.0,6.0,2.0,2.0,2.0,2.0,3.0,3.0,3.0,10.0,16.0,4.0,9.0}},
141 {LISAL, {2.0,2.0,2.0,2.0,2.0,2.0,2.0,2.0,2.0,3.0,2.0,3.0,6.0,2.0,3.0,3.0,6.0,2.0,2.0,2.0,2.0,3.0,3.0,3.0,10.0,16.0,4.0,9.0 }}
142 };
143
144 auto get_dipolar_m_parameter(const std::string& model) {
145 return md.at(modelmap.at(model));
146 };
147
148 const std::map < model_types_2CLJF, std::valarray<double>> kd = {
149 {MECKE, {5.0,6.0,7.0,7.0,9.0,9.0,11.0,15.0,18.0,18.0,5.0,5.0,5.0,6.0,6.0,6.0,6.0,7.0,7.0,7.0,7.0,7.0,7.0,7.0,7.0,7.0,8.0,10.0}},
150 {LISAL, {5.0,6.0,7.0,7.0,9.0,9.0,11.0,15.0,18.0,18.0,5.0,5.0,5.0,6.0,6.0,6.0,6.0,7.0,7.0,7.0,7.0,7.0,7.0,7.0,7.0,7.0,8.0,10.0}}
151 };
152
153 auto get_dipolar_k_parameter(const std::string& model) {
154 return kd.at(modelmap.at(model));
155 };
156
157 const std::map < model_types_2CLJF, std::valarray<double>> od = {
158 {MECKE, {1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }},
159 {LISAL, {1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }}
160 };
161
162 auto get_dipolar_o_parameter(const std::string& model) {
163 return od.at(modelmap.at(model));
164 };
165
166 // Parameters for the quadrupolar contribution (Parameters are from Saager et al: https://aip.scitation.org/doi/10.1063/1.472764
167 const std::map<model_types_2CLJF, std::valarray<double>> cq = {
168 {MECKE, {-0.41215428089610E-2, 0.35578044173610E-2,-0.88809379838910E-3, 0.97379155960910E-4,-0.60423371932610E-7,-0.30447863314610E-4,-0.37893019633710E-3,-0.27538826735210E-1, 0.11830188842010E-1,-0.28345123056210E-2,-0.56770387482810E-4, 0.31470857321210E-2, 0.96378605256910E-3,-0.12759100242410E-2, 0.36374646323810E-3, 0.30106794309610E-4, 0.29177823112810E-6}},
169 {LISAL, {-0.41215428089610E-2, 0.35578044173610E-2,-0.88809379838910E-3, 0.97379155960910E-4,-0.60423371932610E-7,-0.30447863314610E-4,-0.37893019633710E-3,-0.27538826735210E-1, 0.11830188842010E-1,-0.28345123056210E-2,-0.56770387482810E-4, 0.31470857321210E-2, 0.96378605256910E-3,-0.12759100242410E-2, 0.36374646323810E-3, 0.30106794309610E-4, 0.29177823112810E-6}}
170 };
171
172 auto get_quadrupolar_c_parameter(const std::string& model) {
173 return cq.at(modelmap.at(model));
174 };
175
176 const std::map < model_types_2CLJF, std::valarray<double>> nq = {
177 {MECKE, {-8.0,-6.0,-4.0,-10.0,-20.0,-8.0,-3.0,-3.0,-2.0,0.0,-5.0,-1.0,-3.0,-1.0,0.0,0.0,-10.0}},
178 {LISAL, {-8.0,-6.0,-4.0,-10.0,-20.0,-8.0,-3.0,-3.0,-2.0,0.0,-5.0,-1.0,-3.0,-1.0,0.0,0.0,-10.0}}
179 };
180
181 auto get_quadrupolar_n_parameter(const std::string& model) {
182 return nq.at(modelmap.at(model));
183 };
184
185 const std::map < model_types_2CLJF, std::valarray<double>> mq = {
186 {MECKE, {2.0,2.0,2.0,2.0,2.0,2.0,8.0,2.0,2.0,2.0,8.0,2.0,5.0,5.0,5.0,8.0,7.0}},
187 {LISAL, {2.0,2.0,2.0,2.0,2.0,2.0,8.0,2.0,2.0,2.0,8.0,2.0,5.0,5.0,5.0,8.0,7.0}}
188 };
189
190 auto get_quadrupolar_m_parameter(const std::string& model) {
191 return mq.at(modelmap.at(model));
192 };
193
194 const std::map < model_types_2CLJF, std::valarray<double>> kq = {
195 {MECKE, {11.0,12.0,13.0,16.0,19.0,20.0, 7.0, 8.0, 8.0, 8.0, 8.0, 9.0,10.0,10.0,10.0,10.0,18.0}},
196 {LISAL, {11.0,12.0,13.0,16.0,19.0,20.0, 7.0, 8.0, 8.0, 8.0, 8.0, 9.0,10.0,10.0,10.0,10.0,18.0}}
197 };
198
199 auto get_quadrupolar_k_parameter(const std::string& model) {
200 return kq.at(modelmap.at(model));
201 };
202
203 const std::map < model_types_2CLJF, std::valarray<double>> oq = {
204 {MECKE, {1.0,1.0,1.0,1.0,1.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0}},
205 {LISAL, {1.0,1.0,1.0,1.0,1.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0}}
206 };
207
208 auto get_quadrupolar_o_parameter(const std::string& model) {
209 return oq.at(modelmap.at(model));
210 };
211 };
212
213 // Reducing functions for density and temperature
215 public:
216 std::valarray<double> p_alpha, p_eta_rho, p_rho;
217
218 // EQ(3)
219 auto get_alpha_star(const double& L) const {
220 return forceeval(p_alpha[0] + p_alpha[1] * pow(L, 2) + p_alpha[2] * pow(L, 3.5) + p_alpha[3] * pow(L, 4));
221 }
222
223 // EQ(6)
224 auto get_eta_over_rho(const double& L) const {
225 return forceeval(p_eta_rho[0] + p_eta_rho[1] * pow(L, 2) + p_eta_rho[2] * pow(L, 2.5) + p_eta_rho[3] * pow(L, 4));
226 }
227
228 // EQ(8)
229 auto get_rho_red(const double& L) const {
230 return forceeval((p_rho[0] + p_rho[1] * L) / (1.0 + p_rho[2] * L + p_rho[3] * pow(L, 2)));
231 }
232 };
233
235 public:
236 std::valarray<double> p_t;
237
238 // EQ(5)
239 auto get_T_red(const double& L) const {
240 if (L == 0) {
241 return 0.25 * sqrt((p_t[0] + p_t[1] * L) / (1.0 + p_t[2] * L + p_t[3] * pow(L, 2)));
242 }
243 else
244 {
245 return sqrt((p_t[0] + p_t[1] * L) / (1.0 + p_t[2] * L + p_t[3] * pow(L, 2)));
246 }
247 }
248 };
249
251 public:
252 std::valarray<double> c, m, n, o, p, q;
253
254 // EQ(7)
255 template<typename TauType, typename DeltaType>
256 auto alphar(const TauType& tau, const DeltaType& delta, const double& alpha) const {
257 using result = std::common_type_t<TauType, DeltaType>;
258
259 result r = 0.0;
260 for (auto i = 0U; i < c.size(); ++i) {
261 r = r + c[i] * pow(tau, m[i]) * powi(delta, static_cast<int>(n[i])) * pow(alpha, o[i]) * exp(p[i] * powi(delta, static_cast<int>(q[i])));
262 }
263 return forceeval(r);
264 }
265 };
266
267
269 public:
270 const double a = 0.67793;
271 const double g = 0.3674;
272
273 // EQ(2)
274 template<typename TauType, typename DeltaType>
275 auto alphar(const TauType& tau, const DeltaType& delta, const double& alpha) const {
276
277 auto eta = forceeval((delta / (a + (1.0 - a) * pow(tau, g))));
278 auto r = (pow(alpha, 2) - 1.0) * log(1.0 - eta) + ((pow(alpha, 2) + 3 * alpha) * eta - 3 * alpha * powi(eta, 2)) / (pow(1.0 - eta, 2));
279 return forceeval(r);
280 }
281 };
282
284 public:
285 std::valarray<double> c, m, n, k, o;
286 // EQ(9): https://aip.scitation.org/doi/10.1063/1.472764
287 template<typename TauType, typename DeltaType>
288 auto alphar(const TauType& tau, const DeltaType& delta, const double& mu_sq) const {
289 using result = std::common_type_t<TauType, DeltaType>;
290
291 result r = 0.0;
292 for (auto i = 0U; i < c.size(); ++i) {
293 r = r + c[i] * pow(tau, n[i] / 2.0) * pow(delta, m[i] / 2.0) * pow(mu_sq, k[i] / 4.0) * exp(-o[i] * pow(delta, 2.0));
294 }
295 return forceeval(r);
296 }
297 };
298
300 public:
301 std::valarray<double> c, m, n, k, o;
302 template<typename TauType, typename DeltaType>
303 auto alphar(const TauType& tau, const DeltaType& delta, const double& mu_sq) const {
304 using result = std::common_type_t<TauType, DeltaType>;
305
306 result r = 0.0;
307 for (auto i = 0U; i < c.size(); ++i) {
308 r = r + c[i] * pow(tau, n[i] / 2.0) * pow(delta, m[i] / 2.0) * pow(mu_sq, k[i] / 4.0) * exp(-o[i] * pow(delta, 2.0));
309 }
310 return forceeval(r);
311 }
312 };
313 template<typename TypePolarContribution>
315 public:
320 const TypePolarContribution Pole;
321 const double L;
322 const double mu_sq;
323
324 Twocenterljf(ReducingDensity&& redD, ReducingTemperature&& redT, HardSphereContribution&& Hard, const AttractiveContribution&& Attr, const TypePolarContribution&& Pole, const double L, const double& mu_sq) : redD(redD), redT(redT), Hard(Hard), Attr(Attr), Pole(Pole), L(L), mu_sq(mu_sq) {};
325
326 template<typename TType, typename RhoType, typename MoleFracType>
327 auto alphar(const TType& T_star,
328 const RhoType& rho_dimer_star,
329 const MoleFracType& /*molefrac*/) const
330 {
331 auto Tred = forceeval(redT.get_T_red(L));
332 auto Rred = forceeval(redD.get_rho_red(L));
333 auto eta_red = forceeval(redD.get_eta_over_rho(L));
334 auto alpha = forceeval(redD.get_alpha_star(L));
335 auto delta = forceeval(rho_dimer_star / Rred);
336 auto tau = forceeval(T_star / Tred);
337 auto delta_eta = forceeval(rho_dimer_star * eta_red);
338 auto alphar_1 = Hard.alphar(tau, delta_eta, alpha);
339 auto alphar_2 = Attr.alphar(tau, delta, alpha);
340 auto val = forceeval(alphar_1 + alphar_2);
341 if (mu_sq != 0.0){
342 val += Pole.alphar(tau, delta, mu_sq);
343 }
344 return forceeval(val);
345 }
346
347 template<class VecType>
348 auto R(const VecType& /*molefrac*/) const {
349 return 1.0;
350 }
351 };
352
353 inline auto get_density_reducing(const std::string& name) {
354 ParameterContainer pContainer;
355 ReducingDensity red_rho;
356 red_rho.p_alpha = pContainer.get_alpha_star_parameter(name);
357 red_rho.p_eta_rho = pContainer.get_eta_rho_parameter(name);
358 red_rho.p_rho = pContainer.get_rho_parameter(name);
359 return red_rho;
360 };
361
362 inline auto get_temperature_reducing(const std::string& name) {
363 ParameterContainer pContainer;
365 red_T.p_t = pContainer.get_T_parameter(name);
366 return red_T;
367 };
368
369 inline auto get_Attractive_contribution(const std::string& name) {
370 ParameterContainer pContainer;
372 eos.c = pContainer.get_c_parameter(name);
373 eos.m = pContainer.get_m_parameter(name);
374 eos.n = pContainer.get_n_parameter(name);
375 eos.o = pContainer.get_o_parameter(name);
376 eos.p = pContainer.get_p_parameter(name);
377 eos.q = pContainer.get_q_parameter(name);
378 return eos;
379
380 }
381
384 return eos;
385 }
386
387 inline auto get_Dipolar_contribution(const std::string& name) {
388 ParameterContainer pContainer;
390 eos.c = pContainer.get_dipolar_c_parameter(name);
391 eos.n = pContainer.get_dipolar_n_parameter(name);
392 eos.m = pContainer.get_dipolar_m_parameter(name);
393 eos.k = pContainer.get_dipolar_k_parameter(name);
394 eos.o = pContainer.get_dipolar_o_parameter(name);
395 return eos;
396 }
397
398 inline auto get_Quadrupolar_contribution(const std::string& name) {
399 ParameterContainer pContainer;
401 eos.c = pContainer.get_quadrupolar_c_parameter(name);
402 eos.n = pContainer.get_quadrupolar_n_parameter(name);
403 eos.m = pContainer.get_quadrupolar_m_parameter(name);
404 eos.k = pContainer.get_quadrupolar_k_parameter(name);
405 eos.o = pContainer.get_quadrupolar_o_parameter(name);
406 return eos;
407 }
408
409 // build the 2-center Lennard-Jones model without dipole
410 inline auto build_two_center_model(const std::string& model_version, const double& L = 0.0) {
411
412 // Get reducing for temperature and density
413 auto DC_funcs = get_density_reducing(model_version);
414 auto TC_func = get_temperature_reducing(model_version);
415
417 auto EOS_hard = get_HardSphere_contribution();
418 auto EOS_att = get_Attractive_contribution(model_version);
419 auto EOS_dipolar = get_Dipolar_contribution(model_version);
420 double mu_sq = 0.0;
421
422 // Build the 2-center Lennard-Jones model
423 auto model = Twocenterljf(std::move(DC_funcs), std::move(TC_func), std::move(EOS_hard), std::move(EOS_att), std::move(EOS_dipolar), L, mu_sq);
424
425 return model;
426 }
427
428 // build the 2-center Lennard-Jones model with dipole
429 inline auto build_two_center_model_dipole(const std::string& model_version, const double& L = 0.0, const double& mu_sq = 0.0) {
430
431 // Get reducing for temperature and density
432 auto DC_funcs = get_density_reducing(model_version);
433 auto TC_func = get_temperature_reducing(model_version);
434
436 auto EOS_hard = get_HardSphere_contribution();
437 auto EOS_att = get_Attractive_contribution(model_version);
438 auto EOS_dipolar = get_Dipolar_contribution(model_version);
439
440 // Build the 2-center Lennard-Jones model
441 auto model = Twocenterljf(std::move(DC_funcs), std::move(TC_func), std::move(EOS_hard), std::move(EOS_att), std::move(EOS_dipolar), L, mu_sq);
442
443 return model;
444 }
445
446 // build the 2-center Lennard-Jones model with quadrupole
447 inline auto build_two_center_model_quadrupole(const std::string& model_version, const double& L = 0.0, const double& Q_sq = 0.0) {
448
449 // Get reducing for temperature and density
450 auto DC_funcs = get_density_reducing(model_version);
451 auto TC_func = get_temperature_reducing(model_version);
452
453 // Get contributions to EOS ( Attractive and regular part)
454 auto EOS_hard = get_HardSphere_contribution();
455 auto EOS_att = get_Attractive_contribution(model_version);
456
457 // Get contributions to EOS ( Attractive and regular part)
458 auto EOS_quadrupolar = get_Quadrupolar_contribution(model_version);
459
460 // Build the 2-center Lennard-Jones model
461 auto model = Twocenterljf(std::move(DC_funcs), std::move(TC_func), std::move(EOS_hard), std::move(EOS_att), std::move(EOS_quadrupolar), L, Q_sq);
462
463 return model;
464 }
465 } // namespace twocenterljf
466}; // namespace teqp
auto alphar(const TauType &tau, const DeltaType &delta, const double &alpha) const
auto alphar(const TauType &tau, const DeltaType &delta, const double &mu_sq) const
auto alphar(const TauType &tau, const DeltaType &delta, const double &alpha) const
const std::map< model_types_2CLJF, std::valarray< double > > kd
const std::map< model_types_2CLJF, std::valarray< double > > n
auto get_quadrupolar_o_parameter(const std::string &model)
const std::map< model_types_2CLJF, std::valarray< double > > nd
auto get_dipolar_n_parameter(const std::string &model)
auto get_q_parameter(const std::string &model)
const std::map< model_types_2CLJF, std::valarray< double > > m
const std::map< model_types_2CLJF, std::valarray< double > > o
auto get_rho_parameter(const std::string &model)
const std::map< model_types_2CLJF, std::valarray< double > > cd
auto get_dipolar_c_parameter(const std::string &model)
const std::map< model_types_2CLJF, std::valarray< double > > nq
auto get_o_parameter(const std::string &model)
auto get_dipolar_k_parameter(const std::string &model)
auto get_p_parameter(const std::string &model)
const std::map< model_types_2CLJF, std::valarray< double > > p_t
const std::map< model_types_2CLJF, std::valarray< double > > c
auto get_c_parameter(const std::string &model)
auto get_dipolar_o_parameter(const std::string &model)
auto get_alpha_star_parameter(const std::string &model)
const std::map< model_types_2CLJF, std::valarray< double > > q
auto get_quadrupolar_c_parameter(const std::string &model)
const std::map< model_types_2CLJF, std::valarray< double > > p_rho
auto get_quadrupolar_m_parameter(const std::string &model)
auto get_quadrupolar_n_parameter(const std::string &model)
const std::map< model_types_2CLJF, std::valarray< double > > od
const std::map< model_types_2CLJF, std::valarray< double > > cq
const std::map< model_types_2CLJF, std::valarray< double > > md
const std::map< model_types_2CLJF, std::valarray< double > > mq
const std::map< model_types_2CLJF, std::valarray< double > > oq
const std::map< model_types_2CLJF, std::valarray< double > > p_eta_rho
auto get_quadrupolar_k_parameter(const std::string &model)
auto get_m_parameter(const std::string &model)
auto get_eta_rho_parameter(const std::string &model)
const std::map< model_types_2CLJF, std::valarray< double > > kq
auto get_T_parameter(const std::string &model)
const std::map< model_types_2CLJF, std::valarray< double > > p_alpha
auto get_dipolar_m_parameter(const std::string &model)
auto get_n_parameter(const std::string &model)
const std::map< model_types_2CLJF, std::valarray< double > > p
auto alphar(const TauType &tau, const DeltaType &delta, const double &mu_sq) const
auto get_alpha_star(const double &L) const
auto get_eta_over_rho(const double &L) const
std::valarray< double > p_eta_rho
std::valarray< double > p_alpha
auto get_rho_red(const double &L) const
auto get_T_red(const double &L) const
auto R(const VecType &) const
auto alphar(const TType &T_star, const RhoType &rho_dimer_star, const MoleFracType &) const
const ReducingTemperature redT
const TypePolarContribution Pole
Twocenterljf(ReducingDensity &&redD, ReducingTemperature &&redT, HardSphereContribution &&Hard, const AttractiveContribution &&Attr, const TypePolarContribution &&Pole, const double L, const double &mu_sq)
const AttractiveContribution Attr
const HardSphereContribution Hard
auto get_density_reducing(const std::string &name)
auto build_two_center_model(const std::string &model_version, const double &L=0.0)
auto get_Quadrupolar_contribution(const std::string &name)
auto get_Dipolar_contribution(const std::string &name)
const std::map< std::string, model_types_2CLJF > modelmap
auto get_temperature_reducing(const std::string &name)
auto get_HardSphere_contribution()
auto build_two_center_model_dipole(const std::string &model_version, const double &L=0.0, const double &mu_sq=0.0)
auto build_two_center_model_quadrupole(const std::string &model_version, const double &L=0.0, const double &Q_sq=0.0)
auto get_Attractive_contribution(const std::string &name)
T powi(const T &x, int n)
From Ulrich Deiters.
Definition types.hpp:139
auto pow(const double &x, const double &e)
Definition types.hpp:195
auto forceeval(T &&expr)
Definition types.hpp:52