CoolProp  4.2.5
An open-source fluid property and humid air property database
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Public Attributes | List of all members
NewtonRaphsonVLE Class Reference

#include <Mixtures.h>

Public Member Functions

 NewtonRaphsonVLE ()
 
void resize (unsigned int N)
 
void pre_call ()
 
double call (double beta, double T, double p, double rhobar_liq, double rhobar_vap, const std::vector< double > &z, std::vector< double > &K, int spec_index, double spec_value)
 
void build_arrays (double beta, double T, double p, const std::vector< double > &z, std::vector< double > &K, int spec_index, double spec_value)
 

Public Attributes

double error_rms
 
double rhobar_liq
 
double rhobar_vap
 
double T
 
double p
 
unsigned int N
 
bool logging
 
int Nsteps
 
int Nsteps_max
 
MixtureMix
 
STLMatrix J
 
std::vector< double > K
 
std::vector< double > x
 
std::vector< double > y
 
std::vector< double > phi_ij_liq
 
std::vector< double > phi_ij_vap
 
std::vector< double > r
 
std::vector< double > dXdS
 
std::vector< double > neg_dFdS
 
std::vector
< SuccessiveSubstitutionStep
step_logger
 

Detailed Description

A class to do newton raphson solver for VLE given guess values for vapor-liquid equilibria. This class will then be included in the Mixture class

A class is used rather than a function so that it is easier to store iteration histories, additional output values, etc.

Definition at line 331 of file Mixtures.h.

Constructor & Destructor Documentation

NewtonRaphsonVLE::NewtonRaphsonVLE ( )
inline

Definition at line 344 of file Mixtures.h.

Member Function Documentation

void NewtonRaphsonVLE::build_arrays ( double  beta,
double  T,
double  p,
const std::vector< double > &  z,
std::vector< double > &  K,
int  spec_index,
double  spec_value 
)

Build the arrays for the Newton-Raphson solve

This method builds the Jacobian matrix, the sensitivity matrix, etc.

Parameters
betaVoid fraction [-] (0: bubble, 1: dew)
TTemperature [K]
pPressure [Pa]
zBulk mole fractions [-]
KArray of K-factors [-]

Definition at line 2485 of file Mixtures.cpp.

double NewtonRaphsonVLE::call ( double  beta,
double  T,
double  p,
double  rhobar_liq,
double  rhobar_vap,
const std::vector< double > &  z,
std::vector< double > &  K,
int  spec_index,
double  spec_value 
)

Call the Newton-Raphson VLE Solver

This solver must be passed reasonable guess values for the mole fractions, densities, etc. You may want to take a few steps of successive substitution before you start with Newton Raphson.

Parameters
TTemperature [K]
pPressure [Pa]
rhobar_liqCurrent value of molar density of the liquid [mol/m^3]
rhobar_vapCurrent value of molar density of the vapor [mol/m^3]
zBulk mole fractions [-]
KArray of K-factors [-]

Definition at line 2424 of file Mixtures.cpp.

void NewtonRaphsonVLE::pre_call ( )
inline

Definition at line 349 of file Mixtures.h.

void NewtonRaphsonVLE::resize ( unsigned int  N)

Definition at line 2405 of file Mixtures.cpp.

Member Data Documentation

std::vector<double> NewtonRaphsonVLE::dXdS

Definition at line 341 of file Mixtures.h.

double NewtonRaphsonVLE::error_rms

Definition at line 334 of file Mixtures.h.

STLMatrix NewtonRaphsonVLE::J

Definition at line 340 of file Mixtures.h.

std::vector<double> NewtonRaphsonVLE::K

Definition at line 341 of file Mixtures.h.

bool NewtonRaphsonVLE::logging

Definition at line 336 of file Mixtures.h.

Mixture* NewtonRaphsonVLE::Mix

Definition at line 339 of file Mixtures.h.

unsigned int NewtonRaphsonVLE::N

Definition at line 335 of file Mixtures.h.

std::vector<double> NewtonRaphsonVLE::neg_dFdS

Definition at line 341 of file Mixtures.h.

int NewtonRaphsonVLE::Nsteps

Definition at line 337 of file Mixtures.h.

int NewtonRaphsonVLE::Nsteps_max

Definition at line 338 of file Mixtures.h.

double NewtonRaphsonVLE::p

Definition at line 334 of file Mixtures.h.

std::vector<double> NewtonRaphsonVLE::phi_ij_liq

Definition at line 341 of file Mixtures.h.

std::vector<double> NewtonRaphsonVLE::phi_ij_vap

Definition at line 341 of file Mixtures.h.

std::vector<double> NewtonRaphsonVLE::r

Definition at line 341 of file Mixtures.h.

double NewtonRaphsonVLE::rhobar_liq

Definition at line 334 of file Mixtures.h.

double NewtonRaphsonVLE::rhobar_vap

Definition at line 334 of file Mixtures.h.

std::vector<SuccessiveSubstitutionStep> NewtonRaphsonVLE::step_logger

Definition at line 342 of file Mixtures.h.

double NewtonRaphsonVLE::T

Definition at line 334 of file Mixtures.h.

std::vector<double> NewtonRaphsonVLE::x

Definition at line 341 of file Mixtures.h.

std::vector<double> NewtonRaphsonVLE::y

Definition at line 341 of file Mixtures.h.


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