Example #1
0
def plot_tsp3d():
    fig = plt.figure()
    ax = Axes3D(fig)
    pp = np.logspace(-3,3,20)
    ss = np.linspace(0.,10., 40)
    xdata,ydata = np.meshgrid(pp, ss)
    zdata = np.zeros(xdata.shape)

    for i, p in enumerate(pp):
        for j, s in enumerate(ss):
            T = None
            if not freesteam.bounds_ps(p*1e5,s*1e3,0):
                try:
                    T = freesteam.steam_ps(p*1e5,s*1e3).T
                except:
                    pass
            zdata[j, i]= T
    ax.plot_wireframe(xdata, ydata, zdata, rstride=1, cstride=1)
    ax.set_xlabel('Pressure / [bar]')
    ax.set_ylabel('Entropy / [kJ/kgK]')
    ax.set_zlabel('Temperature / [K]')

    TT0 = np.linspace(273.15, freesteam.TCRIT, 100)
    psat = [freesteam.psat_T(T)/1e5 for T in TT0]
    sf = [freesteam.region4_Tx(T,0).s/1e3 for T in TT0]
    sg = [freesteam.region4_Tx(T,1).s/1e3 for T in TT0]
    ax.plot(psat, sf, TT0,'k-')
    ax.plot(psat, sg, TT0,'r-')
    plt.show()
Example #2
0
def plot_tsp3d():
    fig = plt.figure()
    ax = Axes3D(fig)
    pp = np.logspace(-3, 3, 20)
    ss = np.linspace(0., 10., 40)
    xdata, ydata = np.meshgrid(pp, ss)
    zdata = np.zeros(xdata.shape)

    for i, p in enumerate(pp):
        for j, s in enumerate(ss):
            T = None
            if not freesteam.bounds_ps(p * 1e5, s * 1e3, 0):
                try:
                    T = freesteam.steam_ps(p * 1e5, s * 1e3).T
                except:
                    pass
            zdata[j, i] = T
    ax.plot_wireframe(xdata, ydata, zdata, rstride=1, cstride=1)
    ax.set_xlabel('Pressure / [bar]')
    ax.set_ylabel('Entropy / [kJ/kgK]')
    ax.set_zlabel('Temperature / [K]')

    TT0 = np.linspace(273.15, freesteam.TCRIT, 100)
    psat = [freesteam.psat_T(T) / 1e5 for T in TT0]
    sf = [freesteam.region4_Tx(T, 0).s / 1e3 for T in TT0]
    sg = [freesteam.region4_Tx(T, 1).s / 1e3 for T in TT0]
    ax.plot(psat, sf, TT0, 'k-')
    ax.plot(psat, sg, TT0, 'r-')
    plt.show()
Example #3
0
import freesteam
import matplotlib
#matplotlib.use('gtkcairo')
from pylab import *
import math

figure()
n = 400
TT = [273.15 + (freesteam.TCRIT - 273.15) * x / n for x in range(n + 1)]

hf = [freesteam.region4_Tx(T, 0).h / 1e3 for T in TT]
hg = [freesteam.region4_Tx(T, 1).h / 1e3 for T in TT]
plot(hf, TT, 'b-')
plot(hg, TT, 'r-')

pp = logspace(-3, 3) * 1e5

# these are the pressures we're interested in here
pp = [freesteam.psat_T(50 + 273.15), 3e6, 12e6, 165e5, 300e5]

print("low p =", pp[0])

hh = arange(50., 4500., 100) * 1e3

hh1 = arange(50., 4500., 20) * 1e3

x = []
y = []
u = []
v = []
for p in pp:
Example #4
0
imshow(im,
       extent=[smin / 1e3, smax / 1e3, Tmin, Tmax],
       origin='lower',
       aspect='auto',
       interpolation='nearest',
       alpha=0.6)

# SATURATION CURVES

Tmin = 273.15
Tmax = freesteam.TCRIT
n = 1000
DT = (Tmax - Tmin) / n
TT0 = 273.15 + DT * array(range(n + 1))
psat = array([freesteam.psat_T(T) / 1e6 for T in TT0])
sf = [freesteam.region4_Tx(T, 0).s / 1e3 for T in TT0]
sg = [freesteam.region4_Tx(T, 1).s / 1e3 for T in TT0]
plot(sf, TT0, 'b-')
plot(sg, TT0, 'r-')

# LINES OF CONSTANT PRESSURE

pp = logspace(-3, 3, 50) * 1e5
ss = arange(0., 10., 0.1) * 1e3

for p in pp:
    TT = []
    for s in ss:
        T = None
        if not freesteam.bounds_ps(p, s, 0):
            try:
Example #5
0
import freesteam
import matplotlib
matplotlib.use('gtkcairo')
from pylab import *
import math

figure()
hold(1)
n = 400
TT = [273.15 + (freesteam.TCRIT - 273.15)*x/n for x in range(n+1)]

hf = [freesteam.region4_Tx(T,0).h/1e3 for T in TT]
hg = [freesteam.region4_Tx(T,1).h/1e3 for T in TT]
plot(hf,TT,'b-')
plot(hg,TT,'r-')

pp = logspace(-3,3)*1e5

# these are the pressures we're interested in here
pp = [freesteam.psat_T(50+273.15), 3e6, 12e6,  165e5, 300e5]

print "low p =",pp[0]

hh = arange(50.,4500.,100)*1e3

hh1 = arange(50.,4500.,20)*1e3


x = []
y = []
u = []
Example #6
0
		#print "T = %f K, s = %f kg/kgK, region[%d,%d] = %d" % (T,s/1e3,x,y,r)
		im[x,y] = float(r) / 4.
		y += 1
	x += 1

imshow(im,extent=[smin/1e3,smax/1e3,Tmin,Tmax],origin='lower',aspect='auto',interpolation='nearest',alpha=0.6)

# SATURATION CURVES

Tmin = 273.15
Tmax = freesteam.TCRIT
n = 1000
DT = (Tmax - Tmin)/n
TT0 = 273.15 + DT*array(range(n+1))
psat = array([freesteam.psat_T(T)/1e6 for T in TT0])
sf = [freesteam.region4_Tx(T,0).s/1e3 for T in TT0]
sg = [freesteam.region4_Tx(T,1).s/1e3 for T in TT0]
plot(sf,TT0,'b-')
plot(sg,TT0,'r-')

# LINES OF CONSTANT PRESSURE

pp = logspace(-3,3,50)*1e5
ss = arange(0.,10.,0.1)*1e3

for p in pp:
	TT = []
	for s in ss:
		T = None
		if not freesteam.bounds_ps(p,s,0):
			try: 
Example #7
0
matplotlib.use('gtkcairo')
from pylab import *
import math, sys

figure()
hold(1)

# SATURATION CURVE

Tmin = 273.15
Tmax = freesteam.TCRIT
n = 1000
DT = (Tmax - Tmin)/n
TT0 = 273.15 + DT*array(range(n+1))
psat = array([freesteam.psat_T(T)/1e6 for T in TT0])
uf = [freesteam.region4_Tx(T,0).u/1e3 for T in TT0]
ug = [freesteam.region4_Tx(T,1).u/1e3 for T in TT0]

# REGION MAP

umin = 0
umax = 3800e3
Du = umax -umin
pmin = 1.e-3*1e5
pmax = 1.e3*1e5
DP = pmax - pmin
pp = arange(pmin,pmax,DP/100)
uu = arange(umin,umax,Du/100)
im = zeros((len(pp),len(uu)))
x = 0
for p in pp: