teqp 0.22.0
Loading...
Searching...
No Matches
teqp Namespace Reference

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
 

Classes

class  AdvancedPRaEres
 
class  BasicAlphaFunction
 The standard alpha function used by Peng-Robinson and SRK. More...
 
class  Chebyshev2DEOSTerm
 
class  CorrespondingStatesContribution
 
struct  CriticalTracing
 
class  DepartureContribution
 
class  DerivativeHolderSquare
 
class  DoubleExponentialEOSTerm
 
struct  EigenData
 
class  EOSTermContainer
 
class  ExponentialEOSTerm
 
struct  Functor
 
class  GaoBEOSTerm
 
class  GaussianEOSTerm
 
class  GenericCubic
 
class  GenericCubicTerm
 
class  GERG2004EOSTerm
 
struct  hybrj_functor__mix_VLE_Tp
 
class  IdealHelmholtz
 Ideal-gas Helmholtz energy container. More...
 
class  IdealHelmholtzConstant
 
class  IdealHelmholtzCp0Constant
 
class  IdealHelmholtzCp0PowerT
 
class  IdealHelmholtzGERG2004Cosh
 
class  IdealHelmholtzGERG2004Sinh
 
class  IdealHelmholtzLead
 
class  IdealHelmholtzLogT
 
class  IdealHelmholtzPlanckEinstein
 
class  IdealHelmholtzPlanckEinsteinGeneralized
 
class  IdealHelmholtzPowerT
 
class  InvalidArgument
 
class  InvalidValue
 
struct  is_complex_t
 
struct  is_complex_t< std::complex< T > >
 
struct  is_container
 
struct  is_container< std::valarray< Ts... > >
 
struct  is_container< std::vector< Ts... > >
 
struct  is_eigen_impl
 
struct  is_eigen_impl< Eigen::Array< T, Is... > >
 
struct  is_eigen_impl< Eigen::Matrix< T, Is... > >
 
struct  is_mcx_t
 
struct  IsochoricDerivatives
 
class  IsothermPureVLEResiduals
 
class  IterationFailure
 
class  JSONValidationError
 Validation of a JSON schema failed. More...
 
class  JSONValidator
 
class  JustPowerEOSTerm
 
class  Lemmon2005EOSTerm
 
class  MathiasCopemanAlphaFunction
 The Mathias-Copeman alpha function used by Peng-Robinson and SRK. More...
 
struct  MixVLEpxFlags
 
struct  MixVLEReturn
 
struct  MixVLETpFlags
 
class  ModelContainer
 
class  MultiFluid
 
class  MultiFluidAdapter
 
class  MultiFluidAdapter_Ecs
 
class  MultiFluidInvariantReducingFunction
 
class  MultifluidPlusAssociation
 
class  MultiFluidReducingFunction
 
struct  MultiFluidVLEAncillaries
 
class  NonAnalyticEOSTerm
 
class  NotImplementedError
 
class  NullEOSTerm
 
class  PCSAFTGrossSadowski2001Term
 
class  PowerEOSTerm
 
class  PureIdealHelmholtz
 
struct  PVLEOptions
 
class  QuantumCorrectedPR
 
class  Reducing_ECS
 
class  ReducingTermContainer
 
class  RKPRCismondi2005
 
struct  TCABOptions
 
struct  TDXDerivatives
 
class  teqpcException
 
class  teqpException
 
class  Timer
 
struct  TVLEOptions
 
class  TwuAlphaFunction
 The Twu alpha function used by Peng-Robinson and SRK. More...
 
class  vdWEOS
 A slightly more involved implementation of van der Waals, this time with mixture properties. More...
 
class  vdWEOS1
 A (very) simple implementation of the van der Waals EOS. More...
 
struct  VirialDerivatives
 
struct  VLEAncillary
 
struct  wrt_helper
 

Concepts

concept  CallableAlpha
 
concept  CallableAlphar
 
concept  CallableAlpharTauDelta
 

Typedefs

template<typename Model >
using is_AbstractModel = typename std::is_base_of<teqp::cppinterface::AbstractModel, Model>
 
template<typename Model >
using is_not_AbstractModel = std::negation<is_AbstractModel<Model>>
 
using IterationError = IterationFailure
 
using IdealHelmholtzTerms
 
using AlphaFunctionOptions = std::variant<BasicAlphaFunction<double>, TwuAlphaFunction<double>, MathiasCopemanAlphaFunction<double>>
 
using advancedPRaEres_t = decltype(make_AdvancedPRaEres({}))
 
using RKPRCismondi2005_t = decltype(RKPRCismondi2005({}))
 
using vad = std::valarray<double>
 
using vecs = std::vector<std::string>
 
using canonical_cubic_t = decltype(canonical_PR(vad{}, vad{}, vad{}))
 
using PCSAFT_t = decltype(PCSAFT::PCSAFTfactory(nlohmann::json{}))
 
using SAFTVRMie_t = decltype(SAFTVRMie::SAFTVRMieMixture(vecs{}))
 
using CPA_t = decltype(CPA::CPAfactory(nlohmann::json{}))
 
using multifluid_t = decltype(multifluidfactory(nlohmann::json{}))
 
using multifluidmutant_t = decltype(build_multifluid_mutant(multifluidfactory(nlohmann::json{}), nlohmann::json{}))
 
using ammonia_water_TillnerRoth_t = AmmoniaWaterTillnerRoth
 
using SW_EspindolaHeredia2009_t = squarewell::EspindolaHeredia2009
 
using EXP6_Kataoka1992_t = exp6::Kataoka1992
 
using vdWEOS_t = vdWEOS<double>
 
using twocenterLJF_t = decltype(twocenterljf::build_two_center_model_dipole(std::string{}, double{}, double{}))
 
using LJ126KolafaNezbeda1994_t = LJ126KolafaNezbeda1994
 
using LJ126Johnson1993_t = LJ126Johnson1993
 
using Mie6Pohl2023_t = Mie::Mie6Pohl2023
 
using QuantumPR_t = QuantumCorrectedPR
 
using idealgas_t = IdealHelmholtz
 
using EOSTerms = EOSTermContainer<JustPowerEOSTerm, PowerEOSTerm, GaussianEOSTerm, NonAnalyticEOSTerm, Lemmon2005EOSTerm, GaoBEOSTerm, ExponentialEOSTerm, DoubleExponentialEOSTerm, GenericCubicTerm, PCSAFTGrossSadowski2001Term>
 
using DepartureTerms = EOSTermContainer<JustPowerEOSTerm, PowerEOSTerm, GaussianEOSTerm, GERG2004EOSTerm, NullEOSTerm, DoubleExponentialEOSTerm,Chebyshev2DEOSTerm>
 
using ReducingFunctions = ReducingTermContainer<MultiFluidReducingFunction, MultiFluidInvariantReducingFunction>
 

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 >
pow2 (const T &x)
 
template<typename 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 >
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
 

Detailed Description

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

Typedef Documentation

◆ advancedPRaEres_t

Definition at line 668 of file cubics.hpp.

◆ AlphaFunctionOptions

Definition at line 97 of file cubics.hpp.

◆ ammonia_water_TillnerRoth_t

using teqp::ammonia_water_TillnerRoth_t = AmmoniaWaterTillnerRoth

Definition at line 45 of file fwd.hpp.

◆ canonical_cubic_t

using teqp::canonical_cubic_t = decltype(canonical_PR(vad{}, vad{}, vad{}))

Definition at line 39 of file fwd.hpp.

◆ CPA_t

using teqp::CPA_t = decltype(CPA::CPAfactory(nlohmann::json{}))

Definition at line 42 of file fwd.hpp.

◆ DepartureTerms

◆ EOSTerms

◆ EXP6_Kataoka1992_t

Definition at line 47 of file fwd.hpp.

◆ idealgas_t

Definition at line 55 of file fwd.hpp.

◆ IdealHelmholtzTerms

Initial value:
std::variant <
IdealHelmholtzConstant,
IdealHelmholtzLead,
IdealHelmholtzLogT,
IdealHelmholtzPowerT,
IdealHelmholtzPlanckEinstein,
IdealHelmholtzPlanckEinsteinGeneralized,
IdealHelmholtzGERG2004Cosh,
IdealHelmholtzGERG2004Sinh,
IdealHelmholtzCp0Constant,
IdealHelmholtzCp0PowerT
>

Definition at line 228 of file ideal_eosterms.hpp.

