-
Notifications
You must be signed in to change notification settings - Fork 0
/
Compost_input.py
128 lines (96 loc) · 7.74 KB
/
Compost_input.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
# -*- coding: utf-8 -*-
"""
Created on Wed Jul 17 16:37:44 2019
@author: msardar2
"""
import pandas as pd
import numpy as np
from MC import *
class Compost_input(MC):
def __init__(self):
### Land application inputs
self.Land_app = {
#'distLand':{"Name":"Distance to application site","amount":20,"unit":'km',"Reference":None},
#'erLand':{"Name":"Empty return from land application (0=no; 1=yes)","amount":1,"unit":'0/1',"Reference":None},
#'land_payload':{"Name":"Actual payload of truck used to haul soil amendment","amount":7.3,"unit":'Mg',"Reference":None},
'PeatSubFac':{"Name":"Volumetric peat replacement factor","amount":1,"unit":None,"Reference":'17',
'uncertainty_type':5,'loc':1,'minimum':0.9,'maximum':1.1},
'densPeat':{"Name":"Density of peat","amount":200,"unit":'kg/m3',"Reference":'17',
'uncertainty_type':3,'loc': 200, 'scale':57},
'moistPeat':{"Name":"moistPeat","amount":0.56,"unit":None,
'uncertainty_type':3,'loc': 0.56, 'scale':0.05},
'CContPeat':{"Name":"CContPeat","amount":0.504,"unit":None,
'uncertainty_type':5,'loc': 0.504,'minimum':0.48,'maximum':0.63},
'CstorePeat':{"Name":"CstorePeat","amount":0.10,"unit":None,
'uncertainty_type':4,'minimum':0.02,'maximum':0.16},
'perN2Oevap':{"Name":"Percent of applied N evaporated as N2O","amount":1.8,"unit":'%',
'uncertainty_type':4,'minimum':1.3,'maximum':2.2},
'perNH3evap':{"Name":"Percent of Ammonia that evaporates","amount":15,"unit":'%',"Reference":'16',
'uncertainty_type':5,'loc':15,'minimum':10,'maximum':20},
'perNasNH3fc':{"Name":"Percent N that is Ammonia","amount":25,"unit":'%',"Reference":'16',
'uncertainty_type':4,'minimum':1,'maximum':50},
}
### Facility Operation
self.operation = {
'choice_BU':{'Name':'Digestate Beneficial Use (1) or No Beneficial Use (0)','amount':1,'unit':'0/1','Referenc':None},
'peatOff':{'Name':'Digestate Beneficial Use offsets Peat (1 - Yes; 0 - No)','amount':1,'unit':'0/1','Referenc':None},
'fertOff':{'Name':'Digestate Beneficial Use offsets Fertilizer (1 - Yes; 0 - No)','amount':1,'unit':'0/1','Referenc':None},
'allocation_ADC':{'Name':'Allocation factor of LF material use to ADC','amount':0.5,'unit':'frac',
'uncertainty_type':4,'minimum':0,'maximum':1}}
### Material Properties
self.Material_Properties ={
'mcFC':{'Name':'Finished compost moisture content','amount':0.45 ,'unit':'mass water/total mass','Referenc':None,
'uncertainty_type':4,'minimum':0.18,'maximum':0.67},
'densFC':{'Name':'Density of final compost','amount':700 ,'unit':'kg/m3','Referenc':2,
'uncertainty_type':3,'loc': 700 ,'scale':110}
}
### Soil Sequestration
self.Soil_seq ={
'perCStor':{"Name":"Percent of carbon in finished compost remaining after 100 years","amount":10,"unit":'%'
,'uncertainty_type':4,'minimum':2,'maximum':16},
'humFormFac':{"Name":"100 year carbon storage from humus formation","amount":0,"unit":'kg-C/kg-C in compost',"Reference":'4'}
}
### Initial flow
self.initflow ={'mass':{"Name":"mass","amount":1000},
'C_cont':{"Name":"C_cont","amount":0.30,'uncertainty_type':4,'minimum':0.10,'maximum':0.47},
'N_cont':{"Name":"N_cont","amount":0.015,'uncertainty_type':4,'minimum':0.007,'maximum':0.028},
'P_cont':{"Name":"P_cont","amount":0.005,'uncertainty_type':4,'minimum':0.0015,'maximum':0.0093},
'K_cont':{"Name":"K_cont","amount":0.01,'uncertainty_type':4,'minimum':0.0007,'maximum':0.023}
}
### Landfill
self.Landfill ={'CH4_Collected':{"Name":"CH4_Collected","amount":60,
'uncertainty_type':3,'loc': 60 ,'scale':4, 'minimum':48.7,'maximum':69.7},
'Frac_oxidized':{"Name":"Frac_oxidized","amount":0.17,
'uncertainty_type':3,'loc': 0.17,'scale':0.03, 'minimum':0.105,'maximum':0.279},
'Frac_flared':{"Name":"Frac_flared","amount":0.31,
'uncertainty_type':3,'loc': 0.31 , 'scale':0.12, 'minimum':0.1,'maximum':0.593},
'percCStor_LF':{"Name":"Percent of carbon in compost remaining after 100 years","amount":90,"unit":'%'
,'uncertainty_type':3,'loc':90,'scale':3, 'minimum':83.2,'maximum':97.5},
'Elec_eff':{"Name":"Elec_eff in LF","amount":0.30,"unit":None
,'uncertainty_type':4,'minimum':0.20,'maximum':0.37},
'CH4_LHV':{"Name":"CH4_LHV","amount":50,"unit":'MJ/kg'},
'frac_CH4':{"Name":"frac_CH4 in biogas produced in LF","amount":0.5,"unit":None
,'uncertainty_type':4,'minimum':0.45,'maximum':0.55},
'DC_subs_fac':{'Name':'DC_subs_fac','amount':0.9,'unit':'frac',
'uncertainty_type':4,'minimum':0,'maximum':1},
'Soil_dens':{'Name':'Soil_dens','amount':1600,'unit':'kg/m3',
'uncertainty_type':5,'loc': 1600 ,'minimum':1400,'maximum':1800},
'DC_thickness':{'Name':'DC_thickness','amount':15,'unit':'cm',
'uncertainty_type':2,'loc': 2.7081, 'scale':0.0245},
'ADC_thickness':{'Name':'ADC_thickness','amount':22.5,'unit':'cm',
'uncertainty_type':2,'loc': 3.2189, 'scale':0.1150},
'Frac_NH4':{'Name':'Frac_NH4','amount':0.00563,'unit':'fraction',
'uncertainty_type':2,'loc': -5.1796, 'scale':0.2093},
'LCRS_eff':{'Name':'LCRS_eff','amount':0.991,'unit':'fraction',
'uncertainty_type':5,'loc': 0.991 ,'minimum':0.971,'maximum':0.999},
'NH4_rmv_eff':{'Name':'NH4_rmv_eff','amount':0.95,'unit':'fraction',
'uncertainty_type':5,'loc': 0.95 ,'minimum':0.89,'maximum':0.98},
'Grid_mix':{'Name':'Grid_mix','amount':1,'unit':'fraction',
'uncertainty_type':1,'loc': 1 ,'minimum':0.7,'maximum':1.35}
}
### Monte_carlo
def setup_MC(self,seed=None):
self.Compost_Input_list = {'Land_app':self.Land_app,'operation':self.operation,'Material_Properties':self.Material_Properties,
'Soil_seq':self.Soil_seq,'initflow':self.initflow,'Lanfill':self.Landfill}
super().__init__(self.Compost_Input_list)
super().setup_MC(seed)