@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.
- package/index.ts +2 -2
- package/jest.config.js +5 -0
- package/package.json +6 -6
- package/src/calculations/applicationTools.ts +2 -2
- package/src/calculations/discharge.ts +2 -2
- package/src/calculations/dispersion.ts +2 -2
- package/src/calculations/dispersionView.ts +2 -2
- package/src/calculations/fireball.ts +2 -2
- package/src/calculations/jetFire.ts +2 -2
- package/src/calculations/lateExplosion.ts +2 -2
- package/src/calculations/linkedRunners.ts +2 -2
- package/src/calculations/poolFire.ts +2 -2
- package/src/calculations/properties.ts +2 -2
- package/src/calculations/radiation.ts +2 -2
- package/src/calculations/standalones.ts +2 -2
- package/src/calculations/toxics.ts +2 -2
- package/src/calculations/utilities.ts +2 -2
- package/src/constants.ts +2 -2
- package/src/entities.ts +2 -2
- package/src/entity-schemas.ts +2 -2
- package/src/enums.ts +2 -2
- package/src/materials.ts +14 -14
- package/src/utilities.ts +2 -2
- package/tests/concentration-at-point-calculation/testCase116.test.ts +146 -0
- package/tests/concentration-at-point-calculation/testCase117.test.ts +142 -0
- package/tests/concentration-at-point-calculation/testCase118.test.ts +143 -0
- package/tests/concentration-at-point-calculation/testCase119.test.ts +149 -0
- package/tests/concentration-at-point-calculation/testCase120.test.ts +155 -0
- package/tests/constants/testConstants.test.ts +23 -0
- package/tests/convert-comp-mass-to-mole-calculation/testCase129.test.ts +74 -0
- package/tests/convert-comp-mass-to-mole-calculation/testCase130.test.ts +73 -0
- package/tests/convert-comp-mass-to-mole-calculation/testCase131.test.ts +73 -0
- package/tests/convert-comp-mass-to-mole-calculation/testCase132.test.ts +73 -0
- package/tests/convert-comp-mass-to-mole-calculation/testCase133.test.ts +73 -0
- package/tests/convert-comp-mole-to-mass-calculation/testCase134.test.ts +72 -0
- package/tests/convert-comp-mole-to-mass-calculation/testCase135.test.ts +72 -0
- package/tests/convert-comp-mole-to-mass-calculation/testCase136.test.ts +72 -0
- package/tests/convert-comp-mole-to-mass-calculation/testCase137.test.ts +72 -0
- package/tests/convert-comp-mole-to-mass-calculation/testCase138.test.ts +72 -0
- package/tests/distances-and-ellipses-to-radiation-levels-calculation/testCase64.test.ts +194 -0
- package/tests/distances-and-ellipses-to-radiation-levels-calculation/testCase65.test.ts +197 -0
- package/tests/distances-and-ellipses-to-radiation-levels-calculation/testCase66.test.ts +194 -0
- package/tests/distances-and-ellipses-to-radiation-levels-calculation/testCase67.test.ts +198 -0
- package/tests/distances-and-ellipses-to-radiation-levels-calculation/testCase68.test.ts +178 -0
- package/tests/distances-and-footprints-to-concentration-levels-calculation/testCase31a.test.ts +158 -0
- package/tests/distances-and-footprints-to-concentration-levels-calculation/testCase32a.test.ts +156 -0
- package/tests/distances-and-footprints-to-concentration-levels-calculation/testCase33a.test.ts +158 -0
- package/tests/distances-and-footprints-to-concentration-levels-calculation/testCase34a.test.ts +165 -0
- package/tests/distances-and-footprints-to-concentration-levels-calculation/testCase35a.test.ts +188 -0
- package/tests/distances-to-conc-levels-calculation/testCase121.test.ts +149 -0
- package/tests/distances-to-conc-levels-calculation/testCase122.test.ts +145 -0
- package/tests/distances-to-conc-levels-calculation/testCase123.test.ts +150 -0
- package/tests/distances-to-conc-levels-calculation/testCase124.test.ts +154 -0
- package/tests/distances-to-conc-levels-calculation/testCase125.test.ts +157 -0
- package/tests/entities/testVessel.test.ts +49 -0
- package/tests/fireball-calculation/testCase89.test.ts +151 -0
- package/tests/fireball-calculation/testCase90.test.ts +153 -0
- package/tests/fireball-calculation/testCase91.test.ts +152 -0
- package/tests/fireball-calculation/testCse92.test.ts +150 -0
- package/tests/flash-calculation/testCase26.test.ts +71 -0
- package/tests/flash-calculation/testCase27.test.ts +69 -0
- package/tests/flash-calculation/testCase28.test.ts +69 -0
- package/tests/flash-calculation/testCase29.test.ts +67 -0
- package/tests/flash-calculation/testCase30.test.ts +70 -0
- package/tests/general/operation-id-demo.test.ts +64 -0
- package/tests/get-component-by-id/get-component-by-id-METHANE.test.ts +35 -0
- package/tests/get-mass-from-vessel-calculation/testCase139.test.ts +65 -0
- package/tests/jet-fire-calculation/testCase36.test.ts +141 -0
- package/tests/jet-fire-calculation/testCase37.test.ts +148 -0
- package/tests/jet-fire-calculation/testCase38.test.ts +147 -0
- package/tests/jet-fire-calculation/testCase39.test.ts +146 -0
- package/tests/jet-fire-calculation/testCase40.test.ts +152 -0
- package/tests/late-explosion-calculation/testCase46.test.ts +157 -0
- package/tests/late-explosion-calculation/testCase47.test.ts +149 -0
- package/tests/late-explosion-calculation/testCase48.test.ts +176 -0
- package/tests/late-explosion-calculation/testCase49.test.ts +178 -0
- package/tests/late-explosion-calculation/testCase50.test.ts +176 -0
- package/tests/late-explosion-calculation/testCase74.test.ts +166 -0
- package/tests/late-explosion-calculation/testCase75.test.ts +163 -0
- package/tests/late-explosion-calculation/testCase76.test.ts +174 -0
- package/tests/late-explosion-calculation/testCase77.test.ts +175 -0
- package/tests/late-explosion-calculation/testCase78.test.ts +175 -0
- package/tests/lethality-distance-calculation/testCase60.test.ts +142 -0
- package/tests/linked-runners/user-defined-source-linked-run/test-uds-153.test.ts +121 -0
- package/tests/linked-runners/user-defined-source-linked-run/test-uds-154.test.ts +167 -0
- package/tests/linked-runners/user-defined-source-linked-run/test-uds-155.test.ts +202 -0
- package/tests/linked-runners/user-defined-source-linked-run/test-uds-156.test.ts +201 -0
- package/tests/linked-runners/vessel-leak-linked-run/test-vl-157.test.ts +182 -0
- package/tests/linked-runners/vessel-leak-linked-run/test-vl-158.test.ts +200 -0
- package/tests/linked-runners/vessel-leak-linked-run/test-vl-159.test.ts +158 -0
- package/tests/linked-runners/vessel-leak-linked-run/test-vl-160.test.ts +165 -0
- package/tests/linked-runners/vessel-line-rupture-linked-run/test-vlr-161.test.ts +161 -0
- package/tests/linked-runners/vessel-line-rupture-linked-run/test-vlr-162.test.ts +167 -0
- package/tests/linked-runners/vessel-line-rupture-linked-run/test-vlr-163.test.ts +177 -0
- package/tests/linked-runners/vessel-line-rupture-linked-run/test-vlr-164.test.ts +165 -0
- package/tests/linked-runners/vessel-relief-valve-linked-run/test-vrv-165.test.ts +166 -0
- package/tests/linked-runners/vessel-relief-valve-linked-run/test-vrv-166.test.ts +154 -0
- package/tests/linked-runners/vessel-relief-valve-linked-run/test-vrv-167.test.ts +157 -0
- package/tests/linked-runners/vessel-relief-valve-linked-run/test-vrv-168.test.ts +168 -0
- package/tests/load-mass-inventory-vessel-for-line-rupture-scenario-calculation/testCase126.test.ts +72 -0
- package/tests/load-mass-inventory-vessel-for-line-rupture-scenario-calculation/testCase127.test.ts +73 -0
- package/tests/load-mass-inventory-vessel-for-line-rupture-scenario-calculation/testCase128.test.ts +72 -0
- package/tests/load-mass-inventory-vessel-for-relief-valve-scenario-calculation/testCase103.test.ts +74 -0
- package/tests/load-mass-inventory-vessel-for-relief-valve-scenario-calculation/testCase104.test.ts +75 -0
- package/tests/load-mass-inventory-vessel-for-relief-valve-scenario-calculation/testCase105.test.ts +74 -0
- package/tests/long-pipe-calculation/testCase55.test.ts +88 -0
- package/tests/long-pipe-calculation/testCase56.test.ts +90 -0
- package/tests/long-pipe-calculation/testCase57.test.ts +88 -0
- package/tests/long-pipe-calculation/testCase58.test.ts +88 -0
- package/tests/long-pipe-calculation/testCase59.test.ts +88 -0
- package/tests/materials/test-get-component-by-cas-id-1-2-PROPYLENE-OXIDE.test.ts +23 -0
- package/tests/materials/test-get-component-by-cas-id-CARBON-MONOXIDE.test.ts +25 -0
- package/tests/materials/test-get-component-by-cas-id-METHANE.test.ts +22 -0
- package/tests/materials/test-get-component-by-id-1-2-PROPYLENE-OXIDE.test.ts +23 -0
- package/tests/materials/test-get-component-by-id-CARBON-MONOXIDE.test.ts +22 -0
- package/tests/materials/test-get-component-by-id-METHANE.test.ts +22 -0
- package/tests/materials/test-get-component-by-name-1-2-PROPYLENE-OXIDE.test.ts +24 -0
- package/tests/materials/test-get-component-by-name-CARBON-MONOXIDE.test.ts +23 -0
- package/tests/materials/test-get-component-by-name-METHANE.test.ts +25 -0
- package/tests/materials/test-get-components.test.ts +47 -0
- package/tests/materials/test-get-dippr-components.test.ts +28 -0
- package/tests/materials/test-get-dnv-components.test.ts +28 -0
- package/tests/materials/test-get-material-by-cas-id-1-2-PROPYLENE-OXIDE.test.ts +29 -0
- package/tests/materials/test-get-material-by-cas-id-CARBON-MONOXIDE.test.ts +31 -0
- package/tests/materials/test-get-material-by-cas-id-METHANE.test.ts +30 -0
- package/tests/materials/test-get-material-by-cas-id-ZERO.test.ts +31 -0
- package/tests/materials/test-get-material-by-id-1-2-PROPYLENE-OXIDE.test.ts +30 -0
- package/tests/materials/test-get-material-by-id-CARBON-MONOXIDE.test.ts +29 -0
- package/tests/materials/test-get-material-by-id-METHANE.test.ts +29 -0
- package/tests/materials/test-get-material-by-name-1-2-PROPYLENE-OXIDE.test.ts +29 -0
- package/tests/materials/test-get-material-by-name-CARBON-MONOXIDE.test.ts +29 -0
- package/tests/materials/test-get-material-by-name-METHANE.test.ts +29 -0
- package/tests/materials/test-get-materials.test.ts +32 -0
- package/tests/max-conc-distance-calculation/testCase106.test.ts +146 -0
- package/tests/max-conc-distance-calculation/testCase107.test.ts +148 -0
- package/tests/max-conc-distance-calculation/testCase108.test.ts +172 -0
- package/tests/max-conc-distance-calculation/testCase109.test.ts +146 -0
- package/tests/max-conc-distance-calculation/testCase110.test.ts +146 -0
- package/tests/max-conc-footprint-calculation/testCase31.test.ts +169 -0
- package/tests/max-conc-footprint-calculation/testCase32.test.ts +183 -0
- package/tests/max-conc-footprint-calculation/testCase33.test.ts +161 -0
- package/tests/max-conc-footprint-calculation/testCase34.test.ts +172 -0
- package/tests/max-conc-footprint-calculation/testCase35.test.ts +188 -0
- package/tests/max-distance-to-conc-calculation/testCase111.test.ts +138 -0
- package/tests/max-distance-to-conc-calculation/testCase112.test.ts +174 -0
- package/tests/max-distance-to-conc-calculation/testCase113.test.ts +153 -0
- package/tests/max-distance-to-conc-calculation/testCase114.test.ts +162 -0
- package/tests/max-distance-to-conc-calculation/testCase115.test.ts +167 -0
- package/tests/mixture-constant-properties-calculation/testCase97.test.ts +83 -0
- package/tests/mixture-constant-properties-calculation/testCase98.test.ts +90 -0
- package/tests/mixture-constant-properties-calculation/testCase99.test.ts +87 -0
- package/tests/pool-fire-calculation/testCase41.test.ts +153 -0
- package/tests/pool-fire-calculation/testCase41a.test.ts +141 -0
- package/tests/pool-fire-calculation/testCase42.test.ts +169 -0
- package/tests/pool-fire-calculation/testCase42a.test.ts +175 -0
- package/tests/pool-fire-calculation/testCase43.test.ts +161 -0
- package/tests/pool-fire-calculation/testCase43a.test.ts +157 -0
- package/tests/pool-fire-calculation/testCase44.test.ts +147 -0
- package/tests/pool-fire-calculation/testCase44a.test.ts +152 -0
- package/tests/pool-fire-calculation/testCase45.test.ts +176 -0
- package/tests/pool-fire-calculation/testCase45a.test.ts +182 -0
- package/tests/radiation-at-ponts/testCase69.test.ts +167 -0
- package/tests/radiation-at-ponts/testCase70.test.ts +179 -0
- package/tests/radiation-at-ponts/testCase71.test.ts +150 -0
- package/tests/radiation-at-ponts/testCase72.test.ts +166 -0
- package/tests/radiation-at-ponts/testCase73.test.ts +169 -0
- package/tests/radiation-contour-calculation/testCase51.test.ts +127 -0
- package/tests/radiation-contour-calculation/testCase52.test.ts +126 -0
- package/tests/radiation-contour-calculation/testCase53.test.ts +126 -0
- package/tests/radiation-contour-calculation/testCase54.test.ts +131 -0
- package/tests/relief-valve-min-temperature-calculation/testCase140.test.ts +49 -0
- package/tests/set-mixing-layer-height/testCase100.test.ts +36 -0
- package/tests/set-mixing-layer-height/testCase101.test.ts +36 -0
- package/tests/set-mixing-layer-height/testCase102.test.ts +36 -0
- package/tests/set-phase-to-be-released-for-leak-calculation/testCase150.test.ts +67 -0
- package/tests/set-phase-to-be-released-for-line-rupture-calculation/testCase151.test.ts +67 -0
- package/tests/set-phase-to-be-released-for-relief-valve-calculation/TestCase152.test.ts +61 -0
- package/tests/sideview/testCase31b.test.ts +150 -0
- package/tests/sideview/testCase32b.test.ts +145 -0
- package/tests/sideview/testCase33b.test.ts +130 -0
- package/tests/sideview/testCase34b.test.ts +153 -0
- package/tests/sideview/testCase35b.test.ts +140 -0
- package/tests/tank-fire-calculation/testCase79.test.ts +61 -0
- package/tests/tank-fire-calculation/testCase80.test.ts +67 -0
- package/tests/tank-fire-calculation/testCase81.test.ts +68 -0
- package/tests/tank-fire-calculation/testCase82.test.ts +68 -0
- package/tests/tank-fire-calculation/testCase83.test.ts +73 -0
- package/tests/utilities/convert-camel-case-to-snake-case.test.ts +7 -0
- package/tests/utilities/convert-snake-case-to-camel-case.test.ts +7 -0
- package/tests/vessel-catastrophic-rupture-calculation/testCase1.test.ts +83 -0
- package/tests/vessel-catastrophic-rupture-calculation/testCase2.test.ts +82 -0
- package/tests/vessel-catastrophic-rupture-calculation/testCase3.test.ts +91 -0
- package/tests/vessel-catastrophic-rupture-calculation/testCase4.test.ts +85 -0
- package/tests/vessel-catastrophic-rupture-calculation/testCase5.test.ts +84 -0
- package/tests/vessel-leak-calculation/testCase10.test.ts +108 -0
- package/tests/vessel-leak-calculation/testCase6.test.ts +113 -0
- package/tests/vessel-leak-calculation/testCase7.test.ts +123 -0
- package/tests/vessel-leak-calculation/testCase8.test.ts +102 -0
- package/tests/vessel-leak-calculation/testCase9.test.ts +106 -0
- package/tests/vessel-line-rupture-calculation/vlr-ammonia.test.ts +84 -0
- package/tests/vessel-line-rupture-calculation/vlr-ethaneMethane.test.ts +82 -0
- package/tests/vessel-line-rupture-calculation/vlr-nDecane.test.ts +79 -0
- package/tests/vessel-line-rupture-calculation/vlr-oxygen.test.ts +77 -0
- package/tests/vessel-line-rupture-calculation/vlr-propane.test.ts +77 -0
- package/tests/vessel-relief-valve-calculation/vrv-chlorine.test.ts +99 -0
- package/tests/vessel-relief-valve-calculation/vrv-hydrogen.test.ts +96 -0
- package/tests/vessel-relief-valve-calculation/vrv-methane.test.ts +80 -0
- package/tests/vessel-relief-valve-calculation/vrv-methaneH2s.test.ts +86 -0
- package/tests/vessel-relief-valve-calculation/vrv-nitrogen.test.ts +80 -0
- package/tests/vessel-state-calculation/vs-ammonia.test.ts +56 -0
- package/tests/vessel-state-calculation/vs-butane.test.ts +57 -0
- package/tests/vessel-state-calculation/vs-chlorine.test.ts +56 -0
- package/tests/vessel-state-calculation/vs-methane.test.ts +57 -0
- package/tests/vessel-state-calculation/vs-naturalGas.test.ts +59 -0
- package/tests/vessel-state-calculation/vs-nitrogenPentane.test.ts +58 -0
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import { VesselLineRuptureCalculation, VesselStateCalculation } from "../../src/calculations/discharge";
|
|
2
|
+
import { DispersionCalculation } from "../../src/calculations/dispersion";
|
|
3
|
+
import { PoolFireCalculation } from "../../src/calculations/poolFire";
|
|
4
|
+
import { DistancesAndEllipsesToRadiationLevelsForPoolFiresCalculation } from "../../src/calculations/radiation";
|
|
5
|
+
import { DischargeParameters, DispersionParameters, FlammableOutputConfig, FlammableParameters, LineRupture, LocalPosition, Material, MaterialComponent, State, Substrate, Vessel, Weather} from "../../src/entities";
|
|
6
|
+
import { AtmosphericStabilityClass, PoolFireType, ResultCode, VesselShape, WindProfileFlag } from "../../src/enums";
|
|
7
|
+
import { setAccessToken } from "../../src/utilities";
|
|
8
|
+
const accessToken = process.env.PWS_ACCESS_TOKEN;
|
|
9
|
+
|
|
10
|
+
if (!accessToken) {
|
|
11
|
+
throw new Error("ACCESS_TOKEN environment variable is not set.");
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
setAccessToken(accessToken);
|
|
15
|
+
|
|
16
|
+
describe("Vessel Line Rupture Calculation Integration - Test Case 43", () => {
|
|
17
|
+
test("should produce correct radiation results for pool fire after line rupture", async () => {
|
|
18
|
+
const state = new State({
|
|
19
|
+
temperature: 280.0,
|
|
20
|
+
pressure: 1.5e5,
|
|
21
|
+
liquidFraction: 1.0,
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
const material = new Material({
|
|
25
|
+
name: "N-DECANE",
|
|
26
|
+
components: [new MaterialComponent({ name: "N-DECANE", moleFraction: 1.0 })],
|
|
27
|
+
componentCount: 1,
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
const vesselStateCalc = new VesselStateCalculation(material, state);
|
|
31
|
+
let resultCode = await vesselStateCalc.run();
|
|
32
|
+
|
|
33
|
+
if (vesselStateCalc.messages.length > 0) {
|
|
34
|
+
console.log("Messages:");
|
|
35
|
+
vesselStateCalc.messages.forEach((message) => console.log(message));
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
expect(resultCode).toBe(ResultCode.SUCCESS);
|
|
39
|
+
|
|
40
|
+
const vessel = new Vessel({
|
|
41
|
+
state,
|
|
42
|
+
material,
|
|
43
|
+
vesselConditions: vesselStateCalc.vesselConditions,
|
|
44
|
+
liquidFillFractionByVolume: 0.7,
|
|
45
|
+
shape: VesselShape.VERTICAL_CYLINDER,
|
|
46
|
+
height: 3.0,
|
|
47
|
+
diameter: 1.5
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
const lineRupture = new LineRupture({
|
|
51
|
+
pipeDiameter: 0.02,
|
|
52
|
+
pipeLength: 10.0,
|
|
53
|
+
pipeHeightFraction: 0.0,
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
const lineRuptureCalc = new VesselLineRuptureCalculation(
|
|
57
|
+
vessel,
|
|
58
|
+
lineRupture,
|
|
59
|
+
new DischargeParameters()
|
|
60
|
+
);
|
|
61
|
+
resultCode = await lineRuptureCalc.run();
|
|
62
|
+
|
|
63
|
+
if (lineRuptureCalc.messages.length > 0) {
|
|
64
|
+
console.log("Messages:");
|
|
65
|
+
lineRuptureCalc.messages.forEach((message) => console.log(message));
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
expect(resultCode).toBe(ResultCode.SUCCESS);
|
|
69
|
+
|
|
70
|
+
const weather = new Weather({
|
|
71
|
+
windSpeed: 5.0,
|
|
72
|
+
stabilityClass: AtmosphericStabilityClass.STABILITY_D,
|
|
73
|
+
windProfileFlag: WindProfileFlag.LOGARITHMIC_PROFILE
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
const substrate = new Substrate();
|
|
77
|
+
|
|
78
|
+
const dispersionCalc = new DispersionCalculation(
|
|
79
|
+
lineRuptureCalc.exitMaterial!,
|
|
80
|
+
substrate,
|
|
81
|
+
lineRuptureCalc.dischargeResult!,
|
|
82
|
+
lineRuptureCalc.dischargeRecords!,
|
|
83
|
+
lineRuptureCalc.dischargeRecords!.length,
|
|
84
|
+
weather,
|
|
85
|
+
new DispersionParameters(),
|
|
86
|
+
0.0
|
|
87
|
+
);
|
|
88
|
+
resultCode = await dispersionCalc.run();
|
|
89
|
+
|
|
90
|
+
if (dispersionCalc.messages.length > 0) {
|
|
91
|
+
console.log("Messages:");
|
|
92
|
+
dispersionCalc.messages.forEach((message) => console.log(message));
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
expect(resultCode).toBe(ResultCode.SUCCESS);
|
|
96
|
+
|
|
97
|
+
const flammableParams = new FlammableParameters({
|
|
98
|
+
poolFireType: PoolFireType.LATE,
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
const poolFireCalc = new PoolFireCalculation(
|
|
102
|
+
lineRuptureCalc.exitMaterial!,
|
|
103
|
+
dispersionCalc.poolRecords!,
|
|
104
|
+
dispersionCalc.poolRecords!.length,
|
|
105
|
+
weather,
|
|
106
|
+
substrate,
|
|
107
|
+
flammableParams
|
|
108
|
+
);
|
|
109
|
+
resultCode = await poolFireCalc.run();
|
|
110
|
+
|
|
111
|
+
if (poolFireCalc.messages.length > 0) {
|
|
112
|
+
console.log("Messages:");
|
|
113
|
+
poolFireCalc.messages.forEach((message) => console.log(message));
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
expect(resultCode).toBe(ResultCode.SUCCESS);
|
|
117
|
+
|
|
118
|
+
const flammableOutputConfigs = [
|
|
119
|
+
{ x: 0.0, y: 0.0, z: 0.0 },
|
|
120
|
+
{ x: 0.0, y: 0.0, z: 1.0 },
|
|
121
|
+
{ x: 0.0, y: 0.0, z: 2.0 },
|
|
122
|
+
].map(({ x, y, z }) => {
|
|
123
|
+
return new FlammableOutputConfig({
|
|
124
|
+
position: new LocalPosition({ x, y, z })
|
|
125
|
+
});
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
const radiationCalc = new DistancesAndEllipsesToRadiationLevelsForPoolFiresCalculation(
|
|
129
|
+
poolFireCalc.poolFireFlameResult!,
|
|
130
|
+
poolFireCalc.flameRecords!,
|
|
131
|
+
poolFireCalc.flameRecords!.length,
|
|
132
|
+
weather,
|
|
133
|
+
flammableParams,
|
|
134
|
+
flammableOutputConfigs,
|
|
135
|
+
flammableOutputConfigs.length
|
|
136
|
+
);
|
|
137
|
+
resultCode = await radiationCalc.run();
|
|
138
|
+
|
|
139
|
+
if (radiationCalc.messages.length > 0) {
|
|
140
|
+
console.log("Messages:");
|
|
141
|
+
radiationCalc.messages.forEach((message) => console.log(message));
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
expect(resultCode).toBe(ResultCode.SUCCESS);
|
|
145
|
+
|
|
146
|
+
expect(radiationCalc.contourPoints!.length).toBe(150);
|
|
147
|
+
expect(
|
|
148
|
+
Math.abs(
|
|
149
|
+
(radiationCalc.contourPoints![radiationCalc.contourPoints!.length - 1].x -
|
|
150
|
+
49.262370814360395) / 49.262370814360395
|
|
151
|
+
)
|
|
152
|
+
).toBeLessThan(1e-3);
|
|
153
|
+
|
|
154
|
+
expect(
|
|
155
|
+
Math.abs(
|
|
156
|
+
(radiationCalc.poolFireFlameResult!.flameDiameter! -
|
|
157
|
+
30.674606323242188) / 30.674606323242188
|
|
158
|
+
)
|
|
159
|
+
).toBeLessThan(1e-3);
|
|
160
|
+
});
|
|
161
|
+
});
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import { DispersionCalculation } from "../../src/calculations/dispersion";
|
|
2
|
+
import { PoolFireCalculation } from "../../src/calculations/poolFire";
|
|
3
|
+
import { RadiationAtPointsForPoolFiresCalculation } from "../../src/calculations/radiation";
|
|
4
|
+
import { VesselLineRuptureCalculation } from "../../src/calculations/discharge";
|
|
5
|
+
import { Bund, DischargeParameters, DispersionParameters, FlammableOutputConfig, FlammableParameters, LineRupture, LocalPosition, Material, MaterialComponent, State, Substrate, Vessel, Weather } from "../../src/entities";
|
|
6
|
+
import { AtmosphericStabilityClass, PoolFireType, ResultCode, TimeVaryingOption, VesselShape, WindProfileFlag } from "../../src/enums";
|
|
7
|
+
import { VesselStateCalculation } from "../../src/calculations/discharge";
|
|
8
|
+
import { setAccessToken } from "../../src/utilities";
|
|
9
|
+
const accessToken = process.env.PWS_ACCESS_TOKEN;
|
|
10
|
+
|
|
11
|
+
if (!accessToken) {
|
|
12
|
+
throw new Error("ACCESS_TOKEN environment variable is not set.");
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
setAccessToken(accessToken);
|
|
16
|
+
|
|
17
|
+
describe("Vessel Line Rupture Calculation Integration - Test Case 43a", () => {
|
|
18
|
+
test("should compute correct radiation and flame diameter for a line rupture scenario", async () => {
|
|
19
|
+
const state = new State({
|
|
20
|
+
temperature: 280.0,
|
|
21
|
+
pressure: 1.5e5,
|
|
22
|
+
liquidFraction: 1.0,
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
const material = new Material({
|
|
26
|
+
name: "N-DECANE",
|
|
27
|
+
components: [new MaterialComponent({ name: "N-DECANE", moleFraction: 1.0 })],
|
|
28
|
+
componentCount: 1,
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
const vesselStateCalc = new VesselStateCalculation(material, state);
|
|
32
|
+
let resultCode = await vesselStateCalc.run();
|
|
33
|
+
|
|
34
|
+
if (vesselStateCalc.messages.length > 0) {
|
|
35
|
+
console.log("Messages:");
|
|
36
|
+
vesselStateCalc.messages.forEach((msg) => console.log(msg));
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
expect(resultCode).toBe(ResultCode.SUCCESS);
|
|
40
|
+
|
|
41
|
+
const vessel = new Vessel({
|
|
42
|
+
state,
|
|
43
|
+
material,
|
|
44
|
+
vesselConditions: vesselStateCalc.vesselConditions,
|
|
45
|
+
liquidFillFractionByVolume: 0.7,
|
|
46
|
+
shape: VesselShape.VERTICAL_CYLINDER,
|
|
47
|
+
height: 3.0,
|
|
48
|
+
diameter: 1.5,
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
const lineRupture = new LineRupture({
|
|
52
|
+
pipeDiameter: 0.02,
|
|
53
|
+
pipeLength: 10.0,
|
|
54
|
+
pipeHeightFraction: 0.0,
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
const ruptureCalc = new VesselLineRuptureCalculation(
|
|
58
|
+
vessel,
|
|
59
|
+
lineRupture,
|
|
60
|
+
new DischargeParameters()
|
|
61
|
+
);
|
|
62
|
+
resultCode = await ruptureCalc.run();
|
|
63
|
+
|
|
64
|
+
if (ruptureCalc.messages.length > 0) {
|
|
65
|
+
console.log("Messages:");
|
|
66
|
+
ruptureCalc.messages.forEach((msg) => console.log(msg));
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
expect(resultCode).toBe(ResultCode.SUCCESS);
|
|
70
|
+
expect(ruptureCalc.dischargeResult?.releaseMass).toBeGreaterThan(0);
|
|
71
|
+
|
|
72
|
+
const weather = new Weather({
|
|
73
|
+
windSpeed: 5.0,
|
|
74
|
+
stabilityClass: AtmosphericStabilityClass.STABILITY_D,
|
|
75
|
+
windProfileFlag: WindProfileFlag.LOGARITHMIC_PROFILE
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
const substrate = new Substrate();
|
|
79
|
+
|
|
80
|
+
const dispersionCalc = new DispersionCalculation(
|
|
81
|
+
ruptureCalc.exitMaterial!,
|
|
82
|
+
substrate,
|
|
83
|
+
ruptureCalc.dischargeResult!,
|
|
84
|
+
ruptureCalc.dischargeRecords!,
|
|
85
|
+
ruptureCalc.dischargeRecords!.length,
|
|
86
|
+
weather,
|
|
87
|
+
new DispersionParameters(),
|
|
88
|
+
0.0
|
|
89
|
+
);
|
|
90
|
+
resultCode = await dispersionCalc.run();
|
|
91
|
+
|
|
92
|
+
if (dispersionCalc.messages.length > 0) {
|
|
93
|
+
console.log("Messages:");
|
|
94
|
+
dispersionCalc.messages.forEach((msg) => console.log(msg));
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
expect(resultCode).toBe(ResultCode.SUCCESS);
|
|
98
|
+
|
|
99
|
+
const flammableParams = new FlammableParameters({
|
|
100
|
+
poolFireType: PoolFireType.LATE,
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
const poolFireCalc = new PoolFireCalculation(
|
|
104
|
+
ruptureCalc.exitMaterial!,
|
|
105
|
+
dispersionCalc.poolRecords!,
|
|
106
|
+
dispersionCalc.poolRecords!.length,
|
|
107
|
+
weather,
|
|
108
|
+
substrate,
|
|
109
|
+
flammableParams
|
|
110
|
+
);
|
|
111
|
+
resultCode = await poolFireCalc.run();
|
|
112
|
+
|
|
113
|
+
if (poolFireCalc.messages.length > 0) {
|
|
114
|
+
console.log("Messages:");
|
|
115
|
+
poolFireCalc.messages.forEach((msg) => console.log(msg));
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
expect(resultCode).toBe(ResultCode.SUCCESS);
|
|
119
|
+
|
|
120
|
+
const flammableOutputConfigs = [
|
|
121
|
+
{ x: 0.0, y: 0.0, z: 0.0 },
|
|
122
|
+
{ x: 0.0, y: 0.0, z: 1.0 },
|
|
123
|
+
{ x: 0.0, y: 0.0, z: 2.0 },
|
|
124
|
+
].map(({ x, y, z }) => {
|
|
125
|
+
return new FlammableOutputConfig({
|
|
126
|
+
position: new LocalPosition({ x, y, z })
|
|
127
|
+
});
|
|
128
|
+
});
|
|
129
|
+
|
|
130
|
+
const radiationCalc = new RadiationAtPointsForPoolFiresCalculation(
|
|
131
|
+
poolFireCalc.poolFireFlameResult!,
|
|
132
|
+
poolFireCalc.flameRecords!,
|
|
133
|
+
poolFireCalc.flameRecords!.length,
|
|
134
|
+
weather,
|
|
135
|
+
flammableParams,
|
|
136
|
+
flammableOutputConfigs,
|
|
137
|
+
flammableOutputConfigs.length
|
|
138
|
+
);
|
|
139
|
+
resultCode = await radiationCalc.run();
|
|
140
|
+
|
|
141
|
+
if (radiationCalc.messages.length > 0) {
|
|
142
|
+
console.log("Messages:");
|
|
143
|
+
radiationCalc.messages.forEach((msg) => console.log(msg));
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
expect(resultCode).toBe(ResultCode.SUCCESS);
|
|
147
|
+
|
|
148
|
+
const expectedRadiation = 136477.34375;
|
|
149
|
+
const expectedFlameDiameter = 30.674606323242188;
|
|
150
|
+
|
|
151
|
+
const actualRadiation = radiationCalc.radiation![0];
|
|
152
|
+
const actualFlameDiameter = radiationCalc.poolFireFlameResult.flameDiameter!;
|
|
153
|
+
|
|
154
|
+
expect(Math.abs((actualRadiation - expectedRadiation) / expectedRadiation)).toBeLessThan(1e-3);
|
|
155
|
+
expect(Math.abs((actualFlameDiameter - expectedFlameDiameter) / expectedFlameDiameter)).toBeLessThan(1e-3);
|
|
156
|
+
});
|
|
157
|
+
});
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import { VesselLineRuptureCalculation, VesselStateCalculation, VesselCatastrophicRuptureCalculation } from "../../src/calculations/discharge";
|
|
2
|
+
import { DispersionCalculation } from "../../src/calculations/dispersion";
|
|
3
|
+
import { PoolFireCalculation } from "../../src/calculations/poolFire";
|
|
4
|
+
import { DistancesAndEllipsesToRadiationLevelsForPoolFiresCalculation } from "../../src/calculations/radiation";
|
|
5
|
+
import { DischargeParameters, DispersionParameters, FlammableOutputConfig, FlammableParameters, LineRupture, LocalPosition, Material, MaterialComponent, State, Substrate, Vessel, Weather} from "../../src/entities";
|
|
6
|
+
import { AtmosphericStabilityClass, PoolFireType, ResultCode, VesselShape, WindProfileFlag } from "../../src/enums";
|
|
7
|
+
import { setAccessToken } from "../../src/utilities";
|
|
8
|
+
const accessToken = process.env.PWS_ACCESS_TOKEN;
|
|
9
|
+
|
|
10
|
+
if (!accessToken) {
|
|
11
|
+
throw new Error("ACCESS_TOKEN environment variable is not set.");
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
setAccessToken(accessToken);
|
|
15
|
+
|
|
16
|
+
describe("Vessel Catastrophic Rupture Integration - Test Case 44", () => {
|
|
17
|
+
test("should correctly simulate ammonia rupture and fire radiation", async () => {
|
|
18
|
+
const material = new Material({
|
|
19
|
+
name: "AMMONIA",
|
|
20
|
+
components: [new MaterialComponent({ name: "AMMONIA", moleFraction: 1.0 })],
|
|
21
|
+
componentCount: 1,
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
const state = new State({
|
|
25
|
+
temperature: 265.0,
|
|
26
|
+
pressure: 5.0e5,
|
|
27
|
+
liquidFraction: 0.8,
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
const vesselStateCalculation = new VesselStateCalculation(material, state);
|
|
31
|
+
let resultCode = await vesselStateCalculation.run();
|
|
32
|
+
|
|
33
|
+
if (vesselStateCalculation.messages.length > 0) {
|
|
34
|
+
console.log("Messages:");
|
|
35
|
+
vesselStateCalculation.messages.forEach((message) => console.log(message));
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
expect(resultCode).toBe(ResultCode.SUCCESS);
|
|
39
|
+
|
|
40
|
+
const vessel = new Vessel({
|
|
41
|
+
state,
|
|
42
|
+
material,
|
|
43
|
+
vesselConditions: vesselStateCalculation.vesselConditions,
|
|
44
|
+
liquidFillFractionByVolume: 0.8,
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
const dischargeParams = new DischargeParameters();
|
|
48
|
+
|
|
49
|
+
const ruptureCalc = new VesselCatastrophicRuptureCalculation(vessel, dischargeParams);
|
|
50
|
+
resultCode = await ruptureCalc.run();
|
|
51
|
+
|
|
52
|
+
if (ruptureCalc.messages.length > 0) {
|
|
53
|
+
console.log("Messages:");
|
|
54
|
+
ruptureCalc.messages.forEach((message) => console.log(message));
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
expect(resultCode).toBe(ResultCode.SUCCESS);
|
|
58
|
+
|
|
59
|
+
const weather = new Weather({
|
|
60
|
+
windSpeed: 10.0,
|
|
61
|
+
stabilityClass: AtmosphericStabilityClass.STABILITY_A_,
|
|
62
|
+
windProfileFlag: WindProfileFlag.LOGARITHMIC_PROFILE
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
const substrate = new Substrate();
|
|
66
|
+
|
|
67
|
+
const dispersionCalc = new DispersionCalculation(
|
|
68
|
+
ruptureCalc.exitMaterial!,
|
|
69
|
+
substrate,
|
|
70
|
+
ruptureCalc.dischargeResult!,
|
|
71
|
+
ruptureCalc.dischargeRecords!,
|
|
72
|
+
ruptureCalc.dischargeRecords!.length,
|
|
73
|
+
weather,
|
|
74
|
+
new DispersionParameters(),
|
|
75
|
+
0.0
|
|
76
|
+
);
|
|
77
|
+
|
|
78
|
+
resultCode = await dispersionCalc.run();
|
|
79
|
+
|
|
80
|
+
if (dispersionCalc.messages.length > 0) {
|
|
81
|
+
console.log("Messages:");
|
|
82
|
+
dispersionCalc.messages.forEach((message) => console.log(message));
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
expect(resultCode).toBe(ResultCode.SUCCESS);
|
|
86
|
+
|
|
87
|
+
const flammableParams = new FlammableParameters({
|
|
88
|
+
poolFireType: PoolFireType.EARLY,
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
const poolFireCalc = new PoolFireCalculation(
|
|
92
|
+
ruptureCalc.exitMaterial!,
|
|
93
|
+
dispersionCalc.poolRecords!,
|
|
94
|
+
dispersionCalc.poolRecords!.length,
|
|
95
|
+
weather,
|
|
96
|
+
substrate,
|
|
97
|
+
flammableParams
|
|
98
|
+
);
|
|
99
|
+
|
|
100
|
+
resultCode = await poolFireCalc.run();
|
|
101
|
+
|
|
102
|
+
if (poolFireCalc.messages.length > 0) {
|
|
103
|
+
console.log("Messages:");
|
|
104
|
+
poolFireCalc.messages.forEach((message) => console.log(message));
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
expect(resultCode).toBe(ResultCode.SUCCESS);
|
|
108
|
+
|
|
109
|
+
const flammableOutputConfigs = [
|
|
110
|
+
{ x: 0.0, y: 0.0, z: 0.0 },
|
|
111
|
+
{ x: 0.0, y: 0.0, z: 1.0 },
|
|
112
|
+
{ x: 0.0, y: 0.0, z: 2.0 },
|
|
113
|
+
].map(({ x, y, z }) => {
|
|
114
|
+
return new FlammableOutputConfig({
|
|
115
|
+
position: new LocalPosition({ x, y, z })
|
|
116
|
+
});
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
const radiationCalc = new DistancesAndEllipsesToRadiationLevelsForPoolFiresCalculation(
|
|
120
|
+
poolFireCalc.poolFireFlameResult!,
|
|
121
|
+
poolFireCalc.flameRecords!,
|
|
122
|
+
poolFireCalc.flameRecords!.length,
|
|
123
|
+
weather,
|
|
124
|
+
flammableParams,
|
|
125
|
+
flammableOutputConfigs,
|
|
126
|
+
flammableOutputConfigs.length
|
|
127
|
+
);
|
|
128
|
+
|
|
129
|
+
resultCode = await radiationCalc.run();
|
|
130
|
+
|
|
131
|
+
if (radiationCalc.messages.length > 0) {
|
|
132
|
+
console.log("Messages:");
|
|
133
|
+
radiationCalc.messages.forEach((message) => console.log(message));
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
expect(resultCode).toBe(ResultCode.SUCCESS);
|
|
137
|
+
|
|
138
|
+
expect(radiationCalc.contourPoints!.length).toBe(150);
|
|
139
|
+
|
|
140
|
+
const lastPointX = radiationCalc.contourPoints![radiationCalc.contourPoints!.length - 1].x;
|
|
141
|
+
expect(Math.abs((lastPointX - 57.950279071403216) / 57.950279071403216)).toBeLessThan(1e-3);
|
|
142
|
+
|
|
143
|
+
const flameDiameter = radiationCalc.poolFireFlameResult!.flameDiameter!;
|
|
144
|
+
expect(Math.abs((flameDiameter - 41.44367599487305) / 41.44367599487305)).toBeLessThan(1e-3);
|
|
145
|
+
});
|
|
146
|
+
});
|
|
147
|
+
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import { VesselLineRuptureCalculation, VesselStateCalculation, VesselCatastrophicRuptureCalculation } from "../../src/calculations/discharge";
|
|
2
|
+
import { DispersionCalculation } from "../../src/calculations/dispersion";
|
|
3
|
+
import { PoolFireCalculation } from "../../src/calculations/poolFire";
|
|
4
|
+
import { RadiationAtPointsForPoolFiresCalculation } from "../../src/calculations/radiation";
|
|
5
|
+
import { DischargeParameters, DispersionParameters, FlammableOutputConfig, FlammableParameters, LineRupture, LocalPosition, Material, MaterialComponent, State, Substrate, Vessel, Weather} from "../../src/entities";
|
|
6
|
+
import { AtmosphericStabilityClass, PoolFireType, ResultCode, VesselShape, WindProfileFlag } from "../../src/enums";
|
|
7
|
+
import { setAccessToken } from "../../src/utilities";
|
|
8
|
+
const accessToken = process.env.PWS_ACCESS_TOKEN;
|
|
9
|
+
|
|
10
|
+
if (!accessToken) {
|
|
11
|
+
throw new Error("ACCESS_TOKEN environment variable is not set.");
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
setAccessToken(accessToken);
|
|
15
|
+
|
|
16
|
+
describe("Vessel Catastrophic Rupture Integration - Test Case 44a", () => {
|
|
17
|
+
test("should produce correct radiation and flame diameter for ammonia pool fire", async () => {
|
|
18
|
+
const material = new Material({
|
|
19
|
+
name: "AMMONIA",
|
|
20
|
+
components: [new MaterialComponent({ name: "AMMONIA", moleFraction: 1.0 })],
|
|
21
|
+
componentCount: 1,
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
const state = new State({
|
|
25
|
+
temperature: 265.0,
|
|
26
|
+
pressure: 5.0e5,
|
|
27
|
+
liquidFraction: 0.8,
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
const vesselStateCalc = new VesselStateCalculation(material, state);
|
|
31
|
+
let resultCode = await vesselStateCalc.run();
|
|
32
|
+
|
|
33
|
+
if (vesselStateCalc.messages.length > 0) {
|
|
34
|
+
console.log("Messages:");
|
|
35
|
+
vesselStateCalc.messages.forEach((m) => console.log(m));
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
expect(resultCode).toBe(ResultCode.SUCCESS);
|
|
39
|
+
|
|
40
|
+
const vessel = new Vessel({
|
|
41
|
+
state,
|
|
42
|
+
material,
|
|
43
|
+
vesselConditions: vesselStateCalc.vesselConditions,
|
|
44
|
+
liquidFillFractionByVolume: 0.8
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
const dischargeParameters = new DischargeParameters();
|
|
48
|
+
|
|
49
|
+
const ruptureCalc = new VesselCatastrophicRuptureCalculation(
|
|
50
|
+
vessel,
|
|
51
|
+
dischargeParameters
|
|
52
|
+
);
|
|
53
|
+
resultCode = await ruptureCalc.run();
|
|
54
|
+
|
|
55
|
+
if (ruptureCalc.messages.length > 0) {
|
|
56
|
+
console.log("Messages:");
|
|
57
|
+
ruptureCalc.messages.forEach((m) => console.log(m));
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
expect(resultCode).toBe(ResultCode.SUCCESS);
|
|
61
|
+
|
|
62
|
+
const weather = new Weather({
|
|
63
|
+
windSpeed: 10.0,
|
|
64
|
+
stabilityClass: AtmosphericStabilityClass.STABILITY_A_,
|
|
65
|
+
windProfileFlag: WindProfileFlag.LOGARITHMIC_PROFILE
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
const substrate = new Substrate();
|
|
69
|
+
|
|
70
|
+
const dispersionCalc = new DispersionCalculation(
|
|
71
|
+
ruptureCalc.exitMaterial!,
|
|
72
|
+
substrate,
|
|
73
|
+
ruptureCalc.dischargeResult!,
|
|
74
|
+
ruptureCalc.dischargeRecords!,
|
|
75
|
+
ruptureCalc.dischargeRecords!.length,
|
|
76
|
+
weather,
|
|
77
|
+
new DispersionParameters(),
|
|
78
|
+
0.0
|
|
79
|
+
);
|
|
80
|
+
resultCode = await dispersionCalc.run();
|
|
81
|
+
|
|
82
|
+
if (dispersionCalc.messages.length > 0) {
|
|
83
|
+
console.log("Messages:");
|
|
84
|
+
dispersionCalc.messages.forEach((m) => console.log(m));
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
expect(resultCode).toBe(ResultCode.SUCCESS);
|
|
88
|
+
|
|
89
|
+
const flammableParams = new FlammableParameters({
|
|
90
|
+
poolFireType: PoolFireType.EARLY,
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
const poolFireCalc = new PoolFireCalculation(
|
|
94
|
+
ruptureCalc.exitMaterial!,
|
|
95
|
+
dispersionCalc.poolRecords!,
|
|
96
|
+
dispersionCalc.poolRecords!.length,
|
|
97
|
+
weather,
|
|
98
|
+
substrate,
|
|
99
|
+
flammableParams
|
|
100
|
+
);
|
|
101
|
+
resultCode = await poolFireCalc.run();
|
|
102
|
+
|
|
103
|
+
if (poolFireCalc.messages.length > 0) {
|
|
104
|
+
console.log("Messages:");
|
|
105
|
+
poolFireCalc.messages.forEach((m) => console.log(m));
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
expect(resultCode).toBe(ResultCode.SUCCESS);
|
|
109
|
+
|
|
110
|
+
const flammableOutputConfigs = [
|
|
111
|
+
{ x: 0.0, y: 0.0, z: 0.0 },
|
|
112
|
+
{ x: 0.0, y: 0.0, z: 1.0 },
|
|
113
|
+
{ x: 0.0, y: 0.0, z: 2.0 },
|
|
114
|
+
].map(({ x, y, z }) => {
|
|
115
|
+
return new FlammableOutputConfig({
|
|
116
|
+
position: new LocalPosition({ x, y, z })
|
|
117
|
+
});
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
const radiationCalc = new RadiationAtPointsForPoolFiresCalculation(
|
|
121
|
+
poolFireCalc.poolFireFlameResult!,
|
|
122
|
+
poolFireCalc.flameRecords!,
|
|
123
|
+
poolFireCalc.flameRecords!.length,
|
|
124
|
+
weather,
|
|
125
|
+
flammableParams,
|
|
126
|
+
flammableOutputConfigs,
|
|
127
|
+
flammableOutputConfigs.length
|
|
128
|
+
);
|
|
129
|
+
resultCode = await radiationCalc.run();
|
|
130
|
+
|
|
131
|
+
if (radiationCalc.messages.length > 0) {
|
|
132
|
+
console.log("Messages:");
|
|
133
|
+
radiationCalc.messages.forEach((m) => console.log(m));
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
expect(resultCode).toBe(ResultCode.SUCCESS);
|
|
137
|
+
|
|
138
|
+
const expectedRadiation = 33916.10546875;
|
|
139
|
+
const expectedFlameDiameter = 41.44367599487305;
|
|
140
|
+
const actualRadiation = radiationCalc.radiation![0];
|
|
141
|
+
const actualFlameDiameter = radiationCalc.poolFireFlameResult.flameDiameter!;
|
|
142
|
+
|
|
143
|
+
expect(
|
|
144
|
+
Math.abs((actualRadiation - expectedRadiation) / expectedRadiation)
|
|
145
|
+
).toBeLessThan(1e-3);
|
|
146
|
+
|
|
147
|
+
expect(
|
|
148
|
+
Math.abs((actualFlameDiameter - expectedFlameDiameter) / expectedFlameDiameter)
|
|
149
|
+
).toBeLessThan(1e-3);
|
|
150
|
+
});
|
|
151
|
+
});
|
|
152
|
+
|