◆ is_AbstractModel

template<typename Model >
using teqp::is_AbstractModel = typename std::is_base_of<teqp::cppinterface::AbstractModel, Model>

Definition at line 15 of file VLE_pure.hpp.

◆ is_not_AbstractModel

template<typename Model >
using teqp::is_not_AbstractModel = std::negation<is_AbstractModel<Model>>

Definition at line 16 of file VLE_pure.hpp.

◆ IterationError

Definition at line 39 of file exceptions.hpp.

◆ LJ126Johnson1993_t

Definition at line 51 of file fwd.hpp.

◆ LJ126KolafaNezbeda1994_t

Definition at line 50 of file fwd.hpp.

◆ Mie6Pohl2023_t

Definition at line 52 of file fwd.hpp.

◆ multifluid_t

using teqp::multifluid_t = decltype(multifluidfactory(nlohmann::json{}))

Definition at line 43 of file fwd.hpp.

◆ multifluidmutant_t

using teqp::multifluidmutant_t = decltype(build_multifluid_mutant(multifluidfactory(nlohmann::json{}), nlohmann::json{}))

Definition at line 44 of file fwd.hpp.

◆ PCSAFT_t

using teqp::PCSAFT_t = decltype(PCSAFT::PCSAFTfactory(nlohmann::json{}))

Definition at line 40 of file fwd.hpp.

◆ QuantumPR_t

Definition at line 53 of file fwd.hpp.

◆ ReducingFunctions

◆ RKPRCismondi2005_t

Definition at line 922 of file cubics.hpp.

◆ SAFTVRMie_t

Definition at line 41 of file fwd.hpp.

◆ SW_EspindolaHeredia2009_t

◆ twocenterLJF_t

using teqp::twocenterLJF_t = decltype(twocenterljf::build_two_center_model_dipole(std::string{}, double{}, double{}))

Definition at line 49 of file fwd.hpp.

◆ vad

using teqp::vad = std::valarray<double>

Definition at line 34 of file fwd.hpp.

◆ vdWEOS_t

using teqp::vdWEOS_t = vdWEOS<double>

Definition at line 48 of file fwd.hpp.

◆ vecs

using teqp::vecs = std::vector<std::string>

Definition at line 35 of file fwd.hpp.

Enumeration Type Documentation

◆ ADBackends

enum class teqp::ADBackends
strong
Enumerator
autodiff 

Definition at line 92 of file derivs.hpp.

◆ AdvancedPRaEMixingRules

enum class teqp::AdvancedPRaEMixingRules
strong
Enumerator
knotspecified 
kLinear 
kQuadratic 

Definition at line 441 of file cubics.hpp.

◆ VLE_return_code

enum class teqp::VLE_return_code
strong
Enumerator
unset 
xtol_satisfied 
functol_satisfied 
maxfev_met 
maxiter_met 
notfinite_step 

Definition at line 40 of file VLE_types.hpp.

Function Documentation

◆ _build_multifluid_model()

auto teqp::_build_multifluid_model ( const std::vector< nlohmann::json > & pureJSON,
const nlohmann::json & BIPcollection,
const nlohmann::json & depcollection,
const nlohmann::json & flags = {} )
inline

Internal method for actually constructing the model with the provided JSON data structures.

Definition at line 891 of file multifluid.hpp.

◆ all_same_length()

auto teqp::all_same_length ( const nlohmann::json & j,
const std::vector< std::string > & ks )
inline

Definition at line 39 of file json_tools.hpp.

◆ build_alias_map()

auto teqp::build_alias_map ( const std::string & root)
inline

Build a reverse-lookup map for finding a fluid JSON structure given a backup identifier.

Definition at line 850 of file multifluid.hpp.

◆ build_alpha_functions()

template<typename TC >
auto teqp::build_alpha_functions ( const TC & Tc_K,
const nlohmann::json & jalphas )

Definition at line 100 of file cubics.hpp.

◆ build_departure_function()

auto teqp::build_departure_function ( const nlohmann::json & j)
inline

Definition at line 227 of file multifluid.hpp.

◆ build_duplicated_tuple()

template<int N, typename T >
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.

◆ build_duplicated_tuple_impl()

template<typename T , size_t ... I>
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.

◆ build_LJ126_TholJPCRD2016()

