teqp 0.22.0
Loading...
Searching...
No Matches
teqp::algorithms::phase_equil::GeneralizedPhaseEquilibrium Class Reference

#include <phase_equil.hpp>

Classes

struct  CallResult
 
struct  UnpackedVariables
 

Public Member Functions

 GeneralizedPhaseEquilibrium (const AbstractModel &residmodel, const Eigen::ArrayXd &zbulk, const UnpackedVariables &init, const std::vector< std::shared_ptr< AbstractSpecification > > &specifications)
 A helper class for doing multi-phase phase equilibrium calculations with additional specification equations.
 
auto attach_ideal_gas (const std::shared_ptr< const AbstractModel > &ptr)
 
auto call (const Eigen::ArrayXd &x)
 Call the routines to build the vector of residuals and Jacobian and cache it internally.
 
auto num_Jacobian (const Eigen::ArrayXd &x, const Eigen::ArrayXd &dx)
 

Public Attributes

const AbstractModelresidptr
 The pointer for the residual portion of \(\alpha\).
 
std::optional< std::shared_ptr< const AbstractModel > > idealgasptr
 The pointer for the ideal-gas portion of \(\alpha\).
 
const Eigen::ArrayXd zbulk
 The bulk composition of the mixture.
 
const std::size_t Ncomponents
 The number of components in each phase.
 
const std::size_t Nphases
 The number of phases.
 
const std::size_t Nindependent
 The number of independent variables to be solved for.
 
const std::vector< std::shared_ptr< AbstractSpecification > > specifications
 The specification equations.
 
CallResult res
 The internal buffer of residual vector and Jacobian (to minimize copies)
 

Detailed Description

Definition at line 304 of file phase_equil.hpp.

Constructor & Destructor Documentation

◆ GeneralizedPhaseEquilibrium()

teqp::algorithms::phase_equil::GeneralizedPhaseEquilibrium::GeneralizedPhaseEquilibrium ( const AbstractModel & residmodel,
const Eigen::ArrayXd & zbulk,
const UnpackedVariables & init,
const std::vector< std::shared_ptr< AbstractSpecification > > & specifications )
inline

A helper class for doing multi-phase phase equilibrium calculations with additional specification equations.

This general approach allows for a generic framework to handle multi-phase equilibrium. The number of phases and components are both arbitrary (within the memory available on the machine)

Parameters
residmodelThe AbstractModel for the residual portion of the Helmholtz energy
zbulkThe bulk molar fractions
initThe pack of the initial set of arguments
specificationsThe two-element vector of specification equations

Definition at line 370 of file phase_equil.hpp.

Member Function Documentation

◆ attach_ideal_gas()

auto teqp::algorithms::phase_equil::GeneralizedPhaseEquilibrium::attach_ideal_gas ( const std::shared_ptr< const AbstractModel > & ptr)
inline

Definition at line 388 of file phase_equil.hpp.

◆ call()

auto teqp::algorithms::phase_equil::GeneralizedPhaseEquilibrium::call ( const Eigen::ArrayXd & x)
inline

Call the routines to build the vector of residuals and Jacobian and cache it internally.

Parameters
xThe array of independent variables, first T, then molar concentrations of each phase, in order, followed by the molar phase fractions

Definition at line 396 of file phase_equil.hpp.

◆ num_Jacobian()

auto teqp::algorithms::phase_equil::GeneralizedPhaseEquilibrium::num_Jacobian ( const Eigen::ArrayXd & x,
const Eigen::ArrayXd & dx )
inline

Definition at line 565 of file phase_equil.hpp.

Member Data Documentation

◆ idealgasptr

std::optional<std::shared_ptr<const AbstractModel> > teqp::algorithms::phase_equil::GeneralizedPhaseEquilibrium::idealgasptr

The pointer for the ideal-gas portion of \(\alpha\).

Definition at line 350 of file phase_equil.hpp.

◆ Ncomponents

const std::size_t teqp::algorithms::phase_equil::GeneralizedPhaseEquilibrium::Ncomponents

The number of components in each phase.

Definition at line 352 of file phase_equil.hpp.

◆ Nindependent

const std::size_t teqp::algorithms::phase_equil::GeneralizedPhaseEquilibrium::Nindependent

The number of independent variables to be solved for.

Definition at line 354 of file phase_equil.hpp.

◆ Nphases

const std::size_t teqp::algorithms::phase_equil::GeneralizedPhaseEquilibrium::Nphases

The number of phases.

Definition at line 353 of file phase_equil.hpp.

◆ res

CallResult teqp::algorithms::phase_equil::GeneralizedPhaseEquilibrium::res

The internal buffer of residual vector and Jacobian (to minimize copies)

Definition at line 356 of file phase_equil.hpp.

◆ residptr

const AbstractModel& teqp::algorithms::phase_equil::GeneralizedPhaseEquilibrium::residptr

The pointer for the residual portion of \(\alpha\).

Definition at line 349 of file phase_equil.hpp.

◆ specifications

const std::vector<std::shared_ptr<AbstractSpecification> > teqp::algorithms::phase_equil::GeneralizedPhaseEquilibrium::specifications

The specification equations.

Definition at line 355 of file phase_equil.hpp.

◆ zbulk

const Eigen::ArrayXd teqp::algorithms::phase_equil::GeneralizedPhaseEquilibrium::zbulk

The bulk composition of the mixture.

Definition at line 351 of file phase_equil.hpp.


The documentation for this class was generated from the following file: