@dnv-plant/typescriptpws 1.0.70 → 1.0.73-alpha.1902013

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (215) hide show
  1. package/index.ts +2 -2
  2. package/jest.config.js +5 -0
  3. package/package.json +6 -6
  4. package/src/calculations/applicationTools.ts +2 -2
  5. package/src/calculations/discharge.ts +2 -2
  6. package/src/calculations/dispersion.ts +2 -2
  7. package/src/calculations/dispersionView.ts +2 -2
  8. package/src/calculations/fireball.ts +2 -2
  9. package/src/calculations/jetFire.ts +2 -2
  10. package/src/calculations/lateExplosion.ts +2 -2
  11. package/src/calculations/linkedRunners.ts +2 -2
  12. package/src/calculations/poolFire.ts +2 -2
  13. package/src/calculations/properties.ts +2 -2
  14. package/src/calculations/radiation.ts +2 -2
  15. package/src/calculations/standalones.ts +2 -2
  16. package/src/calculations/toxics.ts +2 -2
  17. package/src/calculations/utilities.ts +2 -2
  18. package/src/constants.ts +2 -2
  19. package/src/entities.ts +2 -2
  20. package/src/entity-schemas.ts +2 -2
  21. package/src/enums.ts +2 -2
  22. package/src/materials.ts +14 -14
  23. package/src/utilities.ts +2 -2
  24. package/tests/concentration-at-point-calculation/testCase116.test.ts +146 -0
  25. package/tests/concentration-at-point-calculation/testCase117.test.ts +142 -0
  26. package/tests/concentration-at-point-calculation/testCase118.test.ts +143 -0
  27. package/tests/concentration-at-point-calculation/testCase119.test.ts +149 -0
  28. package/tests/concentration-at-point-calculation/testCase120.test.ts +155 -0
  29. package/tests/constants/testConstants.test.ts +23 -0
  30. package/tests/convert-comp-mass-to-mole-calculation/testCase129.test.ts +74 -0
  31. package/tests/convert-comp-mass-to-mole-calculation/testCase130.test.ts +73 -0
  32. package/tests/convert-comp-mass-to-mole-calculation/testCase131.test.ts +73 -0
  33. package/tests/convert-comp-mass-to-mole-calculation/testCase132.test.ts +73 -0
  34. package/tests/convert-comp-mass-to-mole-calculation/testCase133.test.ts +73 -0
  35. package/tests/convert-comp-mole-to-mass-calculation/testCase134.test.ts +72 -0
  36. package/tests/convert-comp-mole-to-mass-calculation/testCase135.test.ts +72 -0
  37. package/tests/convert-comp-mole-to-mass-calculation/testCase136.test.ts +72 -0
  38. package/tests/convert-comp-mole-to-mass-calculation/testCase137.test.ts +72 -0
  39. package/tests/convert-comp-mole-to-mass-calculation/testCase138.test.ts +72 -0
  40. package/tests/distances-and-ellipses-to-radiation-levels-calculation/testCase64.test.ts +194 -0
  41. package/tests/distances-and-ellipses-to-radiation-levels-calculation/testCase65.test.ts +197 -0
  42. package/tests/distances-and-ellipses-to-radiation-levels-calculation/testCase66.test.ts +194 -0
  43. package/tests/distances-and-ellipses-to-radiation-levels-calculation/testCase67.test.ts +198 -0
  44. package/tests/distances-and-ellipses-to-radiation-levels-calculation/testCase68.test.ts +178 -0
  45. package/tests/distances-and-footprints-to-concentration-levels-calculation/testCase31a.test.ts +158 -0
  46. package/tests/distances-and-footprints-to-concentration-levels-calculation/testCase32a.test.ts +156 -0
  47. package/tests/distances-and-footprints-to-concentration-levels-calculation/testCase33a.test.ts +158 -0
  48. package/tests/distances-and-footprints-to-concentration-levels-calculation/testCase34a.test.ts +165 -0
  49. package/tests/distances-and-footprints-to-concentration-levels-calculation/testCase35a.test.ts +188 -0
  50. package/tests/distances-to-conc-levels-calculation/testCase121.test.ts +149 -0
  51. package/tests/distances-to-conc-levels-calculation/testCase122.test.ts +145 -0
  52. package/tests/distances-to-conc-levels-calculation/testCase123.test.ts +150 -0
  53. package/tests/distances-to-conc-levels-calculation/testCase124.test.ts +154 -0
  54. package/tests/distances-to-conc-levels-calculation/testCase125.test.ts +157 -0
  55. package/tests/entities/testVessel.test.ts +49 -0
  56. package/tests/fireball-calculation/testCase89.test.ts +151 -0
  57. package/tests/fireball-calculation/testCase90.test.ts +153 -0
  58. package/tests/fireball-calculation/testCase91.test.ts +152 -0
  59. package/tests/fireball-calculation/testCse92.test.ts +150 -0
  60. package/tests/flash-calculation/testCase26.test.ts +71 -0
  61. package/tests/flash-calculation/testCase27.test.ts +69 -0
  62. package/tests/flash-calculation/testCase28.test.ts +69 -0
  63. package/tests/flash-calculation/testCase29.test.ts +67 -0
  64. package/tests/flash-calculation/testCase30.test.ts +70 -0
  65. package/tests/general/operation-id-demo.test.ts +64 -0
  66. package/tests/get-component-by-id/get-component-by-id-METHANE.test.ts +35 -0
  67. package/tests/get-mass-from-vessel-calculation/testCase139.test.ts +65 -0
  68. package/tests/jet-fire-calculation/testCase36.test.ts +141 -0
  69. package/tests/jet-fire-calculation/testCase37.test.ts +148 -0
  70. package/tests/jet-fire-calculation/testCase38.test.ts +147 -0
  71. package/tests/jet-fire-calculation/testCase39.test.ts +146 -0
  72. package/tests/jet-fire-calculation/testCase40.test.ts +152 -0
  73. package/tests/late-explosion-calculation/testCase46.test.ts +157 -0
  74. package/tests/late-explosion-calculation/testCase47.test.ts +149 -0
  75. package/tests/late-explosion-calculation/testCase48.test.ts +176 -0
  76. package/tests/late-explosion-calculation/testCase49.test.ts +178 -0
  77. package/tests/late-explosion-calculation/testCase50.test.ts +176 -0
  78. package/tests/late-explosion-calculation/testCase74.test.ts +166 -0
  79. package/tests/late-explosion-calculation/testCase75.test.ts +163 -0
  80. package/tests/late-explosion-calculation/testCase76.test.ts +174 -0
  81. package/tests/late-explosion-calculation/testCase77.test.ts +175 -0
  82. package/tests/late-explosion-calculation/testCase78.test.ts +175 -0
  83. package/tests/lethality-distance-calculation/testCase60.test.ts +142 -0
  84. package/tests/linked-runners/user-defined-source-linked-run/test-uds-153.test.ts +121 -0
  85. package/tests/linked-runners/user-defined-source-linked-run/test-uds-154.test.ts +167 -0
  86. package/tests/linked-runners/user-defined-source-linked-run/test-uds-155.test.ts +202 -0
  87. package/tests/linked-runners/user-defined-source-linked-run/test-uds-156.test.ts +201 -0
  88. package/tests/linked-runners/vessel-leak-linked-run/test-vl-157.test.ts +182 -0
  89. package/tests/linked-runners/vessel-leak-linked-run/test-vl-158.test.ts +200 -0
  90. package/tests/linked-runners/vessel-leak-linked-run/test-vl-159.test.ts +158 -0
  91. package/tests/linked-runners/vessel-leak-linked-run/test-vl-160.test.ts +165 -0
  92. package/tests/linked-runners/vessel-line-rupture-linked-run/test-vlr-161.test.ts +161 -0
  93. package/tests/linked-runners/vessel-line-rupture-linked-run/test-vlr-162.test.ts +167 -0
  94. package/tests/linked-runners/vessel-line-rupture-linked-run/test-vlr-163.test.ts +177 -0
  95. package/tests/linked-runners/vessel-line-rupture-linked-run/test-vlr-164.test.ts +165 -0
  96. package/tests/linked-runners/vessel-relief-valve-linked-run/test-vrv-165.test.ts +166 -0
  97. package/tests/linked-runners/vessel-relief-valve-linked-run/test-vrv-166.test.ts +154 -0
  98. package/tests/linked-runners/vessel-relief-valve-linked-run/test-vrv-167.test.ts +157 -0
  99. package/tests/linked-runners/vessel-relief-valve-linked-run/test-vrv-168.test.ts +168 -0
  100. package/tests/load-mass-inventory-vessel-for-line-rupture-scenario-calculation/testCase126.test.ts +72 -0
  101. package/tests/load-mass-inventory-vessel-for-line-rupture-scenario-calculation/testCase127.test.ts +73 -0
  102. package/tests/load-mass-inventory-vessel-for-line-rupture-scenario-calculation/testCase128.test.ts +72 -0
  103. package/tests/load-mass-inventory-vessel-for-relief-valve-scenario-calculation/testCase103.test.ts +74 -0
  104. package/tests/load-mass-inventory-vessel-for-relief-valve-scenario-calculation/testCase104.test.ts +75 -0
  105. package/tests/load-mass-inventory-vessel-for-relief-valve-scenario-calculation/testCase105.test.ts +74 -0
  106. package/tests/long-pipe-calculation/testCase55.test.ts +88 -0
  107. package/tests/long-pipe-calculation/testCase56.test.ts +90 -0
  108. package/tests/long-pipe-calculation/testCase57.test.ts +88 -0
  109. package/tests/long-pipe-calculation/testCase58.test.ts +88 -0
  110. package/tests/long-pipe-calculation/testCase59.test.ts +88 -0
  111. package/tests/materials/test-get-component-by-cas-id-1-2-PROPYLENE-OXIDE.test.ts +23 -0
  112. package/tests/materials/test-get-component-by-cas-id-CARBON-MONOXIDE.test.ts +25 -0
  113. package/tests/materials/test-get-component-by-cas-id-METHANE.test.ts +22 -0
  114. package/tests/materials/test-get-component-by-id-1-2-PROPYLENE-OXIDE.test.ts +23 -0
  115. package/tests/materials/test-get-component-by-id-CARBON-MONOXIDE.test.ts +22 -0
  116. package/tests/materials/test-get-component-by-id-METHANE.test.ts +22 -0
  117. package/tests/materials/test-get-component-by-name-1-2-PROPYLENE-OXIDE.test.ts +24 -0
  118. package/tests/materials/test-get-component-by-name-CARBON-MONOXIDE.test.ts +23 -0
  119. package/tests/materials/test-get-component-by-name-METHANE.test.ts +25 -0
  120. package/tests/materials/test-get-components.test.ts +47 -0
  121. package/tests/materials/test-get-dippr-components.test.ts +28 -0
  122. package/tests/materials/test-get-dnv-components.test.ts +28 -0
  123. package/tests/materials/test-get-material-by-cas-id-1-2-PROPYLENE-OXIDE.test.ts +29 -0
  124. package/tests/materials/test-get-material-by-cas-id-CARBON-MONOXIDE.test.ts +31 -0
  125. package/tests/materials/test-get-material-by-cas-id-METHANE.test.ts +30 -0
  126. package/tests/materials/test-get-material-by-cas-id-ZERO.test.ts +31 -0
  127. package/tests/materials/test-get-material-by-id-1-2-PROPYLENE-OXIDE.test.ts +30 -0
  128. package/tests/materials/test-get-material-by-id-CARBON-MONOXIDE.test.ts +29 -0
  129. package/tests/materials/test-get-material-by-id-METHANE.test.ts +29 -0
  130. package/tests/materials/test-get-material-by-name-1-2-PROPYLENE-OXIDE.test.ts +29 -0
  131. package/tests/materials/test-get-material-by-name-CARBON-MONOXIDE.test.ts +29 -0
  132. package/tests/materials/test-get-material-by-name-METHANE.test.ts +29 -0
  133. package/tests/materials/test-get-materials.test.ts +32 -0
  134. package/tests/max-conc-distance-calculation/testCase106.test.ts +146 -0
  135. package/tests/max-conc-distance-calculation/testCase107.test.ts +148 -0
  136. package/tests/max-conc-distance-calculation/testCase108.test.ts +172 -0
  137. package/tests/max-conc-distance-calculation/testCase109.test.ts +146 -0
  138. package/tests/max-conc-distance-calculation/testCase110.test.ts +146 -0
  139. package/tests/max-conc-footprint-calculation/testCase31.test.ts +169 -0
  140. package/tests/max-conc-footprint-calculation/testCase32.test.ts +183 -0
  141. package/tests/max-conc-footprint-calculation/testCase33.test.ts +161 -0
  142. package/tests/max-conc-footprint-calculation/testCase34.test.ts +172 -0
  143. package/tests/max-conc-footprint-calculation/testCase35.test.ts +188 -0
  144. package/tests/max-distance-to-conc-calculation/testCase111.test.ts +138 -0
  145. package/tests/max-distance-to-conc-calculation/testCase112.test.ts +174 -0
  146. package/tests/max-distance-to-conc-calculation/testCase113.test.ts +153 -0
  147. package/tests/max-distance-to-conc-calculation/testCase114.test.ts +162 -0
  148. package/tests/max-distance-to-conc-calculation/testCase115.test.ts +167 -0
  149. package/tests/mixture-constant-properties-calculation/testCase97.test.ts +83 -0
  150. package/tests/mixture-constant-properties-calculation/testCase98.test.ts +90 -0
  151. package/tests/mixture-constant-properties-calculation/testCase99.test.ts +87 -0
  152. package/tests/pool-fire-calculation/testCase41.test.ts +153 -0
  153. package/tests/pool-fire-calculation/testCase41a.test.ts +141 -0
  154. package/tests/pool-fire-calculation/testCase42.test.ts +169 -0
  155. package/tests/pool-fire-calculation/testCase42a.test.ts +175 -0
  156. package/tests/pool-fire-calculation/testCase43.test.ts +161 -0
  157. package/tests/pool-fire-calculation/testCase43a.test.ts +157 -0
  158. package/tests/pool-fire-calculation/testCase44.test.ts +147 -0
  159. package/tests/pool-fire-calculation/testCase44a.test.ts +152 -0
  160. package/tests/pool-fire-calculation/testCase45.test.ts +176 -0
  161. package/tests/pool-fire-calculation/testCase45a.test.ts +182 -0
  162. package/tests/radiation-at-ponts/testCase69.test.ts +167 -0
  163. package/tests/radiation-at-ponts/testCase70.test.ts +179 -0
  164. package/tests/radiation-at-ponts/testCase71.test.ts +150 -0
  165. package/tests/radiation-at-ponts/testCase72.test.ts +166 -0
  166. package/tests/radiation-at-ponts/testCase73.test.ts +169 -0
  167. package/tests/radiation-contour-calculation/testCase51.test.ts +127 -0
  168. package/tests/radiation-contour-calculation/testCase52.test.ts +126 -0
  169. package/tests/radiation-contour-calculation/testCase53.test.ts +126 -0
  170. package/tests/radiation-contour-calculation/testCase54.test.ts +131 -0
  171. package/tests/relief-valve-min-temperature-calculation/testCase140.test.ts +49 -0
  172. package/tests/set-mixing-layer-height/testCase100.test.ts +36 -0
  173. package/tests/set-mixing-layer-height/testCase101.test.ts +36 -0
  174. package/tests/set-mixing-layer-height/testCase102.test.ts +36 -0
  175. package/tests/set-phase-to-be-released-for-leak-calculation/testCase150.test.ts +67 -0
  176. package/tests/set-phase-to-be-released-for-line-rupture-calculation/testCase151.test.ts +67 -0
  177. package/tests/set-phase-to-be-released-for-relief-valve-calculation/TestCase152.test.ts +61 -0
  178. package/tests/sideview/testCase31b.test.ts +150 -0
  179. package/tests/sideview/testCase32b.test.ts +145 -0
  180. package/tests/sideview/testCase33b.test.ts +130 -0
  181. package/tests/sideview/testCase34b.test.ts +153 -0
  182. package/tests/sideview/testCase35b.test.ts +140 -0
  183. package/tests/tank-fire-calculation/testCase79.test.ts +61 -0
  184. package/tests/tank-fire-calculation/testCase80.test.ts +67 -0
  185. package/tests/tank-fire-calculation/testCase81.test.ts +68 -0
  186. package/tests/tank-fire-calculation/testCase82.test.ts +68 -0
  187. package/tests/tank-fire-calculation/testCase83.test.ts +73 -0
  188. package/tests/utilities/convert-camel-case-to-snake-case.test.ts +7 -0
  189. package/tests/utilities/convert-snake-case-to-camel-case.test.ts +7 -0
  190. package/tests/vessel-catastrophic-rupture-calculation/testCase1.test.ts +83 -0
  191. package/tests/vessel-catastrophic-rupture-calculation/testCase2.test.ts +82 -0
  192. package/tests/vessel-catastrophic-rupture-calculation/testCase3.test.ts +91 -0
  193. package/tests/vessel-catastrophic-rupture-calculation/testCase4.test.ts +85 -0
  194. package/tests/vessel-catastrophic-rupture-calculation/testCase5.test.ts +84 -0
  195. package/tests/vessel-leak-calculation/testCase10.test.ts +108 -0
  196. package/tests/vessel-leak-calculation/testCase6.test.ts +113 -0
  197. package/tests/vessel-leak-calculation/testCase7.test.ts +123 -0
  198. package/tests/vessel-leak-calculation/testCase8.test.ts +102 -0
  199. package/tests/vessel-leak-calculation/testCase9.test.ts +106 -0
  200. package/tests/vessel-line-rupture-calculation/vlr-ammonia.test.ts +84 -0
  201. package/tests/vessel-line-rupture-calculation/vlr-ethaneMethane.test.ts +82 -0
  202. package/tests/vessel-line-rupture-calculation/vlr-nDecane.test.ts +79 -0
  203. package/tests/vessel-line-rupture-calculation/vlr-oxygen.test.ts +77 -0
  204. package/tests/vessel-line-rupture-calculation/vlr-propane.test.ts +77 -0
  205. package/tests/vessel-relief-valve-calculation/vrv-chlorine.test.ts +99 -0
  206. package/tests/vessel-relief-valve-calculation/vrv-hydrogen.test.ts +96 -0
  207. package/tests/vessel-relief-valve-calculation/vrv-methane.test.ts +80 -0
  208. package/tests/vessel-relief-valve-calculation/vrv-methaneH2s.test.ts +86 -0
  209. package/tests/vessel-relief-valve-calculation/vrv-nitrogen.test.ts +80 -0
  210. package/tests/vessel-state-calculation/vs-ammonia.test.ts +56 -0
  211. package/tests/vessel-state-calculation/vs-butane.test.ts +57 -0
  212. package/tests/vessel-state-calculation/vs-chlorine.test.ts +56 -0
  213. package/tests/vessel-state-calculation/vs-methane.test.ts +57 -0
  214. package/tests/vessel-state-calculation/vs-naturalGas.test.ts +59 -0
  215. package/tests/vessel-state-calculation/vs-nitrogenPentane.test.ts +58 -0