auto teqp::build_LJ126_TholJPCRD2016 ( )
inline

The EOS of Monika Thol and colleagues. DOI:10.1063/1.4945000

Definition at line 13 of file lennardjones.hpp.

◆ build_multifluid_ecs_mutant()

template<class Model >
auto teqp::build_multifluid_ecs_mutant ( const Model & model,
const nlohmann::json & jj )

Definition at line 167 of file multifluid_ecs_mutant.hpp.

◆ build_multifluid_JSONstr()

auto teqp::build_multifluid_JSONstr ( const std::vector< std::string > & componentJSON,
const std::string & BIPJSON,
const std::string & departureJSON,
const nlohmann::json & flags = {} )
inline

A builder function where the JSON-formatted strings are provided explicitly rather than file paths.

Definition at line 941 of file multifluid.hpp.

◆ build_multifluid_model()

auto teqp::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 = {} )
inline

Definition at line 1016 of file multifluid.hpp.

◆ build_multifluid_mutant()

template<class Model >
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.

◆ canonical_PR()

template<typename TCType , typename PCType , typename AcentricType >
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.

◆ canonical_SRK()

template<typename TCType , typename PCType , typename AcentricType >
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.

◆ centered_diff()

template<int Nderiv, int Norder, typename Function , typename Scalar >
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.

◆ centered_diff_xy()

template<typename Function , typename Scalarx , typename Scalary >
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.

◆ collect_component_json()

auto teqp::collect_component_json ( const std::vector< std::string > & components,
const std::string & root )
inline

Definition at line 773 of file multifluid.hpp.

◆ collect_identifiers()

auto teqp::collect_identifiers ( const std::vector< nlohmann::json > & pureJSON)
inline

Definition at line 796 of file multifluid.hpp.

◆ contiguous_dotproduct()

auto teqp::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.

This allows to mix and match 1D Eigen arrays and vectors and STL vectors

Definition at line 235 of file types.hpp.

◆ convert_CoolProp_idealgas()

nlohmann::json teqp::convert_CoolProp_idealgas ( const std::string & s,
int index )
inline

Convert the ideal-gas term for a term from CoolProp-formatted JSON structure.

Parameters
sA string, pointing to a filesystem file, or the JSON contents to be parsed
indexThe index of the model to load, should be zero in general
Returns
j The JSON

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.

◆ CoolProp2teqp_alphaig_term_reformatter()

nlohmann::json teqp::CoolProp2teqp_alphaig_term_reformatter ( const nlohmann::json & term,
double Tri,
double rhori,
double R )
inline

Definition at line 359 of file ideal_eosterms.hpp.

◆ derivrhoi()

template<typename TType , typename ContainerType , typename FuncType , typename Integer >
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.

◆ derivT()

template<typename TType , typename ContainerType , typename FuncType >
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.

◆ do_pure_VLE_T()

template<typename Residual , typename Scalar = double>
auto teqp::do_pure_VLE_T ( Residual & resid,
Scalar rhoL,
Scalar rhoV,
int maxiter )

Definition at line 107 of file VLE_pure.hpp.

◆ dpsatdT_pure() [1/2]

template<typename TemplatedModel , typename ... Params, typename = typename std::enable_if<is_not_AbstractModel<TemplatedModel>::value>::type>
auto teqp::dpsatdT_pure ( const TemplatedModel & model,
Params &&... params )
inline

Definition at line 255 of file VLE_pure.hpp.

◆ dpsatdT_pure() [2/2]

auto teqp::dpsatdT_pure ( const teqp::cppinterface::AbstractModel & model,
double T,
double rhoL,
double rhoV,
const std::optional< Eigen::ArrayXd > & molefracs = std::nullopt )
inline

Definition at line 158 of file VLE_pure.hpp.

◆ error_if_expr()

template<typename T >
void teqp::error_if_expr ( T && )

A constexpr function for ensuring that an argument to a function is NOT an expr, which can have surprising behavior

Definition at line 69 of file types.hpp.

◆ extrapolate_from_critical() [1/2]

auto teqp::extrapolate_from_critical ( const AbstractModel & model,
const double & Tc,
const double & rhoc,
const double & T,
const std::optional< Eigen::ArrayXd > & z = std::nullopt )
inline

Definition at line 212 of file critical_pure.hpp.

