-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathHeat.h
1810 lines (1731 loc) · 64.6 KB
/
Heat.h
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
//
// Created by Ryan.Zurrin001 on 12/16/2021.
//
#ifndef PHYSICSFORMULA_HEAT_H
#define PHYSICSFORMULA_HEAT_H
/**
* @class Heat
* @details driver class for solving physics problems
* @author Ryan Zurrin testing a push to git hub with this line here
* @date 11/29/2020
* @last_modified_on 12/14/2020
*/
#include <iostream>
#include <string>
#include <vector>
#include <cmath>
#include "Constants.h"
#include "SpecificHeat.h"
using namespace std;
static int heat_objectCount = 0;
typedef long double ld;
static struct HeatEnergyUnitConversion
{
//returns calories from kCal
static ld kCal_to_calorie(const ld kCal) { return kCal * 1000.0; }
// returns kCal from calories
static ld calorie_to_kCal(const ld C) { return C / 1000.0; }
// returns joule from kCal
static ld kiloCalorie_to_joule(const ld kCal) { return kCal * 4186.0; }
// returns kCal from joule
static ld joule_to_kCal(const ld joule) { return joule / 4186.0; }
// returns kCal/kg from kJ/kg
static ld kiloJoule_to_kCal_per_kg(const ld kJ_kg) { return kJ_kg/4.184; }
// returns kJ/kg from kCal/kg
static ld kCal_per_kg_to_kiloJoule(const ld kCal_kg) { return kCal_kg*4.184; }
// returns kJ/kg from kJ/mol
static ld kJ_per_mol_to_kJ_per_kg(const ld kJ_mol, const ld mol_mass)
{
return (kJ_mol/mol_mass)*1000.0;
}
// returns kJ/mol from kJ/kg
static ld kJ_per_kg_to_kJ_per_mol(const ld kJ_kg, const ld mol_mass)
{
return (kJ_kg/1000.0)*mol_mass;
}
}heConverter;
/**
* @brief structure holding the heat values of different substances. this is the c value in the
* heat transfer equation, that we must use. Each value is a std::vector holding two different units
* of heat; J/kg*C` or kCal/kg*C`. So c.aluminum[0] would give the value of 900J/kg*C` and
* c.aluminum[1] holds the value of .215 kCal/kg*C` respectfully.
* @variable c stands for specific heat
*/
static struct SpecificHeatCapacity
{
SpecificHeatCapacity() { }
const struct ALUMINUM_SOLID {
const ld J_kgC = 900.0;
const ld kcal_kgC = .215;
} aluminumSolid;
const struct ASBESTOS_SOLID {
const ld J_kgC = 800.0;
const ld kcal_kgC = .19;
} asbestosSolid;
const struct CONCRETE_GRANITE_AVERAGE_SOLID {
const ld J_kgC = 840.0;
const ld kcal_kgC = .20;
} concreteGraniteAverageSolid;
const struct COPPER_SOLID {
const ld J_kgC = 387.0;
const ld kcal_kgC = .0924;
} copperSolid;
const struct GLASS_SOLID {
const ld J_kgC = 840.0;
const ld kcal_kgC = .20;
} glassSolid;
const struct SAND_SOLID {
const ld J_kgC = 840.0;
const ld kcal_kgC = .20;
} sandSolid;
const struct GOLD_SOLID {
const ld J_kgC = 129.0;
const ld kcal_kgC = .0308;
} goldSolid;
const struct HUMAN_BODY_AVERAGE_SOLID {
const ld J_kgC = 3474.38;
const ld kcal_kgC = .83;
} humanBodyAverageSolid;
const struct ICE_AVERAGE_SOLID {
const ld J_kgC = 2090.0;
const ld kcal_kgC = .50;
} iceAverageSolid;
const struct IRON_STEEL_SOLID {
const ld J_kgC = 452;
const ld kcal_kgC = .108;
} ironSteelSolid;
const struct LEAD_SOLID {
const ld J_kgC = 128.0;
const ld kcal_kgC = .0305;
} leadSolid;
const struct SILVER_SOLID {
const ld J_kgC = 235.0;
const ld kcal_kgC = .0562;
} silverSolid;
const struct WOOD_SOLID {
const ld J_kgC = 1700;
const ld kcal_kgC = .40;
} woodSolid;
const struct BENZENE_LIQUID {
const ld J_kgC = 1740.0;
const ld kcal_kgC = .415;
} benzeneLiquid;
const struct ETHANOL_LIQUID {
const ld J_kgC = 2450;
const ld kcal_kgC = .586;
} ethanolLiquid;
const struct GLYCERIN_LIQUID {
const ld J_kgC = 2410.0;
const ld kcal_kgC = .576;
} glycerinLiquid;
const struct MERCURY_LIQUID {
const ld J_kgC = 139;
const ld kcal_kgC = .0333;
} mercuryLiquid;
const struct WATER_LIQUID {
const ld J_kgC = 4186.0;
const ld kcal_kgC = 1.0;
} waterLiquid;
const struct ICE {
const ld J_kgC = 2100.0;
const ld kcal_kgC = .49;
} ice;
const struct AIR_GAS {
const ld J_kgC = 721.0;
const ld kcal_kgC = .172;
} airGas;
const struct AIR_DRY_GAS {
const ld J_kgC = 1015.0;
const ld kcal_kgC = .242;
} airDryGas;
const struct AMMONIA_GAS {
const ld J_kgC = 1670.0;
const ld kcal_kgC = .399;
} ammoniaGas;
const struct AMMONIA_DRY_GAS {
const ld J_kgC = 2190.0;
const ld kcal_kgC = .523;
} ammoniaDryGas;
const struct CARBON_DIOXIDE_GAS {
const ld J_kgC = 658.0;
const ld kcal_kgC = .152;
} carbonDioxideGas;
const struct CARBON_DIOXIDE_DRY_GAS {
const ld J_kgC = 833.0;
const ld kcal_kgC = .199;
} carbonDioxideDryGas;
const struct NITROGEN_GAS {
const ld J_kgC = 739.0;
const ld kcal_kgC = .177;
} nitrogenGas;
const struct NITROGEN_DRY_GAS {
const ld J_kgC = 1040;
const ld kcal_kgC = .248;
} nitrogenDryGas;
const struct OXYGEN_GAS {
const ld J_kgC = 651.0;
const ld kcal_kgC = .156;
} oxygenGas;
const struct OXYGEN_DRY_GAS {
const ld J_kgC = 913.0;
const ld kcal_kgC = .218;
} oxygenDryGas;
const struct STEAM_100C_GAS {
const ld J_kgC = 1520.0;
const ld kcal_kgC = .363;
} steam100CGas;
const struct STEAM_DRY_100C_GAS {
const ld J_kgC = 2020.0;
const ld kcal_kgC = .482;
} steamDry100CGas;
} SHC;
/**
* structure of latent heat coefficients for fusion (melting point)
*/
static struct LatentHeatFusion
{
LatentHeatFusion() {}
const struct HELIUM {
const ld melting_point = -269.7;
const ld kJ_kg = 5.23;
const ld J_kg = 5230.0;
const ld kcal_kg = 1.25;
} helium;
const struct HYDROGEN {
const ld melting_point = -259.3;
const ld kJ_kg = 58.60;
const ld J_kg = 58600.0;
const ld kcal_kg = 14.0;
} hydrogen;
const struct NITROGEN {
const ld melting_point = -210.0;
const ld kJ_kg = 25.50;
const ld J_kg = 25500.0;
const ld kcal_kg = 6.09;
} nitrogen;
const struct OXYGEN {
const ld melting_point = -218.8;
const ld kJ_kg = 13.80;
const ld J_kg = 13800.0;
const ld kcal_kg = 3.3;
} oxygen;
const struct ETHANOL {
const ld melting_point = -114.0;
const ld kJ_kg = 104.0;
const ld J_kg = 104000.0;
const ld kcal_kg = 24.9;
} ethanol;
const struct AMMONIA {
const ld melting_point = -75.0;
const ld kJ_kg = FP_NAN;
const ld J_kg = FP_NAN;
const ld kcal_kg = 108.0;
} ammonia;
const struct MERCURY {
const ld melting_point = -38.9;
const ld kJ_kg = 11.40;
const ld J_kg = 11400.0;
const ld kcal_kg = 2.72;
} mercury;
const struct WATER {
const ld melting_point = 0.0;
const ld kJ_kg = 334.0;
const ld J_kg = 334000.0;
const ld kcal_kg = 79.8;
} water;
const struct SULFUR {
const ld melting_point = 119;
const ld kJ_kg = 38.10;
const ld J_kg = 38100.0;
const ld kcal_kg = 9.10;
} sulfur;
const struct LEAD {
const ld melting_point = 327.0;
const ld kJ_kg = 24.70;
const ld J_kg = 24700.0;
const ld kcal_kg = 5.49;
} lead;
const struct ANTIMONY {
const ld melting_point = 631.0;
const ld kJ_kg = 165.0;
const ld J_kg = 165000.0;
const ld kcal_kg = 39.4;
} antimony;
const struct ALUMINUM {
const ld melting_point = 660.0;
const ld kJ_kg = 380.0;
const ld J_kg = 380000.0;
const ld kcal_kg = 90.0;
} aluminum;
const struct SILVER {
const ld melting_point = 961.0;
const ld kJ_kg = 88.30;
const ld J_kg = 88300.0;
const ld kcal_kg = 21.1;
} silver;
const struct GOLD {
const ld melting_point = 1063.0;
const ld kJ_kg = 64.0;
const ld J_kg = 64000.0;
const ld kcal_kg = 15.4;
} gold;
const struct COPPER {
const ld melting_point = 1083.0;
const ld kJ_kg = 206.14;
const ld J_kg = 206140.0;
const ld kcal_kg = 49.2;
} copper;
const struct URANIUM {
const ld melting_point = 1133.0;
const ld kJ_kg = 84.0;
const ld J_kg = 84000.0;
const ld kcal_kg = 20.077;
} uranium;
const struct URANIUM_DIOXIDE {
const ld melting_point = 2846.85;
const ld kJ_kg = 259.0;
const ld J_kg = 259000.0;
const ld kcal_kg = 61.903;
} uraniumDioxide;
const struct PLATINUM {
const ld melting_point = 1768.0;
const ld kJ_kg = 103.0;
const ld J_kg = 103000.0;
const ld kcal_kg = 24.618;
} platinum;
const struct TUNGSTEN {
const ld melting_point = 3410.0;
const ld kJ_kg = 184.0;
const ld J_kg = 184000.0;
const ld kcal_kg = 43.9;
} tungsten;
// create a way to iterate through all the elements and the kJ_kg value
// for each element
const std::map<std::string, ld> elems_kj = {
{"helium", helium.kJ_kg},
{"hydrogen", hydrogen.kJ_kg},
{"nitrogen", nitrogen.kJ_kg},
{"oxygen", oxygen.kJ_kg},
{"ethanol", ethanol.kJ_kg},
{"ammonia", ammonia.kJ_kg},
{"mercury", mercury.kJ_kg},
{"water", water.kJ_kg},
{"sulfur", sulfur.kJ_kg},
{"lead", lead.kJ_kg},
{"antimony", antimony.kJ_kg},
{"aluminum", aluminum.kJ_kg},
{"silver", silver.kJ_kg},
{"gold", gold.kJ_kg},
{"copper", copper.kJ_kg},
{"uranium", uranium.kJ_kg},
{"uraniumDioxide", uraniumDioxide.kJ_kg},
{"platinum", platinum.kJ_kg},
{"tungsten", tungsten.kJ_kg}
};
// create a way to iterate through all the elements and the J_kg value
const std::map<std::string, ld> elems_j = {
{"helium", helium.J_kg},
{"hydrogen", hydrogen.J_kg},
{"nitrogen", nitrogen.J_kg},
{"oxygen", oxygen.J_kg},
{"ethanol", ethanol.J_kg},
{"ammonia", ammonia.J_kg},
{"mercury", mercury.J_kg},
{"water", water.J_kg},
{"sulfur", sulfur.J_kg},
{"lead", lead.J_kg},
{"antimony", antimony.J_kg},
{"aluminum", aluminum.J_kg},
{"silver", silver.J_kg},
{"gold", gold.J_kg},
{"copper", copper.J_kg},
{"uranium", uranium.J_kg},
{"uraniumDioxide", uraniumDioxide.J_kg},
{"platinum", platinum.J_kg},
{"tungsten", tungsten.J_kg}
};
} LF;
/**
* structure of latent heat coefficients for vaporization (boiling point)
*/
static struct LatentHeatVaporization
{
LatentHeatVaporization() {}
const struct HELIUM {
const ld boiling_point = -268.9; // C
const ld kJ_kg = 20.73; // kJ/kg
const ld J_kg = 20730.0; // J/kg
const ld kcal_kg = 4.95; // kcal/kg
} helium;
const struct HYDROGEN {
const ld boiling_point = -252.9;
const ld kJ_kg = 452.0;
const ld J_kg = 452000.0;
const ld kcal_kg = 108.0;
} hydrogen;
const struct NITROGEN {
const ld boiling_point = -195.8;
const ld kJ_kg = 201.0;
const ld J_kg = 201000.0;
const ld kcal_kg = 48.0;
} nitrogen;
const struct OXYGEN {
const ld boiling_point = -183.0;
const ld kJ_kg = 213.0;
const ld J_kg = 213000.0;
const ld kcal_kg = 50.9;
} oxygen;
const struct ETHANOL {
const ld boiling_point = 78.3;
const ld kJ_kg = 854.0;
const ld J_kg = 854000.0;
const ld kcal_kg = 204.0;
} ethanol;
const struct AMMONIA {
const ld boiling_point = -33.4;
const ld kJ_kg = 1370.0;
const ld J_kg = 1370000.0;
const ld kcal_kg = 327.0;
} ammonia;
const struct MERCURY {
const ld boiling_point = 357;
const ld kJ_kg = 272.0;
const ld J_kg = 272000.0;
const ld kcal_kg = 65.0;
} mercury;
const struct WATER {
const ld boiling_point = 100.0;
const ld kJ_kg = 2256.0;
const ld J_kg = 2256000.0;
const ld kcal_kg = 539.0;
} water;
const struct SULFUR {
const ld boiling_point = 444.6;
const ld kJ_kg = 326.0;
const ld J_kg = 326000.0;
const ld kcal_kg = 77.9;
} sulfur;
const struct LEAD {
const ld boiling_point = 1750.0;
const ld kJ_kg = 859.0;
const ld J_kg = 859000.0;
const ld kcal_kg = 205.31;
} lead;
const struct ANTIMONY {
const ld boiling_point = 1440.0;
const ld kJ_kg = 561.0;
const ld J_kg = 561000.0;
const ld kcal_kg = 134.0;
} antimony;
const struct ALUMINUM {
const ld melting_point = 2450.0;
const ld kJ_kg = 11400.0;
const ld J_kg = 11400000.0;
const ld kcal_kg = 2720.0;
} aluminum;
const struct SILVER {
const ld boiling_point = 2193.0;
const ld kJ_kg = 2336.0;
const ld J_kg = 2336000.0;
const ld kcal_kg = 558.0;
} silver;
const struct GOLD {
const ld boiling_point = 2660.0;
const ld kJ_kg = 1578.0;
const ld J_kg = 1578000.0;
const ld kcal_kg = 377.0;
} gold;
const struct COPPER {
const ld boiling_point = 2595.0;
const ld kJ_kg = 5069.0;
const ld J_kg = 5069000.0;
const ld kcal_kg = 1211.0;
} copper;
const struct URANIUM {
const ld boiling_point = 3900.0;
const ld kJ_kg = 1900.0;
const ld J_kg = 1900000.0;
const ld kcal_kg = 454.0;
} uranium;
const struct URANIUM_DIOXIDE {
const ld boiling_point = 3541.85;
const ld kJ_kg = 1533.0;
const ld J_kg = 1533000.0;
const ld kcal_kg = 366.396;
} uraniumDioxide;
const struct PLATINUM {
const ld boiling_point = 3825.0;
const ld kJ_kg = 2511.8;
const ld J_kg = 2511800.0;
const ld kcal_kg = 600.335;
} platinum;
const struct TUNGSTEN {
const ld boiling_point = 5900.0;
const ld kJ_kg = 4810.0;
const ld J_kg = 4810000.0;
const ld kcal_kg = 1150.0;
} tungsten;
// create a way to iterate through all the elements and the kJ_kg value
// for each element
const std::map<std::string, ld> elems_kj = {
{"helium", helium.kJ_kg},
{"hydrogen", hydrogen.kJ_kg},
{"nitrogen", nitrogen.kJ_kg},
{"oxygen", oxygen.kJ_kg},
{"ethanol", ethanol.kJ_kg},
{"ammonia", ammonia.kJ_kg},
{"mercury", mercury.kJ_kg},
{"water", water.kJ_kg},
{"sulfur", sulfur.kJ_kg},
{"lead", lead.kJ_kg},
{"antimony", antimony.kJ_kg},
{"aluminum", aluminum.kJ_kg},
{"silver", silver.kJ_kg},
{"gold", gold.kJ_kg},
{"copper", copper.kJ_kg},
{"uranium", uranium.kJ_kg},
{"uraniumDioxide", uraniumDioxide.kJ_kg},
{"platinum", platinum.kJ_kg},
{"tungsten", tungsten.kJ_kg}
};
// create a way to iterate through all the elements and the J_kg value
const std::map<std::string, ld> elems_j = {
{"helium", helium.J_kg},
{"hydrogen", hydrogen.J_kg},
{"nitrogen", nitrogen.J_kg},
{"oxygen", oxygen.J_kg},
{"ethanol", ethanol.J_kg},
{"ammonia", ammonia.J_kg},
{"mercury", mercury.J_kg},
{"water", water.J_kg},
{"sulfur", sulfur.J_kg},
{"lead", lead.J_kg},
{"antimony", antimony.J_kg},
{"aluminum", aluminum.J_kg},
{"silver", silver.J_kg},
{"gold", gold.J_kg},
{"copper", copper.J_kg},
{"uranium", uranium.J_kg},
{"uraniumDioxide", uraniumDioxide.J_kg},
{"platinum", platinum.J_kg},
{"tungsten", tungsten.J_kg}
};
}LV;
/**
* @brief structure of thermal conductivities of common substances
*/
static struct ThermalConductivity
{
ThermalConductivity() {}
// const ld silver = 420.0;
const struct SILVER {
const ld W_mK = 403.0;
const ld Btu_in_h_ft = 2790.0;
} silver;
// const ld copper = 390.0;
const struct COPPER {
const ld kJ_kgC = 401.0;
const ld kcal_kgF = 2780.0;
} copper;
// const ld gold = 318.0;
const struct GOLD {
const ld W_mK = 327.0;
const ld Btu_in_h_ft = 2270.0;
} gold;
// const ld aluminum = 220.0;
const struct ALUMINUM {
const ld W_mK = 237.0;
const ld Btu_in_h_ft = 1640.0;
} aluminum;
// const ld steel_iron = 80.0;
const struct IRON {
const ld W_mK = 80.4;
const ld Btu_in_h_ft = 558.0;
} iron;
// const ld steel_stainless = 14.0;
const struct STEEL_STAINLESS {
const ld W_mK = 14.0;
const ld Btu_in_h_ft = 95.0;
} steel_stainless;
// const ld steele = 46.0;
const struct STEEL {
const ld W_mK = 46.0;
const ld Btu_in_h_ft = 319.0;
} steel;
// const ld ice = 2.2;
const struct ICE {
const ld W_mK = 2.2;
const ld Btu_in_h_ft = 15.3;
} ice;
// const ld glass = .84;
const struct GLASS {
const ld W_mK = 0.84;
const ld Btu_in_h_ft = 5.8;
} glass;
// const ld concrete_brick = .84;
const struct CONCRETE {
const ld W_mK = 1.0;
const ld Btu_in_h_ft = 7.0;
} concrete;
// const ld water = .61;
const struct WATER {
const ld W_mK = 0.61;
const ld Btu_in_h_ft = 4.2;
} water;
// const ld fatty_tissue_no_blood = .2;
const struct FATTY_TISSUE {
const ld W_mK = 0.2;
const ld Btu_in_h_ft = 1.39;
} fatty_tissue_no_blood;
// const ld asbestos = .16;
const struct ASBESTOS {
const ld W_mK = 0.16;
const ld Btu_in_h_ft = 1.11;
} asbestos;
// const ld plasterboard = .16;
const struct PLASTERBOARD {
const ld W_mK = 0.16;
const ld Btu_in_h_ft = 1.11;
} plasterboard;
// const ld wood_soft = .08;
const struct WOOD_SOFT {
const ld W_mK = 0.08;
const ld Btu_in_h_ft = 0.555;
} wood_soft;
// const ld wood_medium = .12;
const struct WOOD_MEDIUM {
const ld W_mK = 0.12;
const ld Btu_in_h_ft = 0.832;
} wood_medium;
// const ld wood_hard = .16;
const struct WOOD_HARD {
const ld W_mK = 0.16;
const ld Btu_in_h_ft = 1.11;
} wood_hard;
// const ld wood_pine= .11
const struct WOOD_PINE {
const ld W_mK = 0.11;
const ld Btu_in_h_ft = 0.78;
} wood_pine;
// const ld snow_dry = .10;
const struct SNOW_DRY {
const ld W_mK = 0.10;
const ld Btu_in_h_ft = 0.693;
} snow_dry;
// const ld cork = .042;
const struct CORK {
const ld W_mK = 0.042;
const ld Btu_in_h_ft = 0.291;
} cork;
// const ld glass_wool = .042;
const struct GOOSE_DOWN {
const ld W_mK = 0.043;
const ld Btu_in_h_ft = 0.30;
} goose_down;
// const ld fiberglass = .042;
const struct FIBERGLASS {
const ld W_mK = 0.042;
const ld Btu_in_h_ft = 0.29;
} fiberglass;
// const ld air = .023;
const struct AIR {
const ld W_mK = 0.026;
const ld Btu_in_h_ft = 0.18;
} air;
// const ld styrofoam = .010;
const struct STYROFOAM {
const ld W_mK = 0.029;
const ld Btu_in_h_ft = 0.20;
} styrofoam;
// const ld helium = .14;
const struct HELIUM {
const ld W_mK = 0.14;
const ld Btu_in_h_ft = 0.97;
} helium;
}K;
/**
* @brief struct of Infrared Emissivity values which are a measure
* of the amount of heat radiation a surface can reflect back out and is a value
* from 0 (perfect thermal mirror) to a 1.0 (perfect black body)
*/
static struct InfraredEmissivityValues
{
const ld aluminium_anodised = 0.77;
const ld aluminium_polished = 0.05;
const ld asbestos_board = 0.96;
const ld asbestos_fabric = 0.78;
const ld asbestos_paper = 0.93;
const ld asbestos_slate = 0.96;
const ld Brass_highlyPolished = 0.03;
const ld Brass_oxidized = 0.61;
const std::vector<ld> Brick_common ={.81, .82, .83, .84, .85, .86};
const ld Brick_common_red = 0.93;
const ld Brick_facing_red = 0.92;
const ld Brick_fireClay = 0.75;
const ld Brick_masonry = 0.94;
const ld Brick_red = 0.90;
const ld Carbon_candle_soot = 0.95;
const ld Carbon_graphite_filed_surface = 0.98;
const ld Carbon_purified = 0.80;
const ld Cement_ = 0.54;
const ld Charcoal_powder = 0.96;
const ld Chipboard_untreated = 0.90;
const ld Chromium_polished = 0.10;
const ld Clay_fired = 0.91;
const ld Concrete = 0.92;
const ld Concrete_dry = 0.95;
const std::vector<ld> Concrete_rough = { 0.92, .93, .94, .95, .96, .97 };
const ld Copper_polished = 0.05;
const ld Copper_oxidized = 0.65;
const ld Enamel_lacquer = 0.90;
const ld Fabric_Hessian_green = 0.88;
const ld Fabric_Hessian_uncoloured = 0.87;
const ld Fibreglass = 0.75;
const ld Fibre_board_porous_untreated = 0.85;
const ld Fibre_board_hard_untreated = 0.85;
const ld Filler_white = 0.88;
const ld Firebrick = 0.68;
const ld Food_and_Organic_Materials = 0.96;
const ld Formica = 0.94;
const ld Galvanized_Pipe = 0.46;
const ld Glass = 0.92;
const ld Glass_chemical_ware_partly_transparent = 0.97;
const ld Glass_frosted_high = 0.96;
const ld Glass_frosted_low = 0.70;
const ld Glass_polished_plate = 0.94;
const ld Granite_natural_surface = 0.96;
const ld Graphite_powder = 0.97;
const ld Gravel = 0.28;
const ld Gypsum = 0.08;
const ld Hardwood_across_grain = 0.82;
const ld Hardwood_along_grain = 0.715;
const ld Ice = 0.97;
const ld Iron_heavily_rusted = 0.935;
const ld Lacquer_bakelite = 0.93;
const ld Lacquer_dull_black = 0.97;
const ld Lampblack = 0.96;
const ld Limestone_natural_surface = 0.96;
const ld Mortar = 0.87;
const ld Mortar_dry = 0.94;
const ld PVC = 0.92;
const ld Paint_3M_black_velvet_coating_9560_series_optical_black = 1.00;
const ld Paint_aluminium = 0.45;
const ld Paint_oil_average_of_16_colors = 0.94;
const ld Paint_oil_black_flat = 0.94;
const ld Paint_oil_black_gloss = 0.92;
const ld Paint_oil_grey_flat = 0.97;
const ld Paint_oil_grey_gloss = 0.94;
const ld Paint_oil_various_colours = 0.94;
const ld Paint_plastic_black = 0.95;
const ld Paint_plastic_white = 0.84;
const ld Paper_black = 0.90;
const ld Paper_black_dull = 0.94;
const ld Paper_black_shiny = 0.90;
const ld Paper_cardboard_box = 0.81;
const ld Paper_green = 0.85;
const ld Paper_red = 0.76;
const ld Paper_white = 0.68;
const ld Paper_white_bond = 0.93;
const ld Paper_yellow = 0.72;
const ld Paper_tar = 0.92;
const ld Pipes_glazed = 0.83;
const ld Plaster_common = 0.86;
const ld Plaster_rough_coat = 0.91;
const ld Plasterboard_untreated = 0.90;
const ld Plastic_acrylic_clear = 0.94;
const ld Plastic_black = 0.95;
const ld Plastic_white = 0.84;
const ld Plastic_paper_red = 0.94;
const ld Plastic_paper_white = 0.84;
const ld Plexiglass_Perpex = 0.86;
const ld Plywood_common = 0.83;
const ld Plywood_commercial_smooth_finish_dry = 0.82;
const ld Plywood_untreated = 0.83;
const ld Polypropylene = 0.97;
const ld Porcelain_glazed = 0.92;
const ld Quartz = 0.93;
const ld Redwood_wrought_untreated = 0.83;
const ld Redwood_unwrought_untreated = 0.84;
const ld Rubber = 0.95;
const ld Rubber_stopper_black = 0.97;
const ld Sand = 0.90;
const ld Skin_human = 0.95;
const ld Snow = 0.80;
const ld Soil_dry = 0.92;
const ld Soil_frozen = 0.93;
const ld Soil_saturated_with_water = 0.95;
const ld Stainless_Steel = 0.59;
const ld Stainless_Plate = 0.34;
const ld Steel_galvanized = 0.28;
const ld Steel_rolled_freshly = 0.24;
const ld Styrofoam_insulation = 0.60;
const ld Tape_electrical_insulating_black = 0.97;
const ld Tape_masking = 0.92;
const ld Tile_floor_asbestos = 0.94;
const ld Tile_glazed = 0.94;
const ld Tin_burnished = 0.05;
const ld Tin_commercial_tin_plated_sheet_iron = 0.06;
const ld Varnish_flat = 0.93;
const ld Wallpaper_slight_pattern_light_grey = 0.85;
const ld Wallpaper_slight_pattern_red = 0.90;
const ld Water = 0.95;
const ld Water_distilled = 0.95;
const ld Water_ice_smooth = 0.96;
const ld Water_frost_crystals = 0.98;
const ld Water_snow = 0.85;
const ld Wood_planed = 0.90;
const ld Wood_panelling_light_finish = 0.90;
const ld Wood_spruce_polished_dry = 0.86;
}emissivity;
#include "Temperature.h"
class Heat :
public Temperature
{
private:
static void countIncrease() { heat_objectCount += 1; }
static void countDecrease() { heat_objectCount -= 1; }
public:
/**
* @brief no argument constructor
*/
Heat()
{
countIncrease();
}
/**
* @brief display method for outputting the count of Heat objects
*/
static void show_heat_objectCount() { std::cout << "\nheat object count: "
<< heat_objectCount
<< std::endl; }
/**
* @brief getter method returns the value of heat objects
*/
static int get_heat_objectCount() { return heat_objectCount; }
/**
* @brief heat capacity applies to specific object and therefore depends
* on the objects mass and specific heat capacity
* @param mass
* @param specificHeat
* @return heat capacity
*/
static ld heatCapacity(ld mass, ld specificHeat, bool print = true)
{
auto heat_capacity = mass * specificHeat;
if (print)
std::cout << "\nheat capacity: " << heat_capacity << std::endl;
return heat_capacity;
}
/**
* @brief heat of transformation of a substance from one state to another
* @param mass of substance
* @param latentHeat is the heat of transformation (fusion or vaporization)
* @return heat of transformation
*/
static ld heatOfTransformation(ld mass, ld latentHeat, bool print = true)
{
auto heatOfTransformation = mass * latentHeat;
if (print)
std::cout << "\nheat of transformation: " << heatOfTransformation
<< std::endl;
return heatOfTransformation;
}
/**
* @brief calculates the required heat to heat an object up
* @param mass is the mass of the object
* @param c is the specific heat which depends on object type
* @param deltaTemp is the change in temperature
* @returns the heat in Joules
*/
static ld heatEnergy(const ld mass,
const ld c,
const ld deltaTemp,
bool print = true)
{
auto heat = mass * c * deltaTemp;
if (print)
std::cout << "\nheat energy: " << heat << " J" << std::endl;
return heat;
}
/**
* @brief calculates the temp from heat transferred
* @param Q is the heat in Joules
* @param mass is the mass of the object
* @param c is the specific heat which depends on object type
* @returns the temperature in Kelvin
*/
static ld tempFromHeatEnergy(const ld Q,
const ld mass,
const ld c,
bool print = true)
{
auto temp = Q / (mass * c);
if (print)
std::cout << "\ntemp from heat energy: " << temp << " K"
<< std::endl;
return temp;
}
/**
* @brief calculates the mass from heat capacity
* @param Q is the heat in Joules
* @param temp is the temperature in Kelvin
* @param c is the specific heat which depends on object type
* @returns the mass in kilograms
*/
static ld massFromHeatEnergy(const ld Q,
const ld temp,
const ld c,
bool print = true)
{
auto mass = Q / (c * temp);
if (print)
std::cout << "\nmass from heat energy: " << mass << " kg"
<< std::endl;
return mass;
}
/**
* @brief calculates the specific heat from heat capacity
* @param Q is the heat in Joules
* @param mass is the mass of the object
* @param temp is the temperature in Kelvin
* @returns the specific heat in Joules per Kelvin
*/
static ld specificHeatFromHeatEnergy(const ld Q,
const ld mass,
const ld temp,
bool print = true)
{
auto sh = Q / (mass * temp);
if (print)
std::cout << "\nspecific heat from heat energy: " << sh << " J/K"
<< std::endl;
return sh;
}
/**
* @brief calculates the final temperature between objects
* @param m1 is the mass of the first object
* @param c1 is the specific heat of object 1
* @param t1 is the temperature object 1
* @param m2 is the mass of the second object
* @param c2 is the specific heat of object 2
* @param t2 is the temperature object 2
* @returns thermal equilibrium {is when two objects come in contact
* and the hotter object transfers heat to the cooler object until a equal
* temp is reached between two objects}
*/
static ld thermalEquilibriumTemp(const ld m1,
const ld c1,
const ld t1,
const ld m2,
const ld c2,
const ld t2,
bool print = true)
{
auto temp = ((m1 * c1 * t1) + (m2 * c2 * t2)) / ((m1 * c1) + (m2 * c2));
if (print)
std::cout << "thermal equilibrium temp: " << temp << std::endl;
return temp;
}
static ld thermalEquilibriumTemp(vector<SpecificHeat> &sh, bool print = true)
{
ld top = 0;
ld bot = 0;
for (auto &i : sh)
{
top += (i.getHeat());
bot += (i.getMass() * i.getSpecificHeat());
}
auto tempFinal = top / bot;
if (print)
std::cout << "thermal equilibrium temp: " << tempFinal << std::endl;
return tempFinal;
}
/**
* @brief calculates the phase change from melting/freezing
* @param mass is the mass in kg
* @param Lf is the latent heat coefficient for fusion
* @returns the energy to cause phase change
*/
static ld phaseChangeEnergy_Lf(const ld mass,
const ld Lf,
bool print = true)
{
auto energy = mass * Lf;
if (print)
std::cout << "phase change energy: " << energy << " J" << std::endl;
return energy;
}
/**
* @brief calculates the phase change from vaporization/condensation
* @param mass is the mass in kg
* @param Lv is the latent heat coefficient for vaporization
* @returns the energy to cause phase change
*/
static ld phaseChangeEnergy_Lv(const ld mass,
const ld Lv,
bool print = true)
{
auto energy = mass * Lv;
if (print)
std::cout << "phase change energy: " << energy << " J" << std::endl;
return energy;
}