Tank.py

  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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
# Applied Python PRISM
# (PRISM) PaRametrIc System Model
#
# Written by Charlie Taylor <cet@appliedpython.com> 
# Oct,21 2005

import sys
import numpy
from math import *
from prism.MassItem import MassItem
from prism.fortran import tank_eles
from prism.props import Materials
from prism.Summary import Summary
from prism.pov import POV_Items, POV_Basics
from prism.utils.Goal import Goal
    
# comments from the ELES tank routine
#C INPUT
#C   makeCompositeTank - Make Composite Tank (0=No, 1=Yes)
#C   KALMOD-CALCULATION MODE (0=INPUT RCYLTD, 1=INPUT RINSID)
#C   SY - design strength (psi)
#C   E - material elastic modulus (psi)
#C   RHO - tank material density (lbm/in^3)
#C   TMING - minimum gauge (in)
#C   VFREE-total volume Usabel Volume (ullage plus propellant)
#          (does NOT include Residual Propellant)
#C   ELL-ellipse ratio
#C   RCYLTD-ratio of cylindrical section length to diameter
#C          (MAY BE INPUT OR OUTPUT)
#C   ptank-pressure in tank
#C   SF-safety factor
#C   CXW-tank weight multiplier (welds, bosses, etc.)
#C   ITHCYL-tank wall thickness flag(0=variable thickness,1=constant)
#C   KACQUI-kind of acquisition device flag(0=none,1=transverse collapsin
#C          Alum. bladder,2=full bonded rolling diaphram(BRD) Al,3=half
#C          BRD Al,4=full BRD stainless steel,5=half BRD ss,6=capillary
#C          device, 7=elastomeric bladder, 8=Titanium Bladder)
#C   INPEX-input expulsion efficiency flag(0=calculate eff,1=input)
#C   EXPEFI-input expulsion efficiency
#C   TBLAD-bladder thickness(in)(0<KACQUI<6, or =7,8)
#C   TBOND-bond thickness(in)(1<KACQUI<6 or =7,8)
#C   TTRSPC-transverse collapsing bladder initial space distance(in)
#C          (KACQUI=1 or 7)
#C   RHOBND-density of bonding material (lbm/in**3)(1<KACQUI<6 or =7,8)
#C   RHOACQ-density of acquisition device(lbm/in**3)(KACQUI=6 or 7)

acq_dict = {0:'no acq. device',1:'transverse collapsing Alum. bladder',
    2:'full bonded rolling diaphram(BRD) Al',3:'half BRD Al',
    4:'full BRD stainless steel',5:'half BRD ss',6:'capillary device',
    7:'elastomeric transverse bladder (dP=0)',
    8:'Titanium transverse collapsing'}

ith_dict = {0:'variable thickness',1:'constant thickness'}
    
exp_dict = {0:'calculate expulsion eff',1:'input expulsion eff'}

class Tank( MassItem ):
    
    def __init__(self, name="tank",  mass_lbm=0.0,
        makeCompositeTank=0,kalmod=0, matlName="Ti",  Cp_eff=0.15, # Cp Ti=.125, Al=.2, Monel=.1
        tMinGaugeUser=0.0,
        vfree=1000.0,ell=1.414,rcyltd=2.0,ptank=350.0,
        sf=1.5,cxw=1.25,  NumExtraBaffles=0,
        ithcyl=1,kacqui=0,inpex=0,expefi=0.99, Number=1,
        inpTblad=1, tblad=0.030,tbond=0.030,ttrspc=0.010,
        rhobnd=0.04,rhoacq=0.28,tliner=0.0,rholiner=0.1,
        hasCommonDome=0, deltaPCommonDome=100.0, sf_CommonDome=1.5, matlCommonDome='Ti',
        maxVolFrac_CommonDome=0.75):
            
        # if common dome is imput, then tliner and rholiner will be modified to approximate the 
        # mass and volume required for the common dome.
        #
        #  BE SURE TO CHECK MINIMUM VOLUME OF ZERO CYLINDER CONCAVE DOMES
        #  The max volume side of the dome may be limited by the ellipse ratio
        #  the variable "maxVolFrac_CommonDome" reflects the volume split.
        #  The concave dome volume must be less than or equal to maxVolFrac_CommonDome * vfree
        
        MassItem.__init__(self, name, type="inert", mass_lbm=mass_lbm)
        
        self.makeCompositeTank = makeCompositeTank
        self.kalmod = kalmod
        self.matlName = matlName
        self.rho, self.sy, self.e, self.tming = Materials.getMatlProps(matlName)
        
        self.Cp_eff = Cp_eff  # effective Cp of all tank materials combined

        if tMinGaugeUser> self.tming:
            self.tming = tMinGaugeUser
        
        self.Number = Number  # each tank has vfree
        self.vfree = vfree
        self.ell = ell
        self.rcyltd = rcyltd
        self.ptank = ptank
        self.sf = sf
        self.cxw = cxw
        self.ithcyl = ithcyl
        self.kacqui = kacqui
        self.NumExtraBaffles = NumExtraBaffles
        self.inpex = inpex
        self.expefi = expefi
        self.inpTblad = inpTblad
        if self.kacqui in [7,8] and not inpTblad:
            print 'WARNING... inpTblad should be equal to 1 for kacqu=7 or 8'
            self.inpTblad = 1
        
        self.tblad = tblad
        self.tbond = tbond
        self.ttrspc = ttrspc
        self.rhobnd = rhobnd
        self.rhoacq = rhoacq
        self.tliner = tliner
        self.rholiner = rholiner

        self.hasCommonDome = hasCommonDome
        self.deltaPCommonDome = deltaPCommonDome
        self.sf_CommonDome = sf_CommonDome
        self.matlCommonDome = matlCommonDome
        self.rho_cd, self.sy_cd, self.e_cd, self.tming_cd = Materials.getMatlProps(matlCommonDome)
        self.maxVolFrac_CommonDome = maxVolFrac_CommonDome

        self.reCalc()
        
    def getPOV_Item(self):
        if hasattr( self, 'texture'):
            texture = self.texture
        else:
            
            texture = POV_Basics.Texture( colorName="Gray50" )
        s = POV_Items.CSE_Tank( radius=self.OR, ellRatio=self.ell, cylLen=self.cyl, texture=texture)
        
        return s

    def setToLcyl(self, Lcyl=0.5):
        
        
        t3 = 4.*pi/3./self.ell
        t2 = Lcyl*pi
        
        # do a couple of iterations to get vtank
        for i in range(3):
            self.reCalc()
            # assume there is always a positive root
            poly = numpy.poly1d([t3,t2,0.,-self.vtank])
            roots = numpy.roots( poly )
            #print poly
            #print roots
            
            R = roots[0]
            for r in roots[1:]:
                if r>R: R=r
            #print 'Radius =',R
            
            D = 2.0 * R
            self.rcyltd = Lcyl / D
        self.reCalc()
        
    def setToMaxID(self, IDmax=100.0, rcyltdMin=0.0):
        
        self.rcyltd = rcyltdMin
        self.reCalc()
        Rmax = IDmax / 2.0
        if self.rinsid > Rmax:
            Vd = 4.*pi*Rmax**3/3./self.ell
            L = (self.vtank-Vd)/pi/Rmax**2
            
            self.rcyltd = max(rcyltdMin,L/Rmax/2.0)
            self.reCalc()
        
    def setToMaxOD(self, ODmax=100.0, rcyltdMin=0.0):

        self.rcyltd = rcyltdMin
        self.reCalc()
        
        if self.OD > ODmax:
            # assume the OD will converge pretty quickly
            for i in range(10):
                Rest = ODmax / 2.0 - (self.OR - self.rinsid)
                Vd = 4.*pi*Rest**3/3./self.ell
                L = (self.vtank-Vd)/pi/Rest**2
                
                self.rcyltd = max(rcyltdMin,L/Rest/2.0)
                self.reCalc()
        
    def setToMaxOH(self, Hgoal=25.0):
        
        self.rcyltd = 0.0
        self.reCalc()
        
        if self.OH < Hgoal:
            lodMin = 0.0
            lodMax = sqrt(self.vfree/Hgoal)

            for i in range(6):
                self.rcyltd = lodMax
                self.reCalc()
                if self.OH < Hgoal:
                    lodMax *= 1.2
                else:
                    break

            def testHt( lod ):
                self.rcyltd = lod
                self.reCalc()
                return self.OH
            
            G = Goal(goalVal=Hgoal, minX=lodMin, maxX=lodMax, 
                    funcOfX=testHt, tolerance=1.0E-5, maxLoops=40, failValue=self.vfree)
            lod, ierror = G()
            self.rcyltd = lod
            self.reCalc()
            


    def solveVolumeForOD(self, ODgoal=10.0):
        
        self.reCalc()
        if self.OD > ODgoal:
            Vmax = self.vfree
            Vmin = (ODgoal/self.OD)**(3.) * self.vfree / 2.0
        else:
            Vmin = self.vfree
            Vmax = (ODgoal/self.OD)**(3.) * self.vfree * 2.0

        
        def testVol( vol ):
            self.vfree = vol
            self.reCalc()
            return self.OD
        
        G = Goal(goalVal=ODgoal, minX=Vmin, maxX=Vmax, 
                funcOfX=testVol, tolerance=1.0E-5, maxLoops=40, failValue=self.vfree)
        vol, ierror = G()
        self.vfree = vol
        self.reCalc()
        
        
    def setToLength(self, L=100.0):
        
        self.rcyltd = 0.0
        self.reCalc()
        
        # only try to make it L long by adding cylinder length
        if self.hinsid < L:
            V = self.vtank
            e = self.ell
            rmax = (V*e*3./4./pi)**(1./3.)
            rmin = sqrt( V/pi/L )
            for i in range(40):
                r = (rmin+rmax)/2.0
                Lcyl = L - 2.0*r/e
                Vtest = 4.*pi*r**3/3./e + pi*r**2*Lcyl
                if Vtest>V:
                    rmax = r
                else:
                    rmin = r
                    
            
            self.rcyltd = max(0.0,Lcyl/r/2.0)
            self.reCalc()

            
        
    def reCalc(self):
        
        default_cxw = 1.0
        kacqui = self.kacqui
        if self.kacqui in [7]:
            kacqui = 1
        if self.kacqui in [8]:
            kacqui = 2 # like Al BRD
        
        
        self.VolLimit_cd = self.maxVolFrac_CommonDome * self.vfree
        if self.hasCommonDome:
            rinsid_cd,hinsid_cd,cyl_cd,wacqui_cd,\
                vacqui_cd,dpacq_cd,pullag_cd,vresid_cd,\
                vtank_cd,thkcyl_cd, self.thkCommonDome, thkBladOut_cd,wliner_cd,wtank_cd= \
                tank_eles.csetnk(0,self.kalmod,
                self.sy_cd,self.e_cd,self.rho_cd,self.tming_cd,self.vfree,
                self.ell,self.rcyltd,self.deltaPCommonDome, self.sf_CommonDome,default_cxw,
                self.ithcyl,kacqui,self.inpex,self.expefi,
                self.inpTblad,self.tblad,self.tbond,self.ttrspc,
                self.rhobnd,self.rhoacq,self.tliner,self.rholiner)
            
            SACYL=2.*pi*rinsid_cd*cyl_cd
            
            if self.ell <= 1.:
                SAENDS=4.*pi*rinsid_cd**2
            else:
                ECC=sqrt(1.-(1./self.ell)**2)
                SAENDS=2.*pi*rinsid_cd**2 + pi*(rinsid_cd/self.ell)**2/ECC*log((1.+ECC)/(1.-ECC))
            
            # calc minimum volume in concave domes
            self.VolCommonDomeEllipse = 4.*pi*rinsid_cd**3/self.ell/3.
            
            if self.VolLimit_cd < self.VolCommonDomeEllipse:
                vfree_eff = self.vfree + ( self.VolCommonDomeEllipse - self.VolLimit_cd )
            else:
                vfree_eff = self.vfree
            
                
            self.VolCommonDomeMatl = SAENDS * self.thkCommonDome  / 2.0
            self.WtCommonDome = self.VolCommonDomeMatl * self.rho_cd 
            
            # estimate surface area ratio with and w/o common dome
            SAwo = SACYL + SAENDS
            SAwith = SACYL + SAENDS * 2.0
            
            # the effective thickness will get the matl volume correct
            # includes the volume of the common dome and the liner
            tliner_eff = self.tliner * SAwith / SAwo + self.VolCommonDomeMatl/SAwo
            
            
            # the effective density will get the matl mass of the liner ONLY correct
            # includes additional mass of liner due to extra surface area of common dome
            volMatlEff = tliner_eff * SAwo
            rholiner_eff = wliner_cd * SAwith / SAwo  / volMatlEff
            
        else:
            tliner_eff = self.tliner 
            rholiner_eff = self.rholiner
            self.WtCommonDome = 0.0
            self.VolCommonDomeEllipse = 0.0
            vfree_eff = self.vfree
            


        self.rinsid,self.hinsid,self.cyl,self.wacqui,\
            self.vacqui,self.dpacq,self.pullag,self.vresid,\
            self.vtank,self.thkcyl,self.thkend,self.thkBladOut,self.wliner,self.wtank= \
            tank_eles.csetnk(self.makeCompositeTank,self.kalmod,  # <== call to tank_eles
            self.sy,self.e,self.rho,self.tming,vfree_eff,
            self.ell,self.rcyltd,self.ptank,self.sf,default_cxw,
            self.ithcyl,kacqui,self.inpex,self.expefi,
            self.inpTblad,self.tblad,self.tbond,self.ttrspc,
            self.rhobnd,self.rhoacq,tliner_eff,rholiner_eff)

        if self.kacqui==7: # user defined bladder (elastomeric)
            self.dpacq = 0.0
            self.wacqui = self.wacqui * self.rhoacq * self.tblad / self.thkBladOut / 0.1
            self.vacqui = self.vacqui * self.tblad / self.thkBladOut
            self.thkBladOut = self.tblad

        if self.kacqui==8: # Titanium Bladder
            self.dpacq = 2.0 * self.dpacq # estimate Ti is 4x Al
            self.wacqui = self.wacqui * 0.16 * self.tblad / self.thkBladOut / 0.1
            self.vacqui = self.vacqui * self.tblad / self.thkBladOut
            #self.thkBladOut = self.tblad

        self.dinsid = 2.0*self.rinsid
        self.pov_h = self.cyl + self.dinsid/self.ell
        self.pov_w = self.dinsid
        self.pov_d = self.dinsid

        self.Across = pi * self.rinsid**2

        ECC=sqrt(1.-(1./self.ell)**2)
        HEADCO=pi/2.
        if self.ell>1.0:
            HEADCO=(pi/4.)*(1.+log((1.+ECC)/(1.-ECC))/(2.*ECC*self.ell**2))
        HSA = HEADCO*self.dinsid**2
        self.SAinsid = pi*self.dinsid*self.cyl + 2.*HSA
        
        if self.NumExtraBaffles > 0:
            self.WtExtraBaffles = pi * self.rinsid**2 * self.tming * self.rho * self.NumExtraBaffles
        else:
            self.WtExtraBaffles = 0.0
        
        self.mass_lbm = (self.wtank + self.wacqui ) * self.cxw   + self.WtExtraBaffles + self.WtCommonDome
        
        if self.thkcyl <= self.tming:
            self.Pburst = self.tming * self.sy / self.rinsid 
        else:
            self.Pburst = self.sf * self.ptank
            
        self.OD = 2.0* (self.rinsid + self.thkcyl + self.thkBladOut + self.tliner)
        self.OR = self.OD / 2.0
        
        self.OH = self.hinsid +  2.0* ( self.thkend + self.thkBladOut + self.tliner)

        # if more than one tank, increase mass to reflect that
        self.mass_lbm *= self.Number

        
        try:
            self.PVoverW = self.ptank*self.vtank*self.Number/self.mass_lbm
            self.PburstVoverW = self.Pburst*self.vtank*self.Number/self.mass_lbm
        except:
            self.PVoverW = 0.0
            self.PburstVoverW = 0.0
    
    def minGaugeStr(self, t):
        if t<= self.tming:
            return 'Min Gauge'
        else:
            return ''
        
    def buildSummary(self):
        
        summ = Summary(  summName='Cylindrical/Spherical/Elliptical Tank',
        componentName=self.name, mass_lbm=self.mass_lbm, type=self.type)
        
        
        if self.makeCompositeTank:
            summ.addAssumption('Composite Tank Algorithm')
        else:
            summ.addAssumption('Metal Tank Algorithm')
            summ.addAssumption('Structural Material : ' + self.matlName )

            
        if self.hasCommonDome:
            summ.addAssumption('Includes Common Dome of "%s"'%self.matlCommonDome)
            summ.addAssumption('Limiting Common Dome Volume = %g cuin'%self.VolCommonDomeEllipse)
            summ.addAssumption('Required Common Dome Volume = %g cuin'%self.VolLimit_cd)
            if self.VolLimit_cd >= self.VolCommonDomeEllipse:
                summ.addAssumption('(MEETS VOLUME REQUIREMENT, Required > Limiting)')
            else:
                summ.addAssumption('(WARNING... DOES NOT MEET VOLUME REQUIREMENT)')
                deltaVol = self.VolCommonDomeEllipse - self.VolLimit_cd 
                summ.addAssumption('(INCREASED TOTAL VOLUME BY %g cuin TO MEET REQUIREMENT)'%deltaVol)


        if self.NumExtraBaffles > 0:
            summ.addAssumption("%i Extra Baffles are added to tank"%self.NumExtraBaffles)
            
        if self.kacqui in [1,2,3,4,5,7,8]:
            if self.inpTblad:
                summ.addAssumption('Bladder Thickness is input at %.3f in'%self.tblad)
            else:
                summ.addAssumption('Bladder Thickness is calculated at %.3f in'%self.tblad)
            
        summ.addAssumption('kalmod = ' + str( self.kalmod ) )
            
        if self.Number>1:
            summ.addAssumption( 'Mass is for %i Tanks total'%self.Number )
        
        
        # add inputs
        summ.addInput('vfree', self.vfree, 'cuin', '%g')
        summ.addInput('vfreeTotal', self.vfree*self.Number, 'cuin', '%g')
        
        if self.hasCommonDome:
            summ.addInput('maxVolFrac_CommonDome', self.maxVolFrac_CommonDome, '', '%g')
            summ.addInput('deltaPCommonDome', self.deltaPCommonDome, 'psia', '%g')
        
        summ.addInput('ell', self.ell, '', '%g')
        summ.addInput('rcyltd', self.rcyltd, '', '%g')
        summ.addInput('ptank', self.ptank, 'psia', '%g')
        summ.addInput('sf', self.sf, '', '%g')
        summ.addInput('cxw', self.cxw, '', '%g')
        summ.addInput('ithcyl', self.ithcyl, '', '%g')
        summ.addInput('kacqui', self.kacqui, acq_dict[self.kacqui], '%s')
        summ.addInput('inpex', self.inpex, '', '%g')
        summ.addInput('expefi', self.expefi, '', '%g')
        summ.addInput('tblad', self.tblad, 'in', '%.3f')
        summ.addInput('tbond', self.tbond, 'in', '%.3f')
        summ.addInput('ttrspc', self.ttrspc, 'in', '%.3f')
        summ.addInput('rhobnd', self.rhobnd, 'lbm/cuin', '%g')
        summ.addInput('rhoacq', self.rhoacq, 'lbm/cuin', '%g')
        summ.addInput('tliner', self.tliner, 'in', '%.3f')
        summ.addInput('rholiner', self.rholiner, 'lbm/cuin', '%g')
        
        # add outputs

        summ.addOutput( 'rinsid', self.rinsid, 'in', '%.3f' )
        summ.addOutput( 'dinsid', self.dinsid, 'in', '%.3f' )
        summ.addOutput( 'OR', self.OR, 'in', '%.3f' )
        summ.addOutput( 'OD', self.OD, 'in', '%.3f' )
        summ.addOutput( 'OH', self.OH, 'in', '%.3f' )
        summ.addOutput( 'hinsid', self.hinsid, 'in', '%.3f' )
        summ.addOutput( 'SAinsid', self.SAinsid, 'sqin', '%.3f' )
        summ.addOutput( 'cyl', self.cyl, 'in', '%.3f' )
        summ.addOutput( 'wacqui', self.wacqui, 'lbm', '%.3f' )
        summ.addOutput( 'vacqui', self.vacqui, 'cuin', '%g' )
        summ.addOutput( 'dpacq', self.dpacq, 'psig', '%g' )
        summ.addOutput( 'pullag', self.pullag, 'psia', '%g' )
        summ.addOutput( 'vresid', self.vresid, 'cuin', '%g' )
        summ.addOutput( 'vtank', self.vtank, 'cuin', '%g' )

        summ.addOutput( 'tming', self.tming, 'in', '%.3f' )
        if self.thkcyl <= self.tming:
            summ.addOutput( 'thkcyl', self.thkcyl, 'in (use tming)', '%.3f' )
        else:
            summ.addOutput( 'thkcyl', self.thkcyl, 'in', '%.3f' )
            
        if self.thkend <= self.tming:
            summ.addOutput( 'thkend', self.thkend, 'in (use tming)', '%.3f' )
        else:
            summ.addOutput( 'thkend', self.thkend, 'in', '%.3f' )
        
        summ.addOutput( 'thkBladOut', self.thkBladOut, 'in', '%.3f' )
        if self.NumExtraBaffles > 0:
            summ.addOutput( 'WtExtraBaffles', self.WtExtraBaffles, 'lbm', '%.3f' )

        if self.hasCommonDome:
            summ.addOutput( 'thkCommonDome', self.thkCommonDome, 'in', '%.3f' )
            summ.addOutput( 'WtCommonDome', self.WtCommonDome, 'lbm', '%.3f' )


        if self.wliner > 0.0:
            summ.addOutput( 'wliner', self.wliner, 'lbm', '%.3f' )
            summ.addOutput( 'wtank(+liner)', self.wtank, 'lbm', '%.3f' )
        else:
            summ.addOutput( 'wtank', self.wtank, 'lbm', '%.3f' )
            
        summ.addOutput( 'rho', self.rho, 'lbm/cuin', '%g' )
        if not self.makeCompositeTank:
            summ.addOutput( 'sy', self.sy, 'psi', '%g' )
            summ.addOutput( 'e', self.e, 'psi', '%g' )
        summ.addOutput( 'PmeopVoverW', self.PVoverW, 'lbf-in/lbm', '%g' )
        summ.addOutput( 'Pburst(est.)', self.Pburst, 'psia', '%.1f' )
        summ.addOutput( 'PburstVoverW', self.PburstVoverW, 'lbf-in/lbm', '%g' )

        return summ


if __name__ == "__main__":  #self test

    print "Actual FFC Prop Tank =", 3.703,"lbm"
    print "Calculated =   ",
    oxFFC = Tank(name="FFC Propellant Tank", mass_lbm=3.703,
        makeCompositeTank=1, kalmod=0,  
        matlName="grEpox",   vfree=486.0,ell=1.767,rcyltd=1.445,
        ptank=1400.0,sf=1.5,cxw=1.5,
        ithcyl=1,kacqui=1,inpex=1,expefi=0.98,
        tblad=0.030,tbond=0.030,ttrspc=0.010,
        rhobnd=0.04,rhoacq=0.098,tliner=0.03,rholiner=0.098)
    print oxFFC.getMassStr()
    print
    print oxFFC.getSummary()

    print '===================================================================='
    print "Actual Mars PMD Prop Tank =", 8.5,"lbm (PSI SN 80353-1)"
    print "Calculated Mars =   ",
    pmd = Tank(name="Mars Observer Propellant Tank", mass_lbm=8.5,
        makeCompositeTank=0, kalmod=0,  
        matlName="Ti",   vfree=3490.0,ell=1.0,rcyltd=0.0,  # input vfree=3490 cuin to get 3575 total
        ptank=400.0,sf=1.5,cxw=1.07, NumExtraBaffles=3,
        ithcyl=1,kacqui=6,inpex=1,expefi=0.98,
        tblad=0.0,tbond=0.0,ttrspc=0.0,rhoacq=0.16)
    print pmd.getMassStr()
    print
    print pmd.getSummary()
    print '===================================================================='
    print "Spherical  Prop Tank =", 12.04,"lbm w/o diaphram or PK baffles (PSI SN 80274-1)"
    print "Calculated Mass =   ",
    pmd = Tank(name="PSI 80274-1 Tank", mass_lbm=12.04, tMinGaugeUser=0.035,
        makeCompositeTank=0, kalmod=0,  
        matlName="Ti",   vfree=3660.0,ell=1.0,rcyltd=0.0,  
        ptank=377.0,sf=1.5,cxw=1.32, NumExtraBaffles=3,
        ithcyl=1,kacqui=6,inpex=1,expefi=0.98,
        tblad=0.0,tbond=0.0,ttrspc=0.0,rhoacq=0.16)
    print pmd.getMassStr()
    print
    print pmd.getSummary()
    
    print '===================================================================='
    print "Actual FFC He Tank=",3.157,"lbm (single tank)"
    print "Calculated =",
    HeFFC = Tank(name="FFC Helium Tank", mass_lbm=3.157,
        makeCompositeTank=1, kalmod=0,  Number=1,
        matlName="grEpox",   vfree=160.0, ell=1.764,rcyltd=1.142,
        ptank=10000.0,sf=2.0,cxw=1.25,
        ithcyl=1,kacqui=0,inpex=0,
        inpTblad=0, tblad=0.030,tbond=0.030,ttrspc=0.010,
        rhobnd=0.04,rhoacq=0.1,tliner=0.04,rholiner=0.1)
    print HeFFC.getMassStr()
    print
    print HeFFC.getSummary()
    sys.exit()

    HeFFC.setToMaxID( IDmax=4.0)
    print
    print HeFFC.getSummary()
    HeFFC.setToMaxOD( ODmax=4.0)
    print
    print HeFFC.getSummary()
    
    if 0:
        HeFFC.setToLcyl( 7.0 )
        #HeFFC.setToLength( L=10.0)
        print
        print HeFFC.getSummary()



    print '===================================================================='
    print "Common Dome Prop Tank WITHOUT CommonDome Option="

    cdtank = Tank(name="FFC Propellant Tank", mass_lbm=3.703,
        makeCompositeTank=1, kalmod=0,  
        matlName="grEpox",   vfree=486.0,ell=1.767,rcyltd=1.445,
        ptank=1400.0,sf=1.5,cxw=1.5,
        ithcyl=1,kacqui=1,inpex=1,expefi=0.98,
        tblad=0.030,tbond=0.030,ttrspc=0.010,
        rhobnd=0.04,rhoacq=0.098,tliner=0.03,rholiner=0.098,
        hasCommonDome=0, deltaPCommonDome=100.0, sf_CommonDome=1.5, matlCommonDome='Ti')
    print
    print cdtank.getSummary()
    print "Common Dome Prop Tank ="

    cdtank = Tank(name="FFC Propellant Tank", mass_lbm=3.703,
        makeCompositeTank=1, kalmod=0,  
        matlName="grEpox",   vfree=486.0,ell=1.767,rcyltd=1.445,
        ptank=1400.0,sf=1.5,cxw=1.5,
        ithcyl=1,kacqui=1,inpex=1,expefi=0.98,
        tblad=0.030,tbond=0.030,ttrspc=0.010,
        rhobnd=0.04,rhoacq=0.098,tliner=0.03,rholiner=0.098,
        hasCommonDome=1, deltaPCommonDome=100.0, sf_CommonDome=1.5, matlCommonDome='Ti',
        maxVolFrac_CommonDome=0.15)
    #cdtank.setToMaxOH(Hgoal=15.0)
    print
    print cdtank.getSummary()