1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145 | # Applied Python PRISM
# (PRISM) PaRametrIc System Model
#
# Written by Charlie Taylor <cet@appliedpython.com>
# Oct,21 2005
from prism.MassItem import MassItem
from prism.props import Materials
from prism.Summary import Summary
import sys
from prism.props import Inc_liquid
from math import *
from prism.fortran import orifice
class ValveSize( MassItem ):
def __init__(self, name="liquid valve", liqObj=None, matlName="Ti",
wdot=0.1, deltaP=20.0,
Kfactors=0.1, Number=1,
cxw=1.15, mass_lbm=0.0, ):
MassItem.__init__(self, name, type="inert", mass_lbm=mass_lbm)
self.liqObj = liqObj
#if (liqObj is not Inc_liquid.Inc_liquid):
# print "ERROR...",name,"must have Inc_liquid object input for liqObj"
# sys.exit(1)
self.Number = Number
self.matlName = matlName
self.rho, self.sy, self.e, self.tming = Materials.getMatlProps(matlName)
self.wdot = wdot
self.deltaP = deltaP
self.Kfactors = Kfactors
self.cxw = cxw
self.reCalc()
def reCalc(self, autoCalc=1):
self.autoCalc = autoCalc
self.Q = self.wdot / self.liqObj.D # cuft/s
self.dinsid = (3.62 * self.Kfactors * self.liqObj.D * self.Q**2 / self.deltaP)**0.25
self.Ac = self.dinsid**2 * pi / 4.0
if self.Q>0.0:
self.velFPS = self.Q * 144.0 / self.Ac
else:
self.velFPS = 0.0
self.rinsid = self.dinsid / 2.0
if self.Q>0.0:
self.mass_lbm = 5.289*self.dinsid**1.1517 * self.cxw * self.Number * (self.rho/0.1)
else:
self.mass_lbm = 0.0
def minGaugeStr(self, t):
if t<= self.tming:
return 'Min Gauge'
else:
return ''
def buildSummary(self):
summ = Summary( summName='Liquid Valve',
componentName=self.name, mass_lbm=self.mass_lbm, type=self.type)
summ.addAssumption( 'fluid : ' + self.liqObj.symbol )
summ.addAssumption( 'Structural Material : ' + self.matlName )
summ.addAssumption( 'Uses Mass Scaling of Wt(Al vlv)=5.289*D^1.1517' )
if self.Number>1:
summ.addAssumption( 'Mass is for %i valves total'%self.Number )
# add inputs
summ.addInput( 'deltaP', self.deltaP, 'psig', '%.2f' )
summ.addInput('wdot', self.wdot, 'lbm/sec', '%g')
summ.addInput('Kfactors', self.Kfactors, 'vel heads', '%g')
summ.addInput('cxw', self.cxw, '', '%g')
summ.addInput('# Valves', self.Number, '', '%i')
# add outputs
summ.addOutput('velFPS', self.velFPS, 'ft/sec', '%g')
summ.addOutput( 'dinsid', self.dinsid, 'in', '%.3f' )
summ.addOutput( 'rho', self.rho, 'lbm/cuin', '%g' )
summ.addOutput( 'sy', self.sy, 'psi', '%g' )
#summ.addOutput( 'e', self.e, 'psi', '%g' )
summ.addOutput( 'tming', self.tming, 'in', '%.3f' )
summ.addOutput( 'fluid rho', self.liqObj.rho, 'lbm/cuin', '%g' )
summ.addOutput( 'fluid D', self.liqObj.D, 'lbm/cuft', '%g' )
summ.addOutput( 'fluid visc', self.liqObj.Visc, '1.0E5 * lb/ft-sec', '%g' )
if self.Number>1:
summ.addOutput( 'wt/Valve', self.mass_lbm/self.Number, 'lbm', '%.3f' )
return summ
if __name__ == "__main__": #self test
Fl = Inc_liquid.Inc_liquid( symbol="H2",T=93.0,P=6000.0, mass_lbm=0.0)
h = ValveSize(name="SSME Chamber Coolant Valve (27 lbm)",wdot=75.7, matlName="SS", deltaP=41.0,
liqObj=Fl, Number=10, Kfactors=0.065)
print h.getMassStr()
print
print h.getSummary()
h = ValveSize(name="SSME Main Valve (80 lbm)",wdot=144.6, matlName="SS", deltaP=20.0,
liqObj=Fl, Number=10, Kfactors=0.052)
print h.getMassStr()
print
print h.getSummary()
Ox = Inc_liquid.Inc_liquid( symbol="O2",T=200.0,P=7600.0, mass_lbm=10.0)
h = ValveSize(name="SSME Fuel Preburner Oxidizer Valve (35 lbm)",wdot=64.2, matlName="Inconel", deltaP=1562.0,
liqObj=Ox, Number=10, Kfactors=10.9)
print h.getMassStr()
print
print h.getSummary()
Fl = Inc_liquid.Inc_liquid( symbol="H2",T=36.7,P=226.0, mass_lbm=0.0)
h = ValveSize(name="50% TAN for RS-68 Feed Valve",wdot=129.0, matlName="SS", deltaP=1.0,
liqObj=Fl, Number=10, Kfactors=0.05)
print h.getMassStr()
print
print h.getSummary()
Ox = Inc_liquid.Inc_liquid( symbol="O2",T=160.0,P=243.0, mass_lbm=10.0)
h = ValveSize(name="50% TAN for RS-68 LOX Feed Vlv",wdot=776.0, matlName="Inconel", deltaP=2.5,
liqObj=Ox, Number=10, Kfactors=0.05)
print h.getMassStr()
print
print h.getSummary()
|