@@ -0,0 +1,179 @@
1
+ import { VesselStateCalculation, VesselLeakCalculation } from "../../src/calculations/discharge";
2
+ import { JetFireCalculation } from "../../src/calculations/jetFire";
3
+ import { RadiationAtPointsCalculation } from "../../src/calculations/radiation";
4
+ import { State, Material, MaterialComponent, Vessel, Leak, DischargeParameters, Weather, Substrate, FlammableParameters, FlammableOutputConfig, Transect, LocalPosition } from "../../src/entities";
5
+ import { AtmosphericStabilityClass, Resolution, ResultCode, TimeVaryingOption, VesselShape, WindProfileFlag } from "../../src/enums";
6
+ import { setAccessToken } from "../../src/utilities";
7
+ const accessToken = process.env.PWS_ACCESS_TOKEN;
8
+
9
+ if (!accessToken) {
10
+ throw new Error("ACCESS_TOKEN environment variable is not set.");
11
+ }
12
+
13
+ setAccessToken(accessToken);
14
+
15
+ describe("RadiationAtPointsCalculation Integration - Test Case 70", () => {
16
+ test("should produce correct radiation results for N-BUTANE", async () => {
17
+ const materialName = 'N-BUTANE';
18
+ const stateTemperature = 220.0;
19
+ const statePressure = 1.0e6;
20
+ const vesselShape = VesselShape.VESSEL_SPHERE;
21
+ const vesselDiameter = 3.0;
22
+ const leakHoleDiameter = 0.1;
23
+ const timeVaryingOption = TimeVaryingOption.INITIAL_RATE;
24
+ const leakHoleHeightFraction = 0.5;
25
+ const liquidFillFraction = 0.5;
26
+ const windSpeed = 2.0;
27
+ const stabilityClass = AtmosphericStabilityClass.STABILITY_F;
28
+ const timeOfInterest = 2600.0;
29
+ const radiationResolution = Resolution.HIGH;
30
+ const windProfileFlag = WindProfileFlag.LOGARITHMIC_PROFILE;
31
+
32
+ // Define the initial state of the vessel
33
+ const state = new State({
34
+ temperature: stateTemperature,
35
+ pressure: statePressure,
36
+ liquidFraction: 0.0,
37
+ });
38
+
39
+ // Define the material contained by the vessel
40
+ const material = new Material({
41
+ name: materialName,
42
+ components: [new MaterialComponent({ name: materialName, moleFraction: 1.0 })],
43
+ });
44
+
45
+ // Create a vessel state calculation using the material and state
46
+ const vesselStateCalc = new VesselStateCalculation(material, state);
47
+ console.log("Running vessel_state_calculation...");
48
+ let resultCode = await vesselStateCalc.run();
49
+
50
+ // Check if there are any messages
51
+ if (vesselStateCalc.messages.length > 0) {
52
+ console.log("Messages:");
53
+ vesselStateCalc.messages.forEach((message) => console.log(message));
54
+ }
55
+
56
+ // Validate the result of the vessel state calculation
57
+ expect(resultCode).toBe(ResultCode.SUCCESS);
58
+ console.log(`SUCCESS: vessel_state_calculation (${vesselStateCalc.calculationElapsedTime}ms)`);
59
+
60
+ // Create a vessel to use in the leak calculation using the previously defined entities
61
+ const vessel = new Vessel({
62
+ state: vesselStateCalc.outputState,
63
+ material: vesselStateCalc.material,
64
+ vesselConditions: vesselStateCalc.vesselConditions,
65
+ location: new LocalPosition(),
66
+ diameter: vesselDiameter,
67
+ shape: vesselShape,
68
+ liquidFillFractionByVolume: liquidFillFraction,
69
+ });
70
+
71
+ // Create a leak to use in the vessel leak calculation
72
+ const leak = new Leak({
73
+ holeDiameter: leakHoleDiameter,
74
+ holeHeightFraction: leakHoleHeightFraction,
75
+ timeVaryingOption: timeVaryingOption,
76
+ });
77
+
78
+ // Create discharge parameters for the vessel leak calculation
79
+ const dischargeParams = new DischargeParameters();
80
+
81
+ // Create a vessel leak calculation using the vessel, leak, and discharge parameters
82
+ const vesselLeakCalc = new VesselLeakCalculation(vessel, leak, dischargeParams);
83
+ console.log("Running vessel_leak_calculation...");
84
+ resultCode = await vesselLeakCalc.run();
85
+
86
+ // Check if there are any messages
87
+ if (vesselLeakCalc.messages.length > 0) {
88
+ console.log("Messages:");
89
+ vesselLeakCalc.messages.forEach((message) => console.log(message));
90
+ }
91
+
92
+ // Validate the result of the vessel leak calculation
93
+ expect(resultCode).toBe(ResultCode.SUCCESS);
94
+ console.log(`SUCCESS: vessel_leak_calculation (${vesselLeakCalc.calculationElapsedTime}ms)`);
95
+
96
+ // Instantiate the data required by the jet fire calculation
97
+ const weather = new Weather({
98
+ windSpeed: windSpeed,
99
+ stabilityClass: stabilityClass,
100
+ windProfileFlag: windProfileFlag
101
+ });
102
+ const substrate = new Substrate();
103
+ const flammableParams = new FlammableParameters({ timeOfInterest });
104
+
105
+ // Create a jet fire calculation using the required input data
106
+ const jetFireCalc = new JetFireCalculation(
107
+ vesselLeakCalc.exitMaterial!,
108
+ vesselLeakCalc.dischargeRecords!,
109
+ vesselLeakCalc.dischargeRecords!.length,
110
+ vesselLeakCalc.dischargeResult!,
111
+ weather,
112
+ substrate,
113
+ flammableParams
114
+ );
115
+ console.log("Running jet_fire_calculation...");
116
+ resultCode = await jetFireCalc.run();
117
+
118
+ // Check if there are any messages
119
+ if (jetFireCalc.messages.length > 0) {
120
+ console.log("Messages:");
121
+ jetFireCalc.messages.forEach((message) => console.log(message));
122
+ }
123
+
124
+ // Validate the result of the jet fire calculation
125
+ expect(resultCode).toBe(ResultCode.SUCCESS);
126
+ console.log(`SUCCESS: jet_fire_calculation (${jetFireCalc.calculationElapsedTime}ms)`);
127
+
128
+ // Create flammable output configurations
129
+ const flammableOutputConfigs = [
130
+ { x: 30.0, y: 0.0, z: 2.0 },
131
+ { x: 30.0, y: 0.0, z: 4.0 },
132
+ { x: 30.0, y: 0.0, z: 5.0 },
133
+ ].map(({ x, y, z }) => {
134
+ return new FlammableOutputConfig({
135
+ position: new LocalPosition({ x, y, z }),
136
+ transect: new Transect({
137
+ transectStartPoint: new LocalPosition(),
138
+ transectEndPoint: new LocalPosition(),
139
+ }),
140
+ radiationResolution: radiationResolution,
141
+ });
142
+ });
143
+
144
+ // Create a radiation at points calculation using the flame result, flame records, weather, flammable parameters, and flammable output configurations
145
+ const radiationAtPointsCalc = new RadiationAtPointsCalculation(
146
+ jetFireCalc.flameResult!,
147
+ jetFireCalc.flameRecords!,
148
+ jetFireCalc.flameRecords!.length,
149
+ weather,
150
+ jetFireCalc.flammableParameters,
151
+ flammableOutputConfigs,
152
+ flammableOutputConfigs.length
153
+ );
154
+
155
+ // Run the radiation at points calculation
156
+ console.log("Running radiation_at_points_calculation...");
157
+ resultCode = await radiationAtPointsCalc.run();
158
+
159
+ // Check if there are any messages
160
+ if (radiationAtPointsCalc.messages.length > 0) {
161
+ console.log("Messages:");
162
+ radiationAtPointsCalc.messages.forEach((message) => console.log(message));
163
+ }
164
+
165
+ // Validate the result of the radiation at points calculation
166
+ expect(resultCode).toBe(ResultCode.SUCCESS);
167
+
168
+ const radiationResult = radiationAtPointsCalc.radiation![0];
169
+ const expectedRadiation = 243947.48369382767;
170
+ const radiationTolerance = 1e-3;
171
+ expect(Math.abs((radiationResult - expectedRadiation) / expectedRadiation)).toBeLessThan(radiationTolerance);
172
+
173
+ const flameLength = radiationAtPointsCalc.flameResult.flameLength!;
174
+ const expectedFlameLength = 138.4978616734956;
175
+ expect(Math.abs((flameLength - expectedFlameLength) / expectedFlameLength)).toBeLessThan(radiationTolerance);
176
+
177
+ console.log(`SUCCESS: radiation_at_points_calculation (${radiationAtPointsCalc.calculationElapsedTime}ms)`);
178
+ });
179
+ });
@@ -0,0 +1,150 @@
1
+ import { JetFireCalculation } from "../../src/calculations/jetFire";
2
+ import { RadiationAtPointsCalculation } from "../../src/calculations/radiation";
3
+ import { VesselLeakCalculation, VesselStateCalculation } from "../../src/calculations/discharge";
4
+ import { State, Material, MaterialComponent, Vessel, Leak, DischargeParameters, Weather, Substrate, FlammableParameters, FlammableOutputConfig, Transect, LocalPosition } from "../../src/entities";
5
+ import { AtmosphericStabilityClass, Resolution, ResultCode, TimeVaryingOption, VesselShape, WindProfileFlag } from "../../src/enums";
6
+ import { setAccessToken } from "../../src/utilities";
7
+ const accessToken = process.env.PWS_ACCESS_TOKEN;
8
+
9
+ if (!accessToken) {
10
+ throw new Error("ACCESS_TOKEN environment variable is not set.");
11
+ }
12
+
13
+ setAccessToken(accessToken);
14
+
15
+ describe("RadiationAtPointsCalculation Integration - Test Case 71", () => {
16
+ test("should produce correct radiation results for PROPANE", async () => {
17
+ const materialName = "PROPANE";
18
+ const stateTemperature = 290.0;
19
+ const statePressure = 5.0e5;
20
+ const vesselShape = VesselShape.VESSEL_SPHERE;
21
+ const vesselDiameter = 3.0;
22
+ const leakHoleDiameter = 0.1;
23
+ const timeVaryingOption = TimeVaryingOption.INITIAL_RATE;
24
+ const leakHoleHeightFraction = 0.3;
25
+ const liquidFillFraction = 0.4;
26
+ const windSpeed = 2.0;
27
+ const stabilityClass = AtmosphericStabilityClass.STABILITY_F;
28
+ const timeOfInterest = 2600.0;
29
+ const radiationResolution = Resolution.LOW;
30
+ const windProfileFlag = WindProfileFlag.LOGARITHMIC_PROFILE;
31
+
32
+ // Define the initial state of the vessel
33
+ const state = new State({
34
+ temperature: stateTemperature,
35
+ pressure: statePressure,
36
+ liquidFraction: 0.0,
37
+ });
38
+
39
+ // Define the material contained by the vessel
40
+ const material = new Material({
41
+ name: materialName,
42
+ components: [new MaterialComponent({ name: materialName, moleFraction: 1.0 })],
43
+ });
44
+
45
+ // Create a vessel state calculation using the material and state
46
+ const vesselStateCalc = new VesselStateCalculation(material, state);
47
+ let resultCode = await vesselStateCalc.run();
48
+
49
+ // Validate the result of the vessel state calculation
50
+ expect(resultCode).toBe(ResultCode.SUCCESS);
51
+ if (vesselStateCalc.messages.length > 0) {
52
+ vesselStateCalc.messages.forEach((message) => console.log(message));
53
+ }
54
+
55
+ // Create a vessel for leak calculation
56
+ const vessel = new Vessel({
57
+ state: vesselStateCalc.outputState,
58
+ material: vesselStateCalc.material,
59
+ vesselConditions: vesselStateCalc.vesselConditions,
60
+ location: new LocalPosition(),
61
+ diameter: vesselDiameter,
62
+ shape: vesselShape,
63
+ liquidFillFractionByVolume: liquidFillFraction,
64
+ });
65
+
66
+ // Create a leak for vessel leak calculation
67
+ const leak = new Leak({
68
+ holeDiameter: leakHoleDiameter,
69
+ holeHeightFraction: leakHoleHeightFraction,
70
+ timeVaryingOption: timeVaryingOption,
71
+ });
72
+
73
+ // Create discharge parameters
74
+ const dischargeParams = new DischargeParameters();
75
+
76
+ // Create a vessel leak calculation
77
+ const vesselLeakCalc = new VesselLeakCalculation(vessel, leak, dischargeParams);
78
+ resultCode = await vesselLeakCalc.run();
79
+
80
+ // Validate the result of the vessel leak calculation
81
+ expect(resultCode).toBe(ResultCode.SUCCESS);
82
+ if (vesselLeakCalc.messages.length > 0) {
83
+ vesselLeakCalc.messages.forEach((message) => console.log(message));
84
+ }
85
+
86
+ // Instantiate the data required for jet fire calculation
87
+ const weather = new Weather({
88
+ windSpeed: windSpeed,
89
+ stabilityClass: stabilityClass,
90
+ windProfileFlag: windProfileFlag,
91
+ });
92
+ const substrate = new Substrate();
93
+ const flammableParams = new FlammableParameters({ timeOfInterest: timeOfInterest });
94
+
95
+ // Create a jet fire calculation
96
+ const jetFireCalc = new JetFireCalculation(
97
+ vesselLeakCalc.exitMaterial!,
98
+ vesselLeakCalc.dischargeRecords!,
99
+ vesselLeakCalc.dischargeRecords!.length,
100
+ vesselLeakCalc.dischargeResult!,
101
+ weather,
102
+ substrate,
103
+ flammableParams
104
+ );
105
+ resultCode = await jetFireCalc.run();
106
+
107
+ // Validate the result of the jet fire calculation
108
+ expect(resultCode).toBe(ResultCode.SUCCESS);
109
+ if (jetFireCalc.messages.length > 0) {
110
+ jetFireCalc.messages.forEach((message) => console.log(message));
111
+ }
112
+
113
+ // Create flammable output configurations
114
+ const flammableOutputConfigs = [
115
+ { x: 0.0, y: 60.0, z: 2.0 },
116
+ { x: 0.0, y: -60.0, z: 3.0 },
117
+ { x: 0.0, y: 60.0, z: 6.0 },
118
+ ].map(({ x, y, z }) => {
119
+ return new FlammableOutputConfig({
120
+ position: new LocalPosition({ x, y, z }),
121
+ transect: new Transect({
122
+ transectStartPoint: new LocalPosition(),
123
+ transectEndPoint: new LocalPosition(),
124
+ }),
125
+ radiationResolution: radiationResolution,
126
+ });
127
+ });
128
+
129
+ // Create a radiation at points calculation
130
+ const radiationAtPointsCalc = new RadiationAtPointsCalculation(
131
+ jetFireCalc.flameResult!,
132
+ jetFireCalc.flameRecords!,
133
+ jetFireCalc.flameRecords!.length,
134
+ weather,
135
+ jetFireCalc.flammableParameters,
136
+ flammableOutputConfigs,
137
+ flammableOutputConfigs.length
138
+ );
139
+ resultCode = await radiationAtPointsCalc.run();
140
+
141
+ // Validate the result of the radiation at points calculation
142
+ expect(resultCode).toBe(ResultCode.SUCCESS);
143
+
144
+ // Check for regression values in radiation at points
145
+ expect(Math.abs((radiationAtPointsCalc.radiation![0] - 1371.8130321119306) / 1371.8130321119306)).toBeLessThan(1e-3);
146
+ expect(Math.abs((radiationAtPointsCalc.flameResult.flameLength! - 31.712372512867706) / 31.712372512867706)).toBeLessThan(1e-3);
147
+
148
+ console.log(`SUCCESS: radiation_at_points_calculation (${radiationAtPointsCalc.calculationElapsedTime}ms)`);
149
+ });
150
+ });
@@ -0,0 +1,166 @@
1
+ import { VesselStateCalculation, VesselLeakCalculation } from "../../src/calculations/discharge";
2
+ import { JetFireCalculation } from "../../src/calculations/jetFire";
3
+ import { RadiationAtPointsCalculation } from "../../src/calculations/radiation";
4
+ import { State, Material, MaterialComponent, Vessel, Leak, DischargeParameters, Weather, Substrate, FlammableParameters, FlammableOutputConfig, Transect, LocalPosition } from "../../src/entities";
5
+ import { AtmosphericStabilityClass, Resolution, ResultCode, TimeVaryingOption, VesselShape, WindProfileFlag } from "../../src/enums";
6
+ import { setAccessToken } from "../../src/utilities";
7
+ const accessToken = process.env.PWS_ACCESS_TOKEN;
8
+
9
+ if (!accessToken) {
10
+ throw new Error("ACCESS_TOKEN environment variable is not set.");
11
+ }
12
+
13
+ setAccessToken(accessToken);
14
+
15
+ describe("RadiationAtPointsCalculation Integration - Test Case 72", () => {
16
+ test("should produce correct radiation results for ETHANE_METHANE_HYDROGEN", async () => {
17
+ const materialName = "ETHANE_METHANE_HYDROGEN";
18
+ const stateTemperature = 360.0;
19
+ const statePressure = 3.0e6;
20
+ const vesselShape = VesselShape.VESSEL_SPHERE;
21
+ const vesselDiameter = 3.0;
22
+ const leakHoleDiameter = 0.1;
23
+ const timeVaryingOption = TimeVaryingOption.INITIAL_RATE;
24
+ const leakHoleHeightFraction = 0.3;
25
+ const liquidFillFraction = 0.4;
26
+ const windSpeed = 2.0;
27
+ const stabilityClass = AtmosphericStabilityClass.STABILITY_F;
28
+ const timeOfInterest = 2600.0;
29
+ const radiationResolution = Resolution.EXTREME;
30
+ const windProfileFlag = WindProfileFlag.LOGARITHMIC_PROFILE;
31
+
32
+ // Define the initial state of the vessel
33
+ const state = new State({
34
+ temperature: stateTemperature,
35
+ pressure: statePressure,
36
+ liquidFraction: 0.0,
37
+ });
38
+
39
+ // Define the material contained by the vessel
40
+ const material = new Material({
41
+ name: materialName,
42
+ components: [
43
+ new MaterialComponent({ name: "ETHANE", moleFraction: 0.5 }),
44
+ new MaterialComponent({ name: "METHANE", moleFraction: 0.3 }),
45
+ new MaterialComponent({ name: "HYDROGEN", moleFraction: 0.2 }),
46
+ ],
47
+ componentCount: 3,
48
+ });
49
+
50
+ // Create a vessel state calculation using the material and state
51
+ const vesselStateCalc = new VesselStateCalculation(material, state);
52
+ let resultCode = await vesselStateCalc.run();
53
+
54
+ // Check if there are any messages
55
+ if (vesselStateCalc.messages.length > 0) {
56
+ vesselStateCalc.messages.forEach((message) => console.log(message));
57
+ }
58
+
59
+ // Validate the result of the vessel state calculation
60
+ expect(resultCode).toBe(ResultCode.SUCCESS);
61
+
62
+ // Create a vessel to use in the leak calculation using the previously defined entities
63
+ const vessel = new Vessel({
64
+ state: vesselStateCalc.outputState,
65
+ material: vesselStateCalc.material,
66
+ vesselConditions: vesselStateCalc.vesselConditions,
67
+ location: new LocalPosition(),
68
+ diameter: vesselDiameter,
69
+ shape: vesselShape,
70
+ liquidFillFractionByVolume: liquidFillFraction,
71
+ });
72
+
73
+ // Create a leak to use in the vessel leak calculation
74
+ const leak = new Leak({
75
+ holeDiameter: leakHoleDiameter,
76
+ holeHeightFraction: leakHoleHeightFraction,
77
+ timeVaryingOption: timeVaryingOption,
78
+ });
79
+
80
+ // Create discharge parameters for the vessel leak calculation
81
+ const dischargeParams = new DischargeParameters();
82
+
83
+ // Create a vessel leak calculation using the vessel, leak, and discharge parameters
84
+ const vesselLeakCalc = new VesselLeakCalculation(vessel, leak, dischargeParams);
85
+ resultCode = await vesselLeakCalc.run();
86
+
87
+ // Check if there are any messages
88
+ if (vesselLeakCalc.messages.length > 0) {
89
+ vesselLeakCalc.messages.forEach((message) => console.log(message));
90
+ }
91
+
92
+ // Validate the result of the vessel leak calculation
93
+ expect(resultCode).toBe(ResultCode.SUCCESS);
94
+
95
+ // Instantiate the data required by the jet fire calculation
96
+ const weather = new Weather({
97
+ windSpeed: windSpeed,
98
+ stabilityClass: stabilityClass,
99
+ windProfileFlag: windProfileFlag
100
+ });
101
+ const substrate = new Substrate();
102
+ const flammableParams = new FlammableParameters({ timeOfInterest });
103
+
104
+ // Create a jet fire calculation using the required input data
105
+ const jetFireCalc = new JetFireCalculation(
106
+ vesselLeakCalc.exitMaterial!,
107
+ vesselLeakCalc.dischargeRecords!,
108
+ vesselLeakCalc.dischargeRecords!.length,
109
+ vesselLeakCalc.dischargeResult!,
110
+ weather,
111
+ substrate,
112
+ flammableParams
113
+ );
114
+ resultCode = await jetFireCalc.run();
115
+
116
+ // Check if there are any messages
117
+ if (jetFireCalc.messages.length > 0) {
118
+ jetFireCalc.messages.forEach((message) => console.log(message));
119
+ }
120
+
121
+ // Validate the result of the jet fire calculation
122
+ expect(resultCode).toBe(ResultCode.SUCCESS);
123
+
124
+ // Create flammable output configurations
125
+ const flammableOutputConfigs = [
126
+ { x: 10.0, y: 0.0, z: 2.0 },
127
+ { x: 50.0, y: 0.0, z: 2.0 },
128
+ { x: 100.0, y: 0.0, z: 2.0 },
129
+ ].map(({ x, y, z }) => {
130
+ return new FlammableOutputConfig({
131
+ position: new LocalPosition({ x, y, z }),
132
+ transect: new Transect({
133
+ transectStartPoint: new LocalPosition(),
134
+ transectEndPoint: new LocalPosition(),
135
+ }),
136
+ radiationResolution: radiationResolution,
137
+ });
138
+ });
139
+
140
+ // Create a radiation at points calculation using the flame result, flame records, weather, flammable parameters, and flammable output configurations
141
+ const radiationAtPointsCalc = new RadiationAtPointsCalculation(
142
+ jetFireCalc.flameResult!,
143
+ jetFireCalc.flameRecords!,
144
+ jetFireCalc.flameRecords!.length,
145
+ weather,
146
+ jetFireCalc.flammableParameters,
147
+ flammableOutputConfigs,
148
+ flammableOutputConfigs.length
149
+ );
150
+
151
+ // Run the radiation at points calculation
152
+ resultCode = await radiationAtPointsCalc.run();
153
+
154
+ // Check if there are any messages
155
+ if (radiationAtPointsCalc.messages.length > 0) {
156
+ radiationAtPointsCalc.messages.forEach((message) => console.log(message));
157
+ }
158
+
159
+ // Validate the result of the radiation at points calculation
160
+ expect(resultCode).toBe(ResultCode.SUCCESS);
161
+
162
+ // Validate radiation values
163
+ expect(Math.abs((radiationAtPointsCalc.radiation![0] - 13665.167199336202) / 13665.167199336202)).toBeLessThan(1e-3);
164
+ expect(Math.abs((radiationAtPointsCalc.flameResult.flameLength! - 52.44271020259119) / 52.44271020259119)).toBeLessThan(1e-3);
165
+ });
166
+ });
@@ -0,0 +1,169 @@
1
+ import { VesselStateCalculation, VesselLeakCalculation } from "../../src/calculations/discharge";
2
+ import { JetFireCalculation } from "../../src/calculations/jetFire";
3
+ import { RadiationAtPointsCalculation } from "../../src/calculations/radiation";
4
+ import { State, Material, MaterialComponent, Vessel, Leak, DischargeParameters, Weather, Substrate, FlammableParameters, FlammableOutputConfig, Transect, LocalPosition } from "../../src/entities";
5
+ import { AtmosphericStabilityClass, ResultCode, Resolution, TimeVaryingOption, VesselShape, WindProfileFlag } from "../../src/enums";
6
+ import { setAccessToken } from "../../src/utilities";
7
+ const accessToken = process.env.PWS_ACCESS_TOKEN;
8
+
9
+ if (!accessToken) {
10
+ throw new Error("ACCESS_TOKEN environment variable is not set.");
11
+ }
12
+
13
+ setAccessToken(accessToken);
14
+
15
+ describe("RadiationAtPointsCalculation Integration - Test Case 73", () => {
16
+ test("should produce correct radiation results for N-BUTANE", async () => {
17
+ const materialName = "N-BUTANE";
18
+ const stateTemperature = 360.0;
19
+ const statePressure = 3.0e6;
20
+ const vesselShape = VesselShape.VESSEL_SPHERE;
21
+ const vesselDiameter = 3.0;
22
+ const leakHoleDiameter = 0.1;
23
+ const timeVaryingOption = TimeVaryingOption.INITIAL_RATE;
24
+ const leakHoleHeightFraction = 0.3;
25
+ const liquidFillFraction = 0.4;
26
+ const windSpeed = 2.0;
27
+ const stabilityClass = AtmosphericStabilityClass.STABILITY_F;
28
+ const timeOfInterest = 2600.0;
29
+ const radiationResolution = Resolution.EXTREME;
30
+ const windProfileFlag = WindProfileFlag.LOGARITHMIC_PROFILE;
31
+
32
+ // Define the initial state of the vessel
33
+ const state = new State({
34
+ temperature: stateTemperature,
35
+ pressure: statePressure,
36
+ liquidFraction: 0.0,
37
+ });
38
+
39
+ // Define the material contained by the vessel
40
+ const material = new Material({
41
+ name: materialName,
42
+ components: [new MaterialComponent({ name: materialName, moleFraction: 1.0 })],
43
+ });
44
+
45
+ // Create a vessel state calculation using the material and state
46
+ const vesselStateCalc = new VesselStateCalculation(material, state);
47
+ console.log("Running vessel_state_calculation...");
48
+ let resultCode = await vesselStateCalc.run();
49
+
50
+ // Check if there are any messages
51
+ if (vesselStateCalc.messages.length > 0) {
52
+ console.log("Messages:");
53
+ vesselStateCalc.messages.forEach((message) => console.log(message));
54
+ }
55
+
56
+ expect(resultCode).toBe(ResultCode.SUCCESS);
57
+
58
+ // Create a vessel to use in the leak calculation using the previously defined entities
59
+ const vessel = new Vessel({
60
+ state: vesselStateCalc.outputState,
61
+ material: vesselStateCalc.material,
62
+ vesselConditions: vesselStateCalc.vesselConditions,
63
+ location: new LocalPosition(),
64
+ diameter: vesselDiameter,
65
+ shape: vesselShape,
66
+ liquidFillFractionByVolume: liquidFillFraction,
67
+ });
68
+
69
+ // Create a leak to use in the vessel leak calculation
70
+ const leak = new Leak({
71
+ holeDiameter: leakHoleDiameter,
72
+ holeHeightFraction: leakHoleHeightFraction,
73
+ timeVaryingOption: timeVaryingOption,
74
+ });
75
+
76
+ // Create discharge parameters for the vessel leak calculation
77
+ const dischargeParams = new DischargeParameters();
78
+
79
+ // Create a vessel leak calculation using the vessel, leak, and discharge parameters
80
+ const vesselLeakCalc = new VesselLeakCalculation(vessel, leak, dischargeParams);
81
+ console.log("Running vessel_leak_calculation...");
82
+ resultCode = await vesselLeakCalc.run();
83
+
84
+ // Check if there are any messages
85
+ if (vesselLeakCalc.messages.length > 0) {
86
+ console.log("Messages:");
87
+ vesselLeakCalc.messages.forEach((message) => console.log(message));
88
+ }
89
+
90
+ expect(resultCode).toBe(ResultCode.SUCCESS);
91
+
92
+ // Instantiate the data required by the jet fire calculation
93
+ const weather = new Weather({
94
+ windSpeed: windSpeed,
95
+ stabilityClass: stabilityClass,
96
+ windProfileFlag: windProfileFlag,
97
+ });
98
+
99
+ const substrate = new Substrate();
100
+ const flammableParams = new FlammableParameters({ timeOfInterest });
101
+
102
+ // Create a jet fire calculation using the required input data
103
+ const jetFireCalc = new JetFireCalculation(
104
+ vesselLeakCalc.exitMaterial!,
105
+ vesselLeakCalc.dischargeRecords!,
106
+ vesselLeakCalc.dischargeRecords!.length,
107
+ vesselLeakCalc.dischargeResult!,
108
+ weather,
109
+ substrate,
110
+ flammableParams
111
+ );
112
+ console.log("Running jet_fire_calculation...");
113
+ resultCode = await jetFireCalc.run();
114
+
115
+ // Check if there are any messages
116
+ if (jetFireCalc.messages.length > 0) {
117
+ console.log("Messages:");
118
+ jetFireCalc.messages.forEach((message) => console.log(message));
119
+ }
120
+
121
+ expect(resultCode).toBe(ResultCode.SUCCESS);
122
+
123
+ // Create flammable output configurations
124
+ const flammableOutputConfigs = [
125
+ { x: 5.0, y: 0.0, z: 0.0 },
126
+ { x: 20.0, y: 0.0, z: 0.0 },
127
+ { x: 20.0, y: 0.0, z: 1.0 },
128
+ { x: 20.0, y: 5.0, z: 1.0 },
129
+ ].map(({ x, y, z }) => {
130
+ return new FlammableOutputConfig({
131
+ position: new LocalPosition({ x, y, z }),
132
+ transect: new Transect({
133
+ transectStartPoint: new LocalPosition(),
134
+ transectEndPoint: new LocalPosition(),
135
+ }),
136
+ radiationResolution: radiationResolution,
137
+ });
138
+ });
139
+
140
+ // Create a radiation at points calculation using the flame result, flame records, weather, flammable parameters, and flammable output configurations
141
+ const radiationAtPointsCalc = new RadiationAtPointsCalculation(
142
+ jetFireCalc.flameResult!,
143
+ jetFireCalc.flameRecords!,
144
+ jetFireCalc.flameRecords!.length,
145
+ weather,
146
+ jetFireCalc.flammableParameters,
147
+ flammableOutputConfigs,
148
+ flammableOutputConfigs.length
149
+ );
150
+
151
+ // Run the radiation at points calculation
152
+ console.log("Running radiation_at_points_calculation...");
153
+ resultCode = await radiationAtPointsCalc.run();
154
+
155
+ // Check if there are any messages
156
+ if (radiationAtPointsCalc.messages.length > 0) {
157
+ console.log("Messages:");
158
+ radiationAtPointsCalc.messages.forEach((message) => console.log(message));
159
+ }
160
+
161
+ expect(resultCode).toBe(ResultCode.SUCCESS);
162
+
163
+ // Validate the radiation result
164
+ expect(radiationAtPointsCalc.radiation![0]).toBeCloseTo(350000.0, 3);
165
+ expect(radiationAtPointsCalc.flameResult.flameLength).toBeCloseTo(140.8483651650435, 3);
166
+
167
+ console.log(`SUCCESS: radiation_at_points_calculation (${radiationAtPointsCalc.calculationElapsedTime}ms)`);
168
+ });
169
+ });