Commit 29aba611 authored by Juha Kiviluoma's avatar Juha Kiviluoma
Browse files

r_genFuel was not working. Trying to fix it, but now it works only for units...

r_genFuel was not working. Trying to fix it, but now it works only for units that have one input commodity - the results will be wrong if there are mutliple. Needs to be fixed later. I also added flow based generation. So, r_genFuel should really be r_genSource

#107
parent 8bd6ade9
......@@ -89,7 +89,7 @@ Parameters
// Fuel use results
r_fuelUse(node, unit, f, t) "Fuel use of units"
r_genFuel(grid, node, commodity, f, t) "Energy generation/consumption based on fuels / flows (MW)"
r_genFuel(grid, node, *, f, t) "Energy generation/consumption based on fuels / flows (MW)"
r_genUnittype(grid, node, unittype, f, t) "Energy generation/consumption for each unittype (MW)"
r_gnTotalGenFuel(grid, node, commodity) "Total energy generation in gn per fuel over the simulation (MWh)"
r_gnTotalGenFuelShare(grid, node, commodity) "Total energy generation fuel consumption gn/g share"
......
......@@ -197,12 +197,19 @@ loop(m,
); // END sum(ft_realizedNoReset)
// Energy generation by fuels
r_genFuel(gn(grid, node), commodity, ft_realizedNoReset(f, t))$[sum(unit, un_commodity(unit, node)) and sum(gnu_input(grid, node_, unit)$gnu(grid, node, unit), r_gen(grid, node_, unit, f, t)) and ord(t) > mSettings(m, 't_start') + mSettings(m, 't_initializationPeriod')]
= sum(gnu_output(grid, node, unit),
r_genFuel(gn(grid, node), commodity, ft_realizedNoReset(f, t))$[ sum(gnu_input(grid_, node_, unit)$gnu_output(grid, node, unit), r_gen(grid_, node_, unit, f, t))
and ord(t) > mSettings(m, 't_start') + mSettings(m, 't_initializationPeriod')]
= sum(gnu_output(grid, node, unit)$sum(gnu_input(grid_, commodity, unit), 1),
+ r_gen(grid, node, unit, f, t)
)
* sum(gnu_input(grid, commodity, unit), r_gen(grid, commodity, unit, f, t))
/ sum(gnu_input(grid, node_, unit)$gnu(grid, node, unit), r_gen(grid, node_, unit, f, t));
);
// The calculation with multiple inputs needs to be fixed below (right share for different commodities - now units with multiple input commodities will get the same amount allocated which will then be too big
// * sum((grid_, unit)$gnu_output(grid, node, unit),
// r_gen(grid_, commodity, unit, f, t))
// / sum(gnu_input(grid__, node_, unit), r_gen(grid__, node_, unit, f, t));
r_genFuel(gn(grid, node), flow, ft_realizedNoReset(f, t))$flowNode(flow, node)
= sum(gnu_output(grid, node, unit)$flowUnit(flow, unit),
+ r_gen(grid, node, unit, f, t));
// Energy generation by fuels
r_genUnittype(gn(grid, node), unittype, ft_realizedNoReset(f,t))
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment