implement calc_saturated_liquid_keyed_output and calc_saturated_vapor_keyed_output for tabular backends; closes #814

This commit is contained in:
Ian Bell
2015-09-17 22:17:02 -06:00
parent 3fdd936c55
commit 867b9731f1
2 changed files with 24 additions and 1 deletions

View File

@@ -348,6 +348,27 @@ void CoolProp::TabularBackend::load_tables(){
if (get_debug_level() > 0){ std::cout << "Tables loaded" << std::endl; }
}
CoolPropDbl CoolProp::TabularBackend::calc_saturated_vapor_keyed_output(parameters key){
PhaseEnvelopeData & phase_envelope = dataset->phase_envelope;
PureFluidSaturationTableData &pure_saturation = dataset->pure_saturation;
if (is_mixture){
return phase_envelope_sat(phase_envelope, key, iP, _p);
}
else{
return pure_saturation.evaluate(key, _p, 1, cached_saturation_iL, cached_saturation_iV);
}
}
CoolPropDbl CoolProp::TabularBackend::calc_saturated_liquid_keyed_output(parameters key){
PhaseEnvelopeData & phase_envelope = dataset->phase_envelope;
PureFluidSaturationTableData &pure_saturation = dataset->pure_saturation;
if (is_mixture){
return phase_envelope_sat(phase_envelope, key, iP, _p);
}
else{
return pure_saturation.evaluate(key, _p, 0, cached_saturation_iL, cached_saturation_iV);
}
};
CoolPropDbl CoolProp::TabularBackend::calc_p(void){
PhaseEnvelopeData & phase_envelope = dataset->phase_envelope;
if (using_single_phase_table){

View File

@@ -784,7 +784,9 @@ class TabularBackend : public AbstractState
virtual double evaluate_single_phase_pT_transport(parameters output, std::size_t i, std::size_t j) = 0;
virtual double evaluate_single_phase_phmolar_derivative(parameters output, std::size_t i, std::size_t j, std::size_t Nx, std::size_t Ny) = 0;
virtual double evaluate_single_phase_pT_derivative(parameters output, std::size_t i, std::size_t j, std::size_t Nx, std::size_t Ny) = 0;
CoolPropDbl calc_saturated_liquid_keyed_output(parameters key);
CoolPropDbl calc_saturated_vapor_keyed_output(parameters key);
/// Returns the path to the tables that shall be written
std::string path_to_tables(void);
/// Load the tables from file; throws UnableToLoadException if there is a problem