teqp 0.22.0
|
Namespaces | |
namespace | activity |
namespace | algorithms |
namespace | ancillaries |
namespace | association |
namespace | constants |
namespace | CPA |
namespace | cppinterface |
namespace | CubicSuperAncillary |
namespace | ECSHuberEly |
namespace | exp6 |
namespace | FEANN |
namespace | GERG2004 |
namespace | GERG2008 |
namespace | GERGGeneral |
namespace | iteration |
namespace | LJChain |
namespace | LKP |
namespace | Mie |
namespace | mie |
namespace | multifluid |
namespace | PCSAFT |
namespace | reducing |
namespace | saft |
namespace | SAFTpolar |
namespace | SAFTVRMie |
namespace | squarewell |
namespace | twocenterljf |
namespace | VLLE |
Concepts | |
concept | CallableAlpha |
concept | CallableAlphar |
concept | CallableAlpharTauDelta |
Enumerations | |
enum class | VLE_return_code { unset , xtol_satisfied , functol_satisfied , maxfev_met , maxiter_met , notfinite_step } |
enum class | ADBackends { autodiff } |
enum class | AdvancedPRaEMixingRules { knotspecified , kLinear , kQuadratic } |
Functions | |
auto | get_pure_critical_conditions_Jacobian (const AbstractModel &model, const double T, const double rho, const std::optional< std::size_t > &alternative_pure_index=std::nullopt, const std::optional< std::size_t > &alternative_length=std::nullopt) |
template<typename Model , typename Scalar , ADBackends backend = ADBackends::autodiff, typename = typename std::enable_if<not std::is_base_of<teqp::cppinterface::AbstractModel, Model>::value>::type> | |
auto | get_pure_critical_conditions_Jacobian (const Model &model, const Scalar T, const Scalar rho, const std::optional< std::size_t > &alternative_pure_index=std::nullopt, const std::optional< std::size_t > &alternative_length=std::nullopt) |
template<typename Model , typename Scalar , ADBackends backend = ADBackends::autodiff, typename = typename std::enable_if<not std::is_base_of<teqp::cppinterface::AbstractModel, Model>::value>::type> | |
auto | solve_pure_critical (const Model &model, const Scalar T0, const Scalar rho0, const std::optional< nlohmann::json > &flags=std::nullopt) |
auto | solve_pure_critical (const AbstractModel &model, const double T0, const double rho0, const std::optional< nlohmann::json > &flags=std::nullopt) |
template<typename Model , typename Scalar , typename = typename std::enable_if<not std::is_base_of<teqp::cppinterface::AbstractModel, Model>::value>::type> | |
Scalar | get_Brho_critical_extrap (const Model &model, const Scalar &Tc, const Scalar &rhoc, const std::optional< Eigen::ArrayXd > &z=std::nullopt) |
template<typename Model , typename Scalar , typename = typename std::enable_if<not std::is_base_of<teqp::cppinterface::AbstractModel, Model>::value>::type> | |
Eigen::Array< double, 2, 1 > | extrapolate_from_critical (const Model &model, const Scalar &Tc, const Scalar &rhoc, const Scalar &T, const std::optional< Eigen::ArrayXd > &z=std::nullopt) |
double | get_Brho_critical_extrap (const AbstractModel &model, const double &Tc, const double &rhoc, const std::optional< Eigen::ArrayXd > &z=std::nullopt) |
auto | extrapolate_from_critical (const AbstractModel &model, const double &Tc, const double &rhoc, const double &T, const std::optional< Eigen::ArrayXd > &z=std::nullopt) |
template<typename Callable , typename Inputs > | |
auto | NewtonRaphson (Callable f, const Inputs &args, double tol) |
template<class A , class B > | |
auto | linsolve (const A &a, const B &b) |
auto | mix_VLE_Tx (const AbstractModel &model, double T, const Eigen::ArrayXd &rhovecL0, const Eigen::ArrayXd &rhovecV0, const Eigen::ArrayXd &xspec, double atol, double reltol, double axtol, double relxtol, int maxiter) |
auto | mix_VLE_Tp (const AbstractModel &model, double T, double pgiven, const Eigen::ArrayXd &rhovecL0, const Eigen::ArrayXd &rhovecV0, const std::optional< MixVLETpFlags > &flags_=std::nullopt) |
auto | mixture_VLE_px (const AbstractModel &model, double p_spec, const Eigen::ArrayXd &xmolar_spec, double T0, const Eigen::ArrayXd &rhovecL0, const Eigen::ArrayXd &rhovecV0, const std::optional< MixVLEpxFlags > &flags_=std::nullopt) |
auto | get_drhovecdp_Tsat (const AbstractModel &model, const double &T, const Eigen::ArrayXd &rhovecL, const Eigen::ArrayXd &rhovecV) |
auto | get_drhovecdT_psat (const AbstractModel &model, const double &T, const Eigen::ArrayXd &rhovecL, const Eigen::ArrayXd &rhovecV) |
auto | get_drhovecdT_xsat (const AbstractModel &model, const double &T, const Eigen::ArrayXd &rhovecL, const Eigen::ArrayXd &rhovecV) |
template<typename Model = AbstractModel> | |
auto | get_dpsat_dTsat_isopleth (const Model &model, const double &T, const Eigen::ArrayXd &rhovecL, const Eigen::ArrayXd &rhovecV) |
Derivative of pressure w.r.t. temperature along the isopleth of a phase envelope (at constant composition of the bulk phase with the first concentration array) | |
auto | trace_VLE_isotherm_binary (const AbstractModel &model, double T, const Eigen::ArrayXd &rhovecL0, const Eigen::ArrayXd &rhovecV0, const std::optional< TVLEOptions > &options=std::nullopt) |
template<typename Model = AbstractModel> | |
auto | trace_VLE_isobar_binary (const Model &model, double p, double T0, const Eigen::ArrayXd &rhovecL0, const Eigen::ArrayXd &rhovecV0, const std::optional< PVLEOptions > &options=std::nullopt) |
template<typename TemplatedModel , typename ... Params, typename = typename std::enable_if<not std::is_base_of<teqp::cppinterface::AbstractModel, TemplatedModel>::value>::type> | |
auto | trace_VLE_isobar_binary (const TemplatedModel &model, Params &&... params) |
template<typename TemplatedModel , typename ... Params, typename = typename std::enable_if<not std::is_base_of<teqp::cppinterface::AbstractModel, TemplatedModel>::value>::type> | |
auto | trace_VLE_isotherm_binary (const TemplatedModel &model, Params &&... params) |
template<typename TemplatedModel , typename ... Params, typename = typename std::enable_if<not std::is_base_of<teqp::cppinterface::AbstractModel, TemplatedModel>::value>::type> | |
auto | get_dpsat_dTsat_isopleth (const TemplatedModel &model, Params &&... params) |
template<typename TemplatedModel , typename ... Params, typename = typename std::enable_if<not std::is_base_of<teqp::cppinterface::AbstractModel, TemplatedModel>::value>::type> | |
auto | get_drhovecdT_xsat (const TemplatedModel &model, Params &&... params) |
template<typename TemplatedModel , typename ... Params, typename = typename std::enable_if<not std::is_base_of<teqp::cppinterface::AbstractModel, TemplatedModel>::value>::type> | |
auto | get_drhovecdT_psat (const TemplatedModel &model, Params &&... params) |
template<typename TemplatedModel , typename ... Params, typename = typename std::enable_if<not std::is_base_of<teqp::cppinterface::AbstractModel, TemplatedModel>::value>::type> | |
auto | get_drhovecdp_Tsat (const TemplatedModel &model, Params &&... params) |
template<typename TemplatedModel , typename ... Params, typename = typename std::enable_if<not std::is_base_of<teqp::cppinterface::AbstractModel, TemplatedModel>::value>::type> | |
auto | trace_critical_arclength_binary (const TemplatedModel &model, Params &&... params) |
template<typename TemplatedModel , typename ... Params, typename = typename std::enable_if<not std::is_base_of<teqp::cppinterface::AbstractModel, TemplatedModel>::value>::type> | |
auto | mixture_VLE_px (const TemplatedModel &model, Params &&... params) |
template<typename TemplatedModel , typename ... Params, typename = typename std::enable_if<not std::is_base_of<teqp::cppinterface::AbstractModel, TemplatedModel>::value>::type> | |
auto | mix_VLE_Tp (const TemplatedModel &model, Params &&... params) |
template<typename TemplatedModel , typename ... Params, typename = typename std::enable_if<not std::is_base_of<teqp::cppinterface::AbstractModel, TemplatedModel>::value>::type> | |
auto | mix_VLE_Tx (const TemplatedModel &model, Params &&... params) |
template<typename Residual , typename Scalar = double> | |
auto | do_pure_VLE_T (Residual &resid, Scalar rhoL, Scalar rhoV, int maxiter) |
auto | pure_VLE_T (const teqp::cppinterface::AbstractModel &model, double T, double rhoL, double rhoV, int maxiter, const std::optional< Eigen::ArrayXd > &molefracs=std::nullopt) |
auto | dpsatdT_pure (const teqp::cppinterface::AbstractModel &model, double T, double rhoL, double rhoV, const std::optional< Eigen::ArrayXd > &molefracs=std::nullopt) |
auto | pure_trace_VLE (const teqp::cppinterface::AbstractModel &model, const double T, const nlohmann::json &spec) |
template<typename TemplatedModel , typename ... Params, typename = typename std::enable_if<is_not_AbstractModel<TemplatedModel>::value>::type> | |
auto | dpsatdT_pure (const TemplatedModel &model, Params &&... params) |
template<typename TemplatedModel , typename ... Params, typename = typename std::enable_if<is_not_AbstractModel<TemplatedModel>::value>::type> | |
auto | pure_VLE_T (const TemplatedModel &model, Params &&... params) |
template<typename TemplatedModel , typename ... Params, typename = typename std::enable_if<is_not_AbstractModel<TemplatedModel>::value>::type> | |
auto | pure_trace_VLE (const TemplatedModel &model, Params &&... params) |
template<typename NumType > | |
auto | get_R_gas () |
< Gas constant, according to CODATA 2019, in the given number type | |
template<typename TType , typename ContainerType , typename FuncType > | |
ContainerType::value_type | derivT (const FuncType &f, TType T, const ContainerType &rho) |
Given a function, use complex step derivatives to calculate the derivative with respect to the first variable which here is temperature. | |
template<typename TType , typename ContainerType , typename FuncType , typename Integer > | |
ContainerType::value_type | derivrhoi (const FuncType &f, TType T, const ContainerType &rho, Integer i) |
Given a function, use complex step derivatives to calculate the derivative with respect to the given composition variable. | |
template<typename T , size_t ... I> | |
auto | build_duplicated_tuple_impl (const T &val, std::index_sequence< I... >) |
template<int N, typename T > | |
auto | build_duplicated_tuple (const T &val) |
A function to generate a tuple of N repeated copies of argument val at compile-time. | |
nlohmann::json | CoolProp2teqp_alphaig_term_reformatter (const nlohmann::json &term, double Tri, double rhori, double R) |
nlohmann::json | convert_CoolProp_idealgas (const std::string &s, int index) |
Convert the ideal-gas term for a term from CoolProp-formatted JSON structure. | |
nlohmann::json | load_a_JSON_file (const std::string &path) |
Load a JSON file from a specified file. | |
void | JSON_to_file (const nlohmann::json &jsondata, const std::string &path) |
auto | all_same_length (const nlohmann::json &j, const std::vector< std::string > &ks) |
auto | multilevel_JSON_load (const nlohmann::json &j, const std::optional< std::string > &default_path=std::nullopt) |
template<int Nderiv, int Norder, typename Function , typename Scalar > | |
auto | centered_diff (const Function &f, const Scalar x, const Scalar h) |
template<typename Function , typename Scalarx , typename Scalary > | |
auto | centered_diff_xy (const Function &f, const Scalarx x, const Scalary y, const Scalarx dx, const Scalary dy) |
template<typename Function , typename Vec , typename Scalar > | |
auto | gradient_forward (const Function &f, const Vec &x, Scalar h) |
template<typename A > | |
auto | POW2 (const A &x) |
template<typename A > | |
auto | POW3 (const A &x) |
template<typename A > | |
auto | POW4 (const A &x) |
template<typename A > | |
auto | POW5 (const A &x) |
template<typename A > | |
auto | POW7 (const A &x) |
template<typename A > | |
auto | POW8 (const A &x) |
template<typename A > | |
auto | POW10 (const A &x) |
template<typename A > | |
auto | POW12 (const A &x) |
template<int N, typename T , typename Double = double> | |
auto | quad (const std::function< T(Double)> &F, const Double &a, const Double &b) |
template<typename TC > | |
auto | build_alpha_functions (const TC &Tc_K, const nlohmann::json &jalphas) |
template<typename TCType , typename PCType , typename AcentricType > | |
auto | canonical_SRK (TCType Tc_K, PCType pc_Pa, AcentricType acentric, const std::optional< Eigen::ArrayXXd > &kmat=std::nullopt, const std::optional< double > R_JmolK=std::nullopt) |
auto | make_canonicalSRK (const nlohmann::json &spec) |
A JSON-based factory function for the canonical SRK model. | |
template<typename TCType , typename PCType , typename AcentricType > | |
auto | canonical_PR (TCType Tc_K, PCType pc_Pa, AcentricType acentric, const std::optional< Eigen::ArrayXXd > &kmat=std::nullopt, const std::optional< double > R_JmolK=std::nullopt) |
auto | make_canonicalPR (const nlohmann::json &spec) |
A JSON-based factory function for the canonical SRK model. | |
auto | make_generalizedcubic (const nlohmann::json &spec) |
A JSON-based factory function for the generalized cubic + alpha. | |
NLOHMANN_JSON_SERIALIZE_ENUM (AdvancedPRaEMixingRules, { {AdvancedPRaEMixingRules::knotspecified, nullptr}, {AdvancedPRaEMixingRules::kLinear, "Linear"}, {AdvancedPRaEMixingRules::kQuadratic, "Quadratic"}, }) struct AdvancedPRaEOptions | |
void | from_json (const json &j, AdvancedPRaEOptions &o) |
auto | make_AdvancedPRaEres (const nlohmann::json &j) |
auto | build_LJ126_TholJPCRD2016 () |
auto | get_departure_json (const std::string &name, const std::string &path) |
auto | build_departure_function (const nlohmann::json &j) |
auto | get_departure_function_matrix (const nlohmann::json &depcollection, const nlohmann::json &BIPcollection, const std::vector< std::string > &components, const nlohmann::json &flags) |
auto | get_EOS_terms (const nlohmann::json &j) |
auto | get_EOSs (const std::vector< nlohmann::json > &pureJSON) |
auto | collect_component_json (const std::vector< std::string > &components, const std::string &root) |
auto | collect_identifiers (const std::vector< nlohmann::json > &pureJSON) |
template<typename mapvecstring > | |
auto | select_identifier (const nlohmann::json &BIPcollection, const mapvecstring &identifierset, const nlohmann::json &flags) |
Iterate over the possible options for identifiers to determine which one will satisfy all the binary pairs. | |
auto | build_alias_map (const std::string &root) |
Build a reverse-lookup map for finding a fluid JSON structure given a backup identifier. | |
auto | _build_multifluid_model (const std::vector< nlohmann::json > &pureJSON, const nlohmann::json &BIPcollection, const nlohmann::json &depcollection, const nlohmann::json &flags={}) |
Internal method for actually constructing the model with the provided JSON data structures. | |
auto | build_multifluid_JSONstr (const std::vector< std::string > &componentJSON, const std::string &BIPJSON, const std::string &departureJSON, const nlohmann::json &flags={}) |
A builder function where the JSON-formatted strings are provided explicitly rather than file paths. | |
auto | make_pure_components_JSON (const nlohmann::json &components, const std::optional< std::string > &root=std::nullopt) |
auto | build_multifluid_model (const std::vector< std::string > &components, const std::string &root, const std::string &BIPcollectionpath={}, const nlohmann::json &flags={}, const std::string &departurepath={}) |
auto | multifluidfactory (const nlohmann::json &spec) |
Load a model from a JSON data structure. | |
auto | multifluidfactory (const std::string &specstring) |
An overload of multifluidfactory that takes in a string. | |
template<class Model > | |
auto | build_multifluid_ecs_mutant (const Model &model, const nlohmann::json &jj) |
template<class Model > | |
auto | build_multifluid_mutant (const Model &model, const nlohmann::json &jj) |
template<typename T > | |
T | pow2 (const T &x) |
template<typename T > | |
T | pow3 (const T &x) |
auto | toeig (const std::vector< double > &v) -> Eigen::ArrayXd |
template<typename T > | |
auto | forceeval (T &&expr) |
template<typename T > | |
void | error_if_expr (T &&) |
template<typename T > | |
auto | getbaseval (const T &expr) |
template<typename T > | |
T | powi (const T &x, int n) |
From Ulrich Deiters. | |
template<typename T > | |
auto | powIVi (const T &x, const Eigen::ArrayXi &e) |
template<typename T > | |
auto | powIVd (const T &x, const Eigen::ArrayXd &e) |
auto | pow (const double &x, const double &e) |
auto | pow (const double &x, const int &e) |
template<typename T > | |
auto | pow (const std::complex< T > &x, const Eigen::ArrayXd &e) |
auto | contiguous_dotproduct (const auto &x, const auto &y) |
Take the dot-product of two vector-like objects that have contiguous memory and support the .size() method. | |
Variables | |
auto | build_square_matrix |
Type-agnostic methods for carrying out fixed quadrature with definite integrals
General routines for the calculation of association
The implementation follows the approach of Langenbach for the index compression,
Many helpful hints from Andres Riedemann
The name of this file is currently a bit of a misnomer while we think about whether it is possible to forward-declare the models
It seems like perhaps that is not possible. For now this header just provides the main variant with the model definitions.
This header contains methods that pertain to polar contributions to SAFT models
Initially the contribution of Gross and Vrabec were implemented for PC-SAFT, but they can be used with other non-polar base models as well, so this header collects all the things in one place
using teqp::advancedPRaEres_t = decltype(make_AdvancedPRaEres({})) |
Definition at line 668 of file cubics.hpp.
using teqp::AlphaFunctionOptions = std::variant<BasicAlphaFunction<double>, TwuAlphaFunction<double>, MathiasCopemanAlphaFunction<double>> |
Definition at line 97 of file cubics.hpp.
using teqp::ammonia_water_TillnerRoth_t = AmmoniaWaterTillnerRoth |
using teqp::canonical_cubic_t = decltype(canonical_PR(vad{}, vad{}, vad{})) |
using teqp::CPA_t = decltype(CPA::CPAfactory(nlohmann::json{})) |
using teqp::DepartureTerms = EOSTermContainer<JustPowerEOSTerm, PowerEOSTerm, GaussianEOSTerm, GERG2004EOSTerm, NullEOSTerm, DoubleExponentialEOSTerm,Chebyshev2DEOSTerm> |
Definition at line 461 of file multifluid_eosterms.hpp.
Definition at line 459 of file multifluid_eosterms.hpp.
using teqp::idealgas_t = IdealHelmholtz |
Definition at line 228 of file ideal_eosterms.hpp.
using teqp::is_AbstractModel = typename std::is_base_of<teqp::cppinterface::AbstractModel, Model> |
Definition at line 15 of file VLE_pure.hpp.
using teqp::is_not_AbstractModel = std::negation<is_AbstractModel<Model>> |
Definition at line 16 of file VLE_pure.hpp.
using teqp::IterationError = IterationFailure |
Definition at line 39 of file exceptions.hpp.
using teqp::multifluid_t = decltype(multifluidfactory(nlohmann::json{})) |
using teqp::multifluidmutant_t = decltype(build_multifluid_mutant(multifluidfactory(nlohmann::json{}), nlohmann::json{})) |
using teqp::PCSAFT_t = decltype(PCSAFT::PCSAFTfactory(nlohmann::json{})) |
using teqp::QuantumPR_t = QuantumCorrectedPR |
using teqp::ReducingFunctions = ReducingTermContainer<MultiFluidReducingFunction, MultiFluidInvariantReducingFunction> |
Definition at line 356 of file multifluid_reducing.hpp.
using teqp::RKPRCismondi2005_t = decltype(RKPRCismondi2005({})) |
Definition at line 922 of file cubics.hpp.
using teqp::SAFTVRMie_t = decltype(SAFTVRMie::SAFTVRMieMixture(vecs{})) |
using teqp::twocenterLJF_t = decltype(twocenterljf::build_two_center_model_dipole(std::string{}, double{}, double{})) |
using teqp::vdWEOS_t = vdWEOS<double> |
using teqp::vecs = std::vector<std::string> |
|
strong |
Enumerator | |
---|---|
autodiff |
Definition at line 92 of file derivs.hpp.
|
strong |
Enumerator | |
---|---|
knotspecified | |
kLinear | |
kQuadratic |
Definition at line 441 of file cubics.hpp.
|
strong |
Enumerator | |
---|---|
unset | |
xtol_satisfied | |
functol_satisfied | |
maxfev_met | |
maxiter_met | |
notfinite_step |
Definition at line 40 of file VLE_types.hpp.
|
inline |
Internal method for actually constructing the model with the provided JSON data structures.
Definition at line 891 of file multifluid.hpp.
|
inline |
Definition at line 39 of file json_tools.hpp.
|
inline |
Build a reverse-lookup map for finding a fluid JSON structure given a backup identifier.
Definition at line 850 of file multifluid.hpp.
auto teqp::build_alpha_functions | ( | const TC & | Tc_K, |
const nlohmann::json & | jalphas ) |
Definition at line 100 of file cubics.hpp.
|
inline |
Definition at line 227 of file multifluid.hpp.
auto teqp::build_duplicated_tuple | ( | const T & | val | ) |
A function to generate a tuple of N repeated copies of argument val at compile-time.
Definition at line 77 of file derivs.hpp.
auto teqp::build_duplicated_tuple_impl | ( | const T & | val, |
std::index_sequence< I... > | ) |
Helper function for build_duplicated_tuple See example here for the general concept https://en.cppreference.com/w/cpp/utility/integer_sequence
Definition at line 71 of file derivs.hpp.
|
inline |
The EOS of Monika Thol and colleagues. DOI:10.1063/1.4945000
Definition at line 13 of file lennardjones.hpp.
auto teqp::build_multifluid_ecs_mutant | ( | const Model & | model, |
const nlohmann::json & | jj ) |
Definition at line 167 of file multifluid_ecs_mutant.hpp.
|
inline |
A builder function where the JSON-formatted strings are provided explicitly rather than file paths.
Definition at line 941 of file multifluid.hpp.
|
inline |
Definition at line 1016 of file multifluid.hpp.
auto teqp::build_multifluid_mutant | ( | const Model & | model, |
const nlohmann::json & | jj ) |
Store the model spec in the adapted multifluid class
Definition at line 66 of file multifluid_mutant.hpp.
auto teqp::canonical_PR | ( | TCType | Tc_K, |
PCType | pc_Pa, | ||
AcentricType | acentric, | ||
const std::optional< Eigen::ArrayXXd > & | kmat = std::nullopt, | ||
const std::optional< double > | R_JmolK = std::nullopt ) |
Definition at line 300 of file cubics.hpp.
auto teqp::canonical_SRK | ( | TCType | Tc_K, |
PCType | pc_Pa, | ||
AcentricType | acentric, | ||
const std::optional< Eigen::ArrayXXd > & | kmat = std::nullopt, | ||
const std::optional< double > | R_JmolK = std::nullopt ) |
Definition at line 261 of file cubics.hpp.
auto teqp::centered_diff | ( | const Function & | f, |
const Scalar | x, | ||
const Scalar | h ) |
Routines for finite differentiation, useful for testing derivatives obtained by other methods
From: Bengt Fornberg, 1988, "Coefficients from Generation of Finite Difference Formulas on Arbitrarily Spaced Grids", MATHEMATICS OF COMPUTATION, v. 51, n. 184, pp. 699-706
Higher derivatives should always be done in extended precision mathematics!
Warning: these routines may give entirely erroneous results for double precision arithmetic, especially the higher derivatives
Warning: these routines are optimized for accuracy, not for speed or memory use
Definition at line 22 of file finite_derivs.hpp.
auto teqp::centered_diff_xy | ( | const Function & | f, |
const Scalarx | x, | ||
const Scalary | y, | ||
const Scalarx | dx, | ||
const Scalary | dy ) |
Definition at line 71 of file finite_derivs.hpp.
|
inline |
Definition at line 773 of file multifluid.hpp.
|
inline |
Definition at line 796 of file multifluid.hpp.
auto teqp::contiguous_dotproduct | ( | const auto & | x, |
const auto & | y ) |
|
inline |
Convert the ideal-gas term for a term from CoolProp-formatted JSON structure.
s | A string, pointing to a filesystem file, or the JSON contents to be parsed |
index | The index of the model to load, should be zero in general |
The key difference in the approach in CoolProp and teqp is that the contributions in teqp are based on temperature and density as the independent variables, whereas the implementation in CoolProp uses the pure fluid reciprocal reduced temperature and reduced density as independent variables
Definition at line 489 of file ideal_eosterms.hpp.
|
inline |
Definition at line 359 of file ideal_eosterms.hpp.
ContainerType::value_type teqp::derivrhoi | ( | const FuncType & | f, |
TType | T, | ||
const ContainerType & | rho, | ||
Integer | i ) |
Given a function, use complex step derivatives to calculate the derivative with respect to the given composition variable.
Definition at line 57 of file derivs.hpp.
ContainerType::value_type teqp::derivT | ( | const FuncType & | f, |
TType | T, | ||
const ContainerType & | rho ) |
Given a function, use complex step derivatives to calculate the derivative with respect to the first variable which here is temperature.
Definition at line 33 of file derivs.hpp.
auto teqp::do_pure_VLE_T | ( | Residual & | resid, |
Scalar | rhoL, | ||
Scalar | rhoV, | ||
int | maxiter ) |
Definition at line 107 of file VLE_pure.hpp.
|
inline |
Definition at line 255 of file VLE_pure.hpp.
|
inline |
Definition at line 158 of file VLE_pure.hpp.
void teqp::error_if_expr | ( | T && | ) |
|
inline |
Definition at line 212 of file critical_pure.hpp.
Eigen::Array< double, 2, 1 > teqp::extrapolate_from_critical | ( | const Model & | model, |
const Scalar & | Tc, | ||
const Scalar & | rhoc, | ||
const Scalar & | T, | ||
const std::optional< Eigen::ArrayXd > & | z = std::nullopt ) |
Definition at line 180 of file critical_pure.hpp.
|
inline |
Definition at line 456 of file cubics.hpp.
|
inline |
Definition at line 194 of file critical_pure.hpp.
Scalar teqp::get_Brho_critical_extrap | ( | const Model & | model, |
const Scalar & | Tc, | ||
const Scalar & | rhoc, | ||
const std::optional< Eigen::ArrayXd > & | z = std::nullopt ) |
Definition at line 159 of file critical_pure.hpp.
|
inline |
Definition at line 473 of file multifluid.hpp.
|
inline |
Definition at line 206 of file multifluid.hpp.
auto teqp::get_dpsat_dTsat_isopleth | ( | const Model & | model, |
const double & | T, | ||
const Eigen::ArrayXd & | rhovecL, | ||
const Eigen::ArrayXd & | rhovecV ) |
Derivative of pressure w.r.t. temperature along the isopleth of a phase envelope (at constant composition of the bulk phase with the first concentration array)
Express \(p(T,\rho,\vec x)\), so its total differential is
\[ dp = \left(\frac{\partial p}{\partial T}\right)_{T,\vec x}dT + \left(\frac{\partial p}{\partial \rho}\right)_{T,\vec x} d\rho + \sum_{k} \left(\frac{\partial p}{\partial x_k}\right)_{T,\rho,x_{j\neq k}} dx_k \]
And for the derivative taken along the phase envelope at constant composition (along an isopleth so the composition part drops out):
\[ \left(\frac{dp}{dT}\right)_{x, \sigma} = \left(\frac{\partial p}{\partial T}\right)_{T,\vec x}\frac{dT}{dT} + \left(\frac{\partial p}{\partial \rho}\right)_{T,\vec x} \left(\frac{d\rho}{dT}\right)_{\vec x,\sigma} \]
where
\[ \left(\frac{d\rho}{dT}\right)_{\vec x,\sigma} = \sum_k\left(\frac{d\rho_k}{dT}\right)_{\vec x,\sigma} \]
In the isochoric framework, a similar analysis would apply, which yields the identical result. Express \(p(T,\vec\rho)\), so its total differential is
\[ dp = \left(\frac{\partial p}{\partial T}\right)_{\vec\rho}dT + \sum_k \left(\frac{\partial p}{\partial \rho_k}\right)_{T,\rho_{j\neq k}} d\rho_k \]
And for the derivative taken along the phase envelope at constant composition (along an isopleth):
\[ \left(\frac{dp}{dT}\right)_{x, \sigma} = \left(\frac{\partial p}{\partial T}\right)_{\vec\rho}\frac{dT}{dT} + \sum_k \left(\frac{\partial p}{\partial \rho_k}\right)_{T,\rho_{j\neq k}} \left(\frac{\partial \rho_k}{\partial T}\right)_{x,\sigma} \]
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
lambda function for adding non-analytic terms
Definition at line 516 of file multifluid.hpp.
|
inline |
Definition at line 764 of file multifluid.hpp.
|
inline |
Calculate the criticality conditions for a pure fluid and its Jacobian w.r.t. the temperature and density for additional fine tuning with multi-variate rootfinding
Definition at line 22 of file critical_pure.hpp.
auto teqp::get_pure_critical_conditions_Jacobian | ( | const Model & | model, |
const Scalar | T, | ||
const Scalar | rho, | ||
const std::optional< std::size_t > & | alternative_pure_index = std::nullopt, | ||
const std::optional< std::size_t > & | alternative_length = std::nullopt ) |
Definition at line 83 of file critical_pure.hpp.
auto teqp::get_R_gas | ( | ) |
< Gas constant, according to CODATA 2019, in the given number type
< Boltzmann constant
< Avogadro's number
Definition at line 22 of file constants.hpp.
auto teqp::getbaseval | ( | const T & | expr | ) |
auto teqp::gradient_forward | ( | const Function & | f, |
const Vec & | x, | ||
Scalar | h ) |
Definition at line 76 of file finite_derivs.hpp.
|
inline |
Definition at line 34 of file json_tools.hpp.
auto teqp::linsolve | ( | const A & | a, |
const B & | b ) |
|
inline |
Load a JSON file from a specified file.
Definition at line 18 of file json_tools.hpp.
|
inline |
Definition at line 638 of file cubics.hpp.
|
inline |
A JSON-based factory function for the canonical SRK model.
Definition at line 335 of file cubics.hpp.
|
inline |
A JSON-based factory function for the canonical SRK model.
Definition at line 290 of file cubics.hpp.
|
inline |
A JSON-based factory function for the generalized cubic + alpha.
Definition at line 345 of file cubics.hpp.
|
inline |
There are 4 options:
Definition at line 963 of file multifluid.hpp.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Load a model from a JSON data structure.
Required fields are: components, BIP. The departure field is optional
BIP and departure can be either the data in JSON format, or a path to file with those contents components is an array, which either contains the paths to the JSON data, or the file path
Definition at line 1038 of file multifluid.hpp.
|
inline |
An overload of multifluidfactory that takes in a string.
Definition at line 1105 of file multifluid.hpp.
|
inline |
A method for loading something from a nlohmann::json node. Thing to be operated on can be:
0. empty, in which case the file at the default_path is loaded
Definition at line 82 of file json_tools.hpp.
auto teqp::NewtonRaphson | ( | Callable | f, |
const Inputs & | args, | ||
double | tol ) |
Definition at line 6 of file rootfinding.hpp.
teqp::NLOHMANN_JSON_SERIALIZE_ENUM | ( | AdvancedPRaEMixingRules | , |
{ {AdvancedPRaEMixingRules::knotspecified, nullptr}, {AdvancedPRaEMixingRules::kLinear, "Linear"}, {AdvancedPRaEMixingRules::kQuadratic, "Quadratic"}, } | ) |
Definition at line 443 of file cubics.hpp.
|
inline |
auto teqp::pow | ( | const std::complex< T > & | x, |
const Eigen::ArrayXd & | e ) |
auto teqp::POW10 | ( | const A & | x | ) |
Definition at line 11 of file pow_templates.hpp.
auto teqp::POW12 | ( | const A & | x | ) |
Definition at line 12 of file pow_templates.hpp.
auto teqp::POW2 | ( | const A & | x | ) |
Definition at line 5 of file pow_templates.hpp.
auto teqp::POW3 | ( | const A & | x | ) |
Definition at line 6 of file pow_templates.hpp.
auto teqp::POW4 | ( | const A & | x | ) |
Definition at line 7 of file pow_templates.hpp.
auto teqp::POW5 | ( | const A & | x | ) |
Definition at line 8 of file pow_templates.hpp.
auto teqp::POW7 | ( | const A & | x | ) |
Definition at line 9 of file pow_templates.hpp.
auto teqp::POW8 | ( | const A & | x | ) |
Definition at line 10 of file pow_templates.hpp.
T teqp::powi | ( | const T & | x, |
int | n ) |
|
inline |
|
inline |
|
inline |
Definition at line 255 of file VLE_pure.hpp.
|
inline |
Definition at line 184 of file VLE_pure.hpp.
|
inline |
Definition at line 255 of file VLE_pure.hpp.
|
inline |
Definition at line 138 of file VLE_pure.hpp.
|
inline |
Gauss-Legendre quadrature for a function f(x) in the interval [a,b]
More coefficients here if needed: https://pomax.github.io/bezierinfo/legendre-gauss.html
Definition at line 16 of file quadrature.hpp.
|
inline |
Iterate over the possible options for identifiers to determine which one will satisfy all the binary pairs.
Definition at line 821 of file multifluid.hpp.
|
inline |
Definition at line 125 of file critical_pure.hpp.
auto teqp::solve_pure_critical | ( | const Model & | model, |
const Scalar | T0, | ||
const Scalar | rho0, | ||
const std::optional< nlohmann::json > & | flags = std::nullopt ) |
Definition at line 92 of file critical_pure.hpp.
|
inline |
|
inline |
auto teqp::trace_VLE_isobar_binary | ( | const Model & | model, |
double | p, | ||
double | T0, | ||
const Eigen::ArrayXd & | rhovecL0, | ||
const Eigen::ArrayXd & | rhovecV0, | ||
const std::optional< PVLEOptions > & | options = std::nullopt ) |
|
inline |
|
inline |
|
inline |
|
inline |
Definition at line 45 of file json_tools.hpp.