-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy_3_of_AGS_pokras_config3_S_ratio_power_variance.m
91 lines (81 loc) · 2.34 KB
/
Copy_3_of_AGS_pokras_config3_S_ratio_power_variance.m
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
clear;
close all;
clc;
date = '_03_08_23';
%% Define System Parameters
params = SimulationParameters; %radius, surface temp, dT/dz, etc.
params.config = 4;
% params.S_ratio = 0; %S_ratio = m_S1/m_total
params.find_opt_S_ratio_toggle = 0;
% if params.config == 1 || params.config == 2
% params.S_ratio = 1;
% end
params.well_radius = 0.4667/2; %m ~18 3/8" inner diameter
params.side_stream_radius = 0.2032/2; %m ~8" inner diameter
%% Solver toggle
useMySolver = 1;
%% Collection
params.res_length = 7000;
params.n_streams = 7;
ratios = [0];
A = zeros(size(ratios,2),21);
for i = 1:size(ratios,2)
params.S_ratio = ratios(i);
filename = strcat('Results/dpo_opt_config3_S_ratio_power_variance_copy4',num2str(date),'.csv');
%% Calculate
x0 = 150;
tic;
[result,x_opt] = AGS_solver(useMySolver,x0,params);
if result.s_turb_in <= (1.65e3*0.99)
disp('constraint NOT satisfied')
con = 0;
else
disp('constraint satisfied')
con = 1;
end
toc;
A(i,:) = [result.W_net/1e3,...
result.Q_net/1e3,...
result.Power/1e3,...
result.Power_electric_sold_avg,...
result.Power_heat_sold_avg,...
result.Power_total_sold_avg,...
result.CapitalCost.C_brownfield/result.Power_electric_sold_avg,...
result.CapitalCost.C_brownfield/result.Power_heat_sold_avg,...
result.CapitalCost.C_brownfield/result.Power_total_sold_avg,...
result.CapitalCost.C_greenfield/result.Power_electric_sold_avg,...
result.CapitalCost.C_greenfield/result.Power_heat_sold_avg,...
result.CapitalCost.C_greenfield/result.Power_total_sold_avg,...
params.depth,...
params.res_length,...
params.n_streams,...
params.S_ratio,...
x_opt(1),...
result.max_speed,...
result.CapitalCost.C_brownfield,...
result.CapitalCost.C_greenfield,...
con];
end
T = array2table(A,...
'VariableNames',{'W_net', ...
'Q_net',...
'Total_power',...
'W_net_avg', ...
'Q_net_avg',...
'Total_power_avg',...
'SpCC_W_Br', ...
'SpCC_Q_Br', ...
'SpCC_dH_Br', ...
'SpCC_W_Gr', ...
'SpCC_Q_Gr', ...
'SpCC_dH_Gr', ...
'depth', ...
'res_length', ...
'n_streams', ...
'S_ratio',...
'm_dot', ...
'max_speed', ...
'C_Br', ...
'C_Gr',...
'con satisfied'});
% writetable(T, filename);