The UFZ services GitLab and Mattermost will be unavailable on Monday, July 4 from 06:00 AM to 08:00 AM due to maintenance work.

Commit 802e2272 authored by Markus Millinger's avatar Markus Millinger
Browse files

Corrected an error with the ghg calculation for heat inputs

parent 9f402a3b
......@@ -47,9 +47,9 @@ for time=1:s.runTime
%% Hard coded reference to Poplar - redo!
if s.heatOption==1
if s.heatOption==1 %Natural gas as heat source with EF=0.067 kgCO2eq/MJ
s.ghgEFHeat(time,:) = ones([s.numTech,1]).*0.067; %kgCO2eq/MJ
elseif s.heatOption==2
elseif s.heatOption==2 %Combustion of Poplar with eta=s.heatEta
s.ghgEFHeat(time,:) = ones([s.numTech,1])*(...
f.ghgCultivationTotHa(time,6)... %CO2eq/ha
+f.ghgTransport1(time).*f.cropYieldFM(6)... %CO2eq/tFM * tFM/ha
......
......@@ -27,9 +27,9 @@ close all;
%% Data Import
% Conversion options, biomass crops and residues and other data
techData = ...
importdata('../data/BENOPT_inputData_200409.xls'); %Save to variable - comment out if the .mat-file is up to date
save('../data/techData.mat','techData'); %Save to .mat-file - comment out if the .mat-file is up to date
% techData = ...
% importdata('../data/BENOPT_inputData_200409.xls'); %Save to variable - comment out if the .mat-file is up to date
% save('../data/techData.mat','techData'); %Save to .mat-file - comment out if the .mat-file is up to date
techData = ...
importdata('../data/techData.mat'); %reads data from .mat file
......@@ -70,7 +70,7 @@ for scenario = 1:noScenarios
s.runTime = 2051-2020;
%How many time steps within each year - up to 8760 possible (heavy on run-time)
g.timeStepsIntraYear = 1:50;
g.timeStepsIntraYear = 1:50;%8760;
%Set country specific data
countryID = 'DE';
......
......@@ -797,7 +797,8 @@ picName='../fig/fuelGHGeconomy';
% set(gcf,'PaperUnits','points','PaperPosition',[0 0 700 500],'PaperPositionMode','auto');
print(gcf,'-painters','-depsc','-loose',picName)
saveas(gcf,[picName '.tif'])
%%
%% Passenger car power input per km
index1=find(contains(s.techNames,{'PtG-H2'}));
index2=find(contains(s.techNames,{'PtG-C','PtL','FCEV'}));
......@@ -978,7 +979,7 @@ if max(g.timeStepsIntraYear)>8000
xlabel('ERE usage (TWh)')
title('c')
xlim([0 250])
ylim([0 16])
% ylim([0 19])
%
% subplot(1,4,4)
% plot(marginalCapex)
......@@ -996,8 +997,9 @@ if max(g.timeStepsIntraYear)>8000
saveas(gcf,[picName '.tif'])
end
%% Hydrogen Cost break down
%% Hydrogen Cost break down - only works if calculation of capex is performed @ max(g.timeStepsIntraYear)>8000
costH2=0;
costH2_GJ=0;
indexH2=find(contains(s.techNames,{'PtG-H2'}));
indexFCEV=find(contains(s.techNames,{'FCEV'}));
indexPtCH4=find(contains(s.techNames,{'PtG-CH4'}));
......@@ -1010,26 +1012,42 @@ for index = [indexFCEV,indexPtCH4,indexPtL]
GJpKM = s.MJperKMavgICEV.*10^-3./s.relativeFuelEconomy(index,6); %GJ per vehicle-km
costH2(end+1:end+2,1:6) = [[min(capex)/max(s.plantConvEta(:,index)) min(o(1).fuelInvCostLevel(:,index)) min(s.co2price)*s.feed2ndCO2Amount(index) s.powerInput(indexH2)*0 min(s.transportCost(index,:)) min(s.storageCost(index,:))]*min(GJpKM);% min(o.vehicleCostPerKm(:,index));
[max(capex)/min(s.plantConvEta(:,index)) max(o(1).fuelInvCostLevel(:,index)) max(s.co2price)*s.feed2ndCO2Amount(index) (40/3.6)/(min(s.plantConvEta(indexH2)*s.plantConvEta(:,index))) max(s.transportCost(index,:)) max(s.storageCost(index,:))]*max(GJpKM)];% max(o.vehicleCostPerKm(:,index))]; %/vehicle-km
costH2_GJ(end+1:end+2,1:6) = [[min(capex)/max(s.plantConvEta(:,index)) min(o(1).fuelInvCostLevel(:,index)) min(s.co2price)*s.feed2ndCO2Amount(index) s.powerInput(indexH2)*0 min(s.transportCost(index,:)) min(s.storageCost(index,:))]% min(o.vehicleCostPerKm(:,index));
[max(capex)/min(s.plantConvEta(:,index)) max(o(1).fuelInvCostLevel(:,index)) max(s.co2price)*s.feed2ndCO2Amount(index) (40/3.6)/(min(s.plantConvEta(indexH2)*s.plantConvEta(:,index))) max(s.transportCost(index,:)) max(s.storageCost(index,:))]];% max(o.vehicleCostPerKm(:,index))]; %/vehicle-km
% min(GJpKM)
% max(GJpKM)
end
subplot(1,2,1)
barh(costH2(2:end,:),'stacked','LineStyle','none')
set(gca,'YTickLabel',{'H_2,low','H_2,high','PtG-CH4,low','PtG-CH4,high','PtL,low','PtL,high'},'FontSize',13)
xlim([0 0.11])
grid on
% grid minor
xlabel(' vehicle-km^{-1}')
subplot(1,2,2)
barh(costH2_GJ(2:end,:),'stacked','LineStyle','none')
% set(gca,'YTickLabel',{'H_2,low','H_2,high','PtG-CH4,low','PtG-CH4,high','PtL,low','PtL,high'},'FontSize',13)
set(gca,'YTickLabel',{'','','','','',''},'FontSize',13)
xlim([0 65])
xlabel(' GJ^{-1}')
% for i = 1:7
% set(h(i),'FaceColor',col(i,:))
% end
grid on
% grid minor
legend('CAPEX H_2','CAPEX 2nd','CO_2','Electricity','Transport','Storage/fuelling','Location','EastOutside')
hLegend=legend('CAPEX H_2','CAPEX 2^{nd}','CO_2','Electricity','Transport','Logistics');%,'Location','EastOutside');
set(hLegend,'Position',[0.5174 0.53 0 0],'FontSize',12);
set(hLegend.BoxFace, 'ColorType','truecoloralpha', 'ColorData',uint8(255*[1;1;1;.5]));
% xlabel('FCEV,low','FCEV,high','PtG-CH4,low','PtG-CH4,low','PtL,low','PtL,low')
set(gca,'YTickLabel',{'FCEV,low','FCEV,high','PtG-CH4,low','PtG-CH4,high','PtL,low','PtL,high'})
xlim([0 0.105])
xlabel('Electrofuel cost breakdown ( vehicle-km^{-1})')
set(gcf,'Position',[0 0 500 200])
set(gcf,'PaperUnits','points','PaperPosition',[0 0 500 200],'PaperPositionMode','auto');
% set(gca,'YTickLabel',{'FCEV,low','FCEV,high','PtG-CH4,low','PtG-CH4,high','PtL,low','PtL,high'})
% xlim([0 0.11])
% xlabel('Electrofuel cost breakdown ( vehicle-km^{-1})')
set(gcf,'Position',[0 0 1300 400])
set(gcf,'PaperUnits','points','PaperPosition',[0 0 1300 400],'PaperPositionMode','auto');
picName=['../fig/prodCostH2'];
print(gcf,'-painters','-depsc','-loose',picName)
saveas(gcf,[picName '.tif'])
......@@ -1120,4 +1138,29 @@ for scenario=1:6
end
legend([f.feedNames f.residueNames f.powerNames],'Position',[0.82 0.385 0.1 0.25],'Interpreter','none','FontSize',13)
%%
end
\ No newline at end of file
end
%
%
% fileName = 'ResultsTemp.xlsx';
%
% paretoIter=1;
% for scenario=1:noScenarios
% xlswrite(fileName,s.techNames(g.TStrans),['ResultsPass S' int2str(scenario)],'B1')
% xlswrite(fileName,s.techNames(g.TStrans),['ResultsFreight S' int2str(scenario)],'B1')
% xlswrite(fileName,s.techNames(g.TStrans),['ResultsMarine S' int2str(scenario)],'B1')
% xlswrite(fileName,s.techNames(g.TStrans),['ResultsAviation S' int2str(scenario)],'B1')
% xlswrite(fileName,s.year',['ResultsPass S' int2str(scenario)],'A2')
% xlswrite(fileName,s.year',['ResultsFreight S' int2str(scenario)],'A2')
% xlswrite(fileName,s.year',['ResultsMarine S' int2str(scenario)],'A2')
% xlswrite(fileName,s.year',['ResultsAviation S' int2str(scenario)],'A2')
% xlswrite(fileName,paretoVar(scenario,paretoIter).prd(:,g.TStrans,6).*s.heatByprod(:,g.TStrans),['ResultsPass S' int2str(scenario)],'B2')
% xlswrite(fileName,paretoVar(scenario,paretoIter).prd(:,g.TStrans,8).*s.heatByprod(:,g.TStrans),['ResultsFreight S' int2str(scenario)],'B2')
% xlswrite(fileName,paretoVar(scenario,paretoIter).prd(:,g.TStrans,9).*s.heatByprod(:,g.TStrans),['ResultsMarine S' int2str(scenario)],'B2')
% xlswrite(fileName,paretoVar(scenario,paretoIter).prd(:,g.TStrans,7).*s.heatByprod(:,g.TStrans),['ResultsAviation S' int2str(scenario)],'B2')
% end
%
......@@ -281,17 +281,19 @@ s.ghgTransp1DistEmpty = 20; %km/transport
s.ghgTranspDieselFull = 0.41; %/km
s.ghgTranspDieselEmpty = 0.24; %/km
s.ghgP1Heat = s.heatInput.*s.cropFMenergyContent.*s.plantConvEta; %kWh/GJ_fuel - conversion efficiency to kWh/tFM
s.ghgP1Heat = 3.6.*s.heatInput.*s.cropFMenergyContent.*s.plantConvEta; %kWh/GJ_fuel - conversion efficiency to MJ/tFM
s.ghgP1Power = s.powerInput.*s.cropFMenergyContent.*s.plantConvEta; %kWh/GJ_fuel - converted to kWh/tFM
s.ghgP1Hydrogen = 10^3.*s.feed2ndH2in.*s.cropFMenergyContent.*s.plantConvEta; %kg/tFM
s.ghgP1CO2 = ...
10^3.*s.feed2ndCO2Amount.*s.cropFMenergyContent.*s.plantConvEta; %kg/tFM
s.ghgP1AllocationFactor = techData.data.techInputData(74,1:s.numTech); %proc
%If the allocation factor is not unity, use the more detailed process heat
%and power input data given in the table
s.ghgP1Heat(:,s.ghgP1AllocationFactor~=1) = ...
techData.data.techInputData(72,s.ghgP1AllocationFactor~=1).*linspace(1,1,s.runTime)'; %MJ/t_feed
s.ghgP1Power(:,s.ghgP1AllocationFactor~=1) = ...
techData.data.techInputData(73,s.ghgP1AllocationFactor~=1).*linspace(1,1,s.runTime)'; %MJ/t_feed
techData.data.techInputData(73,s.ghgP1AllocationFactor~=1).*linspace(1,1,s.runTime)'; %kWh/t_feed
s.ghgP2AllocationFactor = techData.data.techInputData(81,1:s.numTech); %proc
......
Markdown is supported
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