-
Notifications
You must be signed in to change notification settings - Fork 1
/
ICSolar_MtnV.mo
1292 lines (1248 loc) · 176 KB
/
ICSolar_MtnV.mo
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
package ICSolar "Integrated Concentrating Solar simulation, packaged for hierarchy construction"
extends Modelica.Icons.Package;
model ICS_Skeleton "This model calculates the electrical and thermal generation of ICSolar. This model is used as a skeleton piece to hold together the other models until it is packages as an FMU."
extends ICSolar.Parameters;
Real EPC = ics_envelopecassette1.EPC;
Real Shade = ics_envelopecassette1.Shade;
//extends ICSolar.measured_data;
/////////////////////
/// Measured Data ///
/////////////////////
// DNI, T inlet, vFlow...and then aaaalll the T ins and outs. Total situational awareness. good for tuning both
//module behavior and whole-array behavior
Real measured_DNI = IC_Data_all.y[1];
// Real measured_T_HTFin = IC_Data_all.y[2];
// Real measured_vFlow = IC_Data_all.y[3];
// Real measured_Egen = IC_Data_all.y[4];
// Real measured_T_HTFout = IC_Data_all.y[5];
// Real measured_T_cavAvg = IC_Data_all.y[6];
// Real measured_T_s3m6in = IC_Data_all.y[7];
// Real measured_T_s3m6out = IC_Data_all.y[8];
// Real measured_T_s3m5in = IC_Data_all.y[9];
// Real measured_T_s3m5out = IC_Data_all.y[10];
// Real measured_T_s3m4in = IC_Data_all.y[11];
// Real measured_T_s3m4out = IC_Data_all.y[12];
// Real measured_T_s3m3in = IC_Data_all.y[13];
// Real measured_T_s3m3out = IC_Data_all.y[14];
// Real measured_T_s3m2in = IC_Data_all.y[15];
// Real measured_T_s3m2out = IC_Data_all.y[16];
// Real measured_T_s3m1in = IC_Data_all.y[17];
// Real measured_T_s3m1out = IC_Data_all.y[18];
// Real measured_T_s2m6in = IC_Data_all.y[19];
// Real measured_T_s2m1out = IC_Data_all.y[20];
// Real measured_T_s2CPVa = IC_Data_all.y[21];
// Real measured_T_s2CPVb = IC_Data_all.y[22];
// Real measured_yaw = IC_Data_all.y[23];
// Real measured_pitch = IC_Data_all.y[24];
// Processed Data
// Real measured_T_drop_jumper = measured_T_s2m6in - measured_T_s3m1out;
// Uncertainity Qualification
// Real UQ_measured_Egen_upper = measured_Egen + 0.73;
// Real UQ_measured_Egen_lower = measured_Egen - 0.73;
// Real UQ_measured_T_HTFout_upper = measured_T_HTFout + 2.2;
// Real UQ_measured_T_HTFout_lower = measured_T_HTFout - 2.2;
// Ambient / Cavity Temp
// Modelica.Blocks.Sources.CombiTimeTable T_cav_in(tableOnFile = true, fileName = Path + "20150323\\T_Cav_data.txt", tableName = "T_Cav");
// Real measured_T_amb = measured_T_cavAvg;
// Real measured_T_amb = T_cav_in.y[1];
/////////////////////////////
/// Energy / Exergy Var. ///
/////////////////////////////
//work in the measured flow rate vector here
Real temp_flowport_a = ics_envelopecassette1.flowport_a.H_flow / (AllBranchesFlow * mediumHTF.rho * mediumHTF.cp);
Real temp_flowport_b = abs(ics_envelopecassette1.flowport_b.H_flow / (AllBranchesFlow * mediumHTF.rho * mediumHTF.cp));
Real Q_arrayTotal = if abs(ics_envelopecassette1.flowport_b.H_flow) - ics_envelopecassette1.flowport_a.H_flow < 0 then 0 else abs(ics_envelopecassette1.flowport_b.H_flow) - ics_envelopecassette1.flowport_a.H_flow;
//Real Q_arrayTotal = if abs(ics_envelopecassette1.flowport_b.H_flow) - ics_envelopecassette1.flowport_a.H_flow < 0 or ics_context1.AOI >= Modelica.Constants.pi / 2.0 then 0 else abs(ics_envelopecassette1.flowport_b.H_flow) - ics_envelopecassette1.flowport_a.H_flow;
Real Egen_arrayTotal = if ics_envelopecassette1.Power_Electric < 0 then 0 else ics_envelopecassette1.Power_Electric;
// Area of modules is assumed to be 0.3^2
// m_dot*cp*(1 - Tamb/T2)
Real Ex_carnot_arrayTotal = Q_arrayTotal * (1 - Tref_ex / temp_flowport_b);
// m_dot*cp*(T2 - T1 - Tamb*ln(T2/T1))
// note "log" in OMedit is the natural log. "log10" is log base 10 in OM
Real Tref_ex = ics_context1.TWetBul + 2;
Real Ex_arrayTotal_temp = Egen_arrayTotal + ics_envelopecassette1.flowport_a.m_flow * mediumHTF.cp * (temp_flowport_b - temp_flowport_a - Tref_ex * log(temp_flowport_b / temp_flowport_a));
Real Ex_arrayTotal = if Ex_arrayTotal_temp < 0 then 0 else Ex_arrayTotal_temp;
//epsilon = the Exergenic efficiency (~93% for sunlight)
//Real Ex_epsilon_GHI = Ex_arrayTotal / (GHI_module * 0.93);
////////////////////////
/// Init. Components ///
////////////////////////
// IC Comp.
ICSolar.ICS_Context ics_context1 annotation(Placement(visible = true, transformation(origin = {-180,40}, extent = {{-25,-25},{25,25}}, rotation = 0)));
ICSolar.Envelope.ICS_EnvelopeCassette_Twelve ics_envelopecassette1 annotation(Placement(visible = true, transformation(origin = {20,40}, extent = {{-25,-25},{25,25}}, rotation = 0)));
// Fluid Comp.
Modelica.Thermal.FluidHeatFlow.Sources.Ambient Source(medium = mediumHTF, useTemperatureInput = true, constantAmbientPressure = 101325, constantAmbientTemperature = Temp_Indoor) "Thermal fluid source" annotation(Placement(visible = true, transformation(origin = {-60,-40}, extent = {{-10,-10},{10,10}}, rotation = 180)));
Modelica.Thermal.FluidHeatFlow.Sources.VolumeFlow Pump(m = 0.01, medium = mediumHTF, T0fixed = false, useVolumeFlowInput = true) "Fluid pump for thermal fluid" annotation(Placement(visible = true, transformation(origin = {-20,-40}, extent = {{-10,-10},{10,10}}, rotation = 0)));
Modelica.Thermal.FluidHeatFlow.Sources.Ambient Sink(medium = mediumHTF, constantAmbientPressure = 101325, constantAmbientTemperature = Temp_Indoor) "Thermal fluid sink, will be replaced with a tank later" annotation(Placement(visible = true, transformation(origin = {80,-20}, extent = {{-10,-10},{10,10}}, rotation = 0)));
Modelica.Blocks.Sources.Constant inletTempConst(k = inletTemp) annotation(Placement(visible = true, transformation(origin = {-160,-40}, extent = {{-10,-10},{10,10}}, rotation = 0)));
Modelica.Blocks.Sources.Constant PumpFlowRate(k = AllBranchesFlow) annotation(Placement(visible = true, transformation(origin = {-160,0}, extent = {{-10,-10},{10,10}}, rotation = 0)));
Modelica.Blocks.Sources.CombiTimeTable IC_Data_all(tableOnFile = true, fileName = Path + "20150323\\measuredData20150323r1.txt", tableName = "DNI_THTFin_vdot", nout = 24, columns = {2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25}) annotation(Placement(visible = true, transformation(origin = {-120,-80}, extent = {{-15,-15},{15,15}}, rotation = 0)));
// G_DN_ext_cos - Direct Normal on Exterior with Cosine Losses
Real G_DN_ext_cos = ics_context1.DNI * Modelica.Math.cos(ics_context1.AOI);
Real eta_E_G_cos = if G_DN_ext_cos <= 10.0 then 0 else Egen_arrayTotal / (G_DN_ext_cos*GlassArea);
Real eta_Q_G_cos = if G_DN_ext_cos <= 10.0 then 0 else Q_arrayTotal / (G_DN_ext_cos*GlassArea);
Real Ex_epsilon_G_cos = Ex_arrayTotal / (G_DN_ext_cos * 0.93);
// G_DN_ext - Direct Normal on Exterior without cosine losses
Real G_DN_ext = ics_context1.DNI;
Real eta_E_G = if G_DN_ext_cos <= 10.0 then 0 else Egen_arrayTotal / (G_DN_ext*GlassArea);
Real eta_Q_G = if G_DN_ext_cos <= 10.0 then 0 else Q_arrayTotal / (G_DN_ext*GlassArea);
Real Ex_epsilon_G = Ex_arrayTotal / (G_DN_ext * 0.93*GlassArea);
// I_hemi - Incident solar radiation
Real I_hemi = ics_context1.IncidentSolar;
Real eta_E = if I_hemi <= 10.0 then 0 else Egen_arrayTotal / (I_hemi * GlassArea);
Real eta_Q = if I_hemi <= 10.0 then 0 else Q_arrayTotal / (I_hemi * GlassArea);
Real Ex_epsilon = if I_hemi <= 10.0 then 0 else Ex_arrayTotal / (I_hemi * 0.93*GlassArea);
// I_cav - Incident solar raidation after glazing losses
Real I_cav = ics_envelopecassette1.glazingLossesOuter.IncidentSolar_cav;
Real eta_E_cav = if I_cav <= 10.0 then 0 else Egen_arrayTotal / (I_cav * GlassArea);
Real eta_Q_cav = if I_cav <= 10.0 then 0 else Q_arrayTotal / (I_cav * GlassArea);
Real Ex_epsilon_cav = if I_cav <= 10.0 then 0 else Ex_arrayTotal / (I_cav * 0.93*GlassArea);
// G_DN_cav - Direct normal after glazing losses
Real G_DN_cav = ics_envelopecassette1.glazingLossesOuter.SurfDirNor;
Real eta_E_G_cav = if G_DN_cav <= 10.0 then 0 else Egen_arrayTotal / (G_DN_cav*GlassArea);
Real eta_Q_G_cav = if G_DN_cav <= 10.0 then 0 else Q_arrayTotal / (G_DN_cav*GlassArea);
Real Ex_epsilon_G_cav = if G_DN_cav <= 10.0 then 0 else Ex_arrayTotal / (G_DN_cav * 0.93*GlassArea);
// G_DN_mod - Direct normal after glazing and shading losses
Real G_DN_mod = ics_envelopecassette1.glazingLossesOuter.SurfDirNor * Shade;
Real eta_E_G_mod = if G_DN_mod <= 10.0 then 0 else Egen_arrayTotal / (G_DN_mod*GlassArea);
Real eta_Q_G_mod = if G_DN_mod <= 10.0 then 0 else Q_arrayTotal / (G_DN_mod*GlassArea);
Real Ex_epsilon_G_mod = if G_DN_mod <= 10.0 then 0 else Ex_arrayTotal / (G_DN_mod * 0.93*GlassArea);
// G_DN_cell - Direct normal irradiance after lens optical losses, without concentration factor
Real G_DN_cell = ics_envelopecassette1.ics_stack[1].ICS_Module_Twelve_1[5].ics_lenslosses1.G_DN_cell;
Real eta_E_G_cell = if G_DN_cell <= 10.0 then 0 else Egen_arrayTotal / (G_DN_cell*GlassArea);
Real eta_Q_G_cell = if G_DN_cell <= 10.0 then 0 else Q_arrayTotal / (G_DN_cell*GlassArea);
Real Ex_epsilon_G_cell = if G_DN_cell <= 10.0 then 0 else Ex_arrayTotal / (G_DN_cell * 0.93*GlassArea);
//
Real elevationAngle = 90 * 3.14159 / 180 - BuildingLatitude + ics_context1.Declination;
//Real GHI_module = ics_context1.GHI * Modelica.Math.sin(elevationAngle + 90 * 3.14159 / 180 - ArrayTilt) / Modelica.Math.sin(elevationAngle) * GlassArea * Modelica.Math.cos(ics_context1.AOI);
equation
connect(ics_context1.IncidentSolar,ics_envelopecassette1.IncidentSolar);
connect(inletTempConst.y,Source.ambientTemperature) annotation(Line(points = {{-149,-40},{-94.452,-40},{-94.452,-33.0176},{-70.636,-33.0176},{-70.636,-33.0176}}, color = {0,0,127}));
connect(PumpFlowRate.y,Pump.volumeFlow) annotation(Line(points = {{-149,0},{-19.7564,0},{-19.7564,-29.77},{-19.7564,-29.77}}, color = {0,0,127}));
//set the HTF temperature according to measured data
//set flow rate according to measured data
connect(Source.flowPort,Pump.flowPort_a) annotation(Line(points = {{-50,-40},{-37.8122,-39.5049},{-30,-40}}));
connect(Pump.flowPort_b,ics_envelopecassette1.flowport_a) annotation(Line(points = {{-10,-40},{-8.167590000000001,-39.5049},{-4.3554,17.6597},{6.25,18.75},{-3.75,18.75}}));
//connect outlet of cassette
connect(ics_envelopecassette1.flowport_b,Sink.flowPort) annotation(Line(points = {{45,40},{60.0812,40},{60.0812,-20.2977},{70,-20.2977},{70,-20}}, color = {255,0,0}));
//connect weatherdata variables
connect(ics_context1.AOI,ics_envelopecassette1.AOI) annotation(Line(points = {{-155,30},{-5,30}}));
connect(ics_context1.SunAzi,ics_envelopecassette1.SunAzi) annotation(Line(points = {{-155,35},{-5,35}}));
connect(ics_context1.SunAlt,ics_envelopecassette1.SunAlt) annotation(Line(points = {{-155,40},{-5,40}}));
connect(ics_context1.SurfOrientation_out,ics_envelopecassette1.SurfaceOrientation) annotation(Line(points = {{-155,45},{-5,45}}));
connect(ics_context1.SurfTilt_out,ics_envelopecassette1.SurfaceTilt) annotation(Line(points = {{-155,50},{-5,50}}));
connect(ics_context1.TDryBul,ics_envelopecassette1.TAmb_in) annotation(Line(points = {{-155,55},{-5,55}}));
connect(ics_context1.DNI,ics_envelopecassette1.DNI) annotation(Line(points = {{-155,25},{-5,25}}, color = {0,0,127}));
//connect measured data for DNI and cavity temperature to cassette (kept as Reals)
connect(measured_DNI,ics_envelopecassette1.DNI_measured);
//connect(measured_T_cavAvg, ics_envelopecassette1.Tcav_measured);
//experiment(StartTime = 7137000.0, StopTime = 7141200.0, Tolerance = 1e-006, Interval = 100));
//StopTime = 3.15569e07, Tolerance = 1e-06, Interval = 3600));
annotation(Diagram(coordinateSystem(preserveAspectRatio = false, extent = {{-200,-100},{200,100}}), graphics), experiment(StartTime = 0, StopTime = 31556900.0, Tolerance = 1e-006, Interval = 3600.0));
end ICS_Skeleton;
model ICS_Context "This model provides the pieces necessary to set up the context to run the simulation, in FMU practice this will be cut out and provided from the EnergyPlus file"
extends ICSolar.Parameters;
Real Lat = BuildingLatitude "Latitude";
Real SurfOrientation = BuildingOrientation "Surface orientation: Change 'S' to 'W','E', or 'N' for other orientations";
Real SurfTilt = ArrayTilt "Tilt of the ICSolar array";
Buildings.BoundaryConditions.WeatherData.ReaderTMY3 weaDat(filNam = wFile, pAtmSou = Buildings.BoundaryConditions.Types.DataSource.File, TDryBul(displayUnit = "K"), TDewPoi(displayUnit = "K"), totSkyCovSou = Buildings.BoundaryConditions.Types.DataSource.File, opaSkyCovSou = Buildings.BoundaryConditions.Types.DataSource.File, totSkyCov = 0.01, opaSkyCov = 0.01) "Weather data reader for New York Central Park" annotation(Placement(visible = true, transformation(origin = {-40,20}, extent = {{-20,-20},{20,20}}, rotation = 0)));
Buildings.BoundaryConditions.SolarGeometry.BaseClasses.Declination decAng "Solar declination (seasonal offset)" annotation(Placement(visible = true, transformation(origin = {-40,-40}, extent = {{-10,-10},{10,10}}, rotation = 0)));
Buildings.BoundaryConditions.SolarGeometry.BaseClasses.SolarHourAngle solHouAng "Solar hour angle" annotation(Placement(visible = true, transformation(origin = {-40,-80}, extent = {{-10,-10},{10,10}}, rotation = 0)));
Buildings.BoundaryConditions.WeatherData.Bus weatherBus "Connector to put variables from the weather file" annotation(Placement(visible = true, transformation(origin = {20,20}, extent = {{-10,-10},{10,10}}, rotation = 0), iconTransformation(origin = {20,20}, extent = {{-10,-10},{10,10}}, rotation = 0)));
Buildings.HeatTransfer.Sources.PrescribedTemperature TOutside "Outside temperature" annotation(Placement(visible = true, transformation(origin = {60,20}, extent = {{-10,-10},{10,10}}, rotation = 0)));
// Modelica.Blocks.Interfaces.RealOutput Q_gen "don't know why these experiment outputs get stuck in context, but here they are" annotation(Placement(visible = true, transformation(origin = {100, 20}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Real GHI "Global Horizontal Irradiance";
Real Declination;
Buildings.BoundaryConditions.SolarIrradiation.DirectTiltedSurface HDirTil(lat = BuildingLatitude, azi = BuildingOrientation, til = Modelica.Constants.pi / 2 - ArrayTilt) annotation(Placement(visible = true, transformation(origin = {40,80}, extent = {{-10,-10},{10,10}}, rotation = 0)));
Buildings.BoundaryConditions.SolarIrradiation.DiffusePerez HDifTil(lat = BuildingLatitude, azi = BuildingOrientation, til = Modelica.Constants.pi / 2 - ArrayTilt, outSkyCon = true, outGroCon = true) annotation(Placement(visible = true, transformation(origin = {40,60}, extent = {{-10,-10},{10,10}}, rotation = 0)));
Modelica.Blocks.Math.Add add1 annotation(Placement(visible = true, transformation(origin = {74,90}, extent = {{-5,-5},{5,5}}, rotation = 0)));
Modelica.Blocks.Interfaces.RealOutput IncidentDiffuse annotation(Placement(visible = true, transformation(origin = {100,60}, extent = {{-10,-10},{10,10}}, rotation = 0), iconTransformation(origin = {100,57}, extent = {{-10,-10},{10,10}}, rotation = 0)));
Modelica.Blocks.Interfaces.RealOutput IncidentBeam annotation(Placement(visible = true, transformation(origin = {100,80}, extent = {{-10,-10},{10,10}}, rotation = 0), iconTransformation(origin = {100,77}, extent = {{-10,-10},{10,10}}, rotation = 0)));
Modelica.Blocks.Interfaces.RealOutput IncidentSolar annotation(Placement(visible = true, transformation(origin = {100,100}, extent = {{-10,-10},{10,10}}, rotation = 0), iconTransformation(origin = {100,97}, extent = {{-10,-10},{10,10}}, rotation = 0)));
Modelica.Thermal.HeatTransfer.Interfaces.HeatPort_b TDryBul "Dry bulb temperature" annotation(Placement(visible = true, transformation(origin = {100,0}, extent = {{-10,-10},{10,10}}, rotation = 0), iconTransformation(origin = {100,37}, extent = {{-10,-10},{10,10}}, rotation = 0)));
Modelica.Blocks.Interfaces.RealOutput SurfTilt_out "Surface tilt" annotation(Placement(visible = true, transformation(origin = {100,20}, extent = {{-10,-10},{10,10}}, rotation = 0), iconTransformation(origin = {100,17}, extent = {{-10,-10},{10,10}}, rotation = 0)));
Modelica.Blocks.Interfaces.RealOutput SurfOrientation_out "Surface Orientation" annotation(Placement(visible = true, transformation(origin = {100,40}, extent = {{-10,-10},{10,10}}, rotation = 0), iconTransformation(origin = {100,-3}, extent = {{-10,-10},{10,10}}, rotation = 0)));
Modelica.Blocks.Interfaces.RealOutput SunAlt "Solar altitude" annotation(Placement(visible = true, transformation(origin = {100,-60}, extent = {{-10,-10},{10,10}}, rotation = 0), iconTransformation(origin = {100,-23}, extent = {{-10,-10},{10,10}}, rotation = 0)));
Modelica.Blocks.Interfaces.RealOutput SunAzi "Solar azimuth" annotation(Placement(visible = true, transformation(origin = {100,-80}, extent = {{-10,-10},{10,10}}, rotation = 0), iconTransformation(origin = {100,-43}, extent = {{-10,-10},{10,10}}, rotation = 0)));
Modelica.Blocks.Interfaces.RealOutput AOI "Angle of incidence" annotation(Placement(visible = true, transformation(origin = {100,-40}, extent = {{-10,-10},{10,10}}, rotation = 0), iconTransformation(origin = {100,-63}, extent = {{-10,-10},{10,10}}, rotation = 0)));
Modelica.Blocks.Interfaces.RealOutput DNI "Direct normal irradiance" annotation(Placement(visible = true, transformation(origin = {100,-20}, extent = {{-10,-10},{10,10}}, rotation = 0), iconTransformation(origin = {100,-83}, extent = {{-10,-10},{10,10}}, rotation = 0)));
Modelica.Blocks.Math.Add add2 annotation(Placement(visible = true, transformation(origin = {72,52}, extent = {{-5,-5},{5,5}}, rotation = 0)));
Real TWetBul;
protected
Real del_c = Modelica.Math.cos(decAng.decAng);
Real del_s = Modelica.Math.sin(decAng.decAng);
Real phi_c = Modelica.Math.cos(Lat);
Real phi_s = Modelica.Math.sin(Lat);
Real omg_c = Modelica.Math.cos(solHouAng.solHouAng);
Real omg_s = Modelica.Math.sin(solHouAng.solHouAng);
Real bet_c = Modelica.Math.cos(Modelica.Constants.pi / 2 - SurfTilt);
Real bet_s = Modelica.Math.sin(Modelica.Constants.pi / 2 - SurfTilt);
Real gam_c = Modelica.Math.cos(SurfOrientation);
Real gam_s = Modelica.Math.sin(SurfOrientation);
equation
connect(weatherBus.TWetBul,TWetBul);
connect(add2.y,add1.u2) annotation(Line(points = {{77.5,52},{79.94580000000001,52},{79.94580000000001,74.7967},{63.6856,74.7967},{63.6856,86.7209},{66.93770000000001,86.7209},{66.93770000000001,86.7209}}, color = {0,0,127}));
connect(add2.y,IncidentDiffuse) annotation(Line(points = {{77.5,52},{83.1978,52},{83.1978,60.7046},{94.03789999999999,60.7046},{94.03789999999999,60.7046}}, color = {0,0,127}));
connect(HDifTil.HGroDifTil,add2.u2) annotation(Line(points = {{51,54},{55.0136,54},{55.0136,48.7805},{65.5827,48.7805},{65.5827,48.7805}}, color = {0,0,127}));
connect(HDifTil.HSkyDifTil,add2.u1) annotation(Line(points = {{51,66},{56.6396,66},{56.6396,55.0136},{65.8537,55.0136},{65.8537,55.0136}}, color = {0,0,127}));
connect(weaDat.weaBus,HDifTil.weaBus) annotation(Line(points = {{-20,20},{7.52566,20},{7.52566,60.2052},{30.3307,60.2052},{30.3307,60.2052}}, color = {255,204,51}));
connect(weaDat.weaBus,HDirTil.weaBus) annotation(Line(points = {{-20,20},{0.4561,20},{0.4561,80.27370000000001},{30.1026,80.27370000000001},{30.1026,80.27370000000001}}, color = {255,204,51}));
connect(add1.y,IncidentSolar) annotation(Line(points = {{79.5,90},{93.27249999999999,90},{93.27249999999999,100.342},{93.27249999999999,100.342}}, color = {0,0,127}));
connect(HDirTil.H,add1.u1) annotation(Line(points = {{51,80},{58.8369,80},{58.8369,92.8164},{67.73090000000001,92.8164},{67.73090000000001,92.8164}}, color = {0,0,127}));
connect(HDirTil.H,IncidentBeam) annotation(Line(points = {{51,80},{94.18470000000001,80},{94.18470000000001,80.5017},{94.18470000000001,80.5017}}, color = {0,0,127}));
connect(TOutside.port,TDryBul) annotation(Line(points = {{70,20},{97.8229,0},{100,0}}));
connect(weatherBus.HDirNor,DNI) "Connects Hourly Direct Normal Irradiance from the weather file to the DNI output of context";
connect(weatherBus.HGloHor,GHI) "Connects Hourly Direct Horizontal Irradiance from the weather file to the DHI output of context";
connect(SurfOrientation,SurfOrientation_out) "Connects Surface Orientation Parameter to Surface Orientation Output";
connect(SurfTilt,SurfTilt_out) "Connects Surface Tilt Parameter to Surface Tilt Output";
connect(weatherBus.TDryBul,TOutside.T) "Connects the weather file Dry Bult to the TOutside prescribed temperature model" annotation(Line(points = {{20,20},{47.0247,20},{48,20}}));
// connect(weatherBus, HDirTil.weaBus) "Connects the weather bus to the irradiance based on wall tilt calculation model (HDirTil)" annotation(Line(points = {{20, 20}, {19.7388, 20}, {19.7388, -17.4165}, {-3.48331, -17.4165}, {-3.48331, -40.0581}, {10, -40.0581}, {10, -40}}));
// connect(HDirTil.inc, AOI) "Connects incident angle to angle of incidence out" annotation(Line(points = {{31, -44}, {45.5733, -44}, {45.5733, -40.0581}, {100, -40.0581}, {100, -40}}));
connect(weatherBus.solTim,solHouAng.solTim) "Connects solar time to solar hour angle model" annotation(Line(points = {{20,20},{19.7388,20},{19.7388,-17.4165},{-63.5704,-17.4165},{-63.5704,-79.8258},{-52,-79.8258},{-52,-80}}));
connect(weatherBus.cloTim,decAng.nDay) "Calculates clock time to day number" annotation(Line(points = {{20,20},{19.7388,20},{19.7388,-17.4165},{-63.5704,-17.4165},{-63.5704,-40.0581},{-52,-40.0581},{-52,-40}}));
connect(weaDat.weaBus,weatherBus) "Connects weather data to weather bus" annotation(Line(points = {{-20,20},{20.6096,20},{20,20}}));
//Uses the decAng and solHouAng to calculate the Declination and Solar Hour angles
SunAlt = Modelica.Math.asin(Modelica.Math.sin(Lat) * Modelica.Math.sin(decAng.decAng) + Modelica.Math.cos(Lat) * Modelica.Math.cos(decAng.decAng) * Modelica.Math.cos(solHouAng.solHouAng));
//Eq 1.6.6 Solar Engineering of Thermal Processes - Duff & Beckman
SunAzi = sign(Modelica.Math.sin(solHouAng.solHouAng)) * abs(Modelica.Math.acos((Modelica.Math.cos(abs(Modelica.Constants.pi / 2 - SunAlt)) * Modelica.Math.sin(Lat) - Modelica.Math.sin(decAng.decAng)) / (Modelica.Math.cos(Lat) * Modelica.Math.sin(abs(Modelica.Constants.pi / 2 - SunAlt)))));
//Eq 1.6.2 Solar Engineering of Thermal Processes - Duff & Beckman
// Ask about the origin of this AOI when we can get AOI from HDirTil component.
AOI = Modelica.Math.acos(del_s * phi_s * bet_c - del_s * phi_c * bet_s * gam_c + del_c * phi_c * bet_c * omg_c + del_c * phi_s * bet_s * gam_c * omg_c + del_c * bet_s * gam_s * omg_s);
connect(Declination,decAng.decAng);
annotation(Diagram(coordinateSystem(preserveAspectRatio = false, extent = {{-100,-100},{100,100}}), graphics), experiment(StartTime = 7084800, StopTime = 7171200, Tolerance = 1e-006, Interval = 864));
end ICS_Context;
package Envelope "Package of all the Envelope components to create an Integrated Concentrating Solar simulation"
extends Modelica.Icons.Package;
model ICS_EnvelopeCassette_Twelve "This model in the Envelope Cassette (Double-Skin Facade) that houses the ICSolar Stack and Modules. This presents a building envelope"
extends ICSolar.Parameters;
Real EPC = ics_stack[1].EPC;
Real Shade = ics_stack[1].Shade;
input Real IncidentSolar;
/// Redundant but here to true model
// Modelica.Blocks.Sources.CombiTimeTable IC_Data_all(tableOnFile = true, fileName = Path + "20150323\\ICSFdata_DLS.txt", tableName = "DNI_THTFin_vdot", nout = 3, columns = {2, 3, 4}) annotation(Placement(visible = true, transformation(origin = {-80, 0}, extent = {{-15, -15}, {15, 15}}, rotation = 0)));
//
//______________________________________________________________________________
Modelica.Blocks.Interfaces.RealInput AOI "Angle of incidence" annotation(Placement(visible = true, transformation(origin = {-100,40}, extent = {{-10,-10},{10,10}}, rotation = 0), iconTransformation(origin = {-100,-40}, extent = {{-10,-10},{10,10}}, rotation = 0)));
Modelica.Blocks.Interfaces.RealInput SunAlt "Altitude of the sun " annotation(Placement(visible = true, transformation(origin = {-100,20}, extent = {{-10,-10},{10,10}}, rotation = 0), iconTransformation(origin = {-100,0}, extent = {{-10,-10},{10,10}}, rotation = 0)));
Modelica.Blocks.Interfaces.RealInput SunAzi "Azimuth of the sun " annotation(Placement(visible = true, transformation(origin = {-100,0}, extent = {{-10,-10},{10,10}}, rotation = 0), iconTransformation(origin = {-100,-20}, extent = {{-10,-10},{10,10}}, rotation = 0)));
Modelica.Blocks.Interfaces.RealInput SurfaceOrientation annotation(Placement(visible = true, transformation(origin = {-100,-20}, extent = {{-10,-10},{10,10}}, rotation = 0), iconTransformation(origin = {-100,20}, extent = {{-10,-10},{10,10}}, rotation = 0)));
Modelica.Blocks.Interfaces.RealInput SurfaceTilt annotation(Placement(visible = true, transformation(origin = {-100,-40}, extent = {{-10,-10},{10,10}}, rotation = 0), iconTransformation(origin = {-100,40}, extent = {{-10,-10},{10,10}}, rotation = 0)));
//
//______________________________________________________________________________
Modelica.Blocks.Interfaces.RealOutput Power_Electric "Electric power generated" annotation(Placement(visible = true, transformation(origin = {100,20}, extent = {{-10,-10},{10,10}}, rotation = 0), iconTransformation(origin = {100,60}, extent = {{-20,-20},{20,20}}, rotation = 0)));
Modelica.Thermal.FluidHeatFlow.Interfaces.FlowPort_a flowport_a(medium = mediumHTF) "Thermal fluid inflow port, before heat exchange" annotation(Placement(visible = true, transformation(origin = {-100,-80}, extent = {{-10,-10},{10,10}}, rotation = 0), iconTransformation(origin = {-95,-85}, extent = {{-5,-5},{5,5}}, rotation = 0)));
Modelica.Thermal.FluidHeatFlow.Interfaces.FlowPort_b flowport_b(medium = mediumHTF) "Thermal fluid outflow port, after heat exchange" annotation(Placement(visible = true, transformation(origin = {100,-20}, extent = {{-10,-10},{10,10}}, rotation = 0), iconTransformation(origin = {100,0}, extent = {{-10,-10},{10,10}}, rotation = 0)));
Modelica.Thermal.HeatTransfer.Sources.FixedTemperature T_indoors(T = Temp_Indoor) annotation(Placement(visible = true, transformation(origin = {-20,60}, extent = {{-10,-10},{10,10}}, rotation = 0)));
ICSolar.Envelope.CavityHeatBalance cavityheatbalance1 annotation(Placement(visible = true, transformation(origin = {20,60}, extent = {{-10,-10},{10,10}}, rotation = 0)));
ICSolar.Envelope.GlazingTransmittance glazingLossesOuter annotation(Placement(visible = true, transformation(origin = {-60,60}, extent = {{-15,-15},{15,15}}, rotation = 0)));
ICSolar.Envelope.RotationMatrixForSphericalCood rotationmatrixforsphericalcood1 annotation(Placement(visible = true, transformation(origin = {-60,-20}, extent = {{-10,-10},{10,10}}, rotation = 0)));
constant Real GND = 0 annotation(Placement(visible = true, transformation(origin = {-40,0}, extent = {{-25,-25},{25,25}}, rotation = 0)));
ICSolar.Stack.ICS_Stack_Twelve ics_stack[NumOfStacks] annotation(Placement(visible = true, transformation(origin = {40,0}, extent = {{-25,-25},{25,25}}, rotation = 0)));
Modelica.Blocks.Interfaces.RealInput DNI_measured "DNI from data file" annotation(Placement(visible = true, transformation(origin = {-100,-60}, extent = {{-10,-10},{10,10}}, rotation = 0), iconTransformation(origin = {-100,-60}, extent = {{-10,-10},{10,10}}, rotation = 0)));
Modelica.Blocks.Interfaces.RealInput DNI "DNI from weather file" annotation(Placement(visible = true, transformation(origin = {-100,60}, extent = {{-10,-10},{10,10}}, rotation = 0), iconTransformation(origin = {-100,-60}, extent = {{-10,-10},{10,10}}, rotation = 0)));
Modelica.Thermal.HeatTransfer.Interfaces.HeatPort_a TAmb_in "Ambient cavity temperature" annotation(Placement(visible = true, transformation(origin = {-100,80}, extent = {{-10,-10},{10,10}}, rotation = 0), iconTransformation(origin = {-100,60}, extent = {{-10,-10},{10,10}}, rotation = 0)));
Modelica.Thermal.HeatTransfer.Components.ThermalConductor thermalconductor[NumOfStacks](each G = 0.2) annotation(Placement(visible = true, transformation(origin = {80,-80}, extent = {{-10,-10},{10,10}}, rotation = 0)));
Modelica.Thermal.FluidHeatFlow.Components.HeatedPipe Tubing[NumOfStacks](medium = mediumHTF, V_flowLaminar = OneBranchFlow, V_flowNominal = 1e-005, h_g = 0, m = 0.0025, T0 = T_HTF_start, dpLaminar = 0.45, dpNominal = 10) annotation(Placement(visible = true, transformation(origin = {40,-80}, extent = {{-10,-10},{10,10}}, rotation = 90)));
//
//______________________________________________________________________________
equation
// Create the number of parallel stacks
ics_stack[1].Power_in = 0;
for i in 1:NumOfStacks loop
connect(glazingLossesOuter.SurfDirNor,ics_stack[i].DNI);
connect(IncidentSolar, glazingLossesOuter.IncidentSolar);
connect(ics_stack[i].flowport_a1,flowport_a);
ics_stack[i].stackNum = i;
connect(rotationmatrixforsphericalcood1.arrayYaw,ics_stack[i].arrayYaw);
connect(rotationmatrixforsphericalcood1.arrayPitch,ics_stack[i].arrayPitch);
connect(ics_stack[i].TAmb_in,cavityheatbalance1.ICS_Heat);
connect(ics_stack[i].flowport_b1,Tubing[i].flowPort_a);
connect(Tubing[i].flowPort_b,flowport_b);
connect(Tubing[i].heatPort,thermalconductor[i].port_a);
connect(thermalconductor[i].port_b,cavityheatbalance1.ICS_Heat);
end for;
for i in 1:NumOfStacks - 1 loop
connect(ics_stack[i].Power_out,ics_stack[i + 1].Power_in);
end for;
connect(ics_stack[NumOfStacks].Power_out,Power_Electric);
connect(TAmb_in,cavityheatbalance1.Exterior) annotation(Line(points = {{-100,80},{5.04451,80},{5.04451,65.8754},{10,66},{10,66}}));
connect(DNI,glazingLossesOuter.DNI) annotation(Line(points = {{-100,60},{-75,60},{-75,64},{-70,69},{-75,69}}));
//_______________________________________________________________________________
//pre-stacks
//DNI into cavity
connect(AOI,glazingLossesOuter.AOI) annotation(Line(points = {{-100,40},{-84,40},{-84,45},{-70,51},{-75,51}}));
connect(SunAlt,rotationmatrixforsphericalcood1.SunAlt) annotation(Line(points = {{-100,20},{-81.46339999999999,20},{-81.2162,-16.5426},{-69.75279999999999,-16.445},{-70,-16}}, color = {0,0,127}));
connect(SunAzi,rotationmatrixforsphericalcood1.SunAzi) annotation(Line(points = {{-100,0},{-87.0732,0},{-86.82599999999999,-11.9084},{-69.75279999999999,-12.445},{-70,-12}}, color = {0,0,127}));
connect(SurfaceOrientation,rotationmatrixforsphericalcood1.SurfaceOrientation) annotation(Line(points = {{-100,-20},{-83.9024,-20},{-83.65519999999999,-20.2011},{-69.75279999999999,-20.445},{-70,-20}}, color = {0,0,127}));
connect(SurfaceTilt,rotationmatrixforsphericalcood1.SurfaceTilt) annotation(Line(points = {{-100,-40},{-85.60980000000001,-40},{-85.3626,-24.5913},{-69.75279999999999,-24.445},{-70,-24}}, color = {0,0,127}));
//_______________________________________________________________________________
//thermal balance
connect(T_indoors.port,cavityheatbalance1.Interior) annotation(Line(points = {{-10,60},{-1.48368,60},{-1.48368,55.7864},{10,55.7864},{10,56}}));
end ICS_EnvelopeCassette_Twelve;
model GlazingTransmittance
// NO LONGER USES EXTEND ICSolar.Parameters BECAUSE VARIABLE OVERLAP
input Real IncidentSolar (start=0.0);
Real IncidentSolar_cav (start=0.0, min=0.0);
//Using Schlick's approximation to get glazing transmittance
Integer n_lites = 1 "number of lites in glazing unit. for Studio =2. for projected =1 (isStudioExperiment=false)";
Real x_lite = 6 "thickness of lite (mm). for studio =3. for projected =6 (isStudioExperiment=true)";
parameter Real R_sfc = 1e-005 "surface soiling coefficient. if isStudioExperiment=true then 0.030 else .00001 (don't like to use zero, generally)";
parameter Real c_disp = 0.0075 "coeff. dispersion. for Ultrawhite =0.0075. for studio = 0.0221(isStudioExperiment = false)";
constant Real n_air = 1.0 "optical index, air";
constant Real n_glass = 1.53 "optical index, glass";
constant Real R_o = ((n_air - n_glass) / (n_air + n_glass)) ^ 2 "normal reflection (Snell's)";
Real R_Fres (start=0.0, min=0.0) "for Schlick's approximation";
Modelica.Blocks.Interfaces.RealOutput Trans_glaz_transient "momentary transmittance of exterior glazing" annotation(Placement(visible = true, transformation(origin = {100,-20}, extent = {{-10,-10},{10,10}}, rotation = 0), iconTransformation(origin = {100,20}, extent = {{-10,-10},{10,10}}, rotation = 0)));
Modelica.Blocks.Interfaces.RealOutput SurfDirNor "Surface direct normal solar irradiance" annotation(Placement(visible = true, transformation(origin = {100,20}, extent = {{-10,-10},{10,10}}, rotation = 0), iconTransformation(origin = {100,20}, extent = {{-10,-10},{10,10}}, rotation = 0)));
Modelica.Blocks.Interfaces.RealInput AOI "Angle of incidence" annotation(Placement(visible = true, transformation(origin = {-100,-60}, extent = {{-10,-10},{10,10}}, rotation = 0), iconTransformation(origin = {-100,-60}, extent = {{-10,-10},{10,10}}, rotation = 0)));
Modelica.Blocks.Interfaces.RealInput DNI "Direct normal irradiance" annotation(Placement(visible = true, transformation(origin = {-100,20}, extent = {{-10,-10},{10,10}}, rotation = 0), iconTransformation(origin = {-100,60}, extent = {{-10,-10},{10,10}}, rotation = 0)));
Real Trans_glazinglosses_Schlick (start=0.0, min=0.0, max=1.0) "glazing transmittance vs AOI";
equation
R_Fres = R_o + (1 - R_o) * (1 - cos(AOI)) ^ 5;
Trans_glazinglosses_Schlick = if (1 - R_sfc / cos(AOI)) * ((1 - c_disp * x_lite / cos(AOI)) * (1 - 2 * R_Fres / (1 + R_Fres))) ^ n_lites < 0 then 0 else (1 - R_sfc / cos(AOI)) * ((1 - c_disp * x_lite / cos(AOI)) * (1 - 2 * R_Fres / (1 + R_Fres))) ^ n_lites;
//if AOI <= 1.570795 then
// SurfDirNor = DNI * Trans_glazinglosses_Schlick;
// IncidentSolar_cav = IncidentSolar * Trans_glazinglosses_Schlick;
//else
// SurfDirNor = 0;
// IncidentSolar_cav = 0;
//end if;
SurfDirNor = DNI * Trans_glazinglosses_Schlick;
IncidentSolar_cav = IncidentSolar * Trans_glazinglosses_Schlick;
if DNI > 0 then
Trans_glaz_transient = SurfDirNor / DNI;
else
Trans_glaz_transient = Trans_glazinglosses_Schlick;
end if;
annotation(Icon(coordinateSystem(extent = {{-100,-100},{100,100}}, preserveAspectRatio = true, initialScale = 0.1, grid = {2,2})), Diagram(coordinateSystem(extent = {{-100,-100},{100,100}}, preserveAspectRatio = true, initialScale = 0.1, grid = {2,2})));
end GlazingTransmittance;
model GlazingTransmittance_ETFE
// NO LONGER USES EXTEND ICSolar.Parameters BECAUSE VARIABLE OVERLAP
input Real IncidentSolar (start=0.0);
Real IncidentSolar_cav (start=0.0);
Integer n_lites = 1 "One layer";
Real x_lite = 0.1 "[mm] ETFE is much thinner than class";
parameter Real R_sfc = 1e-005 "Surface spoil coefficient";
parameter Real c_disp = 0.06 "Coefficient of dispersion/scatter adjusted to reach 94% optical transmittance at AOI = 0";
constant Real n_air = 1.0 "optical index, air";
constant Real n_etfe = 1.4 "optical index, ETFE";
constant Real R_o = ((n_air - n_etfe) / (n_air + n_etfe)) ^ 2 "normal reflection (Snell's)";
Real R_Fres (start=0.0,min=0.0) "for Schlick's approximation";
Modelica.Blocks.Interfaces.RealOutput Trans_glaz_transient "momentary transmittance of exterior glazing" annotation(Placement(visible = true, transformation(origin = {100,-20}, extent = {{-10,-10},{10,10}}, rotation = 0), iconTransformation(origin = {100,20}, extent = {{-10,-10},{10,10}}, rotation = 0)));
Modelica.Blocks.Interfaces.RealOutput SurfDirNor "Surface direct normal solar irradiance" annotation(Placement(visible = true, transformation(origin = {100,20}, extent = {{-10,-10},{10,10}}, rotation = 0), iconTransformation(origin = {100,20}, extent = {{-10,-10},{10,10}}, rotation = 0)));
Modelica.Blocks.Interfaces.RealInput AOI "Angle of incidence" annotation(Placement(visible = true, transformation(origin = {-100,-60}, extent = {{-10,-10},{10,10}}, rotation = 0), iconTransformation(origin = {-100,-60}, extent = {{-10,-10},{10,10}}, rotation = 0)));
Modelica.Blocks.Interfaces.RealInput DNI "Direct normal irradiance" annotation(Placement(visible = true, transformation(origin = {-100,20}, extent = {{-10,-10},{10,10}}, rotation = 0), iconTransformation(origin = {-100,60}, extent = {{-10,-10},{10,10}}, rotation = 0)));
Real Trans_glazinglosses_Schlick (start=0.0, max=1.0, min=0.0) "glazing transmittance vs AOI";
equation
R_Fres = R_o + (1 - R_o) * (1 - cos(AOI)) ^ 5;
Trans_glazinglosses_Schlick = if (1 - R_sfc / cos(AOI)) * ((1 - c_disp * x_lite / cos(AOI)) * (1 - 2 * R_Fres / (1 + R_Fres))) ^ n_lites < 0 then 0 else (1 - R_sfc / cos(AOI)) * ((1 - c_disp * x_lite / cos(AOI)) * (1 - 2 * R_Fres / (1 + R_Fres))) ^ n_lites;
SurfDirNor = DNI * Trans_glazinglosses_Schlick;
IncidentSolar_cav = IncidentSolar * Trans_glazinglosses_Schlick;
// if AOI <= 1.570795 then
// SurfDirNor = DNI * Trans_glazinglosses_Schlick;
// IncidentSolar_cav = IncidentSolar * Trans_glazinglosses_Schlick;
// else
// SurfDirNor = 0;
// IncidentSolar_cav = 0;
// end if;
if DNI > 0 then
Trans_glaz_transient = SurfDirNor / DNI;
else
Trans_glaz_transient = Trans_glazinglosses_Schlick;
end if;
annotation(Icon(coordinateSystem(extent = {{-100,-100},{100,100}}, preserveAspectRatio = true, initialScale = 0.1, grid = {2,2})), Diagram(coordinateSystem(extent = {{-100,-100},{100,100}}, preserveAspectRatio = true, initialScale = 0.1, grid = {2,2})));
end GlazingTransmittance_ETFE;
class RotationMatrixForSphericalCood "This models changes the reference frame from the Solar Altitude / Aizmuth to the surface yaw and pitch angles based on building orientatino and surface tilt"
// parameter Real RollAng = 0; Not included in current model verison
Modelica.Blocks.Interfaces.RealOutput arrayYaw annotation(Placement(visible = true, transformation(origin = {100,60}, extent = {{-10,-10},{10,10}}, rotation = 0), iconTransformation(origin = {100,60}, extent = {{-15,-15},{15,15}}, rotation = 0)));
Modelica.Blocks.Interfaces.RealOutput arrayPitch annotation(Placement(visible = true, transformation(origin = {100,-40}, extent = {{-10,-10},{10,10}}, rotation = 0), iconTransformation(origin = {100,-40}, extent = {{-15,-15},{15,15}}, rotation = 0)));
// Construction of Spherical to Cartesain Matrix
Real phi = 3 * Modelica.Constants.pi / 2 - SunAzi;
Real theta = Modelica.Constants.pi / 2 - SunAlt "Solar Zeneth Angle";
Real PitchAng = SurfaceTilt "Tilt back from Vertical Position";
Real YawAng = SurfaceOrientation "Zero is direct SOUTH";
Real vSphToCart[3,1] = [Modelica.Math.sin(theta) * Modelica.Math.cos(phi);Modelica.Math.sin(theta) * Modelica.Math.sin(phi);Modelica.Math.cos(theta)];
// Result of Cartesian to Spherical
Real vCartToSph[3,1];
// Rotation around X-axis --> RollAng
Real Rx[3,3] = [1,0,0;0,Modelica.Math.cos(PitchAng),-1 * Modelica.Math.sin(PitchAng);0,Modelica.Math.sin(PitchAng),Modelica.Math.cos(PitchAng)];
// Rotation around Y-axis --> PitchAng
// Real Ry[3,3] = [Modelica.Math.cos(-1*PitchAng),0,Modelica.Math.sin(-1*PitchAng);0,1,0;-1 * Modelica.Math.sin(-1*PitchAng),0,Modelica.Math.cos(-1*PitchAng)];
// Rotation around the Z-axis --> YawAng
Real Rz[3,3] = [Modelica.Math.cos(YawAng),-1 * Modelica.Math.sin(YawAng),0;Modelica.Math.sin(YawAng),Modelica.Math.cos(YawAng),0;0,0,1];
Modelica.Blocks.Interfaces.RealInput SunAzi annotation(Placement(visible = true, transformation(origin = {-100,60}, extent = {{-10,-10},{10,10}}, rotation = 0), iconTransformation(origin = {-100,80}, extent = {{-15,-15},{15,15}}, rotation = 0)));
Modelica.Blocks.Interfaces.RealInput SunAlt annotation(Placement(visible = true, transformation(origin = {-100,-40}, extent = {{-10,-10},{10,10}}, rotation = 0), iconTransformation(origin = {-100,40}, extent = {{-15,-15},{15,15}}, rotation = 0)));
Modelica.Blocks.Interfaces.RealInput SurfaceOrientation annotation(Placement(visible = true, transformation(origin = {-100,-20}, extent = {{-10,-10},{10,10}}, rotation = 0), iconTransformation(origin = {-100,0}, extent = {{-15,-15},{15,15}}, rotation = 0)));
Modelica.Blocks.Interfaces.RealInput SurfaceTilt annotation(Placement(visible = true, transformation(origin = {-100,-60}, extent = {{-10,-10},{10,10}}, rotation = 0), iconTransformation(origin = {-100,-40}, extent = {{-15,-15},{15,15}}, rotation = 0)));
equation
vCartToSph = Rx * Rz * vSphToCart;
arrayPitch = Modelica.Constants.pi / 2 - Modelica.Math.acos(vCartToSph[3,1]);
arrayYaw = (-1 * Modelica.Math.atan(vCartToSph[2,1] / vCartToSph[1,1])) - sign(vCartToSph[1,1]) * Modelica.Constants.pi / 2;
annotation(Diagram(coordinateSystem(extent = {{-100,-100},{100,100}}, preserveAspectRatio = true, initialScale = 0.1, grid = {2,2})), Icon(coordinateSystem(extent = {{-100,-100},{100,100}}, preserveAspectRatio = true, initialScale = 0.1, grid = {2,2}), graphics = {Text(origin = {16.0156,3.67356}, extent = {{-101.49,60.28},{73.98,-63.83}}, textString = "Transform Matrix")}), experiment(StartTime = 0, StopTime = 86400, Tolerance = 0.001, Interval = 86.5731));
end RotationMatrixForSphericalCood;
model CavityHeatBalance
extends ICSolar.Parameters;
Modelica.Thermal.HeatTransfer.Components.ThermalConductor Conduction_Exterior(G = 5.3 * GlassArea) "Lumped Thermal Conduction between Exterior and Cavity" annotation(Placement(visible = true, transformation(origin = {-40,20}, extent = {{-10,-10},{10,10}}, rotation = 0)));
Modelica.Thermal.HeatTransfer.Interfaces.HeatPort_a Interior annotation(Placement(visible = true, transformation(origin = {100,20}, extent = {{-10,-10},{10,10}}, rotation = 0), iconTransformation(origin = {-100,-40}, extent = {{-10,-10},{10,10}}, rotation = 0)));
Modelica.Thermal.HeatTransfer.Interfaces.HeatPort_a Exterior annotation(Placement(visible = true, transformation(origin = {-100,20}, extent = {{-10,-10},{10,10}}, rotation = 0), iconTransformation(origin = {-100,60}, extent = {{-10,-10},{10,10}}, rotation = 0)));
Modelica.Thermal.HeatTransfer.Components.HeatCapacitor CavityHeatCapacity(C = 2.072 * 1000) "Includes Air and ICS Components to add to the Heat Capacity of the Cavity" annotation(Placement(visible = true, transformation(origin = {0,40}, extent = {{-10,-10},{10,10}}, rotation = 0)));
Modelica.Thermal.HeatTransfer.Components.ThermalConductor Conduction_Interior(G = 1.7 * GlassArea) "Conduction Heat Transfer between Cavity and Interior" annotation(Placement(visible = true, transformation(origin = {40,20}, extent = {{-10,-10},{10,10}}, rotation = 180)));
Modelica.Thermal.HeatTransfer.Interfaces.HeatPort_b ICS_Heat annotation(Placement(visible = true, transformation(origin = {0,-100}, extent = {{-10,-10},{10,10}}, rotation = 0), iconTransformation(origin = {0,-100}, extent = {{-10,-10},{10,10}}, rotation = 0)));
equation
connect(Conduction_Interior.port_a,Interior) annotation(Line(points = {{50,20},{101.78,20},{101.78,20.4748},{101.78,20.4748}}));
connect(ICS_Heat,CavityHeatCapacity.port) annotation(Line(points = {{0,-100},{0.593472,-100},{0.593472,29.9703},{0.593472,29.9703}}));
connect(Conduction_Interior.port_b,CavityHeatCapacity.port) annotation(Line(points = {{30,20},{0.296736,20},{0.296736,29.3769},{0.296736,29.3769}}));
connect(Conduction_Exterior.port_b,CavityHeatCapacity.port) annotation(Line(points = {{-30,20},{0.296736,20},{0.296736,30.5638},{0.296736,30.5638}}));
connect(Exterior,Conduction_Exterior.port_a) annotation(Line(points = {{-100,20},{-50.1484,20},{-50.1484,20.4748},{-50.1484,20.4748}}));
annotation(Diagram(coordinateSystem(extent = {{-100,-100},{100,100}}, preserveAspectRatio = true, initialScale = 0.1, grid = {2,2})), Icon(coordinateSystem(extent = {{-100,-100},{100,100}}, preserveAspectRatio = true, initialScale = 0.1, grid = {2,2}), graphics = {Text(origin = {2.37855,61.2725}, extent = {{-50.45,33.98},{50.45,-33.98}}, textString = "Cavity"),Text(origin = {0.742849,12.7626}, extent = {{-52.37,30.56},{52.37,-30.56}}, textString = "Heat"),Text(origin = {2.22528,-43.7642}, extent = {{-61.28,22.7},{61.28,-22.7}}, textString = "Balance")}));
end CavityHeatBalance;
model DNIReduction_AreaFraction "Outputs area-based fraction of DNI that enters cassette but is not intercepted by modules, due to array geometry/transient orientation."
Modelica.Blocks.Interfaces.RealOutput DNI_out "DNI after area fraction reduction" annotation(Placement(visible = true, transformation(origin = {100,20}, extent = {{-10,-10},{10,10}}, rotation = 0), iconTransformation(origin = {100,20}, extent = {{-10,-10},{10,10}}, rotation = 0)));
Modelica.Blocks.Interfaces.RealInput DNI_in "DNI before area fraction reduction" annotation(Placement(visible = true, transformation(origin = {-100,80}, extent = {{-10,-10},{10,10}}, rotation = 0), iconTransformation(origin = {-100,80}, extent = {{-10,-10},{10,10}}, rotation = 0)));
Modelica.Blocks.Math.Product product1 "Multiplication of DNI area fraction" annotation(Placement(visible = true, transformation(origin = {20,40}, extent = {{-10,-10},{10,10}}, rotation = 0)));
Modelica.Blocks.Interfaces.RealInput arrayPitch "pitch (up/down) angle of 2axis tracking array (rads)" annotation(Placement(visible = true, transformation(origin = {-100,-20}, extent = {{-10,-10},{10,10}}, rotation = 0), iconTransformation(origin = {-100,0}, extent = {{-10,-10},{10,10}}, rotation = 0)));
Modelica.Blocks.Interfaces.RealInput arrayYaw "yaw (left/right) angle of tracking array (in radians)" annotation(Placement(visible = true, transformation(origin = {-100,-40}, extent = {{-10,-10},{10,10}}, rotation = 0), iconTransformation(origin = {-100,40}, extent = {{-10,-10},{10,10}}, rotation = 0)));
Modelica.Blocks.Tables.CombiTable2D AreaFraction(table = [0.0,-1.5708,-0.41888,-0.40143,-0.38397,-0.36652,-0.34907,-0.33161,-0.31416,-0.29671,-0.27925,-0.2618,-0.24435,-0.22689,-0.20944,-0.19199,-0.17453,-0.15708,-0.13963,-0.12217,-0.10472,-0.08727,-0.06981,-0.05236,-0.03491,-0.01745,0.0,0.01745,0.03491,0.05236,0.06981,0.08727,0.10472,0.12217,0.13963,0.15708,0.17453,0.19199,0.20944,0.22689,0.24435,0.2618,0.27925,0.29671,0.31416,0.33161,0.34907,0.36652,0.38397,0.40143,0.41888,1.5708;-1.5708,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,0.01043,0.02084,0.03126,0.04168,0.05209,0.06251,0.07292999999999999,0.08334,0.09376,0.10418,0.11459,0.12501,0.13543,0.14584,0.15626,0.16668,0.15626,0.14584,0.13543,0.12501,0.11459,0.10418,0.09376,0.08334,0.07292999999999999,0.06251,0.05209,0.04168,0.03126,0.02084,0.01043,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005;-0.61087,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,0.01043,0.02084,0.03126,0.04168,0.05209,0.06251,0.07292999999999999,0.08334,0.09376,0.10418,0.11459,0.12501,0.13543,0.14584,0.15626,0.16668,0.15626,0.14584,0.13543,0.12501,0.11459,0.10418,0.09376,0.08334,0.07292999999999999,0.06251,0.05209,0.04168,0.03126,0.02084,0.01043,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005;-0.59341,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,0.01043,0.02084,0.03126,0.04168,0.05209,0.06251,0.07292999999999999,0.08334,0.09376,0.10418,0.11459,0.12501,0.13543,0.14584,0.15626,0.16668,0.15626,0.14584,0.13543,0.12501,0.11459,0.10418,0.09376,0.08334,0.07292999999999999,0.06251,0.05209,0.04168,0.03126,0.02084,0.01043,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005;-0.57596,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,0.01043,0.02084,0.03126,0.04168,0.05209,0.06251,0.07292999999999999,0.08334,0.09376,0.10418,0.11459,0.12501,0.13543,0.14584,0.15626,0.16668,0.15626,0.14584,0.13543,0.12501,0.11459,0.10418,0.09376,0.08334,0.07292999999999999,0.06251,0.05209,0.04168,0.03126,0.02084,0.01043,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005;-0.55851,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,0.01043,0.02084,0.03126,0.04168,0.05209,0.06251,0.07292999999999999,0.08334,0.09376,0.10418,0.11459,0.12501,0.13543,0.14584,0.15626,0.16668,0.15626,0.14584,0.13543,0.12501,0.11459,0.10418,0.09376,0.08334,0.07292999999999999,0.06251,0.05209,0.04168,0.03126,0.02084,0.01043,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005;-0.54105,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,0.01043,0.02084,0.03126,0.04168,0.05209,0.06251,0.07292999999999999,0.08334,0.09376,0.10418,0.11459,0.12501,0.13543,0.14584,0.15626,0.16668,0.15626,0.14584,0.13543,0.12501,0.11459,0.10418,0.09376,0.08334,0.07292999999999999,0.06251,0.05209,0.04168,0.03126,0.02084,0.01043,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005;-0.5236,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,0.01043,0.02084,0.03126,0.04168,0.05209,0.06251,0.07292999999999999,0.08334,0.09376,0.10418,0.11459,0.12501,0.13543,0.14584,0.15626,0.16668,0.15626,0.14584,0.13543,0.12501,0.11459,0.10418,0.09376,0.08334,0.07292999999999999,0.06251,0.05209,0.04168,0.03126,0.02084,0.01043,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005;-0.50615,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,0.01043,0.02084,0.03126,0.04168,0.05209,0.06251,0.07292999999999999,0.08334,0.09376,0.10418,0.11459,0.12501,0.13543,0.14584,0.15626,0.16668,0.15626,0.14584,0.13543,0.12501,0.11459,0.10418,0.09376,0.08334,0.07292999999999999,0.06251,0.05209,0.04168,0.03126,0.02084,0.01043,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005;-0.48869,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,0.01043,0.02084,0.03126,0.04168,0.05209,0.06251,0.07292999999999999,0.08334,0.09376,0.10418,0.11459,0.12501,0.13543,0.14584,0.15626,0.16668,0.15626,0.14584,0.13543,0.12501,0.11459,0.10418,0.09376,0.08334,0.07292999999999999,0.06251,0.05209,0.04168,0.03126,0.02084,0.01043,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005;-0.47124,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,0.01043,0.02084,0.03126,0.04168,0.05209,0.06251,0.07292999999999999,0.08334,0.09376,0.10418,0.11459,0.12501,0.13543,0.14584,0.15626,0.16668,0.15626,0.14584,0.13543,0.12501,0.11459,0.10418,0.09376,0.08334,0.07292999999999999,0.06251,0.05209,0.04168,0.03126,0.02084,0.01043,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005;-0.45379,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,0.01043,0.02084,0.03126,0.04168,0.05209,0.06251,0.07292999999999999,0.08334,0.09376,0.10418,0.11459,0.12501,0.13543,0.14584,0.15626,0.16668,0.15626,0.14584,0.13543,0.12501,0.11459,0.10418,0.09376,0.08334,0.07292999999999999,0.06251,0.05209,0.04168,0.03126,0.02084,0.01043,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005;-0.43633,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,0.01043,0.02084,0.03126,0.04168,0.05209,0.06251,0.07292999999999999,0.08334,0.09376,0.10418,0.11459,0.12501,0.13543,0.14584,0.15626,0.16668,0.15626,0.14584,0.13543,0.12501,0.11459,0.10418,0.09376,0.08334,0.07292999999999999,0.06251,0.05209,0.04168,0.03126,0.02084,0.01043,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005;-0.41888,0.00523,0.00523,0.00523,0.00523,0.00523,0.00523,0.00523,0.00523,0.00523,0.00523,0.01559,0.02595,0.03631,0.04668,0.05704,0.0674,0.07776,0.08813,0.09848999999999999,0.10885,0.11921,0.12958,0.13994,0.1503,0.16066,0.17102,0.16066,0.1503,0.13994,0.12958,0.11921,0.10885,0.09848999999999999,0.08813,0.07776,0.0674,0.05704,0.04668,0.03631,0.02595,0.01559,0.00523,0.00523,0.00523,0.00523,0.00523,0.00523,0.00523,0.00523,0.00523,0.00523;-0.40143,0.01044,0.01044,0.01044,0.01044,0.01044,0.01044,0.01044,0.01044,0.01044,0.01044,0.02075,0.03106,0.04137,0.05168,0.06198,0.07228999999999999,0.08260000000000001,0.09291000000000001,0.10322,0.11352,0.12383,0.13414,0.14445,0.15476,0.16506,0.17537,0.16506,0.15476,0.14445,0.13414,0.12383,0.11352,0.10322,0.09291000000000001,0.08260000000000001,0.07228999999999999,0.06198,0.05168,0.04137,0.03106,0.02075,0.01044,0.01044,0.01044,0.01044,0.01044,0.01044,0.01044,0.01044,0.01044,0.01044;-0.38397,0.01566,0.01566,0.01566,0.01566,0.01566,0.01566,0.01566,0.01566,0.01566,0.01566,0.02592,0.03617,0.04642,0.05668,0.06693,0.07718,0.08744,0.09769,0.10794,0.1182,0.12845,0.13871,0.14896,0.15921,0.16947,0.17972,0.16947,0.15921,0.14896,0.13871,0.12845,0.1182,0.10794,0.09769,0.08744,0.07718,0.06693,0.05668,0.04642,0.03617,0.02592,0.01566,0.01566,0.01566,0.01566,0.01566,0.01566,0.01566,0.01566,0.01566,0.01566;-0.36652,0.02088,0.02088,0.02088,0.02088,0.02088,0.02088,0.02088,0.02088,0.02088,0.02088,0.03108,0.04128,0.05148,0.06168,0.07188,0.08208,0.09227,0.10247,0.11267,0.12287,0.13307,0.14327,0.15347,0.16367,0.17387,0.18407,0.17387,0.16367,0.15347,0.14327,0.13307,0.12287,0.11267,0.10247,0.09227,0.08208,0.07188,0.06168,0.05148,0.04128,0.03108,0.02088,0.02088,0.02088,0.02088,0.02088,0.02088,0.02088,0.02088,0.02088,0.02088;-0.34907,0.0261,0.0261,0.0261,0.0261,0.0261,0.0261,0.0261,0.0261,0.0261,0.0261,0.03624,0.04639,0.05653,0.06668,0.07682,0.08697000000000001,0.09711,0.10726,0.1174,0.12755,0.13769,0.14784,0.15798,0.16813,0.17827,0.18842,0.17827,0.16813,0.15798,0.14784,0.13769,0.12755,0.1174,0.10726,0.09711,0.08697000000000001,0.07682,0.06668,0.05653,0.04639,0.03624,0.0261,0.0261,0.0261,0.0261,0.0261,0.0261,0.0261,0.0261,0.0261,0.0261;-0.33161,0.03131,0.03131,0.03131,0.03131,0.03131,0.03131,0.03131,0.03131,0.03131,0.03131,0.0414,0.0515,0.06159,0.07167999999999999,0.08177,0.09186,0.10195,0.11204,0.12213,0.13222,0.14231,0.1524,0.16249,0.17258,0.18267,0.19276,0.18267,0.17258,0.16249,0.1524,0.14231,0.13222,0.12213,0.11204,0.10195,0.09186,0.08177,0.07167999999999999,0.06159,0.0515,0.0414,0.03131,0.03131,0.03131,0.03131,0.03131,0.03131,0.03131,0.03131,0.03131,0.03131;-0.31416,0.03653,0.03653,0.03653,0.03653,0.03653,0.03653,0.03653,0.03653,0.03653,0.03653,0.04657,0.0566,0.06664,0.07668,0.08671,0.09675,0.10679,0.11682,0.12686,0.13689,0.14693,0.15697,0.167,0.17704,0.18708,0.19711,0.18708,0.17704,0.167,0.15697,0.14693,0.13689,0.12686,0.11682,0.10679,0.09675,0.08671,0.07668,0.06664,0.0566,0.04657,0.03653,0.03653,0.03653,0.03653,0.03653,0.03653,0.03653,0.03653,0.03653,0.03653;-0.29671,0.04175,0.04175,0.04175,0.04175,0.04175,0.04175,0.04175,0.04175,0.04175,0.04175,0.05173,0.06171,0.07169,0.08168,0.09166000000000001,0.10164,0.11162,0.1216,0.13159,0.14157,0.15155,0.16153,0.17151,0.1815,0.19148,0.20146,0.19148,0.1815,0.17151,0.16153,0.15155,0.14157,0.13159,0.1216,0.11162,0.10164,0.09166000000000001,0.08168,0.07169,0.06171,0.05173,0.04175,0.04175,0.04175,0.04175,0.04175,0.04175,0.04175,0.04175,0.04175,0.04175;-0.27925,0.04697,0.04697,0.04697,0.04697,0.04697,0.04697,0.04697,0.04697,0.04697,0.04697,0.05689,0.06682,0.07675,0.08667999999999999,0.09660000000000001,0.10653,0.11646,0.12639,0.13631,0.14624,0.15617,0.1661,0.17602,0.18595,0.19588,0.20581,0.19588,0.18595,0.17602,0.1661,0.15617,0.14624,0.13631,0.12639,0.11646,0.10653,0.09660000000000001,0.08667999999999999,0.07675,0.06682,0.05689,0.04697,0.04697,0.04697,0.04697,0.04697,0.04697,0.04697,0.04697,0.04697,0.04697;-0.2618,0.05218,0.05218,0.05218,0.05218,0.05218,0.05218,0.05218,0.05218,0.05218,0.05218,0.06206,0.07192999999999999,0.0818,0.09168,0.10155,0.11142,0.1213,0.13117,0.14104,0.15092,0.16079,0.17066,0.18054,0.19041,0.20028,0.21015,0.20028,0.19041,0.18054,0.17066,0.16079,0.15092,0.14104,0.13117,0.1213,0.11142,0.10155,0.09168,0.0818,0.07192999999999999,0.06206,0.05218,0.05218,0.05218,0.05218,0.05218,0.05218,0.05218,0.05218,0.05218,0.05218;-0.24435,0.0574,0.0574,0.0574,0.0574,0.0574,0.0574,0.0574,0.0574,0.0574,0.0574,0.06722,0.07704,0.08686000000000001,0.09668,0.1065,0.11631,0.12613,0.13595,0.14577,0.15559,0.16541,0.17523,0.18505,0.19487,0.20468,0.2145,0.20468,0.19487,0.18505,0.17523,0.16541,0.15559,0.14577,0.13595,0.12613,0.11631,0.1065,0.09668,0.08686000000000001,0.07704,0.06722,0.0574,0.0574,0.0574,0.0574,0.0574,0.0574,0.0574,0.0574,0.0574,0.0574;-0.22689,0.06262,0.06262,0.06262,0.06262,0.06262,0.06262,0.06262,0.06262,0.06262,0.06262,0.07238,0.08215,0.09191000000000001,0.10168,0.11144,0.12121,0.13097,0.14073,0.1505,0.16026,0.17003,0.17979,0.18956,0.19932,0.20909,0.21885,0.20909,0.19932,0.18956,0.17979,0.17003,0.16026,0.1505,0.14073,0.13097,0.12121,0.11144,0.10168,0.09191000000000001,0.08215,0.07238,0.06262,0.06262,0.06262,0.06262,0.06262,0.06262,0.06262,0.06262,0.06262,0.06262;-0.20944,0.06784,0.06784,0.06784,0.06784,0.06784,0.06784,0.06784,0.06784,0.06784,0.06784,0.07754999999999999,0.08726,0.09697,0.10668,0.11639,0.1261,0.13581,0.14552,0.15523,0.16494,0.17465,0.18436,0.19407,0.20378,0.21349,0.2232,0.21349,0.20378,0.19407,0.18436,0.17465,0.16494,0.15523,0.14552,0.13581,0.1261,0.11639,0.10668,0.09697,0.08726,0.07754999999999999,0.06784,0.06784,0.06784,0.06784,0.06784,0.06784,0.06784,0.06784,0.06784,0.06784;-0.19199,0.07305,0.07305,0.07305,0.07305,0.07305,0.07305,0.07305,0.07305,0.07305,0.07305,0.08271000000000001,0.09236999999999999,0.10202,0.11168,0.12133,0.13099,0.14064,0.1503,0.15996,0.16961,0.17927,0.18892,0.19858,0.20823,0.21789,0.22755,0.21789,0.20823,0.19858,0.18892,0.17927,0.16961,0.15996,0.1503,0.14064,0.13099,0.12133,0.11168,0.10202,0.09236999999999999,0.08271000000000001,0.07305,0.07305,0.07305,0.07305,0.07305,0.07305,0.07305,0.07305,0.07305,0.07305;-0.17453,0.07827000000000001,0.07827000000000001,0.07827000000000001,0.07827000000000001,0.07827000000000001,0.07827000000000001,0.07827000000000001,0.07827000000000001,0.07827000000000001,0.07827000000000001,0.08787,0.09747,0.10708,0.11668,0.12628,0.13588,0.14548,0.15508,0.16468,0.17429,0.18389,0.19349,0.20309,0.21269,0.22229,0.23189,0.22229,0.21269,0.20309,0.19349,0.18389,0.17429,0.16468,0.15508,0.14548,0.13588,0.12628,0.11668,0.10708,0.09747,0.08787,0.07827000000000001,0.07827000000000001,0.07827000000000001,0.07827000000000001,0.07827000000000001,0.07827000000000001,0.07827000000000001,0.07827000000000001,0.07827000000000001,0.07827000000000001;-0.15708,0.08348999999999999,0.08348999999999999,0.08348999999999999,0.08348999999999999,0.08348999999999999,0.08348999999999999,0.08348999999999999,0.08348999999999999,0.08348999999999999,0.08348999999999999,0.09304,0.10258,0.11213,0.12168,0.13122,0.14077,0.15032,0.15987,0.16941,0.17896,0.18851,0.19805,0.2076,0.21715,0.22669,0.23624,0.22669,0.21715,0.2076,0.19805,0.18851,0.17896,0.16941,0.15987,0.15032,0.14077,0.13122,0.12168,0.11213,0.10258,0.09304,0.08348999999999999,0.08348999999999999,0.08348999999999999,0.08348999999999999,0.08348999999999999,0.08348999999999999,0.08348999999999999,0.08348999999999999,0.08348999999999999,0.08348999999999999;-0.13963,0.08871,0.08871,0.08871,0.08871,0.08871,0.08871,0.08871,0.08871,0.08871,0.08871,0.0982,0.10769,0.11718,0.12668,0.13617,0.14566,0.15515,0.16465,0.17414,0.18363,0.19313,0.20262,0.21211,0.2216,0.2311,0.24059,0.2311,0.2216,0.21211,0.20262,0.19313,0.18363,0.17414,0.16465,0.15515,0.14566,0.13617,0.12668,0.11718,0.10769,0.0982,0.08871,0.08871,0.08871,0.08871,0.08871,0.08871,0.08871,0.08871,0.08871,0.08871;-0.12217,0.09392,0.09392,0.09392,0.09392,0.09392,0.09392,0.09392,0.09392,0.09392,0.09392,0.10336,0.1128,0.12224,0.13168,0.14112,0.15055,0.15999,0.16943,0.17887,0.18831,0.19775,0.20718,0.21662,0.22606,0.2355,0.24494,0.2355,0.22606,0.21662,0.20718,0.19775,0.18831,0.17887,0.16943,0.15999,0.15055,0.14112,0.13168,0.12224,0.1128,0.10336,0.09392,0.09392,0.09392,0.09392,0.09392,0.09392,0.09392,0.09392,0.09392,0.09392;-0.10472,0.09914000000000001,0.09914000000000001,0.09914000000000001,0.09914000000000001,0.09914000000000001,0.09914000000000001,0.09914000000000001,0.09914000000000001,0.09914000000000001,0.09914000000000001,0.10852,0.11791,0.12729,0.13668,0.14606,0.15544,0.16483,0.17421,0.1836,0.19298,0.20237,0.21175,0.22113,0.23052,0.2399,0.24929,0.2399,0.23052,0.22113,0.21175,0.20237,0.19298,0.1836,0.17421,0.16483,0.15544,0.14606,0.13668,0.12729,0.11791,0.10852,0.09914000000000001,0.09914000000000001,0.09914000000000001,0.09914000000000001,0.09914000000000001,0.09914000000000001,0.09914000000000001,0.09914000000000001,0.09914000000000001,0.09914000000000001;-0.08727,0.10436,0.10436,0.10436,0.10436,0.10436,0.10436,0.10436,0.10436,0.10436,0.10436,0.11369,0.12302,0.13235,0.14168,0.15101,0.16034,0.16967,0.179,0.18833,0.19765,0.20698,0.21631,0.22564,0.23497,0.2443,0.25363,0.2443,0.23497,0.22564,0.21631,0.20698,0.19765,0.18833,0.179,0.16967,0.16034,0.15101,0.14168,0.13235,0.12302,0.11369,0.10436,0.10436,0.10436,0.10436,0.10436,0.10436,0.10436,0.10436,0.10436,0.10436;-0.06981,0.10958,0.10958,0.10958,0.10958,0.10958,0.10958,0.10958,0.10958,0.10958,0.10958,0.11885,0.12813,0.1374,0.14668,0.15595,0.16523,0.1745,0.18378,0.19305,0.20233,0.2116,0.22088,0.23015,0.23943,0.24871,0.25798,0.24871,0.23943,0.23015,0.22088,0.2116,0.20233,0.19305,0.18378,0.1745,0.16523,0.15595,0.14668,0.1374,0.12813,0.11885,0.10958,0.10958,0.10958,0.10958,0.10958,0.10958,0.10958,0.10958,0.10958,0.10958;-0.05236,0.11479,0.11479,0.11479,0.11479,0.11479,0.11479,0.11479,0.11479,0.11479,0.11479,0.12401,0.13323,0.14246,0.15168,0.1609,0.17012,0.17934,0.18856,0.19778,0.207,0.21622,0.22544,0.23467,0.24389,0.25311,0.26233,0.25311,0.24389,0.23467,0.22544,0.21622,0.207,0.19778,0.18856,0.17934,0.17012,0.1609,0.15168,0.14246,0.13323,0.12401,0.11479,0.11479,0.11479,0.11479,0.11479,0.11479,0.11479,0.11479,0.11479,0.11479;-0.03491,0.12001,0.12001,0.12001,0.12001,0.12001,0.12001,0.12001,0.12001,0.12001,0.12001,0.12918,0.13834,0.14751,0.15668,0.16584,0.17501,0.18418,0.19334,0.20251,0.21168,0.22084,0.23001,0.23918,0.24834,0.25751,0.26668,0.25751,0.24834,0.23918,0.23001,0.22084,0.21168,0.20251,0.19334,0.18418,0.17501,0.16584,0.15668,0.14751,0.13834,0.12918,0.12001,0.12001,0.12001,0.12001,0.12001,0.12001,0.12001,0.12001,0.12001,0.12001;-0.01745,0.12523,0.12523,0.12523,0.12523,0.12523,0.12523,0.12523,0.12523,0.12523,0.12523,0.13434,0.14345,0.15256,0.16168,0.17079,0.1799,0.18901,0.19813,0.20724,0.21635,0.22546,0.23458,0.24369,0.2528,0.26191,0.27102,0.26191,0.2528,0.24369,0.23458,0.22546,0.21635,0.20724,0.19813,0.18901,0.1799,0.17079,0.16168,0.15256,0.14345,0.13434,0.12523,0.12523,0.12523,0.12523,0.12523,0.12523,0.12523,0.12523,0.12523,0.12523;0.0,0.13044,0.13044,0.13044,0.13044,0.13044,0.13044,0.13044,0.13044,0.13044,0.13044,0.1395,0.14856,0.15762,0.16668,0.17573,0.18479,0.19385,0.20291,0.21197,0.22102,0.23008,0.23914,0.2482,0.25726,0.26631,0.27537,0.26631,0.25726,0.2482,0.23914,0.23008,0.22102,0.21197,0.20291,0.19385,0.18479,0.17573,0.16668,0.15762,0.14856,0.1395,0.13044,0.13044,0.13044,0.13044,0.13044,0.13044,0.13044,0.13044,0.13044,0.13044;0.01745,0.12523,0.12523,0.12523,0.12523,0.12523,0.12523,0.12523,0.12523,0.12523,0.12523,0.13434,0.14345,0.15256,0.16168,0.17079,0.1799,0.18901,0.19813,0.20724,0.21635,0.22546,0.23458,0.24369,0.2528,0.26191,0.27102,0.26191,0.2528,0.24369,0.23458,0.22546,0.21635,0.20724,0.19813,0.18901,0.1799,0.17079,0.16168,0.15256,0.14345,0.13434,0.12523,0.12523,0.12523,0.12523,0.12523,0.12523,0.12523,0.12523,0.12523,0.12523;0.03491,0.12001,0.12001,0.12001,0.12001,0.12001,0.12001,0.12001,0.12001,0.12001,0.12001,0.12918,0.13834,0.14751,0.15668,0.16584,0.17501,0.18418,0.19334,0.20251,0.21168,0.22084,0.23001,0.23918,0.24834,0.25751,0.26668,0.25751,0.24834,0.23918,0.23001,0.22084,0.21168,0.20251,0.19334,0.18418,0.17501,0.16584,0.15668,0.14751,0.13834,0.12918,0.12001,0.12001,0.12001,0.12001,0.12001,0.12001,0.12001,0.12001,0.12001,0.12001;0.05236,0.11479,0.11479,0.11479,0.11479,0.11479,0.11479,0.11479,0.11479,0.11479,0.11479,0.12401,0.13323,0.14246,0.15168,0.1609,0.17012,0.17934,0.18856,0.19778,0.207,0.21622,0.22544,0.23467,0.24389,0.25311,0.26233,0.25311,0.24389,0.23467,0.22544,0.21622,0.207,0.19778,0.18856,0.17934,0.17012,0.1609,0.15168,0.14246,0.13323,0.12401,0.11479,0.11479,0.11479,0.11479,0.11479,0.11479,0.11479,0.11479,0.11479,0.11479;0.06981,0.10958,0.10958,0.10958,0.10958,0.10958,0.10958,0.10958,0.10958,0.10958,0.10958,0.11885,0.12813,0.1374,0.14668,0.15595,0.16523,0.1745,0.18378,0.19305,0.20233,0.2116,0.22088,0.23015,0.23943,0.24871,0.25798,0.24871,0.23943,0.23015,0.22088,0.2116,0.20233,0.19305,0.18378,0.1745,0.16523,0.15595,0.14668,0.1374,0.12813,0.11885,0.10958,0.10958,0.10958,0.10958,0.10958,0.10958,0.10958,0.10958,0.10958,0.10958;0.08727,0.10436,0.10436,0.10436,0.10436,0.10436,0.10436,0.10436,0.10436,0.10436,0.10436,0.11369,0.12302,0.13235,0.14168,0.15101,0.16034,0.16967,0.179,0.18833,0.19765,0.20698,0.21631,0.22564,0.23497,0.2443,0.25363,0.2443,0.23497,0.22564,0.21631,0.20698,0.19765,0.18833,0.179,0.16967,0.16034,0.15101,0.14168,0.13235,0.12302,0.11369,0.10436,0.10436,0.10436,0.10436,0.10436,0.10436,0.10436,0.10436,0.10436,0.10436;0.10472,0.09914000000000001,0.09914000000000001,0.09914000000000001,0.09914000000000001,0.09914000000000001,0.09914000000000001,0.09914000000000001,0.09914000000000001,0.09914000000000001,0.09914000000000001,0.10852,0.11791,0.12729,0.13668,0.14606,0.15544,0.16483,0.17421,0.1836,0.19298,0.20237,0.21175,0.22113,0.23052,0.2399,0.24929,0.2399,0.23052,0.22113,0.21175,0.20237,0.19298,0.1836,0.17421,0.16483,0.15544,0.14606,0.13668,0.12729,0.11791,0.10852,0.09914000000000001,0.09914000000000001,0.09914000000000001,0.09914000000000001,0.09914000000000001,0.09914000000000001,0.09914000000000001,0.09914000000000001,0.09914000000000001,0.09914000000000001;0.12217,0.09392,0.09392,0.09392,0.09392,0.09392,0.09392,0.09392,0.09392,0.09392,0.09392,0.10336,0.1128,0.12224,0.13168,0.14112,0.15055,0.15999,0.16943,0.17887,0.18831,0.19775,0.20718,0.21662,0.22606,0.2355,0.24494,0.2355,0.22606,0.21662,0.20718,0.19775,0.18831,0.17887,0.16943,0.15999,0.15055,0.14112,0.13168,0.12224,0.1128,0.10336,0.09392,0.09392,0.09392,0.09392,0.09392,0.09392,0.09392,0.09392,0.09392,0.09392;0.13963,0.08871,0.08871,0.08871,0.08871,0.08871,0.08871,0.08871,0.08871,0.08871,0.08871,0.0982,0.10769,0.11718,0.12668,0.13617,0.14566,0.15515,0.16465,0.17414,0.18363,0.19313,0.20262,0.21211,0.2216,0.2311,0.24059,0.2311,0.2216,0.21211,0.20262,0.19313,0.18363,0.17414,0.16465,0.15515,0.14566,0.13617,0.12668,0.11718,0.10769,0.0982,0.08871,0.08871,0.08871,0.08871,0.08871,0.08871,0.08871,0.08871,0.08871,0.08871;0.15708,0.08348999999999999,0.08348999999999999,0.08348999999999999,0.08348999999999999,0.08348999999999999,0.08348999999999999,0.08348999999999999,0.08348999999999999,0.08348999999999999,0.08348999999999999,0.09304,0.10258,0.11213,0.12168,0.13122,0.14077,0.15032,0.15987,0.16941,0.17896,0.18851,0.19805,0.2076,0.21715,0.22669,0.23624,0.22669,0.21715,0.2076,0.19805,0.18851,0.17896,0.16941,0.15987,0.15032,0.14077,0.13122,0.12168,0.11213,0.10258,0.09304,0.08348999999999999,0.08348999999999999,0.08348999999999999,0.08348999999999999,0.08348999999999999,0.08348999999999999,0.08348999999999999,0.08348999999999999,0.08348999999999999,0.08348999999999999;0.17453,0.07827000000000001,0.07827000000000001,0.07827000000000001,0.07827000000000001,0.07827000000000001,0.07827000000000001,0.07827000000000001,0.07827000000000001,0.07827000000000001,0.07827000000000001,0.08787,0.09747,0.10708,0.11668,0.12628,0.13588,0.14548,0.15508,0.16468,0.17429,0.18389,0.19349,0.20309,0.21269,0.22229,0.23189,0.22229,0.21269,0.20309,0.19349,0.18389,0.17429,0.16468,0.15508,0.14548,0.13588,0.12628,0.11668,0.10708,0.09747,0.08787,0.07827000000000001,0.07827000000000001,0.07827000000000001,0.07827000000000001,0.07827000000000001,0.07827000000000001,0.07827000000000001,0.07827000000000001,0.07827000000000001,0.07827000000000001;0.19199,0.07305,0.07305,0.07305,0.07305,0.07305,0.07305,0.07305,0.07305,0.07305,0.07305,0.08271000000000001,0.09236999999999999,0.10202,0.11168,0.12133,0.13099,0.14064,0.1503,0.15996,0.16961,0.17927,0.18892,0.19858,0.20823,0.21789,0.22755,0.21789,0.20823,0.19858,0.18892,0.17927,0.16961,0.15996,0.1503,0.14064,0.13099,0.12133,0.11168,0.10202,0.09236999999999999,0.08271000000000001,0.07305,0.07305,0.07305,0.07305,0.07305,0.07305,0.07305,0.07305,0.07305,0.07305;0.20944,0.06784,0.06784,0.06784,0.06784,0.06784,0.06784,0.06784,0.06784,0.06784,0.06784,0.07754999999999999,0.08726,0.09697,0.10668,0.11639,0.1261,0.13581,0.14552,0.15523,0.16494,0.17465,0.18436,0.19407,0.20378,0.21349,0.2232,0.21349,0.20378,0.19407,0.18436,0.17465,0.16494,0.15523,0.14552,0.13581,0.1261,0.11639,0.10668,0.09697,0.08726,0.07754999999999999,0.06784,0.06784,0.06784,0.06784,0.06784,0.06784,0.06784,0.06784,0.06784,0.06784;0.22689,0.06262,0.06262,0.06262,0.06262,0.06262,0.06262,0.06262,0.06262,0.06262,0.06262,0.07238,0.08215,0.09191000000000001,0.10168,0.11144,0.12121,0.13097,0.14073,0.1505,0.16026,0.17003,0.17979,0.18956,0.19932,0.20909,0.21885,0.20909,0.19932,0.18956,0.17979,0.17003,0.16026,0.1505,0.14073,0.13097,0.12121,0.11144,0.10168,0.09191000000000001,0.08215,0.07238,0.06262,0.06262,0.06262,0.06262,0.06262,0.06262,0.06262,0.06262,0.06262,0.06262;0.24435,0.0574,0.0574,0.0574,0.0574,0.0574,0.0574,0.0574,0.0574,0.0574,0.0574,0.06722,0.07704,0.08686000000000001,0.09668,0.1065,0.11631,0.12613,0.13595,0.14577,0.15559,0.16541,0.17523,0.18505,0.19487,0.20468,0.2145,0.20468,0.19487,0.18505,0.17523,0.16541,0.15559,0.14577,0.13595,0.12613,0.11631,0.1065,0.09668,0.08686000000000001,0.07704,0.06722,0.0574,0.0574,0.0574,0.0574,0.0574,0.0574,0.0574,0.0574,0.0574,0.0574;0.2618,0.05218,0.05218,0.05218,0.05218,0.05218,0.05218,0.05218,0.05218,0.05218,0.05218,0.06206,0.07192999999999999,0.0818,0.09168,0.10155,0.11142,0.1213,0.13117,0.14104,0.15092,0.16079,0.17066,0.18054,0.19041,0.20028,0.21015,0.20028,0.19041,0.18054,0.17066,0.16079,0.15092,0.14104,0.13117,0.1213,0.11142,0.10155,0.09168,0.0818,0.07192999999999999,0.06206,0.05218,0.05218,0.05218,0.05218,0.05218,0.05218,0.05218,0.05218,0.05218,0.05218;0.27925,0.04697,0.04697,0.04697,0.04697,0.04697,0.04697,0.04697,0.04697,0.04697,0.04697,0.05689,0.06682,0.07675,0.08667999999999999,0.09660000000000001,0.10653,0.11646,0.12639,0.13631,0.14624,0.15617,0.1661,0.17602,0.18595,0.19588,0.20581,0.19588,0.18595,0.17602,0.1661,0.15617,0.14624,0.13631,0.12639,0.11646,0.10653,0.09660000000000001,0.08667999999999999,0.07675,0.06682,0.05689,0.04697,0.04697,0.04697,0.04697,0.04697,0.04697,0.04697,0.04697,0.04697,0.04697;0.29671,0.04175,0.04175,0.04175,0.04175,0.04175,0.04175,0.04175,0.04175,0.04175,0.04175,0.05173,0.06171,0.07169,0.08168,0.09166000000000001,0.10164,0.11162,0.1216,0.13159,0.14157,0.15155,0.16153,0.17151,0.1815,0.19148,0.20146,0.19148,0.1815,0.17151,0.16153,0.15155,0.14157,0.13159,0.1216,0.11162,0.10164,0.09166000000000001,0.08168,0.07169,0.06171,0.05173,0.04175,0.04175,0.04175,0.04175,0.04175,0.04175,0.04175,0.04175,0.04175,0.04175;0.31416,0.03653,0.03653,0.03653,0.03653,0.03653,0.03653,0.03653,0.03653,0.03653,0.03653,0.04657,0.0566,0.06664,0.07668,0.08671,0.09675,0.10679,0.11682,0.12686,0.13689,0.14693,0.15697,0.167,0.17704,0.18708,0.19711,0.18708,0.17704,0.167,0.15697,0.14693,0.13689,0.12686,0.11682,0.10679,0.09675,0.08671,0.07668,0.06664,0.0566,0.04657,0.03653,0.03653,0.03653,0.03653,0.03653,0.03653,0.03653,0.03653,0.03653,0.03653;0.33161,0.03131,0.03131,0.03131,0.03131,0.03131,0.03131,0.03131,0.03131,0.03131,0.03131,0.0414,0.0515,0.06159,0.07167999999999999,0.08177,0.09186,0.10195,0.11204,0.12213,0.13222,0.14231,0.1524,0.16249,0.17258,0.18267,0.19276,0.18267,0.17258,0.16249,0.1524,0.14231,0.13222,0.12213,0.11204,0.10195,0.09186,0.08177,0.07167999999999999,0.06159,0.0515,0.0414,0.03131,0.03131,0.03131,0.03131,0.03131,0.03131,0.03131,0.03131,0.03131,0.03131;0.34907,0.0261,0.0261,0.0261,0.0261,0.0261,0.0261,0.0261,0.0261,0.0261,0.0261,0.03624,0.04639,0.05653,0.06668,0.07682,0.08697000000000001,0.09711,0.10726,0.1174,0.12755,0.13769,0.14784,0.15798,0.16813,0.17827,0.18842,0.17827,0.16813,0.15798,0.14784,0.13769,0.12755,0.1174,0.10726,0.09711,0.08697000000000001,0.07682,0.06668,0.05653,0.04639,0.03624,0.0261,0.0261,0.0261,0.0261,0.0261,0.0261,0.0261,0.0261,0.0261,0.0261;0.36652,0.02088,0.02088,0.02088,0.02088,0.02088,0.02088,0.02088,0.02088,0.02088,0.02088,0.03108,0.04128,0.05148,0.06168,0.07188,0.08208,0.09227,0.10247,0.11267,0.12287,0.13307,0.14327,0.15347,0.16367,0.17387,0.18407,0.17387,0.16367,0.15347,0.14327,0.13307,0.12287,0.11267,0.10247,0.09227,0.08208,0.07188,0.06168,0.05148,0.04128,0.03108,0.02088,0.02088,0.02088,0.02088,0.02088,0.02088,0.02088,0.02088,0.02088,0.02088;0.38397,0.01566,0.01566,0.01566,0.01566,0.01566,0.01566,0.01566,0.01566,0.01566,0.01566,0.02592,0.03617,0.04642,0.05668,0.06693,0.07718,0.08744,0.09769,0.10794,0.1182,0.12845,0.13871,0.14896,0.15921,0.16947,0.17972,0.16947,0.15921,0.14896,0.13871,0.12845,0.1182,0.10794,0.09769,0.08744,0.07718,0.06693,0.05668,0.04642,0.03617,0.02592,0.01566,0.01566,0.01566,0.01566,0.01566,0.01566,0.01566,0.01566,0.01566,0.01566;0.40143,0.01044,0.01044,0.01044,0.01044,0.01044,0.01044,0.01044,0.01044,0.01044,0.01044,0.02075,0.03106,0.04137,0.05168,0.06198,0.07228999999999999,0.08260000000000001,0.09291000000000001,0.10322,0.11352,0.12383,0.13414,0.14445,0.15476,0.16506,0.17537,0.16506,0.15476,0.14445,0.13414,0.12383,0.11352,0.10322,0.09291000000000001,0.08260000000000001,0.07228999999999999,0.06198,0.05168,0.04137,0.03106,0.02075,0.01044,0.01044,0.01044,0.01044,0.01044,0.01044,0.01044,0.01044,0.01044,0.01044;0.41888,0.00523,0.00523,0.00523,0.00523,0.00523,0.00523,0.00523,0.00523,0.00523,0.00523,0.01559,0.02595,0.03631,0.04668,0.05704,0.0674,0.07776,0.08813,0.09848999999999999,0.10885,0.11921,0.12958,0.13994,0.1503,0.16066,0.17102,0.16066,0.1503,0.13994,0.12958,0.11921,0.10885,0.09848999999999999,0.08813,0.07776,0.0674,0.05704,0.04668,0.03631,0.02595,0.01559,0.00523,0.00523,0.00523,0.00523,0.00523,0.00523,0.00523,0.00523,0.00523,0.00523;0.43633,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,0.01043,0.02084,0.03126,0.04168,0.05209,0.06251,0.07292999999999999,0.08334,0.09376,0.10418,0.11459,0.12501,0.13543,0.14584,0.15626,0.16668,0.15626,0.14584,0.13543,0.12501,0.11459,0.10418,0.09376,0.08334,0.07292999999999999,0.06251,0.05209,0.04168,0.03126,0.02084,0.01043,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005;0.45379,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,0.01043,0.02084,0.03126,0.04168,0.05209,0.06251,0.07292999999999999,0.08334,0.09376,0.10418,0.11459,0.12501,0.13543,0.14584,0.15626,0.16668,0.15626,0.14584,0.13543,0.12501,0.11459,0.10418,0.09376,0.08334,0.07292999999999999,0.06251,0.05209,0.04168,0.03126,0.02084,0.01043,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005;0.47124,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,0.01043,0.02084,0.03126,0.04168,0.05209,0.06251,0.07292999999999999,0.08334,0.09376,0.10418,0.11459,0.12501,0.13543,0.14584,0.15626,0.16668,0.15626,0.14584,0.13543,0.12501,0.11459,0.10418,0.09376,0.08334,0.07292999999999999,0.06251,0.05209,0.04168,0.03126,0.02084,0.01043,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005;0.48869,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,0.01043,0.02084,0.03126,0.04168,0.05209,0.06251,0.07292999999999999,0.08334,0.09376,0.10418,0.11459,0.12501,0.13543,0.14584,0.15626,0.16668,0.15626,0.14584,0.13543,0.12501,0.11459,0.10418,0.09376,0.08334,0.07292999999999999,0.06251,0.05209,0.04168,0.03126,0.02084,0.01043,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005;0.50615,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,0.01043,0.02084,0.03126,0.04168,0.05209,0.06251,0.07292999999999999,0.08334,0.09376,0.10418,0.11459,0.12501,0.13543,0.14584,0.15626,0.16668,0.15626,0.14584,0.13543,0.12501,0.11459,0.10418,0.09376,0.08334,0.07292999999999999,0.06251,0.05209,0.04168,0.03126,0.02084,0.01043,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005;0.5236,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,0.01043,0.02084,0.03126,0.04168,0.05209,0.06251,0.07292999999999999,0.08334,0.09376,0.10418,0.11459,0.12501,0.13543,0.14584,0.15626,0.16668,0.15626,0.14584,0.13543,0.12501,0.11459,0.10418,0.09376,0.08334,0.07292999999999999,0.06251,0.05209,0.04168,0.03126,0.02084,0.01043,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005;0.54105,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,0.01043,0.02084,0.03126,0.04168,0.05209,0.06251,0.07292999999999999,0.08334,0.09376,0.10418,0.11459,0.12501,0.13543,0.14584,0.15626,0.16668,0.15626,0.14584,0.13543,0.12501,0.11459,0.10418,0.09376,0.08334,0.07292999999999999,0.06251,0.05209,0.04168,0.03126,0.02084,0.01043,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005;0.55851,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,0.01043,0.02084,0.03126,0.04168,0.05209,0.06251,0.07292999999999999,0.08334,0.09376,0.10418,0.11459,0.12501,0.13543,0.14584,0.15626,0.16668,0.15626,0.14584,0.13543,0.12501,0.11459,0.10418,0.09376,0.08334,0.07292999999999999,0.06251,0.05209,0.04168,0.03126,0.02084,0.01043,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005;0.57596,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,0.01043,0.02084,0.03126,0.04168,0.05209,0.06251,0.07292999999999999,0.08334,0.09376,0.10418,0.11459,0.12501,0.13543,0.14584,0.15626,0.16668,0.15626,0.14584,0.13543,0.12501,0.11459,0.10418,0.09376,0.08334,0.07292999999999999,0.06251,0.05209,0.04168,0.03126,0.02084,0.01043,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005;0.59341,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,0.01043,0.02084,0.03126,0.04168,0.05209,0.06251,0.07292999999999999,0.08334,0.09376,0.10418,0.11459,0.12501,0.13543,0.14584,0.15626,0.16668,0.15626,0.14584,0.13543,0.12501,0.11459,0.10418,0.09376,0.08334,0.07292999999999999,0.06251,0.05209,0.04168,0.03126,0.02084,0.01043,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005;0.61087,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,0.01043,0.02084,0.03126,0.04168,0.05209,0.06251,0.07292999999999999,0.08334,0.09376,0.10418,0.11459,0.12501,0.13543,0.14584,0.15626,0.16668,0.15626,0.14584,0.13543,0.12501,0.11459,0.10418,0.09376,0.08334,0.07292999999999999,0.06251,0.05209,0.04168,0.03126,0.02084,0.01043,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005;1.5708,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,0.01043,0.02084,0.03126,0.04168,0.05209,0.06251,0.07292999999999999,0.08334,0.09376,0.10418,0.11459,0.12501,0.13543,0.14584,0.15626,0.16668,0.15626,0.14584,0.13543,0.12501,0.11459,0.10418,0.09376,0.08334,0.07292999999999999,0.06251,0.05209,0.04168,0.03126,0.02084,0.01043,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005,1e-005]) "AreaFraction factors based on altitude and azimuth. bottoms out before 0 to avoid div by zero errors" annotation(Placement(visible = true, transformation(origin = {-40,-40}, extent = {{-10,-10},{10,10}}, rotation = 0)));
equation
connect(AreaFraction.y,product1.u2) annotation(Line(points = {{-29,-40},{-15.5102,-40},{-15.5102,34.5578},{7.89116,34.5578},{7.89116,34.5578}}, color = {0,0,127}));
connect(arrayPitch,AreaFraction.u1) annotation(Line(points = {{-100,-20},{-84.39019999999999,-20},{-84.39019999999999,-32.6829},{-32,-34},{-52,-34}}, color = {0,0,127}));
connect(arrayYaw,AreaFraction.u2) annotation(Line(points = {{-100,-40},{-88.2927,-40},{-88.2927,-45.3659},{-32,-46},{-52,-46}}, color = {0,0,127}));
// product1.u2 = if AreaFraction.y < 0 then 0 else AreaFraction.y;
connect(product1.y,DNI_out) "DNI after multiplication connected to output of model" annotation(Line(points = {{31,40},{58.5909,40},{58.5909,19.7775},{100,19.7775},{100,20}}));
connect(DNI_in,product1.u1) "Model input DNI connecting to product" annotation(Line(points = {{-100,80},{-36.3412,80},{-36.3412,45.9827},{8,45.9827},{8,46}}));
annotation(Icon(coordinateSystem(extent = {{-100,-100},{100,100}}, preserveAspectRatio = true, initialScale = 0.1, grid = {2,2}), graphics = {Text(origin = {-4.59,2.51}, extent = {{-72.63,35.36},{72.63,-35.36}}, textString = "DNI x Area Fraction")}));
end DNIReduction_AreaFraction;
end Envelope;
package Stack "Package of all the necessary components to create an Integrated Concentrating Solar simulation"
extends Modelica.Icons.Package;
model ICS_Stack_Twelve "This model represents an individual Integrated Concentrating Solar Stack"
extends ICSolar.Parameters;
Real EPC = ICS_Module_Twelve_1[5].EPC;
Real Shade = ICS_Module_Twelve_1[5].Shade;
Modelica.Thermal.FluidHeatFlow.Interfaces.FlowPort_b flowport_b1(medium = mediumHTF) "Thermal fluid outflow port" annotation(Placement(visible = true, transformation(origin = {100,0}, extent = {{-10,-10},{10,10}}, rotation = 0), iconTransformation(origin = {100,0}, extent = {{-10,-10},{10,10}}, rotation = 0)));
output Modelica.Blocks.Interfaces.RealOutput Power_out "Electrical power generated" annotation(Placement(visible = true, transformation(origin = {100,40}, extent = {{-10,-10},{10,10}}, rotation = 0), iconTransformation(origin = {100,40}, extent = {{-10,-10},{10,10}}, rotation = 0)));
Modelica.Thermal.FluidHeatFlow.Interfaces.FlowPort_a flowport_a1(medium = mediumHTF) "Thermal fluid inflow port" annotation(Placement(visible = true, transformation(origin = {-100,0}, extent = {{-10,-10},{10,10}}, rotation = 0), iconTransformation(origin = {-100,-60}, extent = {{-10,-10},{10,10}}, rotation = 0)));
input Modelica.Blocks.Interfaces.RealInput Power_in(start = 0) "Power input to stack from (GND?)" annotation(Placement(visible = true, transformation(origin = {-100,-20}, extent = {{-10,-10},{10,10}}, rotation = 0), iconTransformation(origin = {-90,-86}, extent = {{-10,-10},{10,10}}, rotation = 0)));
Modelica.Blocks.Interfaces.RealInput DNI "DNI in from Envelope (Parent)" annotation(Placement(visible = true, transformation(origin = {-100,26}, extent = {{-10,-10},{10,10}}, rotation = 0), iconTransformation(origin = {-90,46}, extent = {{-10,-10},{10,10}}, rotation = 0)));
Modelica.Blocks.Interfaces.RealInput arrayYaw annotation(Placement(visible = true, transformation(origin = {-100,-40}, extent = {{-10,-10},{10,10}}, rotation = 0), iconTransformation(origin = {-100,0}, extent = {{-10,-10},{10,10}}, rotation = 0)));
Modelica.Blocks.Interfaces.RealInput arrayPitch annotation(Placement(visible = true, transformation(origin = {-100,-60}, extent = {{-10,-10},{10,10}}, rotation = 0), iconTransformation(origin = {-100,-20}, extent = {{-10,-10},{10,10}}, rotation = 0)));
// Modelica.Blocks.Tables.CombiTable2D Shading11(tableOnFile = true, fileName = "modelica://ICSolar/ShadingTable2014.txt", tableName = "ShadingTable2014");
ICSolar.Module.ICS_Module_Twelve ICS_Module_Twelve_1[StackHeight] annotation(Placement(visible = true, transformation(origin = {-60,-80}, extent = {{-10,-10},{10,10}}, rotation = 0)));
Modelica.Blocks.Interfaces.IntegerInput stackNum annotation(Placement(visible = true, transformation(origin = {-100,80}, extent = {{-10,-10},{10,10}}, rotation = 0), iconTransformation(origin = {-100,80}, extent = {{-10,-10},{10,10}}, rotation = 0)));
Modelica.Thermal.HeatTransfer.Interfaces.HeatPort_a TAmb_in "Ambient temperature of the cavity" annotation(Placement(visible = true, transformation(origin = {-100,40}, extent = {{-10,-10},{10,10}}, rotation = 0), iconTransformation(origin = {-100,80}, extent = {{-10,-10},{10,10}}, rotation = 0)));
equation
//make the connections between modules: electrical and flow
// for i in 1:StackHeight - 1 loop
// connect(ICS_Module_Twelve_1[i].flowport_b1,ICS_Module_Twelve_1[i + 1].flowport_a1);
// connect(ICS_Module_Twelve_1[i].Power_out,ICS_Module_Twelve_1[i + 1].Power_in);
for i in 1:StackHeight - 1 loop
connect(ICS_Module_Twelve_1[StackHeight + 1 - i].flowport_b1,ICS_Module_Twelve_1[StackHeight - i].flowport_a1);
connect(ICS_Module_Twelve_1[StackHeight + 1 - i].Power_out,ICS_Module_Twelve_1[StackHeight - i].Power_in);
end for;
//make the connections between modules and the world: DNI, T_ambient, pitch, yaw
for i in 1:StackHeight loop
connect(ICS_Module_Twelve_1[i].DNI,DNI);
connect(ICS_Module_Twelve_1[i].arrayPitch,arrayPitch);
connect(ICS_Module_Twelve_1[i].arrayYaw,arrayYaw);
connect(ICS_Module_Twelve_1[i].TAmb_in,TAmb_in);
ICS_Module_Twelve_1[StackHeight + 1 - i].modNum = 3;
//i;
ICS_Module_Twelve_1[StackHeight + 1 - i].stackNum = 3;
//stackNum;
//i + (stackNum - 1) * StackHeight;
end for;
///////////Legacy from reversed plumbing
//connect the inlets and outlets of the stack
// connect(ICS_Module_Twelve_1[1].flowport_a1,flowport_a1);
// connect(ICS_Module_Twelve_1[StackHeight].flowport_b1,flowport_b1);
// connect(ICS_Module_Twelve_1[1].Power_in,Power_in);
// connect(ICS_Module_Twelve_1[StackHeight].Power_out,Power_out);
connect(ICS_Module_Twelve_1[StackHeight].flowport_a1,flowport_a1);
connect(ICS_Module_Twelve_1[1].flowport_b1,flowport_b1);
connect(ICS_Module_Twelve_1[StackHeight].Power_in,Power_in);
connect(ICS_Module_Twelve_1[1].Power_out,Power_out);
//annotation
annotation(Placement(transformation(extent = {{-10,64},{10,84}})), Icon(coordinateSystem(extent = {{-100,-100},{100,100}}, preserveAspectRatio = false, initialScale = 0.1, grid = {2,2}), graphics = {Rectangle(extent = {{-100,100},{100,-100}}, lineColor = {0,0,0}, fillPattern = FillPattern.VerticalCylinder, fillColor = {215,215,215}),Text(origin = {0.95,5.29}, extent = {{-61.06,40.08},{61.06,-40.08}}, textString = "Stack"),Rectangle(extent = {{-100,100},{100,-100}}, lineColor = {0,0,0})}), experiment(StartTime = 0, StopTime = 315360, Tolerance = 1e-006, Interval = 3710.12), Diagram(coordinateSystem(extent = {{-100,-100},{100,100}}, preserveAspectRatio = false, initialScale = 0.1, grid = {2,2}), graphics = {Rectangle(origin = {0,-0.288066}, extent = {{-100,100},{100,-100}})}));
end ICS_Stack_Twelve;
model Shading
Modelica.Blocks.Interfaces.RealOutput DNI_out "DNI after shading factor multiplication" annotation(Placement(visible = true, transformation(origin = {100,20}, extent = {{-10,-10},{10,10}}, rotation = 0), iconTransformation(origin = {100,20}, extent = {{-10,-10},{10,10}}, rotation = 0)));
Modelica.Blocks.Math.Product product1 "Multiplication of DNI and shading factor" annotation(Placement(visible = true, transformation(origin = {20,40}, extent = {{-10,-10},{10,10}}, rotation = 0)));
parameter Modelica.Blocks.Interfaces.IntegerInput ShadingTable annotation(Placement(visible = true, transformation(origin = {-100,40}, extent = {{-10,-10},{10,10}}, rotation = 0), iconTransformation(origin = {-100,40}, extent = {{-10,-10},{10,10}}, rotation = 0)));
//for picking different shading matrices:
// final parameter String ShadingName = String(ShadingTable);
Modelica.Blocks.Tables.CombiTable2D Shading_matrix(tableOnFile = true, fileName = "modelica://ICSolar/ShadingTable2014.txt", tableName = ShadingName) annotation(Placement(visible = true, transformation(origin = {-40,-20}, extent = {{-10,-10},{10,10}}, rotation = 0)));
Modelica.Blocks.Interfaces.RealInput arrayPitch "pitch (up/down) angle of 2axis tracking array (rads)" annotation(Placement(visible = true, transformation(origin = {-100,-20}, extent = {{-10,-10},{10,10}}, rotation = 0), iconTransformation(origin = {-100,0}, extent = {{-10,-10},{10,10}}, rotation = 0)));
Modelica.Blocks.Interfaces.RealInput arrayYaw "yaw (left/right) angle of tracking array (in radians)" annotation(Placement(visible = true, transformation(origin = {-100,-60}, extent = {{-10,-10},{10,10}}, rotation = 0), iconTransformation(origin = {-100,40}, extent = {{-10,-10},{10,10}}, rotation = 0)));
Modelica.Blocks.Interfaces.RealInput DNI_in "DNI in before shading factor multiplication" annotation(Placement(visible = true, transformation(origin = {-100,80}, extent = {{-10,-10},{10,10}}, rotation = 0), iconTransformation(origin = {-100,80}, extent = {{-10,-10},{10,10}}, rotation = 0)));
equation
product1.u2 = if Shading_matrix.y < 0 then 0 else Shading_matrix.y;
connect(product1.y,DNI_out) "DNI after multiplication connected to output of model" annotation(Line(points = {{31,40},{58.5909,40},{58.5909,19.7775},{100,19.7775},{100,20}}));
connect(DNI_in,product1.u1) "Model input DNI connecting to product" annotation(Line(points = {{-100,80},{-36.3412,80},{-36.3412,45.9827},{8,45.9827},{8,46}}));
connect(arrayYaw,Shading_matrix.u2);
connect(arrayPitch,Shading_matrix.u1);
annotation(Icon(coordinateSystem(extent = {{-100,-100},{100,100}}, preserveAspectRatio = true, initialScale = 0.1, grid = {2,2}), graphics = {Text(origin = {-4.59,2.51}, extent = {{-72.63,35.36},{72.63,-35.36}}, textString = "Self Shading")}), Icon(coordinateSystem(extent = {{-100,-100},{100,100}}, preserveAspectRatio = true, initialScale = 0.1, grid = {2,2})), Diagram(coordinateSystem(extent = {{-100,-100},{100,100}}, preserveAspectRatio = true, initialScale = 0.1, grid = {2,2})));
end Shading;
end Stack;
package Module "Package of all the necessary components to create an Integrated Concentrating Solar simulation"
extends Modelica.Icons.Package;
model ICS_Module "This model contains all the components and equations that simulate one module of Integrated Concentrating Solar"
extends ICSolar.Parameters;
parameter Modelica.SIunits.Length LensWidth = 0.25019 "Width of Fresnel Lens, meters";
parameter Modelica.SIunits.Length CellWidth = 0.01 "Width of the PV cell, meters";
// parameter String FresMat = "PMMA" "'PMMA' or 'Silicon on Glass', use the exact spellings provided";
// parameter Real FNum = 0.85 "FNum determines the lens transmittance based on concentrating";
// Integer FMatNum "Integer used to pipe the material to other models";
Modelica.Thermal.FluidHeatFlow.Interfaces.FlowPort_b flowport_b1(medium = mediumHTF) "Outflow port of the thermal fluid (to Parent)" annotation(Placement(visible = true, transformation(origin = {100,-40}, extent = {{-10,-10},{10,10}}, rotation = 0), iconTransformation(origin = {100,-40}, extent = {{-10,-10},{10,10}}, rotation = 0)));
Modelica.Thermal.FluidHeatFlow.Interfaces.FlowPort_a flowport_a1(medium = mediumHTF) "Inflow port of the thermal fluid (from Parent)" annotation(Placement(visible = true, transformation(origin = {-100,-40}, extent = {{-10,-10},{10,10}}, rotation = 0), iconTransformation(origin = {-100,-40}, extent = {{-10,-10},{10,10}}, rotation = 0)));
Modelica.Blocks.Interfaces.RealInput DNI "DNI into the Module" annotation(Placement(visible = true, transformation(origin = {-100,18}, extent = {{-10,-10},{10,10}}, rotation = 0), iconTransformation(origin = {-100,18}, extent = {{-10,-10},{10,10}}, rotation = 0)));
Modelica.Thermal.HeatTransfer.Interfaces.HeatPort_a TAmb_in "Ambient temperature of the cavity into Module model for use in the heat receiver" annotation(Placement(visible = true, transformation(origin = {-100,78}, extent = {{-10,-10},{10,10}}, rotation = 0), iconTransformation(origin = {-100,78}, extent = {{-10,-10},{10,10}}, rotation = 0)));
input Modelica.Blocks.Interfaces.RealInput Power_in "electrical power in from previous module or GND" annotation(Placement(visible = true, transformation(origin = {-100,46}, extent = {{-10,-10},{10,10}}, rotation = 0), iconTransformation(origin = {-100,46}, extent = {{-10,-10},{10,10}}, rotation = 0)));
Modelica.Blocks.Interfaces.RealOutput Power_out "Electrical generation outflow (to Parent)" annotation(Placement(visible = true, transformation(origin = {100,54}, extent = {{-10,-10},{10,10}}, rotation = 0), iconTransformation(origin = {100,54}, extent = {{-10,-10},{10,10}}, rotation = 0)));
ICSolar.Module.ICS_LensLosses ics_lenslosses1 annotation(Placement(visible = true, transformation(origin = {-60,-2}, extent = {{-15,-15},{15,15}}, rotation = 0)));
ICSolar.Module.ICS_PVPerformance ics_pvperformance1 annotation(Placement(visible = true, transformation(origin = {0,0}, extent = {{-16.25,-16.25},{16.25,16.25}}, rotation = 0)));
Modelica.Blocks.Math.Add add annotation(Placement(transformation(extent = {{36,32},{46,42}})));
ICSolar.Receiver.moduleReceiver modulereceiver1 "Heat Receiver to calculate the heat transfer between heat gen and heat transfered to thermal fluid" annotation(Placement(visible = true, transformation(origin = {60,0}, extent = {{-15,-8.571440000000001},{15,21.4286}}, rotation = 0)));
equation
connect(modulereceiver1.flowport_b1,flowport_b1) annotation(Line(points = {{75,10.7143},{86.535,10.7143},{86.535,-40.2154},{99.4614,-40.2154},{99.4614,-40.2154}}, color = {255,0,0}));
connect(TAmb_in,modulereceiver1.TAmb_in) annotation(Line(points = {{-100,78},{-2.90276,78},{-2.90276,13.0624},{50,18.2143},{45,18.2143}}));
connect(ics_pvperformance1.ThermalGen,modulereceiver1.ThermalGen) annotation(Line(points = {{16.25,-7.3125},{45.38,-7.3125},{45.38,6.04915},{50,10.7143},{45,10.7143}}));
connect(modulereceiver1.flowport_a1,flowport_a1) annotation(Line(points = {{57,21.4286},{39.4366,21.4286},{39.4366,-40.1408},{-100,-40.1408},{-100,-40}}));
connect(ics_lenslosses1.ConcentrationFactor,ics_pvperformance1.ConcentrationFactor) annotation(Line(points = {{-45,-11},{-39.3195,-11},{-39.3195,-9.82987},{-16.25,-9.82987},{-16.25,-9.75}}));
connect(ics_lenslosses1.DNI_out,ics_pvperformance1.DNI_in) annotation(Line(points = {{-45,4},{-34.4045,4},{-34.4045,0.378072},{-16.25,0.378072},{-16.25,0}}));
connect(DNI,ics_lenslosses1.DNI_in) annotation(Line(points = {{-100,18},{-75,18},{-75,7}}));
// if FresMat == "PMMA" then
// FMatNum = 1;
// elseif FresMat == "Silicon on Glass" then
// FMatNum = 2;
// else
// end if;
// ics_lens1.FMat = FMatNum "Connects FMatNum calculated in Module to Lens FMat input";
ics_lenslosses1.LensWidth = LensWidth "Connects LensWidth defined in Module to Lens LensWidth";
ics_lenslosses1.CellWidth = CellWidth "Connect CellWidth defined in Module to CellWidth in Lens";
// ics_pvperformance1.CellWidth = CellWidth "Connect CellWidth defined in Module to CellWidth in PVPerformance for EIPC calc on Cell";
// ics_lens1.FNum = FNum "Connects the FNumber defined in Module to FNum in Lens for concentration and transmission equations";
connect(Power_in,add.u1) annotation(Line(points = {{-100,46},{-28,46},{-28,40},{35,40}}, color = {0,0,127}, smooth = Smooth.None));
connect(ics_pvperformance1.ElectricalGen,add.u2) annotation(Line(points = {{16.25,6.5},{16.25,31.25},{35,31.25},{35,34}}, color = {0,0,127}, smooth = Smooth.None));
connect(add.y,Power_out) annotation(Line(points = {{46.5,37},{69.25,37},{69.25,54},{100,54}}, color = {0,0,127}, smooth = Smooth.None));
annotation(Icon(coordinateSystem(extent = {{-100,-100},{100,100}}, preserveAspectRatio = true, initialScale = 0.1, grid = {2,2}), graphics = {Text(origin = {-1.41,9.98}, extent = {{-67.14,46.6},{67.14,-46.6}}, textString = "Module")}), Diagram(coordinateSystem(preserveAspectRatio = false, extent = {{-100,-100},{100,100}}), graphics));
end ICS_Module;
model ICS_Lens "This model does the concentrating lens calculations: transmission losses and concentration. DNI_out is the DNI after concentration"
Modelica.Blocks.Interfaces.RealInput DNI_in "DNI in from Module (Parent)" annotation(Placement(visible = true, transformation(origin = {-100,0}, extent = {{-10,-10},{10,10}}, rotation = 0), iconTransformation(origin = {-100,0}, extent = {{-10,-10},{10,10}}, rotation = 0)));
Modelica.Blocks.Interfaces.RealInput FNum "F Number of concentrating Lens" annotation(Placement(visible = false, transformation(origin = {-100,40}, extent = {{-10,-10},{10,10}}, rotation = 0), iconTransformation(origin = {-100,40}, extent = {{-10,-10},{10,10}}, rotation = 0)));
Modelica.Blocks.Interfaces.RealInput LensWidth "Width of Concentrating Lens" annotation(Placement(visible = false, transformation(origin = {-100,0}, extent = {{-10,-10},{10,10}}, rotation = 0), iconTransformation(origin = {-100,0}, extent = {{-10,-10},{10,10}}, rotation = 0)));
Modelica.Blocks.Interfaces.RealInput CellWidth "Width of PV Cell" annotation(Placement(visible = false, transformation(origin = {-100,-40}, extent = {{-10,-10},{10,10}}, rotation = 0), iconTransformation(origin = {-100,-40}, extent = {{-10,-10},{10,10}}, rotation = 0)));
Modelica.Blocks.Interfaces.IntegerInput FMat "Integer describing lens material and selecting tran losses equation accordingly" annotation(Placement(visible = false, transformation(origin = {-100,-80}, extent = {{-10,-10},{10,10}}, rotation = 0), iconTransformation(origin = {-100,-80}, extent = {{-10,-10},{10,10}}, rotation = 0)));
Real ModuleDepth = LensWidth * sqrt(2) * FNum;
Real LensTrans "Lens transmittance variable";
Real G_DN_cell "Direct Normal Irradiance after optical losses without concentration factor";
Modelica.Blocks.Interfaces.RealOutput DNI_out "Output DNI after Lens manipulation (including concentration)" annotation(Placement(visible = true, transformation(origin = {100,40}, extent = {{-10,-10},{10,10}}, rotation = 0), iconTransformation(origin = {100,40}, extent = {{-10,-10},{10,10}}, rotation = 0)));
Modelica.Blocks.Interfaces.RealOutput ConcentrationFactor = LensWidth ^ 2 / CellWidth ^ 2 "Concentration Factor determined from area of Lens in relation to area of Cell" annotation(Placement(visible = true, transformation(origin = {100,0}, extent = {{-10,-10},{10,10}}, rotation = 0), iconTransformation(origin = {100,0}, extent = {{-10,-10},{10,10}}, rotation = 0)));
equation
if FMat == 1 then
LensTrans = ((-20.833 * FNum ^ 3) - 23.214 * FNum ^ 2 + 106.1 * FNum + 23.207) / 100;
else
LensTrans = ((-104.17 * FNum ^ 3) + 171.43 * FNum ^ 2 - 40.744 * FNum + 57.236) / 100;
end if;
DNI_out = DNI_in * LensTrans * ConcentrationFactor "Calculating DNI after Lens Transmission Losses and Lens Concentration";
G_DN_cell = DNI_in * LensTrans;
end ICS_Lens;
model ICS_PVPerformance "This model uses the EIPC (based on cell area) and PVEfficiency (based on ConcentrationFactor) to calculate the ElectricalGen and ThermalGen"
extends ICSolar.Parameters;
//
//##############################################################################
// parameter Real Eta_Observed = Exp_Observed "From ICSolar.Parameters, observed electrical efficiency of ICSFg8";
// parameter Real Eta_nom_tweak = Exp_nom_tweak "From ICSolar.Parameters, matching the observed to modeled data, compensating for temperature 'unknown'. 0.364 matches the Nov25-13 data well when eta_observed is 0.215. set same as eta_obs for full-strength output.";
Real k_Isc = 0.0013 "Current short circuit efficiency change relative to cell temperature";
Real k_Voc = -0.0018 "Voltage open circuit efficiency change relative to cell temperature";
Real k_FF = -0.0016 "Fill Factor efficiency change relative to cell temperature";
Real CellWidth = 0.01 "Width of the PV Cell";
Real CellEfficiency = 0.42 * (1 + k_Isc * (ThermalGen.T-(273.15+22.5))) * (1 + k_Voc * (ThermalGen.T-(273.15+22.5))) * (1 + k_FF * (ThermalGen.T-(273.15+22.5)));
// 0.36436 + (52.5 - (ThermalGen.T - 273.15)) * 0.0005004 + (ConcentrationFactor - 627.5) * 1.9965e-006;
//* Exp_Observed / Exp_nom_tweak "Equation to determine the PVEfficiency from the ConcentrationFactor and Cell Temperature";
Real EIPC "Energy In Per Cell";
//
//##############################################################################
Modelica.Blocks.Interfaces.RealOutput ElectricalGen "Real output for piping the generated electrical energy out" annotation(Placement(visible = true, transformation(origin = {100,20}, extent = {{-25,-25},{25,25}}, rotation = 0), iconTransformation(origin = {100,40}, extent = {{-25,-25},{25,25}}, rotation = 0)));
Modelica.Thermal.HeatTransfer.Interfaces.HeatPort_b ThermalGen "Output heat port to pipe the generated heat out and to the heat receiver" annotation(Placement(visible = true, transformation(origin = {100,-60}, extent = {{-15,-15},{15,15}}, rotation = 0), iconTransformation(origin = {100,-45}, extent = {{-25,-25},{25,25}}, rotation = 0)));
//Modelica.Blocks.Interfaces.IntegerInput modNum annotation(Placement(visible = true, transformation(origin = {-100,80}, extent = {{-25,-25},{25,25}}, rotation = 0), iconTransformation(origin = {-80,80}, extent = {{-10,-10},{10,10}}, rotation = 0)));
Modelica.Blocks.Interfaces.RealInput ConcentrationFactor "Used to represent 'suns's for the calculation of PVEfficiency" annotation(Placement(visible = true, transformation(origin = {-100,-40}, extent = {{-25,-25},{25,25}}, rotation = 0), iconTransformation(origin = {-100,-60}, extent = {{-15,-15},{15,15}}, rotation = 0)));
Modelica.Blocks.Interfaces.RealInput DNI_in "DNI in from the Lens model (include Concentration)" annotation(Placement(visible = true, transformation(origin = {-100,0}, extent = {{-25,-25},{25,25}}, rotation = 0), iconTransformation(origin = {-100,0}, extent = {{-15,-15},{15,15}}, rotation = 0)));
//##############################################################################
Modelica.Blocks.Interfaces.RealInput PV_on annotation(Placement(visible = true, transformation(origin = {-100,40}, extent = {{-25,-25},{25,25}}, rotation = 0), iconTransformation(origin = {-100,60}, extent = {{-15,-15},{15,15}}, rotation = 0)));
equation
EIPC = DNI_in * CellWidth ^ 2 "Energy In Per Cell, used to calculate maximum energy on the cell";
ElectricalGen = EIPC * CellEfficiency * PV_on "Electrical energy conversion";
ThermalGen.Q_flow = -1 * (EIPC - ElectricalGen);
annotation(Icon(coordinateSystem(extent = {{-100,-100},{100,100}}, preserveAspectRatio = true, initialScale = 0.1, grid = {2,2}), graphics = {Text(origin = {-3.11195,-3.79298}, extent = {{-63.55,45.8},{63.55,-45.8}}, textString = "PV Performance")}), Diagram(coordinateSystem(preserveAspectRatio = false, extent = {{-100,-100},{100,100}}), graphics));
end ICS_PVPerformance;
model ICS_LensLosses "This model does the concentrating lens calculations: transmission losses and concentration. DNI_out is the DNI after concentration"
extends ICSolar.Parameters;
parameter Real Eff_Optic = OpticalEfficiency "Optical efficiency of the concentrating lens and optical device before the photovoltaic cell, value comes from ICSolar.Parameter";
Modelica.Blocks.Interfaces.RealInput LensWidth annotation(Placement(visible = false, transformation(origin = {-100,0}, extent = {{-10,-10},{10,10}}, rotation = 0), iconTransformation(origin = {-100,0}, extent = {{-10,-10},{10,10}}, rotation = 0)));
Modelica.Blocks.Interfaces.RealInput CellWidth annotation(Placement(visible = false, transformation(origin = {-100,-40}, extent = {{-10,-10},{10,10}}, rotation = 0), iconTransformation(origin = {-100,-40}, extent = {{-10,-10},{10,10}}, rotation = 0)));
Modelica.Blocks.Interfaces.RealOutput DNI_out annotation(Placement(visible = true, transformation(origin = {100,40}, extent = {{-10,-10},{10,10}}, rotation = 0), iconTransformation(origin = {100,40}, extent = {{-10,-10},{10,10}}, rotation = 0)));
Modelica.Blocks.Interfaces.RealOutput ConcentrationFactor = LensWidth ^ 2 / CellWidth ^ 2 annotation(Placement(visible = true, transformation(origin = {100,-40}, extent = {{-10,-10},{10,10}}, rotation = 0), iconTransformation(origin = {100,-60}, extent = {{-10,-10},{10,10}}, rotation = 0)));
Modelica.Blocks.Interfaces.RealInput DNI_in annotation(Placement(visible = true, transformation(origin = {-100,0}, extent = {{-10,-10},{10,10}}, rotation = 0), iconTransformation(origin = {-100,60}, extent = {{-10,-10},{10,10}}, rotation = 0)));
Real G_DN_cell "Direct Normal Irradiance after optical losses without concentration factor";
equation
DNI_out = DNI_in * Eff_Optic * ConcentrationFactor;
G_DN_cell = DNI_in * Eff_Optic;
annotation(Documentation(info = "<HTML>
<p><b> Tramission losses associated with the lens / optic elements. Ratio of power on the cell to power on the entry aperture.</b></p>
<p>Optical efficiency from LBI Benitez <b>High performance Fresnel-based photovoltaic concentrator</b> where Eff_Opt(F#). Assuming anti-reflective coating on secondary optic element (SOE), current Gen8 module design Eff_Opt(0.84) = 88.2%</p>
<b>More Information:</b>
<p> The F-number for a Fresnal-Köhler lens is the ratio of the distance between cell and Fresenel lens to the diagonal measurement of the front lens. The concentrator optical efficiency is defined as the ratio of power on the cell to the power on the entry aperture when the sun is exactly on-axis.</p>
</HTML>"), Icon(coordinateSystem(extent = {{-100,-100},{100,100}}, preserveAspectRatio = true, initialScale = 0.1, grid = {2,2}), graphics = {Text(origin = {0.694127,36.2079}, extent = {{-72.52,54.46},{72.52,-54.46}}, textString = "Lens Losses")}));
end ICS_LensLosses;
model chooseShadeMatrix "based on a module's position in an array, choose it's shading matrix. Two modes of operation, based on the value of the isStudioExperiment boolean flag in Parameters"
// extends ICSolar.Envelope.ICS_EnvelopeCassette;
// extends ICSolar.Stack.ICS_Stack;
extends ICSolar.Parameters;
// input String TestOutString (start = "initttt");
output Modelica.Blocks.Interfaces.IntegerOutput ShadeMatrixEnum "Enumeration of shading matrix" annotation(Placement(visible = true, transformation(origin = {60,0}, extent = {{-10,-10},{10,10}}, rotation = 0), iconTransformation(origin = {-90,-86}, extent = {{-10,-10},{10,10}}, rotation = 0)));
parameter Modelica.Blocks.Interfaces.IntegerInput ModuleColumn "Module Column" annotation(Placement(visible = true, transformation(origin = {-60,20}, extent = {{-10,-10},{10,10}}, rotation = 0), iconTransformation(origin = {-90,-86}, extent = {{-10,-10},{10,10}}, rotation = 0)));
parameter Modelica.Blocks.Interfaces.IntegerInput ModuleRow "Module Row" annotation(Placement(visible = true, transformation(origin = {-60,-20}, extent = {{-10,-10},{10,10}}, rotation = 0), iconTransformation(origin = {-90,-86}, extent = {{-10,-10},{10,10}}, rotation = 0)));
algorithm
//step through the rows outer and columns inner, assigning shadeMatrix enumeration
if isStudioExperiment then
if ModuleRow == 1 then
if ModuleColumn == 1 then
ShadeMatrixEnum:=11;
elseif ModuleColumn == 2 then
ShadeMatrixEnum:=12;
else
end if;
elseif ModuleRow == 2 then
if ModuleColumn == 1 then
ShadeMatrixEnum:=21;
elseif ModuleColumn == 2 then
ShadeMatrixEnum:=22;
else
end if;
elseif ModuleRow == 3 then
if ModuleColumn == 1 then
ShadeMatrixEnum:=31;
elseif ModuleColumn == 2 then
ShadeMatrixEnum:=32;
else
end if;
elseif ModuleRow == 4 then
if ModuleColumn == 1 then
ShadeMatrixEnum:=41;
elseif ModuleColumn == 2 then
ShadeMatrixEnum:=42;
else
end if;
elseif ModuleRow == 5 then
if ModuleColumn == 1 then
ShadeMatrixEnum:=51;
elseif ModuleColumn == 2 then
ShadeMatrixEnum:=52;
else
end if;
elseif ModuleRow == 6 then
if ModuleColumn == 1 then
ShadeMatrixEnum:=61;
elseif ModuleColumn == 2 then
ShadeMatrixEnum:=62;
else
end if;
else
end if;
else
if ModuleRow == 1 then
if ModuleColumn == 1 then
ShadeMatrixEnum:=11;
elseif ModuleColumn == 2 then
ShadeMatrixEnum:=12;
elseif ModuleColumn == NumOfStacks - 1 then
ShadeMatrixEnum:=18;
elseif ModuleColumn == NumOfStacks then
ShadeMatrixEnum:=19;
else
ShadeMatrixEnum:=15;
end if;
elseif ModuleRow == 2 then
if ModuleColumn == 1 then
ShadeMatrixEnum:=21;
elseif ModuleColumn == 2 then
ShadeMatrixEnum:=22;
elseif ModuleColumn == NumOfStacks - 1 then
ShadeMatrixEnum:=28;
elseif ModuleColumn == NumOfStacks then
ShadeMatrixEnum:=29;
else
ShadeMatrixEnum:=25;
end if;
elseif ModuleRow == StackHeight - 1 then
if ModuleColumn == 1 then
ShadeMatrixEnum:=81;
elseif ModuleColumn == 2 then
ShadeMatrixEnum:=82;
elseif ModuleColumn == NumOfStacks - 1 then
ShadeMatrixEnum:=88;
elseif ModuleColumn == NumOfStacks then
ShadeMatrixEnum:=89;
else
ShadeMatrixEnum:=85;
end if;
elseif ModuleRow == StackHeight then
if ModuleColumn == 1 then
ShadeMatrixEnum:=91;
elseif ModuleColumn == 2 then
ShadeMatrixEnum:=92;
elseif ModuleColumn == NumOfStacks - 1 then
ShadeMatrixEnum:=98;
elseif ModuleColumn == NumOfStacks then
ShadeMatrixEnum:=99;
else
ShadeMatrixEnum:=95;
end if;
else
ShadeMatrixEnum:=55;
end if;
end if;
annotation(Icon(coordinateSystem(extent = {{-60,-60},{60,60}}, preserveAspectRatio = true, initialScale = 0.1, grid = {2,2})), Diagram(coordinateSystem(extent = {{-60,-60},{60,60}}, preserveAspectRatio = true, initialScale = 0.1, grid = {2,2}), graphics = {Rectangle(origin = {0,0}, extent = {{-60,60},{60,-60}})}));
end chooseShadeMatrix;
model chooseFractExposedLUTPosition "based on a module's position in an ICSF array, choose it's position in the 5x5 array of 'shading' types. Outputs a 2D vector somewhere in the space of [1:5 1:5]"
extends ICSolar.Parameters;
//
//extends ICSolar.Parameters;
//
//______________________________________________________________________________
Modelica.Blocks.Interfaces.IntegerInput ModuleRow "Module Row" annotation(Placement(visible = true, transformation(origin = {-100,40}, extent = {{-10,-10},{10,10}}, rotation = 0), iconTransformation(origin = {-100,60}, extent = {{-10,-10},{10,10}}, rotation = 0)));
Modelica.Blocks.Interfaces.IntegerInput ModuleCol "Module Column" annotation(Placement(visible = true, transformation(origin = {-100,20}, extent = {{-10,-10},{10,10}}, rotation = 0), iconTransformation(origin = {-100,20}, extent = {{-10,-10},{10,10}}, rotation = 0)));
Integer ArrayRows = StackHeight "Rows in Array" annotation(Placement(visible = true, transformation(origin = {-100,-20}, extent = {{-10,-10},{10,10}}, rotation = 0), iconTransformation(origin = {-100,-20}, extent = {{-10,-10},{10,10}}, rotation = 0)));
Integer ArrayCols = NumOfStacks "Columns in Array" annotation(Placement(visible = true, transformation(origin = {-100,-40}, extent = {{-10,-10},{10,10}}, rotation = 0), iconTransformation(origin = {-100,-60}, extent = {{-10,-10},{10,10}}, rotation = 0)));
//
//______________________________________________________________________________
//
//______________________________________________________________________________
output Modelica.Blocks.Interfaces.IntegerOutput FractExposedTypeCol "Enumeration of FractExposed Column" annotation(Placement(visible = true, transformation(origin = {110,-10}, extent = {{-10,-10},{10,10}}, rotation = 0), iconTransformation(origin = {100,-40}, extent = {{-10,-10},{10,10}}, rotation = 0)));
output Modelica.Blocks.Interfaces.IntegerOutput FractExposedTypeRow "Enumeration of FractExposed Row" annotation(Placement(visible = true, transformation(origin = {110,10}, extent = {{-10,-10},{10,10}}, rotation = 0), iconTransformation(origin = {100,40}, extent = {{-10,-10},{10,10}}, rotation = 0)));
algorithm
//
//this first case is a robustness measure, solving an out-of-bounds condition
if ModuleCol > ArrayCols then
FractExposedTypeCol:=3;
elseif ModuleCol < 2 then
FractExposedTypeCol:=1;
elseif ModuleCol < 3 then
FractExposedTypeCol:=2;
elseif ModuleCol > ArrayCols - 1 then
FractExposedTypeCol:=5;
elseif ModuleCol > ArrayCols - 2 then
FractExposedTypeCol:=4;
else
FractExposedTypeCol:=3;
end if;
//
//this first case is a robustness measure, solving an out-of-bounds condition
if ModuleRow > ArrayRows then
FractExposedTypeRow:=3;
elseif ModuleRow < 2 then
FractExposedTypeRow:=1;
elseif ModuleRow < 3 then
FractExposedTypeRow:=2;
elseif ModuleRow > ArrayRows - 1 then
FractExposedTypeRow:=5;
elseif ModuleRow > ArrayRows - 2 then
FractExposedTypeRow:=4;
else
FractExposedTypeRow:=3;
end if;
//##############################################################################
annotation(Icon(coordinateSystem(extent = {{-100,-100},{100,100}}, preserveAspectRatio = true, initialScale = 0.1, grid = {2,2})), Diagram(coordinateSystem(extent = {{-100,-100},{100,100}}, preserveAspectRatio = true, initialScale = 0.1, grid = {2,2}), graphics = {Rectangle(origin = {0,0}, extent = {{-100,100},{100,-100}})}), Documentation(info = "<html>
<p>
This didn't work with equations, so shifted over to algortihm. There was a div/0 problem if your mod or col was the last possible mod or col, which I get on a basic level.
OK, I see now that my logic is delivering, somehow, an output of 0 if the mod or col is trying to choose the last row or column.
So was it necessary to take the parameter designations off the integer inputs?
Evidently yes. still sorting that one out, but let's not get distracted.
</p>
</html>"));
end chooseFractExposedLUTPosition;
model ICS_Module_Twelve "This model contains all the components and equations that simulate one module of Integrated Concentrating Solar"
extends ICSolar.Parameters;
Modelica.SIunits.Length LensWidth = 0.25019 "Width of Fresnel Lens, meters";
Modelica.SIunits.Length CellWidth = 0.01 "Width of the PV cell, meters";
Real measured_eGen_on = eGen_on.y[modNum];
Real EPC = ics_pvperformance1.EIPC;
Real Shade = shadingfraction_function1.SOLAR_frac;
//Stores only column related to module of interests
// parameter String FresMat = "PMMA" "'PMMA' or 'Silicon on Glass', use the exact spellings provided";
// parameter Real FNum = 0.85 "FNum determines the lens transmittance based on concentrating";
// Integer FMatNum "Integer used to pipe the material to other models";
// Adding in temperature outputs for truing-up model (5.3.15)_kP
Modelica.Blocks.Sources.CombiTimeTable eGen_on(tableOnFile = true, fileName = Path + "EgenIO.txt", tableName = "EgenIO", nout = 12, columns = {2,3,4,5,6,7,8,9,10,11,12,13}, smoothness = Modelica.Blocks.Types.Smoothness.ConstantSegments, extrapolation = Modelica.Blocks.Types.Extrapolation.HoldLastPoint);
// Imports the entire eGen matri
Modelica.Thermal.FluidHeatFlow.Interfaces.FlowPort_b flowport_b1(medium = mediumHTF) "Outflow port of the thermal fluid (to Parent)" annotation(Placement(visible = true, transformation(origin = {100,-40}, extent = {{-10,-10},{10,10}}, rotation = 0), iconTransformation(origin = {100,-40}, extent = {{-10,-10},{10,10}}, rotation = 0)));
Modelica.Thermal.FluidHeatFlow.Interfaces.FlowPort_a flowport_a1(medium = mediumHTF) "Inflow port of the thermal fluid (from Parent)" annotation(Placement(visible = true, transformation(origin = {-100,-40}, extent = {{-10,-10},{10,10}}, rotation = 0), iconTransformation(origin = {-100,-40}, extent = {{-10,-10},{10,10}}, rotation = 0)));
Modelica.Thermal.HeatTransfer.Interfaces.HeatPort_a TAmb_in "Ambient temperature of the cavity into Module model for use in the heat receiver" annotation(Placement(visible = true, transformation(origin = {-100,78}, extent = {{-10,-10},{10,10}}, rotation = 0), iconTransformation(origin = {-100,78}, extent = {{-10,-10},{10,10}}, rotation = 0)));
ICSolar.Receiver.moduleReceiver modulereceiver1 "Heat Receiver to calculate the heat transfer between heat gen and heat transfered to thermal fluid" annotation(Placement(visible = true, transformation(origin = {65,-5}, extent = {{-15,-15},{15,15}}, rotation = 0)));
ICSolar.Module.ICS_LensLosses ics_lenslosses1 annotation(Placement(visible = true, transformation(origin = {-60,-2}, extent = {{-15,-15},{15,15}}, rotation = 0)));
ICSolar.Module.ICS_PVPerformance ics_pvperformance1 annotation(Placement(visible = true, transformation(origin = {0,0}, extent = {{-16.25,-16.25},{16.25,16.25}}, rotation = 0)));
Modelica.Blocks.Interfaces.RealOutput Power_out "Electrical generation outflow (to Parent)" annotation(Placement(visible = true, transformation(origin = {100,54}, extent = {{-10,-10},{10,10}}, rotation = 0), iconTransformation(origin = {100,-20}, extent = {{-10,-10},{10,10}}, rotation = 0)));
Modelica.Blocks.Interfaces.RealInput arrayPitch "pass pitch to module" annotation(Placement(visible = true, transformation(origin = {-100,30}, extent = {{-10,-10},{10,10}}, rotation = 0), iconTransformation(origin = {-100,20}, extent = {{-10,-10},{10,10}}, rotation = 0)));
Modelica.Blocks.Interfaces.RealInput Power_in "electrical power in from previous module or GND" annotation(Placement(visible = true, transformation(origin = {-100,60}, extent = {{-10,-10},{10,10}}, rotation = 0), iconTransformation(origin = {-100,-20}, extent = {{-10,-10},{10,10}}, rotation = 0)));
Modelica.Blocks.Interfaces.RealInput arrayYaw "pass yaw to module" annotation(Placement(visible = true, transformation(origin = {-100,50}, extent = {{-10,-10},{10,10}}, rotation = 0), iconTransformation(origin = {-100,40}, extent = {{-10,-10},{10,10}}, rotation = 0)));
Modelica.Blocks.Interfaces.IntegerInput stackNum annotation(Placement(visible = true, transformation(origin = {-100,-100}, extent = {{-10,-10},{10,10}}, rotation = 0), iconTransformation(origin = {-100,-100}, extent = {{-10,-10},{10,10}}, rotation = 0)));
Modelica.Blocks.Interfaces.RealInput DNI "DNI into the Module" annotation(Placement(visible = true, transformation(origin = {-100,18}, extent = {{-10,-10},{10,10}}, rotation = 0), iconTransformation(origin = {-100,-60}, extent = {{-10,-10},{10,10}}, rotation = 0)));
Modelica.Blocks.Interfaces.IntegerInput modNum annotation(Placement(visible = true, transformation(origin = {-100,-80}, extent = {{-10,-10},{10,10}}, rotation = 0), iconTransformation(origin = {-100,-80}, extent = {{-10,-10},{10,10}}, rotation = 0)));
Modelica.Blocks.Math.Add add annotation(Placement(visible = true, transformation(origin = {40,40}, extent = {{-5,-5},{5,5}}, rotation = 0)));
ICSolar.ShadingFraction_Function shadingfraction_function1 annotation(Placement(visible = true, transformation(origin = {-60,40}, extent = {{-10,-10},{10,10}}, rotation = 0)));
Modelica.Blocks.Math.Product shadeProduct annotation(Placement(visible = true, transformation(origin = {-20,40}, extent = {{-8.125,-8.125},{8.125,8.125}}, rotation = 0)));
ICSolar.Module.chooseFractExposedLUTPosition choosefractexposedlutposition1 annotation(Placement(visible = true, transformation(origin = {-60,-80}, extent = {{-10,-10},{10,10}}, rotation = 0)));
equation
connect(choosefractexposedlutposition1.ModuleCol,stackNum);
connect(choosefractexposedlutposition1.ModuleRow,modNum);
connect(choosefractexposedlutposition1.FractExposedTypeCol,shadingfraction_function1.colType) annotation(Line(points = {{-50,-81},{-35.9946,-81},{-35.9946,-17.0501},{-83.35590000000001,-17.0501},{-83.35590000000001,39.5129},{-70.9066,39.5129},{-70.9066,39.5129},{-70.9066,39.5129}}, color = {255,127,0}));
connect(choosefractexposedlutposition1.FractExposedTypeRow,shadingfraction_function1.rowType) annotation(Line(points = {{-50,-79},{-38.7009,-79},{-38.7009,-18.4032},{-85.2503,-18.4032},{-85.2503,43.843},{-71.1773,43.843},{-71.1773,43.843}}, color = {255,127,0}));
connect(arrayYaw,shadingfraction_function1.arrayYaw) annotation(Line(points = {{-100,50},{-77.9432,50},{-77.9432,31.6644},{-70.9066,31.6644},{-70.9066,31.6644}}, color = {0,0,127}));
connect(arrayPitch,shadingfraction_function1.arrayPitch) annotation(Line(points = {{-100,30},{-81.4614,30},{-81.4614,35.724},{-71.1773,35.724},{-71.1773,35.724}}, color = {0,0,127}));
connect(shadeProduct.u2,shadingfraction_function1.SOLAR_frac) annotation(Line(points = {{-50,40},{-42.2192,40},{-42.2192,34.1001},{-30.8525,34.1001},{-30.8525,34.1001}}, color = {0,0,127}));
connect(shadeProduct.u1,DNI) annotation(Line(points = {{-100,18},{-37.3478,18},{-37.3478,44.3843},{-30.8525,44.3843},{-30.8525,44.3843}}, color = {0,0,127}));
connect(shadeProduct.y,ics_lenslosses1.DNI_in) annotation(Line(points = {{-11.0625,40},{-6.7659,40},{-6.7659,14.3437},{-82.8146,14.3437},{-82.8146,6.49526},{-75.5074,6.49526},{-75.5074,6.49526}}, color = {0,0,127}));
ics_lenslosses1.LensWidth = LensWidth "Connects LensWidth defined in Module to Lens LensWidth";
ics_lenslosses1.CellWidth = CellWidth "Connect CellWidth defined in Module to CellWidth in Lens";
connect(ics_lenslosses1.ConcentrationFactor,ics_pvperformance1.ConcentrationFactor) annotation(Line(points = {{-45,-11},{-39.3195,-11},{-39.3195,-9.82987},{-16.25,-9.82987},{-16.25,-9.75}}));
connect(ics_lenslosses1.DNI_out,ics_pvperformance1.DNI_in) annotation(Line(points = {{-45,4},{-34.4045,4},{-34.4045,0.378072},{-16.25,0.378072},{-16.25,0}}));
connect(ics_pvperformance1.ThermalGen,modulereceiver1.ThermalGen) annotation(Line(points = {{16.25,-7.3125},{45.38,-7.3125},{45.38,6.04915},{50,6.04915},{50,-0.714286}}));
connect(ics_pvperformance1.ElectricalGen,add.u2) annotation(Line(points = {{16.25,6.5},{16.25,31.25},{34,31.25},{34,37}}, color = {0,0,127}));
connect(Power_in,add.u1) annotation(Line(points = {{-100,60},{-28,60},{34,40},{34,43}}, color = {0,0,127}));
connect(add.y,Power_out) annotation(Line(points = {{45.5,40},{69.25,40},{69.25,54},{100,54}}, color = {0,0,127}));
connect(modulereceiver1.flowport_b1,flowport_b1) annotation(Line(points = {{80,5.71429},{86.535,5.71429},{86.535,-40.2154},{99.4614,-40.2154},{99.4614,-40.2154}}, color = {255,0,0}));
connect(modulereceiver1.TAmb_in,TAmb_in) annotation(Line(points = {{-100,78},{-2.90276,78},{-2.90276,13.0624},{50,13.0624},{50,6.78571}}));
connect(modulereceiver1.flowport_a1,flowport_a1) "Connect pump flow the heat receiver" annotation(Line(points = {{62,10},{39.4366,10},{39.4366,-40.1408},{-100,-40.1408},{-100,-40}}));
connect(measured_eGen_on,ics_pvperformance1.PV_on);
annotation(Icon(coordinateSystem(extent = {{-100,-100},{100,100}}, preserveAspectRatio = true, initialScale = 0.1, grid = {2,2}), graphics = {Text(origin = {-1.41,9.98}, extent = {{-67.14,46.6},{67.14,-46.6}}, textString = "Module")}), Diagram(coordinateSystem(preserveAspectRatio = false, extent = {{-100,-100},{100,100}}), graphics));
end ICS_Module_Twelve;
end Module;
package Receiver "Package of all the necessary components to create an Integrated Concentrating Solar simulation"
extends Modelica.Icons.Package;
model moduleReceiver
extends ICSolar.Parameters;
Real temp_flowport_a = water_Block_HX1.flowport_a1.H_flow / (water_Block_HX1.flowport_a1.m_flow * mediumHTF.cp);
Real temp_flowport_b = abs(water_Block_HX1.flowport_b1.H_flow / (flowport_a1.m_flow * mediumHTF.cp));
ICSolar.Receiver.subClasses.receiverInternalEnergy receiverInternalEnergy1 annotation(Placement(visible = true, transformation(origin = {-158.447,-48.4473}, extent = {{-23.4473,-23.4473},{23.4473,23.4473}}, rotation = 0)));
Modelica.Thermal.FluidHeatFlow.Interfaces.FlowPort_b flowport_b1(medium = mediumHTF) annotation(Placement(visible = true, transformation(origin = {200,60}, extent = {{-10,-10},{10,10}}, rotation = 0), iconTransformation(origin = {200,100}, extent = {{-10,-10},{10,10}}, rotation = 0)));
Modelica.Thermal.HeatTransfer.Interfaces.HeatPort_a TAmb_in annotation(Placement(visible = true, transformation(origin = {-200,170}, extent = {{-10,-10},{10,10}}, rotation = 0), iconTransformation(origin = {-200,170}, extent = {{-10,-10},{10,10}}, rotation = 0)));
Modelica.Thermal.HeatTransfer.Interfaces.HeatPort_a ThermalGen annotation(Placement(visible = true, transformation(origin = {-200,-10}, extent = {{-10,-10},{10,10}}, rotation = 0), iconTransformation(origin = {-200,100}, extent = {{-10,-10},{10,10}}, rotation = 0)));
Modelica.Thermal.FluidHeatFlow.Interfaces.FlowPort_a flowport_a1(medium = mediumHTF) annotation(Placement(visible = true, transformation(origin = {-200,40}, extent = {{-10,-10},{10,10}}, rotation = -90), iconTransformation(origin = {-40,200}, extent = {{-10,-10},{10,10}}, rotation = 0)));
ICSolar.Receiver.subClasses.Water_Block_HX water_Block_HX1 annotation(Placement(visible = true, transformation(origin = {0,0}, extent = {{-33.4646,-33.4646},{33.4646,33.4646}}, rotation = 0)));
ICSolar.Receiver.subClasses.Tubing_Losses tubing_Losses1(Tubing(medium = mediumHTF, m = 0.0023, T0 = 298.15, V_flowLaminar(displayUnit = "l/min") = 4.1666666666667e-006, dpLaminar(displayUnit = "kPa") = 1000, V_flowNominal(displayUnit = "l/min") = 0.00041666666666667, dpNominal(displayUnit = "kPa") = 100000, h_g = 0.3)) annotation(Placement(visible = true, transformation(origin = {100,0}, extent = {{-31.4355,-31.4355},{31.4355,31.4355}}, rotation = 0)));
equation
connect(tubing_Losses1.flowport_b1,flowport_b1) annotation(Line(points = {{131.435,0},{137.358,0},{137.358,58.1132},{200,58.1132},{200,60}}));
connect(TAmb_in,tubing_Losses1.port_a) annotation(Line(points = {{-200,170},{123.541,170},{123.541,-23.164},{92.2496,-22.0048},{132.064,-22.0048}}));
connect(water_Block_HX1.flowport_b1,tubing_Losses1.flowport_a1) annotation(Line(points = {{34.1339,-1.33858},{16.7742,-1.33858},{16.7742,-0.860215},{30.5376,0},{68.5645,0}}, color = {255,0,0}));
connect(TAmb_in,water_Block_HX1.heatLoss_to_ambient) annotation(Line(points = {{-200,170},{-140,170},{-33.4646,3.4646},{-33.4646,0}}, color = {191,0,0}));
connect(flowport_a1,water_Block_HX1.flowport_a1) annotation(Line(points = {{-200,40},{-130,40},{-130,13.3858},{-33.4646,13.3858}}, color = {255,0,0}));
connect(receiverInternalEnergy1.port_b,water_Block_HX1.heatCap_waterBlock) annotation(Line(points = {{-135,-34.3789},{-85,-34.3789},{-85,-25},{-61.9292,-26.7717},{-33.4646,-26.7717}}, color = {191,0,0}));
connect(ThermalGen,water_Block_HX1.energyFrom_CCA) annotation(Line(points = {{-200,-10},{-119.049,-10},{-119.049,-9.75},{-61.929,-13.3858},{-33.4646,-13.3858}}));
annotation(Diagram(coordinateSystem(extent = {{-200,-80},{200,200}}, preserveAspectRatio = false, initialScale = 0.1, grid = {10,10}), graphics = {Text(origin = {12.5,110}, fillPattern = FillPattern.Solid, extent = {{-42.5,-5},{42.5,5}}, textString = "Bring the Ambient Sources and pump Outside the Class ", fontName = "Arial")}), Icon(coordinateSystem(extent = {{-200,-80},{200,200}}, preserveAspectRatio = false, initialScale = 0.1, grid = {10,10}), graphics = {Text(origin = {3.12,117.49}, extent = {{-133.92,40.92},{133.92,-40.92}}, textString = "Heat"),Text(origin = {9.854509999999999,16.9292}, extent = {{-154.79,56.03},{154.79,-56.03}}, textString = "Receiver")}));
end moduleReceiver;
package subClasses "Contains the subClasses for receiver"
extends Modelica.Icons.Package;
connector Egen_port
Modelica.SIunits.Power p "Power in Watts at the port" annotation(Diagram(coordinateSystem(preserveAspectRatio = false, extent = {{-100,-100},{100,100}}), graphics = {Polygon(points = {{100,100},{-100,100},{-100,-100},{100,-100},{100,100}}, lineColor = {0,0,0}, fillColor = {0,0,0}, fillPattern = FillPattern.Solid),Text(extent = {{-150,-90},{150,-150}}, lineColor = {0,0,0}, fillColor = {0,0,0}, fillPattern = FillPattern.Solid, textString = "%name"),Polygon(points = {{70,70},{-70,70},{-70,-70},{70,-70},{70,70}}, lineColor = {255,255,255}, fillColor = {255,255,255}, fillPattern = FillPattern.Solid)}), Icon(coordinateSystem(preserveAspectRatio = false, extent = {{-100,-100},{100,100}}), graphics = {Polygon(points = {{100,100},{-100,100},{-100,-100},{100,-100},{100,100}}, lineColor = {0,0,0}, fillColor = {0,0,0}, fillPattern = FillPattern.Solid),Polygon(points = {{70,70},{-70,70},{-70,-70},{70,-70},{70,70}}, lineColor = {255,255,255}, fillColor = {255,255,255}, fillPattern = FillPattern.Solid)}));
end Egen_port;
class receiverInternalEnergy
extends ICSolar.Parameters;
Modelica.Thermal.HeatTransfer.Interfaces.HeatPort_b port_b annotation(Placement(visible = true, transformation(origin = {100,60}, extent = {{-10,-10},{10,10}}, rotation = 0), iconTransformation(origin = {100,60}, extent = {{-10,-10},{10,10}}, rotation = 0)));
Modelica.Thermal.HeatTransfer.Components.HeatCapacitor heatcapacitor1(C = HeatCap_Receiver) "60 J/K is calculated in spreadsheet in 1-DOCS\\calculators ...thermal mass or heat capacity of receiver.xlsx" annotation(Placement(visible = true, transformation(origin = {-20,0}, extent = {{-10,10},{10,-10}}, rotation = 0)));
equation
connect(heatcapacitor1.port,port_b) annotation(Line(points = {{-20,10},{-20.023,10},{-20.023,60.5293},{100,60.5293},{100,60}}));
end receiverInternalEnergy;
class CCA_energyBalance
Modelica.Blocks.Interfaces.RealInput wattsIn_perCell annotation(Placement(visible = true, transformation(origin = {-100,60}, extent = {{-15,-15},{15,15}}, rotation = 0), iconTransformation(origin = {-100,60}, extent = {{-10,-10},{10,10}}, rotation = 0)));
Modelica.Blocks.Interfaces.RealInput PV_eff annotation(Placement(visible = true, transformation(origin = {-100,-40}, extent = {{-15,-15},{15,15}}, rotation = 0), iconTransformation(origin = {-100,-60}, extent = {{-10,-10},{10,10}}, rotation = 0)));
Modelica.Thermal.HeatTransfer.Interfaces.HeatPort_b port_b annotation(Placement(visible = true, transformation(origin = {100,-40}, extent = {{-15,-15},{15,15}}, rotation = 0), iconTransformation(origin = {100,-60}, extent = {{-10,-10},{10,10}}, rotation = 0)));
Modelica.Blocks.Interfaces.RealOutput Power_out annotation(Placement(visible = true, transformation(origin = {100,60}, extent = {{-10,-10},{10,10}}, rotation = 0), iconTransformation(origin = {100,60}, extent = {{-10,-10},{10,10}}, rotation = 0)));
equation
Power_out = wattsIn_perCell * PV_eff;
port_b.Q_flow = -wattsIn_perCell * (1 - PV_eff);
end CCA_energyBalance;
class Water_Block_HX
extends ICSolar.Parameters;
Modelica.Thermal.FluidHeatFlow.Interfaces.FlowPort_b flowport_b1(medium = mediumHTF) annotation(Placement(visible = true, transformation(origin = {100.0,40.0}, extent = {{-10.0,-10.0},{10.0,10.0}}, rotation = 0), iconTransformation(origin = {102.0,-4.0}, extent = {{-10.0,-10.0},{10.0,10.0}}, rotation = 0)));
Modelica.Thermal.FluidHeatFlow.Interfaces.FlowPort_a flowport_a1(medium = mediumHTF) annotation(Placement(visible = true, transformation(origin = {-100,40}, extent = {{-10,-10},{10,10}}, rotation = 0), iconTransformation(origin = {-100,40}, extent = {{-10,-10},{10,10}}, rotation = 0)));
Modelica.Thermal.HeatTransfer.Components.ThermalConductor thermalconductor1(G = Cond_RecToEnv) annotation(Placement(visible = true, transformation(origin = {20,0}, extent = {{-10,-10},{10,10}}, rotation = 0)));
Modelica.Thermal.HeatTransfer.Components.Convection convection1 annotation(Placement(visible = true, transformation(origin = {60,0}, extent = {{-10,-10},{10,10}}, rotation = 0)));
Modelica.Thermal.HeatTransfer.Interfaces.HeatPort_a energyFrom_CCA annotation(Placement(visible = true, transformation(origin = {-100,0}, extent = {{-10,-10},{10,10}}, rotation = 0), iconTransformation(origin = {-100,-40}, extent = {{-10,-10},{10,10}}, rotation = 0)));
Modelica.Thermal.HeatTransfer.Interfaces.HeatPort_a heatCap_waterBlock annotation(Placement(visible = true, transformation(origin = {-100,-80}, extent = {{-10,-10},{10,10}}, rotation = 0), iconTransformation(origin = {-100,-80}, extent = {{-10,-10},{10,10}}, rotation = 0)));
Modelica.Thermal.HeatTransfer.Interfaces.HeatPort_a heatLoss_to_ambient annotation(Placement(visible = true, transformation(origin = {-100,-40}, extent = {{-10,-10},{10,10}}, rotation = 0), iconTransformation(origin = {-100,0}, extent = {{-10,-10},{10,10}}, rotation = 0)));
Modelica.Thermal.HeatTransfer.Components.ThermalCollector thermalcollector1 annotation(Placement(visible = true, transformation(origin = {-20,-20}, extent = {{-10,-10},{10,10}}, rotation = 0)));
Modelica.Thermal.FluidHeatFlow.Components.HeatedPipe heatedpipe1(h_g = 0, T0 = Temp_Indoor, medium = mediumHTF, T(start = Temp_Indoor), pressureDrop(fixed = false), T0fixed = false, m = 0.003, dpNominal(displayUnit = "kPa") = 62270, V_flowLaminar(displayUnit = "l/min") = 1.6666666666667e-006, dpLaminar(displayUnit = "kPa") = 14690, V_flowNominal(displayUnit = "l/min") = 3.995e-006) annotation(Placement(visible = true, transformation(origin = {-20,60}, extent = {{-10,-10},{10,10}}, rotation = 0)));
Modelica.Thermal.HeatTransfer.Components.ThermalResistor thermalresistor_waterblock(R = Resistivity_WaterBlock) annotation(Placement(visible = true, transformation(origin = {-20,20}, extent = {{-10,-10},{10,10}}, rotation = 90)));
Modelica.Thermal.HeatTransfer.Components.ThermalResistor thermalresistor_celltoreceiver(R = Resistivity_Cell) annotation(Placement(visible = true, transformation(origin = {-60,0}, extent = {{-10,-10},{10,10}}, rotation = 0)));
//
//______________________________________________________________________________
equation
connect(thermalconductor1.port_a,thermalcollector1.port_a[3]) annotation(Line(points = {{10,0},{-20.029,0},{-20.029,-10.1597},{-20.029,-10.1597}}));
connect(thermalresistor_waterblock.port_a,thermalcollector1.port_a[2]) annotation(Line(points = {{-20,10},{-20,-9.5791},{-19.4485,-9.5791},{-19.4485,-9.5791}}));
connect(heatedpipe1.heatPort,thermalresistor_waterblock.port_b) annotation(Line(points = {{-20,50},{-19.7388,50},{-19.7388,30.1887},{-19.7388,30.1887}}));
connect(thermalresistor_celltoreceiver.port_b,thermalcollector1.port_a[1]) annotation(Line(points = {{-50,0},{-19.7388,0},{-19.7388,-9.86938},{-19.7388,-9.86938}}));
connect(energyFrom_CCA,thermalresistor_celltoreceiver.port_a) annotation(Line(points = {{-100,0},{-69.95650000000001,0},{-69.95650000000001,-0.290276},{-69.95650000000001,-0.290276}}));
connect(heatedpipe1.flowPort_b,flowport_b1) annotation(Line(points = {{-10,60},{31.3498,60},{31.3498,40.3483},{98.98399999999999,40.3483},{98.98399999999999,40.3483}}));
connect(flowport_a1,heatedpipe1.flowPort_a) annotation(Line(points = {{-100,40},{-62.6996,40},{-62.6996,59.7968},{-29.8984,59.7968},{-29.8984,59.7968}}));
connect(thermalresistor_waterblock.port_a,thermalcollector1.port_a[2]) annotation(Line(points = {{-20,10},{-20,-9.5791},{-20,-9.5791},{-20,-10}}));
connect(thermalresistor_waterblock.port_b,heatedpipe1.heatPort) annotation(Line(points = {{-20,30},{-20,49.6372},{-20,50},{-20,50}}));
connect(heatCap_waterBlock,thermalcollector1.port_b) annotation(Line(points = {{-100,-80},{-19.7929,-80},{-20,-10},{-20,-30}}));
connect(heatLoss_to_ambient,convection1.fluid) annotation(Line(points = {{-100,-40},{84.4649,-40},{84.4649,0},{70,0}}));
connect(thermalconductor1.port_b,convection1.solid) annotation(Line(points = {{30,0},{50,0}}));
connect(Conv_Receiver,convection1.Gc) "Connects the Conv_Receiver from ICSolar.Parameter to the input for the convection coeffient of convection1";
annotation(Diagram(coordinateSystem(preserveAspectRatio = false, extent = {{-100,-100},{100,100}}), graphics));
end Water_Block_HX;
class Tubing_Losses
extends ICSolar.Parameters;
Modelica.Thermal.FluidHeatFlow.Components.HeatedPipe Tubing(medium = mediumHTF, V_flowLaminar = OneBranchFlow, V_flowNominal = 1e-005, h_g = 0, m = 0.0025, T0 = T_HTF_start, dpLaminar = 0.45, dpNominal = 10) annotation(Placement(visible = true, transformation(origin = {-80,0}, extent = {{-10,-10},{10,10}}, rotation = 90)));
Modelica.Thermal.HeatTransfer.Components.Convection convection1 annotation(Placement(visible = true, transformation(origin = {80.0,0.0}, extent = {{-10.0,-10.0},{10.0,10.0}}, rotation = 0)));
Modelica.Thermal.HeatTransfer.Components.Convection convection2 annotation(Placement(visible = true, transformation(origin = {-40,0}, extent = {{10,-10},{-10,10}}, rotation = 0)));
Modelica.Thermal.HeatTransfer.Interfaces.HeatPort_a port_a(T(start = 293)) annotation(Placement(visible = true, transformation(origin = {100.0,-60.0}, extent = {{-10.0,-10.0},{10.0,10.0}}, rotation = 0), iconTransformation(origin = {102.0,-70.0}, extent = {{-10.0,-10.0},{10.0,10.0}}, rotation = 0)));
Modelica.Thermal.FluidHeatFlow.Interfaces.FlowPort_b flowport_b1(medium = mediumHTF) annotation(Placement(visible = true, transformation(origin = {-80,80}, extent = {{-10,-10},{10,10}}, rotation = 0), iconTransformation(origin = {100,0}, extent = {{-10,-10},{10,10}}, rotation = 0)));
Modelica.Thermal.FluidHeatFlow.Interfaces.FlowPort_a flowport_a1(medium = mediumHTF) annotation(Placement(visible = true, transformation(origin = {-80.0,-80.0}, extent = {{-10.0,-10.0},{10.0,10.0}}, rotation = 0), iconTransformation(origin = {-100.0,0.0}, extent = {{-10.0,-10.0},{10.0,10.0}}, rotation = 0)));
Modelica.Thermal.HeatTransfer.Components.ThermalConductor Conduction_Insulation(G = Cond_Insulation) "Thermal conductivity of Tubing Insulation, from ICSolar.Parameter" annotation(Placement(visible = true, transformation(origin = {40,0}, extent = {{-10,-10},{10,10}}, rotation = 0)));
Modelica.Thermal.HeatTransfer.Components.ThermalConductor Conduction_Tube(G = Cond_Tube) "Thermal conductivity of the silicone tubing, from ICSolar.Parameter" annotation(Placement(visible = true, transformation(origin = {0,0}, extent = {{-10,-10},{10,10}}, rotation = 0)));
equation
connect(convection2.solid,Conduction_Tube.port_a) annotation(Line(points = {{-30,0},{-9.920629999999999,0},{-10,0}}));
connect(Conduction_Tube.port_b,Conduction_Insulation.port_a) annotation(Line(points = {{10,0},{30.5556,0},{30,0}}));
connect(Conduction_Insulation.port_b,convection1.solid) annotation(Line(points = {{50,0},{70.4365,0},{70.4365,0.1984},{70,0}}));
connect(convection1.fluid,port_a) annotation(Line(visible = true, points = {{90.0,0.0},{97.8175,0.0},{97.8175,-43.8492},{87.5,-43.8492},{87.5,-60.9127},{98.61109999999999,-60.9127},{100.0,-60.0}}));
connect(flowport_a1,Tubing.flowPort_a) annotation(Line(visible = true, points = {{-80.0,-80.0},{-79.9603,-80.0},{-79.9603,-10.3175},{-80.0,-10.0}}));
connect(flowport_b1,Tubing.flowPort_b) annotation(Line(points = {{-80,80},{-79.9615,80},{-79.9615,10},{-80,10}}));
connect(Tubing.heatPort,convection2.fluid) annotation(Line(points = {{-70,-6.12303e-016},{-70,0},{-50,0}}));
connect(Conv_WaterTube,convection2.Gc);
connect(Conv_InsulationAir,convection1.Gc);
annotation(Diagram(coordinateSystem(preserveAspectRatio = false, extent = {{-100,-100},{100,100}}), graphics));
end Tubing_Losses;
end subClasses;
end Receiver;
model Parameters "Inputs for the ICSF model"
//________________________________
///////// LOCATION VARIATIONS //////////
// constant String wFile = "modelica://ICSolar/weatherdata/USA_NY_New.York-LaGuardia.AP.725030_TMY3.mos";
// constant Real BuildingLatitude = 40.783 * Modelica.Constants.pi / 180 "Latitude (radians)";
constant String wFile := "modelica://ICSolar/weatherdata/USA_CA_Mountain.View-Moffett.Field.NAS.745090_TMY3.mos";
constant Real BuildingLatitude = 37.38 * Modelica.Constants.pi / 180 "Latitude (radians)";
// constant String wFile := "modelica://ICSolar/weatherdata/USA_AZ_Phoenix.722780_TMY2.mos";
// constant Real BuildingLatitude = 33.43 * Modelica.Constants.pi / 180 "Latitude (radians)";
///////////////////////
//////// PATH /////////
///////////////////////
//parameter String Date = "20150323\\";
//parameter String Date = "20150319\\";
//parameter String Date = "20150220\\";
//constant String Path = "C:\\Users\\kenton.phillips\\Documents\\GitHub\\RPI_CASE_ICS_Modelica\\";
//constant String Path = "C:\\Users\\Nick\\Documents\\GitHub\\RPI_CASE_ICS_Modelica\\";
constant String Path = "C:\\Users\\Justin\\Documents\\GitHub\\RPI_CASE_ICS_Modelica\\";
//________________________________
//////// MODEL OPERATION /////////
//--------------------------------
parameter Boolean isStudioExperiment = false "True if this run is referring to the gen8 studio experiment. For now, just search through the code for the variable name and flip things where necessary";
/*off hand, that's
numOfStacks
StackHeight
BuildingOrientation
ArrayTilt
[glazing losses stuff]
opticalEfficiency
*/
//////////////////////////////////
///// BUILDING CONFIGURATION /////
//////////////////////////////////
parameter Real BuildingOrientation = 0 * 3.14159 / 180 "Radians, 0 being south";
parameter Real ArrayTilt = 60 * 3.14159 / 180 "Radians, 0 being wall";
////////////////////////
///// ARRAY SIZING /////
////////////////////////