From 28ed0c0a8d268b790f037e6530522bb5b8a14506 Mon Sep 17 00:00:00 2001 From: Francesco Witte Date: Thu, 7 Jan 2021 18:52:08 +0100 Subject: [PATCH] Update isoline iterators --- CHANGELOG.rst | 9 +++++++-- src/fluprodia/fluid_property_diagram.py | 18 +++++++++--------- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 7e3cb60..12ce356 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -2,8 +2,13 @@ Changelog ========= -v1.1 (Someday, Somemonth, Someyear) ------------------------------------ +v1.2 (January, 7, 2021) +----------------------- + +* Reduce the number of datappoints for isolines to 200 for faster performance. + +v1.1 (November, 10, 2020) +------------------------- * Change the iterator for isobaric, isenthalpic and isentropic to specific volume. * Adjust individual isoline plotting iterators and isolines accordingly. diff --git a/src/fluprodia/fluid_property_diagram.py b/src/fluprodia/fluid_property_diagram.py index 23aba45..698aad2 100644 --- a/src/fluprodia/fluid_property_diagram.py +++ b/src/fluprodia/fluid_property_diagram.py @@ -574,8 +574,8 @@ def isobaric(self): isolines = self.pressure['isolines'] iterator = 1 / np.append( - np.geomspace(self.v_min, self.v_intermediate, 150, endpoint=False), - np.geomspace(self.v_intermediate, self.v_max, 150)) + np.geomspace(self.v_min, self.v_intermediate, 100, endpoint=False), + np.geomspace(self.v_intermediate, self.v_max, 100)) for p in isolines.round(8): self.pressure[p] = self.single_isobaric(iterator, np.ones(len(iterator)) * p) @@ -585,8 +585,8 @@ def isochoric(self): isolines = self.volume['isolines'] iterator = np.append( - np.geomspace(self.p_trip, self.p_crit * 0.8, 150, endpoint=False), - np.geomspace(self.p_crit * 0.8, self.p_max, 150)) + np.geomspace(self.p_trip, self.p_crit * 0.8, 100, endpoint=False), + np.geomspace(self.p_crit * 0.8, self.p_max, 100)) for v in isolines.round(8): self.volume[v] = self.single_isochoric( @@ -596,7 +596,7 @@ def isothermal(self): """Calculate an isoline of constant temperature.""" isolines = self.temperature['isolines'] - iterator = np.linspace(self.s_min, self.s_max, 300) + iterator = np.linspace(self.s_min, self.s_max, 200) for T in isolines.round(8): self.temperature[T] = self.single_isothermal( @@ -635,8 +635,8 @@ def isenthalpic(self): isolines = self.enthalpy['isolines'] iterator = 1 / np.append( - np.geomspace(self.v_min, self.v_intermediate, 150, endpoint=False), - np.geomspace(self.v_intermediate, self.v_max, 150)) + np.geomspace(self.v_min, self.v_intermediate, 100, endpoint=False), + np.geomspace(self.v_intermediate, self.v_max, 100)) for h in isolines.round(8): self.enthalpy[h] = self.single_isenthalpic( @@ -647,8 +647,8 @@ def isentropic(self): isolines = self.entropy['isolines'] iterator = 1 / np.append( - np.geomspace(self.v_min, self.v_intermediate, 150, endpoint=False), - np.geomspace(self.v_intermediate, self.v_max, 150)) + np.geomspace(self.v_min, self.v_intermediate, 100, endpoint=False), + np.geomspace(self.v_intermediate, self.v_max, 100)) for s in isolines.round(8): self.entropy[s] = self.single_isentropic(