Skip to content

Commit

Permalink
append FM to eqpt objects, update exampleruns.py
Browse files Browse the repository at this point in the history
  • Loading branch information
weepctxb committed May 10, 2020
1 parent 4aebbe0 commit 33dbfd1
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 19 deletions.
8 changes: 5 additions & 3 deletions capex.py
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,7 @@ def baremodfac(Btuple=None, FM=None, FP=None, eqpt=None):
return FBM
else:
eqpt.FBM = FBM
eqpt.FM = FM
return FBM, eqpt


Expand Down Expand Up @@ -564,7 +565,7 @@ def grasscost(CTM=None, Cpo=None, eqpt=None):
return CGR, eqpt


def annualcapex(FCI=None, pbp=3, eqpt=None, planttype='brown'):
def annualcapex(FCI=None, pbp=None, eqpt=None, planttype='brown'):

"""
Estimate total annualised capital cost based on assumed payback period
Expand All @@ -582,8 +583,9 @@ def annualcapex(FCI=None, pbp=3, eqpt=None, planttype='brown'):
:return: ACC: annualised capital cost estimate ($/yr)
"""

if pbp == 3:
warnings.warn('pbp may not have been specified - 3 years is assumed')
if pbp is None:
pbp = 3
warnings.warn('Payback period (pbp) not specified - 3 years is assumed')

if FCI is not None:
pass
Expand Down
55 changes: 39 additions & 16 deletions exampleruns.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,39 +26,56 @@
# m = 1e5 kg/h, P1 = 2 bar, P2 = 6 bar, T1 = 323.15 K,
# cp = 1.02, cv = 0.72, Z = 0.99
# Specify rotary compressor using carbon steel for costing purposes
_, _, _, K400 = dsg.sizecompressor(m=1e5, P1=2, P2=6, T1=323.15, cp=1.02, cv=0.72, Z=0.99, etype='rotary', mat='CS', id='K400')
K400_comppower, K400_compeff, K400_T2, K400 = \
dsg.sizecompressor(m=1e5, P1=2, P2=6, T1=323.15, cp=1.02, cv=0.72, Z=0.99, etype='rotary', mat='CS', id='K400')
print(K400)

# Example 5: Pump sizing for required power
# Q = 35 m^3/h, P1 = 200 kPa, P2 = 700 kPa, rho = 990 kg/m^3
# Example 5: Compressor K400 sizing for required power and outlet temperature
# m = 4e5 kg/h, P1 = 1.5 bar, P2 = 6.5 bar, T1 = 290 K,
# cp = 1.02, cv = 0.72, Z = 0.99
# Specify rotary compressor using carbon steel for costing purposes
K500_comppower, K500_compeff, K500_T2, K500 = \
dsg.sizecompressor(m=4e5, P1=1.5, P2=6., T1=290, cp=1.02, cv=0.72, Z=0.99, etype='centrifugal', mat='SS', id='K500')
print(K500)

# Example 6: Pump sizing for required power
# Q = 40 m^3/h, P1 = 200 kPa, P2 = 700 kPa, rho = 1200 kg/m^3
# Specify positive displacement pump using stainless steel for costing purposes
_, _, P500 = dsg.sizepump(Q=35, P1=200, P2=700, rho=990, etype='positivedisp', mat='SS', id='P500')
print(P500)
P600_pumppower, P600_pumpeff, P600 = \
dsg.sizepump(Q=40, P1=200, P2=700, rho=1200, etype='positivedisp', mat='SS', id='P600')
print(P600)

# Example 6: Heat exchanger sizing for required heat exchange area (for
# Example 7: Pump sizing for required power
# Q = 100 m^3/h, P1 = 180 kPa, P2 = 800 kPa, rho = 990 kg/m^3
# Specify positive displacement pump using stainless steel for costing purposes
P700_pumppower, P700_pumpeff, P700 = \
dsg.sizepump(Q=100, P1=180, P2=800, rho=990, etype='centrifugal', mat='Ni', id='P700')
print(P700)

# Example 8: Heat exchanger sizing for required heat exchange area (for
# heating process stream)
# mc = 31715 kg/h, cpc = 3246 J/(kg.K), Tcin = 89 degC, Tcout = 101 degC,
# Thin = 160 degC, Thout = 156 degC, U = 850 W/(m^2.degC), Ns = 1 (default)
# Thin = 160 degC, Thout = 156 degC, U = 850 W/(m^2.degC), Ns = 2
# Specify pressure = 2 bar, double pipe HX using CS (shell) and Ni (tube) for costing purposes
_, _, HX600 = dsg.sizeHE_heater(mc=31715, cpc=3246, Tcin=89, Tcout=101, Thin=160, Thout=156, U=850, P=2, \
etype='doublepipe', mat='CS/Ni', id='HX600')
print(HX600)
HX800_area, HX800_F, HX800 = dsg.sizeHE_heater(mc=31715, cpc=3246, Tcin=89, Tcout=101, Thin=160, Thout=156, U=850, P=2, \
Ns=2, etype='doublepipe', mat='CS/Ti', id='HX800')
print(HX800)

# Example 7: Heat exchanger sizing for required heat exchange area (for
# Example 9: Heat exchanger sizing for required heat exchange area (for
# cooling process stream)
# mc = 31715 kg/h, cph = 3246 J/(kg.K), Thin = 89 degC, Thout = 60 degC,
# Tcin = 5 degC, Tcout = 10 degC, U = 850 W/(m^2.degC), Ns = 1 (default)
# Specify pressure = 4 bar, kettle reboiler HX using CS (shell) and SS (tube) for costing purposes
_, _, HX700 = dsg.sizeHE_cooler(mh=31715, cph=3246, Thin=89, Thout=60, Tcin=5, Tcout=10, U=850, P=4, \
etype='kettle', mat='CS/SS', id='HX700')
print(HX700)
HX900_area, HX900_F, HX900 = dsg.sizeHE_cooler(mh=31715, cph=3246, Thin=89, Thout=60, Tcin=5, Tcout=10, U=850, P=4, \
etype='kettle', mat='CS/SS', id='HX900')
print(HX900)

"""Step 2: Calculate all equipment capital"""

time.sleep(0.1)

# Example 8: Calculating capital of equipment, assuming greenfield project
eqptlist = [V100, V200, V300, K400, P500, HX600, HX700]
eqptlist = [V100, V200, V300, K400, K500, P600, P700, HX800, HX900]
FCI, capexreport = capex.econreport(eqptlist, planttype='green', pbp=3, year=2019, currency='SGD', \
reporttype='numpy', verbose=True)

Expand All @@ -67,9 +84,15 @@
time.sleep(0.1)

# Example 9: Calculating cost of manufacturing

COL, Nop = opex.labourcost(wage=42750., eqptlist=eqptlist)

print('Number of workers required : ' + str(int(Nop)))
CRM = opex.costofraw((19779., 12606., 325., 240.), (89.94, 0.25, 477.74, 1512.39))

CRM = opex.costofraw(rawmaterialtuple=(19779., 12606., 325., 240.), unitpricetuple=(89.94, 0.25, 477.74, 1512.39))

CUT = opex.costofutil(utiltuple=(0., 671069., 30815., 889354., 105723., 0., 0., 30643.), year=2019, currency='SGD')

CWT = 0. # Waste treatment cost has to be calculated manually

COMd, d, COM, DMC, FMC, GE, report_dict = opex.costofmanfc(FCI=FCI, COL=COL, CRM=CRM, CWT=CWT, CUT=CUT, verbose=True)

0 comments on commit 33dbfd1

Please sign in to comment.