teqp 0.22.0
Loading...
Searching...
No Matches
multifluid_association.hpp
Go to the documentation of this file.
1#pragma once
2
3#include "teqp/types.hpp"
4
7
8namespace teqp{
9
11private:
12 const decltype(multifluidfactory(nlohmann::json{})) m_multifluid;
13 const association::Association m_association;
14public:
15 MultifluidPlusAssociation(const nlohmann::json &spec) :
16 m_multifluid(multifluidfactory(spec.at("multifluid"))),
17 m_association(association::Association::factory(spec.at("association").at("model"))){}
18
19 const auto& get_association() const { return m_association; }
20
21 template<class VecType>
22 auto R(const VecType& molefrac) const {
24 }
25
26 template <typename TType, typename RhoType, typename MoleFractions>
27 auto alphar(const TType& T, const RhoType& rho, const MoleFractions& molefrac) const {
28 return forceeval(
29 m_multifluid.alphar(T, rho, molefrac)
30 + m_association.alphar(T, rho, molefrac)
31 );
32 }
33};
34
35}; // namespace teqp
auto R(const VecType &molefrac) const
MultifluidPlusAssociation(const nlohmann::json &spec)
auto alphar(const TType &T, const RhoType &rho, const MoleFractions &molefrac) const
auto alphar(const TType &T, const RhoType &rhomolar, const MoleFracsType &molefracs) const
Calculate the contribution , where the Helmholtz energy is on a molar basis, making dimensionless.
auto multifluidfactory(const nlohmann::json &spec)
Load a model from a JSON data structure.
auto forceeval(T &&expr)
Definition types.hpp:52
auto get_R_gas()
< Gas constant, according to CODATA 2019, in the given number type
Definition constants.hpp:22