mirror of
https://github.com/CoolProp/CoolProp.git
synced 2026-02-19 10:04:28 -05:00
Clear cached variables for tabular methods
Signed-off-by: Ian Bell <ian.h.bell@gmail.com>
This commit is contained in:
@@ -135,6 +135,9 @@ void CoolProp::BicubicBackend::build_coeffs(SinglePhaseGriddedTableData &table,
|
||||
|
||||
void CoolProp::BicubicBackend::update(CoolProp::input_pairs input_pair, double val1, double val2)
|
||||
{
|
||||
// Clear cached values
|
||||
clear();
|
||||
|
||||
// Flush the cached indices (set to large number)
|
||||
cached_single_phase_i = std::numeric_limits<std::size_t>::max();
|
||||
cached_single_phase_j = std::numeric_limits<std::size_t>::max();
|
||||
@@ -236,7 +239,7 @@ double CoolProp::BicubicBackend::evaluate_single_phase_transport(SinglePhaseGrid
|
||||
}
|
||||
double x1 = table.xvec[i], x2 = table.xvec[i+1], y1 = table.yvec[j], y2 = table.yvec[j+1];
|
||||
double f11 = (*f)[i][j], f12 = (*f)[i][j+1], f21 = (*f)[i+1][j], f22 = (*f)[i+1][j+1];
|
||||
double val = 1/((x2-x1)*(y2-y1))*( f11*(x2- x1)*(y2 - y)
|
||||
double val = 1/((x2-x1)*(y2-y1))*( f11*(x2 - x)*(y2 - y)
|
||||
+f21*(x - x1)*(y2 - y)
|
||||
+f12*(x2 - x)*(y - y1)
|
||||
+f22*(x - x1)*(y - y1));
|
||||
|
||||
@@ -6,6 +6,8 @@
|
||||
|
||||
void CoolProp::TTSEBackend::update(CoolProp::input_pairs input_pair, double val1, double val2)
|
||||
{
|
||||
// Clear cached variables
|
||||
clear();
|
||||
// Flush the cached indices (set to large number)
|
||||
cached_single_phase_i = std::numeric_limits<std::size_t>::max();
|
||||
cached_single_phase_j = std::numeric_limits<std::size_t>::max();
|
||||
|
||||
Reference in New Issue
Block a user