◆ extrapolate_from_critical() [2/2]

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 > 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.

◆ forceeval()

template<typename T >
auto teqp::forceeval ( T && expr)

Definition at line 52 of file types.hpp.

◆ from_json()

void teqp::from_json ( const json & j,
AdvancedPRaEOptions & o )
inline

Definition at line 456 of file cubics.hpp.

◆ get_Brho_critical_extrap() [1/2]

double teqp::get_Brho_critical_extrap ( const AbstractModel & model,
const double & Tc,
const double & rhoc,
const std::optional< Eigen::ArrayXd > & z = std::nullopt )
inline

Definition at line 194 of file critical_pure.hpp.

◆ get_Brho_critical_extrap() [2/2]

template<typename Model , typename Scalar , typename = typename std::enable_if<not std::is_base_of<teqp::cppinterface::AbstractModel, Model>::value>::type>
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.

◆ get_departure_function_matrix()

auto teqp::get_departure_function_matrix ( const nlohmann::json & depcollection,
const nlohmann::json & BIPcollection,
const std::vector< std::string > & components,
const nlohmann::json & flags )
inline

Definition at line 473 of file multifluid.hpp.

◆ get_departure_json()

auto teqp::get_departure_json ( const std::string & name,
const std::string & path )
inline

Definition at line 206 of file multifluid.hpp.

◆ get_dpsat_dTsat_isopleth() [1/2]

template<typename Model = AbstractModel>
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} \]

Definition at line 764 of file VLE.hpp.

◆ get_dpsat_dTsat_isopleth() [2/2]

template<typename TemplatedModel , typename ... Params, typename = typename std::enable_if<not std::is_base_of<teqp::cppinterface::AbstractModel, TemplatedModel>::value>::type>
auto teqp::get_dpsat_dTsat_isopleth ( const TemplatedModel & model,
Params &&... params )
inline

Definition at line 1305 of file VLE.hpp.

◆ get_drhovecdp_Tsat() [1/2]

auto teqp::get_drhovecdp_Tsat ( const AbstractModel & model,
const double & T,
const Eigen::ArrayXd & rhovecL,
const Eigen::ArrayXd & rhovecV )
inline

Definition at line 524 of file VLE.hpp.

◆ get_drhovecdp_Tsat() [2/2]

template<typename TemplatedModel , typename ... Params, typename = typename std::enable_if<not std::is_base_of<teqp::cppinterface::AbstractModel, TemplatedModel>::value>::type>
auto teqp::get_drhovecdp_Tsat ( const TemplatedModel & model,
Params &&... params )
inline

Definition at line 1305 of file VLE.hpp.

◆ get_drhovecdT_psat() [1/2]

auto teqp::get_drhovecdT_psat ( const AbstractModel & model,
const double & T,
const Eigen::ArrayXd & rhovecL,
const Eigen::ArrayXd & rhovecV )
inline

Derivative of molar concentration vectors w.r.t. p along an isobar of the phase envelope for binary mixtures

Definition at line 598 of file VLE.hpp.

◆ get_drhovecdT_psat() [2/2]

template<typename TemplatedModel , typename ... Params, typename = typename std::enable_if<not std::is_base_of<teqp::cppinterface::AbstractModel, TemplatedModel>::value>::type>
auto teqp::get_drhovecdT_psat ( const TemplatedModel & model,
Params &&... params )
inline

Definition at line 1305 of file VLE.hpp.

◆ get_drhovecdT_xsat() [1/2]

auto teqp::get_drhovecdT_xsat ( const AbstractModel & model,
const double & T,
const Eigen::ArrayXd & rhovecL,
const Eigen::ArrayXd & rhovecV )
inline

Definition at line 712 of file VLE.hpp.

◆ get_drhovecdT_xsat() [2/2]

template<typename TemplatedModel , typename ... Params, typename = typename std::enable_if<not std::is_base_of<teqp::cppinterface::AbstractModel, TemplatedModel>::value>::type>
auto teqp::get_drhovecdT_xsat ( const TemplatedModel & model,
Params &&... params )
inline

Definition at line 1305 of file VLE.hpp.

◆ get_EOS_terms()

auto teqp::get_EOS_terms ( const nlohmann::json & j)
inline

lambda function for adding non-analytic terms

