teqp 0.22.0
|
Things that only depend on the components themselves, but not on composition, temperature, or density. More...
#include <saftvrmie.hpp>
Public Member Functions | |
SAFTVRMieChainContributionTerms (const Eigen::ArrayXd &m, const Eigen::ArrayXd &epsilon_over_k, const Eigen::ArrayXd &sigma_m, const Eigen::ArrayXd &lambda_r, const Eigen::ArrayXd &lambda_a, const Eigen::ArrayXXd &kmat, const std::optional< nlohmann::json > &flags=std::nullopt) | |
auto | get_EPSKIJ_K_matrix () const |
Get the matrix of \(\varepsilon_{ij}/k_B\) with the entries in K. | |
auto | get_SIGMAIJ_m_matrix () const |
Get the matrix of \(\sigma_{ij}\) with the entries in m. | |
template<typename RType > | |
auto | get_uii_over_kB (std::size_t i, const RType &r) const |
Eq. A2 from Lafitte. | |
template<typename TType > | |
auto | get_j_cutoff_dii (std::size_t i, const TType &T) const |
Solve for the value of \(j=\sigma/r\) for which the integrand in \(d_{ii}\) becomes equal to 1 to numerical precision. | |
template<typename TType > | |
TType | get_dii (std::size_t i, const TType &T) const |
template<typename TType > | |
auto | get_dmat (const TType &T) const |
template<typename TType , typename RhoType , typename VecType > | |
auto | get_core_calcs (const TType &T, const RhoType &rhomolar, const VecType &molefracs) const |
template<typename RhoType > | |
auto | get_KHS (const RhoType &pf) const |
Eq. A21 from Lafitte. | |
template<typename RhoType > | |
auto | get_rhos_dK_HS_drhos (const RhoType &zeta_x) const |
template<typename RhoType , typename ZetaType , typename DType > | |
auto | get_a_HS (const RhoType &rhos, const Eigen::Array< ZetaType, 4, 1 > &zeta, const Eigen::Array< DType, 4, 1 > &D) const |
Eq. A6 from Lafitte, accounting for the case of rho_s=0, for which the limit is zero. | |
template<typename ZetaType , typename IJ > | |
auto | get_Bhatij (const ZetaType &zeta_x, const ZetaType &one_minus_zeta_x3, const IJ &I, const IJ &J) const |
template<typename ZetaType , typename IJ > | |
auto | get_rhodBijdrho (const ZetaType &zeta_x, const ZetaType &, const IJ &I, const IJ &J, const ZetaType &Bhatij) const |
template<typename ZetaType > | |
auto | get_a1Shatij (const ZetaType &zeta_x_eff, double lambda_ij) const |
template<typename ZetaType > | |
auto | get_rhoda1Shatijdrho (const ZetaType &zeta_x, const ZetaType &zeta_x_eff, const ZetaType &dzetaxeffdzetax, double lambda_ij) const |
Public Attributes | |
const Eigen::ArrayXd | m |
const Eigen::ArrayXd | epsilon_over_k |
const Eigen::ArrayXd | sigma_A |
const Eigen::ArrayXd | lambda_a |
const Eigen::ArrayXd | lambda_r |
const Eigen::ArrayXXd | kmat |
const Eigen::Index | N |
const EpsilonijFlags | epsilon_ij_flag = EpsilonijFlags::kLafitte |
const Eigen::ArrayXXd | lambda_r_ij |
const Eigen::ArrayXXd | lambda_a_ij |
const Eigen::ArrayXXd | C_ij |
const Eigen::ArrayXXd | alpha_ij |
const Eigen::ArrayXXd | sigma_ij |
const Eigen::ArrayXXd | epsilon_ij |
const std::vector< Eigen::ArrayXXd > | crnij |
const std::vector< Eigen::ArrayXXd > | canij |
const std::vector< Eigen::ArrayXXd > | c2rnij |
const std::vector< Eigen::ArrayXXd > | c2anij |
const std::vector< Eigen::ArrayXXd > | carnij |
const std::vector< Eigen::ArrayXXd > | fkij |
Things that only depend on the components themselves, but not on composition, temperature, or density.
Definition at line 85 of file saftvrmie.hpp.
|
inline |
Definition at line 264 of file saftvrmie.hpp.
|
inline |
\[ \hat a^S_{1,ii} = \frac{a^S_{1,ii}}{2\pi\epsilon_{ij}d^3_{ij}\rho_s} \]
so
\[ a^S_{1,ii} = \kappa\rho_s\hat a^S_{1,ii} \]
Definition at line 749 of file saftvrmie.hpp.
|
inline |
Eq. A6 from Lafitte, accounting for the case of rho_s=0, for which the limit is zero.
Definition at line 661 of file saftvrmie.hpp.
|
inline |
Defining:
\[ \hat B_{ij} \equiv \frac{B_{ij}}{2\pi\epsilon_{ij}d^3_{ij}\rho_s} = \frac{1-\zeta_x/2}{(1-\zeta_x)^3}I-\frac{9\zeta_x(1+\zeta_x)}{2(1-\zeta_x)^3}J \]
Definition at line 713 of file saftvrmie.hpp.
|
inline |
Definition at line 396 of file saftvrmie.hpp.
|
inline |
The calculation of the diameter is based upon
\[ d_{ii} = \int_0^{\sigma_{ii}}(1-\exp(-\beta u_{ii}^{\rm Mie}(r)){\rm d}r \]
which is broken up into two parts:
\[ d = \int_0^{r_{\rm cut}} 1 {\rm d} r + \int_{r_{\rm cut}}^{\sigma_{ii}} [1-\exp(-\beta u_{ii}^{\rm Mie}(r))] {\rm d}r \]
but the integrand is basically constant (to numerical precision) from 0 to some cutoff value of \(r\), which we'll call \(r_{\rm cut}\). So first we need to find the value of \(r_{\rm cut}\) that makes the integrand take its constant value, which is explained well in the paper from Aasen (https://github.com/ClapeyronThermo/Clapeyron.jl/issues/152#issuecomment-1480324192). Finding the cutoff value is obtained when
\[ \exp(-\beta u_{ii}^{\rm Mie}(r)) = EPS \]
where EPS is the numerical precision of the floating point type. Taking the logs of both sides,
\[ -\beta u_{ii}^{\rm Mie} = \ln(EPS) \]
To get a starting value, it is first assumed that only the repulsive contribution contributes to the potential, yielding \(u^{\rm rep} = C\epsilon(\sigma/r)^{\lambda_r}\) (with \(C\) the same as the full potential with attraction) which yields
\[ -\beta C\epsilon(\sigma/r)^{\lambda_r} = \ln(EPS) \]
and
\[ (\sigma/r)_{\rm guess} = (-\ln(EPS)/(\beta C \epsilon))^{1/\lambda_r} \]
Then we solve for the residual \(R(r)=0\), where \(R_0=\exp(-u/T)-EPS\). Equivalently we can write the residual in logarithmic terms as \(R=-u/T-\ln(EPS)\). This simplifies the rootfinding as you need \(R\), \(R'\) and \(R''\) to apply Halley's method, which are themselves quite straightforward to obtain because \(R'=-u'/T\), \(R''=-u''/T\), where the primes are derivatives taken with respect to \(\sigma/r\).
Definition at line 362 of file saftvrmie.hpp.
|
inline |
Definition at line 379 of file saftvrmie.hpp.
|
inline |
Get the matrix of \(\varepsilon_{ij}/k_B\) with the entries in K.
Definition at line 284 of file saftvrmie.hpp.
|
inline |
Solve for the value of \(j=\sigma/r\) for which the integrand in \(d_{ii}\) becomes equal to 1 to numerical precision.
Definition at line 297 of file saftvrmie.hpp.
|
inline |
Eq. A21 from Lafitte.
Definition at line 643 of file saftvrmie.hpp.
|
inline |
\[ \left(\frac{\partial a^S_{1,ii}}{\partial \rho_s}\right)_{T,\vec{z}} = \kappa\left(\hat a^S_{1,ii} + \rho_s\frac{\partial \hat a^S_{1,ii}}{\partial \rho_s} \right) \]
\[ \left(\frac{\partial a^S_{1,ii}}{\partial \rho_s}\right)_{T,\vec{z}} = \kappa\left(\hat a^S_{1,ii} + \rho_s\frac{\partial \hat a^S_{1,ii}}{\partial \zeta_{x,eff}}\frac{\partial \zeta_{x,eff}}{\partial \zeta_x}\frac{\partial \zeta_x}{\partial \rho_s} \right) \]
since \(\rho_s\frac{\partial \zeta_x}{\partial \rho_s} = \zeta_x\)
Definition at line 767 of file saftvrmie.hpp.
|
inline |
\[ B = \hat B_{ij}\kappa \rho_s \]
\[ \left(\frac{\partial B_{ij}}{\partial \rho_s}\right)_{T,\vec{z}} = \kappa\left(\hat B + \zeta_x \frac{\partial \hat B}{\partial \zeta_x}\right) \]
and thus
\[ \rho_s \left(\frac{\partial B_{ij}}{\partial \rho_s}\right)_{T,\vec{z}} = \hat B + \zeta_x \frac{\partial \hat B}{\partial \zeta_x} \]
Definition at line 732 of file saftvrmie.hpp.
|
inline |
\[ \rho_s\frac{\partial K_{HS}}{\partial \rho_s} = \zeta\frac{\partial K_{HS}}{\partial \zeta} \]
Definition at line 653 of file saftvrmie.hpp.
|
inline |
Get the matrix of \(\sigma_{ij}\) with the entries in m.
Definition at line 286 of file saftvrmie.hpp.
|
inline |
Eq. A2 from Lafitte.
Definition at line 290 of file saftvrmie.hpp.
const Eigen::ArrayXXd teqp::SAFTVRMie::SAFTVRMieChainContributionTerms::alpha_ij |
Definition at line 259 of file saftvrmie.hpp.
const std::vector<Eigen::ArrayXXd> teqp::SAFTVRMie::SAFTVRMieChainContributionTerms::c2anij |
Definition at line 261 of file saftvrmie.hpp.
const std::vector<Eigen::ArrayXXd> teqp::SAFTVRMie::SAFTVRMieChainContributionTerms::c2rnij |
Definition at line 261 of file saftvrmie.hpp.
const Eigen::ArrayXXd teqp::SAFTVRMie::SAFTVRMieChainContributionTerms::C_ij |
Definition at line 259 of file saftvrmie.hpp.
const std::vector<Eigen::ArrayXXd> teqp::SAFTVRMie::SAFTVRMieChainContributionTerms::canij |
Definition at line 261 of file saftvrmie.hpp.
const std::vector<Eigen::ArrayXXd> teqp::SAFTVRMie::SAFTVRMieChainContributionTerms::carnij |
Definition at line 261 of file saftvrmie.hpp.
const std::vector<Eigen::ArrayXXd> teqp::SAFTVRMie::SAFTVRMieChainContributionTerms::crnij |
Definition at line 261 of file saftvrmie.hpp.
const Eigen::ArrayXXd teqp::SAFTVRMie::SAFTVRMieChainContributionTerms::epsilon_ij |
Definition at line 259 of file saftvrmie.hpp.
const EpsilonijFlags teqp::SAFTVRMie::SAFTVRMieChainContributionTerms::epsilon_ij_flag = EpsilonijFlags::kLafitte |
Definition at line 256 of file saftvrmie.hpp.
const Eigen::ArrayXd teqp::SAFTVRMie::SAFTVRMieChainContributionTerms::epsilon_over_k |
Definition at line 252 of file saftvrmie.hpp.
const std::vector<Eigen::ArrayXXd> teqp::SAFTVRMie::SAFTVRMieChainContributionTerms::fkij |
Definition at line 262 of file saftvrmie.hpp.
const Eigen::ArrayXXd teqp::SAFTVRMie::SAFTVRMieChainContributionTerms::kmat |
Definition at line 253 of file saftvrmie.hpp.
const Eigen::ArrayXd teqp::SAFTVRMie::SAFTVRMieChainContributionTerms::lambda_a |
Definition at line 252 of file saftvrmie.hpp.
const Eigen::ArrayXXd teqp::SAFTVRMie::SAFTVRMieChainContributionTerms::lambda_a_ij |
Definition at line 259 of file saftvrmie.hpp.
const Eigen::ArrayXd teqp::SAFTVRMie::SAFTVRMieChainContributionTerms::lambda_r |
Definition at line 252 of file saftvrmie.hpp.
const Eigen::ArrayXXd teqp::SAFTVRMie::SAFTVRMieChainContributionTerms::lambda_r_ij |
Definition at line 259 of file saftvrmie.hpp.
const Eigen::ArrayXd teqp::SAFTVRMie::SAFTVRMieChainContributionTerms::m |
Definition at line 252 of file saftvrmie.hpp.
const Eigen::Index teqp::SAFTVRMie::SAFTVRMieChainContributionTerms::N |
Definition at line 255 of file saftvrmie.hpp.
const Eigen::ArrayXd teqp::SAFTVRMie::SAFTVRMieChainContributionTerms::sigma_A |
Definition at line 252 of file saftvrmie.hpp.
const Eigen::ArrayXXd teqp::SAFTVRMie::SAFTVRMieChainContributionTerms::sigma_ij |
Definition at line 259 of file saftvrmie.hpp.