1 #ifndef BICUBICBACKEND_H 2 #define BICUBICBACKEND_H 4 #include "TabularBackends.h" 5 #include "Exceptions.h" 6 #include "DataStructures.h" 60 typedef std::vector<std::vector<double>>
mat;
66 imposed_phase_index = iphase_not_imposed;
68 if (!this->AS->get_mole_fractions().empty()) {
72 dataset->
build_coeffs(single_phase_logph, dataset->coeffs_ph);
73 dataset->
build_coeffs(single_phase_logpT, dataset->coeffs_pT);
74 is_mixture = (this->AS->get_mole_fractions().size() > 1);
77 void set_mole_fractions(
const std::vector<CoolPropDbl>& mole_fractions) {
78 this->AS->set_mole_fractions(mole_fractions);
86 dataset->
build_coeffs(single_phase_logph, dataset->coeffs_ph);
87 dataset->
build_coeffs(single_phase_logpT, dataset->coeffs_pT);
90 return get_backend_string(BICUBIC_BACKEND);
107 double x,
double y, std::size_t i, std::size_t j, std::size_t Nx, std::size_t Ny);
108 double evaluate_single_phase_phmolar_derivative(
parameters output, std::size_t i, std::size_t j, std::size_t Nx, std::size_t Ny) {
111 double evaluate_single_phase_pT_derivative(
parameters output, std::size_t i, std::size_t j, std::size_t Nx, std::size_t Ny) {
127 const parameters output,
const double x,
const double y,
const std::size_t i,
const std::size_t j);
128 double evaluate_single_phase_phmolar(
parameters output, std::size_t i, std::size_t j) {
129 return evaluate_single_phase(dataset->single_phase_logph, dataset->coeffs_ph, output, _hmolar, _p, i, j);
131 double evaluate_single_phase_pT(
parameters output, std::size_t i, std::size_t j) {
136 double y, std::size_t& i, std::size_t& j);
140 const parameters variable1,
const double value1,
const parameters otherkey,
const double otherval,
141 std::size_t& i, std::size_t& j);
153 double evaluate_single_phase_phmolar_transport(
parameters output, std::size_t i, std::size_t j) {
156 double evaluate_single_phase_pT_transport(
parameters output, std::size_t i, std::size_t j) {
170 double other,
double y, std::size_t i, std::size_t j);
172 double other,
double x, std::size_t i, std::size_t j);
177 #endif // BICUBICBACKEND_H void check_tables()
Definition: TabularBackends.h:1337
double evaluate_single_phase(const SinglePhaseGriddedTableData &table, const std::vector< std::vector< CellCoeffs >> &coeffs, const parameters output, const double x, const double y, const std::size_t i, const std::size_t j)
Definition: BicubicBackend.cpp:83
std::vector< std::vector< double > > mat
This class implements bicubic interpolation, as very clearly laid out by the page on wikipedia: http:...
Definition: BicubicBackend.h:60
void invert_single_phase_y(const SinglePhaseGriddedTableData &table, const std::vector< std::vector< CellCoeffs >> &coeffs, parameters other_key, double other, double x, std::size_t i, std::size_t j)
Use the single_phase table to solve for y given an x.
Definition: BicubicBackend.cpp:239
virtual void find_nearest_neighbor(SinglePhaseGriddedTableData &table, const std::vector< std::vector< CellCoeffs >> &coeffs, const parameters variable1, const double value1, const parameters otherkey, const double otherval, std::size_t &i, std::size_t &j)
Ask the derived class to find the nearest neighbor (pure virtual)
Definition: BicubicBackend.cpp:26
std::string backend_name(void)
Get a string representation of the backend - for instance "HelmholtzEOSMixtureBackend" for the core m...
Definition: BicubicBackend.h:89
BicubicBackend(shared_ptr< CoolProp::AbstractState > AS)
Instantiator; base class loads or makes tables.
Definition: BicubicBackend.h:65
Definition: BicubicBackend.h:61
This class holds the data for a single-phase interpolation table that is regularly spaced...
Definition: TabularBackends.h:600
double evaluate_single_phase_transport(SinglePhaseGriddedTableData &table, parameters output, double x, double y, std::size_t i, std::size_t j)
Evaluate the single-phase transport properties using linear interpolation.
Definition: BicubicBackend.cpp:50
double evaluate_single_phase_derivative(SinglePhaseGriddedTableData &table, std::vector< std::vector< CellCoeffs >> &coeffs, parameters output, double x, double y, std::size_t i, std::size_t j, std::size_t Nx, std::size_t Ny)
Evaluate a derivative in terms of the native inputs of the table.
Definition: BicubicBackend.cpp:131
void invert_single_phase_x(const SinglePhaseGriddedTableData &table, const std::vector< std::vector< CellCoeffs >> &coeffs, parameters other_key, double other, double y, std::size_t i, std::size_t j)
Use the table to solve for the x variable of the table given the y coordinate of the table and a vari...
Definition: BicubicBackend.cpp:183
This class contains the general code for tabular backends (TTSE, bicubic, etc.)
Definition: TabularBackends.h:1063
virtual void find_native_nearest_good_indices(SinglePhaseGriddedTableData &table, const std::vector< std::vector< CellCoeffs >> &coeffs, double x, double y, std::size_t &i, std::size_t &j)
Ask the derived class to find the nearest good set of i,j that it wants to use (pure virtual) ...
Definition: BicubicBackend.cpp:8
void build_coeffs(SinglePhaseGriddedTableData &table, std::vector< std::vector< CellCoeffs >> &coeffs)
Build the coefficients for bicubic interpolation.
Definition: TabularBackends.cpp:1326
This file contains flash routines in which the state is unknown, and a solver of some kind must be us...
Definition: AbstractState.h:19
parameters
Define some constants that will be used throughout These are constants for the input and output para...
Definition: DataStructures.h:64