Definition at line 516 of file multifluid.hpp.

◆ get_EOSs()

auto teqp::get_EOSs ( const std::vector< nlohmann::json > & pureJSON)
inline

Definition at line 764 of file multifluid.hpp.

◆ get_pure_critical_conditions_Jacobian() [1/2]

auto teqp::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 )
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.

◆ get_pure_critical_conditions_Jacobian() [2/2]

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 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.

◆ get_R_gas()

template<typename NumType >
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.

◆ getbaseval()

template<typename T >
auto teqp::getbaseval ( const T & expr)

Definition at line 90 of file types.hpp.

◆ gradient_forward()

template<typename Function , typename Vec , typename Scalar >
auto teqp::gradient_forward ( const Function & f,
const Vec & x,
Scalar h )

Definition at line 76 of file finite_derivs.hpp.

◆ JSON_to_file()

void teqp::JSON_to_file ( const nlohmann::json & jsondata,
const std::string & path )
inline

Definition at line 34 of file json_tools.hpp.

◆ linsolve()

template<class A , class B >
auto teqp::linsolve ( const A & a,
const B & b )

Definition at line 55 of file VLE.hpp.

◆ load_a_JSON_file()

nlohmann::json teqp::load_a_JSON_file ( const std::string & path)
inline

Load a JSON file from a specified file.

Definition at line 18 of file json_tools.hpp.

◆ make_AdvancedPRaEres()

auto teqp::make_AdvancedPRaEres ( const nlohmann::json & j)
inline

Definition at line 638 of file cubics.hpp.

◆ make_canonicalPR()

auto teqp::make_canonicalPR ( const nlohmann::json & spec)
inline

A JSON-based factory function for the canonical SRK model.

Definition at line 335 of file cubics.hpp.

◆ make_canonicalSRK()

auto teqp::make_canonicalSRK ( const nlohmann::json & spec)
inline

A JSON-based factory function for the canonical SRK model.

Definition at line 290 of file cubics.hpp.

◆ make_generalizedcubic()

auto teqp::make_generalizedcubic ( const nlohmann::json & spec)
inline

A JSON-based factory function for the generalized cubic + alpha.

Definition at line 345 of file cubics.hpp.

◆ make_pure_components_JSON()

auto teqp::make_pure_components_JSON ( const nlohmann::json & components,
const std::optional< std::string > & root = std::nullopt )
inline

There are 4 options:

  1. Absolute paths to fluid files in the JSON format
  2. Names of fluid fluids that can all be looked up in the dev/fluids folder relative to the root
  3. Fluid data that is already in the JSON format
  4. Names that all resolve to absolute paths when looking up in the alias map

Definition at line 963 of file multifluid.hpp.

◆ mix_VLE_Tp() [1/2]

auto teqp::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 )
inline

Definition at line 287 of file VLE.hpp.

◆ mix_VLE_Tp() [2/2]

template<typename TemplatedModel , typename ... Params, typename = typename std::enable_if<not std::is_base_of<teqp::cppinterface::AbstractModel, TemplatedModel>::value>::type>
auto teqp::mix_VLE_Tp ( const TemplatedModel & model,
Params &&... params )
inline

Definition at line 1305 of file VLE.hpp.

◆ mix_VLE_Tx() [1/2]

auto teqp::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 )
inline

Definition at line 76 of file VLE.hpp.

◆ mix_VLE_Tx() [2/2]

template<typename TemplatedModel , typename ... Params, typename = typename std::enable_if<not std::is_base_of<teqp::cppinterface::AbstractModel, TemplatedModel>::value>::type>
auto teqp::mix_VLE_Tx ( const TemplatedModel & model,
Params &&... params )
inline

Definition at line 1305 of file VLE.hpp.

◆ mixture_VLE_px() [1/2]

auto teqp::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 )
inline

Definition at line 399 of file VLE.hpp.

◆ mixture_VLE_px() [2/2]

template<typename TemplatedModel , typename ... Params, typename = typename std::enable_if<not std::is_base_of<teqp::cppinterface::AbstractModel, TemplatedModel>::value>::type>
auto teqp::mixture_VLE_px ( const TemplatedModel & model,
Params &&... params )
inline

Definition at line 1305 of file VLE.hpp.

◆ multifluidfactory() [1/2]

auto teqp::multifluidfactory ( const nlohmann::json & spec)
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.

◆ multifluidfactory() [2/2]

auto teqp::multifluidfactory ( const std::string & specstring)
inline

An overload of multifluidfactory that takes in a string.

Definition at line 1105 of file multifluid.hpp.

◆ multilevel_JSON_load()

auto teqp::multilevel_JSON_load ( const nlohmann::json & j,
const std::optional< std::string > & default_path = std::nullopt )
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

  1. An object node, in which case it is returned
  2. A path as a string. If this file exists, it will be loaded
  3. A JSON-encoded string

Definition at line 82 of file json_tools.hpp.

◆ NewtonRaphson()

template<typename Callable , typename Inputs >
auto teqp::NewtonRaphson ( Callable f,
const Inputs & args,
double tol )

Definition at line 6 of file rootfinding.hpp.

◆ NLOHMANN_JSON_SERIALIZE_ENUM()

teqp::NLOHMANN_JSON_SERIALIZE_ENUM ( AdvancedPRaEMixingRules ,
{ {AdvancedPRaEMixingRules::knotspecified, nullptr}, {AdvancedPRaEMixingRules::kLinear, "Linear"}, {AdvancedPRaEMixingRules::kQuadratic, "Quadratic"}, }  )

Definition at line 443 of file cubics.hpp.

◆ pow() [1/3]

auto teqp::pow ( const double & x,
const double & e )
inline

Definition at line 195 of file types.hpp.

◆ pow() [2/3]

auto teqp::pow ( const double & x,
const int & e )
inline

Definition at line 199 of file types.hpp.

◆ pow() [3/3]

template<typename T >
auto teqp::pow ( const std::complex< T > & x,
const Eigen::ArrayXd & e )

Definition at line 204 of file types.hpp.

◆ POW10()

template<typename A >
auto teqp::POW10 ( const A & x)

Definition at line 11 of file pow_templates.hpp.

◆ POW12()

template<typename A >
auto teqp::POW12 ( const A & x)

Definition at line 12 of file pow_templates.hpp.

◆ POW2()

template<typename A >
auto teqp::POW2 ( const A & x)

Definition at line 5 of file pow_templates.hpp.

◆ pow2()

template<typename T >
T teqp::pow2 ( const T & x)
inline

Definition at line 7 of file types.hpp.

◆ POW3()

template<typename A >
auto teqp::POW3 ( const A & x)

Definition at line 6 of file pow_templates.hpp.

◆ pow3()

template<typename T >
T teqp::pow3 ( const T & x)
inline

Definition at line 8 of file types.hpp.

◆ POW4()

template<typename A >
auto teqp::POW4 ( const A & x)

Definition at line 7 of file pow_templates.hpp.

◆ POW5()

template<typename A >
auto teqp::POW5 ( const A & x)

Definition at line 8 of file pow_templates.hpp.

◆ POW7()

template<typename A >
auto teqp::POW7 ( const A & x)

Definition at line 9 of file pow_templates.hpp.

◆ POW8()

template<typename A >
auto teqp::POW8 ( const A & x)

Definition at line 10 of file pow_templates.hpp.

◆ powi()

template<typename T >
T teqp::powi ( const T & x,
int n )

From Ulrich Deiters.

Definition at line 139 of file types.hpp.

◆ powIVd()

template<typename T >
auto teqp::powIVd ( const T & x,
const Eigen::ArrayXd & e )
inline

Definition at line 185 of file types.hpp.

◆ powIVi()

template<typename T >
auto teqp::powIVi ( const T & x,
const Eigen::ArrayXi & e )
inline

Definition at line 173 of file types.hpp.

◆ pure_trace_VLE() [1/2]

template<typename TemplatedModel , typename ... Params, typename = typename std::enable_if<is_not_AbstractModel<TemplatedModel>::value>::type>
auto teqp::pure_trace_VLE ( const TemplatedModel & model,
Params &&... params )
inline

Definition at line 255 of file VLE_pure.hpp.

◆ pure_trace_VLE() [2/2]

auto teqp::pure_trace_VLE ( const teqp::cppinterface::AbstractModel & model,
const double T,
const nlohmann::json & spec )
inline

Definition at line 184 of file VLE_pure.hpp.

