mirror of
https://github.com/CoolProp/CoolProp.git
synced 2026-04-23 03:00:17 -04:00
Added data for T66, added Freezium and TVP 1869
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
from __future__ import division, absolute_import, print_function
|
||||
from __future__ import division, print_function
|
||||
import numpy as np
|
||||
from scipy.optimize._minimize import minimize
|
||||
from scipy.optimize.minpack import curve_fit
|
||||
|
||||
36
dev/incompressible_liquids/CPIncomp/CoefficientFluids.py
Normal file
36
dev/incompressible_liquids/CPIncomp/CoefficientFluids.py
Normal file
@@ -0,0 +1,36 @@
|
||||
from __future__ import division, print_function
|
||||
import numpy as np
|
||||
from CPIncomp.DataObjects import CoefficientData,PureData
|
||||
|
||||
|
||||
class NitrateSalt(PureData,CoefficientData):
|
||||
"""
|
||||
Heat transfer fluid based on 60% NaNO3 and 40% KNO3
|
||||
"""
|
||||
def __init__(self):
|
||||
PureData.__init__(self)
|
||||
CoefficientData.__init__(self)
|
||||
self.name = "NaK"
|
||||
self.description = "NitrateSalt"
|
||||
self.reference = "Solar Power Tower Design Basis Document, Alexis B. Zavoico, Sandia Labs, USA"
|
||||
|
||||
self.Tmin = 300 + 273.15
|
||||
self.Tmax = 600 + 273.15
|
||||
self.TminPsat = self.Tmax
|
||||
|
||||
self.Tbase = 273.15
|
||||
|
||||
#self.temperature.data = self.getTrange()
|
||||
#self.concentration.data = np.array([ 0 ]) # mass fraction
|
||||
|
||||
self.density.type = self.density.INCOMPRESSIBLE_POLYNOMIAL
|
||||
self.density.coeffs = np.array([[2090],[-0.636]])
|
||||
|
||||
self.specific_heat.type = self.specific_heat.INCOMPRESSIBLE_POLYNOMIAL
|
||||
self.specific_heat.coeffs = np.array([[1443],[+0.172]])
|
||||
|
||||
self.conductivity.type = self.conductivity.INCOMPRESSIBLE_POLYNOMIAL
|
||||
self.conductivity.coeffs = np.array([[0.443],[+1.9e-4]])
|
||||
|
||||
self.viscosity.type = self.viscosity.INCOMPRESSIBLE_POLYNOMIAL
|
||||
self.viscosity.coeffs = np.array([[22.714],[-0.120],[2.281 * 1e-4],[-1.474 * 1e-7]])/1e3
|
||||
@@ -1,342 +0,0 @@
|
||||
import numpy as np
|
||||
from CPIncomp.DataObjects import SolutionData
|
||||
|
||||
class CoefficientData(SolutionData):
|
||||
"""
|
||||
A class to convert parameter arrays from different other sources
|
||||
"""
|
||||
def __init__(self):
|
||||
SolutionData.__init__(self)
|
||||
self.reference = "Some other software"
|
||||
|
||||
def convertSecCoolArray(self, array):
|
||||
if len(array)!=18:
|
||||
raise ValueError("The lenght is not equal to 18!")
|
||||
|
||||
self.reference = "SecCool software"
|
||||
array = np.array(array)
|
||||
tmp = np.zeros((4,6))
|
||||
|
||||
tmp[0][0] = array[0]
|
||||
tmp[0][1] = array[1]
|
||||
tmp[0][2] = array[2]
|
||||
tmp[0][3] = array[3]
|
||||
tmp[0][4] = array[4]
|
||||
tmp[0][5] = array[5]
|
||||
|
||||
tmp[1][0] = array[6]
|
||||
tmp[1][1] = array[7]
|
||||
tmp[1][2] = array[8]
|
||||
tmp[1][3] = array[9]
|
||||
tmp[1][4] = array[10]
|
||||
#tmp[1][5] = array[11]
|
||||
|
||||
tmp[2][0] = array[11]
|
||||
tmp[2][1] = array[12]
|
||||
tmp[2][2] = array[13]
|
||||
tmp[2][3] = array[14]
|
||||
#tmp[2][4] = array[4]
|
||||
#tmp[2][5] = array[5]
|
||||
|
||||
tmp[3][0] = array[15]
|
||||
tmp[3][1] = array[16]
|
||||
tmp[3][2] = array[17]
|
||||
#tmp[3][3] = array[3]
|
||||
#tmp[3][4] = array[4]
|
||||
#tmp[3][5] = array[5]
|
||||
|
||||
# Concentration is no longer handled in per cent!
|
||||
for i in range(6):
|
||||
tmp.T[i] *= 100.0**i
|
||||
|
||||
return tmp
|
||||
|
||||
|
||||
def convertSecCoolTfreeze(self, array):
|
||||
expo = -1.0
|
||||
for i in range(len(array)):
|
||||
array[i] = array[i]*np.power(100.0,expo+i)
|
||||
array[1] = array[1] + 273.15
|
||||
#self.T_freeze.type = self.T_freeze.INCOMPRESSIBLE_POLYOFFSET
|
||||
return array
|
||||
|
||||
|
||||
|
||||
def convertMelinderArray(self, array):
|
||||
"""The same function as the SecCool converter,
|
||||
the original source code is slightly different though.
|
||||
That is why the implementation is in a transposed form..."""
|
||||
|
||||
if len(array)!=18:
|
||||
raise ValueError("The lenght is not equal to 18!")
|
||||
|
||||
self.reference = "Melinder Book"
|
||||
array = np.array(array)
|
||||
tmp = np.zeros((6,4))
|
||||
|
||||
tmp[0][0] = array[0]
|
||||
tmp[0][1] = array[6]
|
||||
tmp[0][2] = array[11]
|
||||
tmp[0][3] = array[15]
|
||||
|
||||
tmp[1][0] = array[1]
|
||||
tmp[1][1] = array[7]
|
||||
tmp[1][2] = array[12]
|
||||
tmp[1][3] = array[16]
|
||||
|
||||
tmp[2][0] = array[2]
|
||||
tmp[2][1] = array[8]
|
||||
tmp[2][2] = array[13]
|
||||
tmp[2][3] = array[17]
|
||||
|
||||
tmp[3][0] = array[3]
|
||||
tmp[3][1] = array[9]
|
||||
tmp[3][2] = array[14]
|
||||
|
||||
tmp[4][0] = array[4]
|
||||
tmp[4][1] = array[10]
|
||||
|
||||
tmp[5][0] = array[5]
|
||||
|
||||
# Concentration is no longer handled in per cent!
|
||||
for i in range(6):
|
||||
tmp[i] *= 100.0**i
|
||||
|
||||
return tmp.T
|
||||
|
||||
def convertMelinderMatrix(self, array):
|
||||
"""Function to convert the full coefficient array
|
||||
from the very first CoolProp implementation
|
||||
based on the book by Melinder"""
|
||||
if len(array)!=18:
|
||||
raise ValueError("The lenght is not equal to 18!")
|
||||
if len(array[0])!=5:
|
||||
raise ValueError("The lenght is not equal to 5!")
|
||||
array = np.array(array)
|
||||
tmp = np.zeros((18,5))
|
||||
|
||||
for j in range(5):
|
||||
tmp[ 0][j] = array[ 0][j]
|
||||
tmp[ 1][j] = array[ 4][j]
|
||||
tmp[ 2][j] = array[ 8][j]
|
||||
tmp[ 3][j] = array[12][j]
|
||||
tmp[ 4][j] = array[15][j]
|
||||
tmp[ 5][j] = array[17][j]
|
||||
tmp[ 6][j] = array[ 1][j]
|
||||
tmp[ 7][j] = array[ 5][j]
|
||||
tmp[ 8][j] = array[ 9][j]
|
||||
tmp[ 9][j] = array[13][j]
|
||||
tmp[10][j] = array[16][j]
|
||||
tmp[11][j] = array[ 2][j]
|
||||
tmp[12][j] = array[ 6][j]
|
||||
tmp[13][j] = array[10][j]
|
||||
tmp[14][j] = array[14][j]
|
||||
tmp[15][j] = array[ 3][j]
|
||||
tmp[16][j] = array[ 7][j]
|
||||
tmp[17][j] = array[11][j]
|
||||
|
||||
return tmp
|
||||
|
||||
|
||||
|
||||
def setMelinderMatrix(self, matrix):
|
||||
# matrix = np.array([
|
||||
# [-26.29 , 958.1 ,3887 , 0.4175 , 1.153 ],
|
||||
# [ -0.000002575 , -0.4151 , 7.201 , 0.0007271 , -0.03866 ],
|
||||
# [ -0.000006732 , -0.002261 , -0.08979 , 0.0000002823 , 0.0002779 ],
|
||||
# [ 0.000000163 , 0.0000002998 , -0.000439 , 0.000000009718 , -0.000001543 ],
|
||||
# [ -1.187 , -1.391 , -18.5 , -0.004421 , 0.005448 ],
|
||||
# [ -0.00001609 , -0.0151 , 0.2984 , -0.00002952 , 0.0001008 ],
|
||||
# [ 0.000000342 , 0.0001113 , -0.001865 , 0.00000007336 , -0.000002809 ],
|
||||
# [ 0.0000000005687, -0.0000003264 , -0.00001718 , 0.0000000004328 , 0.000000009811 ],
|
||||
# [ -0.01218 , -0.01105 , -0.03769 , 0.00002044 , -0.0005552 ],
|
||||
# [ 0.0000003865 , 0.0001828 , -0.01196 , 0.0000003413 , 0.000008384 ],
|
||||
# [ 0.000000008768 , -0.000001641 , 0.00009801 , -0.000000003665 , -0.00000003997 ],
|
||||
# [ -0.0000000002095, 0.0000000151 , 0.000000666 , -0.00000000002791 , -0.0000000003466 ],
|
||||
# [ -0.00006823 , -0.0001208 , -0.003776 , 0.0000002943 , 0.000003038 ],
|
||||
# [ 0.00000002137 , 0.000002992 , -0.00005611 , -0.0000000009646 , -0.00000007435 ],
|
||||
# [ -0.0000000004271, 0.000000001455, -0.0000007811, 0.00000000003174 , 0.0000000007442 ],
|
||||
# [ 0.0000001297 , 0.000004927 , -0.0001504 , -0.0000000008666 , 0.00000006669 ],
|
||||
# [ -0.0000000005407, -0.0000001325 , 0.000007373 , -0.0000000000004573, -0.0000000009105 ],
|
||||
# [ 0.00000002363 , -0.00000007727 , 0.000006433 , -0.0000000002033 , -0.0000000008472 ]
|
||||
# ])
|
||||
|
||||
coeffs = self.convertMelinderMatrix(matrix).T
|
||||
|
||||
self.T_freeze.type = self.T_freeze.INCOMPRESSIBLE_POLYNOMIAL
|
||||
self.T_freeze.coeffs = self.convertMelinderArray(coeffs[0])
|
||||
|
||||
self.density.type = self.density.INCOMPRESSIBLE_POLYNOMIAL
|
||||
self.density.coeffs = self.convertMelinderArray(coeffs[1])
|
||||
|
||||
self.specific_heat.type = self.specific_heat.INCOMPRESSIBLE_POLYNOMIAL
|
||||
self.specific_heat.coeffs = self.convertMelinderArray(coeffs[2])
|
||||
|
||||
self.conductivity.type = self.conductivity.INCOMPRESSIBLE_POLYNOMIAL
|
||||
self.conductivity.coeffs = self.convertMelinderArray(coeffs[3])
|
||||
|
||||
self.viscosity.type = self.viscosity.INCOMPRESSIBLE_POLYNOMIAL
|
||||
self.viscosity.coeffs = self.convertMelinderArray(coeffs[4])
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
class SecCoolExample(CoefficientData):
|
||||
"""
|
||||
Ethanol-Water mixture according to Melinder book
|
||||
Source: SecCool Software
|
||||
"""
|
||||
def __init__(self):
|
||||
CoefficientData.__init__(self)
|
||||
self.name = "ExampleSecCool"
|
||||
self.description = "Methanol solution"
|
||||
#self.reference = "SecCool software"
|
||||
self.Tmax = 20 + 273.15
|
||||
self.Tmin = -50 + 273.15
|
||||
self.xmax = 0.5
|
||||
self.xmin = 0.0
|
||||
self.xid = self.ifrac_mass
|
||||
self.TminPsat = 20 + 273.15
|
||||
|
||||
self.Tbase = -4.48 + 273.15
|
||||
self.xbase = 31.57 / 100.0
|
||||
|
||||
self.density.type = self.density.INCOMPRESSIBLE_POLYNOMIAL
|
||||
self.density.coeffs = self.convertSecCoolArray(np.array([
|
||||
960.24665800,
|
||||
-1.2903839100,
|
||||
-0.0161042520,
|
||||
-0.0001969888,
|
||||
1.131559E-05,
|
||||
9.181999E-08,
|
||||
-0.4020348270,
|
||||
-0.0162463989,
|
||||
0.0001623301,
|
||||
4.367343E-06,
|
||||
1.199000E-08,
|
||||
-0.0025204776,
|
||||
0.0001101514,
|
||||
-2.320217E-07,
|
||||
7.794999E-08,
|
||||
9.937483E-06,
|
||||
-1.346886E-06,
|
||||
4.141999E-08]))
|
||||
|
||||
|
||||
|
||||
self.specific_heat.type = self.specific_heat.INCOMPRESSIBLE_POLYNOMIAL
|
||||
self.specific_heat.coeffs = self.convertSecCoolArray(np.array([
|
||||
3822.9712300,
|
||||
-23.122409500,
|
||||
0.0678775826,
|
||||
0.0022413893,
|
||||
-0.0003045332,
|
||||
-4.758000E-06,
|
||||
2.3501449500,
|
||||
0.1788839410,
|
||||
0.0006828000,
|
||||
0.0002101166,
|
||||
-9.812000E-06,
|
||||
-0.0004724176,
|
||||
-0.0003317949,
|
||||
0.0001002032,
|
||||
-5.306000E-06,
|
||||
4.242194E-05,
|
||||
2.347190E-05,
|
||||
-1.894000E-06]))
|
||||
|
||||
self.conductivity.type = self.conductivity.INCOMPRESSIBLE_POLYNOMIAL
|
||||
self.conductivity.coeffs = self.convertSecCoolArray(np.array([
|
||||
0.4082066700,
|
||||
-0.0039816870,
|
||||
1.583368E-05,
|
||||
-3.552049E-07,
|
||||
-9.884176E-10,
|
||||
4.460000E-10,
|
||||
0.0006629321,
|
||||
-2.686475E-05,
|
||||
9.039150E-07,
|
||||
-2.128257E-08,
|
||||
-5.562000E-10,
|
||||
3.685975E-07,
|
||||
7.188416E-08,
|
||||
-1.041773E-08,
|
||||
2.278001E-10,
|
||||
4.703395E-08,
|
||||
7.612361E-11,
|
||||
-2.734000E-10]))
|
||||
|
||||
self.viscosity.type = self.viscosity.INCOMPRESSIBLE_EXPPOLYNOMIAL
|
||||
self.viscosity.coeffs = self.convertSecCoolArray(np.array([
|
||||
1.4725525500,
|
||||
0.0022218998,
|
||||
-0.0004406139,
|
||||
6.047984E-06,
|
||||
-1.954730E-07,
|
||||
-2.372000E-09,
|
||||
-0.0411841566,
|
||||
0.0001784479,
|
||||
-3.564413E-06,
|
||||
4.064671E-08,
|
||||
1.915000E-08,
|
||||
0.0002572862,
|
||||
-9.226343E-07,
|
||||
-2.178577E-08,
|
||||
-9.529999E-10,
|
||||
-1.699844E-06,
|
||||
-1.023552E-07,
|
||||
4.482000E-09]))
|
||||
|
||||
self.T_freeze.type = self.T_freeze.INCOMPRESSIBLE_POLYOFFSET
|
||||
self.T_freeze.coeffs = self.convertSecCoolTfreeze(np.array([
|
||||
27.755555600,
|
||||
-22.973221700,
|
||||
-1.1040507200,
|
||||
-0.0120762281,
|
||||
-9.343458E-05]))
|
||||
|
||||
|
||||
class MelinderExample(CoefficientData):
|
||||
"""
|
||||
Methanol-Water mixture according to Melinder book
|
||||
Source: Book
|
||||
"""
|
||||
def __init__(self):
|
||||
CoefficientData.__init__(self)
|
||||
self.name = "ExampleMelinder"
|
||||
self.description = "Methanol solution"
|
||||
self.reference = "Melinder-BOOK-2010"
|
||||
self.Tmax = 40 + 273.15
|
||||
self.Tmin = -50 + 273.15
|
||||
self.xmax = 0.6
|
||||
self.xmin = 0.0
|
||||
self.xid = self.ifrac_mass
|
||||
self.TminPsat = self.Tmax
|
||||
|
||||
self.Tbase = 3.5359 + 273.15;
|
||||
self.xbase = 30.5128 / 100.0
|
||||
|
||||
coeffs = np.array([
|
||||
[-26.29 , 958.1 ,3887 , 0.4175 , 1.153 ],
|
||||
[ -0.000002575 , -0.4151 , 7.201 , 0.0007271 , -0.03866 ],
|
||||
[ -0.000006732 , -0.002261 , -0.08979 , 0.0000002823 , 0.0002779 ],
|
||||
[ 0.000000163 , 0.0000002998 , -0.000439 , 0.000000009718 , -0.000001543 ],
|
||||
[ -1.187 , -1.391 , -18.5 , -0.004421 , 0.005448 ],
|
||||
[ -0.00001609 , -0.0151 , 0.2984 , -0.00002952 , 0.0001008 ],
|
||||
[ 0.000000342 , 0.0001113 , -0.001865 , 0.00000007336 , -0.000002809 ],
|
||||
[ 0.0000000005687, -0.0000003264 , -0.00001718 , 0.0000000004328 , 0.000000009811 ],
|
||||
[ -0.01218 , -0.01105 , -0.03769 , 0.00002044 , -0.0005552 ],
|
||||
[ 0.0000003865 , 0.0001828 , -0.01196 , 0.0000003413 , 0.000008384 ],
|
||||
[ 0.000000008768 , -0.000001641 , 0.00009801 , -0.000000003665 , -0.00000003997 ],
|
||||
[ -0.0000000002095, 0.0000000151 , 0.000000666 , -0.00000000002791 , -0.0000000003466 ],
|
||||
[ -0.00006823 , -0.0001208 , -0.003776 , 0.0000002943 , 0.000003038 ],
|
||||
[ 0.00000002137 , 0.000002992 , -0.00005611 , -0.0000000009646 , -0.00000007435 ],
|
||||
[ -0.0000000004271, 0.000000001455, -0.0000007811, 0.00000000003174 , 0.0000000007442 ],
|
||||
[ 0.0000001297 , 0.000004927 , -0.0001504 , -0.0000000008666 , 0.00000006669 ],
|
||||
[ -0.0000000005407, -0.0000001325 , 0.000007373 , -0.0000000000004573, -0.0000000009105 ],
|
||||
[ 0.00000002363 , -0.00000007727 , 0.000006433 , -0.0000000002033 , -0.0000000008472 ]
|
||||
])
|
||||
|
||||
self.setMelinderMatrix(coeffs)
|
||||
@@ -1,8 +1,8 @@
|
||||
from __future__ import division, absolute_import, print_function
|
||||
from __future__ import division, print_function
|
||||
import numpy as np
|
||||
from scipy import interpolate
|
||||
from CPIncomp.BaseObjects import IncompressibleData
|
||||
import os, CPIncomp, math
|
||||
from CPIncomp.BaseObjects import IncompressibleData
|
||||
from abc import ABCMeta
|
||||
|
||||
class SolutionData(object):
|
||||
"""
|
||||
@@ -11,6 +11,7 @@ class SolutionData(object):
|
||||
put in your data and add some documentation for where the
|
||||
information came from.
|
||||
"""
|
||||
__metaclass__ = ABCMeta
|
||||
def __init__(self):
|
||||
self.ifrac_mass = 0
|
||||
self.ifrac_mole = 1
|
||||
@@ -176,6 +177,7 @@ class PureData(SolutionData):
|
||||
An extension of the solution data that makes it
|
||||
easier to gather data for pure fluids.
|
||||
"""
|
||||
__metaclass__ = ABCMeta
|
||||
def __init__(self):
|
||||
SolutionData.__init__(self)
|
||||
self.xid = self.ifrac_pure
|
||||
@@ -211,6 +213,7 @@ class DigitalData(SolutionData):
|
||||
easier to generate fitting data from fluids available
|
||||
as Python packages.
|
||||
"""
|
||||
__metaclass__ = ABCMeta
|
||||
def __init__(self):
|
||||
SolutionData.__init__(self)
|
||||
|
||||
@@ -254,20 +257,20 @@ class DigitalData(SolutionData):
|
||||
if self.temperature.data==None or self.concentration.data==None: # no data set, try to get it from file
|
||||
if self.temperature.data!=None: raise ValueError("Temperature is not None, but concentration is.")
|
||||
if self.concentration.data!=None: raise ValueError("Concentration is not None, but temperature is.")
|
||||
if (os.path.isfile(self.getFile(data))): # File found
|
||||
if (data!=None and os.path.isfile(self.getFile(data))): # File found
|
||||
fileArray = self.getFromFile(data)
|
||||
self.temperature.data = np.copy(fileArray[1:,0])
|
||||
self.concentration.data = np.copy(fileArray[0,1:])
|
||||
readFromFile = True
|
||||
else:
|
||||
raise ValueError("No temperature and concentration data given and no readable file found.")
|
||||
raise ValueError("No temperature and concentration data given and no readable file found for {0}".format(data))
|
||||
|
||||
tData = self.round(self.temperature.data)[:,0]
|
||||
xData = self.round(self.concentration.data)[:,0]
|
||||
|
||||
baseArray = np.zeros( (len(tData)+1,len(xData)+1) )
|
||||
|
||||
if (os.path.isfile(self.getFile(data)) and not forceUpdate): # File found and no update wanted
|
||||
if (data!=None and os.path.isfile(self.getFile(data)) and not forceUpdate): # File found and no update wanted
|
||||
if fileArray==None: fileArray = self.getFromFile(data)
|
||||
|
||||
# tFile = fileArray[1:,0]
|
||||
@@ -316,132 +319,190 @@ class DigitalData(SolutionData):
|
||||
baseArray[0,0] = np.NaN
|
||||
baseArray[1:,0] = np.copy(self.temperature.data)
|
||||
baseArray[0,1:] = np.copy(self.concentration.data)
|
||||
self.writeToFile(data, baseArray)
|
||||
if data!=None: self.writeToFile(data, baseArray)
|
||||
|
||||
return np.copy(baseArray.T[1:].T[1:]) # Remove the first column and row and return
|
||||
|
||||
|
||||
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"
|
||||
self.Tmax = 150 + 273.15
|
||||
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.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):
|
||||
class CoefficientData(SolutionData):
|
||||
"""
|
||||
A class to convert parameter arrays from different other sources
|
||||
"""
|
||||
__metaclass__ = ABCMeta
|
||||
def __init__(self):
|
||||
SolutionData.__init__(self)
|
||||
self.name = "ExampleSolution"
|
||||
self.description = "Ethanol ice slurry"
|
||||
self.reference = "Some other software"
|
||||
|
||||
def convertSecCoolArray(self, array):
|
||||
if len(array)!=18:
|
||||
raise ValueError("The lenght is not equal to 18!")
|
||||
|
||||
self.reference = "SecCool software"
|
||||
array = np.array(array)
|
||||
tmp = np.zeros((4,6))
|
||||
|
||||
self.temperature.data = np.array([ -45 , -40 , -35 , -30 , -25 , -20 , -15 , -10])+273.15 # Kelvin
|
||||
self.concentration.data = np.array([ 5 , 10 , 15 , 20 , 25 , 30 , 35 ])/100.0 # mass fraction
|
||||
tmp[0][0] = array[0]
|
||||
tmp[0][1] = array[1]
|
||||
tmp[0][2] = array[2]
|
||||
tmp[0][3] = array[3]
|
||||
tmp[0][4] = array[4]
|
||||
tmp[0][5] = array[5]
|
||||
|
||||
self.density.data = np.array([
|
||||
[1064.0, 1054.6, 1045.3, 1036.3, 1027.4, 1018.6, 1010.0],
|
||||
[1061.3, 1052.1, 1043.1, 1034.3, 1025.6, 1017.0, 1008.6],
|
||||
[1057.6, 1048.8, 1040.1, 1031.5, 1023.1, 1014.8, 1006.7],
|
||||
[1053.1, 1044.6, 1036.2, 1028.0, 1019.9, 1012.0, 1004.1],
|
||||
[1047.5, 1039.4, 1031.5, 1023.7, 1016.0, 1008.4, 1000.9],
|
||||
[1040.7, 1033.2, 1025.7, 1018.4, 1011.2, 1004.0, 997.0],
|
||||
[1032.3, 1025.3, 1018.5, 1011.7, 1005.1, 998.5, 992.0],
|
||||
[1021.5, 1015.3, 1009.2, 1003.1, 997.1, 991.2, 985.4]]) # kg/m3
|
||||
tmp[1][0] = array[6]
|
||||
tmp[1][1] = array[7]
|
||||
tmp[1][2] = array[8]
|
||||
tmp[1][3] = array[9]
|
||||
tmp[1][4] = array[10]
|
||||
#tmp[1][5] = array[11]
|
||||
|
||||
self.specific_heat.data = np.copy(self.density.data)
|
||||
tmp[2][0] = array[11]
|
||||
tmp[2][1] = array[12]
|
||||
tmp[2][2] = array[13]
|
||||
tmp[2][3] = array[14]
|
||||
#tmp[2][4] = array[4]
|
||||
#tmp[2][5] = array[5]
|
||||
|
||||
self.Tmax = np.max(self.temperature.data)
|
||||
self.Tmin = np.min(self.temperature.data)
|
||||
self.xmax = np.max(self.concentration.data)
|
||||
self.xmin = np.min(self.concentration.data)
|
||||
self.xid = self.ifrac_mass
|
||||
self.TminPsat = self.Tmax
|
||||
tmp[3][0] = array[15]
|
||||
tmp[3][1] = array[16]
|
||||
tmp[3][2] = array[17]
|
||||
#tmp[3][3] = array[3]
|
||||
#tmp[3][4] = array[4]
|
||||
#tmp[3][5] = array[5]
|
||||
|
||||
# self.density.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, 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, 1016.0, 1008.4, np.nan],
|
||||
# [np.nan, 1033.2, np.nan, np.nan, np.nan, np.nan, np.nan],
|
||||
# [np.nan, 1025.3, 1018.5, np.nan, np.nan, 998.5, 992.0],
|
||||
# [np.nan, np.nan, 1009.2, np.nan, np.nan, np.nan, np.nan]]) # kg/m3
|
||||
# Concentration is no longer handled in per cent!
|
||||
for i in range(6):
|
||||
tmp.T[i] *= 100.0**i
|
||||
|
||||
return tmp
|
||||
|
||||
|
||||
def convertSecCoolTfreeze(self, array):
|
||||
expo = -1.0
|
||||
for i in range(len(array)):
|
||||
array[i] = array[i]*np.power(100.0,expo+i)
|
||||
array[1] = array[1] + 273.15
|
||||
#self.T_freeze.type = self.T_freeze.INCOMPRESSIBLE_POLYOFFSET
|
||||
return array
|
||||
|
||||
class DigitalExample(DigitalData):
|
||||
|
||||
def __init__(self):
|
||||
DigitalData.__init__(self)
|
||||
|
||||
self.name = "ExampleDigital"
|
||||
self.description = "some fluid"
|
||||
self.reference = "none"
|
||||
def convertMelinderArray(self, array):
|
||||
"""The same function as the SecCool converter,
|
||||
the original source code is slightly different though.
|
||||
That is why the implementation is in a transposed form..."""
|
||||
|
||||
self.Tmin = 273.00;
|
||||
self.Tmax = 500.00;
|
||||
self.xmax = 1.0
|
||||
self.xmin = 0.0
|
||||
self.xid = self.ifrac_mass
|
||||
self.TminPsat = self.Tmin;
|
||||
if len(array)!=18:
|
||||
raise ValueError("The lenght is not equal to 18!")
|
||||
|
||||
self.temperature.data = self.getTrange()
|
||||
self.concentration.data = self.getxrange()
|
||||
self.reference = "Melinder Book"
|
||||
array = np.array(array)
|
||||
tmp = np.zeros((6,4))
|
||||
|
||||
def funcRho(T,x):
|
||||
return T + x*100.0 + T*(x+0.5)
|
||||
self.density.data = self.getArray(funcRho,"rho")
|
||||
tmp[0][0] = array[0]
|
||||
tmp[0][1] = array[6]
|
||||
tmp[0][2] = array[11]
|
||||
tmp[0][3] = array[15]
|
||||
|
||||
def funcCp(T,x):
|
||||
return T + x*50.0 + T*(x+0.6)
|
||||
self.specific_heat.data = self.getArray(funcCp,"cp")
|
||||
tmp[1][0] = array[1]
|
||||
tmp[1][1] = array[7]
|
||||
tmp[1][2] = array[12]
|
||||
tmp[1][3] = array[16]
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
pass
|
||||
## An example with a pure fluid
|
||||
# obj = PureExample()
|
||||
# obj.density.type = obj.density.INCOMPRESSIBLE_POLYNOMIAL
|
||||
# obj.density.coeffs = np.zeros((4,6))
|
||||
# print(obj.density.coeffs)
|
||||
# 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[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]))
|
||||
|
||||
## An example with a solution
|
||||
# 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]))
|
||||
|
||||
## An example with a digital fluid
|
||||
# obj = DigitalExample()
|
||||
# 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]))
|
||||
tmp[2][0] = array[2]
|
||||
tmp[2][1] = array[8]
|
||||
tmp[2][2] = array[13]
|
||||
tmp[2][3] = array[17]
|
||||
|
||||
tmp[3][0] = array[3]
|
||||
tmp[3][1] = array[9]
|
||||
tmp[3][2] = array[14]
|
||||
|
||||
tmp[4][0] = array[4]
|
||||
tmp[4][1] = array[10]
|
||||
|
||||
tmp[5][0] = array[5]
|
||||
|
||||
# Concentration is no longer handled in per cent!
|
||||
for i in range(6):
|
||||
tmp[i] *= 100.0**i
|
||||
|
||||
return tmp.T
|
||||
|
||||
def convertMelinderMatrix(self, array):
|
||||
"""Function to convert the full coefficient array
|
||||
from the very first CoolProp implementation
|
||||
based on the book by Melinder"""
|
||||
if len(array)!=18:
|
||||
raise ValueError("The lenght is not equal to 18!")
|
||||
if len(array[0])!=5:
|
||||
raise ValueError("The lenght is not equal to 5!")
|
||||
array = np.array(array)
|
||||
tmp = np.zeros((18,5))
|
||||
|
||||
for j in range(5):
|
||||
tmp[ 0][j] = array[ 0][j]
|
||||
tmp[ 1][j] = array[ 4][j]
|
||||
tmp[ 2][j] = array[ 8][j]
|
||||
tmp[ 3][j] = array[12][j]
|
||||
tmp[ 4][j] = array[15][j]
|
||||
tmp[ 5][j] = array[17][j]
|
||||
tmp[ 6][j] = array[ 1][j]
|
||||
tmp[ 7][j] = array[ 5][j]
|
||||
tmp[ 8][j] = array[ 9][j]
|
||||
tmp[ 9][j] = array[13][j]
|
||||
tmp[10][j] = array[16][j]
|
||||
tmp[11][j] = array[ 2][j]
|
||||
tmp[12][j] = array[ 6][j]
|
||||
tmp[13][j] = array[10][j]
|
||||
tmp[14][j] = array[14][j]
|
||||
tmp[15][j] = array[ 3][j]
|
||||
tmp[16][j] = array[ 7][j]
|
||||
tmp[17][j] = array[11][j]
|
||||
|
||||
return tmp
|
||||
|
||||
|
||||
|
||||
def setMelinderMatrix(self, matrix):
|
||||
# matrix = np.array([
|
||||
# [-26.29 , 958.1 ,3887 , 0.4175 , 1.153 ],
|
||||
# [ -0.000002575 , -0.4151 , 7.201 , 0.0007271 , -0.03866 ],
|
||||
# [ -0.000006732 , -0.002261 , -0.08979 , 0.0000002823 , 0.0002779 ],
|
||||
# [ 0.000000163 , 0.0000002998 , -0.000439 , 0.000000009718 , -0.000001543 ],
|
||||
# [ -1.187 , -1.391 , -18.5 , -0.004421 , 0.005448 ],
|
||||
# [ -0.00001609 , -0.0151 , 0.2984 , -0.00002952 , 0.0001008 ],
|
||||
# [ 0.000000342 , 0.0001113 , -0.001865 , 0.00000007336 , -0.000002809 ],
|
||||
# [ 0.0000000005687, -0.0000003264 , -0.00001718 , 0.0000000004328 , 0.000000009811 ],
|
||||
# [ -0.01218 , -0.01105 , -0.03769 , 0.00002044 , -0.0005552 ],
|
||||
# [ 0.0000003865 , 0.0001828 , -0.01196 , 0.0000003413 , 0.000008384 ],
|
||||
# [ 0.000000008768 , -0.000001641 , 0.00009801 , -0.000000003665 , -0.00000003997 ],
|
||||
# [ -0.0000000002095, 0.0000000151 , 0.000000666 , -0.00000000002791 , -0.0000000003466 ],
|
||||
# [ -0.00006823 , -0.0001208 , -0.003776 , 0.0000002943 , 0.000003038 ],
|
||||
# [ 0.00000002137 , 0.000002992 , -0.00005611 , -0.0000000009646 , -0.00000007435 ],
|
||||
# [ -0.0000000004271, 0.000000001455, -0.0000007811, 0.00000000003174 , 0.0000000007442 ],
|
||||
# [ 0.0000001297 , 0.000004927 , -0.0001504 , -0.0000000008666 , 0.00000006669 ],
|
||||
# [ -0.0000000005407, -0.0000001325 , 0.000007373 , -0.0000000000004573, -0.0000000009105 ],
|
||||
# [ 0.00000002363 , -0.00000007727 , 0.000006433 , -0.0000000002033 , -0.0000000008472 ]
|
||||
# ])
|
||||
|
||||
coeffs = self.convertMelinderMatrix(matrix).T
|
||||
|
||||
self.T_freeze.type = self.T_freeze.INCOMPRESSIBLE_POLYNOMIAL
|
||||
self.T_freeze.coeffs = self.convertMelinderArray(coeffs[0])
|
||||
|
||||
self.density.type = self.density.INCOMPRESSIBLE_POLYNOMIAL
|
||||
self.density.coeffs = self.convertMelinderArray(coeffs[1])
|
||||
|
||||
self.specific_heat.type = self.specific_heat.INCOMPRESSIBLE_POLYNOMIAL
|
||||
self.specific_heat.coeffs = self.convertMelinderArray(coeffs[2])
|
||||
|
||||
self.conductivity.type = self.conductivity.INCOMPRESSIBLE_POLYNOMIAL
|
||||
self.conductivity.coeffs = self.convertMelinderArray(coeffs[3])
|
||||
|
||||
self.viscosity.type = self.viscosity.INCOMPRESSIBLE_POLYNOMIAL
|
||||
self.viscosity.coeffs = self.convertMelinderArray(coeffs[4])
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -9,43 +9,8 @@ from the equations from the publication to the standard
|
||||
parameter form.
|
||||
|
||||
"""
|
||||
import numpy as np
|
||||
from CPIncomp.DataObjects import DigitalData
|
||||
from CPIncomp.DataObjects import PureData
|
||||
|
||||
|
||||
class NitrateSalt(PureData,DigitalData):
|
||||
"""
|
||||
Heat transfer fluid based on 60% NaNO3 and 40% KNO3
|
||||
"""
|
||||
def __init__(self):
|
||||
DigitalData.__init__(self)
|
||||
PureData.__init__(self)
|
||||
self.name = "NaK"
|
||||
self.description = "NitrateSalt"
|
||||
self.reference = "Solar Power Tower Design Basis Document, Alexis B. Zavoico, Sandia Labs, USA"
|
||||
|
||||
self.Tmin = 300 + 273.15
|
||||
self.Tmax = 600 + 273.15
|
||||
self.TminPsat = self.Tmax
|
||||
|
||||
self.temperature.data = self.getTrange()
|
||||
self.concentration.data = np.array([ 0 ]) # mass fraction
|
||||
|
||||
def f_rho( T,x):
|
||||
return 2090 - 0.636 * (T-273.15)
|
||||
def f_cp( T,x):
|
||||
return 1443 + 0.172 * (T-273.15)
|
||||
def f_mu( T,x):
|
||||
return ( 22.714 - 0.120 * (T-273.15) + 2.281 * 1e-4 * (T-273.15)*(T-273.15) - 1.474 * 1e-7 * (T-273.15)*(T-273.15)*(T-273.15) )/1e3
|
||||
def f_lam( T,x):
|
||||
return 0.443 + 1.9e-4 * (T-273.15)
|
||||
|
||||
self.density.data = self.getArray(f_rho,'D')
|
||||
self.specific_heat.data = self.getArray(f_cp ,'C')
|
||||
self.viscosity.data = self.getArray(f_mu ,'V')
|
||||
self.conductivity.data = self.getArray(f_lam,'L')
|
||||
|
||||
from __future__ import division, print_function
|
||||
from CPIncomp.DataObjects import DigitalData
|
||||
|
||||
class LiBrData(DigitalData):
|
||||
"""
|
||||
@@ -60,12 +25,12 @@ class LiBrData(DigitalData):
|
||||
self.description = "Lithium-Bromide solution from Patek2006"
|
||||
self.reference = "Patek2006"
|
||||
|
||||
self.Tmin = 273.00;
|
||||
self.Tmax = 500.00;
|
||||
self.Tmin = 273.00
|
||||
self.Tmax = 500.00
|
||||
self.xmax = 0.75
|
||||
self.xmin = 0.00
|
||||
self.xid = self.ifrac_mass
|
||||
self.TminPsat = self.Tmin;
|
||||
self.TminPsat = self.Tmin
|
||||
|
||||
self.temperature.data = self.getTrange()
|
||||
self.concentration.data = self.getxrange()
|
||||
@@ -95,5 +60,3 @@ class LiBrData(DigitalData):
|
||||
return CP.PropsSI(key,'T',T,'P',1e8,self.name+"-{0:.4f}%".format(x*100.0))
|
||||
self.saturation_pressure.data = self.getArray(funcP,key)
|
||||
|
||||
|
||||
|
||||
|
||||
240
dev/incompressible_liquids/CPIncomp/ExampleObjects.py
Normal file
240
dev/incompressible_liquids/CPIncomp/ExampleObjects.py
Normal file
@@ -0,0 +1,240 @@
|
||||
from __future__ import division, print_function
|
||||
import numpy as np
|
||||
from CPIncomp.DataObjects import PureData, SolutionData, DigitalData,\
|
||||
CoefficientData
|
||||
|
||||
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"
|
||||
self.Tmax = 150 + 273.15
|
||||
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.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):
|
||||
def __init__(self):
|
||||
SolutionData.__init__(self)
|
||||
self.name = "ExampleSolution"
|
||||
self.description = "Ethanol ice slurry"
|
||||
self.reference = "SecCool software"
|
||||
|
||||
self.temperature.data = np.array([ -45 , -40 , -35 , -30 , -25 , -20 , -15 , -10])+273.15 # Kelvin
|
||||
self.concentration.data = np.array([ 5 , 10 , 15 , 20 , 25 , 30 , 35 ])/100.0 # mass fraction
|
||||
|
||||
self.density.data = np.array([
|
||||
[1064.0, 1054.6, 1045.3, 1036.3, 1027.4, 1018.6, 1010.0],
|
||||
[1061.3, 1052.1, 1043.1, 1034.3, 1025.6, 1017.0, 1008.6],
|
||||
[1057.6, 1048.8, 1040.1, 1031.5, 1023.1, 1014.8, 1006.7],
|
||||
[1053.1, 1044.6, 1036.2, 1028.0, 1019.9, 1012.0, 1004.1],
|
||||
[1047.5, 1039.4, 1031.5, 1023.7, 1016.0, 1008.4, 1000.9],
|
||||
[1040.7, 1033.2, 1025.7, 1018.4, 1011.2, 1004.0, 997.0],
|
||||
[1032.3, 1025.3, 1018.5, 1011.7, 1005.1, 998.5, 992.0],
|
||||
[1021.5, 1015.3, 1009.2, 1003.1, 997.1, 991.2, 985.4]]) # kg/m3
|
||||
|
||||
self.specific_heat.data = np.copy(self.density.data)
|
||||
|
||||
self.Tmax = np.max(self.temperature.data)
|
||||
self.Tmin = np.min(self.temperature.data)
|
||||
self.xmax = np.max(self.concentration.data)
|
||||
self.xmin = np.min(self.concentration.data)
|
||||
self.xid = self.ifrac_mass
|
||||
self.TminPsat = self.Tmax
|
||||
|
||||
|
||||
class DigitalExample(DigitalData):
|
||||
def __init__(self):
|
||||
DigitalData.__init__(self)
|
||||
|
||||
self.name = "ExampleDigital"
|
||||
self.description = "some fluid"
|
||||
self.reference = "none"
|
||||
|
||||
self.Tmin = 273.00;
|
||||
self.Tmax = 500.00;
|
||||
self.xmax = 1.0
|
||||
self.xmin = 0.0
|
||||
self.xid = self.ifrac_mass
|
||||
self.TminPsat = self.Tmin;
|
||||
|
||||
self.temperature.data = self.getTrange()
|
||||
self.concentration.data = self.getxrange()
|
||||
|
||||
def funcRho(T,x):
|
||||
return T + x*100.0 + T*(x+0.5)
|
||||
self.density.data = self.getArray(funcRho,"rho")
|
||||
|
||||
def funcCp(T,x):
|
||||
return T + x*50.0 + T*(x+0.6)
|
||||
self.specific_heat.data = self.getArray(funcCp,"cp")
|
||||
|
||||
|
||||
class SecCoolExample(CoefficientData):
|
||||
"""
|
||||
Ethanol-Water mixture according to Melinder book
|
||||
Source: SecCool Software
|
||||
"""
|
||||
def __init__(self):
|
||||
CoefficientData.__init__(self)
|
||||
self.name = "ExampleSecCool"
|
||||
self.description = "Methanol solution"
|
||||
#self.reference = "SecCool software"
|
||||
self.Tmax = 20 + 273.15
|
||||
self.Tmin = -50 + 273.15
|
||||
self.xmax = 0.5
|
||||
self.xmin = 0.0
|
||||
self.xid = self.ifrac_mass
|
||||
self.TminPsat = 20 + 273.15
|
||||
|
||||
self.Tbase = -4.48 + 273.15
|
||||
self.xbase = 31.57 / 100.0
|
||||
|
||||
self.density.type = self.density.INCOMPRESSIBLE_POLYNOMIAL
|
||||
self.density.coeffs = self.convertSecCoolArray(np.array([
|
||||
960.24665800,
|
||||
-1.2903839100,
|
||||
-0.0161042520,
|
||||
-0.0001969888,
|
||||
1.131559E-05,
|
||||
9.181999E-08,
|
||||
-0.4020348270,
|
||||
-0.0162463989,
|
||||
0.0001623301,
|
||||
4.367343E-06,
|
||||
1.199000E-08,
|
||||
-0.0025204776,
|
||||
0.0001101514,
|
||||
-2.320217E-07,
|
||||
7.794999E-08,
|
||||
9.937483E-06,
|
||||
-1.346886E-06,
|
||||
4.141999E-08]))
|
||||
|
||||
|
||||
|
||||
self.specific_heat.type = self.specific_heat.INCOMPRESSIBLE_POLYNOMIAL
|
||||
self.specific_heat.coeffs = self.convertSecCoolArray(np.array([
|
||||
3822.9712300,
|
||||
-23.122409500,
|
||||
0.0678775826,
|
||||
0.0022413893,
|
||||
-0.0003045332,
|
||||
-4.758000E-06,
|
||||
2.3501449500,
|
||||
0.1788839410,
|
||||
0.0006828000,
|
||||
0.0002101166,
|
||||
-9.812000E-06,
|
||||
-0.0004724176,
|
||||
-0.0003317949,
|
||||
0.0001002032,
|
||||
-5.306000E-06,
|
||||
4.242194E-05,
|
||||
2.347190E-05,
|
||||
-1.894000E-06]))
|
||||
|
||||
self.conductivity.type = self.conductivity.INCOMPRESSIBLE_POLYNOMIAL
|
||||
self.conductivity.coeffs = self.convertSecCoolArray(np.array([
|
||||
0.4082066700,
|
||||
-0.0039816870,
|
||||
1.583368E-05,
|
||||
-3.552049E-07,
|
||||
-9.884176E-10,
|
||||
4.460000E-10,
|
||||
0.0006629321,
|
||||
-2.686475E-05,
|
||||
9.039150E-07,
|
||||
-2.128257E-08,
|
||||
-5.562000E-10,
|
||||
3.685975E-07,
|
||||
7.188416E-08,
|
||||
-1.041773E-08,
|
||||
2.278001E-10,
|
||||
4.703395E-08,
|
||||
7.612361E-11,
|
||||
-2.734000E-10]))
|
||||
|
||||
self.viscosity.type = self.viscosity.INCOMPRESSIBLE_EXPPOLYNOMIAL
|
||||
self.viscosity.coeffs = self.convertSecCoolArray(np.array([
|
||||
1.4725525500,
|
||||
0.0022218998,
|
||||
-0.0004406139,
|
||||
6.047984E-06,
|
||||
-1.954730E-07,
|
||||
-2.372000E-09,
|
||||
-0.0411841566,
|
||||
0.0001784479,
|
||||
-3.564413E-06,
|
||||
4.064671E-08,
|
||||
1.915000E-08,
|
||||
0.0002572862,
|
||||
-9.226343E-07,
|
||||
-2.178577E-08,
|
||||
-9.529999E-10,
|
||||
-1.699844E-06,
|
||||
-1.023552E-07,
|
||||
4.482000E-09]))
|
||||
|
||||
self.T_freeze.type = self.T_freeze.INCOMPRESSIBLE_POLYOFFSET
|
||||
self.T_freeze.coeffs = self.convertSecCoolTfreeze(np.array([
|
||||
27.755555600,
|
||||
-22.973221700,
|
||||
-1.1040507200,
|
||||
-0.0120762281,
|
||||
-9.343458E-05]))
|
||||
|
||||
|
||||
class MelinderExample(CoefficientData):
|
||||
"""
|
||||
Methanol-Water mixture according to Melinder book
|
||||
Source: Book
|
||||
"""
|
||||
def __init__(self):
|
||||
CoefficientData.__init__(self)
|
||||
self.name = "ExampleMelinder"
|
||||
self.description = "Methanol solution"
|
||||
self.reference = "Melinder-BOOK-2010"
|
||||
self.Tmax = 40 + 273.15
|
||||
self.Tmin = -50 + 273.15
|
||||
self.xmax = 0.6
|
||||
self.xmin = 0.0
|
||||
self.xid = self.ifrac_mass
|
||||
self.TminPsat = self.Tmax
|
||||
|
||||
self.Tbase = 3.5359 + 273.15;
|
||||
self.xbase = 30.5128 / 100.0
|
||||
|
||||
coeffs = np.array([
|
||||
[-26.29 , 958.1 ,3887 , 0.4175 , 1.153 ],
|
||||
[ -0.000002575 , -0.4151 , 7.201 , 0.0007271 , -0.03866 ],
|
||||
[ -0.000006732 , -0.002261 , -0.08979 , 0.0000002823 , 0.0002779 ],
|
||||
[ 0.000000163 , 0.0000002998 , -0.000439 , 0.000000009718 , -0.000001543 ],
|
||||
[ -1.187 , -1.391 , -18.5 , -0.004421 , 0.005448 ],
|
||||
[ -0.00001609 , -0.0151 , 0.2984 , -0.00002952 , 0.0001008 ],
|
||||
[ 0.000000342 , 0.0001113 , -0.001865 , 0.00000007336 , -0.000002809 ],
|
||||
[ 0.0000000005687, -0.0000003264 , -0.00001718 , 0.0000000004328 , 0.000000009811 ],
|
||||
[ -0.01218 , -0.01105 , -0.03769 , 0.00002044 , -0.0005552 ],
|
||||
[ 0.0000003865 , 0.0001828 , -0.01196 , 0.0000003413 , 0.000008384 ],
|
||||
[ 0.000000008768 , -0.000001641 , 0.00009801 , -0.000000003665 , -0.00000003997 ],
|
||||
[ -0.0000000002095, 0.0000000151 , 0.000000666 , -0.00000000002791 , -0.0000000003466 ],
|
||||
[ -0.00006823 , -0.0001208 , -0.003776 , 0.0000002943 , 0.000003038 ],
|
||||
[ 0.00000002137 , 0.000002992 , -0.00005611 , -0.0000000009646 , -0.00000007435 ],
|
||||
[ -0.0000000004271, 0.000000001455, -0.0000007811, 0.00000000003174 , 0.0000000007442 ],
|
||||
[ 0.0000001297 , 0.000004927 , -0.0001504 , -0.0000000008666 , 0.00000006669 ],
|
||||
[ -0.0000000005407, -0.0000001325 , 0.000007373 , -0.0000000000004573, -0.0000000009105 ],
|
||||
[ 0.00000002363 , -0.00000007727 , 0.000006433 , -0.0000000002033 , -0.0000000008472 ]
|
||||
])
|
||||
|
||||
self.setMelinderMatrix(coeffs)
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
from __future__ import division, print_function
|
||||
import numpy as np
|
||||
from CPIncomp.CoefficientObjects import CoefficientData
|
||||
from CPIncomp.DataObjects import PureData
|
||||
from CPIncomp.DataObjects import PureData,CoefficientData
|
||||
|
||||
|
||||
class DEBLiquidClass(CoefficientData,PureData):
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
from __future__ import division, print_function
|
||||
import numpy as np
|
||||
from CPIncomp.DataObjects import PureData
|
||||
|
||||
|
||||
from CPIncomp.DataObjects import PureData
|
||||
|
||||
class TherminolD12(PureData):
|
||||
"""
|
||||
@@ -50,26 +49,12 @@ class Therminol66(PureData):
|
||||
"""
|
||||
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.temperature.data = np.array([2.7315E+02, 2.8315E+02, 2.9315E+02, 3.0315E+02, 3.1315E+02, 3.2315E+02, 3.3315E+02, 3.4315E+02, 3.5315E+02, 3.6315E+02, 3.7315E+02, 3.8315E+02, 3.9315E+02, 4.0315E+02, 4.1315E+02, 4.2315E+02, 4.3315E+02, 4.4315E+02, 4.5315E+02, 4.6315E+02, 4.7315E+02, 4.8315E+02, 4.9315E+02, 5.0315E+02, 5.1315E+02, 5.2315E+02, 5.3315E+02, 5.4315E+02, 5.5315E+02, 5.6315E+02, 5.7315E+02, 5.8315E+02, 5.9315E+02, 6.0315E+02, 6.1315E+02, 6.2315E+02, 6.3315E+02, 6.4315E+02, 6.5315E+02])
|
||||
self.density.data = np.array([1.0215E+03, 1.0149E+03, 1.0084E+03, 1.0018E+03, 9.9520E+02, 9.8860E+02, 9.8190E+02, 9.7520E+02, 9.6850E+02, 9.6180E+02, 9.5500E+02, 9.4820E+02, 9.4140E+02, 9.3450E+02, 9.2760E+02, 9.2060E+02, 9.1360E+02, 9.0660E+02, 8.9950E+02, 8.9230E+02, 8.8510E+02, 8.7780E+02, 8.7040E+02, 8.6300E+02, 8.5550E+02, 8.4790E+02, 8.4030E+02, 8.3250E+02, 8.2460E+02, 8.1660E+02, 8.0850E+02, 8.0030E+02, 7.9200E+02, 7.8350E+02, 7.7480E+02, 7.6590E+02, 7.5690E+02, 7.4770E+02, 7.3820E+02])
|
||||
self.specific_heat.data = np.array([1.4950E+03, 1.5290E+03, 1.5620E+03, 1.5960E+03, 1.6300E+03, 1.6650E+03, 1.6990E+03, 1.7330E+03, 1.7680E+03, 1.8030E+03, 1.8370E+03, 1.8730E+03, 1.9080E+03, 1.9430E+03, 1.9780E+03, 2.0140E+03, 2.0500E+03, 2.0860E+03, 2.1220E+03, 2.1580E+03, 2.1950E+03, 2.2310E+03, 2.2680E+03, 2.3050E+03, 2.3420E+03, 2.3790E+03, 2.4170E+03, 2.4550E+03, 2.4920E+03, 2.5310E+03, 2.5690E+03, 2.6080E+03, 2.6470E+03, 2.6860E+03, 2.7260E+03, 2.7660E+03, 2.8060E+03, 2.8470E+03, 2.8890E+03])
|
||||
self.conductivity.data = np.array([1.1800E-01, 1.1800E-01, 1.1800E-01, 1.1700E-01, 1.1700E-01, 1.1600E-01, 1.1600E-01, 1.1500E-01, 1.1500E-01, 1.1400E-01, 1.1400E-01, 1.1300E-01, 1.1200E-01, 1.1100E-01, 1.1100E-01, 1.1000E-01, 1.0900E-01, 1.0800E-01, 1.0700E-01, 1.0700E-01, 1.0600E-01, 1.0500E-01, 1.0400E-01, 1.0300E-01, 1.0200E-01, 1.0000E-01, 9.9000E-02, 9.8000E-02, 9.7000E-02, 9.6000E-02, 9.5000E-02, 9.3000E-02, 9.2000E-02, 9.1000E-02, 8.9000E-02, 8.8000E-02, 8.6000E-02, 8.5000E-02, 8.4000E-02])
|
||||
self.viscosity.data = np.array([1.3249E+00, 3.4426E-01, 1.2347E-01, 5.5600E-02, 2.9500E-02, 1.7640E-02, 1.1530E-02, 8.0600E-03, 5.9300E-03, 4.5500E-03, 3.6000E-03, 2.9200E-03, 2.4200E-03, 2.0500E-03, 1.7500E-03, 1.5200E-03, 1.3400E-03, 1.1800E-03, 1.0600E-03, 9.5000E-04, 8.6000E-04, 7.8000E-04, 7.2000E-04, 6.6000E-04, 6.1000E-04, 5.7000E-04, 5.3000E-04, 4.9000E-04, 4.6000E-04, 4.4000E-04, 4.1000E-04, 3.9000E-04, 3.7000E-04, 3.5000E-04, 3.4000E-04, 3.2000E-04, 3.1000E-04, 3.0000E-04, 2.8000E-04])
|
||||
self.saturation_pressure.data = np.array([ np.NAN, np.NAN, np.NAN, np.NAN, np.NAN, np.NAN, np.NAN, 1.0000E+01, 2.0000E+01, 3.0000E+01, 5.0000E+01, 8.0000E+01, 1.2000E+02, 1.8000E+02, 2.7000E+02, 4.0000E+02, 5.8000E+02, 8.3000E+02, 1.1700E+03, 1.6200E+03, 2.2300E+03, 3.0200E+03, 4.0600E+03, 5.3900E+03, 7.1000E+03, 9.2500E+03, 1.1950E+04, 1.5310E+04, 1.9460E+04, 2.4550E+04, 3.0730E+04, 3.8220E+04, 4.7200E+04, 5.7940E+04, 7.0680E+04, 8.5740E+04, 1.0342E+05, 1.2409E+05, 1.4813E+05])
|
||||
self.Tmin = np.min(self.temperature.data)
|
||||
self.Tmax = np.max(self.temperature.data)
|
||||
self.TminPsat = 70+273.15
|
||||
@@ -287,206 +272,3 @@ class HC10(PureData):
|
||||
self.reference = "Dynalene data sheet"
|
||||
self.reshapeAll()
|
||||
|
||||
|
||||
#
|
||||
#class AS10(PureData):
|
||||
# """
|
||||
# Heat transfer fluid Aspen Temper -10 by Aspen Petroleum
|
||||
# """
|
||||
# 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.reference = "SecCool Software"
|
||||
# self.reshapeAll()
|
||||
#
|
||||
#
|
||||
#class AS20(PureData):
|
||||
# """
|
||||
# Heat transfer fluid Aspen Temper -20 by Aspen Petroleum
|
||||
# """
|
||||
# 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.reference = "SecCool Software"
|
||||
# self.reshapeAll()
|
||||
#
|
||||
#
|
||||
#class AS30(PureData):
|
||||
# """
|
||||
# Heat transfer fluid Aspen Temper -30 by Aspen Petroleum
|
||||
# """
|
||||
# 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.reference = "SecCool Software"
|
||||
# self.reshapeAll()
|
||||
#
|
||||
#
|
||||
#class AS40(PureData):
|
||||
# """
|
||||
# Heat transfer fluid Aspen Temper -40 by Aspen Petroleum
|
||||
# """
|
||||
# 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.reference = "SecCool Software"
|
||||
# self.reshapeAll()
|
||||
#
|
||||
#
|
||||
#class AS55(PureData):
|
||||
# """
|
||||
# Heat transfer fluid Aspen Temper -55 by Aspen Petroleum
|
||||
# """
|
||||
# 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.reference = "SecCool Software"
|
||||
# self.reshapeAll()
|
||||
#
|
||||
#
|
||||
#class ZS10(PureData):
|
||||
# """
|
||||
# Heat transfer fluid Zitrec S -10 by Arteco
|
||||
# """
|
||||
# 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.reference = "SecCool Software"
|
||||
# self.reshapeAll()
|
||||
#
|
||||
#
|
||||
#class ZS25(PureData):
|
||||
# """
|
||||
# Heat transfer fluid Zitrec S -25 by Arteco
|
||||
# """
|
||||
# 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.reference = "SecCool Software"
|
||||
# self.reshapeAll()
|
||||
#
|
||||
#
|
||||
#class ZS40(PureData):
|
||||
# """
|
||||
# Heat transfer fluid Zitrec S -40 by Arteco
|
||||
# """
|
||||
# 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.reference = "SecCool Software"
|
||||
# self.reshapeAll()
|
||||
#
|
||||
#
|
||||
#class ZS45(PureData):
|
||||
# """
|
||||
# Heat transfer fluid Zitrec S -45 by Arteco
|
||||
# """
|
||||
# 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.reference = "SecCool Software"
|
||||
# self.reshapeAll()
|
||||
#
|
||||
#
|
||||
#class ZS55(PureData):
|
||||
# """
|
||||
# Heat transfer fluid Zitrec S -55 by Arteco
|
||||
# """
|
||||
# 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.reference = "SecCool Software"
|
||||
# self.reshapeAll()
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
from __future__ import division, absolute_import, print_function
|
||||
from __future__ import division, print_function
|
||||
import numpy as np
|
||||
from CPIncomp.CoefficientObjects import CoefficientData
|
||||
from CPIncomp.BaseObjects import IncompressibleData
|
||||
from CPIncomp.DataObjects import DigitalData
|
||||
from CPIncomp.DataObjects import DigitalData, PureData
|
||||
import os, CPIncomp
|
||||
|
||||
|
||||
@@ -179,7 +178,7 @@ class SecCoolSolutionData(DigitalData):
|
||||
if not self.allowNegativeData and nu<0:
|
||||
nu = np.NAN # invalid entries
|
||||
except (ValueError, TypeError) as ve:
|
||||
#print "Could not convert entry: {0}".format(ve)
|
||||
if False: print("Could not convert entry: {0}".format(ve))
|
||||
if i==0: nu = 0.0 # Dummy for tables without concentration (TFreeze and Vol2Mass)
|
||||
pass
|
||||
numbers[i,j] = nu
|
||||
@@ -262,7 +261,7 @@ class SecCoolSolutionData(DigitalData):
|
||||
sec += [SecCoolSolutionData(sFile='VDI, Sodium Chloride' ,sFolder='xMass',name='VNA' ,desc='VDI, Sodium Chloride' ,ref='VDI Waermeatlas 9th Edition 2002, SecCool software')]
|
||||
print(", {0}".format(sec[-1].name), end="")
|
||||
|
||||
sec += [SecCoolSolutionData(sFile='HFE-7100' ,sFolder='xPure',name='HFE' ,desc='HFE-7100, Hydrofluoroether' ,ref='3M Novec, SecCool software')]
|
||||
sec += [SecCoolSolutionData(sFile='HFE-7100' ,sFolder='xPure',name='HFE2' ,desc='HFE-7100, Hydrofluoroether' ,ref='3M Novec, SecCool software')]
|
||||
print(", {0}".format(sec[-1].name), end="")
|
||||
sec += [SecCoolSolutionData(sFile='NBS, Water' ,sFolder='xPure',name='NBS' ,desc='NBS, Water' ,ref='Properties of Water and Steam in SI-Units, 2nd Revised and Updated Printing, Springer 1979, pp. 175 ff., SecCool software')]
|
||||
print(", {0}".format(sec[-1].name), end="")
|
||||
@@ -288,12 +287,166 @@ class SecCoolSolutionData(DigitalData):
|
||||
print(", {0}".format(sec[-1].name), end="")
|
||||
sec += [SecCoolSolutionData(sFile='Zitrec S55' ,sFolder='xPure',name='ZS55',desc='Zitrec S55, Potassium formate/Sodium propionate' ,ref='Arteco, SecCool software')]
|
||||
print(", {0}".format(sec[-1].name), end="")
|
||||
sec += [SecCoolSolutionData(sFile='Syltherm XLT' ,sFolder='xPure',name='XLT2',desc='Syltherm XLT, Polydimethylsiloxan' ,ref='Dow Chemicals, SecCool software')]
|
||||
print(", {0}".format(sec[-1].name), end="")
|
||||
sec += [SecCoolSolutionData(sFile='Dowtherm J' ,sFolder='xPure',name='DowJ2',desc='Dowtherm J, Diethylbenzene mixture' ,ref='Dow Chemicals, SecCool software')]
|
||||
print(", {0}".format(sec[-1].name), end="")
|
||||
sec += [SecCoolSolutionData(sFile='Dowtherm Q' ,sFolder='xPure',name='DowQ2',desc='Dowtherm Q, Diphenylethane/alkylated aromatics' ,ref='Dow Chemicals, SecCool software')]
|
||||
print(", {0}".format(sec[-1].name), end="")
|
||||
|
||||
sec += [ThermogenVP1869()]
|
||||
print(", {0}".format(sec[-1].name), end="")
|
||||
sec += [Freezium()]
|
||||
print(", {0}".format(sec[-1].name), end="")
|
||||
|
||||
|
||||
|
||||
print(" ... done")
|
||||
|
||||
return sec
|
||||
|
||||
|
||||
class ThermogenVP1869(PureData,DigitalData):
|
||||
"""
|
||||
Source: SecCool Software
|
||||
"""
|
||||
def __init__(self):
|
||||
PureData.__init__(self)
|
||||
DigitalData.__init__(self)
|
||||
self.name = "TVP1869"
|
||||
self.description = "Thermogen VP 1869"
|
||||
self.reference = "Hoechst, SecCool software"
|
||||
|
||||
self.Tmax = 20 + 273.15
|
||||
self.Tmin = -80 + 273.15
|
||||
self.TminPsat = self.Tmax
|
||||
|
||||
self.Tbase = 0.00 + 273.15
|
||||
|
||||
self.density.type = self.density.INCOMPRESSIBLE_POLYNOMIAL
|
||||
self.density.coeffs = np.array([[945.5454545],[-1.054545455]])
|
||||
|
||||
self.specific_heat.type = self.specific_heat.INCOMPRESSIBLE_POLYNOMIAL
|
||||
self.specific_heat.coeffs = np.array([[2.322218182],[0.003843636]])*1000
|
||||
|
||||
self.conductivity.type = self.conductivity.INCOMPRESSIBLE_POLYNOMIAL
|
||||
self.conductivity.coeffs = np.array([[0.15],[-0.000154545]])
|
||||
|
||||
self.temperature.data = self.getTrange()
|
||||
self.concentration.data = np.array([0]) # mass fraction
|
||||
|
||||
|
||||
def fitFluid(self):
|
||||
key = 'Mu'
|
||||
def funcMu(T,x):
|
||||
T = T-self.Tbase
|
||||
return (341.3688975+T*(-0.713408301+0.017723992*T))/ \
|
||||
(1+T*(0.034502393+T*(0.000401319+1.57288E-06*T)))*1e-2
|
||||
|
||||
self.viscosity.data = self.getArray(funcMu,key)
|
||||
self.viscosity.type = self.viscosity.INCOMPRESSIBLE_EXPPOLYNOMIAL
|
||||
try:
|
||||
self.viscosity.coeffs = np.zeros((4,6))
|
||||
self.viscosity.fitCoeffs(self.temperature.data,self.concentration.data,self.Tbase,self.xbase)
|
||||
except (ValueError, AttributeError, TypeError, RuntimeError) as e:
|
||||
if self.viscosity.DEBUG: print("{0}: Could not fit polynomial {1} coefficients: {2}".format(self.name,'viscosity',e))
|
||||
pass
|
||||
|
||||
|
||||
|
||||
class Freezium(DigitalData):
|
||||
def __init__(self):
|
||||
DigitalData.__init__(self)
|
||||
|
||||
self.name = "FRE"
|
||||
self.description = "Freezium, Potassium Formate"
|
||||
self.reference = "Kemira Chemicals OY, SecCool software"
|
||||
|
||||
self.Tmin = -40 + 273.00
|
||||
self.Tmax = +40 + 273.00
|
||||
self.xmax = 0.50
|
||||
self.xmin = 0.19
|
||||
self.xid = self.ifrac_mass
|
||||
self.TminPsat = self.Tmax
|
||||
|
||||
self.Tbase = 273.15
|
||||
self.xbase = 0.0
|
||||
|
||||
self.temperature.data = self.getTrange()
|
||||
self.concentration.data = self.getxrange()
|
||||
|
||||
self.density.type = self.conductivity.INCOMPRESSIBLE_POLYNOMIAL
|
||||
self.density.coeffs = np.array([[1015,462,406],[-40/100.0,0.0,0.0]])
|
||||
|
||||
self.conductivity.type = self.conductivity.INCOMPRESSIBLE_POLYNOMIAL
|
||||
self.conductivity.coeffs = np.array([[0.55,-0.15],[0.18/100.0,-0.16/100.0]])
|
||||
|
||||
|
||||
def fitFluid(self):
|
||||
|
||||
key = 'Cp'
|
||||
def funcCp(T,x):
|
||||
T = (T-self.Tbase)/100.0
|
||||
return (4.15*np.exp(-0.9*x)+0.63*T*x)*1000.0
|
||||
|
||||
self.specific_heat.data = self.getArray(funcCp,key)
|
||||
self.specific_heat.type = self.viscosity.INCOMPRESSIBLE_POLYNOMIAL
|
||||
try:
|
||||
self.specific_heat.coeffs = np.zeros((4,6))
|
||||
self.specific_heat.fitCoeffs(self.temperature.data,self.concentration.data,self.Tbase,self.xbase)
|
||||
except (ValueError, AttributeError, TypeError, RuntimeError) as e:
|
||||
if self.specific_heat.DEBUG: print("{0}: Could not fit polynomial {1} coefficients: {2}".format(self.name,'specific heat',e))
|
||||
pass
|
||||
funcCp = None
|
||||
|
||||
|
||||
key = 'Mu'
|
||||
def funcMu(T,x):
|
||||
Tr = (T-self.Tbase)/100.0
|
||||
result = 0.32+x*(-0.70+x*2.26)+Tr*(-1.26+Tr*(1.12-Tr*0.894))
|
||||
return self.rho(T, 1e6, x)*np.power(10,result)*1E-3;
|
||||
|
||||
self.viscosity.data = self.getArray(funcMu,key)
|
||||
self.viscosity.type = self.viscosity.INCOMPRESSIBLE_EXPPOLYNOMIAL
|
||||
try:
|
||||
self.viscosity.coeffs = np.zeros((4,6))
|
||||
self.viscosity.fitCoeffs(self.temperature.data,self.concentration.data,self.Tbase,self.xbase)
|
||||
except (ValueError, AttributeError, TypeError, RuntimeError) as e:
|
||||
if self.viscosity.DEBUG: print("{0}: Could not fit polynomial {1} coefficients: {2}".format(self.name,'viscosity',e))
|
||||
pass
|
||||
funcMu = None
|
||||
|
||||
|
||||
# Changed the coefficient order for TFreeze
|
||||
key = 'Tfreeze'
|
||||
def funcTf(x,T):
|
||||
a = 0.03422039835160944
|
||||
b = -0.05425629002714395
|
||||
c = -0.007991085555390726
|
||||
d = 0.001036937163846157
|
||||
e = 0.0003268582531827402
|
||||
f = -7.721483884155584E-06
|
||||
g = -4.841293026057464E-06
|
||||
h = 1.216929917247388E-08
|
||||
i = 2.41704396074865E-08
|
||||
j = 4.314861246570078E-11
|
||||
return ((a+x*(c+x*(e+x*(g+i*x))))/(1+x*(b+x*(d+x*(f+x*(h+j*x))))))+273.15
|
||||
|
||||
# Change the coefficients for TFreeze
|
||||
self.temperature.data = self.getxrange()
|
||||
self.concentration.data = np.array([0.0])
|
||||
self.T_freeze.data = self.getArray(funcTf,key)
|
||||
self.temperature.data = self.getTrange()
|
||||
self.concentration.data = self.getxrange()
|
||||
self.T_freeze.type = self.viscosity.INCOMPRESSIBLE_POLYNOMIAL
|
||||
|
||||
try:
|
||||
self.T_freeze.coeffs = np.zeros((4,6))
|
||||
self.T_freeze.type = self.T_freeze.INCOMPRESSIBLE_POLYNOMIAL
|
||||
self.T_freeze.fitCoeffs(self.concentration.data,0.0,self.xbase,0.0)
|
||||
except (ValueError, AttributeError, TypeError, RuntimeError) as e:
|
||||
if self.T_freeze.DEBUG: print("{0}: Could not fit polynomial {1} coefficients: {2}".format(self.name,'T freeze',e))
|
||||
pass
|
||||
funcTf = None
|
||||
|
||||
|
||||
|
||||
@@ -1,15 +1,7 @@
|
||||
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
|
||||
import hashlib
|
||||
import os, CPIncomp
|
||||
import json
|
||||
import hashlib, os, CPIncomp, json
|
||||
|
||||
class SolutionDataWriter(object):
|
||||
"""
|
||||
@@ -21,15 +13,15 @@ class SolutionDataWriter(object):
|
||||
def __init__(self):
|
||||
pass
|
||||
|
||||
def fitAll(self, data):
|
||||
T = data.temperature.data
|
||||
x = data.concentration.data
|
||||
fluid = data.name
|
||||
def fitAll(self, fluidObject):
|
||||
|
||||
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
|
||||
tempData = fluidObject.temperature.data
|
||||
concData = fluidObject.concentration.data
|
||||
|
||||
if fluidObject.Tbase==0.0 or fluidObject.Tbase==None:
|
||||
fluidObject.Tbase = (np.min(tempData) + np.max(tempData)) / 2.0
|
||||
if fluidObject.xbase==0.0 or fluidObject.xbase==None:
|
||||
fluidObject.xbase = (np.min(concData) + np.max(concData)) / 2.0
|
||||
|
||||
# Set the standard order for polynomials
|
||||
std_xorder = 3+1
|
||||
@@ -38,109 +30,70 @@ class SolutionDataWriter(object):
|
||||
|
||||
errList = (ValueError, AttributeError, TypeError, RuntimeError)
|
||||
|
||||
polyDict = {}
|
||||
polyDict["density"] = data.density
|
||||
polyDict["specific heat"] = data.specific_heat
|
||||
# polyDict["viscosity"] = self.viscosity
|
||||
polyDict["conductivity"] = data.conductivity
|
||||
# polyDict["saturation_pressure"] = self.saturation_pressure
|
||||
# polyDict["T_freeze"] = self.T_freeze
|
||||
|
||||
expDict = {}
|
||||
expDict["viscosity"] = data.viscosity
|
||||
expDict["saturation pressure"] = data.saturation_pressure
|
||||
|
||||
for name,entry in polyDict.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 entry.DEBUG: print("{0}: Could not fit polynomial {1} coefficients: {2}".format(fluid,name,ve))
|
||||
pass
|
||||
|
||||
for name,entry in expDict.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 entry.DEBUG: print("{0}: Could not fit exponential {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.fitCoeffs(x,0.0,data.xbase,0.0)
|
||||
try:
|
||||
fluidObject.density.coeffs = np.copy(std_coeffs)
|
||||
fluidObject.density.type = fluidObject.density.INCOMPRESSIBLE_POLYNOMIAL
|
||||
fluidObject.density.fitCoeffs(tempData,concData,fluidObject.Tbase,fluidObject.xbase)
|
||||
except errList as ve:
|
||||
if data.T_freeze.DEBUG: print("{0}: Could not fit {1} coefficients: {2}".format(fluid,"T_freeze",ve))
|
||||
if fluidObject.density.DEBUG: print("{0}: Could not fit polynomial {1} coefficients: {2}".format(fluidObject.name,'density',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:
|
||||
fluidObject.specific_heat.coeffs = np.copy(std_coeffs)
|
||||
fluidObject.specific_heat.type = fluidObject.specific_heat.INCOMPRESSIBLE_POLYNOMIAL
|
||||
fluidObject.specific_heat.fitCoeffs(tempData,concData,fluidObject.Tbase,fluidObject.xbase)
|
||||
except errList as ve:
|
||||
if fluidObject.specific_heat.DEBUG: print("{0}: Could not fit polynomial {1} coefficients: {2}".format(fluidObject.name,'specific heat',ve))
|
||||
pass
|
||||
|
||||
try:
|
||||
fluidObject.conductivity.coeffs = np.copy(std_coeffs)
|
||||
fluidObject.conductivity.type = fluidObject.conductivity.INCOMPRESSIBLE_POLYNOMIAL
|
||||
fluidObject.conductivity.fitCoeffs(tempData,concData,fluidObject.Tbase,fluidObject.xbase)
|
||||
except errList as ve:
|
||||
if fluidObject.conductivity.DEBUG: print("{0}: Could not fit polynomial {1} coefficients: {2}".format(fluidObject.name,'conductivity',ve))
|
||||
pass
|
||||
|
||||
try:
|
||||
fluidObject.viscosity.coeffs = np.copy(std_coeffs)
|
||||
fluidObject.viscosity.type = fluidObject.viscosity.INCOMPRESSIBLE_EXPPOLYNOMIAL
|
||||
fluidObject.viscosity.fitCoeffs(tempData,concData,fluidObject.Tbase,fluidObject.xbase)
|
||||
except errList as ve:
|
||||
if fluidObject.viscosity.DEBUG: print("{0}: Could not fit polynomial {1} coefficients: {2}".format(fluidObject.name,'viscosity',ve))
|
||||
pass
|
||||
|
||||
# reset data for getArray and read special files
|
||||
if fluidObject.xid!=fluidObject.ifrac_pure and fluidObject.xid!=fluidObject.ifrac_undefined:
|
||||
try:
|
||||
fluidObject.T_freeze.coeffs = np.copy(std_coeffs)
|
||||
fluidObject.T_freeze.type = fluidObject.T_freeze.INCOMPRESSIBLE_POLYNOMIAL
|
||||
fluidObject.T_freeze.fitCoeffs(concData,0.0,fluidObject.xbase,0.0)
|
||||
except errList as ve:
|
||||
if fluidObject.T_freeze.DEBUG: print("{0}: Could not fit {1} coefficients: {2}".format(fluidObject.name,"T_freeze",ve))
|
||||
pass
|
||||
#
|
||||
# # reset data for getArray again
|
||||
# if fluidObject.xid==fluidObject.ifrac_volume:
|
||||
# try:
|
||||
# fluidObject.mass2input.coeffs = np.copy(std_coeffs)
|
||||
# fluidObject.mass2input.type = fluidObject.mass2input.INCOMPRESSIBLE_POLYNOMIAL
|
||||
# fluidObject.mass2input.fitCoeffs([fluidObject.Tbase],massData,fluidObject.Tbase,fluidObject.xbase)
|
||||
# except errList as ve:
|
||||
# if fluidObject.mass2input.DEBUG: print("{0}: Could not fit {1} coefficients: {2}".format(fluidObject.name,"mass2input",ve))
|
||||
# pass
|
||||
# elif fluidObject.xid==fluidObject.ifrac_mass:
|
||||
# _,_,fluidObject.volume2input.data = IncompressibleData.shfluidObject.ray(massData,axs=1)
|
||||
# #_,_,volData = IncompressibleData.shapeArray(volData,axs=1)
|
||||
# try:
|
||||
# fluidObject.volume2input.coeffs = np.copy(std_coeffs)
|
||||
# fluidObject.volume2input.type = fluidObject.volume2input.INCOMPRESSIBLE_POLYNOMIAL
|
||||
# fluidObject.volume2input.fitCoeffs([fluidObject.Tbase],volData,fluidObject.Tbase,fluidObject.xbase)
|
||||
# except errList as ve:
|
||||
# if fluidObject.volume2input.DEBUG: print("{0}: Could not fit {1} coefficients: {2}".format(fluidObject.name,"volume2input",ve))
|
||||
# pass
|
||||
# else:
|
||||
# raise ValueError("Unknown xid specified.")
|
||||
|
||||
# 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 get_hash(self,data):
|
||||
return hashlib.sha224(data).hexdigest()
|
||||
@@ -196,8 +149,9 @@ class SolutionDataWriter(object):
|
||||
#print json.dumps(1.0001)
|
||||
stdFmt = " .{0}e".format(int(data.significantDigits-1))
|
||||
#pr = np.finfo(float).eps * 10.0
|
||||
pr = np.finfo(float).precision - 2 # stay away from numerical precision
|
||||
json.encoder.FLOAT_REPR = lambda o: format(np.around(o,decimals=pr), stdFmt)
|
||||
#pr = np.finfo(float).precision - 2 # stay away from numerical precision
|
||||
#json.encoder.FLOAT_REPR = lambda o: format(np.around(o,decimals=pr), stdFmt)
|
||||
json.encoder.FLOAT_REPR = lambda o: format(o, stdFmt)
|
||||
dump = json.dumps(jobj, indent = 2, sort_keys = True)
|
||||
json.encoder.FLOAT_REPR = original_float_repr
|
||||
|
||||
@@ -222,7 +176,62 @@ class SolutionDataWriter(object):
|
||||
if not quiet: print(" ({0})".format("i"), end="")
|
||||
|
||||
|
||||
|
||||
def printStatusID(self, fluidObjs, obj):
|
||||
#obj = fluidObjs[num]
|
||||
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="")
|
||||
|
||||
return
|
||||
|
||||
|
||||
def fitFluidList(self, fluidObjs):
|
||||
print("Fitting normal fluids:", end="")
|
||||
for obj in fluidObjs:
|
||||
self.printStatusID(fluidObjs, obj)
|
||||
try:
|
||||
self.fitAll(obj)
|
||||
except (TypeError, ValueError) as e:
|
||||
print("An error occurred for fluid: {0}".format(obj.name))
|
||||
print(obj)
|
||||
print(e)
|
||||
pass
|
||||
print(" ... done")
|
||||
return
|
||||
|
||||
|
||||
def fitSecCoolList(self, fluidObjs):
|
||||
print("Fitting SecCool fluids:", end="")
|
||||
for obj in fluidObjs:
|
||||
self.printStatusID(fluidObjs, obj)
|
||||
try:
|
||||
obj.fitFluid()
|
||||
except (TypeError, ValueError) as e:
|
||||
print("An error occurred for fluid: {0}".format(obj.name))
|
||||
print(obj)
|
||||
print(e)
|
||||
pass
|
||||
print(" ... done")
|
||||
return
|
||||
|
||||
|
||||
def writeFluidList(self, fluidObjs):
|
||||
print("Legend: FluidName (w) | (i) -> (w)=written, (i)=ignored, unchanged coefficients")
|
||||
print("Writing fluids to JSON:", end="")
|
||||
for obj in fluidObjs:
|
||||
self.printStatusID(fluidObjs, obj)
|
||||
try:
|
||||
self.toJSON(obj)
|
||||
except (TypeError, ValueError) as e:
|
||||
print("An error occurred for fluid: {0}".format(obj.name))
|
||||
print(obj)
|
||||
print(e)
|
||||
pass
|
||||
print(" ... done")
|
||||
return
|
||||
|
||||
|
||||
#class FitGraphWriter(object):
|
||||
|
||||
@@ -6,10 +6,144 @@ readme.md - General instructions and copyright information / credits.
|
||||
|
||||
"""
|
||||
from __future__ import division, absolute_import, print_function
|
||||
import inspect
|
||||
from . import DataObjects,ExampleObjects,PureFluids,CoefficientFluids,DigitalFluids,MelinderFluids
|
||||
from CPIncomp.SecCoolFluids import SecCoolSolutionData
|
||||
|
||||
|
||||
def getBaseClassNames():
|
||||
"""
|
||||
Returns a list of names of the abstract base
|
||||
classes that should not be instantiated. Can
|
||||
be used to build an ignore list.
|
||||
"""
|
||||
ignList = []
|
||||
for i in inspect.getmembers(DataObjects):
|
||||
if inspect.isclass(i[1]):
|
||||
ignList.append(i[0])
|
||||
return ignList
|
||||
|
||||
|
||||
def getExampleNames(obj=False):
|
||||
"""
|
||||
Returns a list of names of the example fluid
|
||||
classes that should not be treated like the
|
||||
normal fluids. Can be used to build an ignore
|
||||
list.
|
||||
Use the obj switch to return the objects instead
|
||||
of the names.
|
||||
"""
|
||||
ignList = getBaseClassNames()
|
||||
outList = []
|
||||
for i in inspect.getmembers(ExampleObjects):
|
||||
if inspect.isclass(i[1]):
|
||||
if i[0] not in ignList:
|
||||
if obj: outList.append(i[1]())
|
||||
else: outList.append(i[0])
|
||||
return outList
|
||||
|
||||
|
||||
def getIgnoreNames():
|
||||
"""
|
||||
Returns a list of names of classes that should
|
||||
not be treated like the normal fluids.
|
||||
"""
|
||||
ignList = []
|
||||
ignList += getBaseClassNames()
|
||||
ignList += getExampleNames()
|
||||
return ignList
|
||||
|
||||
|
||||
def getCoefficientFluids():
|
||||
"""
|
||||
Returns a list of CoefficientData objects, which
|
||||
already contain all coefficients. These objects
|
||||
can be written to JSON without further processing.
|
||||
"""
|
||||
classes = []
|
||||
ignList = getIgnoreNames()
|
||||
for name, obj in inspect.getmembers(CoefficientFluids):
|
||||
if inspect.isclass(obj):
|
||||
#print(name)
|
||||
if not name in ignList: # Ignore the base classes
|
||||
classes.append(obj())
|
||||
return classes
|
||||
|
||||
|
||||
def getDigitalFluids():
|
||||
"""
|
||||
Returns a list of DigitalData objects, which
|
||||
contain data for the fitting. These objects
|
||||
only hold the data and you still have to call
|
||||
the fitting routines.
|
||||
a) Data in these classes is based on equations
|
||||
that cannot be converted to the forms available
|
||||
in CoolProp.
|
||||
b) There are no equations available, but the
|
||||
fluid data can be accessed from python in the
|
||||
form of another library.
|
||||
c) There are data files that contain the experimental
|
||||
data. The fit has to be done after laoding the fluids.
|
||||
"""
|
||||
classes = []
|
||||
ignList = getIgnoreNames()
|
||||
for name, obj in inspect.getmembers(DigitalFluids):
|
||||
if inspect.isclass(obj):
|
||||
#print(name)
|
||||
if not name in ignList: # Ignore the base classes
|
||||
classes.append(obj())
|
||||
return classes
|
||||
|
||||
|
||||
def getMelinderFluids():
|
||||
"""
|
||||
Returns a list of CoefficientData objects, which
|
||||
already contain all coefficients. These objects
|
||||
can be written to JSON without further processing.
|
||||
All coefficients are taken from the same reference:
|
||||
"Properties of Secondary Working Fluids for Indirect Systems"
|
||||
written by Aake Melinder and published in 2010 by IIR
|
||||
"""
|
||||
classes = []
|
||||
ignList = getIgnoreNames()
|
||||
for name, obj in inspect.getmembers(MelinderFluids):
|
||||
if inspect.isclass(obj):
|
||||
#print(name)
|
||||
if not name in ignList: # Ignore the base classes
|
||||
classes.append(obj())
|
||||
return classes
|
||||
|
||||
|
||||
def getPureFluids():
|
||||
"""
|
||||
Returns a list of SolutionData objects, which
|
||||
contain data for fitting pure fluids. These
|
||||
objects only hold the data and you still have
|
||||
to call the fitting routines.
|
||||
"""
|
||||
classes = []
|
||||
ignList = getIgnoreNames()
|
||||
for name, obj in inspect.getmembers(PureFluids):
|
||||
if inspect.isclass(obj):
|
||||
#print(name)
|
||||
if not name in ignList: # Ignore the base classes
|
||||
classes.append(obj())
|
||||
return classes
|
||||
|
||||
|
||||
def getSecCoolFluids():
|
||||
"""
|
||||
Returns a list of DigitalData objects, which
|
||||
contain data for the fits. All objects here
|
||||
implement the fitFluid() function, which can
|
||||
be called to set the coefficients before writing
|
||||
the JSON files.
|
||||
"""
|
||||
return SecCoolSolutionData.factory()
|
||||
|
||||
|
||||
def get_version():
|
||||
return 0.1
|
||||
return 0.5
|
||||
|
||||
if __name__ == "__main__":
|
||||
print('You are using version %s of the Python package for incompressible liquids in CoolProp.'%(get_version()))
|
||||
|
||||
Reference in New Issue
Block a user