From 3661c41e32d143dc8aaa61c87d4f1fe66ae2f027 Mon Sep 17 00:00:00 2001 From: joergbuchwald <joerg.buchwald@ufz.de> Date: Thu, 14 Jul 2022 16:50:12 +0200 Subject: [PATCH] add interpolation curve for thermal conductivity --- .../water/water/properties/conductivity.py | 19 +++++++++++++++++++ Physics/water/water/water.py | 2 +- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/Physics/water/water/properties/conductivity.py b/Physics/water/water/properties/conductivity.py index 48cabd151..a5626733a 100644 --- a/Physics/water/water/properties/conductivity.py +++ b/Physics/water/water/properties/conductivity.py @@ -45,3 +45,22 @@ class conductivity_2(template.PROPERTY): string = self._getcodeasstring("dvalue",None) string = self._convertpythontoexprtk(string) return string + #(4.12292/298.15-1.63866*2*(temperature/298.15))*0.6065 + +class conductivity_3(template.PROPERTY): + def value(self, temperature): + # use only one-liner to keep it parsable: + return (-1.48445+4.12292*(temperature/298.15)-1.63866*(temperature/298.15)**2)*0.6065 + def dvalue(self, temperature): + # use only one-liner to keep it parsable: + return (4.12292/298.15-1.63866*2*(temperature/298.15))*0.6065 + def dvaluenum(self, temperature): + return np.gradient(self.value(temperature),temperature) + def exprtk_value(self): + string = self._getcodeasstring("value", None) + string = self._convertpythontoexprtk(string) + return string + def exprtk_dvalue(self): + string = self._getcodeasstring("dvalue",None) + string = self._convertpythontoexprtk(string) + return string diff --git a/Physics/water/water/water.py b/Physics/water/water/water.py index 5f63d5617..abf5cf3b3 100644 --- a/Physics/water/water/water.py +++ b/Physics/water/water/water.py @@ -22,7 +22,7 @@ class WATER: viscosity.viscosity_2, viscosity.viscosity_3, viscosity.viscosity_4] - self.conductivities = [conductivity.conductivity_1, conductivity.conductivity_2] + self.conductivities = [conductivity.conductivity_1, conductivity.conductivity_2, conductivity.conductivity_3] self.specificheatcapacities = [specificheatcapacity.specificheatcapacity_1, specificheatcapacity.specificheatcapacity_2] self.expansivities = [expansivity.expansivity_1, expansivity.expansivity_2] self.rho = self.densities[rho]() -- GitLab