Exemplo n.º 1
0
def CalNodeProperties(nodes):
    """ get node properties using seuif97 """
    for node in nodes:
        if node['p'] != None and node['t'] != None:
            node['h'] = pt2h(node['p'], node['t'])
            node['s'] = pt2s(node['p'], node['t'])
            node['x'] = pt2x(node['p'], node['t'])
        elif node['p'] != None and node['x'] != None:
            node['t'] = px2t(node['p'], node['x'])
            node['h'] = px2h(node['p'], node['x'])
            node['s'] = px2s(node['p'], node['x'])
        elif node['t'] != None and node['x'] != None:
            node['p'] = tx2p(node['t'], node['x'])
            node['h'] = tx2h(node['t'], node['x'])
            node['s'] = tx2s(node['t'], node['x'])
Exemplo n.º 2
0
 def tx(self):
     self.p = if97.tx2p(self.t, self.x)
     self.h = if97.tx2h(self.t, self.x)
     self.s = if97.tx2s(self.t, self.x)
     self.v = if97.tx2v(self.t, self.x)
Exemplo n.º 3
0
# Isotherm lines to plot, values in ºC
isot = np.array([0, 50, 100, 200, 300, 400, 500, 600, 700, 800])
isop = np.array([Pt, 0.001, 0.01, 0.1, 1, 10, 20, 50, 100])
for t in isot:
    h = np.array([pt2h(p, t) for p in isop])
    s = np.array([pt2s(p, t) for p in isop])
    plt.plot(s, h, 'g', lw=0.5)

# Isobar lines to plot
for p in isop:
    h = np.array([pt2h(p, t) for t in isot])
    s = np.array([pt2s(p, t) for t in isot])
    plt.plot(s, h, 'b', lw=0.5)

tc = 647.096 - 273.15
T = np.linspace(0.1, tc, 100)
# Calculate saturation line
for x in np.array([0, 1.0]):
    h = np.array([tx2h(t, x) for t in T])
    s = np.array([tx2s(t, x) for t in T])
    plt.plot(s, h, 'r', lw=1.0)

# Isoquality lines to plot
isox = np.linspace(0.1, 0.9, 11)
for x in isox:
    h = np.array([tx2h(t, x) for t in T])
    s = np.array([tx2s(t, x) for t in T])
    plt.plot(s, h, 'r--', lw=0.5)

plt.show()
Exemplo n.º 4
0
 def tx(self):
     self.p = if97.tx2p(self.t, self.x)
     self.h = if97.tx2h(self.t, self.x)
     self.s = if97.tx2s(self.t, self.x)
     self.v = if97.tx2v(self.t, self.x)
Exemplo n.º 5
0
plt.title("%s-%s Diagram" % (yAxis, xAxis))
plt.xlabel(title[xAxis])
plt.ylabel(title[yAxis])
plt.grid()

Pt = 611.657e-6
isoh = np.linspace(200, 3600, 18)
isop = np.array([Pt, 0.001, 0.01, 0.02, 0.05, 0.1, 0.2, 0.5,
                 1.0, 2.0, 5.0, 10.0, 20.0, 50.0, 100.0])
for h in isoh:
    T = np.array([ph2t(p, h) for p in isop])
    S = np.array([ph2s(p, h) for p in isop])
    plt.plot(S, T, 'b', lw=0.5)
for p in isop:
    T = np.array([ph2t(p, h) for h in isoh])
    S = np.array([ph2s(p, h) for h in isoh])
    plt.plot(S, T, 'b', lw=0.5)

tc = 647.096 - 273.15
T = np.linspace(0.11, tc, 100)
for x in np.array([0, 1.0]):
    S = np.array([tx2s(t, x) for t in T])
    plt.plot(S, T, 'r', lw=1.0)

for x in np.linspace(0.1, 0.9, 11):
    S = np.array([tx2s(t, x) for t in T])
    plt.plot(S, T, 'r--', lw=0.5)

plt.show()