◆ pure_VLE_T() [1/2]

template<typename TemplatedModel , typename ... Params, typename = typename std::enable_if<is_not_AbstractModel<TemplatedModel>::value>::type>
auto teqp::pure_VLE_T ( const TemplatedModel & model,
Params &&... params )
inline

Definition at line 255 of file VLE_pure.hpp.

◆ pure_VLE_T() [2/2]

auto teqp::pure_VLE_T ( const teqp::cppinterface::AbstractModel & model,
double T,
double rhoL,
double rhoV,
int maxiter,
const std::optional< Eigen::ArrayXd > & molefracs = std::nullopt )
inline

Definition at line 138 of file VLE_pure.hpp.

◆ quad()

template<int N, typename T , typename Double = double>
auto teqp::quad ( const std::function< T(Double)> & F,
const Double & a,
const Double & b )
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.

◆ select_identifier()

template<typename mapvecstring >
auto teqp::select_identifier ( const nlohmann::json & BIPcollection,
const mapvecstring & identifierset,
const nlohmann::json & flags )
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.

◆ solve_pure_critical() [1/2]

auto teqp::solve_pure_critical ( const AbstractModel & model,
const double T0,
const double rho0,
const std::optional< nlohmann::json > & flags = std::nullopt )
inline

Definition at line 125 of file critical_pure.hpp.

◆ solve_pure_critical() [2/2]

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 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.

◆ toeig()

auto teqp::toeig ( const std::vector< double > & v) -> Eigen::ArrayXd
inline

Definition at line 10 of file types.hpp.

◆ trace_critical_arclength_binary()

template<typename TemplatedModel , typename ... Params, typename = typename std::enable_if<not std::is_base_of<teqp::cppinterface::AbstractModel, TemplatedModel>::value>::type>
auto teqp::trace_critical_arclength_binary ( const TemplatedModel & model,
Params &&... params )
inline

Definition at line 1305 of file VLE.hpp.

◆ trace_VLE_isobar_binary() [1/2]

template<typename Model = AbstractModel>
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 )

Definition at line 1047 of file VLE.hpp.

◆ trace_VLE_isobar_binary() [2/2]

template<typename TemplatedModel , typename ... Params, typename = typename std::enable_if<not std::is_base_of<teqp::cppinterface::AbstractModel, TemplatedModel>::value>::type>
auto teqp::trace_VLE_isobar_binary ( const TemplatedModel & model,
Params &&... params )
inline

Definition at line 1305 of file VLE.hpp.

◆ trace_VLE_isotherm_binary() [1/2]

auto teqp::trace_VLE_isotherm_binary ( const AbstractModel & model,
double T,
const Eigen::ArrayXd & rhovecL0,
const Eigen::ArrayXd & rhovecV0,
const std::optional< TVLEOptions > & options = std::nullopt )
inline

Definition at line 792 of file VLE.hpp.

◆ trace_VLE_isotherm_binary() [2/2]

template<typename TemplatedModel , typename ... Params, typename = typename std::enable_if<not std::is_base_of<teqp::cppinterface::AbstractModel, TemplatedModel>::value>::type>
auto teqp::trace_VLE_isotherm_binary ( const TemplatedModel & model,
Params &&... params )
inline

Definition at line 1305 of file VLE.hpp.

Variable Documentation

◆ build_square_matrix

auto teqp::build_square_matrix
inline
Initial value:
= [](const nlohmann::json& j){
if (j.is_null() || (j.is_array() && j.size() == 0)){
return Eigen::ArrayXXd(0, 0);
}
try{
const std::valarray<std::valarray<double>> m = j;
Eigen::ArrayXXd mat(m.size(), m.size());
if (m.size() == 0){
return mat;
}
for (auto i = 0U; i < m.size(); ++i){
auto row = m[i];
if (row.size() != static_cast<std::size_t>(mat.rows())){
throw std::invalid_argument("provided matrix is not square");
}
for (auto k = 0U; k < row.size(); ++k){
mat(i, k) = row[k];
}
}
return mat;
}
catch(const nlohmann::json::exception&){
throw teqp::InvalidArgument("Unable to convert this kmat to a NxN matrix of doubles:" + j.dump(2));
}
}

Definition at line 45 of file json_tools.hpp.