Plot_mole_frac_depth.m 4.09 KB
Newer Older
Lena Noack's avatar
Lena Noack committed
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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147

T = zeros(4,1); % four depths
p = zeros(4,1); % four depths

T(1) = 1400; %K
p(1) = 1; %bar
T(2) = 1500; %K
p(2) = 4500; %bar -> 15 km depth
T(3) = 1600; %K
p(3) = 9000; %bar -> 30 km depth (end of crust)
T(4) = 1800; %K
p(4) = 30000; %bar -> 100 km depth (below lithosphere)
z(1) = 0; %km
z(2) = 15; %km
z(3) = 30; %km
z(4) = 100; %km

H2 = zeros(4,4); % four depths, four redox cases
H2O = zeros(4,4); % four depths, four redox cases
CO = zeros(4,4); % four depths, four redox cases
CO2 = zeros(4,4); % four depths, four redox cases

for i=1:4  
  for j=1:4 
    [H2(i,j), H2O(i,j), CO(i,j), CO2(i,j)] = ortenzi_simultaneous_eq_C_O_H(T(i), p(i), 0.5, 0.5, j, 0);
  end
end

subplot(1,4,1)
plot(H2(:,1),z,'b--','LineWidth',2)
hold on
plot(H2O(:,1),z,'b','LineWidth',2)
plot(CO(:,1),z,'r--','LineWidth',2)
plot(CO2(:,1),z,'r','LineWidth',2)
plot([0,0.5],[15,15],'k:','LineWidth',1)
plot([0,0.5],[30,30],'k:','LineWidth',1)
hold off
%legend('H2','H2O','CO','CO2','location','northeast')
xlabel('Mole fraction','FontSize',16)
ylabel('Depth in km','FontSize',16)
title('QIF','FontSize',18)
xlim([0,0.5])
h = gca;  % Handle to currently active axes
set(h, 'YDir', 'reverse');

subplot(1,4,2)
plot(H2(:,2),z,'b--','LineWidth',2)
hold on
plot(H2O(:,2),z,'b','LineWidth',2)
plot(CO(:,2),z,'r--','LineWidth',2)
plot(CO2(:,2),z,'r','LineWidth',2)
plot([0,0.5],[15,15],'k:','LineWidth',1)
plot([0,0.5],[30,30],'k:','LineWidth',1)
hold off
%legend('H2','H2O','CO','CO2','location','northeast')
xlabel('Mole fraction','FontSize',16)
ylabel('Depth in km','FontSize',16)
title('IW','FontSize',18)
xlim([0,0.5])
h = gca;  % Handle to currently active axes
set(h, 'YDir', 'reverse');

subplot(1,4,3)
plot(H2(:,3),z,'b--','LineWidth',2)
hold on
plot(H2O(:,3),z,'b','LineWidth',2)
plot(CO(:,3),z,'r--','LineWidth',2)
plot(CO2(:,3),z,'r','LineWidth',2)
plot([0,0.5],[15,15],'k:','LineWidth',1)
plot([0,0.5],[30,30],'k:','LineWidth',1)
text(0.15,2,'1400K, 1bar')
text(0.14,16.5,'1500K, 45kbar')
text(0.14,31.5,'1600K, 90kbar')
text(0.12,97.5,'1800K, 300kbar')
hold off
%legend('H2','H2O','CO','CO2','location','northeast')
xlabel('Mole fraction','FontSize',16)
ylabel('Depth in km','FontSize',16)
title('NiNiO','FontSize',18)
xlim([0,0.5])
h = gca;  % Handle to currently active axes
set(h, 'YDir', 'reverse');

subplot(1,4,4)
plot(H2(:,4),z,'b--','LineWidth',2)
hold on
plot(H2O(:,4),z,'b','LineWidth',2)
plot(CO(:,4),z,'r--','LineWidth',2)
plot(CO2(:,4),z,'r','LineWidth',2)
plot([0,0.5],[15,15],'k:','LineWidth',1)
plot([0,0.5],[30,30],'k:','LineWidth',1)
hold off
legend('H2','H2O','CO','CO2','location','north')
xlabel('Mole fraction','FontSize',16)
ylabel('Depth in km','FontSize',16)
title('QFM','FontSize',18)
xlim([0,0.5])
h = gca;  % Handle to currently active axes
set(h, 'YDir', 'reverse');

% subplot(2,2,1)
% plot(p,H2(:,1),'b--','LineWidth',2)
% hold on
% plot(p,H2O(:,1),'b','LineWidth',2)
% plot(p,CO(:,1),'r--','LineWidth',2)
% plot(p,CO2(:,1),'r','LineWidth',2)
% hold off
% %legend('H2','H2O','CO','CO2')
% xlabel('Pressure in bar','FontSize',16)
% ylabel('Mole fraction','FontSize',16)
% title('QIF','FontSize',18)
% 
% subplot(2,2,2)
% plot(p,H2(:,2),'b--','LineWidth',2)
% hold on
% plot(p,H2O(:,2),'b','LineWidth',2)
% plot(p,CO(:,2),'r--','LineWidth',2)
% plot(p,CO2(:,2),'r','LineWidth',2)
% hold off
% %legend('H2','H2O','CO','CO2')
% xlabel('Pressure in bar','FontSize',16)
% ylabel('Mole fraction','FontSize',16)
% title('IW','FontSize',18)
% 
% subplot(2,2,3)
% semilogy(p,H2(:,3),'b--','LineWidth',2)
% hold on
% semilogy(p,H2O(:,3),'b','LineWidth',2)
% semilogy(p,CO(:,3),'r--','LineWidth',2)
% semilogy(p,CO2(:,3),'r','LineWidth',2)
% hold off
% legend('H_2','H_2O','CO','CO_2','location','east','FontSize',12)
% xlabel('Pressure in bar','FontSize',16)
% ylabel('Mole fraction','FontSize',16)
% title('NiNiO','FontSize',18)
% 
% subplot(2,2,4)
% semilogy(p,H2(:,4),'b--','LineWidth',2)
% hold on
% semilogy(p,H2O(:,4),'b','LineWidth',2)
% semilogy(p,CO(:,4),'r--','LineWidth',2)
% semilogy(p,CO2(:,4),'r','LineWidth',2)
% hold off
% %legend('H2','H2O','CO','CO2')
% xlabel('Pressure in bar','FontSize',16)
% ylabel('Mole fraction','FontSize',16)
% title('QFM','FontSize',18)