From 2bb3e182e51f2062e46237d790d8bef10ffc545d Mon Sep 17 00:00:00 2001 From: jowr Date: Thu, 17 Jul 2014 11:52:12 +0200 Subject: [PATCH] Fitting works, some tests do not pass. --- .../CPIncomp/BaseObjects.py | 12 +- .../CPIncomp/CoefficientObjects.py | 2 +- .../CPIncomp/DataObjects.py | 124 ++++- .../CPIncomp/PureFluids.py | 523 ++++++++++++++++++ .../CPIncomp/WriterObjects.py | 222 +++++--- dev/incompressible_liquids/ExamplePure.json | 107 ++-- .../ExampleSolution.json | 221 ++------ .../all_incompressibles.py | 285 ++++++---- include/IncompressibleFluid.h | 40 ++ 9 files changed, 1101 insertions(+), 435 deletions(-) create mode 100644 dev/incompressible_liquids/CPIncomp/PureFluids.py diff --git a/dev/incompressible_liquids/CPIncomp/BaseObjects.py b/dev/incompressible_liquids/CPIncomp/BaseObjects.py index 7507d285..aeb779db 100644 --- a/dev/incompressible_liquids/CPIncomp/BaseObjects.py +++ b/dev/incompressible_liquids/CPIncomp/BaseObjects.py @@ -27,7 +27,7 @@ class IncompressibleData(object): self.maxLog = np.log(np.finfo(np.float64).max-1) self.minLog = -self.maxLog - self.DEBUG = True + self.DEBUG = False ### Base functions that handle the custom data type, just a place holder to show the structure. @@ -113,12 +113,12 @@ class IncompressibleData(object): return (r,c,np.reshape(array,(r,c))) - def fit(self, x=0.0, y=0.0, xbase=0.0, ybase=0.0): + def fitCoeffs(self, x=0.0, y=0.0, xbase=0.0, ybase=0.0): """ A function that selects the correct equations and fits coefficients. Some functions require a start guess for the coefficients to work properly. - """ + """ dr,dc,_ = self.shapeArray(self.data) xr,xc,x = self.shapeArray(x) yr,yc,y = self.shapeArray(y, axs=1) @@ -126,6 +126,12 @@ class IncompressibleData(object): if self.DEBUG: print("Data : ({0},{1})".format(dr,dc)) if self.DEBUG: print("x-axis : ({0},{1})".format(xr,xc)) if self.DEBUG: print("y-axis : ({0},{1})".format(yr,yc)) + + if dr==1 and dc==1: # + if self.DEBUG: print("Data no set, we cannot fit the coefficients") + self.coeffs = None + self.type = self.INCOMPRESSIBLE_NOT_SET + return if (xc!=1): raise ValueError("The first input has to be a 2D array with one column.") if (yr!=1): raise ValueError("The second input has to be a 2D array with one row.") diff --git a/dev/incompressible_liquids/CPIncomp/CoefficientObjects.py b/dev/incompressible_liquids/CPIncomp/CoefficientObjects.py index 3dc77588..7a6551a0 100644 --- a/dev/incompressible_liquids/CPIncomp/CoefficientObjects.py +++ b/dev/incompressible_liquids/CPIncomp/CoefficientObjects.py @@ -243,7 +243,7 @@ class SecCoolExample(CoefficientData): -22.973221700, -1.1040507200*100.0, -0.0120762281*100.0*100.0, - -9.343458E-05*100.0*100.0*100.0]) + -9.343458E-05*100.0*100.0*100.0]) class MelinderExample(CoefficientData): diff --git a/dev/incompressible_liquids/CPIncomp/DataObjects.py b/dev/incompressible_liquids/CPIncomp/DataObjects.py index f298dbce..76854f41 100644 --- a/dev/incompressible_liquids/CPIncomp/DataObjects.py +++ b/dev/incompressible_liquids/CPIncomp/DataObjects.py @@ -39,6 +39,7 @@ class SolutionData(object): #self.viscosity.coeffs = np.array([+7e+2, -6e+1, +1e+1]) #self.saturation_pressure.type = self.saturation_pressure.INCOMPRESSIBLE_EXPONENTIAL #self.saturation_pressure.coeffs = np.array([-5e+3, +3e+1, -1e+1]) + self.xref = 0.0 self.Tref = 0.0 @@ -47,6 +48,38 @@ class SolutionData(object): self.sref = 0.0 self.uref = 0.0 self.rhoref = 0.0 + +# def getDataObjects(self): +# objList = {} +# objList["temperature"] = self.temperature +# objList["concentration"] = self.concentration +# objList["density"] = self.density +# objList["specific_heat"] = self.specific_heat +# objList["viscosity"] = self.viscosity +# objList["conductivity"] = self.conductivity +# objList["saturation_pressure"] = self.saturation_pressure +# objList["T_freeze"] = self.T_freeze +# objList["volume2mass"] = self.volume2mass +# objList["mass2mole"] = self.mass2mole +# return objList + + def getPolyObjects(self): + objList = {} + objList["density"] = self.density + objList["specific heat"] = self.specific_heat +# objList["viscosity"] = self.viscosity + objList["conductivity"] = self.conductivity +# objList["saturation_pressure"] = self.saturation_pressure +# objList["T_freeze"] = self.T_freeze +# objList["volume2mass"] = self.volume2mass +# objList["mass2mole"] = self.mass2mole + return objList + + def getExpPolyObjects(self): + objList = {} + objList["viscosity"] = self.viscosity + objList["saturation pressure"] = self.saturation_pressure + return objList def rho (self, T, p=0.0, x=0.0, c=None): @@ -87,7 +120,7 @@ class SolutionData(object): def cond(self, T, p=0.0, x=0.0, c=None): return self.conductivity.baseFunction(T, x, self.Tbase, self.xbase, c=c) - def psat(self, T, x=0.0, c=None): + def psat(self, T, x=0.0, c=None): return self.saturation_pressure.baseFunction(T, x, self.Tbase, self.xbase, c=c) def Tfreeze(self, p=0.0, x=0.0, c=None): @@ -112,11 +145,44 @@ class SolutionData(object): self.sref = s0 self.href = self.h(T0,p0,x0) self.sref = self.s(T0,p0,x0) - - -class PureExample(SolutionData): + + +class PureData(SolutionData): + """ + An extension of the solution data that makes it + easier to gather data for pure fluids. + """ def __init__(self): - SolutionData.__init__(self) + SolutionData.__init__(self) + self.concentration.data = np.array([ 0 ]) # mass fraction + + def reshapeData(self, dataArray, length): + """ + Makes any array 1-dimensional and implicitly + checks the length. + """ + if dataArray!=None: + return np.reshape(dataArray, (length,1)) + else: + return None + + + def reshapeAll(self): + len_T = len(self.temperature.data) + #len_x = len(self.concentration.data) + self.density.data = self.reshapeData(self.density.data, len_T) + self.specific_heat.data = self.reshapeData(self.specific_heat.data, len_T) + self.viscosity.data = self.reshapeData(self.viscosity.data, len_T) + self.conductivity.data = self.reshapeData(self.conductivity.data, len_T) + self.saturation_pressure.data = self.reshapeData(self.saturation_pressure.data, len_T) + #self.T_freeze.data = self.reshapeData(self.T_freeze.data, len_T) + #self.volume2mass.data = self.reshapeData(self.volume2mass.data, len_T) + #self.mass2mole.data = self.reshapeData(self.mass2mole.data, len_T) + + +class PureExample(PureData): + def __init__(self): + PureData.__init__(self) self.name = "ExamplePure" self.description = "Heat transfer fluid TherminolD12 by Solutia" self.reference = "Solutia data sheet" @@ -124,13 +190,13 @@ class PureExample(SolutionData): self.Tmin = 50 + 273.15 self.TminPsat = self.Tmax - self.temperature.data = np.array([ 50 , 60 , 70 , 80 , 90 , 100 , 110 , 120 , 130 , 140 , 150 ])+273.15 # Kelvin - self.concentration.data = np.array([ 0 ])/100.0 # mass fraction - self.density.data = np.array([[ 740],[ 733],[ 726],[ 717],[ 710],[ 702],[ 695],[ 687],[ 679],[ 670],[ 662]]) # kg/m3 - self.specific_heat.data = np.array([[ 2235],[ 2280],[ 2326],[ 2361],[ 2406],[ 2445],[ 2485],[ 2528],[ 2571],[ 2607],[ 2645]]) # J/kg-K - self.viscosity.data = np.array([[0.804],[ 0.704],[ 0.623],[ 0.556],[ 0.498],[ 0.451],[ 0.410],[ 0.374],[ 0.346],[ 0.317],[ 0.289]]) # Pa-s - self.conductivity.data = np.array([[0.105],[ 0.104],[ 0.102],[ 0.100],[ 0.098],[ 0.096],[ 0.095],[ 0.093],[ 0.091],[ 0.089],[ 0.087]]) # W/m-K - self.saturation_pressure.data = np.array([[ 0.5],[ 0.9],[ 1.4],[ 2.3],[ 3.9],[ 6.0],[ 8.7],[ 12.4],[ 17.6],[ 24.4],[ 33.2]]) # Pa + self.temperature.data = np.array([ 50, 60, 70, 80, 90, 100, 110, 120, 130, 140, 150])+273.15 # Kelvin + self.density.data = np.array([ 740, 733, 726, 717, 710, 702, 695, 687, 679, 670, 662]) # kg/m3 + self.specific_heat.data = np.array([ 2235, 2280, 2326, 2361, 2406, 2445, 2485, 2528, 2571, 2607, 2645]) # J/kg-K + self.viscosity.data = np.array([0.804, 0.704, 0.623, 0.556, 0.498, 0.451, 0.410, 0.374, 0.346, 0.317, 0.289]) # Pa-s + self.conductivity.data = np.array([0.105, 0.104, 0.102, 0.100, 0.098, 0.096, 0.095, 0.093, 0.091, 0.089, 0.087]) # W/m-K + self.saturation_pressure.data = np.array([ 0.5, 0.9, 1.4, 2.3, 3.9, 6.0, 8.7, 12.4, 17.6, 24.4, 33.2]) # Pa + self.reshapeAll() class SolutionExample(SolutionData): @@ -167,26 +233,40 @@ class SolutionExample(SolutionData): # [np.nan, np.nan, 1009.2, np.nan, np.nan, np.nan, np.nan]]) # kg/m3 + + if __name__ == '__main__': # obj = PureExample() # obj.density.type = obj.density.INCOMPRESSIBLE_POLYNOMIAL # obj.density.coeffs = np.ones((3,)) # print(obj.density.coeffs) -# obj.density.fit(obj.temperature.data) +# obj.density.fitCoeffs(obj.temperature.data) # print(obj.density.coeffs) # print(obj.density.data[2][0],obj.rho(obj.temperature.data[2])) # -# obj = PureExample() -# print(obj.saturation_pressure.coeffs) -# obj.saturation_pressure.fit(obj.temperature.data) -# print(obj.saturation_pressure.coeffs) - - obj = SolutionExample() + obj = PureExample() obj.density.type = obj.density.INCOMPRESSIBLE_POLYNOMIAL - obj.density.coeffs = np.ones((3,5)) + obj.density.coeffs = np.zeros((4,6)) print(obj.density.coeffs) - obj.density.fit(obj.temperature.data,obj.concentration.data) + obj.density.fitCoeffs(obj.temperature.data) print(obj.density.coeffs) + obj.saturation_pressure.type = obj.density.INCOMPRESSIBLE_EXPPOLYNOMIAL + obj.saturation_pressure.coeffs = np.zeros((4,6)) + print(obj.saturation_pressure.coeffs) + obj.saturation_pressure.fitCoeffs(obj.temperature.data) + print(obj.saturation_pressure.coeffs) + print(obj.density.data[2][0],obj.rho(obj.temperature.data[2],10e5,obj.concentration.data[0])) - print(obj.density.data[2][2],obj.rho(obj.temperature.data[2],10e5,obj.concentration.data[2])) + print(obj.density.data[5][0],obj.rho(obj.temperature.data[5],10e5,obj.concentration.data[0])) + print(obj.saturation_pressure.data[2][0],obj.psat(obj.temperature.data[2],obj.concentration.data[0])) + print(obj.saturation_pressure.data[5][0],obj.psat(obj.temperature.data[5],obj.concentration.data[0])) + +# obj = SolutionExample() +# obj.density.type = obj.density.INCOMPRESSIBLE_POLYNOMIAL +# obj.density.coeffs = np.ones((3,5)) +# print(obj.density.coeffs) +# obj.density.fitCoeffs(obj.temperature.data,obj.concentration.data) +# print(obj.density.coeffs) +# print(obj.density.data[2][0],obj.rho(obj.temperature.data[2],10e5,obj.concentration.data[0])) +# print(obj.density.data[2][2],obj.rho(obj.temperature.data[2],10e5,obj.concentration.data[2])) \ No newline at end of file diff --git a/dev/incompressible_liquids/CPIncomp/PureFluids.py b/dev/incompressible_liquids/CPIncomp/PureFluids.py new file mode 100644 index 00000000..3414a646 --- /dev/null +++ b/dev/incompressible_liquids/CPIncomp/PureFluids.py @@ -0,0 +1,523 @@ +import numpy as np +from CPIncomp.DataObjects import PureData + + + +class TherminolD12(PureData): + """ + Heat transfer fluid Therminol D12 by Solutia + Source: Therminol Heat Transfer Reference Disk + """ + def __init__(self): + PureData.__init__(self) + self.temperature.data = np.array([-8.50000E+1, -8.00000E+1, -7.50000E+1, -7.00000E+1, -6.50000E+1, -6.00000E+1, -5.50000E+1, -5.00000E+1, -4.50000E+1, -4.00000E+1, -3.50000E+1, -3.00000E+1, -2.50000E+1, -2.00000E+1, -1.50000E+1, -1.00000E+1, -5.00000E+0, +0.00000E+0, +5.00000E+0, +1.00000E+1, +1.50000E+1, +2.00000E+1, +2.50000E+1, +3.00000E+1, +3.50000E+1, +4.00000E+1, +4.50000E+1, +5.00000E+1, +5.50000E+1, +6.00000E+1, +6.50000E+1, +7.00000E+1, +7.50000E+1, +8.00000E+1, +8.50000E+1, +9.00000E+1, +9.50000E+1, +1.00000E+2, +1.05000E+2, +1.10000E+2, +1.15000E+2, +1.20000E+2, +1.25000E+2, +1.30000E+2, +1.35000E+2, +1.40000E+2, +1.45000E+2, +1.50000E+2, +1.55000E+2, +1.60000E+2, +1.65000E+2, +1.70000E+2, +1.75000E+2, +1.80000E+2, +1.85000E+2, +1.90000E+2, +1.95000E+2, +2.00000E+2, +2.05000E+2, +2.10000E+2, +2.15000E+2, +2.20000E+2, +2.25000E+2, +2.30000E+2])+273.15 # Kelvin + self.density.data = np.array([+8.35000E+2, +8.32000E+2, +8.28000E+2, +8.25000E+2, +8.22000E+2, +8.18000E+2, +8.15000E+2, +8.11000E+2, +8.08000E+2, +8.05000E+2, +8.01000E+2, +7.98000E+2, +7.94000E+2, +7.91000E+2, +7.87000E+2, +7.84000E+2, +7.80000E+2, +7.77000E+2, +7.73000E+2, +7.70000E+2, +7.66000E+2, +7.62000E+2, +7.59000E+2, +7.55000E+2, +7.52000E+2, +7.48000E+2, +7.44000E+2, +7.41000E+2, +7.37000E+2, +7.33000E+2, +7.29000E+2, +7.26000E+2, +7.22000E+2, +7.18000E+2, +7.14000E+2, +7.10000E+2, +7.06000E+2, +7.03000E+2, +6.99000E+2, +6.95000E+2, +6.91000E+2, +6.87000E+2, +6.82000E+2, +6.78000E+2, +6.74000E+2, +6.70000E+2, +6.66000E+2, +6.61000E+2, +6.57000E+2, +6.53000E+2, +6.48000E+2, +6.44000E+2, +6.39000E+2, +6.35000E+2, +6.30000E+2, +6.25000E+2, +6.20000E+2, +6.16000E+2, +6.11000E+2, +6.06000E+2, +6.00000E+2, +5.95000E+2, +5.90000E+2, +5.84000E+2]) # kg/m3 + self.specific_heat.data = np.array([+1.69400E+0, +1.71200E+0, +1.73100E+0, +1.75000E+0, +1.76800E+0, +1.78700E+0, +1.80600E+0, +1.82400E+0, +1.84300E+0, +1.86200E+0, +1.88100E+0, +1.90000E+0, +1.91900E+0, +1.93800E+0, +1.95700E+0, +1.97700E+0, +1.99600E+0, +2.01500E+0, +2.03500E+0, +2.05400E+0, +2.07300E+0, +2.09300E+0, +2.11300E+0, +2.13200E+0, +2.15200E+0, +2.17200E+0, +2.19100E+0, +2.21100E+0, +2.23100E+0, +2.25100E+0, +2.27100E+0, +2.29100E+0, +2.31200E+0, +2.33200E+0, +2.35200E+0, +2.37300E+0, +2.39300E+0, +2.41400E+0, +2.43400E+0, +2.45500E+0, +2.47600E+0, +2.49600E+0, +2.51700E+0, +2.53800E+0, +2.55900E+0, +2.58000E+0, +2.60200E+0, +2.62300E+0, +2.64400E+0, +2.66600E+0, +2.68700E+0, +2.70900E+0, +2.73100E+0, +2.75300E+0, +2.77500E+0, +2.79700E+0, +2.82000E+0, +2.84200E+0, +2.86500E+0, +2.88800E+0, +2.91100E+0, +2.93500E+0, +2.95900E+0, +2.98300E+0])*1000. # J/kg-K + self.conductivity.data = np.array([+1.24400E-1, +1.23800E-1, +1.23200E-1, +1.22500E-1, +1.21900E-1, +1.21300E-1, +1.20600E-1, +1.20000E-1, +1.19300E-1, +1.18600E-1, +1.18000E-1, +1.17300E-1, +1.16600E-1, +1.15900E-1, +1.15200E-1, +1.14500E-1, +1.13700E-1, +1.13000E-1, +1.12200E-1, +1.11500E-1, +1.10700E-1, +1.10000E-1, +1.09200E-1, +1.08400E-1, +1.07600E-1, +1.06800E-1, +1.06000E-1, +1.05200E-1, +1.04400E-1, +1.03500E-1, +1.02700E-1, +1.01900E-1, +1.01000E-1, +1.00100E-1, +9.93000E-2, +9.84000E-2, +9.75000E-2, +9.66000E-2, +9.57000E-2, +9.48000E-2, +9.39000E-2, +9.29000E-2, +9.20000E-2, +9.10000E-2, +9.01000E-2, +8.91000E-2, +8.82000E-2, +8.72000E-2, +8.62000E-2, +8.52000E-2, +8.42000E-2, +8.32000E-2, +8.22000E-2, +8.12000E-2, +8.01000E-2, +7.91000E-2, +7.80000E-2, +7.70000E-2, +7.59000E-2, +7.48000E-2, +7.38000E-2, +7.27000E-2, +7.16000E-2, +7.05000E-2]) # W/m-K + self.viscosity.data = np.array([+3.59000E-1, +1.77000E-1, +9.59000E-2, +5.64000E-2, +3.55000E-2, +2.36000E-2, +1.65000E-2, +1.20000E-2, +9.07000E-3, +7.06000E-3, +5.63000E-3, +4.60000E-3, +3.82000E-3, +3.24000E-3, +2.78000E-3, +2.41000E-3, +2.12000E-3, +1.88000E-3, +1.69000E-3, +1.52000E-3, +1.38000E-3, +1.26000E-3, +1.16000E-3, +1.07000E-3, +9.88000E-4, +9.18000E-4, +8.56000E-4, +8.00000E-4, +7.50000E-4, +7.05000E-4, +6.64000E-4, +6.26000E-4, +5.92000E-4, +5.61000E-4, +5.31000E-4, +5.04000E-4, +4.79000E-4, +4.56000E-4, +4.35000E-4, +4.14000E-4, +3.95000E-4, +3.78000E-4, +3.61000E-4, +3.45000E-4, +3.30000E-4, +3.16000E-4, +3.03000E-4, +2.90000E-4, +2.78000E-4, +2.67000E-4, +2.57000E-4, +2.46000E-4, +2.37000E-4, +2.27000E-4, +2.19000E-4, +2.10000E-4, +2.02000E-4, +1.95000E-4, +1.87000E-4, +1.80000E-4, +1.74000E-4, +1.67000E-4, +1.61000E-4, +1.56000E-4]) # Pa-s + self.saturation_pressure.data = np.array([+4.75000E-9, +2.07000E-8, +8.08000E-8, +2.81000E-7, +8.86000E-7, +2.56000E-6, +6.82000E-6, +1.70000E-5, +3.96000E-5, +8.75000E-5, +1.84000E-4, +3.68000E-4, +7.06000E-4, +1.30000E-3, +2.33000E-3, +4.02000E-3, +6.75000E-3, +1.10000E-2, +1.76000E-2, +2.73000E-2, +4.16000E-2, +6.21000E-2, +9.10000E-2, +1.31000E-1, +1.86000E-1, +2.59000E-1, +3.56000E-1, +4.84000E-1, +6.48000E-1, +8.59000E-1, +1.13000E+0, +1.46000E+0, +1.88000E+0, +2.39000E+0, +3.01000E+0, +3.77000E+0, +4.68000E+0, +5.76000E+0, +7.05000E+0, +8.57000E+0, +1.03000E+1, +1.24000E+1, +1.48000E+1, +1.76000E+1, +2.08000E+1, +2.44000E+1, +2.85000E+1, +3.32000E+1, +3.84000E+1, +4.43000E+1, +5.09000E+1, +5.83000E+1, +6.64000E+1, +7.55000E+1, +8.55000E+1, +9.65000E+1, +1.09000E+2, +1.22000E+2, +1.36000E+2, +1.52000E+2, +1.69000E+2, +1.88000E+2, +2.08000E+2, +2.29000E+2])*1000. # Pa + self.Tmin = np.min(self.temperature.data) + self.Tmax = np.max(self.temperature.data) + self.TminPsat = self.Tmin + self.name = "TD12" + self.description = "TherminolD12" + self.reshapeAll() + +class TherminolVP1(PureData): + """ + Heat transfer fluid Therminol VP-1 by Solutia + Source: Therminol Heat Transfer Reference Disk + """ + def __init__(self): + PureData.__init__(self) + self.temperature.data = np.array([+1.20000E+1, +1.70000E+1, +2.20000E+1, +2.70000E+1, +3.20000E+1, +3.70000E+1, +4.20000E+1, +4.70000E+1, +5.20000E+1, +5.70000E+1, +6.20000E+1, +6.70000E+1, +7.20000E+1, +7.70000E+1, +8.20000E+1, +8.70000E+1, +9.20000E+1, +9.70000E+1, +1.02000E+2, +1.07000E+2, +1.12000E+2, +1.17000E+2, +1.22000E+2, +1.27000E+2, +1.32000E+2, +1.37000E+2, +1.42000E+2, +1.47000E+2, +1.52000E+2, +1.57000E+2, +1.62000E+2, +1.67000E+2, +1.72000E+2, +1.77000E+2, +1.82000E+2, +1.87000E+2, +1.92000E+2, +1.97000E+2, +2.02000E+2, +2.07000E+2, +2.12000E+2, +2.17000E+2, +2.22000E+2, +2.27000E+2, +2.32000E+2, +2.37000E+2, +2.42000E+2, +2.47000E+2, +2.52000E+2, +2.57000E+2, +2.62000E+2, +2.67000E+2, +2.72000E+2, +2.77000E+2, +2.82000E+2, +2.87000E+2, +2.92000E+2, +2.97000E+2, +3.02000E+2, +3.07000E+2, +3.12000E+2, +3.17000E+2, +3.22000E+2, +3.27000E+2, +3.32000E+2, +3.37000E+2, +3.42000E+2, +3.47000E+2, +3.52000E+2, +3.57000E+2, +3.62000E+2, +3.67000E+2, +3.72000E+2, +3.77000E+2, +3.82000E+2, +3.87000E+2, +3.92000E+2, +3.97000E+2])+273.15 # Kelvin + self.density.data = np.array([+1.07000E+3, +1.07000E+3, +1.06000E+3, +1.06000E+3, +1.05000E+3, +1.05000E+3, +1.05000E+3, +1.04000E+3, +1.04000E+3, +1.03000E+3, +1.03000E+3, +1.03000E+3, +1.02000E+3, +1.02000E+3, +1.01000E+3, +1.01000E+3, +1.01000E+3, +1.00000E+3, +9.97000E+2, +9.93000E+2, +9.88000E+2, +9.84000E+2, +9.80000E+2, +9.76000E+2, +9.72000E+2, +9.67000E+2, +9.63000E+2, +9.59000E+2, +9.55000E+2, +9.50000E+2, +9.46000E+2, +9.42000E+2, +9.37000E+2, +9.33000E+2, +9.29000E+2, +9.24000E+2, +9.20000E+2, +9.15000E+2, +9.11000E+2, +9.06000E+2, +9.02000E+2, +8.98000E+2, +8.93000E+2, +8.89000E+2, +8.84000E+2, +8.79000E+2, +8.75000E+2, +8.70000E+2, +8.65000E+2, +8.60000E+2, +8.56000E+2, +8.51000E+2, +8.46000E+2, +8.41000E+2, +8.36000E+2, +8.31000E+2, +8.25000E+2, +8.20000E+2, +8.15000E+2, +8.10000E+2, +8.04000E+2, +7.99000E+2, +7.93000E+2, +7.88000E+2, +7.82000E+2, +7.76000E+2, +7.70000E+2, +7.65000E+2, +7.59000E+2, +7.52000E+2, +7.46000E+2, +7.40000E+2, +7.33000E+2, +7.27000E+2, +7.20000E+2, +7.13000E+2, +7.06000E+2, +6.99000E+2]) # kg/m3 + self.specific_heat.data = np.array([+1.52300E+0, +1.53700E+0, +1.55200E+0, +1.56600E+0, +1.58100E+0, +1.59600E+0, +1.61000E+0, +1.62400E+0, +1.63900E+0, +1.65300E+0, +1.66800E+0, +1.68200E+0, +1.69600E+0, +1.71000E+0, +1.72400E+0, +1.73900E+0, +1.75300E+0, +1.76700E+0, +1.78100E+0, +1.79500E+0, +1.80900E+0, +1.82200E+0, +1.83600E+0, +1.85000E+0, +1.86400E+0, +1.87800E+0, +1.89100E+0, +1.90500E+0, +1.91900E+0, +1.93200E+0, +1.94600E+0, +1.95900E+0, +1.97300E+0, +1.98600E+0, +2.00000E+0, +2.01300E+0, +2.02700E+0, +2.04000E+0, +2.05400E+0, +2.06700E+0, +2.08000E+0, +2.09300E+0, +2.10700E+0, +2.12000E+0, +2.13300E+0, +2.14700E+0, +2.16000E+0, +2.17300E+0, +2.18600E+0, +2.19900E+0, +2.21300E+0, +2.22600E+0, +2.23900E+0, +2.25200E+0, +2.26600E+0, +2.27900E+0, +2.29300E+0, +2.30600E+0, +2.31900E+0, +2.33300E+0, +2.34700E+0, +2.36000E+0, +2.37400E+0, +2.38800E+0, +2.40200E+0, +2.41600E+0, +2.43100E+0, +2.44600E+0, +2.46000E+0, +2.47600E+0, +2.49100E+0, +2.50700E+0, +2.52300E+0, +2.54000E+0, +2.55800E+0, +2.57600E+0, +2.59500E+0, +2.61500E+0])*1000. # J/kg-K + self.conductivity.data = np.array([+1.37000E-1, +1.36600E-1, +1.36100E-1, +1.35600E-1, +1.35200E-1, +1.34700E-1, +1.34200E-1, +1.33600E-1, +1.33100E-1, +1.32600E-1, +1.32000E-1, +1.31500E-1, +1.30900E-1, +1.30400E-1, +1.29800E-1, +1.29200E-1, +1.28600E-1, +1.28000E-1, +1.27400E-1, +1.26800E-1, +1.26200E-1, +1.25600E-1, +1.24900E-1, +1.24300E-1, +1.23600E-1, +1.22900E-1, +1.22300E-1, +1.21600E-1, +1.20900E-1, +1.20200E-1, +1.19500E-1, +1.18700E-1, +1.18000E-1, +1.17300E-1, +1.16500E-1, +1.15800E-1, +1.15000E-1, +1.14200E-1, +1.13500E-1, +1.12700E-1, +1.11900E-1, +1.11100E-1, +1.10300E-1, +1.09400E-1, +1.08600E-1, +1.07800E-1, +1.06900E-1, +1.06000E-1, +1.05200E-1, +1.04300E-1, +1.03400E-1, +1.02500E-1, +1.01600E-1, +1.00700E-1, +9.98000E-2, +9.89000E-2, +9.79000E-2, +9.70000E-2, +9.60000E-2, +9.51000E-2, +9.41000E-2, +9.31000E-2, +9.21000E-2, +9.11000E-2, +9.01000E-2, +8.91000E-2, +8.81000E-2, +8.71000E-2, +8.60000E-2, +8.50000E-2, +8.39000E-2, +8.29000E-2, +8.18000E-2, +8.07000E-2, +7.96000E-2, +7.85000E-2, +7.74000E-2, +7.63000E-2]) # W/m-K + self.viscosity.data = np.array([+5.48000E-3, +4.68000E-3, +4.05000E-3, +3.54000E-3, +3.12000E-3, +2.78000E-3, +2.49000E-3, +2.24000E-3, +2.04000E-3, +1.86000E-3, +1.70000E-3, +1.57000E-3, +1.45000E-3, +1.34000E-3, +1.25000E-3, +1.16000E-3, +1.09000E-3, +1.02000E-3, +9.62000E-4, +9.06000E-4, +8.56000E-4, +8.10000E-4, +7.68000E-4, +7.29000E-4, +6.93000E-4, +6.60000E-4, +6.30000E-4, +6.01000E-4, +5.75000E-4, +5.51000E-4, +5.28000E-4, +5.06000E-4, +4.86000E-4, +4.67000E-4, +4.50000E-4, +4.33000E-4, +4.18000E-4, +4.03000E-4, +3.89000E-4, +3.76000E-4, +3.64000E-4, +3.52000E-4, +3.41000E-4, +3.30000E-4, +3.20000E-4, +3.10000E-4, +3.01000E-4, +2.93000E-4, +2.84000E-4, +2.77000E-4, +2.69000E-4, +2.62000E-4, +2.55000E-4, +2.48000E-4, +2.42000E-4, +2.36000E-4, +2.30000E-4, +2.25000E-4, +2.19000E-4, +2.14000E-4, +2.09000E-4, +2.04000E-4, +2.00000E-4, +1.96000E-4, +1.91000E-4, +1.87000E-4, +1.83000E-4, +1.80000E-4, +1.76000E-4, +1.72000E-4, +1.69000E-4, +1.66000E-4, +1.62000E-4, +1.59000E-4, +1.56000E-4, +1.53000E-4, +1.51000E-4, +1.48000E-4]) # Pa-s + self.saturation_pressure.data = np.array([+5.76000E-4, +9.86000E-4, +1.65000E-3, +2.68000E-3, +4.27000E-3, +6.67000E-3, +1.02000E-2, +1.53000E-2, +2.26000E-2, +3.29000E-2, +4.71000E-2, +6.65000E-2, +9.26000E-2, +1.27000E-1, +1.73000E-1, +2.32000E-1, +3.09000E-1, +4.07000E-1, +5.30000E-1, +6.85000E-1, +8.77000E-1, +1.11000E+0, +1.40000E+0, +1.76000E+0, +2.18000E+0, +2.70000E+0, +3.31000E+0, +4.03000E+0, +4.88000E+0, +5.88000E+0, +7.05000E+0, +8.40000E+0, +9.96000E+0, +1.18000E+1, +1.38000E+1, +1.62000E+1, +1.89000E+1, +2.19000E+1, +2.53000E+1, +2.92000E+1, +3.35000E+1, +3.84000E+1, +4.37000E+1, +4.97000E+1, +5.63000E+1, +6.37000E+1, +7.17000E+1, +8.06000E+1, +9.03000E+1, +1.01000E+2, +1.13000E+2, +1.25000E+2, +1.39000E+2, +1.54000E+2, +1.70000E+2, +1.87000E+2, +2.06000E+2, +2.26000E+2, +2.48000E+2, +2.71000E+2, +2.96000E+2, +3.23000E+2, +3.51000E+2, +3.82000E+2, +4.14000E+2, +4.48000E+2, +4.85000E+2, +5.24000E+2, +5.64000E+2, +6.08000E+2, +6.54000E+2, +7.02000E+2, +7.53000E+2, +8.06000E+2, +8.62000E+2, +9.21000E+2, +9.83000E+2, +1.05000E+3])*1000. # Pa + self.Tmin = np.min(self.temperature.data) + self.Tmax = np.max(self.temperature.data) + self.TminPsat = self.Tmin + self.name = "TVP1" + self.description = "TherminolVP1" + self.reshapeAll() + + +class Therminol66(PureData): + """ + Heat transfer fluid Therminol 66 by Solutia + Source: Therminol Heat Transfer Reference Disk + """ + def __init__(self): + PureData.__init__(self) + temp = np.linspace(0, 380, 30) # Celsius temperaure + def f_rho( T_C): + return -0.614254 * T_C - 0.000321 * T_C**2 + 1020.62 + def f_cp( T_C): + return 0.003313 * T_C + 0.0000008970785 * T_C**2 + 1.496005 + def f_mu( T_C): + return np.exp(586.375/(T_C+62.5) -2.2809 ) + def f_lam( T_C): + return -0.000033 * T_C - 0.00000015 * T_C**2 + 0.118294 + def f_psa( T_C): + return np.exp(-9094.51/(T_C+340) + 17.6371 ) + + self.temperature.data = temp + 273.15 # Kelvin + self.density.data = f_rho(temp) # kg/m3 + self.specific_heat.data = f_cp(temp)*1e3 # J/kg-K + self.conductivity.data = f_lam(temp) # W/m-K + # Viscosity: Pa-s (dynamic = kinematic * rho) + # mm2/s /1e6 -> m2/s * kg/m3 = kg/s/m = Pa s + self.viscosity.data = f_mu(temp)/1e6 * self.density.data + self.saturation_pressure.data = f_psa(temp) * 1e3 # Pa + self.Tmin = np.min(self.temperature.data) + self.Tmax = np.max(self.temperature.data) + self.TminPsat = 70+273.15 + self.name = "T66" + self.description = "Therminol66" + self.reshapeAll() + + +class Therminol72(PureData): + """ + Heat transfer fluid Therminol 72 by Solutia + Source: Therminol Heat Transfer Reference Disk + """ + def __init__(self): + PureData.__init__(self) + self.temperature.data = np.array([-1.00000E+1, -5.00000E+0, +0.00000E+0, +5.00000E+0, +1.00000E+1, +1.50000E+1, +2.00000E+1, +2.50000E+1, +3.00000E+1, +3.50000E+1, +4.00000E+1, +4.50000E+1, +5.00000E+1, +5.50000E+1, +6.00000E+1, +6.50000E+1, +7.00000E+1, +7.50000E+1, +8.00000E+1, +8.50000E+1, +9.00000E+1, +9.50000E+1, +1.00000E+2, +1.05000E+2, +1.10000E+2, +1.15000E+2, +1.20000E+2, +1.25000E+2, +1.30000E+2, +1.35000E+2, +1.40000E+2, +1.45000E+2, +1.50000E+2, +1.55000E+2, +1.60000E+2, +1.65000E+2, +1.70000E+2, +1.75000E+2, +1.80000E+2, +1.85000E+2, +1.90000E+2, +1.95000E+2, +2.00000E+2, +2.05000E+2, +2.10000E+2, +2.15000E+2, +2.20000E+2, +2.25000E+2, +2.30000E+2, +2.35000E+2, +2.40000E+2, +2.45000E+2, +2.50000E+2, +2.55000E+2, +2.60000E+2, +2.65000E+2, +2.70000E+2, +2.75000E+2, +2.80000E+2, +2.85000E+2, +2.90000E+2, +2.95000E+2, +3.00000E+2, +3.05000E+2, +3.10000E+2, +3.15000E+2, +3.20000E+2, +3.25000E+2, +3.30000E+2, +3.35000E+2, +3.40000E+2, +3.45000E+2, +3.50000E+2, +3.55000E+2, +3.60000E+2, +3.65000E+2, +3.70000E+2, +3.75000E+2, +3.80000E+2])+273.15 # Kelvin + self.density.data = np.array([+1.11000E+3, +1.10000E+3, +1.10000E+3, +1.09000E+3, +1.09000E+3, +1.08000E+3, +1.08000E+3, +1.07000E+3, +1.07000E+3, +1.07000E+3, +1.06000E+3, +1.06000E+3, +1.05000E+3, +1.05000E+3, +1.04000E+3, +1.04000E+3, +1.03000E+3, +1.03000E+3, +1.02000E+3, +1.02000E+3, +1.02000E+3, +1.01000E+3, +1.01000E+3, +1.00000E+3, +9.97000E+2, +9.93000E+2, +9.88000E+2, +9.84000E+2, +9.79000E+2, +9.74000E+2, +9.70000E+2, +9.65000E+2, +9.61000E+2, +9.56000E+2, +9.52000E+2, +9.47000E+2, +9.43000E+2, +9.38000E+2, +9.34000E+2, +9.29000E+2, +9.25000E+2, +9.20000E+2, +9.16000E+2, +9.11000E+2, +9.06000E+2, +9.02000E+2, +8.98000E+2, +8.93000E+2, +8.89000E+2, +8.84000E+2, +8.80000E+2, +8.75000E+2, +8.71000E+2, +8.66000E+2, +8.62000E+2, +8.57000E+2, +8.53000E+2, +8.48000E+2, +8.44000E+2, +8.39000E+2, +8.34000E+2, +8.30000E+2, +8.25000E+2, +8.21000E+2, +8.16000E+2, +8.12000E+2, +8.07000E+2, +8.03000E+2, +7.98000E+2, +7.94000E+2, +7.89000E+2, +7.85000E+2, +7.80000E+2, +7.76000E+2, +7.71000E+2, +7.66000E+2, +7.62000E+2, +7.57000E+2, +7.53000E+2]) # kg/m3 + self.specific_heat.data = np.array([+1.47100E+0, +1.48400E+0, +1.49800E+0, +1.51200E+0, +1.52500E+0, +1.53900E+0, +1.55200E+0, +1.56600E+0, +1.57900E+0, +1.59300E+0, +1.60600E+0, +1.62000E+0, +1.63400E+0, +1.64700E+0, +1.66100E+0, +1.67400E+0, +1.68800E+0, +1.70100E+0, +1.71500E+0, +1.72800E+0, +1.74200E+0, +1.75500E+0, +1.76900E+0, +1.78300E+0, +1.79600E+0, +1.81000E+0, +1.82300E+0, +1.83700E+0, +1.85000E+0, +1.86400E+0, +1.87700E+0, +1.89100E+0, +1.90500E+0, +1.91800E+0, +1.93200E+0, +1.94500E+0, +1.95900E+0, +1.97200E+0, +1.98600E+0, +1.99900E+0, +2.01300E+0, +2.02600E+0, +2.04000E+0, +2.05400E+0, +2.06700E+0, +2.08100E+0, +2.09400E+0, +2.10800E+0, +2.12100E+0, +2.13500E+0, +2.14800E+0, +2.16200E+0, +2.17600E+0, +2.18900E+0, +2.20300E+0, +2.21600E+0, +2.23000E+0, +2.24300E+0, +2.25700E+0, +2.27000E+0, +2.28400E+0, +2.29700E+0, +2.31100E+0, +2.32500E+0, +2.33800E+0, +2.35200E+0, +2.36500E+0, +2.37900E+0, +2.39200E+0, +2.40600E+0, +2.41900E+0, +2.43300E+0, +2.44600E+0, +2.46000E+0, +2.47400E+0, +2.48700E+0, +2.50100E+0, +2.51400E+0, +2.52800E+0])*1000. # J/kg-K + self.conductivity.data = np.array([+1.43200E-1, +1.42600E-1, +1.42000E-1, +1.41400E-1, +1.40800E-1, +1.40200E-1, +1.39600E-1, +1.39000E-1, +1.38400E-1, +1.37800E-1, +1.37100E-1, +1.36500E-1, +1.35900E-1, +1.35300E-1, +1.34700E-1, +1.34100E-1, +1.33500E-1, +1.32900E-1, +1.32300E-1, +1.31700E-1, +1.31100E-1, +1.30500E-1, +1.29900E-1, +1.29300E-1, +1.28700E-1, +1.28000E-1, +1.27400E-1, +1.26800E-1, +1.26200E-1, +1.25600E-1, +1.25000E-1, +1.24400E-1, +1.23800E-1, +1.23200E-1, +1.22600E-1, +1.22000E-1, +1.21400E-1, +1.20800E-1, +1.20200E-1, +1.19600E-1, +1.18900E-1, +1.18300E-1, +1.17700E-1, +1.17100E-1, +1.16500E-1, +1.15900E-1, +1.15300E-1, +1.14700E-1, +1.14100E-1, +1.13500E-1, +1.12900E-1, +1.12300E-1, +1.11700E-1, +1.11100E-1, +1.10500E-1, +1.09800E-1, +1.09200E-1, +1.08600E-1, +1.08000E-1, +1.07400E-1, +1.06800E-1, +1.06200E-1, +1.05600E-1, +1.05000E-1, +1.04400E-1, +1.03800E-1, +1.03200E-1, +1.02600E-1, +1.02000E-1, +1.01400E-1, +1.00700E-1, +1.00100E-1, +9.95000E-2, +9.89000E-2, +9.83000E-2, +9.77000E-2, +9.71000E-2, +9.65000E-2, +9.59000E-2]) # W/m-K + self.viscosity.data = np.array([+3.83000E-1, +1.19000E-1, +5.92000E-2, +3.60000E-2, +2.44000E-2, +1.77000E-2, +1.35000E-2, +1.07000E-2, +8.68000E-3, +7.21000E-3, +6.09000E-3, +5.21000E-3, +4.52000E-3, +3.96000E-3, +3.50000E-3, +3.12000E-3, +2.79000E-3, +2.52000E-3, +2.28000E-3, +2.08000E-3, +1.90000E-3, +1.75000E-3, +1.61000E-3, +1.49000E-3, +1.38000E-3, +1.29000E-3, +1.20000E-3, +1.12000E-3, +1.05000E-3, +9.86000E-4, +9.28000E-4, +8.74000E-4, +8.25000E-4, +7.79000E-4, +7.38000E-4, +6.99000E-4, +6.64000E-4, +6.31000E-4, +6.00000E-4, +5.72000E-4, +5.45000E-4, +5.20000E-4, +4.97000E-4, +4.75000E-4, +4.55000E-4, +4.36000E-4, +4.18000E-4, +4.01000E-4, +3.85000E-4, +3.70000E-4, +3.55000E-4, +3.42000E-4, +3.29000E-4, +3.17000E-4, +3.05000E-4, +2.95000E-4, +2.84000E-4, +2.74000E-4, +2.65000E-4, +2.56000E-4, +2.47000E-4, +2.39000E-4, +2.31000E-4, +2.24000E-4, +2.17000E-4, +2.10000E-4, +2.03000E-4, +1.97000E-4, +1.91000E-4, +1.85000E-4, +1.80000E-4, +1.75000E-4, +1.69000E-4, +1.65000E-4, +1.60000E-4, +1.55000E-4, +1.51000E-4, +1.47000E-4, +1.43000E-4]) # Pa-s + self.saturation_pressure.data = np.array([+9.60000E-1, +1.05000E+0, +1.14000E+0, +1.24000E+0, +1.35000E+0, +1.47000E+0, +1.60000E+0, +1.74000E+0, +1.89000E+0, +2.06000E+0, +2.24000E+0, +2.44000E+0, +2.65000E+0, +2.88000E+0, +3.14000E+0, +3.41000E+0, +3.71000E+0, +4.03000E+0, +4.39000E+0, +4.77000E+0, +5.18000E+0, +5.63000E+0, +6.12000E+0, +6.66000E+0, +7.23000E+0, +7.86000E+0, +8.54000E+0, +9.27000E+0, +1.01000E+1, +1.10000E+1, +1.19000E+1, +1.29000E+1, +1.40000E+1, +1.52000E+1, +1.65000E+1, +1.80000E+1, +1.95000E+1, +2.12000E+1, +2.30000E+1, +2.49000E+1, +2.71000E+1, +2.94000E+1, +3.19000E+1, +3.46000E+1, +3.75000E+1, +4.07000E+1, +4.42000E+1, +4.79000E+1, +5.20000E+1, +5.64000E+1, +6.11000E+1, +6.63000E+1, +7.19000E+1, +7.79000E+1, +8.45000E+1, +9.15000E+1, +9.92000E+1, +1.08000E+2, +1.17000E+2, +1.26000E+2, +1.37000E+2, +1.48000E+2, +1.61000E+2, +1.74000E+2, +1.89000E+2, +2.04000E+2, +2.21000E+2, +2.40000E+2, +2.60000E+2, +2.81000E+2, +3.04000E+2, +3.30000E+2, +3.57000E+2, +3.86000E+2, +4.18000E+2, +4.53000E+2, +4.90000E+2, +5.30000E+2, +5.74000E+2])*1000. # Pa + self.Tmin = np.min(self.temperature.data) + self.Tmax = np.max(self.temperature.data) + self.TminPsat = self.Tmin + self.name = "T72" + self.description = "Therminol72" + self.reshapeAll() + + + +class DowthermJ(PureData): + """ + Heat transfer fluid Dowtherm J by Dow Chemicals + Source: Dow Chemicals data sheet + """ + def __init__(self): + PureData.__init__(self) + self.temperature.data = np.array([-8.00000E+1, -7.00000E+1, -6.00000E+1, -5.00000E+1, -4.00000E+1, -3.00000E+1, -2.00000E+1, -1.00000E+1, +0.00000E+0, +1.00000E+1, +2.00000E+1, +3.00000E+1, +4.00000E+1, +5.00000E+1, +6.00000E+1, +7.00000E+1, +8.00000E+1, +9.00000E+1, +1.00000E+2, +1.10000E+2, +1.20000E+2, +1.30000E+2, +1.40000E+2, +1.50000E+2, +1.60000E+2, +1.70000E+2, +1.80000E+2, +1.81300E+2, +1.90000E+2, +2.00000E+2, +2.10000E+2, +2.20000E+2, +2.30000E+2, +2.40000E+2, +2.50000E+2, +2.60000E+2, +2.70000E+2, +2.80000E+2, +2.90000E+2, +3.00000E+2, +3.10000E+2, +3.20000E+2, +3.30000E+2, +3.40000E+2, +3.45000E+2])+273.15 # Kelvin + self.density.data = np.array([+9.31300E+2, +9.27900E+2, +9.21000E+2, +9.14100E+2, +9.07100E+2, +9.00000E+2, +8.92900E+2, +8.85700E+2, +8.78500E+2, +8.71100E+2, +8.63700E+2, +8.56200E+2, +8.48700E+2, +8.41000E+2, +8.33200E+2, +8.25400E+2, +8.17400E+2, +8.09400E+2, +8.01200E+2, +7.92900E+2, +7.84400E+2, +7.75900E+2, +7.67100E+2, +7.58300E+2, +7.49200E+2, +7.40000E+2, +7.30600E+2, +7.29300E+2, +7.20900E+2, +7.11000E+2, +7.00900E+2, +6.90500E+2, +6.79800E+2, +6.68800E+2, +6.57300E+2, +6.45500E+2, +6.33100E+2, +6.20200E+2, +6.06600E+2, +5.92200E+2, +5.76900E+2, +5.60400E+2, +5.42400E+2, +5.22400E+2, +5.11400E+2]) # kg/m3 + self.specific_heat.data = np.array([+1.58400E+0, +1.59400E+0, +1.61600E+0, +1.63900E+0, +1.66300E+0, +1.68800E+0, +1.71400E+0, +1.74100E+0, +1.76900E+0, +1.79800E+0, +1.82800E+0, +1.85900E+0, +1.89000E+0, +1.92300E+0, +1.95500E+0, +1.98900E+0, +2.02300E+0, +2.05800E+0, +2.09300E+0, +2.12900E+0, +2.16500E+0, +2.20200E+0, +2.23900E+0, +2.27700E+0, +2.31500E+0, +2.35300E+0, +2.39200E+0, +2.39700E+0, +2.43200E+0, +2.47200E+0, +2.51200E+0, +2.55300E+0, +2.59400E+0, +2.63600E+0, +2.68000E+0, +2.72400E+0, +2.76900E+0, +2.81600E+0, +2.86600E+0, +2.91900E+0, +2.97600E+0, +3.04000E+0, +3.11500E+0, +3.20800E+0, +3.26500E+0])*1000. # J/kg-K + self.conductivity.data = np.array([+1.48500E-1, +1.47500E-1, +1.45300E-1, +1.43200E-1, +1.41100E-1, +1.39000E-1, +1.36800E-1, +1.34700E-1, +1.32600E-1, +1.30500E-1, +1.28400E-1, +1.26200E-1, +1.24100E-1, +1.22000E-1, +1.19900E-1, +1.17700E-1, +1.15600E-1, +1.13500E-1, +1.11400E-1, +1.09300E-1, +1.07100E-1, +1.05000E-1, +1.02900E-1, +1.00800E-1, +9.87000E-2, +9.65000E-2, +9.44000E-2, +9.41000E-2, +9.23000E-2, +9.02000E-2, +8.80000E-2, +8.59000E-2, +8.38000E-2, +8.17000E-2, +7.96000E-2, +7.74000E-2, +7.53000E-2, +7.32000E-2, +7.11000E-2, +6.90000E-2, +6.68000E-2, +6.47000E-2, +6.26000E-2, +6.05000E-2, +5.94000E-2]) # W/m-K + self.viscosity.data = np.array([+8.43000E+0, +7.11000E+0, +5.12000E+0, +3.78000E+0, +2.88000E+0, +2.25000E+0, +1.80000E+0, +1.48000E+0, +1.23000E+0, +1.05000E+0, +9.10000E-1, +7.90000E-1, +7.00000E-1, +6.30000E-1, +5.60000E-1, +5.10000E-1, +4.70000E-1, +4.30000E-1, +4.00000E-1, +3.70000E-1, +3.50000E-1, +3.30000E-1, +3.10000E-1, +2.90000E-1, +2.80000E-1, +2.70000E-1, +2.50000E-1, +2.50000E-1, +2.40000E-1, +2.30000E-1, +2.30000E-1, +2.20000E-1, +2.10000E-1, +2.00000E-1, +2.00000E-1, +1.90000E-1, +1.80000E-1, +1.80000E-1, +1.70000E-1, +1.70000E-1, +1.70000E-1, +1.60000E-1, +1.60000E-1, +1.60000E-1, +1.50000E-1])/1000. # Pa-s + self.saturation_pressure.data = np.array([ np.NAN, np.NAN, np.NAN, np.NAN, np.NAN, np.NAN, np.NAN, np.NAN, np.NAN, np.NAN, np.NAN, np.NAN, np.NAN, +5.00000E-3, +1.00000E-2, +2.00000E-2, +3.00000E-2, +5.00000E-2, +8.00000E-2, +1.10000E-1, +1.60000E-1, +2.30000E-1, +3.20000E-1, +4.30000E-1, +5.80000E-1, +7.60000E-1, +9.80000E-1, +1.01000E+0, +1.25000E+0, +1.58000E+0, +1.97000E+0, +2.43000E+0, +2.96000E+0, +3.59000E+0, +4.30000E+0, +5.13000E+0, +6.06000E+0, +7.12000E+0, +8.31000E+0, +9.64000E+0, +1.11300E+1, +1.27900E+1, +1.46400E+1, +1.66900E+1, +1.78000E+1])*1e5 # Pa + self.Tmin = np.min(self.temperature.data) + self.Tmax = np.max(self.temperature.data) + self.TminPsat = 50 + 273.15 + self.name = "DowJ" + self.description = "DowthermJ" + self.reshapeAll() + +class DowthermQ(PureData): + """ + Heat transfer fluid Dowtherm Q by Dow Chemicals + Source: Dow Chemicals data sheet + """ + def __init__(self): + PureData.__init__(self) + self.temperature.data = np.array([-3.50000E+1, -3.00000E+1, -2.00000E+1, -1.00000E+1, +0.00000E+0, +1.00000E+1, +2.00000E+1, +3.00000E+1, +4.00000E+1, +5.00000E+1, +6.00000E+1, +7.00000E+1, +8.00000E+1, +9.00000E+1, +1.00000E+2, +1.10000E+2, +1.20000E+2, +1.30000E+2, +1.40000E+2, +1.50000E+2, +1.60000E+2, +1.70000E+2, +1.80000E+2, +1.90000E+2, +2.00000E+2, +2.10000E+2, +2.20000E+2, +2.30000E+2, +2.40000E+2, +2.50000E+2, +2.60000E+2, +2.70000E+2, +2.80000E+2, +2.90000E+2, +3.00000E+2, +3.10000E+2, +3.20000E+2, +3.30000E+2, +3.40000E+2, +3.50000E+2, +3.60000E+2])+273.15 # Kelvin + self.density.data = np.array([+1.01140E+3, +1.00320E+3, +9.95600E+2, +9.88000E+2, +9.80500E+2, +9.72900E+2, +9.65400E+2, +9.57800E+2, +9.50200E+2, +9.42700E+2, +9.35100E+2, +9.27600E+2, +9.20000E+2, +9.12400E+2, +9.04900E+2, +8.97300E+2, +8.89800E+2, +8.82200E+2, +8.74600E+2, +8.67100E+2, +8.59500E+2, +8.52000E+2, +8.44400E+2, +8.36800E+2, +8.29300E+2, +8.21700E+2, +8.14200E+2, +8.06600E+2, +7.99000E+2, +7.91500E+2, +7.83900E+2, +7.76400E+2, +7.68800E+2, +7.61200E+2, +7.53700E+2, +7.46100E+2, +7.38600E+2, +7.31000E+2, +7.23400E+2, +7.15900E+2, +7.08300E+2]) # kg/m3 + self.specific_heat.data = np.array([+1.47800E+0, +1.49200E+0, +1.52500E+0, +1.55700E+0, +1.58900E+0, +1.62100E+0, +1.65300E+0, +1.68500E+0, +1.71600E+0, +1.74800E+0, +1.77900E+0, +1.81100E+0, +1.84200E+0, +1.87300E+0, +1.90400E+0, +1.93500E+0, +1.96600E+0, +1.99700E+0, +2.02700E+0, +2.05800E+0, +2.08800E+0, +2.11800E+0, +2.14800E+0, +2.17800E+0, +2.20800E+0, +2.23800E+0, +2.26800E+0, +2.29700E+0, +2.32700E+0, +2.35600E+0, +2.38600E+0, +2.41500E+0, +2.44400E+0, +2.47300E+0, +2.50200E+0, +2.53000E+0, +2.55900E+0, +2.58700E+0, +2.61600E+0, +2.64400E+0, +2.67200E+0])*1000. # J/kg-K + self.conductivity.data = np.array([+1.28000E-1, +1.27700E-1, +1.26600E-1, +1.25500E-1, +1.24400E-1, +1.23200E-1, +1.22000E-1, +1.20800E-1, +1.19500E-1, +1.18300E-1, +1.17000E-1, +1.15600E-1, +1.14300E-1, +1.12900E-1, +1.11500E-1, +1.10100E-1, +1.08700E-1, +1.07200E-1, +1.05800E-1, +1.04300E-1, +1.02800E-1, +1.01300E-1, +9.98000E-2, +9.82000E-2, +9.67000E-2, +9.52000E-2, +9.36000E-2, +9.21000E-2, +9.05000E-2, +8.89000E-2, +8.74000E-2, +8.58000E-2, +8.43000E-2, +8.27000E-2, +8.11000E-2, +7.96000E-2, +7.80000E-2, +7.65000E-2, +7.49000E-2, +7.34000E-2, +7.19000E-2]) # W/m-K + self.viscosity.data = np.array([+4.66000E+1, +2.42000E+1, +1.61000E+1, +1.09000E+1, +7.56000E+0, +5.42000E+0, +4.00000E+0, +3.04000E+0, +2.37000E+0, +1.89000E+0, +1.54000E+0, +1.28000E+0, +1.07000E+0, +9.20000E-1, +8.00000E-1, +7.00000E-1, +6.20000E-1, +5.50000E-1, +5.00000E-1, +4.50000E-1, +4.10000E-1, +3.80000E-1, +3.50000E-1, +3.30000E-1, +3.10000E-1, +2.90000E-1, +2.70000E-1, +2.60000E-1, +2.40000E-1, +2.30000E-1, +2.20000E-1, +2.10000E-1, +2.00000E-1, +1.90000E-1, +1.90000E-1, +1.80000E-1, +1.70000E-1, +1.70000E-1, +1.60000E-1, +1.60000E-1, +1.50000E-1])/1000. # Pa-s + self.saturation_pressure.data = np.array([ np.NAN, np.NAN, np.NAN, np.NAN, np.NAN, np.NAN, np.NAN, np.NAN, np.NAN, np.NAN, np.NAN, np.NAN, np.NAN, np.NAN, np.NAN, np.NAN, +5.00000E-3, +1.00000E-2, +2.00000E-2, +3.00000E-2, +5.00000E-2, +7.00000E-2, +9.00000E-2, +1.30000E-1, +1.70000E-1, +2.30000E-1, +3.10000E-1, +4.00000E-1, +5.10000E-1, +6.40000E-1, +8.10000E-1, +1.00000E+0, +1.24000E+0, +1.51000E+0, +1.82000E+0, +2.19000E+0, +2.61000E+0, +3.09000E+0, +3.64000E+0, +4.25000E+0, +4.95000E+0])*1e5 # Pa + self.Tmin = np.min(self.temperature.data) + self.Tmax = np.max(self.temperature.data) + self.TminPsat = 120 + 273.15 + self.name = "DowQ" + self.description = "DowthermQ" + self.reshapeAll() + + +class Texatherm22(PureData): + """ + Heat transfer fluid Texatherm 22 by Texaco + Source: Texaco data sheet + """ + def __init__(self): + PureData.__init__(self) + self.temperature.data = np.array([+0.00000E+0, +4.00000E+1, +5.00000E+1, +1.00000E+2, +1.50000E+2, +2.00000E+2, +2.50000E+2, +3.00000E+2, +3.50000E+2])+273.15 # Kelvin + self.density.data = np.array([+8.74500E+2, +8.47300E+2, +8.42500E+2, +8.10500E+2, +7.76300E+2, +7.41600E+2, +7.03200E+2, +6.68000E+2, +6.21500E+2]) # kg/m3 + self.specific_heat.data = np.array([+1.81000E+0, +1.95000E+0, +1.99000E+0, +2.18000E+0, +2.36000E+0, +2.54000E+0, +2.72000E+0, +2.90000E+0, +3.08000E+0])*1e3 # J/kg-K + self.conductivity.data = np.array([+1.35000E-1, +1.32000E-1, +1.32000E-1, +1.28000E-1, +1.25000E-1, +1.21000E-1, +1.17100E-1, +1.13000E-1, +1.10000E-1]) # W/m-K + self.viscosity.data = np.array([+4.19760E+2, np.NAN, +2.31688E+1, np.NAN, +2.09601E+0, +1.26072E+0, np.NAN, np.NAN, np.NAN])/1000. # Pa-s + self.saturation_pressure.data = np.array([ np.NAN, +5.3300E-10, +4.00000E-8, +2.67000E-7, +2.27000E-5, +4.67000E-4, +6.67000E-3, +2.13000E-2, +5.33000E-2])*1e5 # Pa + self.Tmin = np.min(self.temperature.data) + self.Tmax = np.max(self.temperature.data) + self.TminPsat = 40 + 273.15 + self.name = "TX22" + self.description = "Texatherm22" + self.reshapeAll() + + +class NitrateSalt(PureData): + """ + Heat transfer fluid based on 60% NaNO3 and 40% KNO3 + Source: Solar Power Tower Design Basis Document, Alexis B. Zavoico, Sandia Labs, USA + """ + def __init__(self): + PureData.__init__(self) + temp = np.linspace(300, 600, 25) # Celsius temperaure + def f_rho( T_C): + return 2090 - 0.636 * T_C + def f_cp( T_C): + return 1443 + 0.172 * T_C + def f_mu( T_C): + return 22.714 - 0.120 * T_C + 2.281 * 1e-4 * T_C*T_C - 1.474 * 1e-7 * T_C*T_C*T_C + def f_lam( T_C): + return 0.443 + 1.9e-4 * T_C + self.temperature.data = temp + 273.15 # Kelvin + self.density.data = f_rho(temp) # kg/m3 + self.specific_heat.data = f_cp(temp)*1e3 # J/kg-K + self.conductivity.data = f_lam(temp) # W/m-K + # Viscosity: Pa-s (dynamic = kinematic * rho) + # mm2/s /1e6 -> m2/s * kg/m3 = kg/s/m = Pa s + self.viscosity.data = f_mu(temp)/1e3 + self.Tmin = np.min(self.temperature.data) + self.Tmax = np.max(self.temperature.data) + self.TminPsat = self.Tmax + self.name = "NaK" + self.description = "NitrateSalt" + self.reshapeAll() + + +class SylthermXLT(PureData): + """ + Heat transfer fluid Syltherm XLT by Dow Chemicals + Source: Dow Chemicals data sheet + """ + def __init__(self): + PureData.__init__(self) + self.temperature.data = np.array([-1.00000E+2, -9.50000E+1, -9.00000E+1, -8.50000E+1, -8.00000E+1, -7.50000E+1, -7.00000E+1, -6.50000E+1, -6.00000E+1, -5.50000E+1, -5.00000E+1, -4.50000E+1, -4.00000E+1, -3.50000E+1, -3.00000E+1, -2.50000E+1, -2.00000E+1, -1.50000E+1, -1.00000E+1, -5.00000E+0, +0.00000E+0, +5.00000E+0, +1.00000E+1, +1.50000E+1, +2.00000E+1, +2.50000E+1, +3.00000E+1, +3.50000E+1, +4.00000E+1, +4.50000E+1, +5.00000E+1, +5.50000E+1, +6.00000E+1, +6.50000E+1, +7.00000E+1, +7.50000E+1, +8.00000E+1, +8.50000E+1, +9.00000E+1, +9.50000E+1, +1.00000E+2, +1.05000E+2, +1.10000E+2, +1.15000E+2, +1.20000E+2, +1.25000E+2, +1.30000E+2, +1.35000E+2, +1.40000E+2, +1.45000E+2, +1.50000E+2, +1.55000E+2, +1.60000E+2, +1.65000E+2, +1.70000E+2, +1.75000E+2, +1.80000E+2, +1.85000E+2, +1.90000E+2, +1.95000E+2, +2.00000E+2, +2.05000E+2, +2.10000E+2, +2.15000E+2, +2.20000E+2, +2.25000E+2, +2.30000E+2, +2.35000E+2, +2.40000E+2, +2.45000E+2, +2.50000E+2, +2.55000E+2, +2.60000E+2])+273.15 # Kelvin + self.density.data = np.array([+9.78500E+2, +9.73400E+2, +9.68300E+2, +9.63100E+2, +9.58000E+2, +9.52900E+2, +9.47700E+2, +9.42600E+2, +9.37500E+2, +9.32300E+2, +9.27200E+2, +9.22000E+2, +9.16900E+2, +9.11800E+2, +9.06600E+2, +9.01500E+2, +8.96400E+2, +8.91200E+2, +8.86100E+2, +8.81000E+2, +8.75800E+2, +8.70700E+2, +8.65500E+2, +8.60400E+2, +8.55300E+2, +8.50100E+2, +8.45000E+2, +8.39900E+2, +8.34700E+2, +8.29600E+2, +8.24500E+2, +8.19300E+2, +8.14200E+2, +8.09100E+2, +8.03900E+2, +7.98800E+2, +7.93600E+2, +7.88500E+2, +7.83400E+2, +7.78200E+2, +7.73100E+2, +7.68000E+2, +7.62800E+2, +7.57700E+2, +7.52600E+2, +7.47400E+2, +7.42300E+2, +7.37200E+2, +7.32000E+2, +7.26900E+2, +7.21700E+2, +7.16600E+2, +7.11500E+2, +7.06300E+2, +7.01200E+2, +6.96100E+2, +6.90900E+2, +6.85800E+2, +6.80700E+2, +6.75500E+2, +6.70400E+2, +6.65300E+2, +6.60100E+2, +6.55000E+2, +6.49800E+2, +6.44700E+2, +6.39600E+2, +6.34400E+2, +6.29300E+2, +6.24200E+2, +6.19000E+2, +6.13900E+2, +6.08800E+2]) # kg/m3 + self.specific_heat.data = np.array([+1.52000E+0, +1.53000E+0, +1.54100E+0, +1.55100E+0, +1.56200E+0, +1.57200E+0, +1.58300E+0, +1.59300E+0, +1.60400E+0, +1.61400E+0, +1.62500E+0, +1.63500E+0, +1.64600E+0, +1.65600E+0, +1.66700E+0, +1.67700E+0, +1.68800E+0, +1.69800E+0, +1.70900E+0, +1.71900E+0, +1.73000E+0, +1.74000E+0, +1.75100E+0, +1.76100E+0, +1.77200E+0, +1.78200E+0, +1.79300E+0, +1.80300E+0, +1.81400E+0, +1.82400E+0, +1.83500E+0, +1.84500E+0, +1.85600E+0, +1.86600E+0, +1.87700E+0, +1.88700E+0, +1.89800E+0, +1.90800E+0, +1.91900E+0, +1.92900E+0, +1.94000E+0, +1.95000E+0, +1.96100E+0, +1.97100E+0, +1.98200E+0, +1.99200E+0, +2.00300E+0, +2.01300E+0, +2.02400E+0, +2.03400E+0, +2.04500E+0, +2.05500E+0, +2.06600E+0, +2.07600E+0, +2.08700E+0, +2.09700E+0, +2.10800E+0, +2.11800E+0, +2.12900E+0, +2.13900E+0, +2.15000E+0, +2.16000E+0, +2.17100E+0, +2.18100E+0, +2.19200E+0, +2.20200E+0, +2.21300E+0, +2.22300E+0, +2.23400E+0, +2.24400E+0, +2.25500E+0, +2.26500E+0, +2.27600E+0])*1e3 # J/kg-K + self.conductivity.data = np.array([+1.34100E-1, +1.33200E-1, +1.32400E-1, +1.31500E-1, +1.30600E-1, +1.29700E-1, +1.28800E-1, +1.27900E-1, +1.26900E-1, +1.26000E-1, +1.25000E-1, +1.24100E-1, +1.23100E-1, +1.22100E-1, +1.21100E-1, +1.20100E-1, +1.19100E-1, +1.18100E-1, +1.17100E-1, +1.16100E-1, +1.15000E-1, +1.14000E-1, +1.12900E-1, +1.11900E-1, +1.10800E-1, +1.09700E-1, +1.08600E-1, +1.07500E-1, +1.06400E-1, +1.05300E-1, +1.04200E-1, +1.03000E-1, +1.01900E-1, +1.00800E-1, +9.96000E-2, +9.84400E-2, +9.72800E-2, +9.61000E-2, +9.49200E-2, +9.37300E-2, +9.25300E-2, +9.13300E-2, +9.01200E-2, +8.89100E-2, +8.76800E-2, +8.64500E-2, +8.52200E-2, +8.39800E-2, +8.27300E-2, +8.14700E-2, +8.02100E-2, +7.89500E-2, +7.76700E-2, +7.64000E-2, +7.51100E-2, +7.38200E-2, +7.25300E-2, +7.12300E-2, +6.99200E-2, +6.86100E-2, +6.72900E-2, +6.59700E-2, +6.46500E-2, +6.33100E-2, +6.19800E-2, +6.06400E-2, +5.92900E-2, +5.79400E-2, +5.65800E-2, +5.52300E-2, +5.38600E-2, +5.24900E-2, +5.11200E-2]) # W/m-K + self.viscosity.data = np.array([+7.86100E+1, +5.01300E+1, +3.48600E+1, +2.58300E+1, +2.00400E+1, +1.60800E+1, +1.32200E+1, +1.10500E+1, +9.35600E+0, +7.99400E+0, +6.87900E+0, +5.95600E+0, +5.18400E+0, +4.53500E+0, +3.98600E+0, +3.52100E+0, +3.12600E+0, +2.78800E+0, +2.49900E+0, +2.25000E+0, +2.03500E+0, +1.84900E+0, +1.68700E+0, +1.54500E+0, +1.41900E+0, +1.30900E+0, +1.21000E+0, +1.12200E+0, +1.04300E+0, +9.72000E-1, +9.08000E-1, +8.49000E-1, +7.96000E-1, +7.48000E-1, +7.05000E-1, +6.65000E-1, +6.28000E-1, +5.95000E-1, +5.64000E-1, +5.36000E-1, +5.11000E-1, +4.87000E-1, +4.65000E-1, +4.45000E-1, +4.26000E-1, +4.09000E-1, +3.93000E-1, +3.77000E-1, +3.63000E-1, +3.50000E-1, +3.37000E-1, +3.25000E-1, +3.14000E-1, +3.03000E-1, +2.93000E-1, +2.84000E-1, +2.75000E-1, +2.66000E-1, +2.58000E-1, +2.51000E-1, +2.44000E-1, +2.38000E-1, +2.32000E-1, +2.26000E-1, +2.20000E-1, +2.15000E-1, +2.09000E-1, +2.04000E-1, +1.99000E-1, +1.94000E-1, +1.89000E-1, +1.85000E-1, +1.82000E-1])/1000. # Pa-s + self.Tmin = np.min(self.temperature.data) + self.Tmax = np.max(self.temperature.data) + self.TminPsat = self.Tmax + self.name = "XLT" + self.description = "SylthermXLT" + self.reshapeAll() + + +class HC50(PureData): + """ + Heat transfer fluid Dynalene HC-50 + Source: Dynalene + """ + def __init__(self): + PureData.__init__(self) + self.temperature.data = np.array([+2.23150E+2,+2.33150E+2,+2.43150E+2,+2.53150E+2,+2.63150E+2,+2.73150E+2,+2.83150E+2,+2.93150E+2,+3.03150E+2,+3.13150E+2,+3.23150E+2,+3.33150E+2,+3.43150E+2,+3.53150E+2,+3.63150E+2,+3.73150E+2,+3.83150E+2,+3.93150E+2,+4.03150E+2,+4.13150E+2,+4.23150E+2,+4.33150E+2,+4.43150E+2,+4.53150E+2,+4.63150E+2,+4.73150E+2,+4.83150E+2]) # Kelvin + self.density.data = np.array([+1.37800E+3,+1.37300E+3,+1.36700E+3,+1.36200E+3,+1.35600E+3,+1.35100E+3,+1.34500E+3,+1.34000E+3,+1.33400E+3,+1.32800E+3,+1.32300E+3,+1.31700E+3,+1.31200E+3,+1.30600E+3,+1.30100E+3,+1.29500E+3,+1.29000E+3,+1.28400E+3,+1.27900E+3,+1.27300E+3,+1.26700E+3,+1.26200E+3,+1.25600E+3,+1.25100E+3,+1.24500E+3,+1.24000E+3,+1.23400E+3]) # kg/m3 + self.specific_heat.data = np.array([+2.56300E+3,+2.58300E+3,+2.60200E+3,+2.62200E+3,+2.64200E+3,+2.66100E+3,+2.68100E+3,+2.70100E+3,+2.72000E+3,+2.74000E+3,+2.76000E+3,+2.78000E+3,+2.79900E+3,+2.81900E+3,+2.83900E+3,+2.85800E+3,+2.87800E+3,+2.89800E+3,+2.91700E+3,+2.93700E+3,+2.95700E+3,+2.97700E+3,+2.99600E+3,+3.01600E+3,+3.03600E+3,+3.05500E+3,+3.07500E+3]) # J/kg-K + self.conductivity.data = np.array([+4.35000E+2,+4.45000E+2,+4.55000E+2,+4.65000E+2,+4.75000E+2,+4.85000E+2,+4.95000E+2,+5.05000E+2,+5.15000E+2,+5.25000E+2,+5.35000E+2,+5.45000E+2,+5.55000E+2,+5.65000E+2,+5.75000E+2,+5.85000E+2,+5.95000E+2,+6.05000E+2,+6.15000E+2,+6.25000E+2,+6.35000E+2,+6.45000E+2,+6.55000E+2,+6.65000E+2,+6.75000E+2,+6.85000E+2,+6.94500E+2])/1e3 # W/m-K + self.viscosity.data = np.array([+3.84000E-2,+2.04000E-2,+1.25000E-2,+8.40000E-3,+5.99000E-3,+4.70000E-3,+3.80000E-3,+3.20000E-3,+2.70000E-3,+2.40000E-3,+2.40000E-3,+1.80000E-3,+1.60000E-3,+1.50000E-3,+1.30000E-3,+1.20000E-3,+1.10000E-3,+1.00000E-3,+9.40000E-4,+8.70000E-4,+8.10000E-4,+7.60000E-4,+7.10000E-4,+6.60000E-4,+6.20000E-4,+5.80000E-4,+5.50000E-4]) # Pa-s + self.saturation_pressure.data = np.array([ np.NAN, np.NAN, np.NAN, np.NAN, np.NAN, np.NAN, np.NAN,+1.58579E+3,+1.93053E+3,+3.10264E+3,+5.58475E+3,+9.85950E+3,+1.64785E+4,+2.60622E+4,+3.93691E+4,+5.72954E+4,+8.06687E+4,+1.11695E+5,+1.50995E+5,+2.00637E+5,+2.63380E+5,+3.41290E+5,+4.36438E+5,+5.53649E+5,+6.95681E+5,+8.67360E+5,+1.07282E+6]) # Pa + self.Tmin = np.min(self.temperature.data) + self.Tmax = np.max(self.temperature.data) + self.TminPsat = 20+273.15 + self.name = "HC50" + self.description = "Dynalene "+ self.name + self.reshapeAll() + + +class HC40(PureData): + """ + Heat transfer fluid Dynalene HC-40 + Source: Dynalene + """ + def __init__(self): + PureData.__init__(self) + self.temperature.data = np.array([+2.33150E+2,+2.43150E+2,+2.53150E+2,+2.63150E+2,+2.73150E+2,+2.83150E+2,+2.93150E+2,+3.03150E+2,+3.13150E+2,+3.23150E+2,+3.33150E+2,+3.43150E+2,+3.53150E+2,+3.63150E+2,+3.73150E+2,+3.83150E+2,+3.93150E+2,+4.03150E+2,+4.13150E+2,+4.23150E+2,+4.33150E+2,+4.38150E+2,+4.43150E+2,+4.53150E+2,+4.63150E+2,+4.73150E+2]) # Kelvin + self.density.data = np.array([+1.34800E+3,+1.34300E+3,+1.33700E+3,+1.33200E+3,+1.32600E+3,+1.32100E+3,+1.31500E+3,+1.30900E+3,+1.30400E+3,+1.29800E+3,+1.29300E+3,+1.28700E+3,+1.28100E+3,+1.27600E+3,+1.27000E+3,+1.26500E+3,+1.25900E+3,+1.25300E+3,+1.24800E+3,+1.24200E+3,+1.23700E+3,+1.23400E+3,+1.23100E+3,+1.22500E+3,+1.22000E+3,+1.21400E+3]) # kg/m3 + self.specific_heat.data = np.array([+2.80000E+3,+2.82000E+3,+2.84000E+3,+2.87000E+3,+2.89000E+3,+2.91000E+3,+2.93000E+3,+2.96000E+3,+2.98000E+3,+3.00000E+3,+3.03000E+3,+3.05000E+3,+3.07000E+3,+3.09000E+3,+3.12000E+3,+3.14000E+3,+3.16000E+3,+3.19000E+3,+3.21000E+3,+3.23000E+3,+3.25000E+3,+3.27000E+3,+3.28000E+3,+3.30000E+3,+3.32000E+3,+3.35000E+3]) # J/kg-K + self.conductivity.data = np.array([+4.49000E+2,+4.59000E+2,+4.69000E+2,+4.79000E+2,+4.89000E+2,+4.99000E+2,+5.09000E+2,+5.19000E+2,+5.29000E+2,+5.39000E+2,+5.49000E+2,+5.59000E+2,+5.69000E+2,+5.79000E+2,+5.89000E+2,+5.99000E+2,+6.09000E+2,+6.19000E+2,+6.29000E+2,+6.39000E+2,+6.49000E+2,+6.54000E+2,+6.59000E+2,+6.69000E+2,+6.79000E+2,+6.89000E+2])/1e3 # W/m-K + self.viscosity.data = np.array([+1.49000E-2,+9.20000E-3,+6.50000E-3,+4.90000E-3,+3.90000E-3,+3.20000E-3,+2.70000E-3,+2.30000E-3,+1.96000E-3,+1.70000E-3,+1.50000E-3,+1.40000E-3,+1.20000E-3,+1.10000E-3,+9.90000E-4,+9.10000E-4,+8.30000E-4,+7.70000E-4,+7.10000E-4,+6.60000E-4,+6.10000E-4,+5.90000E-4,+5.70000E-4,+5.30000E-4,+5.00000E-4,+4.70000E-4]) # Pa-s + self.saturation_pressure.data = np.array([ np.NAN, np.NAN, np.NAN, np.NAN, np.NAN, np.NAN,+1.51685E+3,+2.20632E+3,+3.79212E+3,+6.68791E+3,+1.15142E+4,+1.87537E+4,+2.92338E+4,+4.37817E+4,+6.35007E+4,+8.96318E+4,+1.23416E+5,+1.66853E+5,+2.22701E+5,+2.92338E+5,+3.79212E+5,+4.85391E+5,+6.16391E+5,+7.74971E+5,+9.65955E+5,+1.19417E+6]) # Pa + self.Tmin = np.min(self.temperature.data) + self.Tmax = np.max(self.temperature.data) + self.TminPsat = 20+273.15 + self.name = "HC40" + self.description = "Dynalene "+ self.name + self.reshapeAll() + + +class HC30(PureData): + """ + Heat transfer fluid Dynalene HC-30 + Source: Dynalene + """ + def __init__(self): + PureData.__init__(self) + self.temperature.data = np.array([+2.43150E+2,+2.53150E+2,+2.63150E+2,+2.73150E+2,+2.83150E+2,+2.93150E+2,+3.03150E+2,+3.13150E+2,+3.23150E+2,+3.33150E+2,+3.43150E+2,+3.53150E+2,+3.63150E+2,+3.73150E+2,+3.83150E+2,+3.93150E+2,+4.03150E+2,+4.13150E+2,+4.23150E+2,+4.33150E+2,+4.43150E+2,+4.53150E+2,+4.63150E+2,+4.73150E+2,+4.83150E+2]) # Kelvin + self.density.data = np.array([+1.30000E+3,+1.29500E+3,+1.29000E+3,+1.28500E+3,+1.28000E+3,+1.27500E+3,+1.27000E+3,+1.26500E+3,+1.26000E+3,+1.25500E+3,+1.25000E+3,+1.24400E+3,+1.23900E+3,+1.23400E+3,+1.22900E+3,+1.22400E+3,+1.21900E+3,+1.21400E+3,+1.20900E+3,+1.20400E+3,+1.19900E+3,+1.19300E+3,+1.18800E+3,+1.18300E+3,+1.17800E+3]) # kg/m3 + self.specific_heat.data = np.array([+2.96100E+3,+2.98400E+3,+3.00700E+3,+3.03100E+3,+3.05400E+3,+3.07700E+3,+3.10000E+3,+3.12300E+3,+3.14600E+3,+3.16900E+3,+3.19200E+3,+3.21500E+3,+3.23800E+3,+3.26200E+3,+3.28500E+3,+3.30800E+3,+3.33100E+3,+3.35400E+3,+3.37700E+3,+3.40000E+3,+3.42300E+3,+3.44600E+3,+3.46900E+3,+3.49300E+3,+3.51600E+3]) # J/kg-K + self.conductivity.data = np.array([+4.69000E+2,+4.79000E+2,+4.89000E+2,+4.99000E+2,+5.09000E+2,+5.19000E+2,+5.29000E+2,+5.39000E+2,+5.49000E+2,+5.59000E+2,+5.69000E+2,+5.79000E+2,+5.89000E+2,+5.99000E+2,+6.09000E+2,+6.19000E+2,+6.29000E+2,+6.39000E+2,+6.49000E+2,+6.59000E+2,+6.69000E+2,+6.79000E+2,+6.89000E+2,+6.99000E+2,+7.09000E+2])/1e3 # W/m-K + self.viscosity.data = np.array([+7.00000E-3,+5.50000E-3,+4.50000E-3,+3.70000E-3,+3.00000E-3,+2.50000E-3,+2.20000E-3,+1.90000E-3,+1.60000E-3,+1.40000E-3,+1.30000E-3,+1.10000E-3,+9.90000E-4,+8.90000E-4,+8.00000E-4,+7.30000E-4,+6.70000E-4,+6.10000E-4,+5.70000E-4,+5.20000E-4,+4.80000E-4,+4.50000E-4,+4.20000E-4,+3.90000E-4,+3.70000E-4]) # Pa-s + self.saturation_pressure.data = np.array([ np.NAN, np.NAN, np.NAN, np.NAN, np.NAN,+1.79264E+3,+2.41317E+3,+3.99896E+3,+7.17055E+3,+1.24795E+4,+2.06153E+4,+3.23364E+4,+4.86770E+4,+7.10160E+4,+9.99740E+4,+1.37895E+5,+1.86158E+5,+2.47522E+5,+3.24743E+5,+4.20580E+5,+5.39170E+5,+6.83960E+5,+8.59087E+5,+1.07145E+6,+1.32517E+6]) # Pa + self.Tmin = np.min(self.temperature.data) + self.Tmax = np.max(self.temperature.data) + self.TminPsat = 20+273.15 + self.name = "HC30" + self.description = "Dynalene "+ self.name + self.reshapeAll() + + +class HC20(PureData): + """ + Heat transfer fluid Dynalene HC-20 + Source: Dynalene + """ + def __init__(self): + PureData.__init__(self) + self.temperature.data = np.array([+2.53150E+2,+2.63150E+2,+2.73150E+2,+2.83150E+2,+2.93150E+2,+3.03150E+2,+3.13150E+2,+3.23150E+2,+3.33150E+2,+3.43150E+2,+3.53150E+2,+3.63150E+2,+3.73150E+2,+3.83150E+2,+3.93150E+2,+4.03150E+2,+4.13150E+2,+4.23150E+2,+4.33150E+2,+4.43150E+2,+4.53150E+2,+4.63150E+2,+4.73150E+2,+4.83150E+2]) # Kelvin + self.density.data = np.array([+1.25800E+3,+1.25300E+3,+1.24800E+3,+1.24200E+3,+1.23700E+3,+1.23200E+3,+1.22700E+3,+1.22200E+3,+1.21600E+3,+1.21100E+3,+1.20600E+3,+1.20100E+3,+1.19600E+3,+1.19100E+3,+1.18500E+3,+1.18000E+3,+1.17500E+3,+1.17000E+3,+1.16500E+3,+1.15900E+3,+1.15400E+3,+1.14900E+3,+1.14400E+3,+1.13900E+3]) # kg/m3 + self.specific_heat.data = np.array([+3.11700E+3,+3.14100E+3,+3.16400E+3,+3.18800E+3,+3.21200E+3,+3.23500E+3,+3.25900E+3,+3.28200E+3,+3.30600E+3,+3.33000E+3,+3.35300E+3,+3.37700E+3,+3.40000E+3,+3.42400E+3,+3.44800E+3,+3.47100E+3,+3.49500E+3,+3.51800E+3,+3.54200E+3,+3.56600E+3,+3.58900E+3,+3.61300E+3,+3.63600E+3,+3.66000E+3]) # J/kg-K + self.conductivity.data = np.array([+4.83000E+2,+4.93000E+2,+5.03000E+2,+5.13000E+2,+5.23000E+2,+5.33000E+2,+5.43000E+2,+5.53000E+2,+5.63000E+2,+5.73000E+2,+5.83000E+2,+5.93000E+2,+6.03000E+2,+6.13000E+2,+6.23000E+2,+6.33000E+2,+6.43000E+2,+6.53000E+2,+6.63000E+2,+6.73000E+2,+6.83000E+2,+6.93000E+2,+7.03000E+2,+7.13000E+2])/1e3 # W/m-K + self.viscosity.data = np.array([+4.50000E-3,+3.60000E-3,+3.00000E-3,+2.50000E-3,+2.10000E-3,+1.80000E-3,+1.60000E-3,+1.40000E-3,+1.20000E-3,+1.10000E-3,+9.50000E-4,+8.50000E-4,+7.70000E-4,+7.00000E-4,+6.30000E-4,+5.80000E-4,+5.40000E-4,+4.90000E-4,+4.60000E-4,+4.30000E-4,+4.00000E-4,+3.70000E-4,+3.50000E-4,+3.30000E-4]) # Pa-s + self.saturation_pressure.data = np.array([ np.NAN, np.NAN, np.NAN, np.NAN,+2.06843E+3,+2.75790E+3,+4.55054E+3,+7.99792E+3,+1.37206E+4,+2.24769E+4,+3.52322E+4,+5.29517E+4,+7.72213E+4,+1.08937E+5,+1.50306E+5,+2.04085E+5,+2.71653E+5,+3.57148E+5,+4.62638E+5,+5.93639E+5,+7.52907E+5,+9.46650E+5,+1.18038E+6,+1.45962E+6]) # Pa + self.Tmin = np.min(self.temperature.data) + self.Tmax = np.max(self.temperature.data) + self.TminPsat = 20+273.15 + self.name = "HC20" + self.description = "Dynalene "+ self.name + self.reshapeAll() + + +class HC10(PureData): + """ + Heat transfer fluid Dynalene HC-10 + Source: Dynalene + """ + def __init__(self): + PureData.__init__(self) + self.temperature.data = np.array([+2.63150E+2,+2.73150E+2,+2.83150E+2,+2.93150E+2,+3.03150E+2,+3.13150E+2,+3.23150E+2,+3.33150E+2,+3.43150E+2,+3.53150E+2,+3.63150E+2,+3.73150E+2,+3.83150E+2,+3.93150E+2,+4.03150E+2,+4.13150E+2,+4.23150E+2,+4.33150E+2,+4.43150E+2,+4.53150E+2,+4.63150E+2,+4.73150E+2,+4.83150E+2,+4.91150E+2]) # Kelvin + self.density.data = np.array([+1.20400E+3,+1.19900E+3,+1.19500E+3,+1.19000E+3,+1.18600E+3,+1.18100E+3,+1.17700E+3,+1.17200E+3,+1.16700E+3,+1.16300E+3,+1.15800E+3,+1.15400E+3,+1.14900E+3,+1.14500E+3,+1.14000E+3,+1.13600E+3,+1.13100E+3,+1.12700E+3,+1.12200E+3,+1.11800E+3,+1.11300E+3,+1.10900E+3,+1.10400E+3,+1.10100E+3]) # kg/m3 + self.specific_heat.data = np.array([+3.24600E+3,+3.27100E+3,+3.29600E+3,+3.32000E+3,+3.34500E+3,+3.37000E+3,+3.39500E+3,+3.42000E+3,+3.44400E+3,+3.46900E+3,+3.49400E+3,+3.51900E+3,+3.54400E+3,+3.56800E+3,+3.59300E+3,+3.61800E+3,+3.64300E+3,+3.66800E+3,+3.69200E+3,+3.71700E+3,+3.74200E+3,+3.76700E+3,+3.79200E+3,+3.81100E+3]) # J/kg-K + self.conductivity.data = np.array([+4.94000E+2,+5.04000E+2,+5.14000E+2,+5.24000E+2,+5.34000E+2,+5.44000E+2,+5.54000E+2,+5.64000E+2,+5.74000E+2,+5.84000E+2,+5.94000E+2,+6.04000E+2,+6.14000E+2,+6.24000E+2,+6.34000E+2,+6.44000E+2,+6.54000E+2,+6.64000E+2,+6.74000E+2,+6.84000E+2,+6.94000E+2,+7.04000E+2,+7.14000E+2,+7.22000E+2])/1e3 # W/m-K + self.viscosity.data = np.array([+3.00000E-3,+2.50000E-3,+2.10000E-3,+1.80000E-3,+1.50000E-3,+1.30000E-3,+1.20000E-3,+1.00000E-3,+9.10000E-4,+8.10000E-4,+7.30000E-4,+6.60000E-4,+6.00000E-4,+5.50000E-4,+5.10000E-4,+4.70000E-4,+4.30000E-4,+4.00000E-4,+3.70000E-4,+3.50000E-4,+3.30000E-4,+3.10000E-4,+2.90000E-4,+2.80000E-4]) # Pa-s + self.saturation_pressure.data = np.array([ np.NAN, np.NAN, np.NAN,+2.27527E+3,+2.89580E+3,+4.75738E+3,+8.54950E+3,+1.48927E+4,+2.46143E+4,+3.87485E+4,+5.83986E+4,+8.48055E+4,+1.19969E+5,+1.65474E+5,+2.23390E+5,+2.97164E+5,+3.90243E+5,+5.05386E+5,+6.47418E+5,+8.20476E+5,+1.03146E+6,+1.28587E+6,+1.58993E+6,+1.87468E+6]) # Pa + self.Tmin = np.min(self.temperature.data) + self.Tmax = np.max(self.temperature.data) + self.TminPsat = 20+273.15 + self.name = "HC10" + self.description = "Dynalene "+ self.name + self.reshapeAll() + + + +class AS10(PureData): + """ + Heat transfer fluid Aspen Temper -10 by Aspen Petroleum + Source: SecCool Software + """ + def __init__(self): + PureData.__init__(self) + self.temperature.data = np.array([2.65000E+02, 2.70000E+02, 2.75000E+02, 2.80000E+02, 2.85000E+02, 2.90000E+02, 2.95000E+02, 3.00000E+02]) # Kelvin + self.density.data = np.array([1.09160E+03, 1.09060E+03, 1.08960E+03, 1.08860E+03, 1.08760E+03, 1.08660E+03, 1.08560E+03, 1.08460E+03]) # kg/m3 + self.specific_heat.data = np.array([3.52460E+03, 3.53540E+03, 3.54550E+03, 3.55500E+03, 3.56380E+03, 3.57190E+03, 3.57940E+03, 3.58620E+03]) # J/kg-K + self.conductivity.data = np.array([5.02200E-01, 5.09600E-01, 5.17000E-01, 5.24400E-01, 5.31800E-01, 5.39200E-01, 5.46700E-01, 5.54100E-01]) # W/m-K + self.viscosity.data = np.array([3.83600E-03, 3.16000E-03, 2.61300E-03, 2.17700E-03, 1.83700E-03, 1.57700E-03, 1.38200E-03, 1.23500E-03]) # Pa-s + self.Tmin = np.min(self.temperature.data) + self.Tmax = np.max(self.temperature.data) + self.TminPsat = self.Tmax + self.name = "AS10" + self.description = "Aspen Temper -10" + self.reshapeAll() + + +class AS20(PureData): + """ + Heat transfer fluid Aspen Temper -20 by Aspen Petroleum + Source: SecCool Software + """ + def __init__(self): + PureData.__init__(self) + self.temperature.data = np.array([2.55000E+02, 2.60000E+02, 2.65000E+02, 2.70000E+02, 2.75000E+02, 2.80000E+02, 2.85000E+02, 2.90000E+02, 2.95000E+02, 3.00000E+02]) # Kelvin + self.density.data = np.array([1.15050E+03, 1.14970E+03, 1.14870E+03, 1.14770E+03, 1.14660E+03, 1.14540E+03, 1.14420E+03, 1.14290E+03, 1.14150E+03, 1.14000E+03]) # kg/m3 + self.specific_heat.data = np.array([3.20660E+03, 3.22280E+03, 3.23840E+03, 3.25340E+03, 3.26780E+03, 3.28150E+03, 3.29470E+03, 3.30720E+03, 3.31920E+03, 3.33050E+03]) # J/kg-K + self.conductivity.data = np.array([4.56400E-01, 4.63100E-01, 4.69800E-01, 4.76500E-01, 4.83200E-01, 4.90000E-01, 4.96700E-01, 5.03400E-01, 5.10100E-01, 5.16800E-01]) # W/m-K + self.viscosity.data = np.array([7.43800E-03, 5.91400E-03, 4.74900E-03, 3.85900E-03, 3.17900E-03, 2.65900E-03, 2.26100E-03, 1.95800E-03, 1.72500E-03, 1.54800E-03]) # Pa-s + self.Tmin = np.min(self.temperature.data) + self.Tmax = np.max(self.temperature.data) + self.TminPsat = self.Tmax + self.name = "AS20" + self.description = "Aspen Temper -20" + self.reshapeAll() + + +class AS30(PureData): + """ + Heat transfer fluid Aspen Temper -30 by Aspen Petroleum + Source: SecCool Software + """ + def __init__(self): + PureData.__init__(self) + self.temperature.data = np.array([2.45000E+02, 2.50000E+02, 2.55000E+02, 2.60000E+02, 2.65000E+02, 2.70000E+02, 2.75000E+02, 2.80000E+02, 2.85000E+02, 2.90000E+02, 2.95000E+02, 3.00000E+02]) # Kelvin + self.density.data = np.array([1.19140E+03, 1.19030E+03, 1.18910E+03, 1.18770E+03, 1.18630E+03, 1.18480E+03, 1.18330E+03, 1.18170E+03, 1.18010E+03, 1.17840E+03, 1.17680E+03, 1.17510E+03]) # kg/m3 + self.specific_heat.data = np.array([2.96950E+03, 2.99130E+03, 3.01190E+03, 3.03100E+03, 3.04890E+03, 3.06540E+03, 3.08050E+03, 3.09430E+03, 3.10670E+03, 3.11770E+03, 3.12750E+03, 3.13580E+03]) # J/kg-K + self.conductivity.data = np.array([4.25000E-01, 4.31300E-01, 4.37600E-01, 4.43900E-01, 4.50200E-01, 4.56400E-01, 4.62700E-01, 4.69000E-01, 4.75300E-01, 4.81600E-01, 4.87800E-01, 4.94100E-01]) # W/m-K + self.viscosity.data = np.array([1.56400E-02, 1.19300E-02, 9.17800E-03, 7.14000E-03, 5.62900E-03, 4.50900E-03, 3.67900E-03, 3.06400E-03, 2.60800E-03, 2.27000E-03, 2.01900E-03, 1.83400E-03]) # Pa-s + self.Tmin = np.min(self.temperature.data) + self.Tmax = np.max(self.temperature.data) + self.TminPsat = self.Tmax + self.name = "AS30" + self.description = "Aspen Temper -30" + self.reshapeAll() + + +class AS40(PureData): + """ + Heat transfer fluid Aspen Temper -40 by Aspen Petroleum + Source: SecCool Software + """ + def __init__(self): + PureData.__init__(self) + self.temperature.data = np.array([2.35000E+02, 2.40000E+02, 2.45000E+02, 2.50000E+02, 2.55000E+02, 2.60000E+02, 2.65000E+02, 2.70000E+02, 2.75000E+02, 2.80000E+02, 2.85000E+02, 2.90000E+02, 2.95000E+02, 3.00000E+02]) # Kelvin + self.density.data = np.array([1.22670E+03, 1.22560E+03, 1.22420E+03, 1.22280E+03, 1.22120E+03, 1.21960E+03, 1.21780E+03, 1.21600E+03, 1.21410E+03, 1.21220E+03, 1.21020E+03, 1.20820E+03, 1.20620E+03, 1.20420E+03]) # kg/m3 + self.specific_heat.data = np.array([2.83450E+03, 2.85970E+03, 2.88300E+03, 2.90430E+03, 2.92370E+03, 2.94120E+03, 2.95670E+03, 2.97030E+03, 2.98200E+03, 2.99170E+03, 2.99950E+03, 3.00530E+03, 3.00920E+03, 3.01120E+03]) # J/kg-K + self.conductivity.data = np.array([4.01400E-01, 4.06900E-01, 4.12400E-01, 4.17900E-01, 4.23400E-01, 4.28900E-01, 4.34400E-01, 4.39900E-01, 4.45400E-01, 4.50900E-01, 4.56400E-01, 4.61800E-01, 4.67300E-01, 4.72800E-01]) # W/m-K + self.viscosity.data = np.array([4.43400E-02, 3.01000E-02, 2.10800E-02, 1.52600E-02, 1.14300E-02, 8.84100E-03, 7.03900E-03, 5.74200E-03, 4.77600E-03, 4.03200E-03, 3.44300E-03, 2.96300E-03, 2.56600E-03, 2.23100E-03]) # Pa-s + self.Tmin = np.min(self.temperature.data) + self.Tmax = np.max(self.temperature.data) + self.TminPsat = self.Tmax + self.name = "AS40" + self.description = "Aspen Temper -40" + self.reshapeAll() + + +class AS55(PureData): + """ + Heat transfer fluid Aspen Temper -55 by Aspen Petroleum + Source: SecCool Software + """ + def __init__(self): + PureData.__init__(self) + self.temperature.data = np.array([2.20000E+02, 2.25000E+02, 2.30000E+02, 2.35000E+02, 2.40000E+02, 2.45000E+02, 2.50000E+02, 2.55000E+02, 2.60000E+02, 2.65000E+02, 2.70000E+02, 2.75000E+02, 2.80000E+02, 2.85000E+02, 2.90000E+02, 2.95000E+02, 3.00000E+02]) # Kelvin + self.density.data = np.array([1.26880E+03, 1.26780E+03, 1.26650E+03, 1.26510E+03, 1.26350E+03, 1.26180E+03, 1.25990E+03, 1.25790E+03, 1.25580E+03, 1.25350E+03, 1.25120E+03, 1.24890E+03, 1.24640E+03, 1.24400E+03, 1.24150E+03, 1.23900E+03, 1.23650E+03]) # kg/m3 + self.specific_heat.data = np.array([2.64790E+03, 2.67190E+03, 2.69470E+03, 2.71630E+03, 2.73660E+03, 2.75570E+03, 2.77350E+03, 2.79010E+03, 2.80540E+03, 2.81950E+03, 2.83240E+03, 2.84400E+03, 2.85440E+03, 2.86350E+03, 2.87140E+03, 2.87800E+03, 2.88340E+03]) # J/kg-K + self.conductivity.data = np.array([3.82400E-01, 3.85900E-01, 3.89600E-01, 3.93300E-01, 3.97200E-01, 4.01200E-01, 4.05300E-01, 4.09500E-01, 4.13900E-01, 4.18300E-01, 4.22900E-01, 4.27500E-01, 4.32300E-01, 4.37200E-01, 4.42300E-01, 4.47400E-01, 4.52600E-01]) # W/m-K + self.viscosity.data = np.array([2.93600E-01, 1.62700E-01, 9.44200E-02, 5.79500E-02, 3.78300E-02, 2.62200E-02, 1.91500E-02, 1.45600E-02, 1.14000E-02, 9.10600E-03, 7.36900E-03, 6.01200E-03, 4.93000E-03, 4.05600E-03, 3.34300E-03, 2.75900E-03, 2.27800E-03]) # Pa-s + self.Tmin = np.min(self.temperature.data) + self.Tmax = np.max(self.temperature.data) + self.TminPsat = self.Tmax + self.name = "AS55" + self.description = "Aspen Temper -55" + self.reshapeAll() + + +class ZS10(PureData): + """ + Heat transfer fluid Zitrec S -10 by Arteco + Source: SecCool Software + """ + def __init__(self): + PureData.__init__(self) + self.temperature.data = np.array([2.65000E+02, 2.70000E+02, 2.75000E+02, 2.80000E+02, 2.85000E+02, 2.90000E+02, 2.95000E+02, 3.00000E+02, 3.05000E+02, 3.10000E+02, 3.15000E+02, 3.20000E+02, 3.25000E+02, 3.30000E+02, 3.35000E+02, 3.40000E+02, 3.45000E+02, 3.50000E+02, 3.55000E+02, 3.60000E+02]) # Kelvin + self.density.data = np.array([1.10250E+03, 1.10020E+03, 1.09790E+03, 1.09550E+03, 1.09320E+03, 1.09090E+03, 1.08860E+03, 1.08630E+03, 1.08390E+03, 1.08160E+03, 1.07930E+03, 1.07700E+03, 1.07470E+03, 1.07230E+03, 1.07000E+03, 1.06770E+03, 1.06540E+03, 1.06300E+03, 1.06070E+03, 1.05840E+03]) # kg/m3 + self.specific_heat.data = np.array([3.54260E+03, 3.55520E+03, 3.56720E+03, 3.57880E+03, 3.59000E+03, 3.60070E+03, 3.61090E+03, 3.62060E+03, 3.62990E+03, 3.63870E+03, 3.64710E+03, 3.65500E+03, 3.66240E+03, 3.66940E+03, 3.67590E+03, 3.68190E+03, 3.68750E+03, 3.69260E+03, 3.69720E+03, 3.70140E+03]) # J/kg-K + self.conductivity.data = np.array([4.99700E-01, 5.06300E-01, 5.13000E-01, 5.19600E-01, 5.26200E-01, 5.32800E-01, 5.39400E-01, 5.45900E-01, 5.52500E-01, 5.59000E-01, 5.65500E-01, 5.72000E-01, 5.78500E-01, 5.84900E-01, 5.91400E-01, 5.97800E-01, 6.04300E-01, 6.10700E-01, 6.17100E-01, 6.23400E-01]) # W/m-K + self.viscosity.data = np.array([4.51900E-03, 3.75000E-03, 3.14500E-03, 2.66500E-03, 2.28200E-03, 1.97200E-03, 1.72000E-03, 1.51300E-03, 1.34200E-03, 1.20000E-03, 1.08100E-03, 9.80000E-04, 8.94000E-04, 8.21000E-04, 7.58000E-04, 7.03000E-04, 6.56000E-04, 6.14000E-04, 5.77000E-04, 5.44000E-04]) # Pa-s + self.Tmin = np.min(self.temperature.data) + self.Tmax = np.max(self.temperature.data) + self.TminPsat = self.Tmax + self.name = "ZS10" + self.description = "Zitrec S -10" + self.reshapeAll() + + +class ZS25(PureData): + """ + Heat transfer fluid Zitrec S -25 by Arteco + Source: SecCool Software + """ + def __init__(self): + PureData.__init__(self) + self.temperature.data = np.array([2.50000E+02, 2.55000E+02, 2.60000E+02, 2.65000E+02, 2.70000E+02, 2.75000E+02, 2.80000E+02, 2.85000E+02, 2.90000E+02, 2.95000E+02, 3.00000E+02, 3.05000E+02, 3.10000E+02, 3.15000E+02, 3.20000E+02, 3.25000E+02, 3.30000E+02, 3.35000E+02, 3.40000E+02, 3.45000E+02, 3.50000E+02, 3.55000E+02, 3.60000E+02]) # Kelvin + self.density.data = np.array([1.20620E+03, 1.20360E+03, 1.20090E+03, 1.19820E+03, 1.19560E+03, 1.19290E+03, 1.19030E+03, 1.18760E+03, 1.18490E+03, 1.18230E+03, 1.17960E+03, 1.17690E+03, 1.17430E+03, 1.17160E+03, 1.16890E+03, 1.16630E+03, 1.16360E+03, 1.16100E+03, 1.15830E+03, 1.15560E+03, 1.15300E+03, 1.15030E+03, 1.14760E+03]) # kg/m3 + self.specific_heat.data = np.array([3.17680E+03, 3.17880E+03, 3.18090E+03, 3.18290E+03, 3.18500E+03, 3.18710E+03, 3.18920E+03, 3.19130E+03, 3.19340E+03, 3.19550E+03, 3.19760E+03, 3.19980E+03, 3.20200E+03, 3.20410E+03, 3.20630E+03, 3.20850E+03, 3.21070E+03, 3.21290E+03, 3.21520E+03, 3.21740E+03, 3.21970E+03, 3.22200E+03, 3.22420E+03]) # J/kg-K + self.conductivity.data = np.array([4.43000E-01, 4.49600E-01, 4.56200E-01, 4.62700E-01, 4.69200E-01, 4.75600E-01, 4.81900E-01, 4.88200E-01, 4.94400E-01, 5.00600E-01, 5.06700E-01, 5.12700E-01, 5.18700E-01, 5.24600E-01, 5.30400E-01, 5.36200E-01, 5.42000E-01, 5.47700E-01, 5.53300E-01, 5.58800E-01, 5.64300E-01, 5.69800E-01, 5.75200E-01]) # W/m-K + self.viscosity.data = np.array([1.06800E-02, 8.37400E-03, 6.68600E-03, 5.42800E-03, 4.47800E-03, 3.74900E-03, 3.18300E-03, 2.73800E-03, 2.38400E-03, 2.10000E-03, 1.86800E-03, 1.67800E-03, 1.52000E-03, 1.38800E-03, 1.27500E-03, 1.17900E-03, 1.09500E-03, 1.02100E-03, 9.55000E-04, 8.95000E-04, 8.40000E-04, 7.89000E-04, 7.40000E-04]) # Pa-s + self.Tmin = np.min(self.temperature.data) + self.Tmax = np.max(self.temperature.data) + self.TminPsat = self.Tmax + self.name = "ZS25" + self.description = "Zitrec S -25" + self.reshapeAll() + + +class ZS40(PureData): + """ + Heat transfer fluid Zitrec S -40 by Arteco + Source: SecCool Software + """ + def __init__(self): + PureData.__init__(self) + self.temperature.data = np.array([2.35000E+02, 2.40000E+02, 2.45000E+02, 2.50000E+02, 2.55000E+02, 2.60000E+02, 2.65000E+02, 2.70000E+02, 2.75000E+02, 2.80000E+02, 2.85000E+02, 2.90000E+02, 2.95000E+02, 3.00000E+02, 3.05000E+02, 3.10000E+02, 3.15000E+02, 3.20000E+02, 3.25000E+02, 3.30000E+02, 3.35000E+02, 3.40000E+02, 3.45000E+02, 3.50000E+02, 3.55000E+02, 3.60000E+02]) # Kelvin + self.density.data = np.array([1.28360E+03, 1.28080E+03, 1.27800E+03, 1.27510E+03, 1.27230E+03, 1.26940E+03, 1.26660E+03, 1.26380E+03, 1.26090E+03, 1.25810E+03, 1.25530E+03, 1.25240E+03, 1.24960E+03, 1.24680E+03, 1.24390E+03, 1.24110E+03, 1.23820E+03, 1.23540E+03, 1.23260E+03, 1.22970E+03, 1.22690E+03, 1.22410E+03, 1.22120E+03, 1.21840E+03, 1.21550E+03, 1.21270E+03]) # kg/m3 + self.specific_heat.data = np.array([2.69640E+03, 2.70500E+03, 2.71320E+03, 2.72100E+03, 2.72850E+03, 2.73570E+03, 2.74260E+03, 2.74940E+03, 2.75600E+03, 2.76250E+03, 2.76900E+03, 2.77540E+03, 2.78190E+03, 2.78850E+03, 2.79530E+03, 2.80220E+03, 2.80930E+03, 2.81670E+03, 2.82440E+03, 2.83250E+03, 2.84100E+03, 2.85000E+03, 2.85950E+03, 2.86950E+03, 2.88010E+03, 2.89140E+03]) # J/kg-K + self.conductivity.data = np.array([4.15100E-01, 4.20500E-01, 4.25800E-01, 4.31200E-01, 4.36500E-01, 4.41800E-01, 4.47200E-01, 4.52500E-01, 4.57800E-01, 4.63100E-01, 4.68400E-01, 4.73600E-01, 4.78900E-01, 4.84200E-01, 4.89400E-01, 4.94700E-01, 4.99900E-01, 5.05200E-01, 5.10400E-01, 5.15600E-01, 5.20800E-01, 5.26000E-01, 5.31200E-01, 5.36400E-01, 5.41600E-01, 5.46800E-01]) # W/m-K + self.viscosity.data = np.array([3.10200E-02, 2.28600E-02, 1.72100E-02, 1.32300E-02, 1.03600E-02, 8.26100E-03, 6.70400E-03, 5.53000E-03, 4.63200E-03, 3.93600E-03, 3.38900E-03, 2.95500E-03, 2.60700E-03, 2.32300E-03, 2.09100E-03, 1.89800E-03, 1.73500E-03, 1.59700E-03, 1.47900E-03, 1.37500E-03, 1.28400E-03, 1.20200E-03, 1.12700E-03, 1.05800E-03, 9.93000E-04, 9.30000E-04]) # Pa-s + self.Tmin = np.min(self.temperature.data) + self.Tmax = np.max(self.temperature.data) + self.TminPsat = self.Tmax + self.name = "ZS40" + self.description = "Zitrec S -40" + self.reshapeAll() + + +class ZS45(PureData): + """ + Heat transfer fluid Zitrec S -45 by Arteco + Source: SecCool Software + """ + def __init__(self): + PureData.__init__(self) + self.temperature.data = np.array([2.30000E+02, 2.35000E+02, 2.40000E+02, 2.45000E+02, 2.50000E+02, 2.55000E+02, 2.60000E+02, 2.65000E+02, 2.70000E+02, 2.75000E+02, 2.80000E+02, 2.85000E+02, 2.90000E+02, 2.95000E+02, 3.00000E+02, 3.05000E+02, 3.10000E+02, 3.15000E+02, 3.20000E+02, 3.25000E+02, 3.30000E+02, 3.35000E+02, 3.40000E+02, 3.45000E+02, 3.50000E+02, 3.55000E+02, 3.60000E+02]) # Kelvin + self.density.data = np.array([1.30590E+03, 1.30320E+03, 1.30040E+03, 1.29760E+03, 1.29490E+03, 1.29210E+03, 1.28940E+03, 1.28660E+03, 1.28380E+03, 1.28110E+03, 1.27830E+03, 1.27550E+03, 1.27280E+03, 1.27000E+03, 1.26730E+03, 1.26450E+03, 1.26170E+03, 1.25900E+03, 1.25620E+03, 1.25340E+03, 1.25070E+03, 1.24790E+03, 1.24520E+03, 1.24240E+03, 1.23960E+03, 1.23690E+03, 1.23410E+03]) # kg/m3 + self.specific_heat.data = np.array([2.55240E+03, 2.56350E+03, 2.57450E+03, 2.58550E+03, 2.59650E+03, 2.60760E+03, 2.61860E+03, 2.62960E+03, 2.64070E+03, 2.65170E+03, 2.66270E+03, 2.67370E+03, 2.68480E+03, 2.69580E+03, 2.70680E+03, 2.71790E+03, 2.72890E+03, 2.73990E+03, 2.75090E+03, 2.76200E+03, 2.77300E+03, 2.78400E+03, 2.79510E+03, 2.80610E+03, 2.81710E+03, 2.82810E+03, 2.83920E+03]) # J/kg-K + self.conductivity.data = np.array([4.06200E-01, 4.11100E-01, 4.15900E-01, 4.20900E-01, 4.25800E-01, 4.30700E-01, 4.35700E-01, 4.40600E-01, 4.45600E-01, 4.50600E-01, 4.55700E-01, 4.60700E-01, 4.65800E-01, 4.70900E-01, 4.76000E-01, 4.81100E-01, 4.86200E-01, 4.91400E-01, 4.96600E-01, 5.01700E-01, 5.07000E-01, 5.12200E-01, 5.17400E-01, 5.22700E-01, 5.28000E-01, 5.33300E-01, 5.38600E-01]) # W/m-K + self.viscosity.data = np.array([4.97400E-02, 3.53200E-02, 2.57000E-02, 1.91400E-02, 1.45700E-02, 1.13300E-02, 8.99200E-03, 7.27000E-03, 5.98200E-03, 5.00500E-03, 4.25200E-03, 3.66500E-03, 3.20000E-03, 2.82800E-03, 2.52700E-03, 2.28000E-03, 2.07500E-03, 1.90300E-03, 1.75600E-03, 1.62900E-03, 1.51800E-03, 1.41800E-03, 1.32800E-03, 1.24400E-03, 1.16500E-03, 1.08900E-03, 1.01600E-03]) # Pa-s + self.Tmin = np.min(self.temperature.data) + self.Tmax = np.max(self.temperature.data) + self.TminPsat = self.Tmax + self.name = "ZS45" + self.description = "Zitrec S -45" + self.reshapeAll() + + +class ZS55(PureData): + """ + Heat transfer fluid Zitrec S -55 by Arteco + Source: SecCool Software + """ + def __init__(self): + PureData.__init__(self) + self.temperature.data = np.array([2.20000E+02, 2.25000E+02, 2.30000E+02, 2.35000E+02, 2.40000E+02, 2.45000E+02, 2.50000E+02, 2.55000E+02, 2.60000E+02, 2.65000E+02, 2.70000E+02, 2.75000E+02, 2.80000E+02, 2.85000E+02, 2.90000E+02, 2.95000E+02, 3.00000E+02, 3.05000E+02, 3.10000E+02, 3.15000E+02, 3.20000E+02, 3.25000E+02, 3.30000E+02, 3.35000E+02, 3.40000E+02, 3.45000E+02, 3.50000E+02, 3.55000E+02, 3.60000E+02]) # Kelvin + self.density.data = np.array([1.35580E+03, 1.35280E+03, 1.34980E+03, 1.34680E+03, 1.34380E+03, 1.34070E+03, 1.33770E+03, 1.33470E+03, 1.33170E+03, 1.32870E+03, 1.32560E+03, 1.32260E+03, 1.31960E+03, 1.31660E+03, 1.31350E+03, 1.31050E+03, 1.30750E+03, 1.30450E+03, 1.30150E+03, 1.29840E+03, 1.29540E+03, 1.29240E+03, 1.28940E+03, 1.28630E+03, 1.28330E+03, 1.28030E+03, 1.27730E+03, 1.27430E+03, 1.27120E+03]) # kg/m3 + self.specific_heat.data = np.array([2.43970E+03, 2.44650E+03, 2.45350E+03, 2.46070E+03, 2.46810E+03, 2.47580E+03, 2.48380E+03, 2.49190E+03, 2.50030E+03, 2.50900E+03, 2.51780E+03, 2.52700E+03, 2.53630E+03, 2.54590E+03, 2.55570E+03, 2.56580E+03, 2.57610E+03, 2.58660E+03, 2.59740E+03, 2.60840E+03, 2.61970E+03, 2.63120E+03, 2.64290E+03, 2.65480E+03, 2.66700E+03, 2.67950E+03, 2.69210E+03, 2.70500E+03, 2.71820E+03]) # J/kg-K + self.conductivity.data = np.array([3.93100E-01, 3.97000E-01, 4.01000E-01, 4.05100E-01, 4.09100E-01, 4.13200E-01, 4.17300E-01, 4.21400E-01, 4.25600E-01, 4.29700E-01, 4.33900E-01, 4.38200E-01, 4.42400E-01, 4.46700E-01, 4.51000E-01, 4.55400E-01, 4.59700E-01, 4.64100E-01, 4.68500E-01, 4.73000E-01, 4.77500E-01, 4.82000E-01, 4.86500E-01, 4.91000E-01, 4.95600E-01, 5.00200E-01, 5.04800E-01, 5.09500E-01, 5.14200E-01]) # W/m-K + self.viscosity.data = np.array([1.44300E-01, 9.52000E-02, 6.46500E-02, 4.51300E-02, 3.23400E-02, 2.37700E-02, 1.78900E-02, 1.37800E-02, 1.08400E-02, 8.69800E-03, 7.11600E-03, 5.92500E-03, 5.01500E-03, 4.31100E-03, 3.75700E-03, 3.31700E-03, 2.96200E-03, 2.67300E-03, 2.43300E-03, 2.23300E-03, 2.06300E-03, 1.91500E-03, 1.78600E-03, 1.67000E-03, 1.56500E-03, 1.46600E-03, 1.37300E-03, 1.28300E-03, 1.19400E-03]) # Pa-s + self.Tmin = np.min(self.temperature.data) + self.Tmax = np.max(self.temperature.data) + self.TminPsat = self.Tmax + self.name = "ZS55" + self.description = "Zitrec S -55" + self.reshapeAll() + + + diff --git a/dev/incompressible_liquids/CPIncomp/WriterObjects.py b/dev/incompressible_liquids/CPIncomp/WriterObjects.py index 9a735cb5..f5e6f24a 100644 --- a/dev/incompressible_liquids/CPIncomp/WriterObjects.py +++ b/dev/incompressible_liquids/CPIncomp/WriterObjects.py @@ -1,6 +1,12 @@ from __future__ import division, print_function import numpy as np from CPIncomp.BaseObjects import IncompressibleData +import CPIncomp.DataObjects as DO +import CPIncomp.CoefficientObjects as CO + + +from CoolProp.CoolProp import FluidsList +import CoolProp.CoolProp as CP class SolutionDataWriter(object): """ @@ -15,82 +21,111 @@ class SolutionDataWriter(object): def fitAll(self, data): T = data.temperature.data x = data.concentration.data + fluid = data.name - #if data.Tbase==0.0: - # data.Tbase = (np.min(T) + np.max(T)) / 2.0 - #if data.xbase==0.0: - # data.xbase = (np.min(x) + np.max(x)) / 2.0 + if data.Tbase==0.0: + data.Tbase = (np.min(T) + np.max(T)) / 2.0 + if data.xbase==0.0: + data.xbase = (np.min(x) + np.max(x)) / 2.0 # Set the standard order for polynomials - std_xorder = 3 - std_yorder = 5 + std_xorder = 3+1 + std_yorder = 5+1 std_coeffs = np.zeros((std_xorder,std_yorder)) errList = (ValueError, AttributeError, TypeError, RuntimeError) - try: - data.density.coeffs = np.copy(std_coeffs) - data.density.type = data.density.INCOMPRESSIBLE_POLYNOMIAL - data.density.fit(T,x,data.Tbase,data.xbase) - except errList as ve: - if self.verbose: print("Could not fit density coefficients:", ve) - pass - - try: - data.specific_heat.coeffs = np.copy(std_coeffs) - data.specific_heat.type = data.specific_heat.INCOMPRESSIBLE_POLYNOMIAL - data.specific_heat.fit(T,x,data.Tbase,data.xbase) - except errList as ve: - if self.verbose: print("Could not fit specific heat coefficients:", ve) - pass - - try: - data.viscosity.coeffs = np.copy(std_coeffs) - data.viscosity.type = data.viscosity.INCOMPRESSIBLE_EXPPOLYNOMIAL - data.viscosity.fit(T,x,data.Tbase,data.xbase) - except errList as ve: - if self.verbose: print("Could not fit viscosity coefficients:", ve) - pass - - try: - data.conductivity.coeffs = np.copy(std_coeffs) - data.conductivity.type = data.conductivity.INCOMPRESSIBLE_POLYNOMIAL - data.conductivity.fit(T,x,data.Tbase,data.xbase) - except errList as ve: - if self.verbose: print("Could not fit conductivity coefficients:", ve) - pass - - try: - data.saturation_pressure.coeffs = np.copy(std_coeffs) - data.saturation_pressure.type = data.saturation_pressure.INCOMPRESSIBLE_EXPPOLYNOMIAL - data.saturation_pressure.fit(T,x,data.Tbase,data.xbase) - except errList as ve: - if self.verbose: print("Could not fit saturation pressure coefficients:", ve) - pass + for name,entry in data.getPolyObjects().iteritems(): + try: + entry.coeffs = np.copy(std_coeffs) + entry.type = entry.INCOMPRESSIBLE_POLYNOMIAL + entry.fitCoeffs(T,x,data.Tbase,data.xbase) + except errList as ve: + if self.verbose: print("{0}: Could not fit {1} coefficients: {2}".format(fluid,name,ve)) + pass + + for name,entry in data.getExpPolyObjects().iteritems(): + try: + entry.coeffs = np.copy(std_coeffs) + entry.type = entry.INCOMPRESSIBLE_EXPPOLYNOMIAL + entry.fitCoeffs(T,x,data.Tbase,data.xbase) + except errList as ve: + if self.verbose: print("{0}: Could not fit {1} coefficients: {2}".format(fluid,name,ve)) + pass try: data.T_freeze.coeffs = np.copy(std_coeffs) data.T_freeze.type = data.T_freeze.INCOMPRESSIBLE_POLYNOMIAL - data.T_freeze.fit(0.0,x,0.0,data.xbase) + data.T_freeze.fitCoeffs(x,0.0,data.xbase,0.0) except errList as ve: - if self.verbose: print("Could not fit TFreeze coefficients:", ve) + if self.verbose: print("{0}: Could not fit {1} coefficients: {2}".format(fluid,"T_freeze",ve)) pass - try: - data.volume2mass.coeffs = np.copy(std_coeffs) - data.volume2mass.type = data.volume2mass.INCOMPRESSIBLE_POLYNOMIAL - data.volume2mass.fit(T,x,data.Tbase,data.xbase) - except errList as ve: - if self.verbose: print("Could not fit V2M coefficients:", ve) - pass - try: - data.mass2mole.coeffs = np.copy(std_coeffs) - data.mass2mole.type = data.mass2mole.INCOMPRESSIBLE_POLYNOMIAL - data.mass2mole.fit(T,x,data.Tbase,data.xbase) - except errList as ve: - if self.verbose: print("Could not fit M2M coefficients:", ve) - pass + +# try: +# data.density.coeffs = np.copy(std_coeffs) +# data.density.type = data.density.INCOMPRESSIBLE_POLYNOMIAL +# data.density.fit(T,x,data.Tbase,data.xbase) +# except errList as ve: +# if self.verbose: print(name, ": Could not fit density coefficients: ", ve) +# pass +# +# try: +# data.specific_heat.coeffs = np.copy(std_coeffs) +# data.specific_heat.type = data.specific_heat.INCOMPRESSIBLE_POLYNOMIAL +# data.specific_heat.fit(T,x,data.Tbase,data.xbase) +# except errList as ve: +# if self.verbose: print(name, ": Could not fit specific heat coefficients: ", ve) +# pass +# +# try: +# data.viscosity.coeffs = np.copy(std_coeffs) +# data.viscosity.type = data.viscosity.INCOMPRESSIBLE_EXPPOLYNOMIAL +# data.viscosity.fit(T,x,data.Tbase,data.xbase) +# except errList as ve: +# if self.verbose: print(name, ": Could not fit viscosity coefficients: ", ve) +# pass +# +# try: +# data.conductivity.coeffs = np.copy(std_coeffs) +# data.conductivity.type = data.conductivity.INCOMPRESSIBLE_POLYNOMIAL +# data.conductivity.fit(T,x,data.Tbase,data.xbase) +# except errList as ve: +# if self.verbose: print(name, ": Could not fit conductivity coefficients: ", ve) +# pass +# +# try: +# data.saturation_pressure.coeffs = np.copy(std_coeffs) +# data.saturation_pressure.type = data.saturation_pressure.INCOMPRESSIBLE_EXPPOLYNOMIAL +# data.saturation_pressure.fit(T,x,data.Tbase,data.xbase) +# except errList as ve: +# if self.verbose: print(name, ": Could not fit saturation pressure coefficients: ", ve) +# pass +# +# try: +# data.T_freeze.coeffs = np.copy(std_coeffs) +# data.T_freeze.type = data.T_freeze.INCOMPRESSIBLE_POLYNOMIAL +# data.T_freeze.fit(0.0,x,0.0,data.xbase) +# except errList as ve: +# if self.verbose: print(name, ": Could not fit TFreeze coefficients: ", ve) +# pass + +# try: +# data.volume2mass.coeffs = np.copy(std_coeffs) +# data.volume2mass.type = data.volume2mass.INCOMPRESSIBLE_POLYNOMIAL +# data.volume2mass.fit(T,x,data.Tbase,data.xbase) +# except errList as ve: +# if self.verbose: print(name, ": Could not fit V2M coefficients: ", ve) +# pass +# +# try: +# data.mass2mole.coeffs = np.copy(std_coeffs) +# data.mass2mole.type = data.mass2mole.INCOMPRESSIBLE_POLYNOMIAL +# data.mass2mole.fit(T,x,data.Tbase,data.xbase) +# except errList as ve: +# if self.verbose: print(name, ": Could not fit M2M coefficients: ", ve) +# pass def toJSON(self,data): @@ -132,4 +167,67 @@ class SolutionDataWriter(object): fp = open(jobj['name']+'.json', 'w') fp.write(dump) - fp.close() \ No newline at end of file + fp.close() + + + +#class FitGraphWriter(object): +# """ +# A base class that defines all the variables needed +# in order to make a proper fit. You can copy this code +# put in your data and add some documentation for where the +# information came from. +# """ +# def __init__(self): +# self.verbose = True +# +# def inCoolProp(self,name): +# #print FluidsList() +# result = name in FluidsList() +# if not result: +# try: +# CP.PropsU('Tmin','T',0,'P',0,name,"SI") +# return True +# except ValueError as e: +# print e +# return False +# +# def getFluidList(self): +# containerList = [] +## containerList += [TherminolD12()] +## containerList += [TherminolVP1(), Therminol66(), Therminol72()] +## containerList += [DowthermJ(), DowthermQ()] +## containerList += [Texatherm22(), NitrateSalt(), SylthermXLT()] +## containerList += [HC50(), HC40(), HC30(), HC20(), HC10()] +## containerList += [AS10(), AS20(), AS30(), AS40(), AS55()] +## containerList += [ZS10(), ZS25(), ZS40(), ZS45(), ZS55()] +# return containerList +# +# def relError(A=[],B=[],PCT=False): +# """ +# Returns the relative Error from (A-B)/B, if PCT is True, it returns percent. +# """ +# result = (np.array(A)-np.array(B))/np.array(B); +# if PCT: +# return result * 100. +# else: +# return result +# +# +# def makePlots(self, fluid): +# # row and column sharing for test plots +# #matplotlib.pyplot.subplots_adjust(top=0.85) +# f, ((ax1, ax2), (ax3, ax4), (ax5, ax6)) = matplotlib.pyplot.subplots(3, 2, sharex='col') +# f.set_size_inches(matplotlib.pyplot.figaspect(1.2)*1.5) +# #f.suptitle("Fit for "+str(data.Desc), fontsize=14) +# +## ### This is the actual fitting +# tData = data.T +# tDat1 = numpy.linspace(numpy.min(tData)+1, numpy.max(tData)-1, 10) +# Pin = 1e20 # Dummy pressure +# inCP =liqObj.inCoolProp(data.Name) +# print "Fluid in CoolProp: "+str(inCP) +# print + + + diff --git a/dev/incompressible_liquids/ExamplePure.json b/dev/incompressible_liquids/ExamplePure.json index 928423b9..de8b64aa 100644 --- a/dev/incompressible_liquids/ExamplePure.json +++ b/dev/incompressible_liquids/ExamplePure.json @@ -1,26 +1,25 @@ { "T_freeze": { - "coeffs": [ - [ - 0.000000000000000e+00 - ] - ], - "type": "polynomial" + "coeffs": "null", + "type": "notdefined" }, - "Tbase": 0.000000000000000e+00, + "Tbase": 3.731500000000000e+02, "Tmax": 4.231500000000000e+02, "Tmin": 3.231500000000000e+02, "TminPsat": 4.231500000000000e+02, "conductivity": { "coeffs": [ [ - 1.480970952797216e-01 + 9.648018648018647e-02 ], [ - -9.483682983683419e-05 + -1.800893550893292e-04 ], [ - -1.165501165501257e-07 + -1.165501165501155e-07 + ], + [ + -9.712509712375223e-10 ] ], "type": "polynomial" @@ -28,56 +27,40 @@ "density": { "coeffs": [ [ - 9.188509110139944e+02 + 7.024452214452213e+02 ], [ - -3.798857808858156e-01 + -7.703185703184596e-01 ], [ - -5.361305361305231e-04 + -5.361305361305524e-04 + ], + [ + -5.439005438915205e-06 ] ], "type": "polynomial" }, "description": "Heat transfer fluid TherminolD12 by Solutia", "mass2mole": { - "coeffs": [ - [ - 0.000000000000000e+00, - 0.000000000000000e+00, - 0.000000000000000e+00, - 0.000000000000000e+00, - 0.000000000000000e+00 - ], - [ - 0.000000000000000e+00, - 0.000000000000000e+00, - 0.000000000000000e+00, - 0.000000000000000e+00, - 0.000000000000000e+00 - ], - [ - 0.000000000000000e+00, - 0.000000000000000e+00, - 0.000000000000000e+00, - 0.000000000000000e+00, - 0.000000000000000e+00 - ] - ], - "type": "polynomial" + "coeffs": "null", + "type": "notdefined" }, "name": "ExamplePure", "reference": "Solutia data sheet", "saturation_pressure": { "coeffs": [ [ - -3.373625698981662e+01 + 1.758406480398250e+00 ], [ - 1.484757141205827e-01 + 4.163045637749924e-02 ], [ - -1.429827445582900e-04 + -1.429827445583037e-04 + ], + [ + 7.709858382251525e-08 ] ], "type": "exppolynomial" @@ -85,13 +68,16 @@ "specific_heat": { "coeffs": [ [ - 6.291029323425564e+02 + 2.446529137529137e+03 ], [ - 5.644631701632086e+00 + 4.096017871017279e+00 ], [ - -2.074592074592690e-03 + -2.074592074591486e-03 + ], + [ + 1.942501940163629e-07 ] ], "type": "polynomial" @@ -99,42 +85,23 @@ "viscosity": { "coeffs": [ [ - 6.734078202541530e+00 + -7.952555049439570e-01 ], [ - -3.030175157911949e-02 + -9.663911227114340e-03 ], [ - 2.713113951297678e-05 + 2.713113951297377e-05 + ], + [ + -2.190286143086986e-07 ] ], "type": "exppolynomial" }, "volume2mass": { - "coeffs": [ - [ - 0.000000000000000e+00, - 0.000000000000000e+00, - 0.000000000000000e+00, - 0.000000000000000e+00, - 0.000000000000000e+00 - ], - [ - 0.000000000000000e+00, - 0.000000000000000e+00, - 0.000000000000000e+00, - 0.000000000000000e+00, - 0.000000000000000e+00 - ], - [ - 0.000000000000000e+00, - 0.000000000000000e+00, - 0.000000000000000e+00, - 0.000000000000000e+00, - 0.000000000000000e+00 - ] - ], - "type": "polynomial" + "coeffs": "null", + "type": "notdefined" }, "xbase": 0.000000000000000e+00, "xmax": 1.000000000000000e+00, diff --git a/dev/incompressible_liquids/ExampleSolution.json b/dev/incompressible_liquids/ExampleSolution.json index 831a672e..b06ec808 100644 --- a/dev/incompressible_liquids/ExampleSolution.json +++ b/dev/incompressible_liquids/ExampleSolution.json @@ -1,80 +1,47 @@ { "T_freeze": { - "coeffs": [ - [ - 0.000000000000000e+00, - 0.000000000000000e+00, - 0.000000000000000e+00, - 0.000000000000000e+00, - 0.000000000000000e+00 - ], - [ - 0.000000000000000e+00, - 0.000000000000000e+00, - 0.000000000000000e+00, - 0.000000000000000e+00, - 0.000000000000000e+00 - ], - [ - 0.000000000000000e+00, - 0.000000000000000e+00, - 0.000000000000000e+00, - 0.000000000000000e+00, - 0.000000000000000e+00 - ] - ], - "type": "polynomial" + "coeffs": "null", + "type": "notdefined" }, - "Tbase": 0.000000000000000e+00, + "Tbase": 2.456500000000000e+02, "Tmax": 2.631500000000000e+02, "Tmin": 2.281500000000000e+02, "TminPsat": 2.631500000000000e+02, "conductivity": { - "coeffs": [ - [ - 0.000000000000000e+00, - 0.000000000000000e+00, - 0.000000000000000e+00, - 0.000000000000000e+00, - 0.000000000000000e+00 - ], - [ - 0.000000000000000e+00, - 0.000000000000000e+00, - 0.000000000000000e+00, - 0.000000000000000e+00, - 0.000000000000000e+00 - ], - [ - 0.000000000000000e+00, - 0.000000000000000e+00, - 0.000000000000000e+00, - 0.000000000000000e+00, - 0.000000000000000e+00 - ] - ], - "type": "polynomial" + "coeffs": "null", + "type": "notdefined" }, "density": { "coeffs": [ [ - -2.399430982040804e+02, - 1.250815901394215e+03, - 4.235073668359494e+01, - -1.816072631001761e+02, - 3.787878787862606e+01 + 1.026080708874463e+03, + -1.590170634919809e+02, + 2.363230519487098e+01, + -5.555555556031459e+01, + 3.787878787435842e+01, + 1.500000000001633e+03 ], [ - 1.185772755113077e+01, - -1.350134561596795e+01, - 7.888548752001263e-01, - 5.820105820110935e-01, + -8.565823197961835e-01, + 1.584394540610013e+00, + -4.885161135173223e-01, + 5.820105820079813e-01, + -1.298701298673707e+00, 0.000000000000000e+00 ], [ - -2.674489795948098e-02, - 3.140022675718737e-02, - -3.287981859254933e-03, + -2.059637188207991e-02, + 2.962207105057909e-02, + -3.287981859486457e-03, + 2.645502645515989e-02, + 0.000000000000000e+00, + 0.000000000000000e+00 + ], + [ + -2.976430976448491e-04, + 3.477633480047034e-04, + 1.827801827859139e-04, + 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00 ] @@ -83,138 +50,28 @@ }, "description": "Ethanol ice slurry", "mass2mole": { - "coeffs": [ - [ - 0.000000000000000e+00, - 0.000000000000000e+00, - 0.000000000000000e+00, - 0.000000000000000e+00, - 0.000000000000000e+00 - ], - [ - 0.000000000000000e+00, - 0.000000000000000e+00, - 0.000000000000000e+00, - 0.000000000000000e+00, - 0.000000000000000e+00 - ], - [ - 0.000000000000000e+00, - 0.000000000000000e+00, - 0.000000000000000e+00, - 0.000000000000000e+00, - 0.000000000000000e+00 - ] - ], - "type": "polynomial" + "coeffs": "null", + "type": "notdefined" }, "name": "ExampleSolution", "reference": "SecCool software", "saturation_pressure": { - "coeffs": [ - [ - 0.000000000000000e+00, - 0.000000000000000e+00, - 0.000000000000000e+00, - 0.000000000000000e+00, - 0.000000000000000e+00 - ], - [ - 0.000000000000000e+00, - 0.000000000000000e+00, - 0.000000000000000e+00, - 0.000000000000000e+00, - 0.000000000000000e+00 - ], - [ - 0.000000000000000e+00, - 0.000000000000000e+00, - 0.000000000000000e+00, - 0.000000000000000e+00, - 0.000000000000000e+00 - ] - ], - "type": "exppolynomial" + "coeffs": "null", + "type": "notdefined" }, "specific_heat": { - "coeffs": [ - [ - 0.000000000000000e+00, - 0.000000000000000e+00, - 0.000000000000000e+00, - 0.000000000000000e+00, - 0.000000000000000e+00 - ], - [ - 0.000000000000000e+00, - 0.000000000000000e+00, - 0.000000000000000e+00, - 0.000000000000000e+00, - 0.000000000000000e+00 - ], - [ - 0.000000000000000e+00, - 0.000000000000000e+00, - 0.000000000000000e+00, - 0.000000000000000e+00, - 0.000000000000000e+00 - ] - ], - "type": "polynomial" + "coeffs": "null", + "type": "notdefined" }, "viscosity": { - "coeffs": [ - [ - 0.000000000000000e+00, - 0.000000000000000e+00, - 0.000000000000000e+00, - 0.000000000000000e+00, - 0.000000000000000e+00 - ], - [ - 0.000000000000000e+00, - 0.000000000000000e+00, - 0.000000000000000e+00, - 0.000000000000000e+00, - 0.000000000000000e+00 - ], - [ - 0.000000000000000e+00, - 0.000000000000000e+00, - 0.000000000000000e+00, - 0.000000000000000e+00, - 0.000000000000000e+00 - ] - ], - "type": "exppolynomial" + "coeffs": "null", + "type": "notdefined" }, "volume2mass": { - "coeffs": [ - [ - 0.000000000000000e+00, - 0.000000000000000e+00, - 0.000000000000000e+00, - 0.000000000000000e+00, - 0.000000000000000e+00 - ], - [ - 0.000000000000000e+00, - 0.000000000000000e+00, - 0.000000000000000e+00, - 0.000000000000000e+00, - 0.000000000000000e+00 - ], - [ - 0.000000000000000e+00, - 0.000000000000000e+00, - 0.000000000000000e+00, - 0.000000000000000e+00, - 0.000000000000000e+00 - ] - ], - "type": "polynomial" + "coeffs": "null", + "type": "notdefined" }, - "xbase": 0.000000000000000e+00, + "xbase": 2.000000000000000e-01, "xmax": 1.000000000000000e+00, "xmin": 0.000000000000000e+00 } \ No newline at end of file diff --git a/dev/incompressible_liquids/all_incompressibles.py b/dev/incompressible_liquids/all_incompressibles.py index 6dc714ea..5522b695 100644 --- a/dev/incompressible_liquids/all_incompressibles.py +++ b/dev/incompressible_liquids/all_incompressibles.py @@ -1,17 +1,112 @@ from __future__ import division, absolute_import, print_function +import inspect import numpy as np import itertools,scipy.interpolate import CoolProp.CoolProp as CP +import CPIncomp.PureFluids +import CPIncomp.DataObjects + from CPIncomp.WriterObjects import SolutionDataWriter from CPIncomp.DataObjects import PureExample, SolutionExample from CPIncomp.CoefficientObjects import SecCoolExample, MelinderExample +def getExampleData(): + return [PureExample(), SolutionExample()] -if __name__ == '__main__': +def getExampleCoef(): + return [SecCoolExample(), MelinderExample()] + +def getExampleObjects(): + return getExampleData() + getExampleCoef() + +def getBaseClassNames(): + ignList = [] + for i in inspect.getmembers(CPIncomp.DataObjects): + ignList.append(i[0]) + return ignList + +def getPureDataObjects(): + classes = [] + ignList = getBaseClassNames() + + for name, obj in inspect.getmembers(CPIncomp.PureFluids): + if inspect.isclass(obj): + #print(name) + if not name in ignList: # Ignore the base classes + classes += [obj()] + return classes + +def getSolutionDataObjects(): + return [] + classes = [] + ignList = getBaseClassNames() + + for name, obj in inspect.getmembers(CPIncomp.SolutionFluids): + if inspect.isclass(obj): + #print(name) + if not name in ignList: # Ignore the base classes + classes += [obj()] + return classes + +def getCoefficientObjects(): + return [] + classes = [] + ignList = getBaseClassNames() + + for name, obj in inspect.getmembers(CPIncomp.CoefficientFluids): + if inspect.isclass(obj): + #print(name) + if not name in ignList: # Ignore the base classes + classes += [obj()] + return classes + + +def fitFluidList(fluidObjs): + for obj in fluidObjs: + if obj==fluidObjs[0]: + print(" {0}".format(obj.name), end="") + elif obj==fluidObjs[-1]: + print(", {0}".format(obj.name), end="") + else: + print(", {0}".format(obj.name), end="") + + try: + writer.fitAll(obj) + except (TypeError, ValueError) as e: + print("An error occurred for fluid: {0}".format(obj.name)) + print(obj) + print(e) + pass + return + +if __name__ == '__main__': + writer = SolutionDataWriter() + dataObjs = getExampleData() + for obj in dataObjs: + writer.fitAll(obj) + + dataObjs += getExampleCoef() + for obj in dataObjs: + writer.toJSON(obj) + + # If the examples did not cause any errors, + # we can proceed to the real data. + dataObjs = getPureDataObjects() + print("Fitting pure fluids:".format(obj.name), end="") + fitFluidList(dataObjs) + for obj in dataObjs: + writer.toJSON(obj) + + dataObjs = getPureDataObjects() + print("Fitting solutions:".format(obj.name), end="") + fitFluidList(dataObjs) + for obj in dataObjs: + writer.toJSON(obj) + # data = SecCoolExample() # writer.toJSON(data) @@ -40,99 +135,99 @@ if __name__ == '__main__': # print data.density.data[1][1] # print np.polynomial.polynomial.polyval2d(data.temperature.data[1], data.concentration.data[1], data.density.coeffs) - test = True - #if test: import CoolProp.CoolProp as CP - if test: from scipy import interpolate - if test: p = 10e5 - - def printInfo(data): - print("{0:s} : {1:.4e}, {2:.4e}".format(data.name, data.Tbase, data.xbase)) - - def printValue(data, T, p, x, fluid='', f=None, dataFunc=None, dataLetter=''): - if f!=None: - try: - print("{0:s} : {7:s} : {1:.4e}, {2:.4e}, {3:.4e}, inputs: {4:.4e}, {5:.4e}, {6:.4e} ".format(data.name, dataFunc(T, p, x), CP.PropsSI(dataLetter,'T',T,'P',p,fluid), float(f(T,x)), T, p, x, dataLetter)) - except: - print("{0:s} : {7:s} : {1:.4e}, {2:.4e}, {3:.4e}, inputs: {4:.4e}, {5:.4e}, {6:.4e} ".format(data.name, dataFunc(T, p, x), CP.PropsSI(dataLetter,'T',T,'P',p,fluid), float(f(T)), T, p, x, dataLetter)) - else: - print ("{0:s} : {7:s} : {1:.4e}, {2:.4e}, {3:.4e}, inputs: {4:.4e}, {5:.4e}, {6:.4e} ".format(data.name, dataFunc(T, p, x), CP.PropsSI(dataLetter,'T',T,'P',p,fluid), 0.0, T, p, x, dataLetter)) - - def printDens(data, T, p, x, fluid='', f=None): - printValue(data, T, p, x, fluid=fluid, f=f, dataFunc=data.rho, dataLetter='D') - - def printHeat(data, T, p, x, fluid='', f=None): - printValue(data, T, p, x, fluid=fluid, f=f, dataFunc=data.c, dataLetter='C') - - def printEnergy(data, T, p, x, fluid='', f=None): - printValue(data, T, p, x, fluid=fluid, f=f, dataFunc=data.u, dataLetter='U') - - def printEnthalpy(data, T, p, x, fluid='', f=None): - printValue(data, T, p, x, fluid=fluid, f=f, dataFunc=data.h, dataLetter='H') - - def printVisc(data, T, p, x, fluid='', f=None): - printValue(data, T, p, x, fluid=fluid, f=f, dataFunc=data.visc, dataLetter='V') - - def printCond(data, T, p, x, fluid='', f=None): - printValue(data, T, p, x, fluid=fluid, f=f, dataFunc=data.cond, dataLetter='L') - - def printPsat(data, T, p, x, fluid='', f=None): - printValue(data, T, p, x, fluid=fluid, f=f, dataFunc=data.psat, dataLetter='Psat') - - def printTfreeze(data, T, p, x, fluid='', f=None): - printValue(data, T, p, x, fluid=fluid, f=f, dataFunc=data.Tfreeze, dataLetter='Tfreeze') - - def printAll(data, T, p, x, fluid=''): - printDens(data, T, p, x, fluid, None) - printHeat(data, T, p, x, fluid, None) - printEnergy(data, T, p, x, fluid, None) - #printEnthalpy(data, T, p, x, fluid, None) - printVisc(data, T, p, x, fluid, None) - printCond(data, T, p, x, fluid, None) - #printPsat(data, T, p, x, fluid, None) - #printTfreeze(data, T, p, x, fluid, None) - - - - - data = PureExample() - writer.fitAll(data) - writer.toJSON(data) - #printInfo(data) - if test: T = 55+273.15 - if test: x = 0.0 - #if test: f = interpolate.interp1d(data.temperature.data, data.density.data.T[0]) - #if test: printDens(data, T, p, x, fluid='TD12', f=f) - #if test: f = interpolate.interp1d(data.temperature.data, data.specific_heat.data.T[0]) - #if test: printHeat(data, T, p, x, fluid='TD12', f=f) - if test: printAll(data, T, p, x, fluid='TD12') - - - data = SolutionExample() - writer.fitAll(data) - writer.toJSON(data) - #printInfo(data) - if test: T = -15+273.15 - if test: x = 0.10 - #if test: f = interpolate.interp2d(data.temperature.data, data.concentration.data, data.density.data.T) - #if test: printDens(data, T, p, x, fluid='IceEA-{0:.4f}%'.format(x*100.0), f=f) - #if test: f = None - if test: printAll(data, T, p, x, fluid='IceEA-{0:.4f}%'.format(x*100.0)) - - - data = SecCoolExample() - writer.toJSON(data) - #printInfo(data) - if test: T = -5+273.15 - if test: x = 0.40 - if test: f = None #interpolate.interp2d(data.temperature.data, data.concentration.data, data.density.data.T) - if test: printAll(data, T, p, x, fluid='SecCoolSolution-{0:.4f}%'.format(x*100.0)) - - data = MelinderExample() - writer.toJSON(data) - #printInfo(data) - if test: T = -5+273.15 - if test: x = 0.3 - if test: f = None #interpolate.interp2d(data.temperature.data, data.concentration.data, data.density.data.T) - if test: printAll(data, T, p, x, fluid='MMA-{0:.4f}%'.format(x*100.0)) +# test = True +# #if test: import CoolProp.CoolProp as CP +# if test: from scipy import interpolate +# if test: p = 10e5 +# +# def printInfo(data): +# print("{0:s} : {1:.4e}, {2:.4e}".format(data.name, data.Tbase, data.xbase)) +# +# def printValue(data, T, p, x, fluid='', f=None, dataFunc=None, dataLetter=''): +# if f!=None: +# try: +# print("{0:s} : {7:s} : {1:.4e}, {2:.4e}, {3:.4e}, inputs: {4:.4e}, {5:.4e}, {6:.4e} ".format(data.name, dataFunc(T, p, x), CP.PropsSI(dataLetter,'T',T,'P',p,fluid), float(f(T,x)), T, p, x, dataLetter)) +# except: +# print("{0:s} : {7:s} : {1:.4e}, {2:.4e}, {3:.4e}, inputs: {4:.4e}, {5:.4e}, {6:.4e} ".format(data.name, dataFunc(T, p, x), CP.PropsSI(dataLetter,'T',T,'P',p,fluid), float(f(T)), T, p, x, dataLetter)) +# else: +# print ("{0:s} : {7:s} : {1:.4e}, {2:.4e}, {3:.4e}, inputs: {4:.4e}, {5:.4e}, {6:.4e} ".format(data.name, dataFunc(T, p, x), CP.PropsSI(dataLetter,'T',T,'P',p,fluid), 0.0, T, p, x, dataLetter)) +# +# def printDens(data, T, p, x, fluid='', f=None): +# printValue(data, T, p, x, fluid=fluid, f=f, dataFunc=data.rho, dataLetter='D') +# +# def printHeat(data, T, p, x, fluid='', f=None): +# printValue(data, T, p, x, fluid=fluid, f=f, dataFunc=data.c, dataLetter='C') +# +# def printEnergy(data, T, p, x, fluid='', f=None): +# printValue(data, T, p, x, fluid=fluid, f=f, dataFunc=data.u, dataLetter='U') +# +# def printEnthalpy(data, T, p, x, fluid='', f=None): +# printValue(data, T, p, x, fluid=fluid, f=f, dataFunc=data.h, dataLetter='H') +# +# def printVisc(data, T, p, x, fluid='', f=None): +# printValue(data, T, p, x, fluid=fluid, f=f, dataFunc=data.visc, dataLetter='V') +# +# def printCond(data, T, p, x, fluid='', f=None): +# printValue(data, T, p, x, fluid=fluid, f=f, dataFunc=data.cond, dataLetter='L') +# +# def printPsat(data, T, p, x, fluid='', f=None): +# printValue(data, T, p, x, fluid=fluid, f=f, dataFunc=data.psat, dataLetter='Psat') +# +# def printTfreeze(data, T, p, x, fluid='', f=None): +# printValue(data, T, p, x, fluid=fluid, f=f, dataFunc=data.Tfreeze, dataLetter='Tfreeze') +# +# def printAll(data, T, p, x, fluid=''): +# printDens(data, T, p, x, fluid, None) +# printHeat(data, T, p, x, fluid, None) +# printEnergy(data, T, p, x, fluid, None) +# #printEnthalpy(data, T, p, x, fluid, None) +# printVisc(data, T, p, x, fluid, None) +# printCond(data, T, p, x, fluid, None) +# #printPsat(data, T, p, x, fluid, None) +# #printTfreeze(data, T, p, x, fluid, None) +# +# +# +# +# data = PureExample() +# writer.fitAll(data) +# writer.toJSON(data) +# #printInfo(data) +# if test: T = 55+273.15 +# if test: x = 0.0 +# #if test: f = interpolate.interp1d(data.temperature.data, data.density.data.T[0]) +# #if test: printDens(data, T, p, x, fluid='TD12', f=f) +# #if test: f = interpolate.interp1d(data.temperature.data, data.specific_heat.data.T[0]) +# #if test: printHeat(data, T, p, x, fluid='TD12', f=f) +# if test: printAll(data, T, p, x, fluid='TD12') +# +# +# data = SolutionExample() +# writer.fitAll(data) +# writer.toJSON(data) +# #printInfo(data) +# if test: T = -15+273.15 +# if test: x = 0.10 +# #if test: f = interpolate.interp2d(data.temperature.data, data.concentration.data, data.density.data.T) +# #if test: printDens(data, T, p, x, fluid='IceEA-{0:.4f}%'.format(x*100.0), f=f) +# #if test: f = None +# if test: printAll(data, T, p, x, fluid='IceEA-{0:.4f}%'.format(x*100.0)) +# +# +# data = SecCoolExample() +# writer.toJSON(data) +# #printInfo(data) +# if test: T = -5+273.15 +# if test: x = 0.40 +# if test: f = None #interpolate.interp2d(data.temperature.data, data.concentration.data, data.density.data.T) +# if test: printAll(data, T, p, x, fluid='SecCoolSolution-{0:.4f}%'.format(x*100.0)) +# +# data = MelinderExample() +# writer.toJSON(data) +# #printInfo(data) +# if test: T = -5+273.15 +# if test: x = 0.3 +# if test: f = None #interpolate.interp2d(data.temperature.data, data.concentration.data, data.density.data.T) +# if test: printAll(data, T, p, x, fluid='MMA-{0:.4f}%'.format(x*100.0)) # \ No newline at end of file diff --git a/include/IncompressibleFluid.h b/include/IncompressibleFluid.h index 35d252a3..0cccd669 100644 --- a/include/IncompressibleFluid.h +++ b/include/IncompressibleFluid.h @@ -64,13 +64,53 @@ protected: double uref, rhoref; double xbase, Tbase; + /// These are the objects that hold the coefficients + /** Note that all polynomials require a 2-dimensional array + * of coefficients. This array may have only one row or + * column, but the structure should be 2D. This behaviour is + * hard-coded in the JSON file reader that resides inside + * the IncompressibleLibrary.cpp + * All other functions, also polyoffset, can only handle 1D + * input and throw an error if you feed them other coefficients. + */ + + /// Density coefficients + /** If 2D, the rows are temperature and the columns are concentration. + * If 1D, should be a column vector of temperature coefficients + */ IncompressibleData density; + /// Specific heat coefficients + /** If 2D, the rows are temperature and the columns are concentration. + * If 1D, should be a column vector of temperature coefficients + * Fails for all other forms than polynomial due to the automatic + * integration for internal energy and entropy. + */ IncompressibleData specific_heat; + /// Viscosity coefficients + /** If 2D, the rows are temperature and the columns are concentration. + * If 1D, should be a column vector of temperature coefficients + */ IncompressibleData viscosity; + /// Conductivity coefficients + /** If 2D, the rows are temperature and the columns are concentration. + * If 1D, should be a column vector of temperature coefficients + */ IncompressibleData conductivity; + /// Saturation pressure coefficients + /** If 2D, the rows are temperature and the columns are concentration. + * If 1D, should be a column vector of temperature coefficients + */ IncompressibleData p_sat; + /// Freezing temperature coefficients + /** If 2D, the rows are concentration and the columns are pressure. + * If 1D, should be a column vector of concentration coefficients + */ IncompressibleData T_freeze; + /// Volume to mass fraction coefficients + /** Not implemented, yet */ IncompressibleData volToMass; + /// Mass to mole fraction coefficients + /** Not implemented, yet */ IncompressibleData massToMole; Polynomial2DFrac poly;