/
cmod_mspt_iph.cpp
2435 lines (2050 loc) · 276 KB
/
cmod_mspt_iph.cpp
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
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*
BSD 3-Clause License
Copyright (c) Alliance for Sustainable Energy, LLC. See also https://github.com/NREL/ssc/blob/develop/LICENSE
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#define _HAS_STD_BYTE 0
#include "core.h"
// for adjustment factors
#include "common.h"
// solarpilot header files
#include "AutoPilot_API.h"
#include "SolarField.h"
#include "IOUtil.h"
#include "csp_common.h"
// Can probably delete these headers later...
#include "csp_solver_util.h"
#include "csp_solver_core.h"
#include "csp_solver_pt_sf_perf_interp.h"
#include "csp_solver_mspt_receiver_222.h"
#include "csp_solver_mspt_receiver.h"
#include "csp_solver_mspt_collector_receiver.h"
#include "csp_solver_pc_heat_sink.h"
#include "csp_solver_two_tank_tes.h"
#include "csp_solver_tou_block_schedules.h"
#include "csp_dispatch.h"
#include "csp_solver_cr_electric_resistance.h"
#include "csp_solver_cavity_receiver.h"
#include "csp_system_costs.h"
#include <ctime>
static var_info _cm_vtab_mspt_iph[] = {
// VARTYPE DATATYPE NAME LABEL UNITS META GROUP REQUIRED_IF CONSTRAINTS UI_HINTS
{ SSC_INPUT, SSC_STRING, "solar_resource_file", "Local weather file path", "", "", "Solar Resource", "?", "LOCAL_FILE", ""},
{ SSC_INPUT, SSC_TABLE, "solar_resource_data", "Weather resource data in memory", "", "", "Solar Resource", "?", "", "SIMULATION_PARAMETER"},
// Simulation parameters
{ SSC_INPUT, SSC_NUMBER, "is_dispatch", "Allow dispatch optimization?", "", "", "System Control", "?=0", "", ""},
{ SSC_INPUT, SSC_NUMBER, "sim_type", "1 (default): timeseries, 2: design only", "", "", "System Control", "?=1", "", "SIMULATION_PARAMETER"},
{ SSC_INPUT, SSC_NUMBER, "csp_financial_model", "", "1-8", "", "Financial Model", "?=1", "INTEGER,MIN=0", ""},
{ SSC_INPUT, SSC_NUMBER, "time_start", "Simulation start time", "s", "", "System Control", "?=0", "", "SIMULATION_PARAMETER"},
{ SSC_INPUT, SSC_NUMBER, "time_stop", "Simulation stop time", "s", "", "System Control", "?=31536000", "", "SIMULATION_PARAMETER"},
{ SSC_INPUT, SSC_NUMBER, "time_steps_per_hour", "Number of simulation time steps per hour", "", "", "System Control", "?=-1", "", "SIMULATION_PARAMETER"},
{ SSC_INPUT, SSC_NUMBER, "vacuum_arrays", "Allocate arrays for only the required number of steps", "", "", "System Control", "?=0", "", "SIMULATION_PARAMETER"},
// System Design
{ SSC_INPUT, SSC_NUMBER, "is_parallel_htr", "Does plant include a HTF heater parallel to solar field?", "", "", "System Control", "?=0", "", ""},
{ SSC_INPUT, SSC_NUMBER, "T_htf_cold_des", "Cold HTF inlet temperature at design conditions", "C", "", "System Design", "*", "", ""},
{ SSC_INPUT, SSC_NUMBER, "T_htf_hot_des", "Hot HTF outlet temperature at design conditions", "C", "", "System Design", "*", "", ""},
{ SSC_INPUT, SSC_NUMBER, "q_pb_design", "Design heat input to power block", "MWt", "", "System Design", "*", "", "" },
{ SSC_INPUT, SSC_NUMBER, "tshours", "Equivalent full-load thermal storage hours", "hr", "", "System Design", "*", "", ""},
{ SSC_INPUT, SSC_NUMBER, "solarm", "Solar multiple", "-", "", "System Design", "*", "", ""},
{ SSC_INPUT, SSC_NUMBER, "dni_des", "Design-point DNI", "W/m2", "", "System Design", "*", "", ""},
// Solar field
{ SSC_INPUT, SSC_NUMBER, "field_model_type", "0=design field and tower/receiver geometry, 1=design field, 2=user specified field, 3=user flux and eta map, pass heliostat_positions to SolarPILOT for layout, 4=user flux and eta maps, no SolarPILOT, input A_sf_in, total_land_area_before_rad_cooling_in, and N_hel", "", "", "Heliostat Field", "*", "", ""},
{ SSC_INPUT, SSC_NUMBER, "helio_width", "Heliostat width", "m", "", "Heliostat Field", "field_model_type<4", "", ""},
{ SSC_INPUT, SSC_NUMBER, "helio_height", "Heliostat height", "m", "", "Heliostat Field", "field_model_type<4", "", ""},
{ SSC_INPUT, SSC_NUMBER, "helio_optical_error_mrad", "Heliostat optical error", "mrad", "", "Heliostat Field", "*", "", ""},
{ SSC_INPUT, SSC_NUMBER, "helio_active_fraction", "Heliostat active fraction", "", "", "Heliostat Field", "*", "", ""},
{ SSC_INPUT, SSC_NUMBER, "dens_mirror", "Ratio of heliostat reflective area to profile", "", "", "Heliostat Field", "field_model_type<4", "", ""},
{ SSC_INPUT, SSC_NUMBER, "helio_reflectance", "Heliostat reflectance", "", "", "Heliostat Field", "*", "", ""},
{ SSC_INPUT, SSC_NUMBER, "rec_absorptance", "Receiver absorptance", "", "", "Tower and Receiver", "*", "", ""},
{ SSC_INPUT, SSC_NUMBER, "rec_hl_perm2", "Receiver design heatloss", "kW/m2", "", "Tower and Receiver", "*", "", ""},
{ SSC_INPUT, SSC_NUMBER, "land_max", "Land max boundary", "-ORm", "", "Heliostat Field", "?=7.5", "", ""},
{ SSC_INPUT, SSC_NUMBER, "land_min", "Land min boundary", "-ORm", "", "Heliostat Field", "?=0.75", "", ""},
{ SSC_INPUT, SSC_MATRIX, "land_bound_table", "Land boundary table", "m", "", "Heliostat Field", "?", "", "SIMULATION_PARAMETER"},
{ SSC_INPUT, SSC_ARRAY, "land_bound_list", "Land boundary table listing", "", "", "Heliostat Field", "?", "", "SIMULATION_PARAMETER"},
{ SSC_INPUT, SSC_NUMBER, "p_start", "Heliostat startup energy", "kWe-hr", "", "Heliostat Field", "*", "", ""},
{ SSC_INPUT, SSC_NUMBER, "p_track", "Heliostat tracking energy", "kWe", "", "Heliostat Field", "*", "", ""},
{ SSC_INPUT, SSC_NUMBER, "hel_stow_deploy", "Stow/deploy elevation angle", "deg", "", "Heliostat Field", "*", "", ""},
{ SSC_INPUT, SSC_NUMBER, "v_wind_max", "Heliostat max wind velocity", "m/s", "", "Heliostat Field", "*", "", ""},
{ SSC_INPUT, SSC_NUMBER, "interp_nug", "Interpolation nugget", "-", "", "Heliostat Field", "?=0", "", "SIMULATION_PARAMETER"},
{ SSC_INPUT, SSC_NUMBER, "interp_beta", "Interpolation beta coef.", "-", "", "Heliostat Field", "?=1.99", "", "SIMULATION_PARAMETER"},
{ SSC_INPUT, SSC_MATRIX, "helio_aim_points", "Heliostat aim point table", "m", "", "Heliostat Field", "?", "", "SIMULATION_PARAMETER"},
{ SSC_INPUT, SSC_MATRIX, "eta_map", "Field efficiency array", "", "", "Heliostat Field", "field_model_type>2", "", "SIMULATION_PARAMETER"},
{ SSC_INPUT, SSC_NUMBER, "eta_map_aod_format", "Use 3D AOD format field efficiency array", "", "heliostat", "Heliostat Field", "field_model_type>2", "", "SIMULATION_PARAMETER"},
{ SSC_INPUT, SSC_MATRIX, "flux_maps", "Flux map intensities", "", "", "Heliostat Field", "field_model_type>2", "", "SIMULATION_PARAMETER"},
{ SSC_INPUT, SSC_NUMBER, "c_atm_0", "Attenuation coefficient 0", "", "", "Heliostat Field", "?=0.006789", "", ""},
{ SSC_INPUT, SSC_NUMBER, "c_atm_1", "Attenuation coefficient 1", "", "", "Heliostat Field", "?=0.1046", "", ""},
{ SSC_INPUT, SSC_NUMBER, "c_atm_2", "Attenuation coefficient 2", "", "", "Heliostat Field", "?=-0.0107", "", ""},
{ SSC_INPUT, SSC_NUMBER, "c_atm_3", "Attenuation coefficient 3", "", "", "Heliostat Field", "?=0.002845", "", ""},
{ SSC_INPUT, SSC_NUMBER, "n_facet_x", "Number of heliostat facets - X", "", "", "Heliostat Field", "*", "", ""},
{ SSC_INPUT, SSC_NUMBER, "n_facet_y", "Number of heliostat facets - Y", "", "", "Heliostat Field", "*", "", ""},
{ SSC_INPUT, SSC_NUMBER, "focus_type", "Heliostat focus method", "", "", "Heliostat Field", "*", "", ""},
{ SSC_INPUT, SSC_NUMBER, "cant_type", "Heliostat canting method", "", "", "Heliostat Field", "*", "", ""},
{ SSC_INPUT, SSC_NUMBER, "n_flux_days", "Number of days in flux map lookup", "", "", "Tower and Receiver", "?=8", "", ""},
{ SSC_INPUT, SSC_NUMBER, "delta_flux_hrs", "Hourly frequency in flux map lookup", "", "", "Tower and Receiver", "?=1", "", ""},
{ SSC_INPUT, SSC_NUMBER, "water_usage_per_wash", "Water usage per wash", "L/m2_aper", "", "Heliostat Field", "*", "", ""},
{ SSC_INPUT, SSC_NUMBER, "washing_frequency", "Mirror washing frequency", "none", "", "Heliostat Field", "*", "", ""},
{ SSC_INPUT, SSC_NUMBER, "check_max_flux", "Check max flux at design point", "", "", "Heliostat Field", "?=0", "", ""},
{ SSC_INPUT, SSC_NUMBER, "sf_excess", "Heliostat field multiple", "", "", "System Design", "?=1.0", "", ""},
// Inputs required for user defined SF performance when field_model_type = 4
// Values can be defined by mapping to equivalent _calc output for simulation results with field_model_type < 3
{ SSC_INPUT, SSC_NUMBER, "A_sf_in", "Solar field area", "m^2", "", "Heliostat Field", "field_model_type>3", "", "SIMULATION_PARAMETER"},
{ SSC_INPUT, SSC_NUMBER, "total_land_area_before_rad_cooling_in", "Total land area not including radiative cooling - in", "acre", "", "Heliostat Field", "field_model_type>3", "", "SIMULATION_PARAMETER"},
{ SSC_INPUT, SSC_NUMBER, "N_hel", "Number of heliostats - in", "", "", "Heliostat Field", "field_model_type>3", "", "SIMULATION_PARAMETER"},
{ SSC_INPUT, SSC_NUMBER, "flux_max", "Maximum allowable flux", "", "", "Tower and Receiver", "?=1000", "", ""},
{ SSC_INPUT, SSC_NUMBER, "opt_init_step", "Optimization initial step size", "", "", "Heliostat Field", "?=0.05", "", ""},
{ SSC_INPUT, SSC_NUMBER, "opt_max_iter", "Max number iteration steps", "", "", "Heliostat Field", "?=200", "", ""},
{ SSC_INPUT, SSC_NUMBER, "opt_conv_tol", "Optimization convergence tolerance", "", "", "Heliostat Field", "?=0.001", "", ""},
{ SSC_INPUT, SSC_NUMBER, "opt_flux_penalty", "Optimization flux overage penalty", "", "", "Heliostat Field", "*", "", ""},
{ SSC_INPUT, SSC_NUMBER, "opt_algorithm", "Optimization algorithm", "", "", "Heliostat Field", "?=1", "", ""},
// Receiver (type 222) parameters
{ SSC_INPUT, SSC_NUMBER, "receiver_type", "0: external (default), 1; cavity", "", "", "Heliostat Field", "?=0", "", "" },
{ SSC_INPUT, SSC_NUMBER, "N_panels", "Number of individual panels on the receiver", "", "", "Tower and Receiver", "*", "INTEGER", ""},
{ SSC_INPUT, SSC_NUMBER, "d_tube_out", "The outer diameter of an individual receiver tube", "mm", "", "Tower and Receiver", "*", "", ""},
{ SSC_INPUT, SSC_NUMBER, "th_tube", "The wall thickness of a single receiver tube", "mm", "", "Tower and Receiver", "*", "", ""},
{ SSC_INPUT, SSC_NUMBER, "mat_tube", "Receiver tube material, 2=Stainless AISI316", "", "", "Tower and Receiver", "*", "", ""},
{ SSC_INPUT, SSC_NUMBER, "rec_htf", "Receiver HTF, 17=Salt (60% NaNO3, 40% KNO3) 10=Salt (46.5% LiF 11.5% NaF 42% KF) 50=Lookup tables", "", "", "Tower and Receiver", "*", "", ""},
{ SSC_INPUT, SSC_MATRIX, "field_fl_props", "User defined field fluid property data", "-", "", "Tower and Receiver", "*", "", ""},
{ SSC_INPUT, SSC_NUMBER, "Flow_type", "Receiver flow pattern: see figure on SAM Receiver page", "", "", "Tower and Receiver", "*", "", ""},
{ SSC_INPUT, SSC_NUMBER, "crossover_shift", "Number of panels shift in receiver crossover position", "", "", "Tower and Receiver", "?=0", "", "SIMULATION_PARAMETER"},
{ SSC_INPUT, SSC_NUMBER, "epsilon", "The emissivity of the receiver surface coating", "", "", "Tower and Receiver", "*", "", ""},
{ SSC_INPUT, SSC_NUMBER, "hl_ffact", "The heat loss factor (thermal loss fudge factor)", "", "", "Tower and Receiver", "*", "", ""},
{ SSC_INPUT, SSC_NUMBER, "f_rec_min", "Minimum receiver mass flow rate turn down fraction", "", "", "Tower and Receiver", "*", "", ""},
{ SSC_INPUT, SSC_NUMBER, "rec_su_delay", "Fixed startup delay time for the receiver", "hr", "", "Tower and Receiver", "*", "", ""},
{ SSC_INPUT, SSC_NUMBER, "rec_qf_delay", "Energy-based receiver startup delay (fraction of rated thermal power)", "", "", "Tower and Receiver", "*", "", ""},
{ SSC_INPUT, SSC_NUMBER, "csp.pt.rec.max_oper_frac", "Maximum receiver mass flow rate fraction", "", "", "Tower and Receiver", "*", "", ""},
{ SSC_INPUT, SSC_NUMBER, "eta_pump", "Receiver HTF pump efficiency", "", "", "Tower and Receiver", "*", "", ""},
{ SSC_INPUT, SSC_NUMBER, "piping_length_mult", "Piping length multiplier", "", "", "Tower and Receiver", "*", "", ""},
{ SSC_INPUT, SSC_NUMBER, "piping_length_const", "Piping constant length", "m", "", "Tower and Receiver", "*", "", ""},
// Cavity inputs that should *not* be reset during call to this cmod
{ SSC_INPUT, SSC_NUMBER, "n_cav_rec_panels", "Cavity receiver number of panels", "", "", "Tower and Receiver", "receiver_type=1", "", "" },
{ SSC_INPUT, SSC_NUMBER, "cav_rec_span", "Cavity receiver span angle", "deg", "", "Tower and Receiver", "receiver_type=1", "", "" },
{ SSC_INPUT, SSC_NUMBER, "cav_rec_passive_abs", "Cavity receiver passive surface solar absorptance", "", "", "Tower and Receiver", "receiver_type=1", "", "" },
{ SSC_INPUT, SSC_NUMBER, "cav_rec_passive_eps", "Cavity receiver passive surface thermal emissivity", "", "", "Tower and Receiver", "receiver_type=1", "", "" },
// New variables replacing deprecated variable "piping_loss". Variable currently not required so exec() can check if assigned and throw a more detailed error
{ SSC_INPUT, SSC_NUMBER, "piping_loss_coefficient", "Thermal loss per meter of piping", "Wt/m2-K", "", "Tower and Receiver", "", "", ""},
{ SSC_INPUT, SSC_NUMBER, "rec_clearsky_model", "Clearsky model: None = -1, User-defined data = 0, Meinel = 1; Hottel = 2; Allen = 3; Moon = 4", "", "", "Tower and Receiver", "?=-1", "", "SIMULATION_PARAMETER"},
{ SSC_INPUT, SSC_ARRAY, "rec_clearsky_dni", "User-defined clear-sky DNI", "W/m2", "", "Tower and Receiver", "rec_clearsky_model=0", "", "SIMULATION_PARAMETER"},
{ SSC_INPUT, SSC_NUMBER, "rec_clearsky_fraction", "Weighting fraction on clear-sky DNI for receiver flow control", "", "", "Tower and Receiver", "?=0.0", "", "SIMULATION_PARAMETER"},
// Transient receiver parameters
{ SSC_INPUT, SSC_NUMBER, "is_rec_model_trans", "Formulate receiver model as transient?", "", "", "Tower and Receiver", "?=0", "", ""},
{ SSC_INPUT, SSC_NUMBER, "is_rec_startup_trans", "Formulate receiver startup model as transient?", "", "", "Tower and Receiver", "?=0", "", ""},
{ SSC_INPUT, SSC_NUMBER, "rec_tm_mult", "Receiver thermal mass multiplier", "", "", "Tower and Receiver", "?=1.0", "", ""},
{ SSC_INPUT, SSC_NUMBER, "riser_tm_mult", "Riser thermal mass multiplier", "", "", "Tower and Receiver", "?=1.0", "", ""},
{ SSC_INPUT, SSC_NUMBER, "downc_tm_mult", "Downcomer thermal mass multiplier", "", "", "Tower and Receiver", "?=1.0", "", ""},
{ SSC_INPUT, SSC_NUMBER, "u_riser", "Design point HTF velocity in riser", "m/s", "", "Tower and Receiver", "?=4.0", "", ""},
{ SSC_INPUT, SSC_NUMBER, "th_riser", "Riser or downcomer tube wall thickness", "mm", "", "Tower and Receiver", "?=15.0", "", ""},
{ SSC_INPUT, SSC_NUMBER, "heat_trace_power", "Riser/downcomer heat trace power during startup", "kW/m", "", "Tower and Receiver", "?=500.0", "", ""},
{ SSC_INPUT, SSC_NUMBER, "preheat_flux", "Tube absorbed solar flux during preheat", "kW/m2", "", "Tower and Receiver", "?=50.0", "", ""},
{ SSC_INPUT, SSC_NUMBER, "min_preheat_time", "Minimum time required in preheat startup stage", "hr", "", "Tower and Receiver", "?=0.0", "", "SIMULATION_PARAMETER"},
{ SSC_INPUT, SSC_NUMBER, "min_fill_time", "Startup time delay for filling the receiver/piping", "hr", "", "Tower and Receiver", "?=0.1333", "", "SIMULATION_PARAMETER"},
{ SSC_INPUT, SSC_NUMBER, "startup_ramp_time", "Time required to reach full flux during receiver startup", "hr", "", "Tower and Receiver", "?=0.1333", "", ""},
{ SSC_INPUT, SSC_NUMBER, "startup_target_Tdiff", "Target HTF T at end of startup - steady state hot HTF temperature", "C", "", "Tower and Receiver", "?=-5.0", "", ""},
{ SSC_INPUT, SSC_NUMBER, "is_rec_startup_from_T_soln", "Begin receiver startup from solved temperature profiles?", "", "", "Tower and Receiver", "?=0", "", ""},
{ SSC_INPUT, SSC_NUMBER, "is_rec_enforce_min_startup", "Always enforce minimum startup time", "", "", "Tower and Receiver", "?=1", "", ""},
// Field layout and tower/receiver dimensions
// If field_model_type = 1, tower/receiver dimensions are used as guess values
// and optimized values are reported as _calc outputs
{ SSC_INPUT, SSC_MATRIX, "helio_positions", "Heliostat position table - in", "", "", "Heliostat Field", "field_model_type=2|field_model_type=3", "", "COL_LABEL=XY_POSITION" },
{ SSC_INPUT, SSC_NUMBER, "rec_height", "Receiver height - in", "m", "", "Tower and Receiver", "*", "", "" },
{ SSC_INPUT, SSC_NUMBER, "D_rec", "The overall outer diameter of the receiver - in", "m", "", "Tower and Receiver", "*", "", "" },
{ SSC_INPUT, SSC_NUMBER, "h_tower", "Tower height - in", "m", "", "Tower and Receiver", "*", "", "" },
{ SSC_INPUT, SSC_NUMBER, "cav_rec_height", "Cavity receiver height - in", "m", "", "Tower and Receiver", "receiver_type=1", "", "" },
{ SSC_INPUT, SSC_NUMBER, "cav_rec_width", "Cavity receiver aperture width - in", "m", "", "Tower and Receiver", "receiver_type=1", "", "" },
// Parallel heater parameters
{ SSC_INPUT, SSC_NUMBER, "heater_mult", "Heater multiple relative to design cycle thermal power", "-", "", "Parallel Heater", "is_parallel_htr=1", "", "SIMULATION_PARAMETER" },
{ SSC_INPUT, SSC_NUMBER, "heater_efficiency", "Heater electric to thermal efficiency", "%", "", "Parallel Heater", "is_parallel_htr=1", "", "SIMULATION_PARAMETER" },
{ SSC_INPUT, SSC_NUMBER, "f_q_dot_des_allowable_su", "Fraction of design power allowed during startup", "-", "", "Parallel Heater", "is_parallel_htr=1", "", "SIMULATION_PARAMETER" },
{ SSC_INPUT, SSC_NUMBER, "hrs_startup_at_max_rate", "Duration of startup at max startup power", "hr", "", "Parallel Heater", "is_parallel_htr=1", "", "SIMULATION_PARAMETER" },
{ SSC_INPUT, SSC_NUMBER, "f_q_dot_heater_min", "Minimum allowable heater output as fraction of design", "", "", "Parallel Heater", "is_parallel_htr=1", "", "SIMULATION_PARAMETER" },
{ SSC_INPUT, SSC_NUMBER, "disp_hsu_cost_rel", "Heater startup cost", "$/MWt/start", "", "System Control", "is_dispatch=1&is_parallel_htr=1", "", "SIMULATION_PARAMETER" },
{ SSC_INPUT, SSC_NUMBER, "heater_spec_cost", "Heater specific cost", "$/kWht", "", "System Costs", "is_parallel_htr=1", "", "SIMULATION_PARAMETER" },
{ SSC_INPUT, SSC_NUMBER, "allow_heater_no_dispatch_opt", "Allow heater with no dispatch optimization? SAM UI relies on cmod default", "", "", "System Costs", "?=0", "", "SIMULATION_PARAMETER" },
// TES parameters - general
{ SSC_INPUT, SSC_NUMBER, "tes_init_hot_htf_percent", "Initial fraction of available volume that is hot", "%", "", "Thermal Storage", "", /*not required because replacing deprecated var and checked in cmod*/ "", ""},
{ SSC_INPUT, SSC_NUMBER, "h_tank", "Total height of tank (height of HTF when tank is full)", "m", "", "Thermal Storage", "*", "", ""},
{ SSC_INPUT, SSC_NUMBER, "cold_tank_max_heat", "Rated heater capacity for cold tank heating", "MW", "", "Thermal Storage", "*", "", ""},
{ SSC_INPUT, SSC_NUMBER, "u_tank", "Loss coefficient from the tank", "W/m2-K", "", "Thermal Storage", "*", "", ""},
{ SSC_INPUT, SSC_NUMBER, "tank_pairs", "Number of equivalent tank pairs", "", "", "Thermal Storage", "*", "INTEGER", ""},
{ SSC_INPUT, SSC_NUMBER, "cold_tank_Thtr", "Minimum allowable cold tank HTF temperature", "C", "", "Thermal Storage", "*", "", ""},
// TES parameters - 2 tank
{ SSC_INPUT, SSC_NUMBER, "h_tank_min", "Minimum allowable HTF height in storage tank", "m", "", "Thermal Storage", "*", "", ""},
{ SSC_INPUT, SSC_NUMBER, "hot_tank_Thtr", "Minimum allowable hot tank HTF temperature", "C", "", "Thermal Storage", "*", "", ""},
{ SSC_INPUT, SSC_NUMBER, "hot_tank_max_heat", "Rated heater capacity for hot tank heating", "MW", "", "Thermal Storage", "*", "", ""},
{ SSC_INPUT, SSC_NUMBER, "tanks_in_parallel", "Tanks are in parallel, not in series, with solar field", "-", "", "Thermal Storage", "*", "", "" },
// Heat Sink
{ SSC_INPUT, SSC_NUMBER, "pb_pump_coef", "Pumping power to move 1kg of HTF through PB loop", "kW/kg", "", "Heat Sink", "*", "", "" },
// Aux and Balance of Plant
{ SSC_INPUT, SSC_NUMBER, "pb_fixed_par", "Fixed parasitic load - runs at all times", "MWe/MWcap", "", "System Control", "*", "", "" },
{ SSC_INPUT, SSC_NUMBER, "aux_par", "Aux heater, boiler parasitic", "MWe/MWcap", "", "System Control", "*", "", "" },
{ SSC_INPUT, SSC_NUMBER, "aux_par_f", "Aux heater, boiler parasitic - multiplying fraction", "", "", "System Control", "*", "", "" },
{ SSC_INPUT, SSC_NUMBER, "aux_par_0", "Aux heater, boiler parasitic - constant coefficient", "", "", "System Control", "*", "", "" },
{ SSC_INPUT, SSC_NUMBER, "aux_par_1", "Aux heater, boiler parasitic - linear coefficient", "", "", "System Control", "*", "", "" },
{ SSC_INPUT, SSC_NUMBER, "aux_par_2", "Aux heater, boiler parasitic - quadratic coefficient", "", "", "System Control", "*", "", "" },
{ SSC_INPUT, SSC_NUMBER, "bop_par", "Balance of plant parasitic power fraction", "MWe/MWcap", "", "System Control", "*", "", "" },
{ SSC_INPUT, SSC_NUMBER, "bop_par_f", "Balance of plant parasitic power fraction - mult frac", "", "", "System Control", "*", "", "" },
{ SSC_INPUT, SSC_NUMBER, "bop_par_0", "Balance of plant parasitic power fraction - const coeff", "", "", "System Control", "*", "", "" },
{ SSC_INPUT, SSC_NUMBER, "bop_par_1", "Balance of plant parasitic power fraction - linear coeff", "", "", "System Control", "*", "", "" },
{ SSC_INPUT, SSC_NUMBER, "bop_par_2", "Balance of plant parasitic power fraction - quadratic coeff", "", "", "System Control", "*", "", "" },
// System Control
{ SSC_INPUT, SSC_NUMBER, "is_timestep_load_fractions", "Use turbine load fraction for each timestep instead of block dispatch?", "", "", "System Control", "?=0", "", "SIMULATION_PARAMETER" },
{ SSC_INPUT, SSC_ARRAY, "timestep_load_fractions", "Turbine load fraction for each timestep, alternative to block dispatch", "", "", "System Control", "?", "", "SIMULATION_PARAMETER" },
{ SSC_INPUT, SSC_ARRAY, "f_turb_tou_periods", "Dispatch logic for turbine load fraction", "", "", "System Control", "*", "", ""},
{ SSC_INPUT, SSC_MATRIX, "weekday_schedule", "12x24 CSP operation Time-of-Use Weekday schedule", "", "", "System Control", "*", "", ""},
{ SSC_INPUT, SSC_MATRIX, "weekend_schedule", "12x24 CSP operation Time-of-Use Weekend schedule", "", "", "System Control", "*", "", ""},
{ SSC_INPUT, SSC_NUMBER, "is_tod_pc_target_also_pc_max", "Is the TOD target cycle heat input also the max cycle heat input?", "", "", "System Control", "?=0", "", ""},
// Receiver control
{ SSC_INPUT, SSC_NUMBER, "q_rec_standby", "Receiver standby energy consumption", "kWt", "", "System Control", "?=9e99", "", "SIMULATION_PARAMETER"},
{ SSC_INPUT, SSC_NUMBER, "q_rec_heattrace", "Receiver heat trace energy consumption during startup", "kWe-hr", "", "System Control", "?=0.0", "", "SIMULATION_PARAMETER"},
// System Control
// Required if dispatch
{ SSC_INPUT, SSC_NUMBER, "disp_rsu_cost_rel", "Receiver startup cost", "$/MWt/start", "", "System Control", "", "", "" },
{ SSC_INPUT, SSC_NUMBER, "disp_horizon", "Time horizon for dispatch optimization", "hour", "", "System Control", "is_dispatch=1", "", "" },
{ SSC_INPUT, SSC_NUMBER, "disp_frequency", "Frequency for dispatch optimization calculations", "hour", "", "System Control", "is_dispatch=1", "", "" },
{ SSC_INPUT, SSC_NUMBER, "disp_max_iter", "Max number of dispatch optimization iterations", "", "", "System Control", "is_dispatch=1", "", "" },
{ SSC_INPUT, SSC_NUMBER, "disp_timeout", "Max dispatch optimization solve duration", "s", "", "System Control", "is_dispatch=1", "", "" },
{ SSC_INPUT, SSC_NUMBER, "disp_mip_gap", "Dispatch optimization solution tolerance", "", "", "System Control", "is_dispatch=1", "", "" },
{ SSC_INPUT, SSC_NUMBER, "disp_time_weighting", "Dispatch optimization future time discounting factor", "", "", "System Control", "is_dispatch=1", "", "" },
// Optional for custom scripting
{ SSC_INPUT, SSC_NUMBER, "disp_steps_per_hour", "Time steps per hour for dispatch optimization calculations", "", "", "System Control", "?=1", "", "SIMULATION_PARAMETER" },
{ SSC_INPUT, SSC_NUMBER, "disp_spec_presolve", "Dispatch optimization presolve heuristic", "", "", "System Control", "?=-1", "", "SIMULATION_PARAMETER" },
{ SSC_INPUT, SSC_NUMBER, "disp_spec_bb", "Dispatch optimization B&B heuristic", "", "", "System Control", "?=-1", "", "SIMULATION_PARAMETER" },
{ SSC_INPUT, SSC_NUMBER, "disp_spec_scaling", "Dispatch optimization scaling heuristic", "", "", "System Control", "?=-1", "", "SIMULATION_PARAMETER" },
{ SSC_INPUT, SSC_NUMBER, "disp_reporting", "Dispatch optimization reporting level", "", "", "System Control", "?=-1", "", "SIMULATION_PARAMETER" },
{ SSC_INPUT, SSC_NUMBER, "is_write_ampl_dat", "Write AMPL data files for dispatch run", "", "", "System Control", "?=0", "", "SIMULATION_PARAMETER" },
{ SSC_INPUT, SSC_NUMBER, "is_ampl_engine", "Run dispatch optimization with external AMPL engine", "", "", "System Control", "?=0", "", "SIMULATION_PARAMETER" },
{ SSC_INPUT, SSC_STRING, "ampl_data_dir", "AMPL data file directory", "", "", "System Control", "?=''", "", "SIMULATION_PARAMETER" },
{ SSC_INPUT, SSC_STRING, "ampl_exec_call", "System command to run AMPL code", "", "", "System Control", "?='ampl sdk_solution.run'", "", "SIMULATION_PARAMETER" },
{ SSC_INPUT, SSC_NUMBER, "disp_inventory_incentive", "Dispatch storage terminal inventory incentive multiplier", "", "", "System Control", "?=0.0", "", "SIMULATION_PARAMETER" },
// Pricing schedules (copied from electricity - eventually need to resolve electricity vs. heat)
{ SSC_INPUT, SSC_NUMBER, "ppa_multiplier_model", "PPA multiplier model 0: dispatch factors dispatch_factorX, 1: hourly multipliers dispatch_factors_ts", "0/1", "0=diurnal,1=timestep", "Time of Delivery Factors", "?=0", /*need a default so this var works in required_if*/ "INTEGER,MIN=0", "SIMULATION_PARAMETER" },
{ SSC_INPUT, SSC_NUMBER, "ppa_soln_mode", "PPA solution mode (0=Specify IRR target, 1=Specify PPA price)", "", "", "Financial Solution Mode", "ppa_multiplier_model=0&csp_financial_model<5&is_dispatch=1&sim_type=1", "", "SIMULATION_PARAMETER" },
{ SSC_INPUT, SSC_ARRAY, "dispatch_factors_ts", "Dispatch payment factor array", "", "", "Time of Delivery Factors", "ppa_multiplier_model=1&csp_financial_model<5&is_dispatch=1&sim_type=1", "", "SIMULATION_PARAMETER" },
{ SSC_INPUT, SSC_MATRIX, "dispatch_sched_weekday", "PPA pricing weekday schedule, 12x24", "", "", "Time of Delivery Factors", "ppa_multiplier_model=0&csp_financial_model<5&is_dispatch=1&sim_type=1", "", "SIMULATION_PARAMETER" },
{ SSC_INPUT, SSC_MATRIX, "dispatch_sched_weekend", "PPA pricing weekend schedule, 12x24", "", "", "Time of Delivery Factors", "ppa_multiplier_model=0&csp_financial_model<5&is_dispatch=1&sim_type=1", "", "SIMULATION_PARAMETER" },
{ SSC_INPUT, SSC_ARRAY, "dispatch_tod_factors", "TOD factors for periods 1 through 9", "", "", "Time of Delivery Factors", "ppa_multiplier_model=0&csp_financial_model<5&is_dispatch=1&sim_type=1", "", "SIMULATION_PARAMETER" },
{ SSC_INPUT, SSC_ARRAY, "ppa_price_input", "PPA prices - yearly", "$/kWh", "", "Revenue", "ppa_multiplier_model=0&csp_financial_model<5&is_dispatch=1&sim_type=1", "", "SIMULATION_PARAMETER" },
// Costs
{ SSC_INPUT, SSC_NUMBER, "tower_fixed_cost", "Tower fixed cost", "$", "", "System Costs", "*", "", "" },
{ SSC_INPUT, SSC_NUMBER, "tower_exp", "Tower cost scaling exponent", "", "", "System Costs", "*", "", "" },
{ SSC_INPUT, SSC_NUMBER, "rec_ref_cost", "Receiver reference cost", "$", "", "System Costs", "*", "", "" },
{ SSC_INPUT, SSC_NUMBER, "rec_ref_area", "Receiver reference area for cost scale", "", "", "System Costs", "*", "", "" },
{ SSC_INPUT, SSC_NUMBER, "rec_cost_exp", "Receiver cost scaling exponent", "", "", "System Costs", "*", "", "" },
{ SSC_INPUT, SSC_NUMBER, "site_spec_cost", "Site improvement cost", "$/m2", "", "System Costs", "*", "", "" },
{ SSC_INPUT, SSC_NUMBER, "heliostat_spec_cost", "Heliostat field cost", "$/m2", "", "System Costs", "*", "", "" },
//{ SSC_INPUT, SSC_NUMBER, "plant_spec_cost", "Power cycle specific cost", "$/kWe", "", "System Costs", "*", "", "" },
{ SSC_INPUT, SSC_NUMBER, "bop_spec_cost", "BOS specific cost", "$/kWe", "", "System Costs", "*", "", "" },
{ SSC_INPUT, SSC_NUMBER, "tes_spec_cost", "Thermal energy storage cost", "$/kWht", "", "System Costs", "*", "", "" },
{ SSC_INPUT, SSC_NUMBER, "land_spec_cost", "Total land area cost", "$/acre", "", "System Costs", "*", "", "" },
{ SSC_INPUT, SSC_NUMBER, "contingency_rate", "Contingency for cost overrun", "%", "", "System Costs", "*", "", "" },
{ SSC_INPUT, SSC_NUMBER, "sales_tax_rate", "Sales tax rate", "%", "", "Financial Parameters", "*", "", "" },
{ SSC_INPUT, SSC_NUMBER, "sales_tax_frac", "Percent of cost to which sales tax applies", "%", "", "System Costs", "*", "", "" },
{ SSC_INPUT, SSC_NUMBER, "cost_sf_fixed", "Solar field fixed cost", "$", "", "System Costs", "*", "", "" },
//{ SSC_INPUT, SSC_NUMBER, "fossil_spec_cost", "Fossil system specific cost", "$/kWe", "", "System Costs", "*", "", "" },
{ SSC_INPUT, SSC_NUMBER, "csp.pt.cost.epc.per_acre", "EPC cost per acre", "$/acre", "", "System Costs", "*", "", "" },
{ SSC_INPUT, SSC_NUMBER, "csp.pt.cost.epc.percent", "EPC cost percent of direct", "%", "", "System Costs", "*", "", "" },
{ SSC_INPUT, SSC_NUMBER, "csp.pt.cost.epc.per_watt", "EPC cost per watt", "$/W", "", "System Costs", "*", "", "" },
{ SSC_INPUT, SSC_NUMBER, "csp.pt.cost.epc.fixed", "EPC fixed", "$", "", "System Costs", "*", "", "" },
{ SSC_INPUT, SSC_NUMBER, "csp.pt.cost.plm.percent", "PLM cost percent of direct", "%", "", "System Costs", "*", "", "" },
{ SSC_INPUT, SSC_NUMBER, "csp.pt.cost.plm.per_watt", "PLM cost per watt", "$/W", "", "System Costs", "*", "", "" },
{ SSC_INPUT, SSC_NUMBER, "csp.pt.cost.plm.fixed", "PLM fixed", "$", "", "System Costs", "*", "", "" },
{ SSC_INPUT, SSC_NUMBER, "csp.pt.sf.fixed_land_area", "Fixed land area", "acre", "", "Heliostat Field", "*", "", "" },
{ SSC_INPUT, SSC_NUMBER, "csp.pt.sf.land_overhead_factor", "Land overhead factor", "", "", "Heliostat Field", "*", "", "" },
// Construction financing inputs/outputs (SSC variable table from cmod_cb_construction_financing)
{ SSC_INPUT, SSC_NUMBER, "const_per_interest_rate1", "Interest rate, loan 1", "%", "", "Financial Parameters", "*", "", ""},
{ SSC_INPUT, SSC_NUMBER, "const_per_interest_rate2", "Interest rate, loan 2", "%", "", "Financial Parameters", "*", "", ""},
{ SSC_INPUT, SSC_NUMBER, "const_per_interest_rate3", "Interest rate, loan 3", "%", "", "Financial Parameters", "*", "", ""},
{ SSC_INPUT, SSC_NUMBER, "const_per_interest_rate4", "Interest rate, loan 4", "%", "", "Financial Parameters", "*", "", ""},
{ SSC_INPUT, SSC_NUMBER, "const_per_interest_rate5", "Interest rate, loan 5", "%", "", "Financial Parameters", "*", "", ""},
{ SSC_INPUT, SSC_NUMBER, "const_per_months1", "Months prior to operation, loan 1", "", "", "Financial Parameters", "*", "", ""},
{ SSC_INPUT, SSC_NUMBER, "const_per_months2", "Months prior to operation, loan 2", "", "", "Financial Parameters", "*", "", ""},
{ SSC_INPUT, SSC_NUMBER, "const_per_months3", "Months prior to operation, loan 3", "", "", "Financial Parameters", "*", "", ""},
{ SSC_INPUT, SSC_NUMBER, "const_per_months4", "Months prior to operation, loan 4", "", "", "Financial Parameters", "*", "", ""},
{ SSC_INPUT, SSC_NUMBER, "const_per_months5", "Months prior to operation, loan 5", "", "", "Financial Parameters", "*", "", ""},
{ SSC_INPUT, SSC_NUMBER, "const_per_percent1", "Percent of total installed cost, loan 1", "%", "", "Financial Parameters", "*", "", ""},
{ SSC_INPUT, SSC_NUMBER, "const_per_percent2", "Percent of total installed cost, loan 2", "%", "", "Financial Parameters", "*", "", ""},
{ SSC_INPUT, SSC_NUMBER, "const_per_percent3", "Percent of total installed cost, loan 3", "%", "", "Financial Parameters", "*", "", ""},
{ SSC_INPUT, SSC_NUMBER, "const_per_percent4", "Percent of total installed cost, loan 4", "%", "", "Financial Parameters", "*", "", ""},
{ SSC_INPUT, SSC_NUMBER, "const_per_percent5", "Percent of total installed cost, loan 5", "%", "", "Financial Parameters", "*", "", ""},
{ SSC_INPUT, SSC_NUMBER, "const_per_upfront_rate1", "Upfront fee on principal, loan 1", "%", "", "Financial Parameters", "*", "", ""},
{ SSC_INPUT, SSC_NUMBER, "const_per_upfront_rate2", "Upfront fee on principal, loan 2", "%", "", "Financial Parameters", "*", "", ""},
{ SSC_INPUT, SSC_NUMBER, "const_per_upfront_rate3", "Upfront fee on principal, loan 3", "%", "", "Financial Parameters", "*", "", ""},
{ SSC_INPUT, SSC_NUMBER, "const_per_upfront_rate4", "Upfront fee on principal, loan 4", "%", "", "Financial Parameters", "*", "", ""},
{ SSC_INPUT, SSC_NUMBER, "const_per_upfront_rate5", "Upfront fee on principal, loan 5", "%", "", "Financial Parameters", "*", "", ""},
// ****************************************************************************************************************************************
// DEPRECATED INPUTS -- exec() checks if a) variable is assigned and b) if replacement variable is assigned. throws exception if a=true and b=false
// ****************************************************************************************************************************************
{ SSC_INPUT, SSC_NUMBER, "piping_loss", "Thermal loss per meter of piping", "Wt/m", "", "Deprecated", "", "", "SIMULATION_PARAMETER" },
{ SSC_INPUT, SSC_NUMBER, "disp_csu_cost", "Cycle startup cost", "$", "", "Deprecated", "", "", "SIMULATION_PARAMETER" },
{ SSC_INPUT, SSC_NUMBER, "disp_rsu_cost", "Receiver startup cost", "$", "", "Deprecated", "", "", "SIMULATION_PARAMETER" },
{ SSC_INPUT, SSC_NUMBER, "disp_pen_delta_w", "Dispatch cycle production change penalty", "$/kWe-change", "", "Deprecated", "", "", "SIMULATION_PARAMETER" },
{ SSC_INPUT, SSC_NUMBER, "P_boil", "Boiler operating pressure", "bar", "", "Deprecated", "", "", "SIMULATION_PARAMETER" },
{ SSC_INPUT, SSC_NUMBER, "csp.pt.tes.init_hot_htf_percent", "Initial fraction of available volume that is hot", "%", "", "Deprecated", "", "", "SIMULATION_PARAMETER" },
// ****************************************************************************************************************************************
// Design Outputs here:
// ****************************************************************************************************************************************
// land area with variable name required by downstream financial model
{ SSC_OUTPUT, SSC_NUMBER, "total_land_area", "Total land area", "acre", "", "System Costs", "*", "", "" },
// System capacity required by downstream financial model
{ SSC_OUTPUT, SSC_NUMBER, "system_capacity", "System capacity", "kWt", "", "System Costs", "*", "", "" },
{ SSC_OUTPUT, SSC_NUMBER, "cp_system_nameplate", "System capacity for capacity payments", "MWt", "", "System Costs", "*", "", "" },
{ SSC_OUTPUT, SSC_NUMBER, "cp_battery_nameplate", "Battery nameplate", "MWe", "", "System Costs", "*", "", "" },
// Solar Field
{ SSC_OUTPUT, SSC_NUMBER, "N_hel_calc", "Number of heliostats - out", "", "", "Heliostat Field", "*", "", "" },
{ SSC_OUTPUT, SSC_NUMBER, "refl_image_error", "Reflected image error", "mrad", "", "Heliostat Field", "*", "", "" },
{ SSC_OUTPUT, SSC_NUMBER, "heliostat_area", "Active area of heliostat", "m^2", "", "Heliostat Field", "*", "", "" },
{ SSC_OUTPUT, SSC_NUMBER, "average_attenuation", "Average solar field attenuation", "%", "", "Heliostat Field", "*", "", "" },
{ SSC_OUTPUT, SSC_MATRIX, "helio_positions_calc", "Heliostat position table - out", "", "", "Heliostat Field", "*", "", "COL_LABEL=XY_POSITION" },
{ SSC_OUTPUT, SSC_NUMBER, "A_sf", "Solar field area", "m^2", "", "Heliostat Field", "*", "", "" },
{ SSC_OUTPUT, SSC_NUMBER, "land_min_abs", "Min distance from tower to heliostat", "m", "", "Heliostat Field", "*", "", "" },
{ SSC_OUTPUT, SSC_NUMBER, "land_max_abs", "Max distance from tower to heliostat", "m", "", "Heliostat Field", "*", "", "" },
{ SSC_OUTPUT, SSC_NUMBER, "land_area_base_calc", "Land area occupied by heliostats", "acre", "", "Heliostat Field", "*", "", "" },
{ SSC_OUTPUT, SSC_NUMBER, "total_land_area_before_rad_cooling_calc", "Total land area not including radiative cooling - out", "acre", "", "Heliostat Field", "*", "", "" },
{ SSC_OUTPUT, SSC_NUMBER, "W_dot_col_tracking_des", "Collector tracking power at design", "MWe", "", "Heliostat Field", "*", "", "" },
// Receiver Geometry
{ SSC_OUTPUT, SSC_NUMBER, "rec_height_calc", "Receiver height - out", "m", "", "Tower and Receiver", "*", "", "" },
{ SSC_OUTPUT, SSC_NUMBER, "D_rec_calc", "The overall outer diameter of the receiver - out", "m", "", "Tower and Receiver", "*", "", "" },
{ SSC_OUTPUT, SSC_NUMBER, "h_tower_calc", "Tower height - out", "m", "", "Tower and Receiver", "*", "", "" },
{ SSC_OUTPUT, SSC_NUMBER, "ext_rec_area", "External receiver area - out", "m2", "", "Tower and Receiver", "*", "", "" },
{ SSC_OUTPUT, SSC_NUMBER, "ext_rec_aspect", "External receiver aspect ratio - out", "", "", "Tower and Receiver", "*", "", "" },
{ SSC_OUTPUT, SSC_NUMBER, "cav_rec_height_calc", "Cavity receiver height - out", "m", "", "Tower and Receiver", "*", "", "" },
{ SSC_OUTPUT, SSC_NUMBER, "cav_rec_width_calc", "Cavity receiver aperture width - out", "m", "", "Tower and Receiver", "*", "", "" },
{ SSC_OUTPUT, SSC_NUMBER, "cav_rec_area", "Cavity receiver area", "m2", "", "Tower and Receiver", "*", "", "" },
{ SSC_OUTPUT, SSC_NUMBER, "cav_panel_width", "Cavity panel width", "m", "", "Tower and Receiver", "*", "", "" },
{ SSC_OUTPUT, SSC_NUMBER, "cav_radius", "Cavity radius", "m", "", "Tower and Receiver", "*", "", "" },
{ SSC_OUTPUT, SSC_NUMBER, "A_rec", "Receiver area - planar", "m2", "", "Tower and Receiver", "*", "", "" },
{ SSC_OUTPUT, SSC_NUMBER, "L_tower_piping_calc", "Tower piping length", "m", "", "Tower and Receiver", "*", "", "" },
{ SSC_OUTPUT, SSC_NUMBER, "od_tube_calc", "Receiver tube outer diameter - out", "mm", "", "Tower and Receiver", "*", "", "" },
// Receiver Performance
{ SSC_OUTPUT, SSC_NUMBER, "q_dot_rec_des", "Receiver thermal output at design", "MWt", "", "Tower and Receiver", "*", "", "" },
{ SSC_OUTPUT, SSC_NUMBER, "eta_rec_thermal_des", "Receiver estimated thermal efficiency at design", "", "", "Tower and Receiver", "*", "", "" },
{ SSC_OUTPUT, SSC_NUMBER, "W_dot_rec_pump_des", "Receiver estimated pump power at design", "MWe", "", "Tower and Receiver", "*", "", "" },
{ SSC_OUTPUT, SSC_NUMBER, "W_dot_rec_pump_tower_share_des", "Receiver estimated pump power due to tower height at design", "MWe", "", "Tower and Receiver", "*", "", "" },
{ SSC_OUTPUT, SSC_NUMBER, "W_dot_rec_pump_rec_share_des", "Receiver estimated pump power due to rec tubes at design", "MWe", "", "Tower and Receiver", "*", "", "" },
{ SSC_OUTPUT, SSC_NUMBER, "vel_rec_htf_des", "Receiver estimated tube HTF velocity at design", "m/s", "", "Tower and Receiver", "*", "", "" },
{ SSC_OUTPUT, SSC_NUMBER, "m_dot_htf_rec_des", "Receiver HTF mass flow rate at design", "kg/s", "", "Tower and Receiver", "*", "", "" },
{ SSC_OUTPUT, SSC_NUMBER, "m_dot_htf_rec_max", "Receiver max HTF mass flow rate", "kg/s", "", "Tower and Receiver", "*", "", "" },
{ SSC_OUTPUT, SSC_NUMBER, "q_dot_piping_loss_des", "Receiver estimated piping loss at design", "MWt", "", "Tower and Receiver", "*", "", "" },
// Heater
{ SSC_OUTPUT, SSC_NUMBER, "q_dot_heater_des", "Heater design thermal power", "MWt", "", "Heater", "*", "", "" },
{ SSC_OUTPUT, SSC_NUMBER, "W_dot_heater_des", "Heater electricity consumption at design", "MWe", "", "Heater", "*", "", "" },
{ SSC_OUTPUT, SSC_NUMBER, "E_heater_su_des", "Heater startup energy", "MWt-hr", "", "Heater", "*", "", "" },
// Power Cycle
//{ SSC_OUTPUT, SSC_NUMBER, "m_dot_htf_cycle_des", "PC HTF mass flow rate at design", "kg/s", "", "Power Cycle", "*", "", "" },
//{ SSC_OUTPUT, SSC_NUMBER, "q_dot_cycle_des", "PC thermal input at design", "MWt", "", "Power Cycle", "*", "", "" },
//{ SSC_OUTPUT, SSC_NUMBER, "W_dot_cycle_pump_des", "PC HTF pump power at design", "MWe", "", "Power Cycle", "*", "", "" },
//{ SSC_OUTPUT, SSC_NUMBER, "W_dot_cycle_cooling_des", "PC cooling power at design", "MWe", "", "Power Cycle", "*", "", "" },
// TES
{ SSC_OUTPUT, SSC_NUMBER, "Q_tes_des", "TES design capacity", "MWt-hr", "", "TES Design Calc", "*", "", "" },
{ SSC_OUTPUT, SSC_NUMBER, "V_tes_htf_avail_des", "TES volume of HTF available for heat transfer", "m3", "", "TES Design Calc", "*", "", "" },
{ SSC_OUTPUT, SSC_NUMBER, "V_tes_htf_total_des", "TES total HTF volume", "m3", "", "TES Design Calc", "*", "", "" },
{ SSC_OUTPUT, SSC_NUMBER, "d_tank_tes", "TES tank diameter", "m", "", "TES Design Calc", "*", "", "" },
{ SSC_OUTPUT, SSC_NUMBER, "q_dot_loss_tes_des", "TES thermal loss at design", "MWt", "", "TES Design Calc", "*", "", "" },
{ SSC_OUTPUT, SSC_NUMBER, "tshours_rec", "TES duration at receiver design output", "hr", "", "TES Design Calc", "*", "", "" },
{ SSC_OUTPUT, SSC_NUMBER, "tshours_heater", "TES duration at heater design output", "hr", "", "TES Design Calc", "*", "", "" },
{ SSC_OUTPUT, SSC_NUMBER, "dens_store_htf_at_T_ave", "TES density of HTF at avg temps", "kg/m3", "", "TES Design Calc", "*", "", "" },
// Balance of Plant
{ SSC_OUTPUT, SSC_NUMBER, "nameplate", "Nameplate capacity", "MWt", "", "System Design Calc", "*", "", "" },
{ SSC_OUTPUT, SSC_NUMBER, "W_dot_bop_design", "BOP parasitics at design", "MWe", "", "Balance of Plant", "*", "", "" },
{ SSC_OUTPUT, SSC_NUMBER, "W_dot_fixed", "Fixed parasitic at design", "MWe", "", "Balance of Plant", "*", "", "" },
// Costs
{ SSC_OUTPUT, SSC_NUMBER, "h_rec_input_to_cost_model", "Receiver height for cost model selected from receiver type", "m", "", "System Costs", "*", "", "" },
{ SSC_OUTPUT, SSC_NUMBER, "csp.pt.cost.site_improvements", "Site improvement cost", "$", "", "System Costs", "*", "", "" },
{ SSC_OUTPUT, SSC_NUMBER, "csp.pt.cost.heliostats", "Heliostat cost", "$", "", "System Costs", "*", "", "" },
{ SSC_OUTPUT, SSC_NUMBER, "csp.pt.cost.tower", "Tower cost", "$", "", "System Costs", "*", "", "" },
{ SSC_OUTPUT, SSC_NUMBER, "csp.pt.cost.receiver", "Receiver cost", "$", "", "System Costs", "*", "", "" },
{ SSC_OUTPUT, SSC_NUMBER, "csp.pt.cost.storage", "TES cost", "$", "", "System Costs", "*", "", "" },
{ SSC_OUTPUT, SSC_NUMBER, "csp.pt.cost.power_block", "Power cycle cost", "$", "", "System Costs", "*", "", "" },
{ SSC_OUTPUT, SSC_NUMBER, "heater_cost", "Heater cost", "$", "", "System Costs", "*", "", "" },
{ SSC_OUTPUT, SSC_NUMBER, "csp.pt.cost.bop", "BOP cost", "$", "", "System Costs", "*", "", "" },
{ SSC_OUTPUT, SSC_NUMBER, "csp.pt.cost.fossil", "Fossil backup cost", "$", "", "System Costs", "*", "", "" },
{ SSC_OUTPUT, SSC_NUMBER, "ui_direct_subtotal", "Direct capital precontingency cost", "$", "", "System Costs", "*", "", "" },
{ SSC_OUTPUT, SSC_NUMBER, "csp.pt.cost.contingency", "Contingency cost", "$", "", "System Costs", "*", "", "" },
{ SSC_OUTPUT, SSC_NUMBER, "total_direct_cost", "Total direct cost", "$", "", "System Costs", "*", "", "" },
{ SSC_OUTPUT, SSC_NUMBER, "csp.pt.cost.epc.total", "EPC and owner cost", "$", "", "System Costs", "*", "", "" },
{ SSC_OUTPUT, SSC_NUMBER, "csp.pt.cost.plm.total", "Total land cost", "$", "", "System Costs", "*", "", "" },
{ SSC_OUTPUT, SSC_NUMBER, "csp.pt.cost.sales_tax.total", "Sales tax cost", "$", "", "System Costs", "*", "", "" },
{ SSC_OUTPUT, SSC_NUMBER, "total_indirect_cost", "Total indirect cost", "$", "", "System Costs", "*", "", "" },
{ SSC_OUTPUT, SSC_NUMBER, "total_installed_cost", "Total installed cost", "$", "", "System Costs", "*", "", "" },
{ SSC_OUTPUT, SSC_NUMBER, "csp.pt.cost.installed_per_capacity", "Estimated installed cost per cap", "$", "", "System Costs", "*", "", "" },
// Financing
{ SSC_OUTPUT, SSC_NUMBER, "const_per_principal1", "Principal, loan 1", "$", "", "Financial Parameters", "*", "", "" },
{ SSC_OUTPUT, SSC_NUMBER, "const_per_principal2", "Principal, loan 2", "$", "", "Financial Parameters", "*", "", "" },
{ SSC_OUTPUT, SSC_NUMBER, "const_per_principal3", "Principal, loan 3", "$", "", "Financial Parameters", "*", "", "" },
{ SSC_OUTPUT, SSC_NUMBER, "const_per_principal4", "Principal, loan 4", "$", "", "Financial Parameters", "*", "", "" },
{ SSC_OUTPUT, SSC_NUMBER, "const_per_principal5", "Principal, loan 5", "$", "", "Financial Parameters", "*", "", "" },
{ SSC_OUTPUT, SSC_NUMBER, "const_per_interest1", "Interest cost, loan 1", "$", "", "Financial Parameters", "*", "", "" },
{ SSC_OUTPUT, SSC_NUMBER, "const_per_interest2", "Interest cost, loan 2", "$", "", "Financial Parameters", "*", "", "" },
{ SSC_OUTPUT, SSC_NUMBER, "const_per_interest3", "Interest cost, loan 3", "$", "", "Financial Parameters", "*", "", "" },
{ SSC_OUTPUT, SSC_NUMBER, "const_per_interest4", "Interest cost, loan 4", "$", "", "Financial Parameters", "*", "", "" },
{ SSC_OUTPUT, SSC_NUMBER, "const_per_interest5", "Interest cost, loan 5", "$", "", "Financial Parameters", "*", "", "" },
{ SSC_OUTPUT, SSC_NUMBER, "const_per_total1", "Total financing cost, loan 1", "$", "", "Financial Parameters", "*", "", "" },
{ SSC_OUTPUT, SSC_NUMBER, "const_per_total2", "Total financing cost, loan 2", "$", "", "Financial Parameters", "*", "", "" },
{ SSC_OUTPUT, SSC_NUMBER, "const_per_total3", "Total financing cost, loan 3", "$", "", "Financial Parameters", "*", "", "" },
{ SSC_OUTPUT, SSC_NUMBER, "const_per_total4", "Total financing cost, loan 4", "$", "", "Financial Parameters", "*", "", "" },
{ SSC_OUTPUT, SSC_NUMBER, "const_per_total5", "Total financing cost, loan 5", "$", "", "Financial Parameters", "*", "", "" },
{ SSC_OUTPUT, SSC_NUMBER, "const_per_percent_total", "Total percent of installed costs, all loans", "%", "", "Financial Parameters", "*", "", "" },
{ SSC_OUTPUT, SSC_NUMBER, "const_per_principal_total", "Total principal, all loans", "$", "", "Financial Parameters", "*", "", "" },
{ SSC_OUTPUT, SSC_NUMBER, "const_per_interest_total", "Total interest costs, all loans", "$", "", "Financial Parameters", "*", "", "" },
{ SSC_OUTPUT, SSC_NUMBER, "construction_financing_cost", "Total construction financing cost", "$", "", "Financial Parameters", "*", "", "" },
// ****************************************************************************************************************************************
// Timeseries Simulation Outputs here:
// ****************************************************************************************************************************************
// Simulation outputs
{ SSC_OUTPUT, SSC_ARRAY, "time_hr", "Time at end of timestep", "hr", "", "", "sim_type=1", "", ""},
{ SSC_OUTPUT, SSC_ARRAY, "solzen", "Resource solar zenith", "deg", "", "", "sim_type=1", "", ""},
{ SSC_OUTPUT, SSC_ARRAY, "solaz", "Resource solar azimuth", "deg", "", "", "sim_type=1", "", ""},
{ SSC_OUTPUT, SSC_ARRAY, "beam", "Resource beam normal irradiance", "W/m2", "", "", "sim_type=1", "", ""},
{ SSC_OUTPUT, SSC_ARRAY, "tdry", "Resource dry Bulb temperature", "C", "", "", "sim_type=1", "", ""},
{ SSC_OUTPUT, SSC_ARRAY, "twet", "Resource wet Bulb temperature", "C", "", "", "sim_type=1", "", ""},
{ SSC_OUTPUT, SSC_ARRAY, "rh", "Resource relative humidity", "%", "", "", "sim_type=1", "", ""},
{ SSC_OUTPUT, SSC_ARRAY, "wspd", "Resource wind velocity", "m/s", "", "", "sim_type=1", "", ""},
// Collector-receiver outputs
{ SSC_OUTPUT, SSC_MATRIX, "eta_map_out", "Solar field optical efficiencies", "", "", "", "sim_type=1", "", "COL_LABEL=OPTICAL_EFFICIENCY,ROW_LABEL=NO_ROW_LABEL"},
{ SSC_OUTPUT, SSC_MATRIX, "flux_maps_for_import", "Flux map for import", "", "", "", "sim_type=1", "", "COL_LABEL=FLUX_MAPS,ROW_LABEL=NO_ROW_LABEL" },
{ SSC_OUTPUT, SSC_MATRIX, "flux_maps_out", "Flux map intensities", "", "", "", "sim_type=1", "", "COL_LABEL=FLUX_MAPS,ROW_LABEL=NO_ROW_LABEL"},
{ SSC_OUTPUT, SSC_ARRAY, "q_sf_inc", "Field incident thermal power", "MWt", "", "", "sim_type=1", "", ""},
{ SSC_OUTPUT, SSC_ARRAY, "eta_field", "Field optical efficiency", "", "", "", "sim_type=1", "", ""},
{ SSC_OUTPUT, SSC_ARRAY, "defocus", "Field optical focus fraction", "", "", "", "sim_type=1", "", ""},
{ SSC_OUTPUT, SSC_ARRAY, "sf_adjust_out", "Field availability adjustment factor", "", "", "", "sim_type=1", "", ""},
{ SSC_OUTPUT, SSC_ARRAY, "rec_defocus", "Receiver component defocus", "", "", "", "sim_type=1", "", ""},
{ SSC_OUTPUT, SSC_ARRAY, "q_dot_rec_inc", "Receiver incident thermal power", "MWt", "", "", "sim_type=1", "", ""},
{ SSC_OUTPUT, SSC_ARRAY, "eta_therm", "Receiver thermal efficiency", "", "", "", "sim_type=1", "", ""},
{ SSC_OUTPUT, SSC_ARRAY, "Q_thermal", "Receiver thermal power to HTF less piping loss", "MWt", "", "", "sim_type=1", "", ""},
{ SSC_OUTPUT, SSC_ARRAY, "pparasi", "Field tracking power", "MWe", "", "", "sim_type=1", "", "" },
{ SSC_OUTPUT, SSC_ARRAY, "m_dot_rec", "Receiver mass flow rate", "kg/s", "", "", "sim_type=1", "", ""},
{ SSC_OUTPUT, SSC_ARRAY, "q_startup", "Receiver startup thermal energy consumed", "MWt", "", "", "sim_type=1", "", ""},
{ SSC_OUTPUT, SSC_ARRAY, "T_rec_in", "Receiver HTF inlet temperature", "C", "", "", "sim_type=1", "", ""},
{ SSC_OUTPUT, SSC_ARRAY, "T_rec_out", "Receiver HTF outlet temperature", "C", "", "", "sim_type=1", "", ""},
{ SSC_OUTPUT, SSC_ARRAY, "q_piping_losses", "Receiver header/tower piping losses", "MWt", "", "", "sim_type=1", "", ""},
{ SSC_OUTPUT, SSC_ARRAY, "q_thermal_loss", "Receiver convection and emission losses", "MWt", "", "", "sim_type=1", "", "" },
{ SSC_OUTPUT, SSC_ARRAY, "q_dot_reflection_loss", "Receiver reflection losses", "MWt", "", "", "sim_type=1&receiver_type=1", "", ""},
{ SSC_OUTPUT, SSC_ARRAY, "P_tower_pump", "Receiver and tower HTF pumping power", "MWe", "", "", "sim_type=1", "", "" },
{ SSC_OUTPUT, SSC_ARRAY, "T_rec_out_end", "Receiver HTF outlet temperature at end of timestep", "C", "", "CR", "sim_type=1&is_rec_model_trans=1", "", ""},
{ SSC_OUTPUT, SSC_ARRAY, "T_rec_out_max", "Receiver maximum HTF outlet temperature during timestep", "C", "", "CR", "sim_type=1&is_rec_model_trans=1", "", ""},
{ SSC_OUTPUT, SSC_ARRAY, "T_panel_out_max", "Receiver panel maximum HTF outlet temperature during timestep", "C", "", "CR", "sim_type=1&is_rec_model_trans=1", "", ""},
{ SSC_OUTPUT, SSC_ARRAY, "T_wall_rec_inlet", "Receiver inlet panel wall temperature at end of timestep", "C", "", "CR", "sim_type=1&is_rec_model_trans=1", "", ""},
{ SSC_OUTPUT, SSC_ARRAY, "T_wall_rec_outlet", "Receiver outlet panel wall temperature at end of timestep", "C", "", "CR", "sim_type=1&is_rec_model_trans=1", "", ""},
{ SSC_OUTPUT, SSC_ARRAY, "T_wall_riser", "Receiver riser wall temperature at end of timestep", "C", "", "CR", "sim_type=1&is_rec_model_trans=1", "", ""},
{ SSC_OUTPUT, SSC_ARRAY, "T_wall_downcomer", "Receiver downcomer wall temperature at end of timestep", "C", "", "CR", "sim_type=1&is_rec_model_trans=1", "", ""},
{ SSC_OUTPUT, SSC_ARRAY, "clearsky", "Predicted clear-sky beam normal irradiance", "W/m2", "", "CR", "sim_type=1&rec_clearsky_fraction>0", "", "" },
{ SSC_OUTPUT, SSC_ARRAY, "Q_thermal_ss", "Receiver thermal power to HTF less piping loss (steady state)", "MWt", "", "CR", "sim_type=1&is_rec_model_trans=1", "", "" },
{ SSC_OUTPUT, SSC_ARRAY, "Q_thermal_ss_csky", "Receiver thermal power to HTF less piping loss under clear-sky conditions (steady state)", "MWt", "", "CR", "sim_type=1&rec_clearsky_fraction>0", "", "" },
// Heater outputs is_parallel_htr
{ SSC_OUTPUT, SSC_ARRAY, "W_dot_heater", "Parallel heater electricity consumption", "MWe", "", "Parallel Heater", "sim_type=1&is_parallel_htr=1", "", "" },
{ SSC_OUTPUT, SSC_ARRAY, "q_dot_heater_to_htf", "Parallel heater thermal power to HTF", "MWt", "", "Parallel Heater", "sim_type=1&is_parallel_htr=1", "", "" },
{ SSC_OUTPUT, SSC_ARRAY, "q_dot_heater_startup", "Parallel heater thermal power consumed during startup", "MWt", "", "Parallel Heater", "sim_type=1&is_parallel_htr=1", "", "" },
{ SSC_OUTPUT, SSC_ARRAY, "m_dot_htf_heater", "Parallel heater HTF mass flow rate", "kg/s", "", "Parallel Heater", "sim_type=1&is_parallel_htr=1", "", "" },
{ SSC_OUTPUT, SSC_ARRAY, "T_htf_heater_in", "Parallel heater HTF inlet temperature", "C", "", "Parallel Heater", "sim_type=1&is_parallel_htr=1", "", "" },
{ SSC_OUTPUT, SSC_ARRAY, "T_htf_heater_out", "Parallel heater HTF outlet temperature", "C", "", "Parallel Heater", "sim_type=1&is_parallel_htr=1", "", "" },
// Heat Sink
{ SSC_OUTPUT, SSC_ARRAY, "q_dot_to_heat_sink", "Heat sink thermal power", "MWt", "", "Heat_Sink", "sim_type=1", "", "" },
{ SSC_OUTPUT, SSC_ARRAY, "W_dot_pc_pump", "Heat sink pumping power", "MWe", "", "Heat_Sink", "sim_type=1", "", "" },
{ SSC_OUTPUT, SSC_ARRAY, "m_dot_htf_heat_sink","Heat sink HTF mass flow", "kg/s", "", "Heat_Sink", "sim_type=1", "", "" },
{ SSC_OUTPUT, SSC_ARRAY, "T_heat_sink_in", "Heat sink HTF inlet temp", "C", "", "Heat_Sink", "sim_type=1", "", "" },
{ SSC_OUTPUT, SSC_ARRAY, "T_heat_sink_out", "Heat sink HTF outlet temp", "C", "", "Heat_Sink", "sim_type=1", "", "" },
// Thermal energy storage outputs
{ SSC_OUTPUT, SSC_ARRAY, "tank_losses", "TES thermal losses", "MWt", "", "", "sim_type=1", "", "" },
{ SSC_OUTPUT, SSC_ARRAY, "q_dot_tes_heater", "TES freeze protection power", "MWt", "", "", "sim_type=1", "", "" },
{ SSC_OUTPUT, SSC_ARRAY, "T_tes_hot", "TES hot temperature", "C", "", "", "sim_type=1", "", "" },
{ SSC_OUTPUT, SSC_ARRAY, "T_tes_cold", "TES cold temperature", "C", "", "", "sim_type=1", "", "" },
{ SSC_OUTPUT, SSC_ARRAY, "mass_tes_cold", "TES cold tank mass (end)", "kg", "", "", "sim_type=1", "", "" },
{ SSC_OUTPUT, SSC_ARRAY, "mass_tes_hot", "TES hot tank mass (end)", "kg", "", "", "sim_type=1", "", "" },
{ SSC_OUTPUT, SSC_ARRAY, "q_dc_tes", "TES discharge thermal power", "MWt", "", "", "sim_type=1", "", "" },
{ SSC_OUTPUT, SSC_ARRAY, "q_ch_tes", "TES charge thermal power", "MWt", "", "", "sim_type=1", "", "" },
{ SSC_OUTPUT, SSC_ARRAY, "e_ch_tes", "TES charge state", "MWht", "", "", "sim_type=1", "", "" },
{ SSC_OUTPUT, SSC_ARRAY, "m_dot_cr_to_tes_hot", "Mass flow: field to hot TES", "kg/s", "", "", "sim_type=1", "", "" },
{ SSC_OUTPUT, SSC_ARRAY, "m_dot_tes_hot_out", "Mass flow: TES hot out", "kg/s", "", "", "sim_type=1", "", "" },
{ SSC_OUTPUT, SSC_ARRAY, "m_dot_pc_to_tes_cold", "Mass flow: cycle to cold TES", "kg/s", "", "", "sim_type=1", "", "" },
{ SSC_OUTPUT, SSC_ARRAY, "m_dot_tes_cold_out", "Mass flow: TES cold out", "kg/s", "", "", "sim_type=1", "", "" },
{ SSC_OUTPUT, SSC_ARRAY, "m_dot_field_to_cycle", "Mass flow: field to cycle", "kg/s", "", "", "sim_type=1", "", "" },
{ SSC_OUTPUT, SSC_ARRAY, "m_dot_cycle_to_field", "Mass flow: cycle to field", "kg/s", "", "", "sim_type=1", "", "" },
{ SSC_OUTPUT, SSC_ARRAY, "tes_htf_pump_power", "TES HTF pump power", "MWe", "", "", "sim_type=1", "", "" },
// Parasitics outputs
{ SSC_OUTPUT, SSC_ARRAY, "P_fixed", "Parasitic power fixed load", "MWe", "", "", "sim_type=1", "", ""},
{ SSC_OUTPUT, SSC_ARRAY, "P_plant_balance_tot", "Parasitic power generation-dependent load", "MWe", "", "", "sim_type=1", "", ""},
{ SSC_OUTPUT, SSC_ARRAY, "P_rec_heattrace", "Receiver heat trace parasitic load", "MWe", "", "System", "sim_type=1&is_rec_model_trans=1", "", ""},
// System outputs
{ SSC_OUTPUT, SSC_ARRAY, "W_dot_parasitic_tot", "System total electrical parasitic", "MWe", "", "", "sim_type=1", "", ""},
// Controller outputs
{ SSC_OUTPUT, SSC_ARRAY, "tou_value", "CSP operating time-of-use value", "", "", "", "sim_type=1", "", ""},
{ SSC_OUTPUT, SSC_ARRAY, "pricing_mult", "PPA price multiplier", "", "", "", "sim_type=1", "", ""},
{ SSC_OUTPUT, SSC_ARRAY, "n_op_modes", "Operating modes in reporting timestep", "", "", "", "sim_type=1", "", ""},
{ SSC_OUTPUT, SSC_ARRAY, "op_mode_1", "1st operating mode", "", "", "", "sim_type=1", "", ""},
{ SSC_OUTPUT, SSC_ARRAY, "op_mode_2", "2nd operating mode, if applicable", "", "", "", "sim_type=1", "", ""},
{ SSC_OUTPUT, SSC_ARRAY, "op_mode_3", "3rd operating mode, if applicable", "", "", "", "sim_type=1", "", ""},
{ SSC_OUTPUT, SSC_ARRAY, "m_dot_balance", "Relative mass flow balance error", "", "", "", "sim_type=1", "", ""},
{ SSC_OUTPUT, SSC_ARRAY, "q_balance", "Relative energy balance error", "", "", "", "sim_type=1", "", ""},
// Dispatch outputs
{ SSC_OUTPUT, SSC_ARRAY, "disp_rel_mip_gap", "Dispatch relative MIP gap", "", "", "", "sim_type=1", "", ""},
{ SSC_OUTPUT, SSC_ARRAY, "disp_solve_state", "Dispatch solver state", "", "", "", "sim_type=1", "", ""},
{ SSC_OUTPUT, SSC_ARRAY, "disp_subopt_flag", "Dispatch suboptimal solution flag", "", "", "", "sim_type=1", "", ""},
{ SSC_OUTPUT, SSC_ARRAY, "disp_solve_iter", "Dispatch iterations count", "", "", "", "sim_type=1", "", ""},
{ SSC_OUTPUT, SSC_ARRAY, "disp_objective", "Dispatch objective function value", "", "", "", "sim_type=1", "", ""},
{ SSC_OUTPUT, SSC_ARRAY, "disp_obj_relax", "Dispatch objective function - relaxed max", "", "", "", "sim_type=1", "", ""},
{ SSC_OUTPUT, SSC_ARRAY, "disp_qsf_expected", "Dispatch expected solar field available energy", "MWt", "", "", "sim_type=1", "", ""},
{ SSC_OUTPUT, SSC_ARRAY, "disp_qsfprod_expected", "Dispatch expected solar field generation", "MWt", "", "", "sim_type=1", "", ""},
{ SSC_OUTPUT, SSC_ARRAY, "disp_qsfsu_expected", "Dispatch expected solar field startup enegy", "MWt", "", "", "sim_type=1", "", ""},
{ SSC_OUTPUT, SSC_ARRAY, "disp_tes_expected", "Dispatch expected TES charge level", "MWht", "", "", "sim_type=1", "", ""},
{ SSC_OUTPUT, SSC_ARRAY, "disp_pceff_expected", "Dispatch expected power cycle efficiency adj.", "", "", "", "sim_type=1", "", ""},
{ SSC_OUTPUT, SSC_ARRAY, "disp_thermeff_expected", "Dispatch expected SF thermal efficiency adj.", "", "", "", "sim_type=1", "", ""},
{ SSC_OUTPUT, SSC_ARRAY, "disp_qpbsu_expected", "Dispatch expected power cycle startup energy", "MWht", "", "", "sim_type=1", "", ""},
{ SSC_OUTPUT, SSC_ARRAY, "disp_wpb_expected", "Dispatch expected power generation", "MWe", "", "", "sim_type=1", "", ""},
{ SSC_OUTPUT, SSC_ARRAY, "disp_rev_expected", "Dispatch expected revenue factor", "", "", "", "sim_type=1", "", ""},
{ SSC_OUTPUT, SSC_ARRAY, "disp_presolve_nconstr", "Dispatch number of constraints in problem", "", "", "", "sim_type=1", "", ""},
{ SSC_OUTPUT, SSC_ARRAY, "disp_presolve_nvar", "Dispatch number of variables in problem", "", "", "", "sim_type=1", "", ""},
{ SSC_OUTPUT, SSC_ARRAY, "disp_solve_time", "Dispatch solver time", "sec", "", "", "sim_type=1", "", ""},
// These outputs correspond to the first csp-solver timestep in the reporting timestep.
// Subsequent csp-solver timesteps within the same reporting timestep are not tracked
{ SSC_OUTPUT, SSC_ARRAY, "q_dot_pc_sb", "Thermal power for PC standby", "MWt", "", "", "sim_type=1", "", ""},
{ SSC_OUTPUT, SSC_ARRAY, "q_dot_pc_min", "Thermal power for PC min operation", "MWt", "", "", "sim_type=1", "", ""},
{ SSC_OUTPUT, SSC_ARRAY, "q_dot_pc_max", "Max thermal power to PC", "MWt", "", "", "sim_type=1", "", ""},
{ SSC_OUTPUT, SSC_ARRAY, "q_dot_pc_target", "Target thermal power to PC", "MWt", "", "", "sim_type=1", "", ""},
{ SSC_OUTPUT, SSC_ARRAY, "is_rec_su_allowed", "Is receiver startup allowed", "", "", "", "sim_type=1", "", ""},
{ SSC_OUTPUT, SSC_ARRAY, "is_pc_su_allowed", "Is power cycle startup allowed", "", "", "", "sim_type=1", "", ""},
{ SSC_OUTPUT, SSC_ARRAY, "is_pc_sb_allowed", "Is power cycle standby allowed", "", "", "", "sim_type=1", "", ""},
{ SSC_OUTPUT, SSC_ARRAY, "is_PAR_HTR_allowed", "Is parallel electric heater operation allowed", "", "", "", "sim_type=1", "", ""},
{ SSC_OUTPUT, SSC_ARRAY, "q_dot_elec_to_PAR_HTR", "Electric heater thermal power target", "MWt", "", "", "sim_type=1", "", ""},
{ SSC_OUTPUT, SSC_ARRAY, "q_dot_est_cr_su", "Estimated receiver startup thermal power", "MWt", "", "", "sim_type=1", "", ""},
{ SSC_OUTPUT, SSC_ARRAY, "q_dot_est_cr_on", "Estimated receiver thermal power TO HTF", "MWt", "", "", "sim_type=1", "", ""},
{ SSC_OUTPUT, SSC_ARRAY, "q_dot_est_tes_dc", "Estimated max TES discharge thermal power", "MWt", "", "", "sim_type=1", "", ""},
{ SSC_OUTPUT, SSC_ARRAY, "q_dot_est_tes_ch", "Estimated max TES charge thermal power", "MWt", "", "", "sim_type=1", "", ""},
{ SSC_OUTPUT, SSC_ARRAY, "operating_modes_a", "First 3 operating modes tried", "", "", "", "sim_type=1", "", ""},
{ SSC_OUTPUT, SSC_ARRAY, "operating_modes_b", "Next 3 operating modes tried", "", "", "", "sim_type=1", "", ""},
{ SSC_OUTPUT, SSC_ARRAY, "operating_modes_c", "Final 3 operating modes tried", "", "", "", "sim_type=1", "", ""},
{ SSC_OUTPUT, SSC_ARRAY, "gen", "Total thermal power to heat sink with available derate", "kWt", "", "", "sim_type=1", "", ""},
// Annual single-value outputs
{ SSC_OUTPUT, SSC_NUMBER, "annual_energy", "Annual Thermal Energy to Heat Sink w/ avail derate", "kWt-hr", "", "Post-process", "sim_type=1", "", ""},
{ SSC_OUTPUT, SSC_NUMBER, "annual_q_rec_htf", "Annual receiver power delivered to HTF", "MWt-hr", "", "Tower and Receiver", "sim_type=1", "", ""},
{ SSC_OUTPUT, SSC_NUMBER, "annual_electricity_consumption", "Annual electricity consumption w/ avail derate", "kWe-hr", "", "Post-process", "sim_type=1", "", ""},
{ SSC_OUTPUT, SSC_NUMBER, "capacity_factor", "Capacity factor", "%", "", "Post-process", "sim_type=1", "", ""},
{ SSC_OUTPUT, SSC_NUMBER, "kwh_per_kw", "First year kWh/kW", "kWth/kWt", "", "Post-process", "sim_type=1", "", ""},
{ SSC_OUTPUT, SSC_NUMBER, "annual_total_water_use", "Total annual water usage from mirror washing", "m3", "", "Post-process", "sim_type=1", "", ""},
{ SSC_OUTPUT, SSC_NUMBER, "annual_q_rec_inc", "Annual receiver incident thermal power after reflective losses", "MWt-hr", "", "Tower and Receiver", "sim_type=1", "", ""},
{ SSC_OUTPUT, SSC_NUMBER, "annual_q_rec_loss", "Annual receiver convective and radiative losses", "MWt-hr", "", "Tower and Receiver", "sim_type=1", "", ""},
{ SSC_OUTPUT, SSC_NUMBER, "annual_q_piping_loss", "Annual tower piping losses", "MWt-hr", "", "Tower and Receiver", "sim_type=1", "", "" },
{ SSC_OUTPUT, SSC_NUMBER, "annual_q_rec_startup", "Annual receiver startup energy", "MWt-hr", "", "Tower and Receiver", "sim_type=1", "", "" },
{ SSC_OUTPUT, SSC_NUMBER, "annual_E_tower_pump", "Annual tower pumping power", "MWe-hr", "", "Tower and Receiver", "sim_type=1", "", "" },
{ SSC_OUTPUT, SSC_NUMBER, "annual_eta_rec_th", "Annual receiver thermal efficiency ignoring rec reflective loss", "", "", "Tower and Receiver", "sim_type=1", "", ""},
{ SSC_OUTPUT, SSC_NUMBER, "annual_eta_rec_th_incl_refl", "Annual receiver thermal efficiency including reflective loss", "", "", "Tower and Receiver", "sim_type=1", "", ""},
{ SSC_OUTPUT, SSC_NUMBER, "annual_q_defocus_est", "Annual defocus loss estimate", "MWt-hr", "", "Tower and Receiver", "sim_type=1", "", "" },
{ SSC_OUTPUT, SSC_NUMBER, "sim_cpu_run_time", "Simulation duration clock time", "s", "", "", "sim_type=1", "", ""},
var_info_invalid };
class cm_mspt_iph : public compute_module
{
public:
cm_mspt_iph()
{
add_var_info(_cm_vtab_mspt_iph);
add_var_info(vtab_adjustment_factors);
add_var_info(vtab_sf_adjustment_factors);
add_var_info(vtab_technology_outputs);
}
bool relay_message(string& msg, double percent)
{
log(msg);
return update(msg, (float)percent);
}
void exec() override
{
std::clock_t clock_start = std::clock();
int sim_type = as_integer("sim_type"); // 1 (default): timeseries, 2: design only
bool is_dispatch = as_boolean("is_dispatch");
// *****************************************************
// *****************************************************
// *****************************************************
// System Design Parameters
double T_htf_cold_des = as_double("T_htf_cold_des"); //[C]
double T_htf_hot_des = as_double("T_htf_hot_des"); //[C]
double tshours = as_double("tshours"); //[-]
// System Design Calcs
double q_dot_pc_des = as_double("q_pb_design"); //[MWt] HEAT SINK design thermal power
double Q_tes = q_dot_pc_des * tshours; //[MWt-hr]
double q_dot_rec_des = q_dot_pc_des * as_number("solarm"); //[MWt]
// Weather reader
C_csp_weatherreader weather_reader;
if (is_assigned("solar_resource_file")) {
weather_reader.m_weather_data_provider = make_shared<weatherfile>(as_string("solar_resource_file"));
if (weather_reader.m_weather_data_provider->has_message()) log(weather_reader.m_weather_data_provider->message(), SSC_WARNING);
}
if (is_assigned("solar_resource_data")) {
weather_reader.m_weather_data_provider = make_shared<weatherdata>(lookup("solar_resource_data"));
if (weather_reader.m_weather_data_provider->has_message()) log(weather_reader.m_weather_data_provider->message(), SSC_WARNING);
}
size_t n_steps_full = weather_reader.m_weather_data_provider->nrecords(); //steps_per_hour * 8760;
weather_reader.m_trackmode = 0;
weather_reader.m_tilt = 0.0;
weather_reader.m_azimuth = 0.0;
// Initialize to get weather file info
weather_reader.init();
if (weather_reader.has_error()) throw exec_error("mspt_iph", weather_reader.get_error());
// Get info from the weather reader initialization
double site_elevation = weather_reader.ms_solved_params.m_elev; //[m]
int tes_type = 1;
// 'sf_model_type'
// 0 = design field and tower/receiver geometry
// 1 = design field
// 2 = user field, calculate performance
// 3 = user performance maps vs solar position
int field_model_type = as_integer("field_model_type");
if (sim_type == 2 && field_model_type < 2) {
field_model_type = 2;
}
int rec_type = as_integer("receiver_type");
// Run solarpilot right away to update values as needed
util::matrix_t<double> mt_eta_map;
util::matrix_t<double> mt_flux_maps;
int N_hel = -999;
double A_sf = std::numeric_limits<double>::quiet_NaN();
double THT = std::numeric_limits<double>::quiet_NaN();
double rec_height = std::numeric_limits<double>::quiet_NaN();
double cav_rec_height = std::numeric_limits<double>::quiet_NaN();
double rec_aspect = std::numeric_limits<double>::quiet_NaN();
double D_rec = std::numeric_limits<double>::quiet_NaN();
double cav_rec_width = std::numeric_limits<double>::quiet_NaN();
double land_area_base = std::numeric_limits<double>::quiet_NaN();
double total_land_area_before_rad_cooling = std::numeric_limits<double>::quiet_NaN();
double heliostat_area = std::numeric_limits<double>::quiet_NaN();
double h_helio = std::numeric_limits<double>::quiet_NaN(); //[m]
double average_attenuation = std::numeric_limits<double>::quiet_NaN();
double refl_image_error = std::numeric_limits<double>::quiet_NaN();
double land_max_abs = std::numeric_limits<double>::quiet_NaN();
double land_min_abs = std::numeric_limits<double>::quiet_NaN();
util::matrix_t<double> helio_pos;
assign("is_optimize", 0);
bool is_optimize = false;
int n_flux_y = 1;
if (field_model_type < 4) {
h_helio = as_double("helio_height"); //[m]
// Field types 0-3 require solar pilot
solarpilot_invoke spi(this);
assign("q_design", q_dot_rec_des); //[MWt]
// Set up "cmod_solarpilot.cpp" conversions as necessary
double helio_optical_error_mrad = as_number("helio_optical_error_mrad"); //[mrad]
refl_image_error = std::sqrt(2. * helio_optical_error_mrad * 2. * helio_optical_error_mrad * 2.); //[mrad]
assign("helio_optical_error", (ssc_number_t)(helio_optical_error_mrad * 1.E-3));
// Set 'n_flux_x' and 'n_flux_y' here, for now
assign("n_flux_y", n_flux_y);
if (rec_type == 0) {
assign("rec_aspect", as_number("rec_height") / as_number("D_rec"));
int n_ext_rec_panels = as_integer("N_panels");
assign("n_flux_x", (ssc_number_t)max(12, n_ext_rec_panels));
}
else if (rec_type == 1) {
assign("n_flux_x", 2); // n_flux_x represents *per panel* the number subsurfaces in x direction
}
else {
throw exec_error("mspt_iph", "receiver_type must be 1 (external) or 0 (cavity)");
}
if ((field_model_type == 0 || field_model_type == 1) && sim_type == 1) // Auto-design. Generate a new system (is_optimize = true) or field layout
{
// What if sim_type = 2?
// If from the UI, then probably never want to actually layout the field and geometry
// because there are macros for that
// If called from a script.... then maybe?
// So.. maybe add optional input like "is_layout_field_in_design_only" and default to False?
if (field_model_type == 0)
{
assign("is_optimize", 1);
is_optimize = true;
}
assign("calc_fluxmaps", 1);
spi.run(weather_reader.m_weather_data_provider);
if (is_optimize)
{
//Optimization iteration history
vector<vector<double> > steps;
vector<double> obj, flux;
spi.getOptimizationSimulationHistory(steps, obj, flux);
size_t nr = steps.size();
if (nr > 0)
{
size_t nc = steps.front().size() + 2;
ssc_number_t* ssc_hist = allocate("opt_history", nr, nc);
for (size_t i = 0; i < nr; i++) {
for (size_t j = 0; j < steps.front().size(); j++)
ssc_hist[i * nc + j] = (ssc_number_t)steps.at(i).at(j);
ssc_hist[i * nc + nc - 2] = (ssc_number_t)obj.at(i);
ssc_hist[i * nc + nc - 1] = (ssc_number_t)flux.at(i);
}
}
}
// receiver calculations
double H_rec = spi.recs.front().rec_height.val;
//collect the optical efficiency data and sun positions
if (spi.fluxtab.zeniths.size() > 0 && spi.fluxtab.azimuths.size() > 0
&& spi.fluxtab.efficiency.size() > 0)
{
size_t nvals = spi.fluxtab.efficiency.size();
mt_eta_map.resize(nvals, 3);
for (size_t i = 0; i < nvals; i++)
{
mt_eta_map(i, 0) = spi.fluxtab.azimuths[i] * 180. / CSP::pi; //Convention is usually S=0, E<0, W>0
mt_eta_map(i, 1) = spi.fluxtab.zeniths[i] * 180. / CSP::pi; //Provide zenith angle
mt_eta_map(i, 2) = spi.fluxtab.efficiency[i];
}
}
else
throw exec_error("solarpilot", "failed to calculate a correct optical efficiency table");
//collect the flux map data
block_t<double>* flux_data = &spi.fluxtab.flux_surfaces.front().flux_data; //there should be only one flux stack for SAM
if (flux_data->ncols() > 0 && flux_data->nlayers() > 0)
{
if (rec_type == 0) {
int nflux_y = (int)flux_data->nrows();
int nflux_x = (int)flux_data->ncols();
mt_flux_maps.resize(nflux_y * flux_data->nlayers(), nflux_x);
int cur_row = 0;
for (size_t i = 0; i < flux_data->nlayers(); i++)
{
for (int j = 0; j < nflux_y; j++)
{
for (int k = 0; k < nflux_x; k++)
{
mt_flux_maps(cur_row, k) = flux_data->at(j, k, i);
//fluxdata[cur_row * nflux_x + k] = (float)flux_data->at(j, k, i);
}
cur_row++;
}
}
}
else if (rec_type == 1) {
int nflux_y = (int)flux_data->nrows();
int nflux_x = (int)flux_data->ncols();
int n_panels_cav = as_integer("n_cav_rec_panels"); //[-]
int n_sp_surfaces = spi.fluxtab.flux_surfaces.size();
int n_panels_cav_sp = n_sp_surfaces - 1;
if (nflux_y > 1) {
throw exec_error("solarpilot", "cavity flux maps currently only work for nflux_y = 1");
}
mt_flux_maps.resize(nflux_y * flux_data->nlayers(), n_panels_cav_sp);
int cur_row = 0;
// nlayers is number of solar positions (i.e. flux maps)
for (size_t i = 0; i < flux_data->nlayers(); i++) {
int j = 0;
double flux_receiver = 0.0;
// Start at k=1 because the first surface in flux_surfaces is the aperture, which we don't want
for (int k = 1; k <= n_panels_cav_sp; k++) {
block_t<double>* flux_data = &spi.fluxtab.flux_surfaces[k].flux_data; //.front().flux_data; //there should be only one flux stack for SAM
double flux_local = 0.0;
for (int l = 0; l < nflux_x; l++) {
//double flux_local0 = flux_data->at(j, 0, i);
//double flux_local1 = flux_data->at(j, 1, i);
//double flux_local2 = flux_data->at(j, 2, i);
//double flux_local3 = flux_data->at(j, 3, i);
flux_local += flux_data->at(j, l, i);
}
// Adjust k to start flux maps with first receiver surface
mt_flux_maps(cur_row, k - 1) = flux_local;
flux_receiver += flux_local;
double abc = 1.23;
}
cur_row++;
}
}
}
else
throw exec_error("solarpilot", "failed to calculate a correct flux map table");
}
else if (field_model_type == 2 || field_model_type == 3)
{
// only calculates a flux map, so need to "assign" 'helio_positions_in' for SolarPILOT cmod
util::matrix_t<double> helio_pos_temp = as_matrix("helio_positions");
size_t n_h_rows = helio_pos_temp.nrows();
ssc_number_t* p_helio_positions_in = allocate("helio_positions_in", n_h_rows, 2);
// Try to determine whether heliostat positions represent surround or cavity field
double y_h_min = 1.E5;
double y_h_max = -1.E5;
for (size_t i = 0; i < n_h_rows; i++)
{
p_helio_positions_in[i * 2] = (ssc_number_t)helio_pos_temp(i, 0); //[m] x
p_helio_positions_in[i * 2 + 1] = (ssc_number_t)helio_pos_temp(i, 1); //[m] y
y_h_min = min(y_h_min, p_helio_positions_in[i * 2 + 1]);
y_h_max = max(y_h_max, p_helio_positions_in[i * 2 + 1]);
}
bool is_cavity_field = false;
if ((y_h_max - y_h_min) / max(std::abs(y_h_max), std::abs(y_h_min)) < 1.25) {
is_cavity_field = true;
}
// Check determined field type against user-specified receiver type
if (sim_type == 1) {
if (is_cavity_field && rec_type == 0) {
throw exec_error("mspt compute module", "\nExternal receiver specified, but cavity field detected. Try one of the following options:\n"
"1) Run field layout macro on Heliostat Field page\n"
"2) Select option for simulation to layout field and tower/receiver design\n"
"3) Enter new heliostat positions\n");
}
if (!is_cavity_field && rec_type == 1) {
throw exec_error("mspt compute module", "\nCavity receiver specified, but surround field detected. Try one of the following options:\n"
"1) Run field layout macro on Heliostat Field page\n"
"2) Select option for simulation to layout field and tower/receiver design\n"
"3) Enter new heliostat positions\n");
}
}
// 'calc_fluxmaps' defaults to false in solarpilot cmod, so overwrite here if we want flux maps
if (sim_type == 1 && field_model_type == 2) {
assign("calc_fluxmaps", 1);
}
else if (sim_type == 2 || field_model_type == 3) {
assign("calc_fluxmaps", 0);
}
spi.run(weather_reader.m_weather_data_provider);
if (sim_type == 1 && field_model_type == 2) {
//collect the optical efficiency data and sun positions
if (spi.fluxtab.zeniths.size() > 0 && spi.fluxtab.azimuths.size() > 0
&& spi.fluxtab.efficiency.size() > 0)
{
size_t nvals = spi.fluxtab.efficiency.size();
mt_eta_map.resize(nvals, 3);
for (size_t i = 0; i < nvals; i++)
{
mt_eta_map(i, 0) = spi.fluxtab.azimuths[i] * 180. / CSP::pi; //Convention is usually S=0, E<0, W>0
mt_eta_map(i, 1) = spi.fluxtab.zeniths[i] * 180. / CSP::pi; //Provide zenith angle
mt_eta_map(i, 2) = spi.fluxtab.efficiency[i];
}
}
else
throw exec_error("solarpilot", "failed to calculate a correct optical efficiency table");
//collect the flux map data
block_t<double>* flux_data = &spi.fluxtab.flux_surfaces.front().flux_data; //there should be only one flux stack for SAM
if (flux_data->ncols() > 0 && flux_data->nlayers() > 0)
{
if (rec_type == 0) {
int nflux_y = (int)flux_data->nrows();
int nflux_x = (int)flux_data->ncols();
mt_flux_maps.resize(nflux_y * flux_data->nlayers(), nflux_x);
int cur_row = 0;
for (size_t i = 0; i < flux_data->nlayers(); i++)
{
for (int j = 0; j < nflux_y; j++)
{
for (int k = 0; k < nflux_x; k++)
{
mt_flux_maps(cur_row, k) = flux_data->at(j, k, i);
//fluxdata[cur_row * nflux_x + k] = (float)flux_data->at(j, k, i);
}
cur_row++;
}
}