CoolProp
4.2.5
An open-source fluid property and humid air property database
|
#include <TTSE.h>
Public Member Functions | |
TTSESinglePhaseTableClass () | |
TTSESinglePhaseTableClass (Fluid *pFluid) | |
int | set_mode (int mode) |
int | get_mode () |
bool | read_all_from_file (std::string root_path) |
void | write_all_to_file (std::string root_path=std::string()) |
void | matrix_to_file (std::string fName, std::vector< std::vector< double > > *A) |
void | vector_to_file (std::string fName, std::vector< double > *A) |
void | vector_from_file (std::string fName, int N, std::vector< double > *A) |
void | matrix_from_file (std::string fName, std::vector< std::vector< double > > *A) |
void | set_size_ph (unsigned int Np=100, unsigned int Nh=100) |
Set the sizes of the matrices with h,p as inputs. More... | |
void | set_size_Trho (unsigned int NT=100, unsigned int Nrho=100) |
Set the sizes of the matrices with Trho as inputs. More... | |
void | update_saturation_boundary_indices () |
void | update_cell_validity () |
double | build_ph (double hmin, double hmax, double pmin, double pmax, TTSETwoPhaseTableClass *SatL=NULL, TTSETwoPhaseTableClass *SatV=NULL) |
double | build_Trho (double Tmin, double Tmax, double rhomin, double rhomax, TTSETwoPhaseTableClass *SatL, TTSETwoPhaseTableClass *SatV) |
double | evaluate (long iParam, double p, double logp, double h) |
double | evaluate_one_other_input (long iInput1, double Param1, long iOther, double Other) |
Evaluate the TTSE using P,S or P,T. More... | |
bool | within_range (long iInput1, double Input1, long iInput2, double Input2) |
See if the inputs are within range. More... | |
double | evaluate_Trho (long iOutput, double T, double rho, double logrho) |
double | interpolate_bicubic_Trho (long iParam, double T, double rho, double logrho) |
double | evaluate_randomly (long iParam, unsigned int N) |
double | interpolate_bicubic_ph (long iParam, double p, double logp, double h) |
void | bicubic_cell_coordinates_Trho (double Tval, double rho, double logrhoval, int *i, int *j) |
void | bicubic_cell_coordinates_ph (double hval, double p, double logpval, int *i, int *j) |
std::vector< double > * | bicubic_cell_coeffs_Trho (long iParam, int i, int j) |
std::vector< double > * | bicubic_cell_coeffs_ph (long iParam, int i, int j) |
double | bicubic_evaluate_first_derivative_ph (long iOF, long iWRT, long iCONSTANT, double p, double logp, double h) |
double | bicubic_evaluate_one_other_input (long iInput1, double Input1, long iOther, double Other) |
double | check_randomly (long iParam, unsigned int N, std::vector< double > *h, std::vector< double > *p, std::vector< double > *EOSv, std::vector< double > *TTSE) |
void | write_dotdrawing_tofile (char fName[]) |
Write a representation of the ph surface to file with O in each "good" spot and "X" in each "bad" one or two-phase. More... | |
void | nearest_neighbor_ph (int i, int j, double *T0, double *rho0) |
void | nearest_good_neighbor (int *i, int *j) |
void | nearest_good_neighbor_Trho (int *i, int *j) |
void | nearest_good_neighbor_ph_interpolate (int *i, int *j) |
void | nearest_good_neighbor_Trho_interpolate (int *i, int *j) |
double | evaluate_first_derivative (long iOF, long iWRT, long iCONSTANT, double p, double logp, double h) |
Public Attributes | |
TTSETwoPhaseTableClass * | SatL |
TTSETwoPhaseTableClass * | SatV |
std::string | root_path |
std::vector< double > | TL |
std::vector< double > | SL |
std::vector< double > | DL |
std::vector< double > | TV |
std::vector< double > | SV |
std::vector< double > | DV |
double | hmin |
double | hmax |
double | pmin |
double | pmax |
double | Tmin |
double | Tmax |
double | rhomin |
double | rhomax |
bool | enable_writing_tables_to_files |
bool | enable_transport |
std::vector< double > | alpha_bicubic |
std::vector< double > | z_bicubic |
BiCubicCellsContainerClass | bicubic_cells |
std::vector< std::vector < double > > | T |
std::vector< std::vector < double > > | dTdh |
std::vector< std::vector < double > > | dTdp |
std::vector< std::vector < double > > | d2Tdh2 |
std::vector< std::vector < double > > | d2Tdp2 |
std::vector< std::vector < double > > | d2Tdhdp |
std::vector< std::vector < double > > | rho |
std::vector< std::vector < double > > | drhodh |
std::vector< std::vector < double > > | drhodp |
std::vector< std::vector < double > > | d2rhodh2 |
std::vector< std::vector < double > > | d2rhodp2 |
std::vector< std::vector < double > > | d2rhodhdp |
std::vector< std::vector < double > > | s |
std::vector< std::vector < double > > | dsdh |
std::vector< std::vector < double > > | dsdp |
std::vector< std::vector < double > > | d2sdh2 |
std::vector< std::vector < double > > | d2sdp2 |
std::vector< std::vector < double > > | d2sdhdp |
std::vector< double > | h |
std::vector< double > | p |
std::vector< std::vector < double > > | s_Trho |
std::vector< std::vector < double > > | dsdT_Trho |
std::vector< std::vector < double > > | dsdrho_Trho |
std::vector< std::vector < double > > | d2sdT2_Trho |
std::vector< std::vector < double > > | d2sdrho2_Trho |
std::vector< std::vector < double > > | d2sdTdrho_Trho |
std::vector< std::vector < double > > | p_Trho |
std::vector< std::vector < double > > | dpdT_Trho |
std::vector< std::vector < double > > | dpdrho_Trho |
std::vector< std::vector < double > > | d2pdT2_Trho |
std::vector< std::vector < double > > | d2pdrho2_Trho |
std::vector< std::vector < double > > | d2pdTdrho_Trho |
std::vector< std::vector < double > > | h_Trho |
std::vector< std::vector < double > > | dhdT_Trho |
std::vector< std::vector < double > > | dhdrho_Trho |
std::vector< std::vector < double > > | d2hdT2_Trho |
std::vector< std::vector < double > > | d2hdrho2_Trho |
std::vector< std::vector < double > > | d2hdTdrho_Trho |
std::vector< std::vector < double > > | mu_Trho |
std::vector< std::vector < double > > | dmudT_Trho |
std::vector< std::vector < double > > | dmudrho_Trho |
std::vector< std::vector < double > > | d2mudT2_Trho |
std::vector< std::vector < double > > | d2mudrho2_Trho |
std::vector< std::vector < double > > | d2mudTdrho_Trho |
std::vector< std::vector < double > > | k_Trho |
std::vector< std::vector < double > > | dkdT_Trho |
std::vector< std::vector < double > > | dkdrho_Trho |
std::vector< std::vector < double > > | d2kdT2_Trho |
std::vector< std::vector < double > > | d2kdrho2_Trho |
std::vector< std::vector < double > > | d2kdTdrho_Trho |
std::vector< double > | T_Trho |
std::vector< double > | rho_Trho |
std::vector< int > | IL |
std::vector< int > | IV |
Protected Member Functions | |
bool | within_range_one_other_input (long iInput1, double Input1, long iOther, double Other, int buf) |
Protected Attributes | |
unsigned int | Nh |
unsigned int | Np |
unsigned int | NT |
unsigned int | Nrho |
Fluid * | pFluid |
double | pratio |
double | logpratio |
double | logpmin |
double | rhoratio |
double | logrhoratio |
double | logrhomin |
int | jpcrit_floor |
int | jpcrit_ceil |
int | mode |
TTSESinglePhaseTableClass::TTSESinglePhaseTableClass | ( | Fluid * | pFluid | ) |
std::vector< double > * TTSESinglePhaseTableClass::bicubic_cell_coeffs_ph | ( | long | iParam, |
int | i, | ||
int | j | ||
) |
std::vector< double > * TTSESinglePhaseTableClass::bicubic_cell_coeffs_Trho | ( | long | iParam, |
int | i, | ||
int | j | ||
) |
void TTSESinglePhaseTableClass::bicubic_cell_coordinates_ph | ( | double | hval, |
double | p, | ||
double | logpval, | ||
int * | i, | ||
int * | j | ||
) |
void TTSESinglePhaseTableClass::bicubic_cell_coordinates_Trho | ( | double | Tval, |
double | rho, | ||
double | logrhoval, | ||
int * | i, | ||
int * | j | ||
) |
double TTSESinglePhaseTableClass::build_ph | ( | double | hmin, |
double | hmax, | ||
double | pmin, | ||
double | pmax, | ||
TTSETwoPhaseTableClass * | SatL = NULL , |
||
TTSETwoPhaseTableClass * | SatV = NULL |
||
) |
double TTSESinglePhaseTableClass::build_Trho | ( | double | Tmin, |
double | Tmax, | ||
double | rhomin, | ||
double | rhomax, | ||
TTSETwoPhaseTableClass * | SatL, | ||
TTSETwoPhaseTableClass * | SatV | ||
) |
Build the tables with T,rho as the independent variables
Tmin | Minimum temperature [K] |
Tmax | Maximum temperature [K] |
rhomin | Minimum density [kg/m^3] |
rhomax | Maximum density [kg/m^3] |
TTSESatL | Saturated liquid TTSE LUT |
TTSESatV | Saturated vapor TTSE LUT |
Transport properties
double TTSESinglePhaseTableClass::check_randomly | ( | long | iParam, |
unsigned int | N, | ||
std::vector< double > * | h, | ||
std::vector< double > * | p, | ||
std::vector< double > * | EOSv, | ||
std::vector< double > * | TTSE | ||
) |
Randomly select a point within the range, and evaluate the property using TTSE and the EOS
iParam | Index of desired output |
N | Number of runs to do |
h | std::vector of enthalpies |
p | std::vector of enthalpies |
EOS | std::vector of values from Equation of State |
TTSE | std::vector of values from TTSE |
Note: h,p,EOS, TTSE should be empty std::vector passed by reference
double TTSESinglePhaseTableClass::evaluate | ( | long | iParam, |
double | p, | ||
double | logp, | ||
double | h | ||
) |
double TTSESinglePhaseTableClass::evaluate_randomly | ( | long | iParam, |
unsigned int | N | ||
) |
double TTSESinglePhaseTableClass::evaluate_Trho | ( | long | iOutput, |
double | T, | ||
double | rho, | ||
double | logrho | ||
) |
double TTSESinglePhaseTableClass::interpolate_bicubic_ph | ( | long | iParam, |
double | pval, | ||
double | logp, | ||
double | hval | ||
) |
Randomly evaluate a property in the two-phase region using the TTSE method
iParam | Index of desired output |
p | Pressure [kPa] |
logp | Logarithm of the pressure [log(kPa)] |
h | Enthalpy [kJ/kg] |
\[ A^{-1} = \left[ \begin{array}{*{16}c} 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ -3 & 3 & 0 & 0 & -2 & -1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ 2 & -2 & 0 & 0 & 1 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & -3 & 3 & 0 & 0 & -2 & -1 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 2 & -2 & 0 & 0 & 1 & 1 & 0 & 0 \\ -3 & 0 & 3 & 0 & 0 & 0 & 0 & 0 & -2 & 0 & -1 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & -3 & 0 & 3 & 0 & 0 & 0 & 0 & 0 & -2 & 0 & -1 & 0 \\ 9 & -9 & -9 & 9 & 6 & 3 & -6 & -3 & 6 & -6 & 3 & -3 & 4 & 2 & 2 & 1 \\ -6 & 6 & 6 & -6 & -3 & -3 & 3 & 3 & -4 & 4 & -2 & 2 & -2 & -2 & -1 & -1 \\ 2 & 0 & -2 & 0 & 0 & 0 & 0 & 0 & 1 & 0 & 1 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 2 & 0 & -2 & 0 & 0 & 0 & 0 & 0 & 1 & 0 & 1 & 0 \\ -6 & 6 & 6 & -6 & -4 & -2 & 4 & 2 & -3 & 3 & -3 & 3 & -2 & -1 & -2 & -1 \\ 4 & -4 & -4 & 4 & 2 & 2 & -2 & -2 & 2 & -2 & 2 & -2 & 1 & 1 & 1 & 1 \end{array} \right] \]
\[ x = \frac{h-h_i}{h_{i+1}-h_i} \]
\[ \frac{\partial x}{\partial h} = \frac{1}{h_{i+1}-h_i} \]
\[ \frac{\partial h}{\partial x} = h_{i+1}-h_i \]
\[ y = \frac{p-p_j}{p_{j+1}-p_j} \]
\[ \frac{\partial y}{\partial p} = \frac{1}{p_{j+1}-p_j} \]
\[ \frac{\partial p}{\partial y} = p_{j+1}-p_j \]
\[ \frac{\partial f}{\partial x} = \frac{\partial f}{\partial h}\cdot\frac{\partial h}{\partial x} \]
\
double TTSESinglePhaseTableClass::interpolate_bicubic_Trho | ( | long | iParam, |
double | T, | ||
double | rho, | ||
double | logrho | ||
) |
void TTSESinglePhaseTableClass::matrix_from_file | ( | std::string | fName, |
std::vector< std::vector< double > > * | A | ||
) |
void TTSESinglePhaseTableClass::matrix_to_file | ( | std::string | fName, |
std::vector< std::vector< double > > * | A | ||
) |
void TTSESinglePhaseTableClass::nearest_good_neighbor | ( | int * | i, |
int * | j | ||
) |
void TTSESinglePhaseTableClass::nearest_good_neighbor_ph_interpolate | ( | int * | i, |
int * | j | ||
) |
void TTSESinglePhaseTableClass::nearest_good_neighbor_Trho | ( | int * | i, |
int * | j | ||
) |
void TTSESinglePhaseTableClass::nearest_good_neighbor_Trho_interpolate | ( | int * | i, |
int * | j | ||
) |
void TTSESinglePhaseTableClass::nearest_neighbor_ph | ( | int | i, |
int | j, | ||
double * | T0, | ||
double * | rho0 | ||
) |
bool TTSESinglePhaseTableClass::read_all_from_file | ( | std::string | root_path | ) |
void TTSESinglePhaseTableClass::set_size_ph | ( | unsigned int | Np = 100 , |
unsigned int | Nh = 100 |
||
) |
void TTSESinglePhaseTableClass::set_size_Trho | ( | unsigned int | NT = 100 , |
unsigned int | Nrho = 100 |
||
) |
void TTSESinglePhaseTableClass::update_saturation_boundary_indices | ( | ) |
void TTSESinglePhaseTableClass::vector_from_file | ( | std::string | fName, |
int | N, | ||
std::vector< double > * | A | ||
) |
void TTSESinglePhaseTableClass::vector_to_file | ( | std::string | fName, |
std::vector< double > * | A | ||
) |
void TTSESinglePhaseTableClass::write_all_to_file | ( | std::string | root_path = std::string() | ) |
void TTSESinglePhaseTableClass::write_dotdrawing_tofile | ( | char | fName[] | ) |
BiCubicCellsContainerClass TTSESinglePhaseTableClass::bicubic_cells |
std::vector<std::vector<double> > TTSESinglePhaseTableClass::d2hdrho2_Trho |
std::vector<std::vector<double> > TTSESinglePhaseTableClass::d2hdT2_Trho |
std::vector<std::vector<double> > TTSESinglePhaseTableClass::d2hdTdrho_Trho |
std::vector<std::vector<double> > TTSESinglePhaseTableClass::d2kdrho2_Trho |
std::vector<std::vector<double> > TTSESinglePhaseTableClass::d2kdT2_Trho |
std::vector<std::vector<double> > TTSESinglePhaseTableClass::d2kdTdrho_Trho |
std::vector<std::vector<double> > TTSESinglePhaseTableClass::d2mudrho2_Trho |
std::vector<std::vector<double> > TTSESinglePhaseTableClass::d2mudT2_Trho |
std::vector<std::vector<double> > TTSESinglePhaseTableClass::d2mudTdrho_Trho |
std::vector<std::vector<double> > TTSESinglePhaseTableClass::d2pdrho2_Trho |
std::vector<std::vector<double> > TTSESinglePhaseTableClass::d2pdT2_Trho |
std::vector<std::vector<double> > TTSESinglePhaseTableClass::d2pdTdrho_Trho |
std::vector<std::vector<double> > TTSESinglePhaseTableClass::d2rhodh2 |
std::vector<std::vector<double> > TTSESinglePhaseTableClass::d2rhodhdp |
std::vector<std::vector<double> > TTSESinglePhaseTableClass::d2rhodp2 |
std::vector<std::vector<double> > TTSESinglePhaseTableClass::d2sdh2 |
std::vector<std::vector<double> > TTSESinglePhaseTableClass::d2sdhdp |
std::vector<std::vector<double> > TTSESinglePhaseTableClass::d2sdp2 |
std::vector<std::vector<double> > TTSESinglePhaseTableClass::d2sdrho2_Trho |
std::vector<std::vector<double> > TTSESinglePhaseTableClass::d2sdT2_Trho |
std::vector<std::vector<double> > TTSESinglePhaseTableClass::d2sdTdrho_Trho |
std::vector<std::vector<double> > TTSESinglePhaseTableClass::d2Tdh2 |
std::vector<std::vector<double> > TTSESinglePhaseTableClass::d2Tdhdp |
std::vector<std::vector<double> > TTSESinglePhaseTableClass::d2Tdp2 |
std::vector<std::vector<double> > TTSESinglePhaseTableClass::dhdrho_Trho |
std::vector<std::vector<double> > TTSESinglePhaseTableClass::dhdT_Trho |
std::vector<std::vector<double> > TTSESinglePhaseTableClass::dkdrho_Trho |
std::vector<std::vector<double> > TTSESinglePhaseTableClass::dkdT_Trho |
std::vector<std::vector<double> > TTSESinglePhaseTableClass::dmudrho_Trho |
std::vector<std::vector<double> > TTSESinglePhaseTableClass::dmudT_Trho |
std::vector<std::vector<double> > TTSESinglePhaseTableClass::dpdrho_Trho |
std::vector<std::vector<double> > TTSESinglePhaseTableClass::dpdT_Trho |
std::vector<std::vector<double> > TTSESinglePhaseTableClass::drhodh |
std::vector<std::vector<double> > TTSESinglePhaseTableClass::drhodp |
std::vector<std::vector<double> > TTSESinglePhaseTableClass::dsdh |
std::vector<std::vector<double> > TTSESinglePhaseTableClass::dsdp |
std::vector<std::vector<double> > TTSESinglePhaseTableClass::dsdrho_Trho |
std::vector<std::vector<double> > TTSESinglePhaseTableClass::dsdT_Trho |
std::vector<std::vector<double> > TTSESinglePhaseTableClass::dTdh |
std::vector<std::vector<double> > TTSESinglePhaseTableClass::dTdp |
bool TTSESinglePhaseTableClass::enable_writing_tables_to_files |
std::vector<std::vector<double> > TTSESinglePhaseTableClass::h_Trho |
std::vector<int> TTSESinglePhaseTableClass::IL |
std::vector<std::vector<double> > TTSESinglePhaseTableClass::k_Trho |
std::vector<std::vector<double> > TTSESinglePhaseTableClass::mu_Trho |
std::vector<std::vector<double> > TTSESinglePhaseTableClass::p_Trho |
std::vector<std::vector<double> > TTSESinglePhaseTableClass::rho |
std::vector<std::vector<double> > TTSESinglePhaseTableClass::s |
std::vector<std::vector<double> > TTSESinglePhaseTableClass::s_Trho |
TTSETwoPhaseTableClass* TTSESinglePhaseTableClass::SatL |
TTSETwoPhaseTableClass * TTSESinglePhaseTableClass::SatV |
std::vector<std::vector<double> > TTSESinglePhaseTableClass::T |