Add emissions to the output file

gh-actions v0.3.0
Alinson S. Xavier 5 years ago
parent 046ee52d9d
commit 9f988dd3f9
No known key found for this signature in database
GPG Key ID: A796166E4E218E02

@ -46,6 +46,7 @@
0.0,
0.0
],
"Emissions (tonne)": {},
"Expansion cost ($)": [
0.0,
0.0
@ -94,7 +95,8 @@
-11360.736,
-11360.736
],
"Latitude (deg)": 0.75
"Latitude (deg)": 0.75,
"Emissions (tonne)": {}
}
}
}
@ -106,6 +108,16 @@
500.0,
0.0
],
"Emissions (tonne)": {
"CH4": [
3.0,
2.0
],
"CO2": [
52.0,
50.0
]
},
"Expansion cost ($)": [
0.0,
750.0
@ -211,7 +223,17 @@
6389.1,
6389.1
],
"Latitude (deg)": 84.0
"Latitude (deg)": 84.0,
"Emissions (tonne)": {
"CH4": [
0.63891,
0.42594
],
"CO2": [
11.07444,
10.6485
]
}
},
"C7": {
"Distance (km)": 8526.39,
@ -232,7 +254,17 @@
7398.599999999999,
7398.599999999999
],
"Latitude (deg)": 30.0
"Latitude (deg)": 30.0,
"Emissions (tonne)": {
"CH4": [
0.73986,
0.49323999999999996
],
"CO2": [
12.824239999999998,
12.331
]
}
},
"C5": {
"Distance (km)": 9148.52,
@ -253,7 +285,17 @@
15309.9,
15309.9
],
"Latitude (deg)": 32.0
"Latitude (deg)": 32.0,
"Emissions (tonne)": {
"CH4": [
1.53099,
1.02066
],
"CO2": [
26.537159999999997,
25.5165
]
}
},
"C9": {
"Distance (km)": 8201.21,
@ -274,7 +316,17 @@
902.4,
902.4
],
"Latitude (deg)": 74.0
"Latitude (deg)": 74.0,
"Emissions (tonne)": {
"CH4": [
0.09024,
0.06016
],
"CO2": [
1.5641599999999998,
1.504
]
}
}
}
}
@ -284,6 +336,16 @@
1000.0,
0.0
],
"Emissions (tonne)": {
"CH4": [
11.21592,
7.4772799999999995
],
"CO2": [
194.40928,
186.93200000000002
]
},
"Expansion cost ($)": [
0.0,
3364.776
@ -368,7 +430,17 @@
46728.0,
46728.0
],
"Latitude (deg)": 7.0
"Latitude (deg)": 7.0,
"Emissions (tonne)": {
"CH4": [
2.80368,
1.86912
],
"CO2": [
48.59712,
46.728
]
}
},
"C2": {
"Distance (km)": 2165.47,
@ -389,7 +461,17 @@
9947.5,
9947.5
],
"Latitude (deg)": 7.0
"Latitude (deg)": 7.0,
"Emissions (tonne)": {
"CH4": [
0.59685,
0.3979
],
"CO2": [
10.3454,
9.9475
]
}
},
"C8": {
"Distance (km)": 5421.1,
@ -410,7 +492,17 @@
35308.5,
35308.5
],
"Latitude (deg)": 35.0
"Latitude (deg)": 35.0,
"Emissions (tonne)": {
"CH4": [
2.11851,
1.41234
],
"CO2": [
36.720839999999995,
35.3085
]
}
},
"C6": {
"Distance (km)": 6595.52,
@ -431,7 +523,17 @@
23583.0,
23583.0
],
"Latitude (deg)": 14.0
"Latitude (deg)": 14.0,
"Emissions (tonne)": {
"CH4": [
1.4149800000000001,
0.94332
],
"CO2": [
24.526320000000002,
23.583000000000002
]
}
},
"C10": {
"Distance (km)": 6014.13,
@ -452,7 +554,17 @@
26826.0,
26826.0
],
"Latitude (deg)": 22.0
"Latitude (deg)": 22.0,
"Emissions (tonne)": {
"CH4": [
1.6095599999999999,
1.07304
],
"CO2": [
27.89904,
26.826
]
}
},
"C4": {
"Distance (km)": 2802.12,
@ -473,7 +585,17 @@
17609.5,
17609.5
],
"Latitude (deg)": 21.0
"Latitude (deg)": 21.0,
"Emissions (tonne)": {
"CH4": [
1.05657,
0.70438
],
"CO2": [
18.313879999999997,
17.6095
]
}
},
"C7": {
"Distance (km)": 8469.86,
@ -494,7 +616,17 @@
26929.5,
26929.5
],
"Latitude (deg)": 30.0
"Latitude (deg)": 30.0,
"Emissions (tonne)": {
"CH4": [
1.6157700000000002,
1.07718
],
"CO2": [
28.00668,
26.929500000000004
]
}
}
}
}
@ -506,6 +638,7 @@
3000.0,
0.0
],
"Emissions (tonne)": {},
"Expansion cost ($)": [
0.0,
0.0
@ -590,7 +723,8 @@
9950.0,
9950.0
],
"Latitude (deg)": 0.0
"Latitude (deg)": 0.0,
"Emissions (tonne)": {}
},
"L2": {
"Distance (km)": 43.35,
@ -611,7 +745,8 @@
37386.4,
37386.4
],
"Latitude (deg)": 0.5
"Latitude (deg)": 0.5,
"Emissions (tonne)": {}
}
}
}
@ -623,6 +758,7 @@
0.0,
0.0
],
"Emissions (tonne)": {},
"Expansion cost ($)": [
0.0,
0.0
@ -671,7 +807,8 @@
-7485.0,
-7485.0
],
"Latitude (deg)": 0.0
"Latitude (deg)": 0.0,
"Emissions (tonne)": {}
},
"L2": {
"Distance (km)": 6828.89,
@ -692,7 +829,8 @@
-28039.8,
-28039.8
],
"Latitude (deg)": 0.5
"Latitude (deg)": 0.5,
"Emissions (tonne)": {}
}
},
"F2": {
@ -715,11 +853,34 @@
-710.046,
-710.046
],
"Latitude (deg)": 0.75
"Latitude (deg)": 0.75,
"Emissions (tonne)": {}
}
}
}
}
}
},
"Emissions": {
"Transportation (tonne)": {
"CH4": [
14.21592,
9.477279999999999
],
"CO2": [
246.40927999999994,
236.93200000000002
]
},
"Plants (tonne)": {
"CH4": [
14.21592,
9.47728
],
"CO2": [
246.40928,
236.93200000000002
]
}
},
"Products": {

@ -241,7 +241,11 @@ function get_solution(model::ManufacturingModel)
"Energy" => Dict(
"Plants (GJ)" => zeros(T),
"Transportation (GJ)" => zeros(T),
)
),
"Emissions" => Dict(
"Plants (tonne)" => Dict(),
"Transportation (tonne)" => Dict(),
),
)
plant_to_process_node = Dict(n.location => n for n in graph.process_nodes)
@ -316,7 +320,16 @@ function get_solution(model::ManufacturingModel)
"Transportation cost (\$)" => a.source.product.transportation_cost .* vals .* a.values["distance"],
"Variable operating cost (\$)" => plant.sizes[1].variable_operating_cost .* vals,
"Transportation energy (J)" => vals .* a.values["distance"] .* a.source.product.transportation_energy,
"Emissions (tonne)" => Dict(),
)
emissions_dict = output["Emissions"]["Transportation (tonne)"]
for (em_name, em_values) in a.source.product.transportation_emissions
dict["Emissions (tonne)"][em_name] = em_values .* dict["Amount (tonne)"]
if em_name keys(emissions_dict)
emissions_dict[em_name] = zeros(T)
end
emissions_dict[em_name] += dict["Emissions (tonne)"][em_name]
end
if a.source.location isa CollectionCenter
plant_name = "Origin"
location_name = a.source.location.name
@ -338,6 +351,16 @@ function get_solution(model::ManufacturingModel)
plant_dict["Energy (GJ)"] = plant_dict["Total input (tonne)"] .* plant.energy
output["Energy"]["Plants (GJ)"] += plant_dict["Energy (GJ)"]
plant_dict["Emissions (tonne)"] = Dict()
emissions_dict = output["Emissions"]["Plants (tonne)"]
for (em_name, em_values) in plant.emissions
plant_dict["Emissions (tonne)"][em_name] = em_values .* plant_dict["Total input (tonne)"]
if em_name keys(emissions_dict)
emissions_dict[em_name] = zeros(T)
end
emissions_dict[em_name] += plant_dict["Emissions (tonne)"][em_name]
end
# Outputs
for shipping_node in plant_to_shipping_nodes[plant]
product_name = shipping_node.product.name

Loading…
Cancel
Save