@dnv-plant/typescriptpws 1.0.86 → 1.0.88
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/.vscode/launch.json +16 -0
- package/azure-test-folder-job.yml +2 -2
- package/index.ts +3 -3
- package/package.json +7 -6
- package/src/calculations/applicationTools.ts +29 -36
- package/src/calculations/discharge.ts +423 -321
- package/src/calculations/dispersion.ts +52 -84
- package/src/calculations/dispersionView.ts +311 -549
- package/src/calculations/fireball.ts +45 -69
- package/src/calculations/jetFire.ts +80 -129
- package/src/calculations/lateExplosion.ts +120 -210
- package/src/calculations/linkedRunners.ts +727 -1275
- package/src/calculations/poolFire.ts +45 -69
- package/src/calculations/properties.ts +32 -42
- package/src/calculations/radiation.ts +415 -714
- package/src/calculations/standalones.ts +39 -57
- package/src/calculations/toxics.ts +50 -78
- package/src/calculations/utilities.ts +357 -588
- package/src/constants.ts +9 -3
- package/src/entities.ts +3 -3
- package/src/entity-schemas.ts +3 -3
- package/src/enums.ts +4 -27
- package/src/materials.ts +236 -75
- package/src/utilities.ts +40 -9
- package/tsconfig.json +0 -100
- package/vitest.config.ts +9 -0
|
@@ -6,12 +6,10 @@
|
|
|
6
6
|
* Editing it may lead to inconsistent results and limit DNV's ability to provide support.
|
|
7
7
|
* Please contact DNV if you believe changes are required.
|
|
8
8
|
*
|
|
9
|
-
* Version: 1.0.
|
|
10
|
-
* Date/time:
|
|
9
|
+
* Version: 1.0.89
|
|
10
|
+
* Date/time: 29 Jul 2025 17:59:11
|
|
11
11
|
* Template: templates/typescriptpws/calculations.razor.
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
***********************************************************************/
|
|
15
13
|
|
|
16
14
|
import * as Enums from "../enums";
|
|
17
15
|
import * as Entities from "../entities";
|
|
@@ -36,12 +34,17 @@ class CalculationBase {
|
|
|
36
34
|
messages: string[] = [];
|
|
37
35
|
calculationElapsedTime?: number = 0.0;
|
|
38
36
|
operationId?: string = "";
|
|
37
|
+
controller?: AbortController;
|
|
38
|
+
|
|
39
|
+
constructor(controller?: AbortController) {
|
|
40
|
+
this.controller = controller;
|
|
41
|
+
}
|
|
39
42
|
|
|
40
43
|
/**
|
|
41
44
|
* Post JSON to URL and time the call
|
|
42
45
|
*/
|
|
43
46
|
async postRequest(url: string, data: string): Promise<AxiosResponse> {
|
|
44
|
-
return postRequest(url, data);
|
|
47
|
+
return postRequest(url, data, this.controller);
|
|
45
48
|
}
|
|
46
49
|
|
|
47
50
|
/**
|
|
@@ -185,20 +188,8 @@ class LateExplosionCalculationRequest extends CalculationRequestBase {
|
|
|
185
188
|
/**
|
|
186
189
|
* LateExplosion calculation request class.
|
|
187
190
|
*
|
|
188
|
-
* @param {Entities.Material} material - a material entity with post-discharge composition.
|
|
189
|
-
* @param {Entities.ScalarUdmOutputs} scalarUdmOutputs - Scalar dispersion results.
|
|
190
|
-
* @param {Entities.Weather} weather - a weather entity.
|
|
191
|
-
* @param {Entities.DispersionRecord[]} dispersionRecords - an array of dispersion records.
|
|
192
|
-
* @param {number} dispersionRecordCount - Number of dispersion records.
|
|
193
|
-
* @param {Entities.Substrate} substrate - a substrate entity.
|
|
194
|
-
* @param {Entities.DispersionOutputConfig} dispersionOutputConfig - a dispersion output config.
|
|
195
|
-
* @param {Entities.ExplosionOutputConfig} explosionOutputConfig - an explosion output config.
|
|
196
|
-
* @param {Entities.ExplosionParameters} explosionParameters - an explosion parameters entity.
|
|
197
|
-
* @param {Entities.ExplosionConfinedVolume[]} explosionConfinedVolumes - an array of explosion confined volumes.
|
|
198
|
-
* @param {number} explosionConfinedVolumeCount - Number of explosion confined volumes.
|
|
199
|
-
* @param {Entities.DispersionParameters} dispersionParameters - a dispersion parameters entity.
|
|
200
191
|
*/
|
|
201
|
-
constructor(
|
|
192
|
+
constructor(data: {
|
|
202
193
|
material: Entities.Material,
|
|
203
194
|
scalarUdmOutputs: Entities.ScalarUdmOutputs,
|
|
204
195
|
weather: Entities.Weather,
|
|
@@ -211,20 +202,20 @@ class LateExplosionCalculationRequest extends CalculationRequestBase {
|
|
|
211
202
|
explosionConfinedVolumes: Entities.ExplosionConfinedVolume[],
|
|
212
203
|
explosionConfinedVolumeCount: number,
|
|
213
204
|
dispersionParameters: Entities.DispersionParameters
|
|
214
|
-
) {
|
|
205
|
+
}) {
|
|
215
206
|
super();
|
|
216
|
-
this.material = material;
|
|
217
|
-
this.scalarUdmOutputs = scalarUdmOutputs;
|
|
218
|
-
this.weather = weather;
|
|
219
|
-
this.dispersionRecords = dispersionRecords;
|
|
220
|
-
this.dispersionRecordCount = dispersionRecordCount;
|
|
221
|
-
this.substrate = substrate;
|
|
222
|
-
this.dispersionOutputConfig = dispersionOutputConfig;
|
|
223
|
-
this.explosionOutputConfig = explosionOutputConfig;
|
|
224
|
-
this.explosionParameters = explosionParameters;
|
|
225
|
-
this.explosionConfinedVolumes = explosionConfinedVolumes;
|
|
226
|
-
this.explosionConfinedVolumeCount = explosionConfinedVolumeCount;
|
|
227
|
-
this.dispersionParameters = dispersionParameters;
|
|
207
|
+
this.material = data.material;
|
|
208
|
+
this.scalarUdmOutputs = data.scalarUdmOutputs;
|
|
209
|
+
this.weather = data.weather;
|
|
210
|
+
this.dispersionRecords = data.dispersionRecords;
|
|
211
|
+
this.dispersionRecordCount = data.dispersionRecordCount;
|
|
212
|
+
this.substrate = data.substrate;
|
|
213
|
+
this.dispersionOutputConfig = data.dispersionOutputConfig;
|
|
214
|
+
this.explosionOutputConfig = data.explosionOutputConfig;
|
|
215
|
+
this.explosionParameters = data.explosionParameters;
|
|
216
|
+
this.explosionConfinedVolumes = data.explosionConfinedVolumes;
|
|
217
|
+
this.explosionConfinedVolumeCount = data.explosionConfinedVolumeCount;
|
|
218
|
+
this.dispersionParameters = data.dispersionParameters;
|
|
228
219
|
}
|
|
229
220
|
}
|
|
230
221
|
|
|
@@ -276,20 +267,7 @@ export class LateExplosionCalculationRequestSchema {
|
|
|
276
267
|
}
|
|
277
268
|
|
|
278
269
|
makeCalculationRequest(data: LateExplosionCalculationRequestSchemaData): LateExplosionCalculationRequest {
|
|
279
|
-
return new LateExplosionCalculationRequest(
|
|
280
|
-
data.material,
|
|
281
|
-
data.scalarUdmOutputs,
|
|
282
|
-
data.weather,
|
|
283
|
-
data.dispersionRecords,
|
|
284
|
-
data.dispersionRecordCount,
|
|
285
|
-
data.substrate,
|
|
286
|
-
data.dispersionOutputConfig,
|
|
287
|
-
data.explosionOutputConfig,
|
|
288
|
-
data.explosionParameters,
|
|
289
|
-
data.explosionConfinedVolumes,
|
|
290
|
-
data.explosionConfinedVolumeCount,
|
|
291
|
-
data.dispersionParameters
|
|
292
|
-
);
|
|
270
|
+
return new LateExplosionCalculationRequest(data);
|
|
293
271
|
}
|
|
294
272
|
}
|
|
295
273
|
|
|
@@ -312,20 +290,8 @@ export class LateExplosionCalculation extends CalculationBase {
|
|
|
312
290
|
/**
|
|
313
291
|
* Calculates the explosion overpressures from a flammable cloud, including delayed ignition. The method can switch between a "Uniform confined" approach where the multi-energy explosion calculations will model a single confined source that contains the entire mass of the cloud, or a "User-defined" approach where the user can specify explosion volumes with different strengths. The results produced are for the worst-case explosion determined by exploding the cloud at 10 m intervals in the downwind direction.
|
|
314
292
|
*
|
|
315
|
-
* @param {Entities.Material} material - a material entity with post-discharge composition.
|
|
316
|
-
* @param {Entities.ScalarUdmOutputs} scalarUdmOutputs - Scalar dispersion results.
|
|
317
|
-
* @param {Entities.Weather} weather - a weather entity.
|
|
318
|
-
* @param {Entities.DispersionRecord[]} dispersionRecords - an array of dispersion records.
|
|
319
|
-
* @param {number} dispersionRecordCount - Number of dispersion records.
|
|
320
|
-
* @param {Entities.Substrate} substrate - a substrate entity.
|
|
321
|
-
* @param {Entities.DispersionOutputConfig} dispersionOutputConfig - a dispersion output config.
|
|
322
|
-
* @param {Entities.ExplosionOutputConfig} explosionOutputConfig - an explosion output config.
|
|
323
|
-
* @param {Entities.ExplosionParameters} explosionParameters - an explosion parameters entity.
|
|
324
|
-
* @param {Entities.ExplosionConfinedVolume[]} explosionConfinedVolumes - an array of explosion confined volumes.
|
|
325
|
-
* @param {number} explosionConfinedVolumeCount - Number of explosion confined volumes.
|
|
326
|
-
* @param {Entities.DispersionParameters} dispersionParameters - a dispersion parameters entity.
|
|
327
293
|
*/
|
|
328
|
-
constructor(
|
|
294
|
+
constructor(data: {
|
|
329
295
|
material: Entities.Material,
|
|
330
296
|
scalarUdmOutputs: Entities.ScalarUdmOutputs,
|
|
331
297
|
weather: Entities.Weather,
|
|
@@ -338,38 +304,39 @@ export class LateExplosionCalculation extends CalculationBase {
|
|
|
338
304
|
explosionConfinedVolumes: Entities.ExplosionConfinedVolume[],
|
|
339
305
|
explosionConfinedVolumeCount: number,
|
|
340
306
|
dispersionParameters: Entities.DispersionParameters
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
this.
|
|
345
|
-
this.
|
|
346
|
-
this.
|
|
347
|
-
this.
|
|
348
|
-
this.
|
|
349
|
-
this.
|
|
350
|
-
this.
|
|
351
|
-
this.
|
|
352
|
-
this.
|
|
353
|
-
this.
|
|
354
|
-
this.
|
|
307
|
+
controller?: AbortController;
|
|
308
|
+
}) {
|
|
309
|
+
super(data.controller);
|
|
310
|
+
this.material = data.material;
|
|
311
|
+
this.scalarUdmOutputs = data.scalarUdmOutputs;
|
|
312
|
+
this.weather = data.weather;
|
|
313
|
+
this.dispersionRecords = data.dispersionRecords;
|
|
314
|
+
this.dispersionRecordCount = data.dispersionRecordCount;
|
|
315
|
+
this.substrate = data.substrate;
|
|
316
|
+
this.dispersionOutputConfig = data.dispersionOutputConfig;
|
|
317
|
+
this.explosionOutputConfig = data.explosionOutputConfig;
|
|
318
|
+
this.explosionParameters = data.explosionParameters;
|
|
319
|
+
this.explosionConfinedVolumes = data.explosionConfinedVolumes;
|
|
320
|
+
this.explosionConfinedVolumeCount = data.explosionConfinedVolumeCount;
|
|
321
|
+
this.dispersionParameters = data.dispersionParameters;
|
|
355
322
|
}
|
|
356
323
|
|
|
357
324
|
async run() {
|
|
358
325
|
try {
|
|
359
|
-
const request = new LateExplosionCalculationRequest(
|
|
360
|
-
this.material,
|
|
361
|
-
this.scalarUdmOutputs,
|
|
362
|
-
this.weather,
|
|
363
|
-
this.dispersionRecords,
|
|
364
|
-
this.dispersionRecordCount,
|
|
365
|
-
this.substrate,
|
|
366
|
-
this.dispersionOutputConfig,
|
|
367
|
-
this.explosionOutputConfig,
|
|
368
|
-
this.explosionParameters,
|
|
369
|
-
this.explosionConfinedVolumes,
|
|
370
|
-
this.explosionConfinedVolumeCount,
|
|
371
|
-
this.dispersionParameters
|
|
372
|
-
);
|
|
326
|
+
const request = new LateExplosionCalculationRequest({
|
|
327
|
+
material: this.material,
|
|
328
|
+
scalarUdmOutputs: this.scalarUdmOutputs,
|
|
329
|
+
weather: this.weather,
|
|
330
|
+
dispersionRecords: this.dispersionRecords,
|
|
331
|
+
dispersionRecordCount: this.dispersionRecordCount,
|
|
332
|
+
substrate: this.substrate,
|
|
333
|
+
dispersionOutputConfig: this.dispersionOutputConfig,
|
|
334
|
+
explosionOutputConfig: this.explosionOutputConfig,
|
|
335
|
+
explosionParameters: this.explosionParameters,
|
|
336
|
+
explosionConfinedVolumes: this.explosionConfinedVolumes,
|
|
337
|
+
explosionConfinedVolumeCount: this.explosionConfinedVolumeCount,
|
|
338
|
+
dispersionParameters: this.dispersionParameters
|
|
339
|
+
});
|
|
373
340
|
|
|
374
341
|
const schema = new LateExplosionCalculationRequestSchema();
|
|
375
342
|
const validatedRequest = schema.validate(request);
|
|
@@ -431,24 +398,22 @@ export class LateExplosionCalculationResponse extends CalculationResponseBase {
|
|
|
431
398
|
/**
|
|
432
399
|
* LateExplosion calculation response class.
|
|
433
400
|
*
|
|
434
|
-
* @param {Entities.ExplosionOverpressureResult} explosionUnifConfOverpressureResult - Uniform confined explosion overpressure result.
|
|
435
|
-
* @param {Entities.ExplosionOverpressureResult} explosionUnconfOverpressureResult - Unconfined explosion overpressure result.
|
|
436
401
|
*/
|
|
437
|
-
constructor(
|
|
402
|
+
constructor(data: {
|
|
438
403
|
explosionUnifConfOverpressureResult: Entities.ExplosionOverpressureResult,
|
|
439
404
|
explosionUnconfOverpressureResult: Entities.ExplosionOverpressureResult,
|
|
440
405
|
resultCode: Enums.ResultCode,
|
|
441
406
|
messages: string[],
|
|
442
407
|
calculationElapsedTime: number,
|
|
443
408
|
operationId: string
|
|
444
|
-
) {
|
|
409
|
+
}) {
|
|
445
410
|
super();
|
|
446
|
-
this.explosionUnifConfOverpressureResult = explosionUnifConfOverpressureResult;
|
|
447
|
-
this.explosionUnconfOverpressureResult = explosionUnconfOverpressureResult;
|
|
448
|
-
this.resultCode = resultCode;
|
|
449
|
-
this.messages = messages;
|
|
450
|
-
this.calculationElapsedTime = calculationElapsedTime;
|
|
451
|
-
this.operationId = operationId;
|
|
411
|
+
this.explosionUnifConfOverpressureResult = data.explosionUnifConfOverpressureResult;
|
|
412
|
+
this.explosionUnconfOverpressureResult = data.explosionUnconfOverpressureResult;
|
|
413
|
+
this.resultCode = data.resultCode;
|
|
414
|
+
this.messages = data.messages;
|
|
415
|
+
this.calculationElapsedTime = data.calculationElapsedTime;
|
|
416
|
+
this.operationId = data.operationId;
|
|
452
417
|
}
|
|
453
418
|
|
|
454
419
|
initialiseFromDictionary(data: { [key: string]: unknown }) {
|
|
@@ -517,14 +482,7 @@ export class LateExplosionCalculationResponseSchema {
|
|
|
517
482
|
}
|
|
518
483
|
|
|
519
484
|
makeCalculationResponse(data: LateExplosionCalculationResponseSchemaData): LateExplosionCalculationResponse {
|
|
520
|
-
return new LateExplosionCalculationResponse(
|
|
521
|
-
data.explosionUnifConfOverpressureResult,
|
|
522
|
-
data.explosionUnconfOverpressureResult,
|
|
523
|
-
data.resultCode,
|
|
524
|
-
data.messages,
|
|
525
|
-
data.calculationElapsedTime,
|
|
526
|
-
data.operationId
|
|
527
|
-
);
|
|
485
|
+
return new LateExplosionCalculationResponse(data);
|
|
528
486
|
}
|
|
529
487
|
}
|
|
530
488
|
|
|
@@ -562,21 +520,8 @@ class LateExplosionToOPLevelsCalculationRequest extends CalculationRequestBase {
|
|
|
562
520
|
/**
|
|
563
521
|
* LateExplosionToOPLevels calculation request class.
|
|
564
522
|
*
|
|
565
|
-
* @param {Entities.Material} material - a material entity with post-discharge composition.
|
|
566
|
-
* @param {Entities.ScalarUdmOutputs} scalarUdmOutputs - Scalar dispersion results.
|
|
567
|
-
* @param {Entities.Weather} weather - a weather entity.
|
|
568
|
-
* @param {Entities.DispersionRecord[]} dispersionRecords - Cloud definition.
|
|
569
|
-
* @param {number} dispersionRecordCount - Number of dispersion records.
|
|
570
|
-
* @param {Entities.Substrate} substrate - a substrate entity.
|
|
571
|
-
* @param {Entities.DispersionOutputConfig} dispersionOutputConfig - a dispersion output config entity.
|
|
572
|
-
* @param {Entities.ExplosionOutputConfig[]} explosionOutputConfigs - an array of explosion output configs.
|
|
573
|
-
* @param {number} explosionOutputConfigCount - Number of explosion output configs.
|
|
574
|
-
* @param {Entities.ExplosionParameters} explosionParameters - Explosion parameters.
|
|
575
|
-
* @param {Entities.ExplosionConfinedVolume[]} explosionConfinedVolumes - an array of explosion confined volumes.
|
|
576
|
-
* @param {number} explosionConfinedVolumeCount - Number of explosion confined volumes.
|
|
577
|
-
* @param {Entities.DispersionParameters} dispersionParameters - a dispersion parameters entity.
|
|
578
523
|
*/
|
|
579
|
-
constructor(
|
|
524
|
+
constructor(data: {
|
|
580
525
|
material: Entities.Material,
|
|
581
526
|
scalarUdmOutputs: Entities.ScalarUdmOutputs,
|
|
582
527
|
weather: Entities.Weather,
|
|
@@ -590,21 +535,21 @@ class LateExplosionToOPLevelsCalculationRequest extends CalculationRequestBase {
|
|
|
590
535
|
explosionConfinedVolumes: Entities.ExplosionConfinedVolume[],
|
|
591
536
|
explosionConfinedVolumeCount: number,
|
|
592
537
|
dispersionParameters: Entities.DispersionParameters
|
|
593
|
-
) {
|
|
538
|
+
}) {
|
|
594
539
|
super();
|
|
595
|
-
this.material = material;
|
|
596
|
-
this.scalarUdmOutputs = scalarUdmOutputs;
|
|
597
|
-
this.weather = weather;
|
|
598
|
-
this.dispersionRecords = dispersionRecords;
|
|
599
|
-
this.dispersionRecordCount = dispersionRecordCount;
|
|
600
|
-
this.substrate = substrate;
|
|
601
|
-
this.dispersionOutputConfig = dispersionOutputConfig;
|
|
602
|
-
this.explosionOutputConfigs = explosionOutputConfigs;
|
|
603
|
-
this.explosionOutputConfigCount = explosionOutputConfigCount;
|
|
604
|
-
this.explosionParameters = explosionParameters;
|
|
605
|
-
this.explosionConfinedVolumes = explosionConfinedVolumes;
|
|
606
|
-
this.explosionConfinedVolumeCount = explosionConfinedVolumeCount;
|
|
607
|
-
this.dispersionParameters = dispersionParameters;
|
|
540
|
+
this.material = data.material;
|
|
541
|
+
this.scalarUdmOutputs = data.scalarUdmOutputs;
|
|
542
|
+
this.weather = data.weather;
|
|
543
|
+
this.dispersionRecords = data.dispersionRecords;
|
|
544
|
+
this.dispersionRecordCount = data.dispersionRecordCount;
|
|
545
|
+
this.substrate = data.substrate;
|
|
546
|
+
this.dispersionOutputConfig = data.dispersionOutputConfig;
|
|
547
|
+
this.explosionOutputConfigs = data.explosionOutputConfigs;
|
|
548
|
+
this.explosionOutputConfigCount = data.explosionOutputConfigCount;
|
|
549
|
+
this.explosionParameters = data.explosionParameters;
|
|
550
|
+
this.explosionConfinedVolumes = data.explosionConfinedVolumes;
|
|
551
|
+
this.explosionConfinedVolumeCount = data.explosionConfinedVolumeCount;
|
|
552
|
+
this.dispersionParameters = data.dispersionParameters;
|
|
608
553
|
}
|
|
609
554
|
}
|
|
610
555
|
|
|
@@ -658,21 +603,7 @@ export class LateExplosionToOPLevelsCalculationRequestSchema {
|
|
|
658
603
|
}
|
|
659
604
|
|
|
660
605
|
makeCalculationRequest(data: LateExplosionToOPLevelsCalculationRequestSchemaData): LateExplosionToOPLevelsCalculationRequest {
|
|
661
|
-
return new LateExplosionToOPLevelsCalculationRequest(
|
|
662
|
-
data.material,
|
|
663
|
-
data.scalarUdmOutputs,
|
|
664
|
-
data.weather,
|
|
665
|
-
data.dispersionRecords,
|
|
666
|
-
data.dispersionRecordCount,
|
|
667
|
-
data.substrate,
|
|
668
|
-
data.dispersionOutputConfig,
|
|
669
|
-
data.explosionOutputConfigs,
|
|
670
|
-
data.explosionOutputConfigCount,
|
|
671
|
-
data.explosionParameters,
|
|
672
|
-
data.explosionConfinedVolumes,
|
|
673
|
-
data.explosionConfinedVolumeCount,
|
|
674
|
-
data.dispersionParameters
|
|
675
|
-
);
|
|
606
|
+
return new LateExplosionToOPLevelsCalculationRequest(data);
|
|
676
607
|
}
|
|
677
608
|
}
|
|
678
609
|
|
|
@@ -696,21 +627,8 @@ export class LateExplosionToOPLevelsCalculation extends CalculationBase {
|
|
|
696
627
|
/**
|
|
697
628
|
* Calculates the explosion overpressures from a flammable cloud, including delayed ignition. The method can switch between a "Uniform confined" approach where the multi-energy explosion calculations will model a single confined source that contains the entire mass of the cloud, or a "User-defined" approach where the user can specify explosion volumes with different strengths. The results produced are for the worst-case explosion determined by exploding the cloud at 10 m intervals in the downwind direction. This calculation determines the worst-case explosion to various overpressure levels as specified by the array of explosion output configs.
|
|
698
629
|
*
|
|
699
|
-
* @param {Entities.Material} material - a material entity with post-discharge composition.
|
|
700
|
-
* @param {Entities.ScalarUdmOutputs} scalarUdmOutputs - Scalar dispersion results.
|
|
701
|
-
* @param {Entities.Weather} weather - a weather entity.
|
|
702
|
-
* @param {Entities.DispersionRecord[]} dispersionRecords - Cloud definition.
|
|
703
|
-
* @param {number} dispersionRecordCount - Number of dispersion records.
|
|
704
|
-
* @param {Entities.Substrate} substrate - a substrate entity.
|
|
705
|
-
* @param {Entities.DispersionOutputConfig} dispersionOutputConfig - a dispersion output config entity.
|
|
706
|
-
* @param {Entities.ExplosionOutputConfig[]} explosionOutputConfigs - an array of explosion output configs.
|
|
707
|
-
* @param {number} explosionOutputConfigCount - Number of explosion output configs.
|
|
708
|
-
* @param {Entities.ExplosionParameters} explosionParameters - Explosion parameters.
|
|
709
|
-
* @param {Entities.ExplosionConfinedVolume[]} explosionConfinedVolumes - an array of explosion confined volumes.
|
|
710
|
-
* @param {number} explosionConfinedVolumeCount - Number of explosion confined volumes.
|
|
711
|
-
* @param {Entities.DispersionParameters} dispersionParameters - a dispersion parameters entity.
|
|
712
630
|
*/
|
|
713
|
-
constructor(
|
|
631
|
+
constructor(data: {
|
|
714
632
|
material: Entities.Material,
|
|
715
633
|
scalarUdmOutputs: Entities.ScalarUdmOutputs,
|
|
716
634
|
weather: Entities.Weather,
|
|
@@ -724,40 +642,41 @@ export class LateExplosionToOPLevelsCalculation extends CalculationBase {
|
|
|
724
642
|
explosionConfinedVolumes: Entities.ExplosionConfinedVolume[],
|
|
725
643
|
explosionConfinedVolumeCount: number,
|
|
726
644
|
dispersionParameters: Entities.DispersionParameters
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
this.
|
|
731
|
-
this.
|
|
732
|
-
this.
|
|
733
|
-
this.
|
|
734
|
-
this.
|
|
735
|
-
this.
|
|
736
|
-
this.
|
|
737
|
-
this.
|
|
738
|
-
this.
|
|
739
|
-
this.
|
|
740
|
-
this.
|
|
741
|
-
this.
|
|
645
|
+
controller?: AbortController;
|
|
646
|
+
}) {
|
|
647
|
+
super(data.controller);
|
|
648
|
+
this.material = data.material;
|
|
649
|
+
this.scalarUdmOutputs = data.scalarUdmOutputs;
|
|
650
|
+
this.weather = data.weather;
|
|
651
|
+
this.dispersionRecords = data.dispersionRecords;
|
|
652
|
+
this.dispersionRecordCount = data.dispersionRecordCount;
|
|
653
|
+
this.substrate = data.substrate;
|
|
654
|
+
this.dispersionOutputConfig = data.dispersionOutputConfig;
|
|
655
|
+
this.explosionOutputConfigs = data.explosionOutputConfigs;
|
|
656
|
+
this.explosionOutputConfigCount = data.explosionOutputConfigCount;
|
|
657
|
+
this.explosionParameters = data.explosionParameters;
|
|
658
|
+
this.explosionConfinedVolumes = data.explosionConfinedVolumes;
|
|
659
|
+
this.explosionConfinedVolumeCount = data.explosionConfinedVolumeCount;
|
|
660
|
+
this.dispersionParameters = data.dispersionParameters;
|
|
742
661
|
}
|
|
743
662
|
|
|
744
663
|
async run() {
|
|
745
664
|
try {
|
|
746
|
-
const request = new LateExplosionToOPLevelsCalculationRequest(
|
|
747
|
-
this.material,
|
|
748
|
-
this.scalarUdmOutputs,
|
|
749
|
-
this.weather,
|
|
750
|
-
this.dispersionRecords,
|
|
751
|
-
this.dispersionRecordCount,
|
|
752
|
-
this.substrate,
|
|
753
|
-
this.dispersionOutputConfig,
|
|
754
|
-
this.explosionOutputConfigs,
|
|
755
|
-
this.explosionOutputConfigCount,
|
|
756
|
-
this.explosionParameters,
|
|
757
|
-
this.explosionConfinedVolumes,
|
|
758
|
-
this.explosionConfinedVolumeCount,
|
|
759
|
-
this.dispersionParameters
|
|
760
|
-
);
|
|
665
|
+
const request = new LateExplosionToOPLevelsCalculationRequest({
|
|
666
|
+
material: this.material,
|
|
667
|
+
scalarUdmOutputs: this.scalarUdmOutputs,
|
|
668
|
+
weather: this.weather,
|
|
669
|
+
dispersionRecords: this.dispersionRecords,
|
|
670
|
+
dispersionRecordCount: this.dispersionRecordCount,
|
|
671
|
+
substrate: this.substrate,
|
|
672
|
+
dispersionOutputConfig: this.dispersionOutputConfig,
|
|
673
|
+
explosionOutputConfigs: this.explosionOutputConfigs,
|
|
674
|
+
explosionOutputConfigCount: this.explosionOutputConfigCount,
|
|
675
|
+
explosionParameters: this.explosionParameters,
|
|
676
|
+
explosionConfinedVolumes: this.explosionConfinedVolumes,
|
|
677
|
+
explosionConfinedVolumeCount: this.explosionConfinedVolumeCount,
|
|
678
|
+
dispersionParameters: this.dispersionParameters
|
|
679
|
+
});
|
|
761
680
|
|
|
762
681
|
const schema = new LateExplosionToOPLevelsCalculationRequestSchema();
|
|
763
682
|
const validatedRequest = schema.validate(request);
|
|
@@ -829,24 +748,22 @@ export class LateExplosionToOPLevelsCalculationResponse extends CalculationRespo
|
|
|
829
748
|
/**
|
|
830
749
|
* LateExplosionToOPLevels calculation response class.
|
|
831
750
|
*
|
|
832
|
-
* @param {Entities.ExplosionOverpressureResult[]} explosionUnifConfOverpressureResults - an array of uniform confined explosion overpressure results.
|
|
833
|
-
* @param {Entities.ExplosionOverpressureResult[]} explosionUnconfOverpressureResults - an array of unconfined explosion overpressure results.
|
|
834
751
|
*/
|
|
835
|
-
constructor(
|
|
752
|
+
constructor(data: {
|
|
836
753
|
explosionUnifConfOverpressureResults: Entities.ExplosionOverpressureResult[],
|
|
837
754
|
explosionUnconfOverpressureResults: Entities.ExplosionOverpressureResult[],
|
|
838
755
|
resultCode: Enums.ResultCode,
|
|
839
756
|
messages: string[],
|
|
840
757
|
calculationElapsedTime: number,
|
|
841
758
|
operationId: string
|
|
842
|
-
) {
|
|
759
|
+
}) {
|
|
843
760
|
super();
|
|
844
|
-
this.explosionUnifConfOverpressureResults = explosionUnifConfOverpressureResults;
|
|
845
|
-
this.explosionUnconfOverpressureResults = explosionUnconfOverpressureResults;
|
|
846
|
-
this.resultCode = resultCode;
|
|
847
|
-
this.messages = messages;
|
|
848
|
-
this.calculationElapsedTime = calculationElapsedTime;
|
|
849
|
-
this.operationId = operationId;
|
|
761
|
+
this.explosionUnifConfOverpressureResults = data.explosionUnifConfOverpressureResults;
|
|
762
|
+
this.explosionUnconfOverpressureResults = data.explosionUnconfOverpressureResults;
|
|
763
|
+
this.resultCode = data.resultCode;
|
|
764
|
+
this.messages = data.messages;
|
|
765
|
+
this.calculationElapsedTime = data.calculationElapsedTime;
|
|
766
|
+
this.operationId = data.operationId;
|
|
850
767
|
}
|
|
851
768
|
|
|
852
769
|
initialiseFromDictionary(data: { [key: string]: unknown }) {
|
|
@@ -925,13 +842,6 @@ export class LateExplosionToOPLevelsCalculationResponseSchema {
|
|
|
925
842
|
}
|
|
926
843
|
|
|
927
844
|
makeCalculationResponse(data: LateExplosionToOPLevelsCalculationResponseSchemaData): LateExplosionToOPLevelsCalculationResponse {
|
|
928
|
-
return new LateExplosionToOPLevelsCalculationResponse(
|
|
929
|
-
data.explosionUnifConfOverpressureResults,
|
|
930
|
-
data.explosionUnconfOverpressureResults,
|
|
931
|
-
data.resultCode,
|
|
932
|
-
data.messages,
|
|
933
|
-
data.calculationElapsedTime,
|
|
934
|
-
data.operationId
|
|
935
|
-
);
|
|
845
|
+
return new LateExplosionToOPLevelsCalculationResponse(data);
|
|
936
846
|
}
|
|
937
847
|
}
|