@dnv-plant/typescriptpws 1.0.16 → 1.0.18-alpha.1805813
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 +3 -3
- package/package.json +2 -2
- package/src/calculations.ts +364 -2344
- package/src/constants.ts +2 -2
- package/src/entities.ts +976 -649
- package/src/entity-schemas.ts +232 -671
- package/src/enums.ts +2 -2
- package/src/materials.ts +53 -154
- package/src/utilities.ts +11 -32
package/src/calculations.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/***********************************************************************
|
|
2
2
|
* This file has been auto-generated by a code generation tool.
|
|
3
|
-
* Version: 1.0.
|
|
4
|
-
* Date/time:
|
|
3
|
+
* Version: 1.0.18
|
|
4
|
+
* Date/time: 18 Feb 2025 14:37:50
|
|
5
5
|
* Template: templates/typescriptpws/calculations.razor.
|
|
6
6
|
***********************************************************************/
|
|
7
7
|
|
|
@@ -1225,7 +1225,7 @@ export class DispersionCalculationResponse extends CalculationResponseBase {
|
|
|
1225
1225
|
initialiseFromDictionary(data: { [key: string]: unknown }) {
|
|
1226
1226
|
if (data.scalarUdmOutputs) {
|
|
1227
1227
|
this.scalarUdmOutputs = new Entities.ScalarUdmOutputs();
|
|
1228
|
-
this.scalarUdmOutputs.initialiseFromDictionary(data.scalarUdmOutputs);
|
|
1228
|
+
this.scalarUdmOutputs.initialiseFromDictionary(data.scalarUdmOutputs as { [key: string]: unknown });
|
|
1229
1229
|
}
|
|
1230
1230
|
if (data.dispersionRecords && Array.isArray(data.dispersionRecords)) {
|
|
1231
1231
|
this.dispersionRecords = data.dispersionRecords.map(
|
|
@@ -3621,7 +3621,7 @@ export class FireballCalculationResponse extends CalculationResponseBase {
|
|
|
3621
3621
|
initialiseFromDictionary(data: { [key: string]: unknown }) {
|
|
3622
3622
|
if (data.flameResult) {
|
|
3623
3623
|
this.flameResult = new Entities.FlameResult();
|
|
3624
|
-
this.flameResult.initialiseFromDictionary(data.flameResult);
|
|
3624
|
+
this.flameResult.initialiseFromDictionary(data.flameResult as { [key: string]: unknown });
|
|
3625
3625
|
}
|
|
3626
3626
|
if (data.flameRecords && Array.isArray(data.flameRecords)) {
|
|
3627
3627
|
this.flameRecords = data.flameRecords.map(
|
|
@@ -3868,7 +3868,7 @@ export class FlashCalculationResponse extends CalculationResponseBase {
|
|
|
3868
3868
|
initialiseFromDictionary(data: { [key: string]: unknown }) {
|
|
3869
3869
|
if (data.flashResult) {
|
|
3870
3870
|
this.flashResult = new Entities.FlashResult();
|
|
3871
|
-
this.flashResult.initialiseFromDictionary(data.flashResult);
|
|
3871
|
+
this.flashResult.initialiseFromDictionary(data.flashResult as { [key: string]: unknown });
|
|
3872
3872
|
}
|
|
3873
3873
|
if (data.resultCode !== undefined && (typeof data.resultCode === "string" || typeof data.resultCode === "number")) {
|
|
3874
3874
|
this.resultCode = data.resultCode as Enums.ResultCode;
|
|
@@ -4399,7 +4399,7 @@ export class JetFireCalculationResponse extends CalculationResponseBase {
|
|
|
4399
4399
|
initialiseFromDictionary(data: { [key: string]: unknown }) {
|
|
4400
4400
|
if (data.flameResult) {
|
|
4401
4401
|
this.flameResult = new Entities.FlameResult();
|
|
4402
|
-
this.flameResult.initialiseFromDictionary(data.flameResult);
|
|
4402
|
+
this.flameResult.initialiseFromDictionary(data.flameResult as { [key: string]: unknown });
|
|
4403
4403
|
}
|
|
4404
4404
|
if (data.flameRecords && Array.isArray(data.flameRecords)) {
|
|
4405
4405
|
this.flameRecords = data.flameRecords.map(
|
|
@@ -4782,11 +4782,11 @@ export class LateExplosionCalculationResponse extends CalculationResponseBase {
|
|
|
4782
4782
|
initialiseFromDictionary(data: { [key: string]: unknown }) {
|
|
4783
4783
|
if (data.explosionUnifConfOverpressureResult) {
|
|
4784
4784
|
this.explosionUnifConfOverpressureResult = new Entities.ExplosionOverpressureResult();
|
|
4785
|
-
this.explosionUnifConfOverpressureResult.initialiseFromDictionary(data.explosionUnifConfOverpressureResult);
|
|
4785
|
+
this.explosionUnifConfOverpressureResult.initialiseFromDictionary(data.explosionUnifConfOverpressureResult as { [key: string]: unknown });
|
|
4786
4786
|
}
|
|
4787
4787
|
if (data.explosionUnconfOverpressureResult) {
|
|
4788
4788
|
this.explosionUnconfOverpressureResult = new Entities.ExplosionOverpressureResult();
|
|
4789
|
-
this.explosionUnconfOverpressureResult.initialiseFromDictionary(data.explosionUnconfOverpressureResult);
|
|
4789
|
+
this.explosionUnconfOverpressureResult.initialiseFromDictionary(data.explosionUnconfOverpressureResult as { [key: string]: unknown });
|
|
4790
4790
|
}
|
|
4791
4791
|
if (data.resultCode !== undefined && (typeof data.resultCode === "string" || typeof data.resultCode === "number")) {
|
|
4792
4792
|
this.resultCode = data.resultCode as Enums.ResultCode;
|
|
@@ -5827,11 +5827,11 @@ export class LoadMassInventoryVesselForLeakScenarioCalculationResponse extends C
|
|
|
5827
5827
|
initialiseFromDictionary(data: { [key: string]: unknown }) {
|
|
5828
5828
|
if (data.vessel) {
|
|
5829
5829
|
this.vessel = new Entities.Vessel();
|
|
5830
|
-
this.vessel.initialiseFromDictionary(data.vessel);
|
|
5830
|
+
this.vessel.initialiseFromDictionary(data.vessel as { [key: string]: unknown });
|
|
5831
5831
|
}
|
|
5832
5832
|
if (data.leak) {
|
|
5833
5833
|
this.leak = new Entities.Leak();
|
|
5834
|
-
this.leak.initialiseFromDictionary(data.leak);
|
|
5834
|
+
this.leak.initialiseFromDictionary(data.leak as { [key: string]: unknown });
|
|
5835
5835
|
}
|
|
5836
5836
|
if (data.resultCode !== undefined && (typeof data.resultCode === "string" || typeof data.resultCode === "number")) {
|
|
5837
5837
|
this.resultCode = data.resultCode as Enums.ResultCode;
|
|
@@ -6153,11 +6153,11 @@ export class LoadMassInventoryVesselForLineRuptureScenarioCalculationResponse ex
|
|
|
6153
6153
|
initialiseFromDictionary(data: { [key: string]: unknown }) {
|
|
6154
6154
|
if (data.vessel) {
|
|
6155
6155
|
this.vessel = new Entities.Vessel();
|
|
6156
|
-
this.vessel.initialiseFromDictionary(data.vessel);
|
|
6156
|
+
this.vessel.initialiseFromDictionary(data.vessel as { [key: string]: unknown });
|
|
6157
6157
|
}
|
|
6158
6158
|
if (data.lineRupture) {
|
|
6159
6159
|
this.lineRupture = new Entities.LineRupture();
|
|
6160
|
-
this.lineRupture.initialiseFromDictionary(data.lineRupture);
|
|
6160
|
+
this.lineRupture.initialiseFromDictionary(data.lineRupture as { [key: string]: unknown });
|
|
6161
6161
|
}
|
|
6162
6162
|
if (data.resultCode !== undefined && (typeof data.resultCode === "string" || typeof data.resultCode === "number")) {
|
|
6163
6163
|
this.resultCode = data.resultCode as Enums.ResultCode;
|
|
@@ -6492,11 +6492,11 @@ export class LoadMassInventoryVesselForReliefValveScenarioCalculationResponse ex
|
|
|
6492
6492
|
initialiseFromDictionary(data: { [key: string]: unknown }) {
|
|
6493
6493
|
if (data.vessel) {
|
|
6494
6494
|
this.vessel = new Entities.Vessel();
|
|
6495
|
-
this.vessel.initialiseFromDictionary(data.vessel);
|
|
6495
|
+
this.vessel.initialiseFromDictionary(data.vessel as { [key: string]: unknown });
|
|
6496
6496
|
}
|
|
6497
6497
|
if (data.reliefValve) {
|
|
6498
6498
|
this.reliefValve = new Entities.ReliefValve();
|
|
6499
|
-
this.reliefValve.initialiseFromDictionary(data.reliefValve);
|
|
6499
|
+
this.reliefValve.initialiseFromDictionary(data.reliefValve as { [key: string]: unknown });
|
|
6500
6500
|
}
|
|
6501
6501
|
if (data.resultCode !== undefined && (typeof data.resultCode === "string" || typeof data.resultCode === "number")) {
|
|
6502
6502
|
this.resultCode = data.resultCode as Enums.ResultCode;
|
|
@@ -6768,11 +6768,11 @@ export class LongPipeBreachCalculationResponse extends CalculationResponseBase {
|
|
|
6768
6768
|
initialiseFromDictionary(data: { [key: string]: unknown }) {
|
|
6769
6769
|
if (data.exitMaterial) {
|
|
6770
6770
|
this.exitMaterial = new Entities.Material();
|
|
6771
|
-
this.exitMaterial.initialiseFromDictionary(data.exitMaterial);
|
|
6771
|
+
this.exitMaterial.initialiseFromDictionary(data.exitMaterial as { [key: string]: unknown });
|
|
6772
6772
|
}
|
|
6773
6773
|
if (data.dischargeResult) {
|
|
6774
6774
|
this.dischargeResult = new Entities.DischargeResult();
|
|
6775
|
-
this.dischargeResult.initialiseFromDictionary(data.dischargeResult);
|
|
6775
|
+
this.dischargeResult.initialiseFromDictionary(data.dischargeResult as { [key: string]: unknown });
|
|
6776
6776
|
}
|
|
6777
6777
|
if (data.dischargeRecords && Array.isArray(data.dischargeRecords)) {
|
|
6778
6778
|
this.dischargeRecords = data.dischargeRecords.map(
|
|
@@ -8003,7 +8003,7 @@ export class MixtureConstantPropertiesCalculationResponse extends CalculationRes
|
|
|
8003
8003
|
initialiseFromDictionary(data: { [key: string]: unknown }) {
|
|
8004
8004
|
if (data.mixConstantPropResult) {
|
|
8005
8005
|
this.mixConstantPropResult = new Entities.MixtureConstantPropertiesResult();
|
|
8006
|
-
this.mixConstantPropResult.initialiseFromDictionary(data.mixConstantPropResult);
|
|
8006
|
+
this.mixConstantPropResult.initialiseFromDictionary(data.mixConstantPropResult as { [key: string]: unknown });
|
|
8007
8007
|
}
|
|
8008
8008
|
if (data.resultCode !== undefined && (typeof data.resultCode === "string" || typeof data.resultCode === "number")) {
|
|
8009
8009
|
this.resultCode = data.resultCode as Enums.ResultCode;
|
|
@@ -8587,7 +8587,7 @@ export class PoolFireCalculationResponse extends CalculationResponseBase {
|
|
|
8587
8587
|
initialiseFromDictionary(data: { [key: string]: unknown }) {
|
|
8588
8588
|
if (data.poolFireFlameResult) {
|
|
8589
8589
|
this.poolFireFlameResult = new Entities.PoolFireFlameResult();
|
|
8590
|
-
this.poolFireFlameResult.initialiseFromDictionary(data.poolFireFlameResult);
|
|
8590
|
+
this.poolFireFlameResult.initialiseFromDictionary(data.poolFireFlameResult as { [key: string]: unknown });
|
|
8591
8591
|
}
|
|
8592
8592
|
if (data.flameRecords && Array.isArray(data.flameRecords)) {
|
|
8593
8593
|
this.flameRecords = data.flameRecords.map(
|
|
@@ -11109,7 +11109,7 @@ export class SetMixingLayerHeightCalculationResponse extends CalculationResponse
|
|
|
11109
11109
|
initialiseFromDictionary(data: { [key: string]: unknown }) {
|
|
11110
11110
|
if (data.updatedWeather) {
|
|
11111
11111
|
this.updatedWeather = new Entities.Weather();
|
|
11112
|
-
this.updatedWeather.initialiseFromDictionary(data.updatedWeather);
|
|
11112
|
+
this.updatedWeather.initialiseFromDictionary(data.updatedWeather as { [key: string]: unknown });
|
|
11113
11113
|
}
|
|
11114
11114
|
if (data.resultCode !== undefined && (typeof data.resultCode === "string" || typeof data.resultCode === "number")) {
|
|
11115
11115
|
this.resultCode = data.resultCode as Enums.ResultCode;
|
|
@@ -12132,7 +12132,7 @@ export class SetReleaseElevationForScenarioCalculationResponse extends Calculati
|
|
|
12132
12132
|
initialiseFromDictionary(data: { [key: string]: unknown }) {
|
|
12133
12133
|
if (data.updatedVessel) {
|
|
12134
12134
|
this.updatedVessel = new Entities.Vessel();
|
|
12135
|
-
this.updatedVessel.initialiseFromDictionary(data.updatedVessel);
|
|
12135
|
+
this.updatedVessel.initialiseFromDictionary(data.updatedVessel as { [key: string]: unknown });
|
|
12136
12136
|
}
|
|
12137
12137
|
if (data.resultCode !== undefined && (typeof data.resultCode === "string" || typeof data.resultCode === "number")) {
|
|
12138
12138
|
this.resultCode = data.resultCode as Enums.ResultCode;
|
|
@@ -12738,7 +12738,7 @@ export class TankFireCalculationResponse extends CalculationResponseBase {
|
|
|
12738
12738
|
initialiseFromDictionary(data: { [key: string]: unknown }) {
|
|
12739
12739
|
if (data.poolFireFlameResult) {
|
|
12740
12740
|
this.poolFireFlameResult = new Entities.PoolFireFlameResult();
|
|
12741
|
-
this.poolFireFlameResult.initialiseFromDictionary(data.poolFireFlameResult);
|
|
12741
|
+
this.poolFireFlameResult.initialiseFromDictionary(data.poolFireFlameResult as { [key: string]: unknown });
|
|
12742
12742
|
}
|
|
12743
12743
|
if (data.flameRecords && Array.isArray(data.flameRecords)) {
|
|
12744
12744
|
this.flameRecords = data.flameRecords.map(
|
|
@@ -13579,11 +13579,11 @@ export class UserDefinedSourceLinkedRunCalculationResponse extends CalculationRe
|
|
|
13579
13579
|
}
|
|
13580
13580
|
if (data.jetFireFlameResult) {
|
|
13581
13581
|
this.jetFireFlameResult = new Entities.FlameResult();
|
|
13582
|
-
this.jetFireFlameResult.initialiseFromDictionary(data.jetFireFlameResult);
|
|
13582
|
+
this.jetFireFlameResult.initialiseFromDictionary(data.jetFireFlameResult as { [key: string]: unknown });
|
|
13583
13583
|
}
|
|
13584
13584
|
if (data.poolFireFlameResult) {
|
|
13585
13585
|
this.poolFireFlameResult = new Entities.PoolFireFlameResult();
|
|
13586
|
-
this.poolFireFlameResult.initialiseFromDictionary(data.poolFireFlameResult);
|
|
13586
|
+
this.poolFireFlameResult.initialiseFromDictionary(data.poolFireFlameResult as { [key: string]: unknown });
|
|
13587
13587
|
}
|
|
13588
13588
|
if (data.resultCode !== undefined && (typeof data.resultCode === "string" || typeof data.resultCode === "number")) {
|
|
13589
13589
|
this.resultCode = data.resultCode as Enums.ResultCode;
|
|
@@ -13915,11 +13915,11 @@ export class VesselCatastrophicRuptureCalculationResponse extends CalculationRes
|
|
|
13915
13915
|
initialiseFromDictionary(data: { [key: string]: unknown }) {
|
|
13916
13916
|
if (data.exitMaterial) {
|
|
13917
13917
|
this.exitMaterial = new Entities.Material();
|
|
13918
|
-
this.exitMaterial.initialiseFromDictionary(data.exitMaterial);
|
|
13918
|
+
this.exitMaterial.initialiseFromDictionary(data.exitMaterial as { [key: string]: unknown });
|
|
13919
13919
|
}
|
|
13920
13920
|
if (data.dischargeResult) {
|
|
13921
13921
|
this.dischargeResult = new Entities.DischargeResult();
|
|
13922
|
-
this.dischargeResult.initialiseFromDictionary(data.dischargeResult);
|
|
13922
|
+
this.dischargeResult.initialiseFromDictionary(data.dischargeResult as { [key: string]: unknown });
|
|
13923
13923
|
}
|
|
13924
13924
|
if (data.dischargeRecords && Array.isArray(data.dischargeRecords)) {
|
|
13925
13925
|
this.dischargeRecords = data.dischargeRecords.map(
|
|
@@ -14201,11 +14201,11 @@ export class VesselLeakCalculationResponse extends CalculationResponseBase {
|
|
|
14201
14201
|
initialiseFromDictionary(data: { [key: string]: unknown }) {
|
|
14202
14202
|
if (data.exitMaterial) {
|
|
14203
14203
|
this.exitMaterial = new Entities.Material();
|
|
14204
|
-
this.exitMaterial.initialiseFromDictionary(data.exitMaterial);
|
|
14204
|
+
this.exitMaterial.initialiseFromDictionary(data.exitMaterial as { [key: string]: unknown });
|
|
14205
14205
|
}
|
|
14206
14206
|
if (data.dischargeResult) {
|
|
14207
14207
|
this.dischargeResult = new Entities.DischargeResult();
|
|
14208
|
-
this.dischargeResult.initialiseFromDictionary(data.dischargeResult);
|
|
14208
|
+
this.dischargeResult.initialiseFromDictionary(data.dischargeResult as { [key: string]: unknown });
|
|
14209
14209
|
}
|
|
14210
14210
|
if (data.dischargeRecords && Array.isArray(data.dischargeRecords)) {
|
|
14211
14211
|
this.dischargeRecords = data.dischargeRecords.map(
|
|
@@ -14288,18 +14288,21 @@ export class VesselLeakCalculationResponseSchema {
|
|
|
14288
14288
|
}
|
|
14289
14289
|
}
|
|
14290
14290
|
|
|
14291
|
-
export interface
|
|
14291
|
+
export interface VesselLeakLinkedRunCalculationRequestSchemaData {
|
|
14292
14292
|
vessel: Entities.Vessel;
|
|
14293
14293
|
leak: Entities.Leak;
|
|
14294
14294
|
dischargeParameters: Entities.DischargeParameters;
|
|
14295
14295
|
substrate: Entities.Substrate;
|
|
14296
14296
|
weather: Entities.Weather;
|
|
14297
|
-
dispersionParameters: Entities.DispersionParameters;
|
|
14297
|
+
dispersionParameters: Entities.DispersionParameters[];
|
|
14298
|
+
dispersionParameterCount: number;
|
|
14298
14299
|
endPointConcentration: number;
|
|
14299
14300
|
flammableParameters: Entities.FlammableParameters;
|
|
14300
14301
|
explosionParameters: Entities.ExplosionParameters;
|
|
14301
|
-
|
|
14302
|
-
|
|
14302
|
+
dispersionFlamOutputConfigs: Entities.DispersionOutputConfig[];
|
|
14303
|
+
dispersionFlamOutputConfigCount: number;
|
|
14304
|
+
dispersionToxicOutputConfigs: Entities.DispersionOutputConfig[];
|
|
14305
|
+
dispersionToxicOutputConfigCount: number;
|
|
14303
14306
|
flammableOutputConfigs: Entities.FlammableOutputConfig[];
|
|
14304
14307
|
flammableOutputConfigCount: number;
|
|
14305
14308
|
explosionOutputConfigs: Entities.ExplosionOutputConfig[];
|
|
@@ -14308,18 +14311,21 @@ export interface VesselLeakFlammableLinkedRunCalculationRequestSchemaData {
|
|
|
14308
14311
|
explosionConfinedVolumeCount: number;
|
|
14309
14312
|
}
|
|
14310
14313
|
|
|
14311
|
-
class
|
|
14314
|
+
class VesselLeakLinkedRunCalculationRequest extends CalculationRequestBase {
|
|
14312
14315
|
vessel: Entities.Vessel;
|
|
14313
14316
|
leak: Entities.Leak;
|
|
14314
14317
|
dischargeParameters: Entities.DischargeParameters;
|
|
14315
14318
|
substrate: Entities.Substrate;
|
|
14316
14319
|
weather: Entities.Weather;
|
|
14317
|
-
dispersionParameters: Entities.DispersionParameters;
|
|
14320
|
+
dispersionParameters: Entities.DispersionParameters[];
|
|
14321
|
+
dispersionParameterCount: number;
|
|
14318
14322
|
endPointConcentration: number;
|
|
14319
14323
|
flammableParameters: Entities.FlammableParameters;
|
|
14320
14324
|
explosionParameters: Entities.ExplosionParameters;
|
|
14321
|
-
|
|
14322
|
-
|
|
14325
|
+
dispersionFlamOutputConfigs: Entities.DispersionOutputConfig[];
|
|
14326
|
+
dispersionFlamOutputConfigCount: number;
|
|
14327
|
+
dispersionToxicOutputConfigs: Entities.DispersionOutputConfig[];
|
|
14328
|
+
dispersionToxicOutputConfigCount: number;
|
|
14323
14329
|
flammableOutputConfigs: Entities.FlammableOutputConfig[];
|
|
14324
14330
|
flammableOutputConfigCount: number;
|
|
14325
14331
|
explosionOutputConfigs: Entities.ExplosionOutputConfig[];
|
|
@@ -14328,23 +14334,26 @@ class VesselLeakFlammableLinkedRunCalculationRequest extends CalculationRequestB
|
|
|
14328
14334
|
explosionConfinedVolumeCount: number;
|
|
14329
14335
|
|
|
14330
14336
|
/**
|
|
14331
|
-
*
|
|
14337
|
+
* VesselLeakLinkedRun calculation request class.
|
|
14332
14338
|
*
|
|
14333
14339
|
* @param {Entities.Vessel} vessel - A Vessel entity.
|
|
14334
14340
|
* @param {Entities.Leak} leak - A Leak entity.
|
|
14335
14341
|
* @param {Entities.DischargeParameters} dischargeParameters - A Discharge Parameters entity.
|
|
14336
14342
|
* @param {Entities.Substrate} substrate - A Substrate entity.
|
|
14337
14343
|
* @param {Entities.Weather} weather - A Weather entity.
|
|
14338
|
-
* @param {Entities.DispersionParameters} dispersionParameters -
|
|
14344
|
+
* @param {Entities.DispersionParameters[]} dispersionParameters - An array of Dispersion Parameters.
|
|
14345
|
+
* @param {number} dispersionParameterCount - Number of Dispersion Parameters.
|
|
14339
14346
|
* @param {number} endPointConcentration - Concentration at which the dispersion calculations will terminate (v/v fraction).
|
|
14340
14347
|
* @param {Entities.FlammableParameters} flammableParameters - A Flammable Parameters entity.
|
|
14341
14348
|
* @param {Entities.ExplosionParameters} explosionParameters - An Explosion Parameters entity.
|
|
14342
|
-
* @param {Entities.DispersionOutputConfig[]}
|
|
14343
|
-
* @param {number}
|
|
14349
|
+
* @param {Entities.DispersionOutputConfig[]} dispersionFlamOutputConfigs - An array of Dispersion Output Configs for flammable concentrations of interest.
|
|
14350
|
+
* @param {number} dispersionFlamOutputConfigCount - Number of Dispersion Output Configs for flammable concentrations of interest.
|
|
14351
|
+
* @param {Entities.DispersionOutputConfig[]} dispersionToxicOutputConfigs - An array of Dispersion Output Configs for toxic concentrations of interest.
|
|
14352
|
+
* @param {number} dispersionToxicOutputConfigCount - Number of Dispersion Output Configs for toxic concentrations of interest.
|
|
14344
14353
|
* @param {Entities.FlammableOutputConfig[]} flammableOutputConfigs - An array of Flammable Output Configs for radiation levels of interest.
|
|
14345
|
-
* @param {number} flammableOutputConfigCount - Number of Flammable Ouput Configs.
|
|
14354
|
+
* @param {number} flammableOutputConfigCount - Number of Flammable Ouput Configs for radiation levels of interest.
|
|
14346
14355
|
* @param {Entities.ExplosionOutputConfig[]} explosionOutputConfigs - An array of Explosion Output Configs for overpressure levels of interest.
|
|
14347
|
-
* @param {number} explosionOutputConfigCount - Number of Explosion Output Configs.
|
|
14356
|
+
* @param {number} explosionOutputConfigCount - Number of Explosion Output Configs for overpressure levels of interest.
|
|
14348
14357
|
* @param {Entities.ExplosionConfinedVolume[]} explosionConfinedVolumes - An array of Explosion Confined Volumes.
|
|
14349
14358
|
* @param {number} explosionConfinedVolumeCount - Number of Explosion Confined Volumes.
|
|
14350
14359
|
*/
|
|
@@ -14354,12 +14363,15 @@ class VesselLeakFlammableLinkedRunCalculationRequest extends CalculationRequestB
|
|
|
14354
14363
|
dischargeParameters: Entities.DischargeParameters,
|
|
14355
14364
|
substrate: Entities.Substrate,
|
|
14356
14365
|
weather: Entities.Weather,
|
|
14357
|
-
dispersionParameters: Entities.DispersionParameters,
|
|
14366
|
+
dispersionParameters: Entities.DispersionParameters[],
|
|
14367
|
+
dispersionParameterCount: number,
|
|
14358
14368
|
endPointConcentration: number,
|
|
14359
14369
|
flammableParameters: Entities.FlammableParameters,
|
|
14360
14370
|
explosionParameters: Entities.ExplosionParameters,
|
|
14361
|
-
|
|
14362
|
-
|
|
14371
|
+
dispersionFlamOutputConfigs: Entities.DispersionOutputConfig[],
|
|
14372
|
+
dispersionFlamOutputConfigCount: number,
|
|
14373
|
+
dispersionToxicOutputConfigs: Entities.DispersionOutputConfig[],
|
|
14374
|
+
dispersionToxicOutputConfigCount: number,
|
|
14363
14375
|
flammableOutputConfigs: Entities.FlammableOutputConfig[],
|
|
14364
14376
|
flammableOutputConfigCount: number,
|
|
14365
14377
|
explosionOutputConfigs: Entities.ExplosionOutputConfig[],
|
|
@@ -14374,11 +14386,14 @@ class VesselLeakFlammableLinkedRunCalculationRequest extends CalculationRequestB
|
|
|
14374
14386
|
this.substrate = substrate;
|
|
14375
14387
|
this.weather = weather;
|
|
14376
14388
|
this.dispersionParameters = dispersionParameters;
|
|
14389
|
+
this.dispersionParameterCount = dispersionParameterCount;
|
|
14377
14390
|
this.endPointConcentration = endPointConcentration;
|
|
14378
14391
|
this.flammableParameters = flammableParameters;
|
|
14379
14392
|
this.explosionParameters = explosionParameters;
|
|
14380
|
-
this.
|
|
14381
|
-
this.
|
|
14393
|
+
this.dispersionFlamOutputConfigs = dispersionFlamOutputConfigs;
|
|
14394
|
+
this.dispersionFlamOutputConfigCount = dispersionFlamOutputConfigCount;
|
|
14395
|
+
this.dispersionToxicOutputConfigs = dispersionToxicOutputConfigs;
|
|
14396
|
+
this.dispersionToxicOutputConfigCount = dispersionToxicOutputConfigCount;
|
|
14382
14397
|
this.flammableOutputConfigs = flammableOutputConfigs;
|
|
14383
14398
|
this.flammableOutputConfigCount = flammableOutputConfigCount;
|
|
14384
14399
|
this.explosionOutputConfigs = explosionOutputConfigs;
|
|
@@ -14388,12 +14403,12 @@ class VesselLeakFlammableLinkedRunCalculationRequest extends CalculationRequestB
|
|
|
14388
14403
|
}
|
|
14389
14404
|
}
|
|
14390
14405
|
|
|
14391
|
-
export class
|
|
14406
|
+
export class VesselLeakLinkedRunCalculationRequestSchema {
|
|
14392
14407
|
schema: Joi.ObjectSchema;
|
|
14393
14408
|
propertyTypes: Record<string, string>;
|
|
14394
14409
|
|
|
14395
14410
|
/**
|
|
14396
|
-
* Schema for the
|
|
14411
|
+
* Schema for the VesselLeakLinkedRun calculation request.
|
|
14397
14412
|
*/
|
|
14398
14413
|
constructor() {
|
|
14399
14414
|
this.schema = Joi.object({
|
|
@@ -14402,12 +14417,15 @@ export class VesselLeakFlammableLinkedRunCalculationRequestSchema {
|
|
|
14402
14417
|
dischargeParameters: new EntitySchemas.DischargeParametersSchema().schema,
|
|
14403
14418
|
substrate: new EntitySchemas.SubstrateSchema().schema,
|
|
14404
14419
|
weather: new EntitySchemas.WeatherSchema().schema,
|
|
14405
|
-
dispersionParameters: new EntitySchemas.DispersionParametersSchema().schema,
|
|
14420
|
+
dispersionParameters: Joi.array().items(new EntitySchemas.DispersionParametersSchema().schema).allow(null),
|
|
14421
|
+
dispersionParameterCount: Joi.number().integer(),
|
|
14406
14422
|
endPointConcentration: Joi.number().unsafe(),
|
|
14407
14423
|
flammableParameters: new EntitySchemas.FlammableParametersSchema().schema,
|
|
14408
14424
|
explosionParameters: new EntitySchemas.ExplosionParametersSchema().schema,
|
|
14409
|
-
|
|
14410
|
-
|
|
14425
|
+
dispersionFlamOutputConfigs: Joi.array().items(new EntitySchemas.DispersionOutputConfigSchema().schema).allow(null),
|
|
14426
|
+
dispersionFlamOutputConfigCount: Joi.number().integer(),
|
|
14427
|
+
dispersionToxicOutputConfigs: Joi.array().items(new EntitySchemas.DispersionOutputConfigSchema().schema).allow(null),
|
|
14428
|
+
dispersionToxicOutputConfigCount: Joi.number().integer(),
|
|
14411
14429
|
flammableOutputConfigs: Joi.array().items(new EntitySchemas.FlammableOutputConfigSchema().schema).allow(null),
|
|
14412
14430
|
flammableOutputConfigCount: Joi.number().integer(),
|
|
14413
14431
|
explosionOutputConfigs: Joi.array().items(new EntitySchemas.ExplosionOutputConfigSchema().schema).allow(null),
|
|
@@ -14422,12 +14440,15 @@ export class VesselLeakFlammableLinkedRunCalculationRequestSchema {
|
|
|
14422
14440
|
dischargeParameters: "Entities.DischargeParameters",
|
|
14423
14441
|
substrate: "Entities.Substrate",
|
|
14424
14442
|
weather: "Entities.Weather",
|
|
14425
|
-
dispersionParameters: "Entities.DispersionParameters",
|
|
14443
|
+
dispersionParameters: "Entities.DispersionParameters[]",
|
|
14444
|
+
dispersionParameterCount: "number",
|
|
14426
14445
|
endPointConcentration: "number",
|
|
14427
14446
|
flammableParameters: "Entities.FlammableParameters",
|
|
14428
14447
|
explosionParameters: "Entities.ExplosionParameters",
|
|
14429
|
-
|
|
14430
|
-
|
|
14448
|
+
dispersionFlamOutputConfigs: "Entities.DispersionOutputConfig[]",
|
|
14449
|
+
dispersionFlamOutputConfigCount: "number",
|
|
14450
|
+
dispersionToxicOutputConfigs: "Entities.DispersionOutputConfig[]",
|
|
14451
|
+
dispersionToxicOutputConfigCount: "number",
|
|
14431
14452
|
flammableOutputConfigs: "Entities.FlammableOutputConfig[]",
|
|
14432
14453
|
flammableOutputConfigCount: "number",
|
|
14433
14454
|
explosionOutputConfigs: "Entities.ExplosionOutputConfig[]",
|
|
@@ -14437,7 +14458,7 @@ export class VesselLeakFlammableLinkedRunCalculationRequestSchema {
|
|
|
14437
14458
|
};
|
|
14438
14459
|
}
|
|
14439
14460
|
|
|
14440
|
-
validate(data:
|
|
14461
|
+
validate(data: VesselLeakLinkedRunCalculationRequestSchemaData): VesselLeakLinkedRunCalculationRequest {
|
|
14441
14462
|
const { error, value } = this.schema.validate(data, { abortEarly: false });
|
|
14442
14463
|
if (error) {
|
|
14443
14464
|
throw new Error(`Validation error: ${error.details.map((x) => x.message).join(", ")}`);
|
|
@@ -14445,19 +14466,22 @@ export class VesselLeakFlammableLinkedRunCalculationRequestSchema {
|
|
|
14445
14466
|
return this.makeCalculationRequest(value);
|
|
14446
14467
|
}
|
|
14447
14468
|
|
|
14448
|
-
makeCalculationRequest(data:
|
|
14449
|
-
return new
|
|
14469
|
+
makeCalculationRequest(data: VesselLeakLinkedRunCalculationRequestSchemaData): VesselLeakLinkedRunCalculationRequest {
|
|
14470
|
+
return new VesselLeakLinkedRunCalculationRequest(
|
|
14450
14471
|
data.vessel,
|
|
14451
14472
|
data.leak,
|
|
14452
14473
|
data.dischargeParameters,
|
|
14453
14474
|
data.substrate,
|
|
14454
14475
|
data.weather,
|
|
14455
14476
|
data.dispersionParameters,
|
|
14477
|
+
data.dispersionParameterCount,
|
|
14456
14478
|
data.endPointConcentration,
|
|
14457
14479
|
data.flammableParameters,
|
|
14458
14480
|
data.explosionParameters,
|
|
14459
|
-
data.
|
|
14460
|
-
data.
|
|
14481
|
+
data.dispersionFlamOutputConfigs,
|
|
14482
|
+
data.dispersionFlamOutputConfigCount,
|
|
14483
|
+
data.dispersionToxicOutputConfigs,
|
|
14484
|
+
data.dispersionToxicOutputConfigCount,
|
|
14461
14485
|
data.flammableOutputConfigs,
|
|
14462
14486
|
data.flammableOutputConfigCount,
|
|
14463
14487
|
data.explosionOutputConfigs,
|
|
@@ -14468,18 +14492,21 @@ export class VesselLeakFlammableLinkedRunCalculationRequestSchema {
|
|
|
14468
14492
|
}
|
|
14469
14493
|
}
|
|
14470
14494
|
|
|
14471
|
-
export class
|
|
14495
|
+
export class VesselLeakLinkedRunCalculation extends CalculationBase {
|
|
14472
14496
|
vessel: Entities.Vessel;
|
|
14473
14497
|
leak: Entities.Leak;
|
|
14474
14498
|
dischargeParameters: Entities.DischargeParameters;
|
|
14475
14499
|
substrate: Entities.Substrate;
|
|
14476
14500
|
weather: Entities.Weather;
|
|
14477
|
-
dispersionParameters: Entities.DispersionParameters;
|
|
14501
|
+
dispersionParameters: Entities.DispersionParameters[];
|
|
14502
|
+
dispersionParameterCount: number;
|
|
14478
14503
|
endPointConcentration: number;
|
|
14479
14504
|
flammableParameters: Entities.FlammableParameters;
|
|
14480
14505
|
explosionParameters: Entities.ExplosionParameters;
|
|
14481
|
-
|
|
14482
|
-
|
|
14506
|
+
dispersionFlamOutputConfigs: Entities.DispersionOutputConfig[];
|
|
14507
|
+
dispersionFlamOutputConfigCount: number;
|
|
14508
|
+
dispersionToxicOutputConfigs: Entities.DispersionOutputConfig[];
|
|
14509
|
+
dispersionToxicOutputConfigCount: number;
|
|
14483
14510
|
flammableOutputConfigs: Entities.FlammableOutputConfig[];
|
|
14484
14511
|
flammableOutputConfigCount: number;
|
|
14485
14512
|
explosionOutputConfigs: Entities.ExplosionOutputConfig[];
|
|
@@ -14487,43 +14514,49 @@ export class VesselLeakFlammableLinkedRunCalculation extends CalculationBase {
|
|
|
14487
14514
|
explosionConfinedVolumes: Entities.ExplosionConfinedVolume[];
|
|
14488
14515
|
explosionConfinedVolumeCount: number;
|
|
14489
14516
|
dischargeRecord?: Entities.DischargeRecord;
|
|
14490
|
-
exitMaterial?: Entities.Material;
|
|
14491
|
-
dischargeResult?: Entities.DischargeResult;
|
|
14492
14517
|
distancesToJetFireRadiation?: number[];
|
|
14493
14518
|
jetContourPoints?: Entities.LocalPosition[];
|
|
14494
14519
|
nJetContourPoints?: number[];
|
|
14495
|
-
|
|
14496
|
-
|
|
14497
|
-
|
|
14498
|
-
|
|
14499
|
-
|
|
14500
|
-
|
|
14520
|
+
areaContourJet?: number[];
|
|
14521
|
+
distancesToFlamConcentration?: number[];
|
|
14522
|
+
flamConcentrationsUsed?: number[];
|
|
14523
|
+
flamConcContourPoints?: Entities.LocalPosition[];
|
|
14524
|
+
nFlamConcContourPoints?: number[];
|
|
14525
|
+
areaFootprintFlamConc?: number[];
|
|
14501
14526
|
distancesToPoolFireRadiation?: number[];
|
|
14502
14527
|
poolContourPoints?: Entities.LocalPosition[];
|
|
14503
14528
|
nPoolContourPoints?: number[];
|
|
14504
|
-
|
|
14529
|
+
areaContourPool?: number[];
|
|
14505
14530
|
explosionOverpressureResults?: Entities.ExplosionOverpressureResult[];
|
|
14531
|
+
distancesToToxicConcentration?: number[];
|
|
14532
|
+
toxicConcentrationUsed?: number[];
|
|
14533
|
+
toxicConcContourPoints?: Entities.LocalPosition[];
|
|
14534
|
+
nToxicConcContourPoints?: number[];
|
|
14535
|
+
areaFootprintToxicConc?: number[];
|
|
14506
14536
|
jetFireFlameResult?: Entities.FlameResult;
|
|
14507
14537
|
poolFireFlameResult?: Entities.PoolFireFlameResult;
|
|
14508
14538
|
|
|
14509
14539
|
/**
|
|
14510
|
-
* Calculates maximum distance to a number of concentration, radiation and overpressure levels given a vessel, leak and weather definition.
|
|
14540
|
+
* Calculates maximum distance to a number of concentration, radiation and overpressure levels for flammable and toxic materials, given a vessel, leak and weather definition.
|
|
14511
14541
|
*
|
|
14512
14542
|
* @param {Entities.Vessel} vessel - A Vessel entity.
|
|
14513
14543
|
* @param {Entities.Leak} leak - A Leak entity.
|
|
14514
14544
|
* @param {Entities.DischargeParameters} dischargeParameters - A Discharge Parameters entity.
|
|
14515
14545
|
* @param {Entities.Substrate} substrate - A Substrate entity.
|
|
14516
14546
|
* @param {Entities.Weather} weather - A Weather entity.
|
|
14517
|
-
* @param {Entities.DispersionParameters} dispersionParameters -
|
|
14547
|
+
* @param {Entities.DispersionParameters[]} dispersionParameters - An array of Dispersion Parameters.
|
|
14548
|
+
* @param {number} dispersionParameterCount - Number of Dispersion Parameters.
|
|
14518
14549
|
* @param {number} endPointConcentration - Concentration at which the dispersion calculations will terminate (v/v fraction).
|
|
14519
14550
|
* @param {Entities.FlammableParameters} flammableParameters - A Flammable Parameters entity.
|
|
14520
14551
|
* @param {Entities.ExplosionParameters} explosionParameters - An Explosion Parameters entity.
|
|
14521
|
-
* @param {Entities.DispersionOutputConfig[]}
|
|
14522
|
-
* @param {number}
|
|
14552
|
+
* @param {Entities.DispersionOutputConfig[]} dispersionFlamOutputConfigs - An array of Dispersion Output Configs for flammable concentrations of interest.
|
|
14553
|
+
* @param {number} dispersionFlamOutputConfigCount - Number of Dispersion Output Configs for flammable concentrations of interest.
|
|
14554
|
+
* @param {Entities.DispersionOutputConfig[]} dispersionToxicOutputConfigs - An array of Dispersion Output Configs for toxic concentrations of interest.
|
|
14555
|
+
* @param {number} dispersionToxicOutputConfigCount - Number of Dispersion Output Configs for toxic concentrations of interest.
|
|
14523
14556
|
* @param {Entities.FlammableOutputConfig[]} flammableOutputConfigs - An array of Flammable Output Configs for radiation levels of interest.
|
|
14524
|
-
* @param {number} flammableOutputConfigCount - Number of Flammable Ouput Configs.
|
|
14557
|
+
* @param {number} flammableOutputConfigCount - Number of Flammable Ouput Configs for radiation levels of interest.
|
|
14525
14558
|
* @param {Entities.ExplosionOutputConfig[]} explosionOutputConfigs - An array of Explosion Output Configs for overpressure levels of interest.
|
|
14526
|
-
* @param {number} explosionOutputConfigCount - Number of Explosion Output Configs.
|
|
14559
|
+
* @param {number} explosionOutputConfigCount - Number of Explosion Output Configs for overpressure levels of interest.
|
|
14527
14560
|
* @param {Entities.ExplosionConfinedVolume[]} explosionConfinedVolumes - An array of Explosion Confined Volumes.
|
|
14528
14561
|
* @param {number} explosionConfinedVolumeCount - Number of Explosion Confined Volumes.
|
|
14529
14562
|
*/
|
|
@@ -14533,12 +14566,15 @@ export class VesselLeakFlammableLinkedRunCalculation extends CalculationBase {
|
|
|
14533
14566
|
dischargeParameters: Entities.DischargeParameters,
|
|
14534
14567
|
substrate: Entities.Substrate,
|
|
14535
14568
|
weather: Entities.Weather,
|
|
14536
|
-
dispersionParameters: Entities.DispersionParameters,
|
|
14569
|
+
dispersionParameters: Entities.DispersionParameters[],
|
|
14570
|
+
dispersionParameterCount: number,
|
|
14537
14571
|
endPointConcentration: number,
|
|
14538
14572
|
flammableParameters: Entities.FlammableParameters,
|
|
14539
14573
|
explosionParameters: Entities.ExplosionParameters,
|
|
14540
|
-
|
|
14541
|
-
|
|
14574
|
+
dispersionFlamOutputConfigs: Entities.DispersionOutputConfig[],
|
|
14575
|
+
dispersionFlamOutputConfigCount: number,
|
|
14576
|
+
dispersionToxicOutputConfigs: Entities.DispersionOutputConfig[],
|
|
14577
|
+
dispersionToxicOutputConfigCount: number,
|
|
14542
14578
|
flammableOutputConfigs: Entities.FlammableOutputConfig[],
|
|
14543
14579
|
flammableOutputConfigCount: number,
|
|
14544
14580
|
explosionOutputConfigs: Entities.ExplosionOutputConfig[],
|
|
@@ -14553,11 +14589,14 @@ export class VesselLeakFlammableLinkedRunCalculation extends CalculationBase {
|
|
|
14553
14589
|
this.substrate = substrate;
|
|
14554
14590
|
this.weather = weather;
|
|
14555
14591
|
this.dispersionParameters = dispersionParameters;
|
|
14592
|
+
this.dispersionParameterCount = dispersionParameterCount;
|
|
14556
14593
|
this.endPointConcentration = endPointConcentration;
|
|
14557
14594
|
this.flammableParameters = flammableParameters;
|
|
14558
14595
|
this.explosionParameters = explosionParameters;
|
|
14559
|
-
this.
|
|
14560
|
-
this.
|
|
14596
|
+
this.dispersionFlamOutputConfigs = dispersionFlamOutputConfigs;
|
|
14597
|
+
this.dispersionFlamOutputConfigCount = dispersionFlamOutputConfigCount;
|
|
14598
|
+
this.dispersionToxicOutputConfigs = dispersionToxicOutputConfigs;
|
|
14599
|
+
this.dispersionToxicOutputConfigCount = dispersionToxicOutputConfigCount;
|
|
14561
14600
|
this.flammableOutputConfigs = flammableOutputConfigs;
|
|
14562
14601
|
this.flammableOutputConfigCount = flammableOutputConfigCount;
|
|
14563
14602
|
this.explosionOutputConfigs = explosionOutputConfigs;
|
|
@@ -14568,18 +14607,21 @@ export class VesselLeakFlammableLinkedRunCalculation extends CalculationBase {
|
|
|
14568
14607
|
|
|
14569
14608
|
async run() {
|
|
14570
14609
|
try {
|
|
14571
|
-
const request = new
|
|
14610
|
+
const request = new VesselLeakLinkedRunCalculationRequest(
|
|
14572
14611
|
this.vessel,
|
|
14573
14612
|
this.leak,
|
|
14574
14613
|
this.dischargeParameters,
|
|
14575
14614
|
this.substrate,
|
|
14576
14615
|
this.weather,
|
|
14577
14616
|
this.dispersionParameters,
|
|
14617
|
+
this.dispersionParameterCount,
|
|
14578
14618
|
this.endPointConcentration,
|
|
14579
14619
|
this.flammableParameters,
|
|
14580
14620
|
this.explosionParameters,
|
|
14581
|
-
this.
|
|
14582
|
-
this.
|
|
14621
|
+
this.dispersionFlamOutputConfigs,
|
|
14622
|
+
this.dispersionFlamOutputConfigCount,
|
|
14623
|
+
this.dispersionToxicOutputConfigs,
|
|
14624
|
+
this.dispersionToxicOutputConfigCount,
|
|
14583
14625
|
this.flammableOutputConfigs,
|
|
14584
14626
|
this.flammableOutputConfigCount,
|
|
14585
14627
|
this.explosionOutputConfigs,
|
|
@@ -14588,39 +14630,42 @@ export class VesselLeakFlammableLinkedRunCalculation extends CalculationBase {
|
|
|
14588
14630
|
this.explosionConfinedVolumeCount
|
|
14589
14631
|
);
|
|
14590
14632
|
|
|
14591
|
-
const schema = new
|
|
14633
|
+
const schema = new VesselLeakLinkedRunCalculationRequestSchema();
|
|
14592
14634
|
const validatedRequest = schema.validate(request);
|
|
14593
14635
|
|
|
14594
14636
|
const requestJson = JSON.stringify(validatedRequest);
|
|
14595
|
-
const url = `${getAnalyticsApiTarget()}
|
|
14637
|
+
const url = `${getAnalyticsApiTarget()}vesselleaklinkedrun?clientId=${getClientAliasId()}`;
|
|
14596
14638
|
|
|
14597
14639
|
this.resultCode = Enums.ResultCode.UNEXPECTED_APPLICATION_ERROR;
|
|
14598
14640
|
|
|
14599
14641
|
const response = await this.postRequest(url, requestJson);
|
|
14600
14642
|
|
|
14601
14643
|
if (response.status >= 200 && response.status < 300) {
|
|
14602
|
-
const schema = new
|
|
14644
|
+
const schema = new VesselLeakLinkedRunCalculationResponseSchema();
|
|
14603
14645
|
const validatedResponse = schema.validate(response.data);
|
|
14604
14646
|
|
|
14605
14647
|
this.resultCode = validatedResponse.resultCode;
|
|
14606
14648
|
if (this.resultCode === Enums.ResultCode.SUCCESS) {
|
|
14607
14649
|
this.dischargeRecord = validatedResponse.dischargeRecord;
|
|
14608
|
-
this.exitMaterial = validatedResponse.exitMaterial;
|
|
14609
|
-
this.dischargeResult = validatedResponse.dischargeResult;
|
|
14610
14650
|
this.distancesToJetFireRadiation = validatedResponse.distancesToJetFireRadiation;
|
|
14611
14651
|
this.jetContourPoints = validatedResponse.jetContourPoints;
|
|
14612
14652
|
this.nJetContourPoints = validatedResponse.nJetContourPoints;
|
|
14613
|
-
this.
|
|
14614
|
-
this.
|
|
14615
|
-
this.
|
|
14616
|
-
this.
|
|
14617
|
-
this.
|
|
14618
|
-
this.
|
|
14653
|
+
this.areaContourJet = validatedResponse.areaContourJet;
|
|
14654
|
+
this.distancesToFlamConcentration = validatedResponse.distancesToFlamConcentration;
|
|
14655
|
+
this.flamConcentrationsUsed = validatedResponse.flamConcentrationsUsed;
|
|
14656
|
+
this.flamConcContourPoints = validatedResponse.flamConcContourPoints;
|
|
14657
|
+
this.nFlamConcContourPoints = validatedResponse.nFlamConcContourPoints;
|
|
14658
|
+
this.areaFootprintFlamConc = validatedResponse.areaFootprintFlamConc;
|
|
14619
14659
|
this.distancesToPoolFireRadiation = validatedResponse.distancesToPoolFireRadiation;
|
|
14620
14660
|
this.poolContourPoints = validatedResponse.poolContourPoints;
|
|
14621
14661
|
this.nPoolContourPoints = validatedResponse.nPoolContourPoints;
|
|
14622
|
-
this.
|
|
14662
|
+
this.areaContourPool = validatedResponse.areaContourPool;
|
|
14623
14663
|
this.explosionOverpressureResults = validatedResponse.explosionOverpressureResults;
|
|
14664
|
+
this.distancesToToxicConcentration = validatedResponse.distancesToToxicConcentration;
|
|
14665
|
+
this.toxicConcentrationUsed = validatedResponse.toxicConcentrationUsed;
|
|
14666
|
+
this.toxicConcContourPoints = validatedResponse.toxicConcContourPoints;
|
|
14667
|
+
this.nToxicConcContourPoints = validatedResponse.nToxicConcContourPoints;
|
|
14668
|
+
this.areaFootprintToxicConc = validatedResponse.areaFootprintToxicConc;
|
|
14624
14669
|
this.jetFireFlameResult = validatedResponse.jetFireFlameResult;
|
|
14625
14670
|
this.poolFireFlameResult = validatedResponse.poolFireFlameResult;
|
|
14626
14671
|
this.resultCode = validatedResponse.resultCode;
|
|
@@ -14647,11 +14692,9 @@ export class VesselLeakFlammableLinkedRunCalculation extends CalculationBase {
|
|
|
14647
14692
|
}
|
|
14648
14693
|
|
|
14649
14694
|
toString() {
|
|
14650
|
-
const parts = ["*
|
|
14695
|
+
const parts = ["* VesselLeakLinkedRun"];
|
|
14651
14696
|
|
|
14652
14697
|
parts.push(`dischargeRecord: ${String(this.dischargeRecord)}`);
|
|
14653
|
-
parts.push(`exitMaterial: ${String(this.exitMaterial)}`);
|
|
14654
|
-
parts.push(`dischargeResult: ${String(this.dischargeResult)}`);
|
|
14655
14698
|
parts.push("*** distancesToJetFireRadiation:");
|
|
14656
14699
|
parts.push(
|
|
14657
14700
|
this.distancesToJetFireRadiation && this.distancesToJetFireRadiation.length > 0
|
|
@@ -14670,41 +14713,41 @@ export class VesselLeakFlammableLinkedRunCalculation extends CalculationBase {
|
|
|
14670
14713
|
? this.nJetContourPoints.map((point) => `nJetContourPointsElement: ${point}`).join("\n")
|
|
14671
14714
|
: "nJetContourPoints does not contain any elements"
|
|
14672
14715
|
);
|
|
14673
|
-
parts.push("***
|
|
14716
|
+
parts.push("*** areaContourJet:");
|
|
14674
14717
|
parts.push(
|
|
14675
|
-
this.
|
|
14676
|
-
? this.
|
|
14677
|
-
: "
|
|
14718
|
+
this.areaContourJet && this.areaContourJet.length > 0
|
|
14719
|
+
? this.areaContourJet.map((point) => `areaContourJetElement: ${point}`).join("\n")
|
|
14720
|
+
: "areaContourJet does not contain any elements"
|
|
14678
14721
|
);
|
|
14679
|
-
parts.push("***
|
|
14722
|
+
parts.push("*** distancesToFlamConcentration:");
|
|
14680
14723
|
parts.push(
|
|
14681
|
-
this.
|
|
14682
|
-
? this.
|
|
14683
|
-
: "
|
|
14724
|
+
this.distancesToFlamConcentration && this.distancesToFlamConcentration.length > 0
|
|
14725
|
+
? this.distancesToFlamConcentration.map((point) => `distancesToFlamConcentrationElement: ${point}`).join("\n")
|
|
14726
|
+
: "distancesToFlamConcentration does not contain any elements"
|
|
14684
14727
|
);
|
|
14685
|
-
parts.push("***
|
|
14728
|
+
parts.push("*** flamConcentrationsUsed:");
|
|
14686
14729
|
parts.push(
|
|
14687
|
-
this.
|
|
14688
|
-
? this.
|
|
14689
|
-
: "
|
|
14730
|
+
this.flamConcentrationsUsed && this.flamConcentrationsUsed.length > 0
|
|
14731
|
+
? this.flamConcentrationsUsed.map((point) => `flamConcentrationsUsedElement: ${point}`).join("\n")
|
|
14732
|
+
: "flamConcentrationsUsed does not contain any elements"
|
|
14690
14733
|
);
|
|
14691
|
-
parts.push("***
|
|
14734
|
+
parts.push("*** flamConcContourPoints:");
|
|
14692
14735
|
parts.push(
|
|
14693
|
-
this.
|
|
14694
|
-
? this.
|
|
14695
|
-
: "
|
|
14736
|
+
this.flamConcContourPoints && this.flamConcContourPoints.length > 0
|
|
14737
|
+
? this.flamConcContourPoints.map((point) => `flamConcContourPointsElement: ${point}`).join("\n")
|
|
14738
|
+
: "flamConcContourPoints does not contain any elements"
|
|
14696
14739
|
);
|
|
14697
|
-
parts.push("***
|
|
14740
|
+
parts.push("*** nFlamConcContourPoints:");
|
|
14698
14741
|
parts.push(
|
|
14699
|
-
this.
|
|
14700
|
-
? this.
|
|
14701
|
-
: "
|
|
14742
|
+
this.nFlamConcContourPoints && this.nFlamConcContourPoints.length > 0
|
|
14743
|
+
? this.nFlamConcContourPoints.map((point) => `nFlamConcContourPointsElement: ${point}`).join("\n")
|
|
14744
|
+
: "nFlamConcContourPoints does not contain any elements"
|
|
14702
14745
|
);
|
|
14703
|
-
parts.push("***
|
|
14746
|
+
parts.push("*** areaFootprintFlamConc:");
|
|
14704
14747
|
parts.push(
|
|
14705
|
-
this.
|
|
14706
|
-
? this.
|
|
14707
|
-
: "
|
|
14748
|
+
this.areaFootprintFlamConc && this.areaFootprintFlamConc.length > 0
|
|
14749
|
+
? this.areaFootprintFlamConc.map((point) => `areaFootprintFlamConcElement: ${point}`).join("\n")
|
|
14750
|
+
: "areaFootprintFlamConc does not contain any elements"
|
|
14708
14751
|
);
|
|
14709
14752
|
parts.push("*** distancesToPoolFireRadiation:");
|
|
14710
14753
|
parts.push(
|
|
@@ -14724,11 +14767,11 @@ export class VesselLeakFlammableLinkedRunCalculation extends CalculationBase {
|
|
|
14724
14767
|
? this.nPoolContourPoints.map((point) => `nPoolContourPointsElement: ${point}`).join("\n")
|
|
14725
14768
|
: "nPoolContourPoints does not contain any elements"
|
|
14726
14769
|
);
|
|
14727
|
-
parts.push("***
|
|
14770
|
+
parts.push("*** areaContourPool:");
|
|
14728
14771
|
parts.push(
|
|
14729
|
-
this.
|
|
14730
|
-
? this.
|
|
14731
|
-
: "
|
|
14772
|
+
this.areaContourPool && this.areaContourPool.length > 0
|
|
14773
|
+
? this.areaContourPool.map((point) => `areaContourPoolElement: ${point}`).join("\n")
|
|
14774
|
+
: "areaContourPool does not contain any elements"
|
|
14732
14775
|
);
|
|
14733
14776
|
parts.push("*** explosionOverpressureResults:");
|
|
14734
14777
|
parts.push(
|
|
@@ -14736,6 +14779,36 @@ export class VesselLeakFlammableLinkedRunCalculation extends CalculationBase {
|
|
|
14736
14779
|
? this.explosionOverpressureResults.map((point) => `explosionOverpressureResultsElement: ${point}`).join("\n")
|
|
14737
14780
|
: "explosionOverpressureResults does not contain any elements"
|
|
14738
14781
|
);
|
|
14782
|
+
parts.push("*** distancesToToxicConcentration:");
|
|
14783
|
+
parts.push(
|
|
14784
|
+
this.distancesToToxicConcentration && this.distancesToToxicConcentration.length > 0
|
|
14785
|
+
? this.distancesToToxicConcentration.map((point) => `distancesToToxicConcentrationElement: ${point}`).join("\n")
|
|
14786
|
+
: "distancesToToxicConcentration does not contain any elements"
|
|
14787
|
+
);
|
|
14788
|
+
parts.push("*** toxicConcentrationUsed:");
|
|
14789
|
+
parts.push(
|
|
14790
|
+
this.toxicConcentrationUsed && this.toxicConcentrationUsed.length > 0
|
|
14791
|
+
? this.toxicConcentrationUsed.map((point) => `toxicConcentrationUsedElement: ${point}`).join("\n")
|
|
14792
|
+
: "toxicConcentrationUsed does not contain any elements"
|
|
14793
|
+
);
|
|
14794
|
+
parts.push("*** toxicConcContourPoints:");
|
|
14795
|
+
parts.push(
|
|
14796
|
+
this.toxicConcContourPoints && this.toxicConcContourPoints.length > 0
|
|
14797
|
+
? this.toxicConcContourPoints.map((point) => `toxicConcContourPointsElement: ${point}`).join("\n")
|
|
14798
|
+
: "toxicConcContourPoints does not contain any elements"
|
|
14799
|
+
);
|
|
14800
|
+
parts.push("*** nToxicConcContourPoints:");
|
|
14801
|
+
parts.push(
|
|
14802
|
+
this.nToxicConcContourPoints && this.nToxicConcContourPoints.length > 0
|
|
14803
|
+
? this.nToxicConcContourPoints.map((point) => `nToxicConcContourPointsElement: ${point}`).join("\n")
|
|
14804
|
+
: "nToxicConcContourPoints does not contain any elements"
|
|
14805
|
+
);
|
|
14806
|
+
parts.push("*** areaFootprintToxicConc:");
|
|
14807
|
+
parts.push(
|
|
14808
|
+
this.areaFootprintToxicConc && this.areaFootprintToxicConc.length > 0
|
|
14809
|
+
? this.areaFootprintToxicConc.map((point) => `areaFootprintToxicConcElement: ${point}`).join("\n")
|
|
14810
|
+
: "areaFootprintToxicConc does not contain any elements"
|
|
14811
|
+
);
|
|
14739
14812
|
parts.push(`jetFireFlameResult: ${String(this.jetFireFlameResult)}`);
|
|
14740
14813
|
parts.push(`poolFireFlameResult: ${String(this.poolFireFlameResult)}`);
|
|
14741
14814
|
parts.push(`resultCode: ${String(this.resultCode)}`);
|
|
@@ -14748,69 +14821,78 @@ export class VesselLeakFlammableLinkedRunCalculation extends CalculationBase {
|
|
|
14748
14821
|
}
|
|
14749
14822
|
}
|
|
14750
14823
|
|
|
14751
|
-
export class
|
|
14824
|
+
export class VesselLeakLinkedRunCalculationResponse extends CalculationResponseBase {
|
|
14752
14825
|
dischargeRecord: Entities.DischargeRecord;
|
|
14753
|
-
exitMaterial: Entities.Material;
|
|
14754
|
-
dischargeResult: Entities.DischargeResult;
|
|
14755
14826
|
distancesToJetFireRadiation: number[];
|
|
14756
14827
|
jetContourPoints: Entities.LocalPosition[];
|
|
14757
14828
|
nJetContourPoints: number[];
|
|
14758
|
-
|
|
14759
|
-
|
|
14760
|
-
|
|
14761
|
-
|
|
14762
|
-
|
|
14763
|
-
|
|
14829
|
+
areaContourJet: number[];
|
|
14830
|
+
distancesToFlamConcentration: number[];
|
|
14831
|
+
flamConcentrationsUsed: number[];
|
|
14832
|
+
flamConcContourPoints: Entities.LocalPosition[];
|
|
14833
|
+
nFlamConcContourPoints: number[];
|
|
14834
|
+
areaFootprintFlamConc: number[];
|
|
14764
14835
|
distancesToPoolFireRadiation: number[];
|
|
14765
14836
|
poolContourPoints: Entities.LocalPosition[];
|
|
14766
14837
|
nPoolContourPoints: number[];
|
|
14767
|
-
|
|
14838
|
+
areaContourPool: number[];
|
|
14768
14839
|
explosionOverpressureResults: Entities.ExplosionOverpressureResult[];
|
|
14840
|
+
distancesToToxicConcentration: number[];
|
|
14841
|
+
toxicConcentrationUsed: number[];
|
|
14842
|
+
toxicConcContourPoints: Entities.LocalPosition[];
|
|
14843
|
+
nToxicConcContourPoints: number[];
|
|
14844
|
+
areaFootprintToxicConc: number[];
|
|
14769
14845
|
jetFireFlameResult: Entities.FlameResult;
|
|
14770
14846
|
poolFireFlameResult: Entities.PoolFireFlameResult;
|
|
14771
14847
|
|
|
14772
14848
|
/**
|
|
14773
|
-
*
|
|
14849
|
+
* VesselLeakLinkedRun calculation response class.
|
|
14774
14850
|
*
|
|
14775
14851
|
* @param {Entities.DischargeRecord} dischargeRecord - A Discharge Record entity.
|
|
14776
|
-
* @param {Entities.Material} exitMaterial - Description not in params list.
|
|
14777
|
-
* @param {Entities.DischargeResult} dischargeResult - Description not in params list.
|
|
14778
14852
|
* @param {number[]} distancesToJetFireRadiation - An array of distances to jet fire radiation levels, ordered according to the Flammable Output Configs.
|
|
14779
|
-
* @param {Entities.LocalPosition[]} jetContourPoints - An array of jet fire radiation
|
|
14780
|
-
* @param {number[]} nJetContourPoints - An array of the number of jet fire radiation
|
|
14781
|
-
* @param {number[]}
|
|
14782
|
-
* @param {number[]}
|
|
14783
|
-
* @param {number[]}
|
|
14784
|
-
* @param {Entities.LocalPosition[]}
|
|
14785
|
-
* @param {number[]}
|
|
14786
|
-
* @param {number[]}
|
|
14853
|
+
* @param {Entities.LocalPosition[]} jetContourPoints - An array of jet fire radiation contour points, ordered according to the Flammable Output Configs.
|
|
14854
|
+
* @param {number[]} nJetContourPoints - An array of the number of jet fire radiation contour points, ordered according to the Flammable Output Configs.
|
|
14855
|
+
* @param {number[]} areaContourJet - An array of areas of the jet fire contours, ordered according to the Flammable Output Configs.
|
|
14856
|
+
* @param {number[]} distancesToFlamConcentration - An array of distances to flammable concentration levels, ordered according to the Dispersion Output Configs for flammable concentrations of interest.
|
|
14857
|
+
* @param {number[]} flamConcentrationsUsed - An array of flammable concentration levels used in the calculations, ordered according to the Dispersion Output Configs for flammable concentrations of interest.
|
|
14858
|
+
* @param {Entities.LocalPosition[]} flamConcContourPoints - An array of maximum flammable concentration footprint contour points, ordered according to the Dispersion Output Configs for flammable concentrations of interest.
|
|
14859
|
+
* @param {number[]} nFlamConcContourPoints - An array of the number of maximum flammable concentration footprint contour points, ordered according to the Dispersion Output Configs for flammable concentrations of interest.
|
|
14860
|
+
* @param {number[]} areaFootprintFlamConc - An array of areas of the maximum flammable concentration footprint contours, ordered according to the Dispersion Output Configs for flammable concentrations of interest.
|
|
14787
14861
|
* @param {number[]} distancesToPoolFireRadiation - An array of distances to pool fire radiation levels, ordered according to the Flammable Output Configs.
|
|
14788
|
-
* @param {Entities.LocalPosition[]} poolContourPoints - An array of pool fire radiation
|
|
14789
|
-
* @param {number[]} nPoolContourPoints - An array of the number of pool fire radiation
|
|
14790
|
-
* @param {number[]}
|
|
14862
|
+
* @param {Entities.LocalPosition[]} poolContourPoints - An array of pool fire radiation contour points, ordered according to the Flammable Output Configs.
|
|
14863
|
+
* @param {number[]} nPoolContourPoints - An array of the number of pool fire radiation contour points, ordered according to the Flammable Output Configs.
|
|
14864
|
+
* @param {number[]} areaContourPool - An array of areas of the pool fire contours, ordered according to the Flammable Output Configs.
|
|
14791
14865
|
* @param {Entities.ExplosionOverpressureResult[]} explosionOverpressureResults - An array of Explosion Overpressure Results, ordered according to the Explosion Output Configs.
|
|
14866
|
+
* @param {number[]} distancesToToxicConcentration - An array of distances to toxic concentration levels, ordered according to the Dispersion Output Configs for toxic concentrations of interest.
|
|
14867
|
+
* @param {number[]} toxicConcentrationUsed - An array of toxic concentration levels used in the calculations, ordered according to the Dispersion Output Configs for toxic concentrations of interest.
|
|
14868
|
+
* @param {Entities.LocalPosition[]} toxicConcContourPoints - An array of maximum toxic concentration footprint contour points, ordered according to the Dispersion Output Configs for toxic concentrations of interest.
|
|
14869
|
+
* @param {number[]} nToxicConcContourPoints - An array of the number of maximum toxic concentration footprint contour points, ordered according to the Dispersion Output Configs for toxic concentrations of interest.
|
|
14870
|
+
* @param {number[]} areaFootprintToxicConc - An array of areas of the maximum toxic concentration footprint contours, ordered according to the Dispersion Output Configs for toxic concentrations of interest.
|
|
14792
14871
|
* @param {Entities.FlameResult} jetFireFlameResult - A Flame Results entity, for jet fire.
|
|
14793
14872
|
* @param {Entities.PoolFireFlameResult} poolFireFlameResult - A Pool Fire Flame Results entity, for pool fire.
|
|
14794
14873
|
*/
|
|
14795
14874
|
constructor(
|
|
14796
14875
|
dischargeRecord: Entities.DischargeRecord,
|
|
14797
|
-
exitMaterial: Entities.Material,
|
|
14798
|
-
dischargeResult: Entities.DischargeResult,
|
|
14799
14876
|
distancesToJetFireRadiation: number[],
|
|
14800
14877
|
jetContourPoints: Entities.LocalPosition[],
|
|
14801
14878
|
nJetContourPoints: number[],
|
|
14802
|
-
|
|
14803
|
-
|
|
14804
|
-
|
|
14805
|
-
|
|
14806
|
-
|
|
14807
|
-
|
|
14808
|
-
distancesToPoolFireRadiation: number[],
|
|
14809
|
-
poolContourPoints: Entities.LocalPosition[],
|
|
14810
|
-
nPoolContourPoints: number[],
|
|
14811
|
-
|
|
14812
|
-
explosionOverpressureResults: Entities.ExplosionOverpressureResult[],
|
|
14813
|
-
|
|
14879
|
+
areaContourJet: number[],
|
|
14880
|
+
distancesToFlamConcentration: number[],
|
|
14881
|
+
flamConcentrationsUsed: number[],
|
|
14882
|
+
flamConcContourPoints: Entities.LocalPosition[],
|
|
14883
|
+
nFlamConcContourPoints: number[],
|
|
14884
|
+
areaFootprintFlamConc: number[],
|
|
14885
|
+
distancesToPoolFireRadiation: number[],
|
|
14886
|
+
poolContourPoints: Entities.LocalPosition[],
|
|
14887
|
+
nPoolContourPoints: number[],
|
|
14888
|
+
areaContourPool: number[],
|
|
14889
|
+
explosionOverpressureResults: Entities.ExplosionOverpressureResult[],
|
|
14890
|
+
distancesToToxicConcentration: number[],
|
|
14891
|
+
toxicConcentrationUsed: number[],
|
|
14892
|
+
toxicConcContourPoints: Entities.LocalPosition[],
|
|
14893
|
+
nToxicConcContourPoints: number[],
|
|
14894
|
+
areaFootprintToxicConc: number[],
|
|
14895
|
+
jetFireFlameResult: Entities.FlameResult,
|
|
14814
14896
|
poolFireFlameResult: Entities.PoolFireFlameResult,
|
|
14815
14897
|
resultCode: Enums.ResultCode,
|
|
14816
14898
|
messages: string[],
|
|
@@ -14819,22 +14901,25 @@ export class VesselLeakFlammableLinkedRunCalculationResponse extends Calculation
|
|
|
14819
14901
|
) {
|
|
14820
14902
|
super();
|
|
14821
14903
|
this.dischargeRecord = dischargeRecord;
|
|
14822
|
-
this.exitMaterial = exitMaterial;
|
|
14823
|
-
this.dischargeResult = dischargeResult;
|
|
14824
14904
|
this.distancesToJetFireRadiation = distancesToJetFireRadiation;
|
|
14825
14905
|
this.jetContourPoints = jetContourPoints;
|
|
14826
14906
|
this.nJetContourPoints = nJetContourPoints;
|
|
14827
|
-
this.
|
|
14828
|
-
this.
|
|
14829
|
-
this.
|
|
14830
|
-
this.
|
|
14831
|
-
this.
|
|
14832
|
-
this.
|
|
14907
|
+
this.areaContourJet = areaContourJet;
|
|
14908
|
+
this.distancesToFlamConcentration = distancesToFlamConcentration;
|
|
14909
|
+
this.flamConcentrationsUsed = flamConcentrationsUsed;
|
|
14910
|
+
this.flamConcContourPoints = flamConcContourPoints;
|
|
14911
|
+
this.nFlamConcContourPoints = nFlamConcContourPoints;
|
|
14912
|
+
this.areaFootprintFlamConc = areaFootprintFlamConc;
|
|
14833
14913
|
this.distancesToPoolFireRadiation = distancesToPoolFireRadiation;
|
|
14834
14914
|
this.poolContourPoints = poolContourPoints;
|
|
14835
14915
|
this.nPoolContourPoints = nPoolContourPoints;
|
|
14836
|
-
this.
|
|
14916
|
+
this.areaContourPool = areaContourPool;
|
|
14837
14917
|
this.explosionOverpressureResults = explosionOverpressureResults;
|
|
14918
|
+
this.distancesToToxicConcentration = distancesToToxicConcentration;
|
|
14919
|
+
this.toxicConcentrationUsed = toxicConcentrationUsed;
|
|
14920
|
+
this.toxicConcContourPoints = toxicConcContourPoints;
|
|
14921
|
+
this.nToxicConcContourPoints = nToxicConcContourPoints;
|
|
14922
|
+
this.areaFootprintToxicConc = areaFootprintToxicConc;
|
|
14838
14923
|
this.jetFireFlameResult = jetFireFlameResult;
|
|
14839
14924
|
this.poolFireFlameResult = poolFireFlameResult;
|
|
14840
14925
|
this.resultCode = resultCode;
|
|
@@ -14846,15 +14931,7 @@ export class VesselLeakFlammableLinkedRunCalculationResponse extends Calculation
|
|
|
14846
14931
|
initialiseFromDictionary(data: { [key: string]: unknown }) {
|
|
14847
14932
|
if (data.dischargeRecord) {
|
|
14848
14933
|
this.dischargeRecord = new Entities.DischargeRecord();
|
|
14849
|
-
this.dischargeRecord.initialiseFromDictionary(data.dischargeRecord);
|
|
14850
|
-
}
|
|
14851
|
-
if (data.exitMaterial) {
|
|
14852
|
-
this.exitMaterial = new Entities.Material();
|
|
14853
|
-
this.exitMaterial.initialiseFromDictionary(data.exitMaterial);
|
|
14854
|
-
}
|
|
14855
|
-
if (data.dischargeResult) {
|
|
14856
|
-
this.dischargeResult = new Entities.DischargeResult();
|
|
14857
|
-
this.dischargeResult.initialiseFromDictionary(data.dischargeResult);
|
|
14934
|
+
this.dischargeRecord.initialiseFromDictionary(data.dischargeRecord as { [key: string]: unknown });
|
|
14858
14935
|
}
|
|
14859
14936
|
if (data.distancesToJetFireRadiation && Array.isArray(data.distancesToJetFireRadiation)) {
|
|
14860
14937
|
this.distancesToJetFireRadiation = data.distancesToJetFireRadiation.map((item) => parseFloat(item));
|
|
@@ -14871,17 +14948,17 @@ export class VesselLeakFlammableLinkedRunCalculationResponse extends Calculation
|
|
|
14871
14948
|
if (data.nJetContourPoints && Array.isArray(data.nJetContourPoints)) {
|
|
14872
14949
|
this.nJetContourPoints = data.nJetContourPoints.map((item) => parseInt(item));
|
|
14873
14950
|
}
|
|
14874
|
-
if (data.
|
|
14875
|
-
this.
|
|
14951
|
+
if (data.areaContourJet && Array.isArray(data.areaContourJet)) {
|
|
14952
|
+
this.areaContourJet = data.areaContourJet.map((item) => parseFloat(item));
|
|
14876
14953
|
}
|
|
14877
|
-
if (data.
|
|
14878
|
-
this.
|
|
14954
|
+
if (data.distancesToFlamConcentration && Array.isArray(data.distancesToFlamConcentration)) {
|
|
14955
|
+
this.distancesToFlamConcentration = data.distancesToFlamConcentration.map((item) => parseFloat(item));
|
|
14879
14956
|
}
|
|
14880
|
-
if (data.
|
|
14881
|
-
this.
|
|
14957
|
+
if (data.flamConcentrationsUsed && Array.isArray(data.flamConcentrationsUsed)) {
|
|
14958
|
+
this.flamConcentrationsUsed = data.flamConcentrationsUsed.map((item) => parseFloat(item));
|
|
14882
14959
|
}
|
|
14883
|
-
if (data.
|
|
14884
|
-
this.
|
|
14960
|
+
if (data.flamConcContourPoints && Array.isArray(data.flamConcContourPoints)) {
|
|
14961
|
+
this.flamConcContourPoints = data.flamConcContourPoints.map(
|
|
14885
14962
|
(item) => {
|
|
14886
14963
|
const record = new Entities.LocalPosition();
|
|
14887
14964
|
record.initialiseFromDictionary(item);
|
|
@@ -14889,11 +14966,11 @@ export class VesselLeakFlammableLinkedRunCalculationResponse extends Calculation
|
|
|
14889
14966
|
}
|
|
14890
14967
|
);
|
|
14891
14968
|
}
|
|
14892
|
-
if (data.
|
|
14893
|
-
this.
|
|
14969
|
+
if (data.nFlamConcContourPoints && Array.isArray(data.nFlamConcContourPoints)) {
|
|
14970
|
+
this.nFlamConcContourPoints = data.nFlamConcContourPoints.map((item) => parseInt(item));
|
|
14894
14971
|
}
|
|
14895
|
-
if (data.
|
|
14896
|
-
this.
|
|
14972
|
+
if (data.areaFootprintFlamConc && Array.isArray(data.areaFootprintFlamConc)) {
|
|
14973
|
+
this.areaFootprintFlamConc = data.areaFootprintFlamConc.map((item) => parseFloat(item));
|
|
14897
14974
|
}
|
|
14898
14975
|
if (data.distancesToPoolFireRadiation && Array.isArray(data.distancesToPoolFireRadiation)) {
|
|
14899
14976
|
this.distancesToPoolFireRadiation = data.distancesToPoolFireRadiation.map((item) => parseFloat(item));
|
|
@@ -14910,8 +14987,8 @@ export class VesselLeakFlammableLinkedRunCalculationResponse extends Calculation
|
|
|
14910
14987
|
if (data.nPoolContourPoints && Array.isArray(data.nPoolContourPoints)) {
|
|
14911
14988
|
this.nPoolContourPoints = data.nPoolContourPoints.map((item) => parseInt(item));
|
|
14912
14989
|
}
|
|
14913
|
-
if (data.
|
|
14914
|
-
this.
|
|
14990
|
+
if (data.areaContourPool && Array.isArray(data.areaContourPool)) {
|
|
14991
|
+
this.areaContourPool = data.areaContourPool.map((item) => parseFloat(item));
|
|
14915
14992
|
}
|
|
14916
14993
|
if (data.explosionOverpressureResults && Array.isArray(data.explosionOverpressureResults)) {
|
|
14917
14994
|
this.explosionOverpressureResults = data.explosionOverpressureResults.map(
|
|
@@ -14922,13 +14999,34 @@ export class VesselLeakFlammableLinkedRunCalculationResponse extends Calculation
|
|
|
14922
14999
|
}
|
|
14923
15000
|
);
|
|
14924
15001
|
}
|
|
15002
|
+
if (data.distancesToToxicConcentration && Array.isArray(data.distancesToToxicConcentration)) {
|
|
15003
|
+
this.distancesToToxicConcentration = data.distancesToToxicConcentration.map((item) => parseFloat(item));
|
|
15004
|
+
}
|
|
15005
|
+
if (data.toxicConcentrationUsed && Array.isArray(data.toxicConcentrationUsed)) {
|
|
15006
|
+
this.toxicConcentrationUsed = data.toxicConcentrationUsed.map((item) => parseFloat(item));
|
|
15007
|
+
}
|
|
15008
|
+
if (data.toxicConcContourPoints && Array.isArray(data.toxicConcContourPoints)) {
|
|
15009
|
+
this.toxicConcContourPoints = data.toxicConcContourPoints.map(
|
|
15010
|
+
(item) => {
|
|
15011
|
+
const record = new Entities.LocalPosition();
|
|
15012
|
+
record.initialiseFromDictionary(item);
|
|
15013
|
+
return record;
|
|
15014
|
+
}
|
|
15015
|
+
);
|
|
15016
|
+
}
|
|
15017
|
+
if (data.nToxicConcContourPoints && Array.isArray(data.nToxicConcContourPoints)) {
|
|
15018
|
+
this.nToxicConcContourPoints = data.nToxicConcContourPoints.map((item) => parseInt(item));
|
|
15019
|
+
}
|
|
15020
|
+
if (data.areaFootprintToxicConc && Array.isArray(data.areaFootprintToxicConc)) {
|
|
15021
|
+
this.areaFootprintToxicConc = data.areaFootprintToxicConc.map((item) => parseFloat(item));
|
|
15022
|
+
}
|
|
14925
15023
|
if (data.jetFireFlameResult) {
|
|
14926
15024
|
this.jetFireFlameResult = new Entities.FlameResult();
|
|
14927
|
-
this.jetFireFlameResult.initialiseFromDictionary(data.jetFireFlameResult);
|
|
15025
|
+
this.jetFireFlameResult.initialiseFromDictionary(data.jetFireFlameResult as { [key: string]: unknown });
|
|
14928
15026
|
}
|
|
14929
15027
|
if (data.poolFireFlameResult) {
|
|
14930
15028
|
this.poolFireFlameResult = new Entities.PoolFireFlameResult();
|
|
14931
|
-
this.poolFireFlameResult.initialiseFromDictionary(data.poolFireFlameResult);
|
|
15029
|
+
this.poolFireFlameResult.initialiseFromDictionary(data.poolFireFlameResult as { [key: string]: unknown });
|
|
14932
15030
|
}
|
|
14933
15031
|
if (data.resultCode !== undefined && (typeof data.resultCode === "string" || typeof data.resultCode === "number")) {
|
|
14934
15032
|
this.resultCode = data.resultCode as Enums.ResultCode;
|
|
@@ -14946,24 +15044,27 @@ export class VesselLeakFlammableLinkedRunCalculationResponse extends Calculation
|
|
|
14946
15044
|
}
|
|
14947
15045
|
}
|
|
14948
15046
|
|
|
14949
|
-
export interface
|
|
15047
|
+
export interface VesselLeakLinkedRunCalculationResponseSchemaData {
|
|
14950
15048
|
dischargeRecord: Entities.DischargeRecord;
|
|
14951
|
-
exitMaterial: Entities.Material;
|
|
14952
|
-
dischargeResult: Entities.DischargeResult;
|
|
14953
15049
|
distancesToJetFireRadiation: number[];
|
|
14954
15050
|
jetContourPoints: Entities.LocalPosition[];
|
|
14955
15051
|
nJetContourPoints: number[];
|
|
14956
|
-
|
|
14957
|
-
|
|
14958
|
-
|
|
14959
|
-
|
|
14960
|
-
|
|
14961
|
-
|
|
15052
|
+
areaContourJet: number[];
|
|
15053
|
+
distancesToFlamConcentration: number[];
|
|
15054
|
+
flamConcentrationsUsed: number[];
|
|
15055
|
+
flamConcContourPoints: Entities.LocalPosition[];
|
|
15056
|
+
nFlamConcContourPoints: number[];
|
|
15057
|
+
areaFootprintFlamConc: number[];
|
|
14962
15058
|
distancesToPoolFireRadiation: number[];
|
|
14963
15059
|
poolContourPoints: Entities.LocalPosition[];
|
|
14964
15060
|
nPoolContourPoints: number[];
|
|
14965
|
-
|
|
15061
|
+
areaContourPool: number[];
|
|
14966
15062
|
explosionOverpressureResults: Entities.ExplosionOverpressureResult[];
|
|
15063
|
+
distancesToToxicConcentration: number[];
|
|
15064
|
+
toxicConcentrationUsed: number[];
|
|
15065
|
+
toxicConcContourPoints: Entities.LocalPosition[];
|
|
15066
|
+
nToxicConcContourPoints: number[];
|
|
15067
|
+
areaFootprintToxicConc: number[];
|
|
14967
15068
|
jetFireFlameResult: Entities.FlameResult;
|
|
14968
15069
|
poolFireFlameResult: Entities.PoolFireFlameResult;
|
|
14969
15070
|
resultCode: Enums.ResultCode;
|
|
@@ -14972,32 +15073,35 @@ export interface VesselLeakFlammableLinkedRunCalculationResponseSchemaData {
|
|
|
14972
15073
|
operationId: string;
|
|
14973
15074
|
}
|
|
14974
15075
|
|
|
14975
|
-
export class
|
|
15076
|
+
export class VesselLeakLinkedRunCalculationResponseSchema {
|
|
14976
15077
|
schema: Joi.ObjectSchema;
|
|
14977
15078
|
propertyTypes: Record<string, string>;
|
|
14978
15079
|
|
|
14979
15080
|
/**
|
|
14980
|
-
* Schema for the
|
|
15081
|
+
* Schema for the VesselLeakLinkedRun calculation response.
|
|
14981
15082
|
*/
|
|
14982
15083
|
constructor() {
|
|
14983
15084
|
this.schema = Joi.object({
|
|
14984
15085
|
dischargeRecord: new EntitySchemas.DischargeRecordSchema().schema,
|
|
14985
|
-
exitMaterial: new EntitySchemas.MaterialSchema().schema,
|
|
14986
|
-
dischargeResult: new EntitySchemas.DischargeResultSchema().schema,
|
|
14987
15086
|
distancesToJetFireRadiation: Joi.array().items(Joi.number().unsafe()).allow(null),
|
|
14988
15087
|
jetContourPoints: Joi.array().items(new EntitySchemas.LocalPositionSchema().schema).allow(null),
|
|
14989
15088
|
nJetContourPoints: Joi.array().items(Joi.number().integer()).allow(null),
|
|
14990
|
-
|
|
14991
|
-
|
|
14992
|
-
|
|
14993
|
-
|
|
14994
|
-
|
|
14995
|
-
|
|
15089
|
+
areaContourJet: Joi.array().items(Joi.number().unsafe()).allow(null),
|
|
15090
|
+
distancesToFlamConcentration: Joi.array().items(Joi.number().unsafe()).allow(null),
|
|
15091
|
+
flamConcentrationsUsed: Joi.array().items(Joi.number().unsafe()).allow(null),
|
|
15092
|
+
flamConcContourPoints: Joi.array().items(new EntitySchemas.LocalPositionSchema().schema).allow(null),
|
|
15093
|
+
nFlamConcContourPoints: Joi.array().items(Joi.number().integer()).allow(null),
|
|
15094
|
+
areaFootprintFlamConc: Joi.array().items(Joi.number().unsafe()).allow(null),
|
|
14996
15095
|
distancesToPoolFireRadiation: Joi.array().items(Joi.number().unsafe()).allow(null),
|
|
14997
15096
|
poolContourPoints: Joi.array().items(new EntitySchemas.LocalPositionSchema().schema).allow(null),
|
|
14998
15097
|
nPoolContourPoints: Joi.array().items(Joi.number().integer()).allow(null),
|
|
14999
|
-
|
|
15098
|
+
areaContourPool: Joi.array().items(Joi.number().unsafe()).allow(null),
|
|
15000
15099
|
explosionOverpressureResults: Joi.array().items(new EntitySchemas.ExplosionOverpressureResultSchema().schema).allow(null),
|
|
15100
|
+
distancesToToxicConcentration: Joi.array().items(Joi.number().unsafe()).allow(null),
|
|
15101
|
+
toxicConcentrationUsed: Joi.array().items(Joi.number().unsafe()).allow(null),
|
|
15102
|
+
toxicConcContourPoints: Joi.array().items(new EntitySchemas.LocalPositionSchema().schema).allow(null),
|
|
15103
|
+
nToxicConcContourPoints: Joi.array().items(Joi.number().integer()).allow(null),
|
|
15104
|
+
areaFootprintToxicConc: Joi.array().items(Joi.number().unsafe()).allow(null),
|
|
15001
15105
|
jetFireFlameResult: new EntitySchemas.FlameResultSchema().schema,
|
|
15002
15106
|
poolFireFlameResult: new EntitySchemas.PoolFireFlameResultSchema().schema,
|
|
15003
15107
|
resultCode: Joi.string().valid(...Object.values(Enums.ResultCode)),
|
|
@@ -15008,28 +15112,31 @@ export class VesselLeakFlammableLinkedRunCalculationResponseSchema {
|
|
|
15008
15112
|
|
|
15009
15113
|
this.propertyTypes = {
|
|
15010
15114
|
dischargeRecord: "Entities.DischargeRecord",
|
|
15011
|
-
exitMaterial: "Entities.Material",
|
|
15012
|
-
dischargeResult: "Entities.DischargeResult",
|
|
15013
15115
|
distancesToJetFireRadiation: "number[]",
|
|
15014
15116
|
jetContourPoints: "Entities.LocalPosition[]",
|
|
15015
15117
|
nJetContourPoints: "number[]",
|
|
15016
|
-
|
|
15017
|
-
|
|
15018
|
-
|
|
15019
|
-
|
|
15020
|
-
|
|
15021
|
-
|
|
15118
|
+
areaContourJet: "number[]",
|
|
15119
|
+
distancesToFlamConcentration: "number[]",
|
|
15120
|
+
flamConcentrationsUsed: "number[]",
|
|
15121
|
+
flamConcContourPoints: "Entities.LocalPosition[]",
|
|
15122
|
+
nFlamConcContourPoints: "number[]",
|
|
15123
|
+
areaFootprintFlamConc: "number[]",
|
|
15022
15124
|
distancesToPoolFireRadiation: "number[]",
|
|
15023
15125
|
poolContourPoints: "Entities.LocalPosition[]",
|
|
15024
15126
|
nPoolContourPoints: "number[]",
|
|
15025
|
-
|
|
15127
|
+
areaContourPool: "number[]",
|
|
15026
15128
|
explosionOverpressureResults: "Entities.ExplosionOverpressureResult[]",
|
|
15129
|
+
distancesToToxicConcentration: "number[]",
|
|
15130
|
+
toxicConcentrationUsed: "number[]",
|
|
15131
|
+
toxicConcContourPoints: "Entities.LocalPosition[]",
|
|
15132
|
+
nToxicConcContourPoints: "number[]",
|
|
15133
|
+
areaFootprintToxicConc: "number[]",
|
|
15027
15134
|
jetFireFlameResult: "Entities.FlameResult",
|
|
15028
15135
|
poolFireFlameResult: "Entities.PoolFireFlameResult",
|
|
15029
15136
|
};
|
|
15030
15137
|
}
|
|
15031
15138
|
|
|
15032
|
-
validate(data:
|
|
15139
|
+
validate(data: VesselLeakLinkedRunCalculationResponseSchemaData): VesselLeakLinkedRunCalculationResponse {
|
|
15033
15140
|
const { error, value } = this.schema.validate(data, { abortEarly: false });
|
|
15034
15141
|
if (error) {
|
|
15035
15142
|
throw new Error(`Validation error: ${error.details.map((x) => x.message).join(", ")}`);
|
|
@@ -15037,25 +15144,28 @@ export class VesselLeakFlammableLinkedRunCalculationResponseSchema {
|
|
|
15037
15144
|
return this.makeCalculationResponse(value);
|
|
15038
15145
|
}
|
|
15039
15146
|
|
|
15040
|
-
makeCalculationResponse(data:
|
|
15041
|
-
return new
|
|
15147
|
+
makeCalculationResponse(data: VesselLeakLinkedRunCalculationResponseSchemaData): VesselLeakLinkedRunCalculationResponse {
|
|
15148
|
+
return new VesselLeakLinkedRunCalculationResponse(
|
|
15042
15149
|
data.dischargeRecord,
|
|
15043
|
-
data.exitMaterial,
|
|
15044
|
-
data.dischargeResult,
|
|
15045
15150
|
data.distancesToJetFireRadiation,
|
|
15046
15151
|
data.jetContourPoints,
|
|
15047
15152
|
data.nJetContourPoints,
|
|
15048
|
-
data.
|
|
15049
|
-
data.
|
|
15050
|
-
data.
|
|
15051
|
-
data.
|
|
15052
|
-
data.
|
|
15053
|
-
data.
|
|
15153
|
+
data.areaContourJet,
|
|
15154
|
+
data.distancesToFlamConcentration,
|
|
15155
|
+
data.flamConcentrationsUsed,
|
|
15156
|
+
data.flamConcContourPoints,
|
|
15157
|
+
data.nFlamConcContourPoints,
|
|
15158
|
+
data.areaFootprintFlamConc,
|
|
15054
15159
|
data.distancesToPoolFireRadiation,
|
|
15055
15160
|
data.poolContourPoints,
|
|
15056
15161
|
data.nPoolContourPoints,
|
|
15057
|
-
data.
|
|
15162
|
+
data.areaContourPool,
|
|
15058
15163
|
data.explosionOverpressureResults,
|
|
15164
|
+
data.distancesToToxicConcentration,
|
|
15165
|
+
data.toxicConcentrationUsed,
|
|
15166
|
+
data.toxicConcContourPoints,
|
|
15167
|
+
data.nToxicConcContourPoints,
|
|
15168
|
+
data.areaFootprintToxicConc,
|
|
15059
15169
|
data.jetFireFlameResult,
|
|
15060
15170
|
data.poolFireFlameResult,
|
|
15061
15171
|
data.resultCode,
|
|
@@ -15066,2096 +15176,6 @@ export class VesselLeakFlammableLinkedRunCalculationResponseSchema {
|
|
|
15066
15176
|
}
|
|
15067
15177
|
}
|
|
15068
15178
|
|
|
15069
|
-
export interface VesselLeakFlamToxSimpleLinkedRunCalculationRequestSchemaData {
|
|
15070
|
-
vessel: Entities.Vessel;
|
|
15071
|
-
leak: Entities.Leak;
|
|
15072
|
-
dischargeParameters: Entities.DischargeParameters;
|
|
15073
|
-
substrate: Entities.Substrate;
|
|
15074
|
-
weather: Entities.Weather;
|
|
15075
|
-
dispersionParameters: Entities.DispersionParameters[];
|
|
15076
|
-
dispersionParameterCount: number;
|
|
15077
|
-
endPointConcentration: number;
|
|
15078
|
-
flammableParameters: Entities.FlammableParameters;
|
|
15079
|
-
explosionParameters: Entities.ExplosionParameters;
|
|
15080
|
-
dispersionFlamOutputConfigs: Entities.DispersionOutputConfig[];
|
|
15081
|
-
dispersionFlamOutputConfigCount: number;
|
|
15082
|
-
moleFractionToxic: number;
|
|
15083
|
-
dispersionToxicOutputConfigs: Entities.DispersionOutputConfig[];
|
|
15084
|
-
dispersionToxicOutputConfigCount: number;
|
|
15085
|
-
flammableOutputConfigs: Entities.FlammableOutputConfig[];
|
|
15086
|
-
flammableOutputConfigCount: number;
|
|
15087
|
-
explosionOutputConfigs: Entities.ExplosionOutputConfig[];
|
|
15088
|
-
explosionOutputConfigCount: number;
|
|
15089
|
-
explosionConfinedVolumes: Entities.ExplosionConfinedVolume[];
|
|
15090
|
-
explosionConfinedVolumeCount: number;
|
|
15091
|
-
}
|
|
15092
|
-
|
|
15093
|
-
class VesselLeakFlamToxSimpleLinkedRunCalculationRequest extends CalculationRequestBase {
|
|
15094
|
-
vessel: Entities.Vessel;
|
|
15095
|
-
leak: Entities.Leak;
|
|
15096
|
-
dischargeParameters: Entities.DischargeParameters;
|
|
15097
|
-
substrate: Entities.Substrate;
|
|
15098
|
-
weather: Entities.Weather;
|
|
15099
|
-
dispersionParameters: Entities.DispersionParameters[];
|
|
15100
|
-
dispersionParameterCount: number;
|
|
15101
|
-
endPointConcentration: number;
|
|
15102
|
-
flammableParameters: Entities.FlammableParameters;
|
|
15103
|
-
explosionParameters: Entities.ExplosionParameters;
|
|
15104
|
-
dispersionFlamOutputConfigs: Entities.DispersionOutputConfig[];
|
|
15105
|
-
dispersionFlamOutputConfigCount: number;
|
|
15106
|
-
moleFractionToxic: number;
|
|
15107
|
-
dispersionToxicOutputConfigs: Entities.DispersionOutputConfig[];
|
|
15108
|
-
dispersionToxicOutputConfigCount: number;
|
|
15109
|
-
flammableOutputConfigs: Entities.FlammableOutputConfig[];
|
|
15110
|
-
flammableOutputConfigCount: number;
|
|
15111
|
-
explosionOutputConfigs: Entities.ExplosionOutputConfig[];
|
|
15112
|
-
explosionOutputConfigCount: number;
|
|
15113
|
-
explosionConfinedVolumes: Entities.ExplosionConfinedVolume[];
|
|
15114
|
-
explosionConfinedVolumeCount: number;
|
|
15115
|
-
|
|
15116
|
-
/**
|
|
15117
|
-
* VesselLeakFlamToxSimpleLinkedRun calculation request class.
|
|
15118
|
-
*
|
|
15119
|
-
* @param {Entities.Vessel} vessel - A Vessel entity.
|
|
15120
|
-
* @param {Entities.Leak} leak - A Leak entity.
|
|
15121
|
-
* @param {Entities.DischargeParameters} dischargeParameters - A Discharge Parameters entity.
|
|
15122
|
-
* @param {Entities.Substrate} substrate - A Substrate entity.
|
|
15123
|
-
* @param {Entities.Weather} weather - A Weather entity.
|
|
15124
|
-
* @param {Entities.DispersionParameters[]} dispersionParameters - An array of Dispersion Parameters.
|
|
15125
|
-
* @param {number} dispersionParameterCount - Number of Dispersion Parameters.
|
|
15126
|
-
* @param {number} endPointConcentration - Concentration at which the dispersion calculations will terminate (v/v fraction).
|
|
15127
|
-
* @param {Entities.FlammableParameters} flammableParameters - A Flammable Parameters entity.
|
|
15128
|
-
* @param {Entities.ExplosionParameters} explosionParameters - An Explosion Parameters entity.
|
|
15129
|
-
* @param {Entities.DispersionOutputConfig[]} dispersionFlamOutputConfigs - An array of Dispersion Output Configs for flammable concentrations of interest.
|
|
15130
|
-
* @param {number} dispersionFlamOutputConfigCount - Number of Dispersion Output Configs for flammable concentrations of interest.
|
|
15131
|
-
* @param {number} moleFractionToxic - Mole fraction of toxic component.
|
|
15132
|
-
* @param {Entities.DispersionOutputConfig[]} dispersionToxicOutputConfigs - An array of Dispersion Output Configs for toxic concentrations of interest.
|
|
15133
|
-
* @param {number} dispersionToxicOutputConfigCount - Number of Dispersion Output Configs for toxic concentrations of interest.
|
|
15134
|
-
* @param {Entities.FlammableOutputConfig[]} flammableOutputConfigs - An array of Flammable Output Configs for radiation levels of interest.
|
|
15135
|
-
* @param {number} flammableOutputConfigCount - Number of Flammable Ouput Configs for radiation levels of interest.
|
|
15136
|
-
* @param {Entities.ExplosionOutputConfig[]} explosionOutputConfigs - An array of Explosion Output Configs for overpressure levels of interest.
|
|
15137
|
-
* @param {number} explosionOutputConfigCount - Number of Explosion Output Configs for overpressure levels of interest.
|
|
15138
|
-
* @param {Entities.ExplosionConfinedVolume[]} explosionConfinedVolumes - An array of Explosion Confined Volumes.
|
|
15139
|
-
* @param {number} explosionConfinedVolumeCount - Number of Explosion Confined Volumes.
|
|
15140
|
-
*/
|
|
15141
|
-
constructor(
|
|
15142
|
-
vessel: Entities.Vessel,
|
|
15143
|
-
leak: Entities.Leak,
|
|
15144
|
-
dischargeParameters: Entities.DischargeParameters,
|
|
15145
|
-
substrate: Entities.Substrate,
|
|
15146
|
-
weather: Entities.Weather,
|
|
15147
|
-
dispersionParameters: Entities.DispersionParameters[],
|
|
15148
|
-
dispersionParameterCount: number,
|
|
15149
|
-
endPointConcentration: number,
|
|
15150
|
-
flammableParameters: Entities.FlammableParameters,
|
|
15151
|
-
explosionParameters: Entities.ExplosionParameters,
|
|
15152
|
-
dispersionFlamOutputConfigs: Entities.DispersionOutputConfig[],
|
|
15153
|
-
dispersionFlamOutputConfigCount: number,
|
|
15154
|
-
moleFractionToxic: number,
|
|
15155
|
-
dispersionToxicOutputConfigs: Entities.DispersionOutputConfig[],
|
|
15156
|
-
dispersionToxicOutputConfigCount: number,
|
|
15157
|
-
flammableOutputConfigs: Entities.FlammableOutputConfig[],
|
|
15158
|
-
flammableOutputConfigCount: number,
|
|
15159
|
-
explosionOutputConfigs: Entities.ExplosionOutputConfig[],
|
|
15160
|
-
explosionOutputConfigCount: number,
|
|
15161
|
-
explosionConfinedVolumes: Entities.ExplosionConfinedVolume[],
|
|
15162
|
-
explosionConfinedVolumeCount: number
|
|
15163
|
-
) {
|
|
15164
|
-
super();
|
|
15165
|
-
this.vessel = vessel;
|
|
15166
|
-
this.leak = leak;
|
|
15167
|
-
this.dischargeParameters = dischargeParameters;
|
|
15168
|
-
this.substrate = substrate;
|
|
15169
|
-
this.weather = weather;
|
|
15170
|
-
this.dispersionParameters = dispersionParameters;
|
|
15171
|
-
this.dispersionParameterCount = dispersionParameterCount;
|
|
15172
|
-
this.endPointConcentration = endPointConcentration;
|
|
15173
|
-
this.flammableParameters = flammableParameters;
|
|
15174
|
-
this.explosionParameters = explosionParameters;
|
|
15175
|
-
this.dispersionFlamOutputConfigs = dispersionFlamOutputConfigs;
|
|
15176
|
-
this.dispersionFlamOutputConfigCount = dispersionFlamOutputConfigCount;
|
|
15177
|
-
this.moleFractionToxic = moleFractionToxic;
|
|
15178
|
-
this.dispersionToxicOutputConfigs = dispersionToxicOutputConfigs;
|
|
15179
|
-
this.dispersionToxicOutputConfigCount = dispersionToxicOutputConfigCount;
|
|
15180
|
-
this.flammableOutputConfigs = flammableOutputConfigs;
|
|
15181
|
-
this.flammableOutputConfigCount = flammableOutputConfigCount;
|
|
15182
|
-
this.explosionOutputConfigs = explosionOutputConfigs;
|
|
15183
|
-
this.explosionOutputConfigCount = explosionOutputConfigCount;
|
|
15184
|
-
this.explosionConfinedVolumes = explosionConfinedVolumes;
|
|
15185
|
-
this.explosionConfinedVolumeCount = explosionConfinedVolumeCount;
|
|
15186
|
-
}
|
|
15187
|
-
}
|
|
15188
|
-
|
|
15189
|
-
export class VesselLeakFlamToxSimpleLinkedRunCalculationRequestSchema {
|
|
15190
|
-
schema: Joi.ObjectSchema;
|
|
15191
|
-
propertyTypes: Record<string, string>;
|
|
15192
|
-
|
|
15193
|
-
/**
|
|
15194
|
-
* Schema for the VesselLeakFlamToxSimpleLinkedRun calculation request.
|
|
15195
|
-
*/
|
|
15196
|
-
constructor() {
|
|
15197
|
-
this.schema = Joi.object({
|
|
15198
|
-
vessel: new EntitySchemas.VesselSchema().schema,
|
|
15199
|
-
leak: new EntitySchemas.LeakSchema().schema,
|
|
15200
|
-
dischargeParameters: new EntitySchemas.DischargeParametersSchema().schema,
|
|
15201
|
-
substrate: new EntitySchemas.SubstrateSchema().schema,
|
|
15202
|
-
weather: new EntitySchemas.WeatherSchema().schema,
|
|
15203
|
-
dispersionParameters: Joi.array().items(new EntitySchemas.DispersionParametersSchema().schema).allow(null),
|
|
15204
|
-
dispersionParameterCount: Joi.number().integer(),
|
|
15205
|
-
endPointConcentration: Joi.number().unsafe(),
|
|
15206
|
-
flammableParameters: new EntitySchemas.FlammableParametersSchema().schema,
|
|
15207
|
-
explosionParameters: new EntitySchemas.ExplosionParametersSchema().schema,
|
|
15208
|
-
dispersionFlamOutputConfigs: Joi.array().items(new EntitySchemas.DispersionOutputConfigSchema().schema).allow(null),
|
|
15209
|
-
dispersionFlamOutputConfigCount: Joi.number().integer(),
|
|
15210
|
-
moleFractionToxic: Joi.number().unsafe(),
|
|
15211
|
-
dispersionToxicOutputConfigs: Joi.array().items(new EntitySchemas.DispersionOutputConfigSchema().schema).allow(null),
|
|
15212
|
-
dispersionToxicOutputConfigCount: Joi.number().integer(),
|
|
15213
|
-
flammableOutputConfigs: Joi.array().items(new EntitySchemas.FlammableOutputConfigSchema().schema).allow(null),
|
|
15214
|
-
flammableOutputConfigCount: Joi.number().integer(),
|
|
15215
|
-
explosionOutputConfigs: Joi.array().items(new EntitySchemas.ExplosionOutputConfigSchema().schema).allow(null),
|
|
15216
|
-
explosionOutputConfigCount: Joi.number().integer(),
|
|
15217
|
-
explosionConfinedVolumes: Joi.array().items(new EntitySchemas.ExplosionConfinedVolumeSchema().schema).allow(null),
|
|
15218
|
-
explosionConfinedVolumeCount: Joi.number().integer(),
|
|
15219
|
-
}).unknown(true);
|
|
15220
|
-
|
|
15221
|
-
this.propertyTypes = {
|
|
15222
|
-
vessel: "Entities.Vessel",
|
|
15223
|
-
leak: "Entities.Leak",
|
|
15224
|
-
dischargeParameters: "Entities.DischargeParameters",
|
|
15225
|
-
substrate: "Entities.Substrate",
|
|
15226
|
-
weather: "Entities.Weather",
|
|
15227
|
-
dispersionParameters: "Entities.DispersionParameters[]",
|
|
15228
|
-
dispersionParameterCount: "number",
|
|
15229
|
-
endPointConcentration: "number",
|
|
15230
|
-
flammableParameters: "Entities.FlammableParameters",
|
|
15231
|
-
explosionParameters: "Entities.ExplosionParameters",
|
|
15232
|
-
dispersionFlamOutputConfigs: "Entities.DispersionOutputConfig[]",
|
|
15233
|
-
dispersionFlamOutputConfigCount: "number",
|
|
15234
|
-
moleFractionToxic: "number",
|
|
15235
|
-
dispersionToxicOutputConfigs: "Entities.DispersionOutputConfig[]",
|
|
15236
|
-
dispersionToxicOutputConfigCount: "number",
|
|
15237
|
-
flammableOutputConfigs: "Entities.FlammableOutputConfig[]",
|
|
15238
|
-
flammableOutputConfigCount: "number",
|
|
15239
|
-
explosionOutputConfigs: "Entities.ExplosionOutputConfig[]",
|
|
15240
|
-
explosionOutputConfigCount: "number",
|
|
15241
|
-
explosionConfinedVolumes: "Entities.ExplosionConfinedVolume[]",
|
|
15242
|
-
explosionConfinedVolumeCount: "number",
|
|
15243
|
-
};
|
|
15244
|
-
}
|
|
15245
|
-
|
|
15246
|
-
validate(data: VesselLeakFlamToxSimpleLinkedRunCalculationRequestSchemaData): VesselLeakFlamToxSimpleLinkedRunCalculationRequest {
|
|
15247
|
-
const { error, value } = this.schema.validate(data, { abortEarly: false });
|
|
15248
|
-
if (error) {
|
|
15249
|
-
throw new Error(`Validation error: ${error.details.map((x) => x.message).join(", ")}`);
|
|
15250
|
-
}
|
|
15251
|
-
return this.makeCalculationRequest(value);
|
|
15252
|
-
}
|
|
15253
|
-
|
|
15254
|
-
makeCalculationRequest(data: VesselLeakFlamToxSimpleLinkedRunCalculationRequestSchemaData): VesselLeakFlamToxSimpleLinkedRunCalculationRequest {
|
|
15255
|
-
return new VesselLeakFlamToxSimpleLinkedRunCalculationRequest(
|
|
15256
|
-
data.vessel,
|
|
15257
|
-
data.leak,
|
|
15258
|
-
data.dischargeParameters,
|
|
15259
|
-
data.substrate,
|
|
15260
|
-
data.weather,
|
|
15261
|
-
data.dispersionParameters,
|
|
15262
|
-
data.dispersionParameterCount,
|
|
15263
|
-
data.endPointConcentration,
|
|
15264
|
-
data.flammableParameters,
|
|
15265
|
-
data.explosionParameters,
|
|
15266
|
-
data.dispersionFlamOutputConfigs,
|
|
15267
|
-
data.dispersionFlamOutputConfigCount,
|
|
15268
|
-
data.moleFractionToxic,
|
|
15269
|
-
data.dispersionToxicOutputConfigs,
|
|
15270
|
-
data.dispersionToxicOutputConfigCount,
|
|
15271
|
-
data.flammableOutputConfigs,
|
|
15272
|
-
data.flammableOutputConfigCount,
|
|
15273
|
-
data.explosionOutputConfigs,
|
|
15274
|
-
data.explosionOutputConfigCount,
|
|
15275
|
-
data.explosionConfinedVolumes,
|
|
15276
|
-
data.explosionConfinedVolumeCount
|
|
15277
|
-
);
|
|
15278
|
-
}
|
|
15279
|
-
}
|
|
15280
|
-
|
|
15281
|
-
export class VesselLeakFlamToxSimpleLinkedRunCalculation extends CalculationBase {
|
|
15282
|
-
vessel: Entities.Vessel;
|
|
15283
|
-
leak: Entities.Leak;
|
|
15284
|
-
dischargeParameters: Entities.DischargeParameters;
|
|
15285
|
-
substrate: Entities.Substrate;
|
|
15286
|
-
weather: Entities.Weather;
|
|
15287
|
-
dispersionParameters: Entities.DispersionParameters[];
|
|
15288
|
-
dispersionParameterCount: number;
|
|
15289
|
-
endPointConcentration: number;
|
|
15290
|
-
flammableParameters: Entities.FlammableParameters;
|
|
15291
|
-
explosionParameters: Entities.ExplosionParameters;
|
|
15292
|
-
dispersionFlamOutputConfigs: Entities.DispersionOutputConfig[];
|
|
15293
|
-
dispersionFlamOutputConfigCount: number;
|
|
15294
|
-
moleFractionToxic: number;
|
|
15295
|
-
dispersionToxicOutputConfigs: Entities.DispersionOutputConfig[];
|
|
15296
|
-
dispersionToxicOutputConfigCount: number;
|
|
15297
|
-
flammableOutputConfigs: Entities.FlammableOutputConfig[];
|
|
15298
|
-
flammableOutputConfigCount: number;
|
|
15299
|
-
explosionOutputConfigs: Entities.ExplosionOutputConfig[];
|
|
15300
|
-
explosionOutputConfigCount: number;
|
|
15301
|
-
explosionConfinedVolumes: Entities.ExplosionConfinedVolume[];
|
|
15302
|
-
explosionConfinedVolumeCount: number;
|
|
15303
|
-
dischargeRecord?: Entities.DischargeRecord;
|
|
15304
|
-
distancesToJetFireRadiation?: number[];
|
|
15305
|
-
jetContourPoints?: Entities.LocalPosition[];
|
|
15306
|
-
nJetContourPoints?: number[];
|
|
15307
|
-
areaEllipseJet?: number[];
|
|
15308
|
-
distancesToFlamConcentration?: number[];
|
|
15309
|
-
flamConcentrationsUsed?: number[];
|
|
15310
|
-
flamConcContourPoints?: Entities.LocalPosition[];
|
|
15311
|
-
nFlamConcContourPoints?: number[];
|
|
15312
|
-
areaFootprintFlamConc?: number[];
|
|
15313
|
-
distancesToPoolFireRadiation?: number[];
|
|
15314
|
-
poolContourPoints?: Entities.LocalPosition[];
|
|
15315
|
-
nPoolContourPoints?: number[];
|
|
15316
|
-
areaEllipsePool?: number[];
|
|
15317
|
-
explosionOverpressureResults?: Entities.ExplosionOverpressureResult[];
|
|
15318
|
-
distancesToToxicConcentration?: number[];
|
|
15319
|
-
toxicConcentrationUsed?: number[];
|
|
15320
|
-
toxicConcContourPoints?: Entities.LocalPosition[];
|
|
15321
|
-
nToxicConcContourPoints?: number[];
|
|
15322
|
-
areaFootprintToxicConc?: number[];
|
|
15323
|
-
jetFireFlameResult?: Entities.FlameResult;
|
|
15324
|
-
poolFireFlameResult?: Entities.PoolFireFlameResult;
|
|
15325
|
-
|
|
15326
|
-
/**
|
|
15327
|
-
* Calculates maximum distance to a number of concentration, radiation and overpressure levels for flammable and toxic materials, given a vessel, leak and weather definition. Note
|
|
15328
|
-
that the toxic handling is simplistic - the concentrations levels are scaled based on the mole fraction of
|
|
15329
|
-
the toxic component present.
|
|
15330
|
-
*
|
|
15331
|
-
* @param {Entities.Vessel} vessel - A Vessel entity.
|
|
15332
|
-
* @param {Entities.Leak} leak - A Leak entity.
|
|
15333
|
-
* @param {Entities.DischargeParameters} dischargeParameters - A Discharge Parameters entity.
|
|
15334
|
-
* @param {Entities.Substrate} substrate - A Substrate entity.
|
|
15335
|
-
* @param {Entities.Weather} weather - A Weather entity.
|
|
15336
|
-
* @param {Entities.DispersionParameters[]} dispersionParameters - An array of Dispersion Parameters.
|
|
15337
|
-
* @param {number} dispersionParameterCount - Number of Dispersion Parameters.
|
|
15338
|
-
* @param {number} endPointConcentration - Concentration at which the dispersion calculations will terminate (v/v fraction).
|
|
15339
|
-
* @param {Entities.FlammableParameters} flammableParameters - A Flammable Parameters entity.
|
|
15340
|
-
* @param {Entities.ExplosionParameters} explosionParameters - An Explosion Parameters entity.
|
|
15341
|
-
* @param {Entities.DispersionOutputConfig[]} dispersionFlamOutputConfigs - An array of Dispersion Output Configs for flammable concentrations of interest.
|
|
15342
|
-
* @param {number} dispersionFlamOutputConfigCount - Number of Dispersion Output Configs for flammable concentrations of interest.
|
|
15343
|
-
* @param {number} moleFractionToxic - Mole fraction of toxic component.
|
|
15344
|
-
* @param {Entities.DispersionOutputConfig[]} dispersionToxicOutputConfigs - An array of Dispersion Output Configs for toxic concentrations of interest.
|
|
15345
|
-
* @param {number} dispersionToxicOutputConfigCount - Number of Dispersion Output Configs for toxic concentrations of interest.
|
|
15346
|
-
* @param {Entities.FlammableOutputConfig[]} flammableOutputConfigs - An array of Flammable Output Configs for radiation levels of interest.
|
|
15347
|
-
* @param {number} flammableOutputConfigCount - Number of Flammable Ouput Configs for radiation levels of interest.
|
|
15348
|
-
* @param {Entities.ExplosionOutputConfig[]} explosionOutputConfigs - An array of Explosion Output Configs for overpressure levels of interest.
|
|
15349
|
-
* @param {number} explosionOutputConfigCount - Number of Explosion Output Configs for overpressure levels of interest.
|
|
15350
|
-
* @param {Entities.ExplosionConfinedVolume[]} explosionConfinedVolumes - An array of Explosion Confined Volumes.
|
|
15351
|
-
* @param {number} explosionConfinedVolumeCount - Number of Explosion Confined Volumes.
|
|
15352
|
-
*/
|
|
15353
|
-
constructor(
|
|
15354
|
-
vessel: Entities.Vessel,
|
|
15355
|
-
leak: Entities.Leak,
|
|
15356
|
-
dischargeParameters: Entities.DischargeParameters,
|
|
15357
|
-
substrate: Entities.Substrate,
|
|
15358
|
-
weather: Entities.Weather,
|
|
15359
|
-
dispersionParameters: Entities.DispersionParameters[],
|
|
15360
|
-
dispersionParameterCount: number,
|
|
15361
|
-
endPointConcentration: number,
|
|
15362
|
-
flammableParameters: Entities.FlammableParameters,
|
|
15363
|
-
explosionParameters: Entities.ExplosionParameters,
|
|
15364
|
-
dispersionFlamOutputConfigs: Entities.DispersionOutputConfig[],
|
|
15365
|
-
dispersionFlamOutputConfigCount: number,
|
|
15366
|
-
moleFractionToxic: number,
|
|
15367
|
-
dispersionToxicOutputConfigs: Entities.DispersionOutputConfig[],
|
|
15368
|
-
dispersionToxicOutputConfigCount: number,
|
|
15369
|
-
flammableOutputConfigs: Entities.FlammableOutputConfig[],
|
|
15370
|
-
flammableOutputConfigCount: number,
|
|
15371
|
-
explosionOutputConfigs: Entities.ExplosionOutputConfig[],
|
|
15372
|
-
explosionOutputConfigCount: number,
|
|
15373
|
-
explosionConfinedVolumes: Entities.ExplosionConfinedVolume[],
|
|
15374
|
-
explosionConfinedVolumeCount: number
|
|
15375
|
-
) {
|
|
15376
|
-
super();
|
|
15377
|
-
this.vessel = vessel;
|
|
15378
|
-
this.leak = leak;
|
|
15379
|
-
this.dischargeParameters = dischargeParameters;
|
|
15380
|
-
this.substrate = substrate;
|
|
15381
|
-
this.weather = weather;
|
|
15382
|
-
this.dispersionParameters = dispersionParameters;
|
|
15383
|
-
this.dispersionParameterCount = dispersionParameterCount;
|
|
15384
|
-
this.endPointConcentration = endPointConcentration;
|
|
15385
|
-
this.flammableParameters = flammableParameters;
|
|
15386
|
-
this.explosionParameters = explosionParameters;
|
|
15387
|
-
this.dispersionFlamOutputConfigs = dispersionFlamOutputConfigs;
|
|
15388
|
-
this.dispersionFlamOutputConfigCount = dispersionFlamOutputConfigCount;
|
|
15389
|
-
this.moleFractionToxic = moleFractionToxic;
|
|
15390
|
-
this.dispersionToxicOutputConfigs = dispersionToxicOutputConfigs;
|
|
15391
|
-
this.dispersionToxicOutputConfigCount = dispersionToxicOutputConfigCount;
|
|
15392
|
-
this.flammableOutputConfigs = flammableOutputConfigs;
|
|
15393
|
-
this.flammableOutputConfigCount = flammableOutputConfigCount;
|
|
15394
|
-
this.explosionOutputConfigs = explosionOutputConfigs;
|
|
15395
|
-
this.explosionOutputConfigCount = explosionOutputConfigCount;
|
|
15396
|
-
this.explosionConfinedVolumes = explosionConfinedVolumes;
|
|
15397
|
-
this.explosionConfinedVolumeCount = explosionConfinedVolumeCount;
|
|
15398
|
-
}
|
|
15399
|
-
|
|
15400
|
-
async run() {
|
|
15401
|
-
try {
|
|
15402
|
-
const request = new VesselLeakFlamToxSimpleLinkedRunCalculationRequest(
|
|
15403
|
-
this.vessel,
|
|
15404
|
-
this.leak,
|
|
15405
|
-
this.dischargeParameters,
|
|
15406
|
-
this.substrate,
|
|
15407
|
-
this.weather,
|
|
15408
|
-
this.dispersionParameters,
|
|
15409
|
-
this.dispersionParameterCount,
|
|
15410
|
-
this.endPointConcentration,
|
|
15411
|
-
this.flammableParameters,
|
|
15412
|
-
this.explosionParameters,
|
|
15413
|
-
this.dispersionFlamOutputConfigs,
|
|
15414
|
-
this.dispersionFlamOutputConfigCount,
|
|
15415
|
-
this.moleFractionToxic,
|
|
15416
|
-
this.dispersionToxicOutputConfigs,
|
|
15417
|
-
this.dispersionToxicOutputConfigCount,
|
|
15418
|
-
this.flammableOutputConfigs,
|
|
15419
|
-
this.flammableOutputConfigCount,
|
|
15420
|
-
this.explosionOutputConfigs,
|
|
15421
|
-
this.explosionOutputConfigCount,
|
|
15422
|
-
this.explosionConfinedVolumes,
|
|
15423
|
-
this.explosionConfinedVolumeCount
|
|
15424
|
-
);
|
|
15425
|
-
|
|
15426
|
-
const schema = new VesselLeakFlamToxSimpleLinkedRunCalculationRequestSchema();
|
|
15427
|
-
const validatedRequest = schema.validate(request);
|
|
15428
|
-
|
|
15429
|
-
const requestJson = JSON.stringify(validatedRequest);
|
|
15430
|
-
const url = `${getAnalyticsApiTarget()}VesselLeakFlamToxSimpleLinkedRun?clientId=${getClientAliasId()}`;
|
|
15431
|
-
|
|
15432
|
-
this.resultCode = Enums.ResultCode.UNEXPECTED_APPLICATION_ERROR;
|
|
15433
|
-
|
|
15434
|
-
const response = await this.postRequest(url, requestJson);
|
|
15435
|
-
|
|
15436
|
-
if (response.status >= 200 && response.status < 300) {
|
|
15437
|
-
const schema = new VesselLeakFlamToxSimpleLinkedRunCalculationResponseSchema();
|
|
15438
|
-
const validatedResponse = schema.validate(response.data);
|
|
15439
|
-
|
|
15440
|
-
this.resultCode = validatedResponse.resultCode;
|
|
15441
|
-
if (this.resultCode === Enums.ResultCode.SUCCESS) {
|
|
15442
|
-
this.dischargeRecord = validatedResponse.dischargeRecord;
|
|
15443
|
-
this.distancesToJetFireRadiation = validatedResponse.distancesToJetFireRadiation;
|
|
15444
|
-
this.jetContourPoints = validatedResponse.jetContourPoints;
|
|
15445
|
-
this.nJetContourPoints = validatedResponse.nJetContourPoints;
|
|
15446
|
-
this.areaEllipseJet = validatedResponse.areaEllipseJet;
|
|
15447
|
-
this.distancesToFlamConcentration = validatedResponse.distancesToFlamConcentration;
|
|
15448
|
-
this.flamConcentrationsUsed = validatedResponse.flamConcentrationsUsed;
|
|
15449
|
-
this.flamConcContourPoints = validatedResponse.flamConcContourPoints;
|
|
15450
|
-
this.nFlamConcContourPoints = validatedResponse.nFlamConcContourPoints;
|
|
15451
|
-
this.areaFootprintFlamConc = validatedResponse.areaFootprintFlamConc;
|
|
15452
|
-
this.distancesToPoolFireRadiation = validatedResponse.distancesToPoolFireRadiation;
|
|
15453
|
-
this.poolContourPoints = validatedResponse.poolContourPoints;
|
|
15454
|
-
this.nPoolContourPoints = validatedResponse.nPoolContourPoints;
|
|
15455
|
-
this.areaEllipsePool = validatedResponse.areaEllipsePool;
|
|
15456
|
-
this.explosionOverpressureResults = validatedResponse.explosionOverpressureResults;
|
|
15457
|
-
this.distancesToToxicConcentration = validatedResponse.distancesToToxicConcentration;
|
|
15458
|
-
this.toxicConcentrationUsed = validatedResponse.toxicConcentrationUsed;
|
|
15459
|
-
this.toxicConcContourPoints = validatedResponse.toxicConcContourPoints;
|
|
15460
|
-
this.nToxicConcContourPoints = validatedResponse.nToxicConcContourPoints;
|
|
15461
|
-
this.areaFootprintToxicConc = validatedResponse.areaFootprintToxicConc;
|
|
15462
|
-
this.jetFireFlameResult = validatedResponse.jetFireFlameResult;
|
|
15463
|
-
this.poolFireFlameResult = validatedResponse.poolFireFlameResult;
|
|
15464
|
-
this.resultCode = validatedResponse.resultCode;
|
|
15465
|
-
this.messages = validatedResponse.messages ?? [];
|
|
15466
|
-
this.calculationElapsedTime = validatedResponse.calculationElapsedTime;
|
|
15467
|
-
this.operationId = validatedResponse.operationId;
|
|
15468
|
-
} else {
|
|
15469
|
-
this.messages.push(...(validatedResponse.messages ?? []));
|
|
15470
|
-
}
|
|
15471
|
-
} else {
|
|
15472
|
-
this.handleFailedResponse(response);
|
|
15473
|
-
}
|
|
15474
|
-
} catch (error) {
|
|
15475
|
-
if (error instanceof Error) {
|
|
15476
|
-
this.messages.push(`Error: ${error.message}`);
|
|
15477
|
-
} else {
|
|
15478
|
-
this.messages.push(`Unexpected error: ${JSON.stringify(error)}`);
|
|
15479
|
-
}
|
|
15480
|
-
console.error(error);
|
|
15481
|
-
this.resultCode = Enums.ResultCode.UNEXPECTED_APPLICATION_ERROR;
|
|
15482
|
-
}
|
|
15483
|
-
|
|
15484
|
-
return this.resultCode;
|
|
15485
|
-
}
|
|
15486
|
-
|
|
15487
|
-
toString() {
|
|
15488
|
-
const parts = ["* VesselLeakFlamToxSimpleLinkedRun"];
|
|
15489
|
-
|
|
15490
|
-
parts.push(`dischargeRecord: ${String(this.dischargeRecord)}`);
|
|
15491
|
-
parts.push("*** distancesToJetFireRadiation:");
|
|
15492
|
-
parts.push(
|
|
15493
|
-
this.distancesToJetFireRadiation && this.distancesToJetFireRadiation.length > 0
|
|
15494
|
-
? this.distancesToJetFireRadiation.map((point) => `distancesToJetFireRadiationElement: ${point}`).join("\n")
|
|
15495
|
-
: "distancesToJetFireRadiation does not contain any elements"
|
|
15496
|
-
);
|
|
15497
|
-
parts.push("*** jetContourPoints:");
|
|
15498
|
-
parts.push(
|
|
15499
|
-
this.jetContourPoints && this.jetContourPoints.length > 0
|
|
15500
|
-
? this.jetContourPoints.map((point) => `jetContourPointsElement: ${point}`).join("\n")
|
|
15501
|
-
: "jetContourPoints does not contain any elements"
|
|
15502
|
-
);
|
|
15503
|
-
parts.push("*** nJetContourPoints:");
|
|
15504
|
-
parts.push(
|
|
15505
|
-
this.nJetContourPoints && this.nJetContourPoints.length > 0
|
|
15506
|
-
? this.nJetContourPoints.map((point) => `nJetContourPointsElement: ${point}`).join("\n")
|
|
15507
|
-
: "nJetContourPoints does not contain any elements"
|
|
15508
|
-
);
|
|
15509
|
-
parts.push("*** areaEllipseJet:");
|
|
15510
|
-
parts.push(
|
|
15511
|
-
this.areaEllipseJet && this.areaEllipseJet.length > 0
|
|
15512
|
-
? this.areaEllipseJet.map((point) => `areaEllipseJetElement: ${point}`).join("\n")
|
|
15513
|
-
: "areaEllipseJet does not contain any elements"
|
|
15514
|
-
);
|
|
15515
|
-
parts.push("*** distancesToFlamConcentration:");
|
|
15516
|
-
parts.push(
|
|
15517
|
-
this.distancesToFlamConcentration && this.distancesToFlamConcentration.length > 0
|
|
15518
|
-
? this.distancesToFlamConcentration.map((point) => `distancesToFlamConcentrationElement: ${point}`).join("\n")
|
|
15519
|
-
: "distancesToFlamConcentration does not contain any elements"
|
|
15520
|
-
);
|
|
15521
|
-
parts.push("*** flamConcentrationsUsed:");
|
|
15522
|
-
parts.push(
|
|
15523
|
-
this.flamConcentrationsUsed && this.flamConcentrationsUsed.length > 0
|
|
15524
|
-
? this.flamConcentrationsUsed.map((point) => `flamConcentrationsUsedElement: ${point}`).join("\n")
|
|
15525
|
-
: "flamConcentrationsUsed does not contain any elements"
|
|
15526
|
-
);
|
|
15527
|
-
parts.push("*** flamConcContourPoints:");
|
|
15528
|
-
parts.push(
|
|
15529
|
-
this.flamConcContourPoints && this.flamConcContourPoints.length > 0
|
|
15530
|
-
? this.flamConcContourPoints.map((point) => `flamConcContourPointsElement: ${point}`).join("\n")
|
|
15531
|
-
: "flamConcContourPoints does not contain any elements"
|
|
15532
|
-
);
|
|
15533
|
-
parts.push("*** nFlamConcContourPoints:");
|
|
15534
|
-
parts.push(
|
|
15535
|
-
this.nFlamConcContourPoints && this.nFlamConcContourPoints.length > 0
|
|
15536
|
-
? this.nFlamConcContourPoints.map((point) => `nFlamConcContourPointsElement: ${point}`).join("\n")
|
|
15537
|
-
: "nFlamConcContourPoints does not contain any elements"
|
|
15538
|
-
);
|
|
15539
|
-
parts.push("*** areaFootprintFlamConc:");
|
|
15540
|
-
parts.push(
|
|
15541
|
-
this.areaFootprintFlamConc && this.areaFootprintFlamConc.length > 0
|
|
15542
|
-
? this.areaFootprintFlamConc.map((point) => `areaFootprintFlamConcElement: ${point}`).join("\n")
|
|
15543
|
-
: "areaFootprintFlamConc does not contain any elements"
|
|
15544
|
-
);
|
|
15545
|
-
parts.push("*** distancesToPoolFireRadiation:");
|
|
15546
|
-
parts.push(
|
|
15547
|
-
this.distancesToPoolFireRadiation && this.distancesToPoolFireRadiation.length > 0
|
|
15548
|
-
? this.distancesToPoolFireRadiation.map((point) => `distancesToPoolFireRadiationElement: ${point}`).join("\n")
|
|
15549
|
-
: "distancesToPoolFireRadiation does not contain any elements"
|
|
15550
|
-
);
|
|
15551
|
-
parts.push("*** poolContourPoints:");
|
|
15552
|
-
parts.push(
|
|
15553
|
-
this.poolContourPoints && this.poolContourPoints.length > 0
|
|
15554
|
-
? this.poolContourPoints.map((point) => `poolContourPointsElement: ${point}`).join("\n")
|
|
15555
|
-
: "poolContourPoints does not contain any elements"
|
|
15556
|
-
);
|
|
15557
|
-
parts.push("*** nPoolContourPoints:");
|
|
15558
|
-
parts.push(
|
|
15559
|
-
this.nPoolContourPoints && this.nPoolContourPoints.length > 0
|
|
15560
|
-
? this.nPoolContourPoints.map((point) => `nPoolContourPointsElement: ${point}`).join("\n")
|
|
15561
|
-
: "nPoolContourPoints does not contain any elements"
|
|
15562
|
-
);
|
|
15563
|
-
parts.push("*** areaEllipsePool:");
|
|
15564
|
-
parts.push(
|
|
15565
|
-
this.areaEllipsePool && this.areaEllipsePool.length > 0
|
|
15566
|
-
? this.areaEllipsePool.map((point) => `areaEllipsePoolElement: ${point}`).join("\n")
|
|
15567
|
-
: "areaEllipsePool does not contain any elements"
|
|
15568
|
-
);
|
|
15569
|
-
parts.push("*** explosionOverpressureResults:");
|
|
15570
|
-
parts.push(
|
|
15571
|
-
this.explosionOverpressureResults && this.explosionOverpressureResults.length > 0
|
|
15572
|
-
? this.explosionOverpressureResults.map((point) => `explosionOverpressureResultsElement: ${point}`).join("\n")
|
|
15573
|
-
: "explosionOverpressureResults does not contain any elements"
|
|
15574
|
-
);
|
|
15575
|
-
parts.push("*** distancesToToxicConcentration:");
|
|
15576
|
-
parts.push(
|
|
15577
|
-
this.distancesToToxicConcentration && this.distancesToToxicConcentration.length > 0
|
|
15578
|
-
? this.distancesToToxicConcentration.map((point) => `distancesToToxicConcentrationElement: ${point}`).join("\n")
|
|
15579
|
-
: "distancesToToxicConcentration does not contain any elements"
|
|
15580
|
-
);
|
|
15581
|
-
parts.push("*** toxicConcentrationUsed:");
|
|
15582
|
-
parts.push(
|
|
15583
|
-
this.toxicConcentrationUsed && this.toxicConcentrationUsed.length > 0
|
|
15584
|
-
? this.toxicConcentrationUsed.map((point) => `toxicConcentrationUsedElement: ${point}`).join("\n")
|
|
15585
|
-
: "toxicConcentrationUsed does not contain any elements"
|
|
15586
|
-
);
|
|
15587
|
-
parts.push("*** toxicConcContourPoints:");
|
|
15588
|
-
parts.push(
|
|
15589
|
-
this.toxicConcContourPoints && this.toxicConcContourPoints.length > 0
|
|
15590
|
-
? this.toxicConcContourPoints.map((point) => `toxicConcContourPointsElement: ${point}`).join("\n")
|
|
15591
|
-
: "toxicConcContourPoints does not contain any elements"
|
|
15592
|
-
);
|
|
15593
|
-
parts.push("*** nToxicConcContourPoints:");
|
|
15594
|
-
parts.push(
|
|
15595
|
-
this.nToxicConcContourPoints && this.nToxicConcContourPoints.length > 0
|
|
15596
|
-
? this.nToxicConcContourPoints.map((point) => `nToxicConcContourPointsElement: ${point}`).join("\n")
|
|
15597
|
-
: "nToxicConcContourPoints does not contain any elements"
|
|
15598
|
-
);
|
|
15599
|
-
parts.push("*** areaFootprintToxicConc:");
|
|
15600
|
-
parts.push(
|
|
15601
|
-
this.areaFootprintToxicConc && this.areaFootprintToxicConc.length > 0
|
|
15602
|
-
? this.areaFootprintToxicConc.map((point) => `areaFootprintToxicConcElement: ${point}`).join("\n")
|
|
15603
|
-
: "areaFootprintToxicConc does not contain any elements"
|
|
15604
|
-
);
|
|
15605
|
-
parts.push(`jetFireFlameResult: ${String(this.jetFireFlameResult)}`);
|
|
15606
|
-
parts.push(`poolFireFlameResult: ${String(this.poolFireFlameResult)}`);
|
|
15607
|
-
parts.push(`resultCode: ${String(this.resultCode)}`);
|
|
15608
|
-
parts.push("*** messages:");
|
|
15609
|
-
parts.push(`messages: ${this.messages !== undefined ? this.messages : "(None)"}`);
|
|
15610
|
-
parts.push(`calculationElapsedTime: ${this.calculationElapsedTime !== undefined ? this.calculationElapsedTime : "(None)"}`);
|
|
15611
|
-
parts.push(`operationId: ${this.operationId !== undefined ? this.operationId : "(None)"}`);
|
|
15612
|
-
|
|
15613
|
-
return parts.join("\n");
|
|
15614
|
-
}
|
|
15615
|
-
}
|
|
15616
|
-
|
|
15617
|
-
export class VesselLeakFlamToxSimpleLinkedRunCalculationResponse extends CalculationResponseBase {
|
|
15618
|
-
dischargeRecord: Entities.DischargeRecord;
|
|
15619
|
-
distancesToJetFireRadiation: number[];
|
|
15620
|
-
jetContourPoints: Entities.LocalPosition[];
|
|
15621
|
-
nJetContourPoints: number[];
|
|
15622
|
-
areaEllipseJet: number[];
|
|
15623
|
-
distancesToFlamConcentration: number[];
|
|
15624
|
-
flamConcentrationsUsed: number[];
|
|
15625
|
-
flamConcContourPoints: Entities.LocalPosition[];
|
|
15626
|
-
nFlamConcContourPoints: number[];
|
|
15627
|
-
areaFootprintFlamConc: number[];
|
|
15628
|
-
distancesToPoolFireRadiation: number[];
|
|
15629
|
-
poolContourPoints: Entities.LocalPosition[];
|
|
15630
|
-
nPoolContourPoints: number[];
|
|
15631
|
-
areaEllipsePool: number[];
|
|
15632
|
-
explosionOverpressureResults: Entities.ExplosionOverpressureResult[];
|
|
15633
|
-
distancesToToxicConcentration: number[];
|
|
15634
|
-
toxicConcentrationUsed: number[];
|
|
15635
|
-
toxicConcContourPoints: Entities.LocalPosition[];
|
|
15636
|
-
nToxicConcContourPoints: number[];
|
|
15637
|
-
areaFootprintToxicConc: number[];
|
|
15638
|
-
jetFireFlameResult: Entities.FlameResult;
|
|
15639
|
-
poolFireFlameResult: Entities.PoolFireFlameResult;
|
|
15640
|
-
|
|
15641
|
-
/**
|
|
15642
|
-
* VesselLeakFlamToxSimpleLinkedRun calculation response class.
|
|
15643
|
-
*
|
|
15644
|
-
* @param {Entities.DischargeRecord} dischargeRecord - A Discharge Record entity.
|
|
15645
|
-
* @param {number[]} distancesToJetFireRadiation - An array of distances to jet fire radiation levels, ordered according to the Flammable Output Configs.
|
|
15646
|
-
* @param {Entities.LocalPosition[]} jetContourPoints - An array of jet fire radiation ellipse contour points, ordered according to the Flammable Output Configs.
|
|
15647
|
-
* @param {number[]} nJetContourPoints - An array of the number of jet fire radiation ellipse contour points, ordered according to the Flammable Output Configs.
|
|
15648
|
-
* @param {number[]} areaEllipseJet - An array of areas of the jet fire ellipses, ordered according to the Flammable Output Configs.
|
|
15649
|
-
* @param {number[]} distancesToFlamConcentration - An array of distances to flammable concentration levels, ordered according to the Dispersion Output Configs for flammable concentrations of interest.
|
|
15650
|
-
* @param {number[]} flamConcentrationsUsed - An array of flammable concentration levels used in the calculations, ordered according to the Dispersion Output Configs for flammable concentrations of interest.
|
|
15651
|
-
* @param {Entities.LocalPosition[]} flamConcContourPoints - An array of maximum flammable concentration footprint contour points, ordered according to the Dispersion Output Configs for flammable concentrations of interest.
|
|
15652
|
-
* @param {number[]} nFlamConcContourPoints - An array of the number of maximum flammable concentration footprint contour points, ordered according to the Dispersion Output Configs for flammable concentrations of interest.
|
|
15653
|
-
* @param {number[]} areaFootprintFlamConc - An array of areas of the maximum flammable concentration footprint contours, ordered according to the Dispersion Output Configs for flammable concentrations of interest.
|
|
15654
|
-
* @param {number[]} distancesToPoolFireRadiation - An array of distances to pool fire radiation levels, ordered according to the Flammable Output Configs.
|
|
15655
|
-
* @param {Entities.LocalPosition[]} poolContourPoints - An array of pool fire radiation contour points, ordered according to the Flammable Output Configs.
|
|
15656
|
-
* @param {number[]} nPoolContourPoints - An array of the number of pool fire radiation contour points, ordered according to the Flammable Output Configs.
|
|
15657
|
-
* @param {number[]} areaEllipsePool - An array of areas of the pool fire ellipses, ordered according to the Flammable Output Configs.
|
|
15658
|
-
* @param {Entities.ExplosionOverpressureResult[]} explosionOverpressureResults - An array of Explosion Overpressure Results, ordered according to the Explosion Output Configs.
|
|
15659
|
-
* @param {number[]} distancesToToxicConcentration - An array of distances to toxic concentration levels, ordered according to the Dispersion Output Configs for toxic concentrations of interest.
|
|
15660
|
-
* @param {number[]} toxicConcentrationUsed - An array of toxic concentration levels used in the calculations, ordered according to the Dispersion Output Configs for toxic concentrations of interest.
|
|
15661
|
-
* @param {Entities.LocalPosition[]} toxicConcContourPoints - An array of maximum toxic concentration footprint contour points, ordered according to the Dispersion Output Configs for toxic concentrations of interest.
|
|
15662
|
-
* @param {number[]} nToxicConcContourPoints - An array of the number of maximum toxic concentration footprint contour points, ordered according to the Dispersion Output Configs for toxic concentrations of interest.
|
|
15663
|
-
* @param {number[]} areaFootprintToxicConc - An array of areas of the maximum toxic concentration footprint contours, ordered according to the Dispersion Output Configs for toxic concentrations of interest.
|
|
15664
|
-
* @param {Entities.FlameResult} jetFireFlameResult - A Flame Results entity, for jet fire.
|
|
15665
|
-
* @param {Entities.PoolFireFlameResult} poolFireFlameResult - A Pool Fire Flame Results entity, for pool fire.
|
|
15666
|
-
*/
|
|
15667
|
-
constructor(
|
|
15668
|
-
dischargeRecord: Entities.DischargeRecord,
|
|
15669
|
-
distancesToJetFireRadiation: number[],
|
|
15670
|
-
jetContourPoints: Entities.LocalPosition[],
|
|
15671
|
-
nJetContourPoints: number[],
|
|
15672
|
-
areaEllipseJet: number[],
|
|
15673
|
-
distancesToFlamConcentration: number[],
|
|
15674
|
-
flamConcentrationsUsed: number[],
|
|
15675
|
-
flamConcContourPoints: Entities.LocalPosition[],
|
|
15676
|
-
nFlamConcContourPoints: number[],
|
|
15677
|
-
areaFootprintFlamConc: number[],
|
|
15678
|
-
distancesToPoolFireRadiation: number[],
|
|
15679
|
-
poolContourPoints: Entities.LocalPosition[],
|
|
15680
|
-
nPoolContourPoints: number[],
|
|
15681
|
-
areaEllipsePool: number[],
|
|
15682
|
-
explosionOverpressureResults: Entities.ExplosionOverpressureResult[],
|
|
15683
|
-
distancesToToxicConcentration: number[],
|
|
15684
|
-
toxicConcentrationUsed: number[],
|
|
15685
|
-
toxicConcContourPoints: Entities.LocalPosition[],
|
|
15686
|
-
nToxicConcContourPoints: number[],
|
|
15687
|
-
areaFootprintToxicConc: number[],
|
|
15688
|
-
jetFireFlameResult: Entities.FlameResult,
|
|
15689
|
-
poolFireFlameResult: Entities.PoolFireFlameResult,
|
|
15690
|
-
resultCode: Enums.ResultCode,
|
|
15691
|
-
messages: string[],
|
|
15692
|
-
calculationElapsedTime: number,
|
|
15693
|
-
operationId: string
|
|
15694
|
-
) {
|
|
15695
|
-
super();
|
|
15696
|
-
this.dischargeRecord = dischargeRecord;
|
|
15697
|
-
this.distancesToJetFireRadiation = distancesToJetFireRadiation;
|
|
15698
|
-
this.jetContourPoints = jetContourPoints;
|
|
15699
|
-
this.nJetContourPoints = nJetContourPoints;
|
|
15700
|
-
this.areaEllipseJet = areaEllipseJet;
|
|
15701
|
-
this.distancesToFlamConcentration = distancesToFlamConcentration;
|
|
15702
|
-
this.flamConcentrationsUsed = flamConcentrationsUsed;
|
|
15703
|
-
this.flamConcContourPoints = flamConcContourPoints;
|
|
15704
|
-
this.nFlamConcContourPoints = nFlamConcContourPoints;
|
|
15705
|
-
this.areaFootprintFlamConc = areaFootprintFlamConc;
|
|
15706
|
-
this.distancesToPoolFireRadiation = distancesToPoolFireRadiation;
|
|
15707
|
-
this.poolContourPoints = poolContourPoints;
|
|
15708
|
-
this.nPoolContourPoints = nPoolContourPoints;
|
|
15709
|
-
this.areaEllipsePool = areaEllipsePool;
|
|
15710
|
-
this.explosionOverpressureResults = explosionOverpressureResults;
|
|
15711
|
-
this.distancesToToxicConcentration = distancesToToxicConcentration;
|
|
15712
|
-
this.toxicConcentrationUsed = toxicConcentrationUsed;
|
|
15713
|
-
this.toxicConcContourPoints = toxicConcContourPoints;
|
|
15714
|
-
this.nToxicConcContourPoints = nToxicConcContourPoints;
|
|
15715
|
-
this.areaFootprintToxicConc = areaFootprintToxicConc;
|
|
15716
|
-
this.jetFireFlameResult = jetFireFlameResult;
|
|
15717
|
-
this.poolFireFlameResult = poolFireFlameResult;
|
|
15718
|
-
this.resultCode = resultCode;
|
|
15719
|
-
this.messages = messages;
|
|
15720
|
-
this.calculationElapsedTime = calculationElapsedTime;
|
|
15721
|
-
this.operationId = operationId;
|
|
15722
|
-
}
|
|
15723
|
-
|
|
15724
|
-
initialiseFromDictionary(data: { [key: string]: unknown }) {
|
|
15725
|
-
if (data.dischargeRecord) {
|
|
15726
|
-
this.dischargeRecord = new Entities.DischargeRecord();
|
|
15727
|
-
this.dischargeRecord.initialiseFromDictionary(data.dischargeRecord);
|
|
15728
|
-
}
|
|
15729
|
-
if (data.distancesToJetFireRadiation && Array.isArray(data.distancesToJetFireRadiation)) {
|
|
15730
|
-
this.distancesToJetFireRadiation = data.distancesToJetFireRadiation.map((item) => parseFloat(item));
|
|
15731
|
-
}
|
|
15732
|
-
if (data.jetContourPoints && Array.isArray(data.jetContourPoints)) {
|
|
15733
|
-
this.jetContourPoints = data.jetContourPoints.map(
|
|
15734
|
-
(item) => {
|
|
15735
|
-
const record = new Entities.LocalPosition();
|
|
15736
|
-
record.initialiseFromDictionary(item);
|
|
15737
|
-
return record;
|
|
15738
|
-
}
|
|
15739
|
-
);
|
|
15740
|
-
}
|
|
15741
|
-
if (data.nJetContourPoints && Array.isArray(data.nJetContourPoints)) {
|
|
15742
|
-
this.nJetContourPoints = data.nJetContourPoints.map((item) => parseInt(item));
|
|
15743
|
-
}
|
|
15744
|
-
if (data.areaEllipseJet && Array.isArray(data.areaEllipseJet)) {
|
|
15745
|
-
this.areaEllipseJet = data.areaEllipseJet.map((item) => parseFloat(item));
|
|
15746
|
-
}
|
|
15747
|
-
if (data.distancesToFlamConcentration && Array.isArray(data.distancesToFlamConcentration)) {
|
|
15748
|
-
this.distancesToFlamConcentration = data.distancesToFlamConcentration.map((item) => parseFloat(item));
|
|
15749
|
-
}
|
|
15750
|
-
if (data.flamConcentrationsUsed && Array.isArray(data.flamConcentrationsUsed)) {
|
|
15751
|
-
this.flamConcentrationsUsed = data.flamConcentrationsUsed.map((item) => parseFloat(item));
|
|
15752
|
-
}
|
|
15753
|
-
if (data.flamConcContourPoints && Array.isArray(data.flamConcContourPoints)) {
|
|
15754
|
-
this.flamConcContourPoints = data.flamConcContourPoints.map(
|
|
15755
|
-
(item) => {
|
|
15756
|
-
const record = new Entities.LocalPosition();
|
|
15757
|
-
record.initialiseFromDictionary(item);
|
|
15758
|
-
return record;
|
|
15759
|
-
}
|
|
15760
|
-
);
|
|
15761
|
-
}
|
|
15762
|
-
if (data.nFlamConcContourPoints && Array.isArray(data.nFlamConcContourPoints)) {
|
|
15763
|
-
this.nFlamConcContourPoints = data.nFlamConcContourPoints.map((item) => parseInt(item));
|
|
15764
|
-
}
|
|
15765
|
-
if (data.areaFootprintFlamConc && Array.isArray(data.areaFootprintFlamConc)) {
|
|
15766
|
-
this.areaFootprintFlamConc = data.areaFootprintFlamConc.map((item) => parseFloat(item));
|
|
15767
|
-
}
|
|
15768
|
-
if (data.distancesToPoolFireRadiation && Array.isArray(data.distancesToPoolFireRadiation)) {
|
|
15769
|
-
this.distancesToPoolFireRadiation = data.distancesToPoolFireRadiation.map((item) => parseFloat(item));
|
|
15770
|
-
}
|
|
15771
|
-
if (data.poolContourPoints && Array.isArray(data.poolContourPoints)) {
|
|
15772
|
-
this.poolContourPoints = data.poolContourPoints.map(
|
|
15773
|
-
(item) => {
|
|
15774
|
-
const record = new Entities.LocalPosition();
|
|
15775
|
-
record.initialiseFromDictionary(item);
|
|
15776
|
-
return record;
|
|
15777
|
-
}
|
|
15778
|
-
);
|
|
15779
|
-
}
|
|
15780
|
-
if (data.nPoolContourPoints && Array.isArray(data.nPoolContourPoints)) {
|
|
15781
|
-
this.nPoolContourPoints = data.nPoolContourPoints.map((item) => parseInt(item));
|
|
15782
|
-
}
|
|
15783
|
-
if (data.areaEllipsePool && Array.isArray(data.areaEllipsePool)) {
|
|
15784
|
-
this.areaEllipsePool = data.areaEllipsePool.map((item) => parseFloat(item));
|
|
15785
|
-
}
|
|
15786
|
-
if (data.explosionOverpressureResults && Array.isArray(data.explosionOverpressureResults)) {
|
|
15787
|
-
this.explosionOverpressureResults = data.explosionOverpressureResults.map(
|
|
15788
|
-
(item) => {
|
|
15789
|
-
const record = new Entities.ExplosionOverpressureResult();
|
|
15790
|
-
record.initialiseFromDictionary(item);
|
|
15791
|
-
return record;
|
|
15792
|
-
}
|
|
15793
|
-
);
|
|
15794
|
-
}
|
|
15795
|
-
if (data.distancesToToxicConcentration && Array.isArray(data.distancesToToxicConcentration)) {
|
|
15796
|
-
this.distancesToToxicConcentration = data.distancesToToxicConcentration.map((item) => parseFloat(item));
|
|
15797
|
-
}
|
|
15798
|
-
if (data.toxicConcentrationUsed && Array.isArray(data.toxicConcentrationUsed)) {
|
|
15799
|
-
this.toxicConcentrationUsed = data.toxicConcentrationUsed.map((item) => parseFloat(item));
|
|
15800
|
-
}
|
|
15801
|
-
if (data.toxicConcContourPoints && Array.isArray(data.toxicConcContourPoints)) {
|
|
15802
|
-
this.toxicConcContourPoints = data.toxicConcContourPoints.map(
|
|
15803
|
-
(item) => {
|
|
15804
|
-
const record = new Entities.LocalPosition();
|
|
15805
|
-
record.initialiseFromDictionary(item);
|
|
15806
|
-
return record;
|
|
15807
|
-
}
|
|
15808
|
-
);
|
|
15809
|
-
}
|
|
15810
|
-
if (data.nToxicConcContourPoints && Array.isArray(data.nToxicConcContourPoints)) {
|
|
15811
|
-
this.nToxicConcContourPoints = data.nToxicConcContourPoints.map((item) => parseInt(item));
|
|
15812
|
-
}
|
|
15813
|
-
if (data.areaFootprintToxicConc && Array.isArray(data.areaFootprintToxicConc)) {
|
|
15814
|
-
this.areaFootprintToxicConc = data.areaFootprintToxicConc.map((item) => parseFloat(item));
|
|
15815
|
-
}
|
|
15816
|
-
if (data.jetFireFlameResult) {
|
|
15817
|
-
this.jetFireFlameResult = new Entities.FlameResult();
|
|
15818
|
-
this.jetFireFlameResult.initialiseFromDictionary(data.jetFireFlameResult);
|
|
15819
|
-
}
|
|
15820
|
-
if (data.poolFireFlameResult) {
|
|
15821
|
-
this.poolFireFlameResult = new Entities.PoolFireFlameResult();
|
|
15822
|
-
this.poolFireFlameResult.initialiseFromDictionary(data.poolFireFlameResult);
|
|
15823
|
-
}
|
|
15824
|
-
if (data.resultCode !== undefined && (typeof data.resultCode === "string" || typeof data.resultCode === "number")) {
|
|
15825
|
-
this.resultCode = data.resultCode as Enums.ResultCode;
|
|
15826
|
-
}
|
|
15827
|
-
this.messages = this.messages ?? [];
|
|
15828
|
-
if (data.messages && Array.isArray(data.messages)) {
|
|
15829
|
-
this.messages.push(...data.messages);
|
|
15830
|
-
}
|
|
15831
|
-
if (data.calculationElapsedTime !== undefined && typeof data.calculationElapsedTime === "number") {
|
|
15832
|
-
this.calculationElapsedTime = data.calculationElapsedTime as number;
|
|
15833
|
-
}
|
|
15834
|
-
if (data.operationId !== undefined && typeof data.operationId === "string") {
|
|
15835
|
-
this.operationId = data.operationId as string;
|
|
15836
|
-
}
|
|
15837
|
-
}
|
|
15838
|
-
}
|
|
15839
|
-
|
|
15840
|
-
export interface VesselLeakFlamToxSimpleLinkedRunCalculationResponseSchemaData {
|
|
15841
|
-
dischargeRecord: Entities.DischargeRecord;
|
|
15842
|
-
distancesToJetFireRadiation: number[];
|
|
15843
|
-
jetContourPoints: Entities.LocalPosition[];
|
|
15844
|
-
nJetContourPoints: number[];
|
|
15845
|
-
areaEllipseJet: number[];
|
|
15846
|
-
distancesToFlamConcentration: number[];
|
|
15847
|
-
flamConcentrationsUsed: number[];
|
|
15848
|
-
flamConcContourPoints: Entities.LocalPosition[];
|
|
15849
|
-
nFlamConcContourPoints: number[];
|
|
15850
|
-
areaFootprintFlamConc: number[];
|
|
15851
|
-
distancesToPoolFireRadiation: number[];
|
|
15852
|
-
poolContourPoints: Entities.LocalPosition[];
|
|
15853
|
-
nPoolContourPoints: number[];
|
|
15854
|
-
areaEllipsePool: number[];
|
|
15855
|
-
explosionOverpressureResults: Entities.ExplosionOverpressureResult[];
|
|
15856
|
-
distancesToToxicConcentration: number[];
|
|
15857
|
-
toxicConcentrationUsed: number[];
|
|
15858
|
-
toxicConcContourPoints: Entities.LocalPosition[];
|
|
15859
|
-
nToxicConcContourPoints: number[];
|
|
15860
|
-
areaFootprintToxicConc: number[];
|
|
15861
|
-
jetFireFlameResult: Entities.FlameResult;
|
|
15862
|
-
poolFireFlameResult: Entities.PoolFireFlameResult;
|
|
15863
|
-
resultCode: Enums.ResultCode;
|
|
15864
|
-
messages: string[];
|
|
15865
|
-
calculationElapsedTime: number;
|
|
15866
|
-
operationId: string;
|
|
15867
|
-
}
|
|
15868
|
-
|
|
15869
|
-
export class VesselLeakFlamToxSimpleLinkedRunCalculationResponseSchema {
|
|
15870
|
-
schema: Joi.ObjectSchema;
|
|
15871
|
-
propertyTypes: Record<string, string>;
|
|
15872
|
-
|
|
15873
|
-
/**
|
|
15874
|
-
* Schema for the VesselLeakFlamToxSimpleLinkedRun calculation response.
|
|
15875
|
-
*/
|
|
15876
|
-
constructor() {
|
|
15877
|
-
this.schema = Joi.object({
|
|
15878
|
-
dischargeRecord: new EntitySchemas.DischargeRecordSchema().schema,
|
|
15879
|
-
distancesToJetFireRadiation: Joi.array().items(Joi.number().unsafe()).allow(null),
|
|
15880
|
-
jetContourPoints: Joi.array().items(new EntitySchemas.LocalPositionSchema().schema).allow(null),
|
|
15881
|
-
nJetContourPoints: Joi.array().items(Joi.number().integer()).allow(null),
|
|
15882
|
-
areaEllipseJet: Joi.array().items(Joi.number().unsafe()).allow(null),
|
|
15883
|
-
distancesToFlamConcentration: Joi.array().items(Joi.number().unsafe()).allow(null),
|
|
15884
|
-
flamConcentrationsUsed: Joi.array().items(Joi.number().unsafe()).allow(null),
|
|
15885
|
-
flamConcContourPoints: Joi.array().items(new EntitySchemas.LocalPositionSchema().schema).allow(null),
|
|
15886
|
-
nFlamConcContourPoints: Joi.array().items(Joi.number().integer()).allow(null),
|
|
15887
|
-
areaFootprintFlamConc: Joi.array().items(Joi.number().unsafe()).allow(null),
|
|
15888
|
-
distancesToPoolFireRadiation: Joi.array().items(Joi.number().unsafe()).allow(null),
|
|
15889
|
-
poolContourPoints: Joi.array().items(new EntitySchemas.LocalPositionSchema().schema).allow(null),
|
|
15890
|
-
nPoolContourPoints: Joi.array().items(Joi.number().integer()).allow(null),
|
|
15891
|
-
areaEllipsePool: Joi.array().items(Joi.number().unsafe()).allow(null),
|
|
15892
|
-
explosionOverpressureResults: Joi.array().items(new EntitySchemas.ExplosionOverpressureResultSchema().schema).allow(null),
|
|
15893
|
-
distancesToToxicConcentration: Joi.array().items(Joi.number().unsafe()).allow(null),
|
|
15894
|
-
toxicConcentrationUsed: Joi.array().items(Joi.number().unsafe()).allow(null),
|
|
15895
|
-
toxicConcContourPoints: Joi.array().items(new EntitySchemas.LocalPositionSchema().schema).allow(null),
|
|
15896
|
-
nToxicConcContourPoints: Joi.array().items(Joi.number().integer()).allow(null),
|
|
15897
|
-
areaFootprintToxicConc: Joi.array().items(Joi.number().unsafe()).allow(null),
|
|
15898
|
-
jetFireFlameResult: new EntitySchemas.FlameResultSchema().schema,
|
|
15899
|
-
poolFireFlameResult: new EntitySchemas.PoolFireFlameResultSchema().schema,
|
|
15900
|
-
resultCode: Joi.string().valid(...Object.values(Enums.ResultCode)),
|
|
15901
|
-
messages: Joi.array().items(Joi.string()),
|
|
15902
|
-
calculationElapsedTime: Joi.number().unsafe(),
|
|
15903
|
-
operationId: Joi.string().uuid().allow(null),
|
|
15904
|
-
}).unknown(true);
|
|
15905
|
-
|
|
15906
|
-
this.propertyTypes = {
|
|
15907
|
-
dischargeRecord: "Entities.DischargeRecord",
|
|
15908
|
-
distancesToJetFireRadiation: "number[]",
|
|
15909
|
-
jetContourPoints: "Entities.LocalPosition[]",
|
|
15910
|
-
nJetContourPoints: "number[]",
|
|
15911
|
-
areaEllipseJet: "number[]",
|
|
15912
|
-
distancesToFlamConcentration: "number[]",
|
|
15913
|
-
flamConcentrationsUsed: "number[]",
|
|
15914
|
-
flamConcContourPoints: "Entities.LocalPosition[]",
|
|
15915
|
-
nFlamConcContourPoints: "number[]",
|
|
15916
|
-
areaFootprintFlamConc: "number[]",
|
|
15917
|
-
distancesToPoolFireRadiation: "number[]",
|
|
15918
|
-
poolContourPoints: "Entities.LocalPosition[]",
|
|
15919
|
-
nPoolContourPoints: "number[]",
|
|
15920
|
-
areaEllipsePool: "number[]",
|
|
15921
|
-
explosionOverpressureResults: "Entities.ExplosionOverpressureResult[]",
|
|
15922
|
-
distancesToToxicConcentration: "number[]",
|
|
15923
|
-
toxicConcentrationUsed: "number[]",
|
|
15924
|
-
toxicConcContourPoints: "Entities.LocalPosition[]",
|
|
15925
|
-
nToxicConcContourPoints: "number[]",
|
|
15926
|
-
areaFootprintToxicConc: "number[]",
|
|
15927
|
-
jetFireFlameResult: "Entities.FlameResult",
|
|
15928
|
-
poolFireFlameResult: "Entities.PoolFireFlameResult",
|
|
15929
|
-
};
|
|
15930
|
-
}
|
|
15931
|
-
|
|
15932
|
-
validate(data: VesselLeakFlamToxSimpleLinkedRunCalculationResponseSchemaData): VesselLeakFlamToxSimpleLinkedRunCalculationResponse {
|
|
15933
|
-
const { error, value } = this.schema.validate(data, { abortEarly: false });
|
|
15934
|
-
if (error) {
|
|
15935
|
-
throw new Error(`Validation error: ${error.details.map((x) => x.message).join(", ")}`);
|
|
15936
|
-
}
|
|
15937
|
-
return this.makeCalculationResponse(value);
|
|
15938
|
-
}
|
|
15939
|
-
|
|
15940
|
-
makeCalculationResponse(data: VesselLeakFlamToxSimpleLinkedRunCalculationResponseSchemaData): VesselLeakFlamToxSimpleLinkedRunCalculationResponse {
|
|
15941
|
-
return new VesselLeakFlamToxSimpleLinkedRunCalculationResponse(
|
|
15942
|
-
data.dischargeRecord,
|
|
15943
|
-
data.distancesToJetFireRadiation,
|
|
15944
|
-
data.jetContourPoints,
|
|
15945
|
-
data.nJetContourPoints,
|
|
15946
|
-
data.areaEllipseJet,
|
|
15947
|
-
data.distancesToFlamConcentration,
|
|
15948
|
-
data.flamConcentrationsUsed,
|
|
15949
|
-
data.flamConcContourPoints,
|
|
15950
|
-
data.nFlamConcContourPoints,
|
|
15951
|
-
data.areaFootprintFlamConc,
|
|
15952
|
-
data.distancesToPoolFireRadiation,
|
|
15953
|
-
data.poolContourPoints,
|
|
15954
|
-
data.nPoolContourPoints,
|
|
15955
|
-
data.areaEllipsePool,
|
|
15956
|
-
data.explosionOverpressureResults,
|
|
15957
|
-
data.distancesToToxicConcentration,
|
|
15958
|
-
data.toxicConcentrationUsed,
|
|
15959
|
-
data.toxicConcContourPoints,
|
|
15960
|
-
data.nToxicConcContourPoints,
|
|
15961
|
-
data.areaFootprintToxicConc,
|
|
15962
|
-
data.jetFireFlameResult,
|
|
15963
|
-
data.poolFireFlameResult,
|
|
15964
|
-
data.resultCode,
|
|
15965
|
-
data.messages,
|
|
15966
|
-
data.calculationElapsedTime,
|
|
15967
|
-
data.operationId
|
|
15968
|
-
);
|
|
15969
|
-
}
|
|
15970
|
-
}
|
|
15971
|
-
|
|
15972
|
-
export interface VesselLeakLinkedRunCalculationRequestSchemaData {
|
|
15973
|
-
vessel: Entities.Vessel;
|
|
15974
|
-
leak: Entities.Leak;
|
|
15975
|
-
dischargeParameters: Entities.DischargeParameters;
|
|
15976
|
-
substrate: Entities.Substrate;
|
|
15977
|
-
weather: Entities.Weather;
|
|
15978
|
-
dispersionParameters: Entities.DispersionParameters[];
|
|
15979
|
-
dispersionParameterCount: number;
|
|
15980
|
-
endPointConcentration: number;
|
|
15981
|
-
flammableParameters: Entities.FlammableParameters;
|
|
15982
|
-
explosionParameters: Entities.ExplosionParameters;
|
|
15983
|
-
dispersionFlamOutputConfigs: Entities.DispersionOutputConfig[];
|
|
15984
|
-
dispersionFlamOutputConfigCount: number;
|
|
15985
|
-
dispersionToxicOutputConfigs: Entities.DispersionOutputConfig[];
|
|
15986
|
-
dispersionToxicOutputConfigCount: number;
|
|
15987
|
-
flammableOutputConfigs: Entities.FlammableOutputConfig[];
|
|
15988
|
-
flammableOutputConfigCount: number;
|
|
15989
|
-
explosionOutputConfigs: Entities.ExplosionOutputConfig[];
|
|
15990
|
-
explosionOutputConfigCount: number;
|
|
15991
|
-
explosionConfinedVolumes: Entities.ExplosionConfinedVolume[];
|
|
15992
|
-
explosionConfinedVolumeCount: number;
|
|
15993
|
-
}
|
|
15994
|
-
|
|
15995
|
-
class VesselLeakLinkedRunCalculationRequest extends CalculationRequestBase {
|
|
15996
|
-
vessel: Entities.Vessel;
|
|
15997
|
-
leak: Entities.Leak;
|
|
15998
|
-
dischargeParameters: Entities.DischargeParameters;
|
|
15999
|
-
substrate: Entities.Substrate;
|
|
16000
|
-
weather: Entities.Weather;
|
|
16001
|
-
dispersionParameters: Entities.DispersionParameters[];
|
|
16002
|
-
dispersionParameterCount: number;
|
|
16003
|
-
endPointConcentration: number;
|
|
16004
|
-
flammableParameters: Entities.FlammableParameters;
|
|
16005
|
-
explosionParameters: Entities.ExplosionParameters;
|
|
16006
|
-
dispersionFlamOutputConfigs: Entities.DispersionOutputConfig[];
|
|
16007
|
-
dispersionFlamOutputConfigCount: number;
|
|
16008
|
-
dispersionToxicOutputConfigs: Entities.DispersionOutputConfig[];
|
|
16009
|
-
dispersionToxicOutputConfigCount: number;
|
|
16010
|
-
flammableOutputConfigs: Entities.FlammableOutputConfig[];
|
|
16011
|
-
flammableOutputConfigCount: number;
|
|
16012
|
-
explosionOutputConfigs: Entities.ExplosionOutputConfig[];
|
|
16013
|
-
explosionOutputConfigCount: number;
|
|
16014
|
-
explosionConfinedVolumes: Entities.ExplosionConfinedVolume[];
|
|
16015
|
-
explosionConfinedVolumeCount: number;
|
|
16016
|
-
|
|
16017
|
-
/**
|
|
16018
|
-
* VesselLeakLinkedRun calculation request class.
|
|
16019
|
-
*
|
|
16020
|
-
* @param {Entities.Vessel} vessel - A Vessel entity.
|
|
16021
|
-
* @param {Entities.Leak} leak - A Leak entity.
|
|
16022
|
-
* @param {Entities.DischargeParameters} dischargeParameters - A Discharge Parameters entity.
|
|
16023
|
-
* @param {Entities.Substrate} substrate - A Substrate entity.
|
|
16024
|
-
* @param {Entities.Weather} weather - A Weather entity.
|
|
16025
|
-
* @param {Entities.DispersionParameters[]} dispersionParameters - An array of Dispersion Parameters.
|
|
16026
|
-
* @param {number} dispersionParameterCount - Number of Dispersion Parameters.
|
|
16027
|
-
* @param {number} endPointConcentration - Concentration at which the dispersion calculations will terminate (v/v fraction).
|
|
16028
|
-
* @param {Entities.FlammableParameters} flammableParameters - A Flammable Parameters entity.
|
|
16029
|
-
* @param {Entities.ExplosionParameters} explosionParameters - An Explosion Parameters entity.
|
|
16030
|
-
* @param {Entities.DispersionOutputConfig[]} dispersionFlamOutputConfigs - An array of Dispersion Output Configs for flammable concentrations of interest.
|
|
16031
|
-
* @param {number} dispersionFlamOutputConfigCount - Number of Dispersion Output Configs for flammable concentrations of interest.
|
|
16032
|
-
* @param {Entities.DispersionOutputConfig[]} dispersionToxicOutputConfigs - An array of Dispersion Output Configs for toxic concentrations of interest.
|
|
16033
|
-
* @param {number} dispersionToxicOutputConfigCount - Number of Dispersion Output Configs for toxic concentrations of interest.
|
|
16034
|
-
* @param {Entities.FlammableOutputConfig[]} flammableOutputConfigs - An array of Flammable Output Configs for radiation levels of interest.
|
|
16035
|
-
* @param {number} flammableOutputConfigCount - Number of Flammable Ouput Configs for radiation levels of interest.
|
|
16036
|
-
* @param {Entities.ExplosionOutputConfig[]} explosionOutputConfigs - An array of Explosion Output Configs for overpressure levels of interest.
|
|
16037
|
-
* @param {number} explosionOutputConfigCount - Number of Explosion Output Configs for overpressure levels of interest.
|
|
16038
|
-
* @param {Entities.ExplosionConfinedVolume[]} explosionConfinedVolumes - An array of Explosion Confined Volumes.
|
|
16039
|
-
* @param {number} explosionConfinedVolumeCount - Number of Explosion Confined Volumes.
|
|
16040
|
-
*/
|
|
16041
|
-
constructor(
|
|
16042
|
-
vessel: Entities.Vessel,
|
|
16043
|
-
leak: Entities.Leak,
|
|
16044
|
-
dischargeParameters: Entities.DischargeParameters,
|
|
16045
|
-
substrate: Entities.Substrate,
|
|
16046
|
-
weather: Entities.Weather,
|
|
16047
|
-
dispersionParameters: Entities.DispersionParameters[],
|
|
16048
|
-
dispersionParameterCount: number,
|
|
16049
|
-
endPointConcentration: number,
|
|
16050
|
-
flammableParameters: Entities.FlammableParameters,
|
|
16051
|
-
explosionParameters: Entities.ExplosionParameters,
|
|
16052
|
-
dispersionFlamOutputConfigs: Entities.DispersionOutputConfig[],
|
|
16053
|
-
dispersionFlamOutputConfigCount: number,
|
|
16054
|
-
dispersionToxicOutputConfigs: Entities.DispersionOutputConfig[],
|
|
16055
|
-
dispersionToxicOutputConfigCount: number,
|
|
16056
|
-
flammableOutputConfigs: Entities.FlammableOutputConfig[],
|
|
16057
|
-
flammableOutputConfigCount: number,
|
|
16058
|
-
explosionOutputConfigs: Entities.ExplosionOutputConfig[],
|
|
16059
|
-
explosionOutputConfigCount: number,
|
|
16060
|
-
explosionConfinedVolumes: Entities.ExplosionConfinedVolume[],
|
|
16061
|
-
explosionConfinedVolumeCount: number
|
|
16062
|
-
) {
|
|
16063
|
-
super();
|
|
16064
|
-
this.vessel = vessel;
|
|
16065
|
-
this.leak = leak;
|
|
16066
|
-
this.dischargeParameters = dischargeParameters;
|
|
16067
|
-
this.substrate = substrate;
|
|
16068
|
-
this.weather = weather;
|
|
16069
|
-
this.dispersionParameters = dispersionParameters;
|
|
16070
|
-
this.dispersionParameterCount = dispersionParameterCount;
|
|
16071
|
-
this.endPointConcentration = endPointConcentration;
|
|
16072
|
-
this.flammableParameters = flammableParameters;
|
|
16073
|
-
this.explosionParameters = explosionParameters;
|
|
16074
|
-
this.dispersionFlamOutputConfigs = dispersionFlamOutputConfigs;
|
|
16075
|
-
this.dispersionFlamOutputConfigCount = dispersionFlamOutputConfigCount;
|
|
16076
|
-
this.dispersionToxicOutputConfigs = dispersionToxicOutputConfigs;
|
|
16077
|
-
this.dispersionToxicOutputConfigCount = dispersionToxicOutputConfigCount;
|
|
16078
|
-
this.flammableOutputConfigs = flammableOutputConfigs;
|
|
16079
|
-
this.flammableOutputConfigCount = flammableOutputConfigCount;
|
|
16080
|
-
this.explosionOutputConfigs = explosionOutputConfigs;
|
|
16081
|
-
this.explosionOutputConfigCount = explosionOutputConfigCount;
|
|
16082
|
-
this.explosionConfinedVolumes = explosionConfinedVolumes;
|
|
16083
|
-
this.explosionConfinedVolumeCount = explosionConfinedVolumeCount;
|
|
16084
|
-
}
|
|
16085
|
-
}
|
|
16086
|
-
|
|
16087
|
-
export class VesselLeakLinkedRunCalculationRequestSchema {
|
|
16088
|
-
schema: Joi.ObjectSchema;
|
|
16089
|
-
propertyTypes: Record<string, string>;
|
|
16090
|
-
|
|
16091
|
-
/**
|
|
16092
|
-
* Schema for the VesselLeakLinkedRun calculation request.
|
|
16093
|
-
*/
|
|
16094
|
-
constructor() {
|
|
16095
|
-
this.schema = Joi.object({
|
|
16096
|
-
vessel: new EntitySchemas.VesselSchema().schema,
|
|
16097
|
-
leak: new EntitySchemas.LeakSchema().schema,
|
|
16098
|
-
dischargeParameters: new EntitySchemas.DischargeParametersSchema().schema,
|
|
16099
|
-
substrate: new EntitySchemas.SubstrateSchema().schema,
|
|
16100
|
-
weather: new EntitySchemas.WeatherSchema().schema,
|
|
16101
|
-
dispersionParameters: Joi.array().items(new EntitySchemas.DispersionParametersSchema().schema).allow(null),
|
|
16102
|
-
dispersionParameterCount: Joi.number().integer(),
|
|
16103
|
-
endPointConcentration: Joi.number().unsafe(),
|
|
16104
|
-
flammableParameters: new EntitySchemas.FlammableParametersSchema().schema,
|
|
16105
|
-
explosionParameters: new EntitySchemas.ExplosionParametersSchema().schema,
|
|
16106
|
-
dispersionFlamOutputConfigs: Joi.array().items(new EntitySchemas.DispersionOutputConfigSchema().schema).allow(null),
|
|
16107
|
-
dispersionFlamOutputConfigCount: Joi.number().integer(),
|
|
16108
|
-
dispersionToxicOutputConfigs: Joi.array().items(new EntitySchemas.DispersionOutputConfigSchema().schema).allow(null),
|
|
16109
|
-
dispersionToxicOutputConfigCount: Joi.number().integer(),
|
|
16110
|
-
flammableOutputConfigs: Joi.array().items(new EntitySchemas.FlammableOutputConfigSchema().schema).allow(null),
|
|
16111
|
-
flammableOutputConfigCount: Joi.number().integer(),
|
|
16112
|
-
explosionOutputConfigs: Joi.array().items(new EntitySchemas.ExplosionOutputConfigSchema().schema).allow(null),
|
|
16113
|
-
explosionOutputConfigCount: Joi.number().integer(),
|
|
16114
|
-
explosionConfinedVolumes: Joi.array().items(new EntitySchemas.ExplosionConfinedVolumeSchema().schema).allow(null),
|
|
16115
|
-
explosionConfinedVolumeCount: Joi.number().integer(),
|
|
16116
|
-
}).unknown(true);
|
|
16117
|
-
|
|
16118
|
-
this.propertyTypes = {
|
|
16119
|
-
vessel: "Entities.Vessel",
|
|
16120
|
-
leak: "Entities.Leak",
|
|
16121
|
-
dischargeParameters: "Entities.DischargeParameters",
|
|
16122
|
-
substrate: "Entities.Substrate",
|
|
16123
|
-
weather: "Entities.Weather",
|
|
16124
|
-
dispersionParameters: "Entities.DispersionParameters[]",
|
|
16125
|
-
dispersionParameterCount: "number",
|
|
16126
|
-
endPointConcentration: "number",
|
|
16127
|
-
flammableParameters: "Entities.FlammableParameters",
|
|
16128
|
-
explosionParameters: "Entities.ExplosionParameters",
|
|
16129
|
-
dispersionFlamOutputConfigs: "Entities.DispersionOutputConfig[]",
|
|
16130
|
-
dispersionFlamOutputConfigCount: "number",
|
|
16131
|
-
dispersionToxicOutputConfigs: "Entities.DispersionOutputConfig[]",
|
|
16132
|
-
dispersionToxicOutputConfigCount: "number",
|
|
16133
|
-
flammableOutputConfigs: "Entities.FlammableOutputConfig[]",
|
|
16134
|
-
flammableOutputConfigCount: "number",
|
|
16135
|
-
explosionOutputConfigs: "Entities.ExplosionOutputConfig[]",
|
|
16136
|
-
explosionOutputConfigCount: "number",
|
|
16137
|
-
explosionConfinedVolumes: "Entities.ExplosionConfinedVolume[]",
|
|
16138
|
-
explosionConfinedVolumeCount: "number",
|
|
16139
|
-
};
|
|
16140
|
-
}
|
|
16141
|
-
|
|
16142
|
-
validate(data: VesselLeakLinkedRunCalculationRequestSchemaData): VesselLeakLinkedRunCalculationRequest {
|
|
16143
|
-
const { error, value } = this.schema.validate(data, { abortEarly: false });
|
|
16144
|
-
if (error) {
|
|
16145
|
-
throw new Error(`Validation error: ${error.details.map((x) => x.message).join(", ")}`);
|
|
16146
|
-
}
|
|
16147
|
-
return this.makeCalculationRequest(value);
|
|
16148
|
-
}
|
|
16149
|
-
|
|
16150
|
-
makeCalculationRequest(data: VesselLeakLinkedRunCalculationRequestSchemaData): VesselLeakLinkedRunCalculationRequest {
|
|
16151
|
-
return new VesselLeakLinkedRunCalculationRequest(
|
|
16152
|
-
data.vessel,
|
|
16153
|
-
data.leak,
|
|
16154
|
-
data.dischargeParameters,
|
|
16155
|
-
data.substrate,
|
|
16156
|
-
data.weather,
|
|
16157
|
-
data.dispersionParameters,
|
|
16158
|
-
data.dispersionParameterCount,
|
|
16159
|
-
data.endPointConcentration,
|
|
16160
|
-
data.flammableParameters,
|
|
16161
|
-
data.explosionParameters,
|
|
16162
|
-
data.dispersionFlamOutputConfigs,
|
|
16163
|
-
data.dispersionFlamOutputConfigCount,
|
|
16164
|
-
data.dispersionToxicOutputConfigs,
|
|
16165
|
-
data.dispersionToxicOutputConfigCount,
|
|
16166
|
-
data.flammableOutputConfigs,
|
|
16167
|
-
data.flammableOutputConfigCount,
|
|
16168
|
-
data.explosionOutputConfigs,
|
|
16169
|
-
data.explosionOutputConfigCount,
|
|
16170
|
-
data.explosionConfinedVolumes,
|
|
16171
|
-
data.explosionConfinedVolumeCount
|
|
16172
|
-
);
|
|
16173
|
-
}
|
|
16174
|
-
}
|
|
16175
|
-
|
|
16176
|
-
export class VesselLeakLinkedRunCalculation extends CalculationBase {
|
|
16177
|
-
vessel: Entities.Vessel;
|
|
16178
|
-
leak: Entities.Leak;
|
|
16179
|
-
dischargeParameters: Entities.DischargeParameters;
|
|
16180
|
-
substrate: Entities.Substrate;
|
|
16181
|
-
weather: Entities.Weather;
|
|
16182
|
-
dispersionParameters: Entities.DispersionParameters[];
|
|
16183
|
-
dispersionParameterCount: number;
|
|
16184
|
-
endPointConcentration: number;
|
|
16185
|
-
flammableParameters: Entities.FlammableParameters;
|
|
16186
|
-
explosionParameters: Entities.ExplosionParameters;
|
|
16187
|
-
dispersionFlamOutputConfigs: Entities.DispersionOutputConfig[];
|
|
16188
|
-
dispersionFlamOutputConfigCount: number;
|
|
16189
|
-
dispersionToxicOutputConfigs: Entities.DispersionOutputConfig[];
|
|
16190
|
-
dispersionToxicOutputConfigCount: number;
|
|
16191
|
-
flammableOutputConfigs: Entities.FlammableOutputConfig[];
|
|
16192
|
-
flammableOutputConfigCount: number;
|
|
16193
|
-
explosionOutputConfigs: Entities.ExplosionOutputConfig[];
|
|
16194
|
-
explosionOutputConfigCount: number;
|
|
16195
|
-
explosionConfinedVolumes: Entities.ExplosionConfinedVolume[];
|
|
16196
|
-
explosionConfinedVolumeCount: number;
|
|
16197
|
-
dischargeRecord?: Entities.DischargeRecord;
|
|
16198
|
-
distancesToJetFireRadiation?: number[];
|
|
16199
|
-
jetContourPoints?: Entities.LocalPosition[];
|
|
16200
|
-
nJetContourPoints?: number[];
|
|
16201
|
-
areaEllipseJet?: number[];
|
|
16202
|
-
distancesToFlamConcentration?: number[];
|
|
16203
|
-
flamConcentrationsUsed?: number[];
|
|
16204
|
-
flamConcContourPoints?: Entities.LocalPosition[];
|
|
16205
|
-
nFlamConcContourPoints?: number[];
|
|
16206
|
-
areaFootprintFlamConc?: number[];
|
|
16207
|
-
distancesToPoolFireRadiation?: number[];
|
|
16208
|
-
poolContourPoints?: Entities.LocalPosition[];
|
|
16209
|
-
nPoolContourPoints?: number[];
|
|
16210
|
-
areaEllipsePool?: number[];
|
|
16211
|
-
explosionOverpressureResults?: Entities.ExplosionOverpressureResult[];
|
|
16212
|
-
distancesToToxicConcentration?: number[];
|
|
16213
|
-
toxicConcentrationUsed?: number[];
|
|
16214
|
-
toxicConcContourPoints?: Entities.LocalPosition[];
|
|
16215
|
-
nToxicConcContourPoints?: number[];
|
|
16216
|
-
areaFootprintToxicConc?: number[];
|
|
16217
|
-
jetFireFlameResult?: Entities.FlameResult;
|
|
16218
|
-
poolFireFlameResult?: Entities.PoolFireFlameResult;
|
|
16219
|
-
|
|
16220
|
-
/**
|
|
16221
|
-
* Calculates maximum distance to a number of concentration, radiation and overpressure levels for flammable and toxic materials, given a vessel, leak and weather definition.
|
|
16222
|
-
*
|
|
16223
|
-
* @param {Entities.Vessel} vessel - A Vessel entity.
|
|
16224
|
-
* @param {Entities.Leak} leak - A Leak entity.
|
|
16225
|
-
* @param {Entities.DischargeParameters} dischargeParameters - A Discharge Parameters entity.
|
|
16226
|
-
* @param {Entities.Substrate} substrate - A Substrate entity.
|
|
16227
|
-
* @param {Entities.Weather} weather - A Weather entity.
|
|
16228
|
-
* @param {Entities.DispersionParameters[]} dispersionParameters - An array of Dispersion Parameters.
|
|
16229
|
-
* @param {number} dispersionParameterCount - Number of Dispersion Parameters.
|
|
16230
|
-
* @param {number} endPointConcentration - Concentration at which the dispersion calculations will terminate (v/v fraction).
|
|
16231
|
-
* @param {Entities.FlammableParameters} flammableParameters - A Flammable Parameters entity.
|
|
16232
|
-
* @param {Entities.ExplosionParameters} explosionParameters - An Explosion Parameters entity.
|
|
16233
|
-
* @param {Entities.DispersionOutputConfig[]} dispersionFlamOutputConfigs - An array of Dispersion Output Configs for flammable concentrations of interest.
|
|
16234
|
-
* @param {number} dispersionFlamOutputConfigCount - Number of Dispersion Output Configs for flammable concentrations of interest.
|
|
16235
|
-
* @param {Entities.DispersionOutputConfig[]} dispersionToxicOutputConfigs - An array of Dispersion Output Configs for toxic concentrations of interest.
|
|
16236
|
-
* @param {number} dispersionToxicOutputConfigCount - Number of Dispersion Output Configs for toxic concentrations of interest.
|
|
16237
|
-
* @param {Entities.FlammableOutputConfig[]} flammableOutputConfigs - An array of Flammable Output Configs for radiation levels of interest.
|
|
16238
|
-
* @param {number} flammableOutputConfigCount - Number of Flammable Ouput Configs for radiation levels of interest.
|
|
16239
|
-
* @param {Entities.ExplosionOutputConfig[]} explosionOutputConfigs - An array of Explosion Output Configs for overpressure levels of interest.
|
|
16240
|
-
* @param {number} explosionOutputConfigCount - Number of Explosion Output Configs for overpressure levels of interest.
|
|
16241
|
-
* @param {Entities.ExplosionConfinedVolume[]} explosionConfinedVolumes - An array of Explosion Confined Volumes.
|
|
16242
|
-
* @param {number} explosionConfinedVolumeCount - Number of Explosion Confined Volumes.
|
|
16243
|
-
*/
|
|
16244
|
-
constructor(
|
|
16245
|
-
vessel: Entities.Vessel,
|
|
16246
|
-
leak: Entities.Leak,
|
|
16247
|
-
dischargeParameters: Entities.DischargeParameters,
|
|
16248
|
-
substrate: Entities.Substrate,
|
|
16249
|
-
weather: Entities.Weather,
|
|
16250
|
-
dispersionParameters: Entities.DispersionParameters[],
|
|
16251
|
-
dispersionParameterCount: number,
|
|
16252
|
-
endPointConcentration: number,
|
|
16253
|
-
flammableParameters: Entities.FlammableParameters,
|
|
16254
|
-
explosionParameters: Entities.ExplosionParameters,
|
|
16255
|
-
dispersionFlamOutputConfigs: Entities.DispersionOutputConfig[],
|
|
16256
|
-
dispersionFlamOutputConfigCount: number,
|
|
16257
|
-
dispersionToxicOutputConfigs: Entities.DispersionOutputConfig[],
|
|
16258
|
-
dispersionToxicOutputConfigCount: number,
|
|
16259
|
-
flammableOutputConfigs: Entities.FlammableOutputConfig[],
|
|
16260
|
-
flammableOutputConfigCount: number,
|
|
16261
|
-
explosionOutputConfigs: Entities.ExplosionOutputConfig[],
|
|
16262
|
-
explosionOutputConfigCount: number,
|
|
16263
|
-
explosionConfinedVolumes: Entities.ExplosionConfinedVolume[],
|
|
16264
|
-
explosionConfinedVolumeCount: number
|
|
16265
|
-
) {
|
|
16266
|
-
super();
|
|
16267
|
-
this.vessel = vessel;
|
|
16268
|
-
this.leak = leak;
|
|
16269
|
-
this.dischargeParameters = dischargeParameters;
|
|
16270
|
-
this.substrate = substrate;
|
|
16271
|
-
this.weather = weather;
|
|
16272
|
-
this.dispersionParameters = dispersionParameters;
|
|
16273
|
-
this.dispersionParameterCount = dispersionParameterCount;
|
|
16274
|
-
this.endPointConcentration = endPointConcentration;
|
|
16275
|
-
this.flammableParameters = flammableParameters;
|
|
16276
|
-
this.explosionParameters = explosionParameters;
|
|
16277
|
-
this.dispersionFlamOutputConfigs = dispersionFlamOutputConfigs;
|
|
16278
|
-
this.dispersionFlamOutputConfigCount = dispersionFlamOutputConfigCount;
|
|
16279
|
-
this.dispersionToxicOutputConfigs = dispersionToxicOutputConfigs;
|
|
16280
|
-
this.dispersionToxicOutputConfigCount = dispersionToxicOutputConfigCount;
|
|
16281
|
-
this.flammableOutputConfigs = flammableOutputConfigs;
|
|
16282
|
-
this.flammableOutputConfigCount = flammableOutputConfigCount;
|
|
16283
|
-
this.explosionOutputConfigs = explosionOutputConfigs;
|
|
16284
|
-
this.explosionOutputConfigCount = explosionOutputConfigCount;
|
|
16285
|
-
this.explosionConfinedVolumes = explosionConfinedVolumes;
|
|
16286
|
-
this.explosionConfinedVolumeCount = explosionConfinedVolumeCount;
|
|
16287
|
-
}
|
|
16288
|
-
|
|
16289
|
-
async run() {
|
|
16290
|
-
try {
|
|
16291
|
-
const request = new VesselLeakLinkedRunCalculationRequest(
|
|
16292
|
-
this.vessel,
|
|
16293
|
-
this.leak,
|
|
16294
|
-
this.dischargeParameters,
|
|
16295
|
-
this.substrate,
|
|
16296
|
-
this.weather,
|
|
16297
|
-
this.dispersionParameters,
|
|
16298
|
-
this.dispersionParameterCount,
|
|
16299
|
-
this.endPointConcentration,
|
|
16300
|
-
this.flammableParameters,
|
|
16301
|
-
this.explosionParameters,
|
|
16302
|
-
this.dispersionFlamOutputConfigs,
|
|
16303
|
-
this.dispersionFlamOutputConfigCount,
|
|
16304
|
-
this.dispersionToxicOutputConfigs,
|
|
16305
|
-
this.dispersionToxicOutputConfigCount,
|
|
16306
|
-
this.flammableOutputConfigs,
|
|
16307
|
-
this.flammableOutputConfigCount,
|
|
16308
|
-
this.explosionOutputConfigs,
|
|
16309
|
-
this.explosionOutputConfigCount,
|
|
16310
|
-
this.explosionConfinedVolumes,
|
|
16311
|
-
this.explosionConfinedVolumeCount
|
|
16312
|
-
);
|
|
16313
|
-
|
|
16314
|
-
const schema = new VesselLeakLinkedRunCalculationRequestSchema();
|
|
16315
|
-
const validatedRequest = schema.validate(request);
|
|
16316
|
-
|
|
16317
|
-
const requestJson = JSON.stringify(validatedRequest);
|
|
16318
|
-
const url = `${getAnalyticsApiTarget()}VesselLeakLinkedRun?clientId=${getClientAliasId()}`;
|
|
16319
|
-
|
|
16320
|
-
this.resultCode = Enums.ResultCode.UNEXPECTED_APPLICATION_ERROR;
|
|
16321
|
-
|
|
16322
|
-
const response = await this.postRequest(url, requestJson);
|
|
16323
|
-
|
|
16324
|
-
if (response.status >= 200 && response.status < 300) {
|
|
16325
|
-
const schema = new VesselLeakLinkedRunCalculationResponseSchema();
|
|
16326
|
-
const validatedResponse = schema.validate(response.data);
|
|
16327
|
-
|
|
16328
|
-
this.resultCode = validatedResponse.resultCode;
|
|
16329
|
-
if (this.resultCode === Enums.ResultCode.SUCCESS) {
|
|
16330
|
-
this.dischargeRecord = validatedResponse.dischargeRecord;
|
|
16331
|
-
this.distancesToJetFireRadiation = validatedResponse.distancesToJetFireRadiation;
|
|
16332
|
-
this.jetContourPoints = validatedResponse.jetContourPoints;
|
|
16333
|
-
this.nJetContourPoints = validatedResponse.nJetContourPoints;
|
|
16334
|
-
this.areaEllipseJet = validatedResponse.areaEllipseJet;
|
|
16335
|
-
this.distancesToFlamConcentration = validatedResponse.distancesToFlamConcentration;
|
|
16336
|
-
this.flamConcentrationsUsed = validatedResponse.flamConcentrationsUsed;
|
|
16337
|
-
this.flamConcContourPoints = validatedResponse.flamConcContourPoints;
|
|
16338
|
-
this.nFlamConcContourPoints = validatedResponse.nFlamConcContourPoints;
|
|
16339
|
-
this.areaFootprintFlamConc = validatedResponse.areaFootprintFlamConc;
|
|
16340
|
-
this.distancesToPoolFireRadiation = validatedResponse.distancesToPoolFireRadiation;
|
|
16341
|
-
this.poolContourPoints = validatedResponse.poolContourPoints;
|
|
16342
|
-
this.nPoolContourPoints = validatedResponse.nPoolContourPoints;
|
|
16343
|
-
this.areaEllipsePool = validatedResponse.areaEllipsePool;
|
|
16344
|
-
this.explosionOverpressureResults = validatedResponse.explosionOverpressureResults;
|
|
16345
|
-
this.distancesToToxicConcentration = validatedResponse.distancesToToxicConcentration;
|
|
16346
|
-
this.toxicConcentrationUsed = validatedResponse.toxicConcentrationUsed;
|
|
16347
|
-
this.toxicConcContourPoints = validatedResponse.toxicConcContourPoints;
|
|
16348
|
-
this.nToxicConcContourPoints = validatedResponse.nToxicConcContourPoints;
|
|
16349
|
-
this.areaFootprintToxicConc = validatedResponse.areaFootprintToxicConc;
|
|
16350
|
-
this.jetFireFlameResult = validatedResponse.jetFireFlameResult;
|
|
16351
|
-
this.poolFireFlameResult = validatedResponse.poolFireFlameResult;
|
|
16352
|
-
this.resultCode = validatedResponse.resultCode;
|
|
16353
|
-
this.messages = validatedResponse.messages ?? [];
|
|
16354
|
-
this.calculationElapsedTime = validatedResponse.calculationElapsedTime;
|
|
16355
|
-
this.operationId = validatedResponse.operationId;
|
|
16356
|
-
} else {
|
|
16357
|
-
this.messages.push(...(validatedResponse.messages ?? []));
|
|
16358
|
-
}
|
|
16359
|
-
} else {
|
|
16360
|
-
this.handleFailedResponse(response);
|
|
16361
|
-
}
|
|
16362
|
-
} catch (error) {
|
|
16363
|
-
if (error instanceof Error) {
|
|
16364
|
-
this.messages.push(`Error: ${error.message}`);
|
|
16365
|
-
} else {
|
|
16366
|
-
this.messages.push(`Unexpected error: ${JSON.stringify(error)}`);
|
|
16367
|
-
}
|
|
16368
|
-
console.error(error);
|
|
16369
|
-
this.resultCode = Enums.ResultCode.UNEXPECTED_APPLICATION_ERROR;
|
|
16370
|
-
}
|
|
16371
|
-
|
|
16372
|
-
return this.resultCode;
|
|
16373
|
-
}
|
|
16374
|
-
|
|
16375
|
-
toString() {
|
|
16376
|
-
const parts = ["* VesselLeakLinkedRun"];
|
|
16377
|
-
|
|
16378
|
-
parts.push(`dischargeRecord: ${String(this.dischargeRecord)}`);
|
|
16379
|
-
parts.push("*** distancesToJetFireRadiation:");
|
|
16380
|
-
parts.push(
|
|
16381
|
-
this.distancesToJetFireRadiation && this.distancesToJetFireRadiation.length > 0
|
|
16382
|
-
? this.distancesToJetFireRadiation.map((point) => `distancesToJetFireRadiationElement: ${point}`).join("\n")
|
|
16383
|
-
: "distancesToJetFireRadiation does not contain any elements"
|
|
16384
|
-
);
|
|
16385
|
-
parts.push("*** jetContourPoints:");
|
|
16386
|
-
parts.push(
|
|
16387
|
-
this.jetContourPoints && this.jetContourPoints.length > 0
|
|
16388
|
-
? this.jetContourPoints.map((point) => `jetContourPointsElement: ${point}`).join("\n")
|
|
16389
|
-
: "jetContourPoints does not contain any elements"
|
|
16390
|
-
);
|
|
16391
|
-
parts.push("*** nJetContourPoints:");
|
|
16392
|
-
parts.push(
|
|
16393
|
-
this.nJetContourPoints && this.nJetContourPoints.length > 0
|
|
16394
|
-
? this.nJetContourPoints.map((point) => `nJetContourPointsElement: ${point}`).join("\n")
|
|
16395
|
-
: "nJetContourPoints does not contain any elements"
|
|
16396
|
-
);
|
|
16397
|
-
parts.push("*** areaEllipseJet:");
|
|
16398
|
-
parts.push(
|
|
16399
|
-
this.areaEllipseJet && this.areaEllipseJet.length > 0
|
|
16400
|
-
? this.areaEllipseJet.map((point) => `areaEllipseJetElement: ${point}`).join("\n")
|
|
16401
|
-
: "areaEllipseJet does not contain any elements"
|
|
16402
|
-
);
|
|
16403
|
-
parts.push("*** distancesToFlamConcentration:");
|
|
16404
|
-
parts.push(
|
|
16405
|
-
this.distancesToFlamConcentration && this.distancesToFlamConcentration.length > 0
|
|
16406
|
-
? this.distancesToFlamConcentration.map((point) => `distancesToFlamConcentrationElement: ${point}`).join("\n")
|
|
16407
|
-
: "distancesToFlamConcentration does not contain any elements"
|
|
16408
|
-
);
|
|
16409
|
-
parts.push("*** flamConcentrationsUsed:");
|
|
16410
|
-
parts.push(
|
|
16411
|
-
this.flamConcentrationsUsed && this.flamConcentrationsUsed.length > 0
|
|
16412
|
-
? this.flamConcentrationsUsed.map((point) => `flamConcentrationsUsedElement: ${point}`).join("\n")
|
|
16413
|
-
: "flamConcentrationsUsed does not contain any elements"
|
|
16414
|
-
);
|
|
16415
|
-
parts.push("*** flamConcContourPoints:");
|
|
16416
|
-
parts.push(
|
|
16417
|
-
this.flamConcContourPoints && this.flamConcContourPoints.length > 0
|
|
16418
|
-
? this.flamConcContourPoints.map((point) => `flamConcContourPointsElement: ${point}`).join("\n")
|
|
16419
|
-
: "flamConcContourPoints does not contain any elements"
|
|
16420
|
-
);
|
|
16421
|
-
parts.push("*** nFlamConcContourPoints:");
|
|
16422
|
-
parts.push(
|
|
16423
|
-
this.nFlamConcContourPoints && this.nFlamConcContourPoints.length > 0
|
|
16424
|
-
? this.nFlamConcContourPoints.map((point) => `nFlamConcContourPointsElement: ${point}`).join("\n")
|
|
16425
|
-
: "nFlamConcContourPoints does not contain any elements"
|
|
16426
|
-
);
|
|
16427
|
-
parts.push("*** areaFootprintFlamConc:");
|
|
16428
|
-
parts.push(
|
|
16429
|
-
this.areaFootprintFlamConc && this.areaFootprintFlamConc.length > 0
|
|
16430
|
-
? this.areaFootprintFlamConc.map((point) => `areaFootprintFlamConcElement: ${point}`).join("\n")
|
|
16431
|
-
: "areaFootprintFlamConc does not contain any elements"
|
|
16432
|
-
);
|
|
16433
|
-
parts.push("*** distancesToPoolFireRadiation:");
|
|
16434
|
-
parts.push(
|
|
16435
|
-
this.distancesToPoolFireRadiation && this.distancesToPoolFireRadiation.length > 0
|
|
16436
|
-
? this.distancesToPoolFireRadiation.map((point) => `distancesToPoolFireRadiationElement: ${point}`).join("\n")
|
|
16437
|
-
: "distancesToPoolFireRadiation does not contain any elements"
|
|
16438
|
-
);
|
|
16439
|
-
parts.push("*** poolContourPoints:");
|
|
16440
|
-
parts.push(
|
|
16441
|
-
this.poolContourPoints && this.poolContourPoints.length > 0
|
|
16442
|
-
? this.poolContourPoints.map((point) => `poolContourPointsElement: ${point}`).join("\n")
|
|
16443
|
-
: "poolContourPoints does not contain any elements"
|
|
16444
|
-
);
|
|
16445
|
-
parts.push("*** nPoolContourPoints:");
|
|
16446
|
-
parts.push(
|
|
16447
|
-
this.nPoolContourPoints && this.nPoolContourPoints.length > 0
|
|
16448
|
-
? this.nPoolContourPoints.map((point) => `nPoolContourPointsElement: ${point}`).join("\n")
|
|
16449
|
-
: "nPoolContourPoints does not contain any elements"
|
|
16450
|
-
);
|
|
16451
|
-
parts.push("*** areaEllipsePool:");
|
|
16452
|
-
parts.push(
|
|
16453
|
-
this.areaEllipsePool && this.areaEllipsePool.length > 0
|
|
16454
|
-
? this.areaEllipsePool.map((point) => `areaEllipsePoolElement: ${point}`).join("\n")
|
|
16455
|
-
: "areaEllipsePool does not contain any elements"
|
|
16456
|
-
);
|
|
16457
|
-
parts.push("*** explosionOverpressureResults:");
|
|
16458
|
-
parts.push(
|
|
16459
|
-
this.explosionOverpressureResults && this.explosionOverpressureResults.length > 0
|
|
16460
|
-
? this.explosionOverpressureResults.map((point) => `explosionOverpressureResultsElement: ${point}`).join("\n")
|
|
16461
|
-
: "explosionOverpressureResults does not contain any elements"
|
|
16462
|
-
);
|
|
16463
|
-
parts.push("*** distancesToToxicConcentration:");
|
|
16464
|
-
parts.push(
|
|
16465
|
-
this.distancesToToxicConcentration && this.distancesToToxicConcentration.length > 0
|
|
16466
|
-
? this.distancesToToxicConcentration.map((point) => `distancesToToxicConcentrationElement: ${point}`).join("\n")
|
|
16467
|
-
: "distancesToToxicConcentration does not contain any elements"
|
|
16468
|
-
);
|
|
16469
|
-
parts.push("*** toxicConcentrationUsed:");
|
|
16470
|
-
parts.push(
|
|
16471
|
-
this.toxicConcentrationUsed && this.toxicConcentrationUsed.length > 0
|
|
16472
|
-
? this.toxicConcentrationUsed.map((point) => `toxicConcentrationUsedElement: ${point}`).join("\n")
|
|
16473
|
-
: "toxicConcentrationUsed does not contain any elements"
|
|
16474
|
-
);
|
|
16475
|
-
parts.push("*** toxicConcContourPoints:");
|
|
16476
|
-
parts.push(
|
|
16477
|
-
this.toxicConcContourPoints && this.toxicConcContourPoints.length > 0
|
|
16478
|
-
? this.toxicConcContourPoints.map((point) => `toxicConcContourPointsElement: ${point}`).join("\n")
|
|
16479
|
-
: "toxicConcContourPoints does not contain any elements"
|
|
16480
|
-
);
|
|
16481
|
-
parts.push("*** nToxicConcContourPoints:");
|
|
16482
|
-
parts.push(
|
|
16483
|
-
this.nToxicConcContourPoints && this.nToxicConcContourPoints.length > 0
|
|
16484
|
-
? this.nToxicConcContourPoints.map((point) => `nToxicConcContourPointsElement: ${point}`).join("\n")
|
|
16485
|
-
: "nToxicConcContourPoints does not contain any elements"
|
|
16486
|
-
);
|
|
16487
|
-
parts.push("*** areaFootprintToxicConc:");
|
|
16488
|
-
parts.push(
|
|
16489
|
-
this.areaFootprintToxicConc && this.areaFootprintToxicConc.length > 0
|
|
16490
|
-
? this.areaFootprintToxicConc.map((point) => `areaFootprintToxicConcElement: ${point}`).join("\n")
|
|
16491
|
-
: "areaFootprintToxicConc does not contain any elements"
|
|
16492
|
-
);
|
|
16493
|
-
parts.push(`jetFireFlameResult: ${String(this.jetFireFlameResult)}`);
|
|
16494
|
-
parts.push(`poolFireFlameResult: ${String(this.poolFireFlameResult)}`);
|
|
16495
|
-
parts.push(`resultCode: ${String(this.resultCode)}`);
|
|
16496
|
-
parts.push("*** messages:");
|
|
16497
|
-
parts.push(`messages: ${this.messages !== undefined ? this.messages : "(None)"}`);
|
|
16498
|
-
parts.push(`calculationElapsedTime: ${this.calculationElapsedTime !== undefined ? this.calculationElapsedTime : "(None)"}`);
|
|
16499
|
-
parts.push(`operationId: ${this.operationId !== undefined ? this.operationId : "(None)"}`);
|
|
16500
|
-
|
|
16501
|
-
return parts.join("\n");
|
|
16502
|
-
}
|
|
16503
|
-
}
|
|
16504
|
-
|
|
16505
|
-
export class VesselLeakLinkedRunCalculationResponse extends CalculationResponseBase {
|
|
16506
|
-
dischargeRecord: Entities.DischargeRecord;
|
|
16507
|
-
distancesToJetFireRadiation: number[];
|
|
16508
|
-
jetContourPoints: Entities.LocalPosition[];
|
|
16509
|
-
nJetContourPoints: number[];
|
|
16510
|
-
areaEllipseJet: number[];
|
|
16511
|
-
distancesToFlamConcentration: number[];
|
|
16512
|
-
flamConcentrationsUsed: number[];
|
|
16513
|
-
flamConcContourPoints: Entities.LocalPosition[];
|
|
16514
|
-
nFlamConcContourPoints: number[];
|
|
16515
|
-
areaFootprintFlamConc: number[];
|
|
16516
|
-
distancesToPoolFireRadiation: number[];
|
|
16517
|
-
poolContourPoints: Entities.LocalPosition[];
|
|
16518
|
-
nPoolContourPoints: number[];
|
|
16519
|
-
areaEllipsePool: number[];
|
|
16520
|
-
explosionOverpressureResults: Entities.ExplosionOverpressureResult[];
|
|
16521
|
-
distancesToToxicConcentration: number[];
|
|
16522
|
-
toxicConcentrationUsed: number[];
|
|
16523
|
-
toxicConcContourPoints: Entities.LocalPosition[];
|
|
16524
|
-
nToxicConcContourPoints: number[];
|
|
16525
|
-
areaFootprintToxicConc: number[];
|
|
16526
|
-
jetFireFlameResult: Entities.FlameResult;
|
|
16527
|
-
poolFireFlameResult: Entities.PoolFireFlameResult;
|
|
16528
|
-
|
|
16529
|
-
/**
|
|
16530
|
-
* VesselLeakLinkedRun calculation response class.
|
|
16531
|
-
*
|
|
16532
|
-
* @param {Entities.DischargeRecord} dischargeRecord - A Discharge Record entity.
|
|
16533
|
-
* @param {number[]} distancesToJetFireRadiation - An array of distances to jet fire radiation levels, ordered according to the Flammable Output Configs.
|
|
16534
|
-
* @param {Entities.LocalPosition[]} jetContourPoints - An array of jet fire radiation ellipse contour points, ordered according to the Flammable Output Configs.
|
|
16535
|
-
* @param {number[]} nJetContourPoints - An array of the number of jet fire radiation ellipse contour points, ordered according to the Flammable Output Configs.
|
|
16536
|
-
* @param {number[]} areaEllipseJet - An array of areas of the jet fire ellipses, ordered according to the Flammable Output Configs.
|
|
16537
|
-
* @param {number[]} distancesToFlamConcentration - An array of distances to flammable concentration levels, ordered according to the Dispersion Output Configs for flammable concentrations of interest.
|
|
16538
|
-
* @param {number[]} flamConcentrationsUsed - An array of flammable concentration levels used in the calculations, ordered according to the Dispersion Output Configs for flammable concentrations of interest.
|
|
16539
|
-
* @param {Entities.LocalPosition[]} flamConcContourPoints - An array of maximum flammable concentration footprint contour points, ordered according to the Dispersion Output Configs for flammable concentrations of interest.
|
|
16540
|
-
* @param {number[]} nFlamConcContourPoints - An array of the number of maximum flammable concentration footprint contour points, ordered according to the Dispersion Output Configs for flammable concentrations of interest.
|
|
16541
|
-
* @param {number[]} areaFootprintFlamConc - An array of areas of the maximum flammable concentration footprint contours, ordered according to the Dispersion Output Configs for flammable concentrations of interest.
|
|
16542
|
-
* @param {number[]} distancesToPoolFireRadiation - An array of distances to pool fire radiation levels, ordered according to the Flammable Output Configs.
|
|
16543
|
-
* @param {Entities.LocalPosition[]} poolContourPoints - An array of pool fire radiation contour points, ordered according to the Flammable Output Configs.
|
|
16544
|
-
* @param {number[]} nPoolContourPoints - An array of the number of pool fire radiation contour points, ordered according to the Flammable Output Configs.
|
|
16545
|
-
* @param {number[]} areaEllipsePool - An array of areas of the pool fire ellipses, ordered according to the Flammable Output Configs.
|
|
16546
|
-
* @param {Entities.ExplosionOverpressureResult[]} explosionOverpressureResults - An array of Explosion Overpressure Results, ordered according to the Explosion Output Configs.
|
|
16547
|
-
* @param {number[]} distancesToToxicConcentration - An array of distances to toxic concentration levels, ordered according to the Dispersion Output Configs for toxic concentrations of interest.
|
|
16548
|
-
* @param {number[]} toxicConcentrationUsed - An array of toxic concentration levels used in the calculations, ordered according to the Dispersion Output Configs for toxic concentrations of interest.
|
|
16549
|
-
* @param {Entities.LocalPosition[]} toxicConcContourPoints - An array of maximum toxic concentration footprint contour points, ordered according to the Dispersion Output Configs for toxic concentrations of interest.
|
|
16550
|
-
* @param {number[]} nToxicConcContourPoints - An array of the number of maximum toxic concentration footprint contour points, ordered according to the Dispersion Output Configs for toxic concentrations of interest.
|
|
16551
|
-
* @param {number[]} areaFootprintToxicConc - An array of areas of the maximum toxic concentration footprint contours, ordered according to the Dispersion Output Configs for toxic concentrations of interest.
|
|
16552
|
-
* @param {Entities.FlameResult} jetFireFlameResult - A Flame Results entity, for jet fire.
|
|
16553
|
-
* @param {Entities.PoolFireFlameResult} poolFireFlameResult - A Pool Fire Flame Results entity, for pool fire.
|
|
16554
|
-
*/
|
|
16555
|
-
constructor(
|
|
16556
|
-
dischargeRecord: Entities.DischargeRecord,
|
|
16557
|
-
distancesToJetFireRadiation: number[],
|
|
16558
|
-
jetContourPoints: Entities.LocalPosition[],
|
|
16559
|
-
nJetContourPoints: number[],
|
|
16560
|
-
areaEllipseJet: number[],
|
|
16561
|
-
distancesToFlamConcentration: number[],
|
|
16562
|
-
flamConcentrationsUsed: number[],
|
|
16563
|
-
flamConcContourPoints: Entities.LocalPosition[],
|
|
16564
|
-
nFlamConcContourPoints: number[],
|
|
16565
|
-
areaFootprintFlamConc: number[],
|
|
16566
|
-
distancesToPoolFireRadiation: number[],
|
|
16567
|
-
poolContourPoints: Entities.LocalPosition[],
|
|
16568
|
-
nPoolContourPoints: number[],
|
|
16569
|
-
areaEllipsePool: number[],
|
|
16570
|
-
explosionOverpressureResults: Entities.ExplosionOverpressureResult[],
|
|
16571
|
-
distancesToToxicConcentration: number[],
|
|
16572
|
-
toxicConcentrationUsed: number[],
|
|
16573
|
-
toxicConcContourPoints: Entities.LocalPosition[],
|
|
16574
|
-
nToxicConcContourPoints: number[],
|
|
16575
|
-
areaFootprintToxicConc: number[],
|
|
16576
|
-
jetFireFlameResult: Entities.FlameResult,
|
|
16577
|
-
poolFireFlameResult: Entities.PoolFireFlameResult,
|
|
16578
|
-
resultCode: Enums.ResultCode,
|
|
16579
|
-
messages: string[],
|
|
16580
|
-
calculationElapsedTime: number,
|
|
16581
|
-
operationId: string
|
|
16582
|
-
) {
|
|
16583
|
-
super();
|
|
16584
|
-
this.dischargeRecord = dischargeRecord;
|
|
16585
|
-
this.distancesToJetFireRadiation = distancesToJetFireRadiation;
|
|
16586
|
-
this.jetContourPoints = jetContourPoints;
|
|
16587
|
-
this.nJetContourPoints = nJetContourPoints;
|
|
16588
|
-
this.areaEllipseJet = areaEllipseJet;
|
|
16589
|
-
this.distancesToFlamConcentration = distancesToFlamConcentration;
|
|
16590
|
-
this.flamConcentrationsUsed = flamConcentrationsUsed;
|
|
16591
|
-
this.flamConcContourPoints = flamConcContourPoints;
|
|
16592
|
-
this.nFlamConcContourPoints = nFlamConcContourPoints;
|
|
16593
|
-
this.areaFootprintFlamConc = areaFootprintFlamConc;
|
|
16594
|
-
this.distancesToPoolFireRadiation = distancesToPoolFireRadiation;
|
|
16595
|
-
this.poolContourPoints = poolContourPoints;
|
|
16596
|
-
this.nPoolContourPoints = nPoolContourPoints;
|
|
16597
|
-
this.areaEllipsePool = areaEllipsePool;
|
|
16598
|
-
this.explosionOverpressureResults = explosionOverpressureResults;
|
|
16599
|
-
this.distancesToToxicConcentration = distancesToToxicConcentration;
|
|
16600
|
-
this.toxicConcentrationUsed = toxicConcentrationUsed;
|
|
16601
|
-
this.toxicConcContourPoints = toxicConcContourPoints;
|
|
16602
|
-
this.nToxicConcContourPoints = nToxicConcContourPoints;
|
|
16603
|
-
this.areaFootprintToxicConc = areaFootprintToxicConc;
|
|
16604
|
-
this.jetFireFlameResult = jetFireFlameResult;
|
|
16605
|
-
this.poolFireFlameResult = poolFireFlameResult;
|
|
16606
|
-
this.resultCode = resultCode;
|
|
16607
|
-
this.messages = messages;
|
|
16608
|
-
this.calculationElapsedTime = calculationElapsedTime;
|
|
16609
|
-
this.operationId = operationId;
|
|
16610
|
-
}
|
|
16611
|
-
|
|
16612
|
-
initialiseFromDictionary(data: { [key: string]: unknown }) {
|
|
16613
|
-
if (data.dischargeRecord) {
|
|
16614
|
-
this.dischargeRecord = new Entities.DischargeRecord();
|
|
16615
|
-
this.dischargeRecord.initialiseFromDictionary(data.dischargeRecord);
|
|
16616
|
-
}
|
|
16617
|
-
if (data.distancesToJetFireRadiation && Array.isArray(data.distancesToJetFireRadiation)) {
|
|
16618
|
-
this.distancesToJetFireRadiation = data.distancesToJetFireRadiation.map((item) => parseFloat(item));
|
|
16619
|
-
}
|
|
16620
|
-
if (data.jetContourPoints && Array.isArray(data.jetContourPoints)) {
|
|
16621
|
-
this.jetContourPoints = data.jetContourPoints.map(
|
|
16622
|
-
(item) => {
|
|
16623
|
-
const record = new Entities.LocalPosition();
|
|
16624
|
-
record.initialiseFromDictionary(item);
|
|
16625
|
-
return record;
|
|
16626
|
-
}
|
|
16627
|
-
);
|
|
16628
|
-
}
|
|
16629
|
-
if (data.nJetContourPoints && Array.isArray(data.nJetContourPoints)) {
|
|
16630
|
-
this.nJetContourPoints = data.nJetContourPoints.map((item) => parseInt(item));
|
|
16631
|
-
}
|
|
16632
|
-
if (data.areaEllipseJet && Array.isArray(data.areaEllipseJet)) {
|
|
16633
|
-
this.areaEllipseJet = data.areaEllipseJet.map((item) => parseFloat(item));
|
|
16634
|
-
}
|
|
16635
|
-
if (data.distancesToFlamConcentration && Array.isArray(data.distancesToFlamConcentration)) {
|
|
16636
|
-
this.distancesToFlamConcentration = data.distancesToFlamConcentration.map((item) => parseFloat(item));
|
|
16637
|
-
}
|
|
16638
|
-
if (data.flamConcentrationsUsed && Array.isArray(data.flamConcentrationsUsed)) {
|
|
16639
|
-
this.flamConcentrationsUsed = data.flamConcentrationsUsed.map((item) => parseFloat(item));
|
|
16640
|
-
}
|
|
16641
|
-
if (data.flamConcContourPoints && Array.isArray(data.flamConcContourPoints)) {
|
|
16642
|
-
this.flamConcContourPoints = data.flamConcContourPoints.map(
|
|
16643
|
-
(item) => {
|
|
16644
|
-
const record = new Entities.LocalPosition();
|
|
16645
|
-
record.initialiseFromDictionary(item);
|
|
16646
|
-
return record;
|
|
16647
|
-
}
|
|
16648
|
-
);
|
|
16649
|
-
}
|
|
16650
|
-
if (data.nFlamConcContourPoints && Array.isArray(data.nFlamConcContourPoints)) {
|
|
16651
|
-
this.nFlamConcContourPoints = data.nFlamConcContourPoints.map((item) => parseInt(item));
|
|
16652
|
-
}
|
|
16653
|
-
if (data.areaFootprintFlamConc && Array.isArray(data.areaFootprintFlamConc)) {
|
|
16654
|
-
this.areaFootprintFlamConc = data.areaFootprintFlamConc.map((item) => parseFloat(item));
|
|
16655
|
-
}
|
|
16656
|
-
if (data.distancesToPoolFireRadiation && Array.isArray(data.distancesToPoolFireRadiation)) {
|
|
16657
|
-
this.distancesToPoolFireRadiation = data.distancesToPoolFireRadiation.map((item) => parseFloat(item));
|
|
16658
|
-
}
|
|
16659
|
-
if (data.poolContourPoints && Array.isArray(data.poolContourPoints)) {
|
|
16660
|
-
this.poolContourPoints = data.poolContourPoints.map(
|
|
16661
|
-
(item) => {
|
|
16662
|
-
const record = new Entities.LocalPosition();
|
|
16663
|
-
record.initialiseFromDictionary(item);
|
|
16664
|
-
return record;
|
|
16665
|
-
}
|
|
16666
|
-
);
|
|
16667
|
-
}
|
|
16668
|
-
if (data.nPoolContourPoints && Array.isArray(data.nPoolContourPoints)) {
|
|
16669
|
-
this.nPoolContourPoints = data.nPoolContourPoints.map((item) => parseInt(item));
|
|
16670
|
-
}
|
|
16671
|
-
if (data.areaEllipsePool && Array.isArray(data.areaEllipsePool)) {
|
|
16672
|
-
this.areaEllipsePool = data.areaEllipsePool.map((item) => parseFloat(item));
|
|
16673
|
-
}
|
|
16674
|
-
if (data.explosionOverpressureResults && Array.isArray(data.explosionOverpressureResults)) {
|
|
16675
|
-
this.explosionOverpressureResults = data.explosionOverpressureResults.map(
|
|
16676
|
-
(item) => {
|
|
16677
|
-
const record = new Entities.ExplosionOverpressureResult();
|
|
16678
|
-
record.initialiseFromDictionary(item);
|
|
16679
|
-
return record;
|
|
16680
|
-
}
|
|
16681
|
-
);
|
|
16682
|
-
}
|
|
16683
|
-
if (data.distancesToToxicConcentration && Array.isArray(data.distancesToToxicConcentration)) {
|
|
16684
|
-
this.distancesToToxicConcentration = data.distancesToToxicConcentration.map((item) => parseFloat(item));
|
|
16685
|
-
}
|
|
16686
|
-
if (data.toxicConcentrationUsed && Array.isArray(data.toxicConcentrationUsed)) {
|
|
16687
|
-
this.toxicConcentrationUsed = data.toxicConcentrationUsed.map((item) => parseFloat(item));
|
|
16688
|
-
}
|
|
16689
|
-
if (data.toxicConcContourPoints && Array.isArray(data.toxicConcContourPoints)) {
|
|
16690
|
-
this.toxicConcContourPoints = data.toxicConcContourPoints.map(
|
|
16691
|
-
(item) => {
|
|
16692
|
-
const record = new Entities.LocalPosition();
|
|
16693
|
-
record.initialiseFromDictionary(item);
|
|
16694
|
-
return record;
|
|
16695
|
-
}
|
|
16696
|
-
);
|
|
16697
|
-
}
|
|
16698
|
-
if (data.nToxicConcContourPoints && Array.isArray(data.nToxicConcContourPoints)) {
|
|
16699
|
-
this.nToxicConcContourPoints = data.nToxicConcContourPoints.map((item) => parseInt(item));
|
|
16700
|
-
}
|
|
16701
|
-
if (data.areaFootprintToxicConc && Array.isArray(data.areaFootprintToxicConc)) {
|
|
16702
|
-
this.areaFootprintToxicConc = data.areaFootprintToxicConc.map((item) => parseFloat(item));
|
|
16703
|
-
}
|
|
16704
|
-
if (data.jetFireFlameResult) {
|
|
16705
|
-
this.jetFireFlameResult = new Entities.FlameResult();
|
|
16706
|
-
this.jetFireFlameResult.initialiseFromDictionary(data.jetFireFlameResult);
|
|
16707
|
-
}
|
|
16708
|
-
if (data.poolFireFlameResult) {
|
|
16709
|
-
this.poolFireFlameResult = new Entities.PoolFireFlameResult();
|
|
16710
|
-
this.poolFireFlameResult.initialiseFromDictionary(data.poolFireFlameResult);
|
|
16711
|
-
}
|
|
16712
|
-
if (data.resultCode !== undefined && (typeof data.resultCode === "string" || typeof data.resultCode === "number")) {
|
|
16713
|
-
this.resultCode = data.resultCode as Enums.ResultCode;
|
|
16714
|
-
}
|
|
16715
|
-
this.messages = this.messages ?? [];
|
|
16716
|
-
if (data.messages && Array.isArray(data.messages)) {
|
|
16717
|
-
this.messages.push(...data.messages);
|
|
16718
|
-
}
|
|
16719
|
-
if (data.calculationElapsedTime !== undefined && typeof data.calculationElapsedTime === "number") {
|
|
16720
|
-
this.calculationElapsedTime = data.calculationElapsedTime as number;
|
|
16721
|
-
}
|
|
16722
|
-
if (data.operationId !== undefined && typeof data.operationId === "string") {
|
|
16723
|
-
this.operationId = data.operationId as string;
|
|
16724
|
-
}
|
|
16725
|
-
}
|
|
16726
|
-
}
|
|
16727
|
-
|
|
16728
|
-
export interface VesselLeakLinkedRunCalculationResponseSchemaData {
|
|
16729
|
-
dischargeRecord: Entities.DischargeRecord;
|
|
16730
|
-
distancesToJetFireRadiation: number[];
|
|
16731
|
-
jetContourPoints: Entities.LocalPosition[];
|
|
16732
|
-
nJetContourPoints: number[];
|
|
16733
|
-
areaEllipseJet: number[];
|
|
16734
|
-
distancesToFlamConcentration: number[];
|
|
16735
|
-
flamConcentrationsUsed: number[];
|
|
16736
|
-
flamConcContourPoints: Entities.LocalPosition[];
|
|
16737
|
-
nFlamConcContourPoints: number[];
|
|
16738
|
-
areaFootprintFlamConc: number[];
|
|
16739
|
-
distancesToPoolFireRadiation: number[];
|
|
16740
|
-
poolContourPoints: Entities.LocalPosition[];
|
|
16741
|
-
nPoolContourPoints: number[];
|
|
16742
|
-
areaEllipsePool: number[];
|
|
16743
|
-
explosionOverpressureResults: Entities.ExplosionOverpressureResult[];
|
|
16744
|
-
distancesToToxicConcentration: number[];
|
|
16745
|
-
toxicConcentrationUsed: number[];
|
|
16746
|
-
toxicConcContourPoints: Entities.LocalPosition[];
|
|
16747
|
-
nToxicConcContourPoints: number[];
|
|
16748
|
-
areaFootprintToxicConc: number[];
|
|
16749
|
-
jetFireFlameResult: Entities.FlameResult;
|
|
16750
|
-
poolFireFlameResult: Entities.PoolFireFlameResult;
|
|
16751
|
-
resultCode: Enums.ResultCode;
|
|
16752
|
-
messages: string[];
|
|
16753
|
-
calculationElapsedTime: number;
|
|
16754
|
-
operationId: string;
|
|
16755
|
-
}
|
|
16756
|
-
|
|
16757
|
-
export class VesselLeakLinkedRunCalculationResponseSchema {
|
|
16758
|
-
schema: Joi.ObjectSchema;
|
|
16759
|
-
propertyTypes: Record<string, string>;
|
|
16760
|
-
|
|
16761
|
-
/**
|
|
16762
|
-
* Schema for the VesselLeakLinkedRun calculation response.
|
|
16763
|
-
*/
|
|
16764
|
-
constructor() {
|
|
16765
|
-
this.schema = Joi.object({
|
|
16766
|
-
dischargeRecord: new EntitySchemas.DischargeRecordSchema().schema,
|
|
16767
|
-
distancesToJetFireRadiation: Joi.array().items(Joi.number().unsafe()).allow(null),
|
|
16768
|
-
jetContourPoints: Joi.array().items(new EntitySchemas.LocalPositionSchema().schema).allow(null),
|
|
16769
|
-
nJetContourPoints: Joi.array().items(Joi.number().integer()).allow(null),
|
|
16770
|
-
areaEllipseJet: Joi.array().items(Joi.number().unsafe()).allow(null),
|
|
16771
|
-
distancesToFlamConcentration: Joi.array().items(Joi.number().unsafe()).allow(null),
|
|
16772
|
-
flamConcentrationsUsed: Joi.array().items(Joi.number().unsafe()).allow(null),
|
|
16773
|
-
flamConcContourPoints: Joi.array().items(new EntitySchemas.LocalPositionSchema().schema).allow(null),
|
|
16774
|
-
nFlamConcContourPoints: Joi.array().items(Joi.number().integer()).allow(null),
|
|
16775
|
-
areaFootprintFlamConc: Joi.array().items(Joi.number().unsafe()).allow(null),
|
|
16776
|
-
distancesToPoolFireRadiation: Joi.array().items(Joi.number().unsafe()).allow(null),
|
|
16777
|
-
poolContourPoints: Joi.array().items(new EntitySchemas.LocalPositionSchema().schema).allow(null),
|
|
16778
|
-
nPoolContourPoints: Joi.array().items(Joi.number().integer()).allow(null),
|
|
16779
|
-
areaEllipsePool: Joi.array().items(Joi.number().unsafe()).allow(null),
|
|
16780
|
-
explosionOverpressureResults: Joi.array().items(new EntitySchemas.ExplosionOverpressureResultSchema().schema).allow(null),
|
|
16781
|
-
distancesToToxicConcentration: Joi.array().items(Joi.number().unsafe()).allow(null),
|
|
16782
|
-
toxicConcentrationUsed: Joi.array().items(Joi.number().unsafe()).allow(null),
|
|
16783
|
-
toxicConcContourPoints: Joi.array().items(new EntitySchemas.LocalPositionSchema().schema).allow(null),
|
|
16784
|
-
nToxicConcContourPoints: Joi.array().items(Joi.number().integer()).allow(null),
|
|
16785
|
-
areaFootprintToxicConc: Joi.array().items(Joi.number().unsafe()).allow(null),
|
|
16786
|
-
jetFireFlameResult: new EntitySchemas.FlameResultSchema().schema,
|
|
16787
|
-
poolFireFlameResult: new EntitySchemas.PoolFireFlameResultSchema().schema,
|
|
16788
|
-
resultCode: Joi.string().valid(...Object.values(Enums.ResultCode)),
|
|
16789
|
-
messages: Joi.array().items(Joi.string()),
|
|
16790
|
-
calculationElapsedTime: Joi.number().unsafe(),
|
|
16791
|
-
operationId: Joi.string().uuid().allow(null),
|
|
16792
|
-
}).unknown(true);
|
|
16793
|
-
|
|
16794
|
-
this.propertyTypes = {
|
|
16795
|
-
dischargeRecord: "Entities.DischargeRecord",
|
|
16796
|
-
distancesToJetFireRadiation: "number[]",
|
|
16797
|
-
jetContourPoints: "Entities.LocalPosition[]",
|
|
16798
|
-
nJetContourPoints: "number[]",
|
|
16799
|
-
areaEllipseJet: "number[]",
|
|
16800
|
-
distancesToFlamConcentration: "number[]",
|
|
16801
|
-
flamConcentrationsUsed: "number[]",
|
|
16802
|
-
flamConcContourPoints: "Entities.LocalPosition[]",
|
|
16803
|
-
nFlamConcContourPoints: "number[]",
|
|
16804
|
-
areaFootprintFlamConc: "number[]",
|
|
16805
|
-
distancesToPoolFireRadiation: "number[]",
|
|
16806
|
-
poolContourPoints: "Entities.LocalPosition[]",
|
|
16807
|
-
nPoolContourPoints: "number[]",
|
|
16808
|
-
areaEllipsePool: "number[]",
|
|
16809
|
-
explosionOverpressureResults: "Entities.ExplosionOverpressureResult[]",
|
|
16810
|
-
distancesToToxicConcentration: "number[]",
|
|
16811
|
-
toxicConcentrationUsed: "number[]",
|
|
16812
|
-
toxicConcContourPoints: "Entities.LocalPosition[]",
|
|
16813
|
-
nToxicConcContourPoints: "number[]",
|
|
16814
|
-
areaFootprintToxicConc: "number[]",
|
|
16815
|
-
jetFireFlameResult: "Entities.FlameResult",
|
|
16816
|
-
poolFireFlameResult: "Entities.PoolFireFlameResult",
|
|
16817
|
-
};
|
|
16818
|
-
}
|
|
16819
|
-
|
|
16820
|
-
validate(data: VesselLeakLinkedRunCalculationResponseSchemaData): VesselLeakLinkedRunCalculationResponse {
|
|
16821
|
-
const { error, value } = this.schema.validate(data, { abortEarly: false });
|
|
16822
|
-
if (error) {
|
|
16823
|
-
throw new Error(`Validation error: ${error.details.map((x) => x.message).join(", ")}`);
|
|
16824
|
-
}
|
|
16825
|
-
return this.makeCalculationResponse(value);
|
|
16826
|
-
}
|
|
16827
|
-
|
|
16828
|
-
makeCalculationResponse(data: VesselLeakLinkedRunCalculationResponseSchemaData): VesselLeakLinkedRunCalculationResponse {
|
|
16829
|
-
return new VesselLeakLinkedRunCalculationResponse(
|
|
16830
|
-
data.dischargeRecord,
|
|
16831
|
-
data.distancesToJetFireRadiation,
|
|
16832
|
-
data.jetContourPoints,
|
|
16833
|
-
data.nJetContourPoints,
|
|
16834
|
-
data.areaEllipseJet,
|
|
16835
|
-
data.distancesToFlamConcentration,
|
|
16836
|
-
data.flamConcentrationsUsed,
|
|
16837
|
-
data.flamConcContourPoints,
|
|
16838
|
-
data.nFlamConcContourPoints,
|
|
16839
|
-
data.areaFootprintFlamConc,
|
|
16840
|
-
data.distancesToPoolFireRadiation,
|
|
16841
|
-
data.poolContourPoints,
|
|
16842
|
-
data.nPoolContourPoints,
|
|
16843
|
-
data.areaEllipsePool,
|
|
16844
|
-
data.explosionOverpressureResults,
|
|
16845
|
-
data.distancesToToxicConcentration,
|
|
16846
|
-
data.toxicConcentrationUsed,
|
|
16847
|
-
data.toxicConcContourPoints,
|
|
16848
|
-
data.nToxicConcContourPoints,
|
|
16849
|
-
data.areaFootprintToxicConc,
|
|
16850
|
-
data.jetFireFlameResult,
|
|
16851
|
-
data.poolFireFlameResult,
|
|
16852
|
-
data.resultCode,
|
|
16853
|
-
data.messages,
|
|
16854
|
-
data.calculationElapsedTime,
|
|
16855
|
-
data.operationId
|
|
16856
|
-
);
|
|
16857
|
-
}
|
|
16858
|
-
}
|
|
16859
|
-
|
|
16860
|
-
export interface VesselLeakMaxFlammableCloudCalculationRequestSchemaData {
|
|
16861
|
-
vessel: Entities.Vessel;
|
|
16862
|
-
leak: Entities.Leak;
|
|
16863
|
-
weather: Entities.Weather;
|
|
16864
|
-
substrate: Entities.Substrate;
|
|
16865
|
-
dischargeParameters: Entities.DischargeParameters;
|
|
16866
|
-
dispersionParameters: Entities.DispersionParameters;
|
|
16867
|
-
dispersionOutputConfig: Entities.DispersionOutputConfig;
|
|
16868
|
-
}
|
|
16869
|
-
|
|
16870
|
-
class VesselLeakMaxFlammableCloudCalculationRequest extends CalculationRequestBase {
|
|
16871
|
-
vessel: Entities.Vessel;
|
|
16872
|
-
leak: Entities.Leak;
|
|
16873
|
-
weather: Entities.Weather;
|
|
16874
|
-
substrate: Entities.Substrate;
|
|
16875
|
-
dischargeParameters: Entities.DischargeParameters;
|
|
16876
|
-
dispersionParameters: Entities.DispersionParameters;
|
|
16877
|
-
dispersionOutputConfig: Entities.DispersionOutputConfig;
|
|
16878
|
-
|
|
16879
|
-
/**
|
|
16880
|
-
* VesselLeakMaxFlammableCloud calculation request class.
|
|
16881
|
-
*
|
|
16882
|
-
* @param {Entities.Vessel} vessel - A Vessel entity.
|
|
16883
|
-
* @param {Entities.Leak} leak - A Leak entity.
|
|
16884
|
-
* @param {Entities.Weather} weather - A Weather entity.
|
|
16885
|
-
* @param {Entities.Substrate} substrate - A Substrate entity.
|
|
16886
|
-
* @param {Entities.DischargeParameters} dischargeParameters - A Discharge Parameters entity.
|
|
16887
|
-
* @param {Entities.DispersionParameters} dispersionParameters - A Dispersion Parameters entity.
|
|
16888
|
-
* @param {Entities.DispersionOutputConfig} dispersionOutputConfig - A Dispersion Output Config entity, used to set height of interest.
|
|
16889
|
-
*/
|
|
16890
|
-
constructor(
|
|
16891
|
-
vessel: Entities.Vessel,
|
|
16892
|
-
leak: Entities.Leak,
|
|
16893
|
-
weather: Entities.Weather,
|
|
16894
|
-
substrate: Entities.Substrate,
|
|
16895
|
-
dischargeParameters: Entities.DischargeParameters,
|
|
16896
|
-
dispersionParameters: Entities.DispersionParameters,
|
|
16897
|
-
dispersionOutputConfig: Entities.DispersionOutputConfig
|
|
16898
|
-
) {
|
|
16899
|
-
super();
|
|
16900
|
-
this.vessel = vessel;
|
|
16901
|
-
this.leak = leak;
|
|
16902
|
-
this.weather = weather;
|
|
16903
|
-
this.substrate = substrate;
|
|
16904
|
-
this.dischargeParameters = dischargeParameters;
|
|
16905
|
-
this.dispersionParameters = dispersionParameters;
|
|
16906
|
-
this.dispersionOutputConfig = dispersionOutputConfig;
|
|
16907
|
-
}
|
|
16908
|
-
}
|
|
16909
|
-
|
|
16910
|
-
export class VesselLeakMaxFlammableCloudCalculationRequestSchema {
|
|
16911
|
-
schema: Joi.ObjectSchema;
|
|
16912
|
-
propertyTypes: Record<string, string>;
|
|
16913
|
-
|
|
16914
|
-
/**
|
|
16915
|
-
* Schema for the VesselLeakMaxFlammableCloud calculation request.
|
|
16916
|
-
*/
|
|
16917
|
-
constructor() {
|
|
16918
|
-
this.schema = Joi.object({
|
|
16919
|
-
vessel: new EntitySchemas.VesselSchema().schema,
|
|
16920
|
-
leak: new EntitySchemas.LeakSchema().schema,
|
|
16921
|
-
weather: new EntitySchemas.WeatherSchema().schema,
|
|
16922
|
-
substrate: new EntitySchemas.SubstrateSchema().schema,
|
|
16923
|
-
dischargeParameters: new EntitySchemas.DischargeParametersSchema().schema,
|
|
16924
|
-
dispersionParameters: new EntitySchemas.DispersionParametersSchema().schema,
|
|
16925
|
-
dispersionOutputConfig: new EntitySchemas.DispersionOutputConfigSchema().schema,
|
|
16926
|
-
}).unknown(true);
|
|
16927
|
-
|
|
16928
|
-
this.propertyTypes = {
|
|
16929
|
-
vessel: "Entities.Vessel",
|
|
16930
|
-
leak: "Entities.Leak",
|
|
16931
|
-
weather: "Entities.Weather",
|
|
16932
|
-
substrate: "Entities.Substrate",
|
|
16933
|
-
dischargeParameters: "Entities.DischargeParameters",
|
|
16934
|
-
dispersionParameters: "Entities.DispersionParameters",
|
|
16935
|
-
dispersionOutputConfig: "Entities.DispersionOutputConfig",
|
|
16936
|
-
};
|
|
16937
|
-
}
|
|
16938
|
-
|
|
16939
|
-
validate(data: VesselLeakMaxFlammableCloudCalculationRequestSchemaData): VesselLeakMaxFlammableCloudCalculationRequest {
|
|
16940
|
-
const { error, value } = this.schema.validate(data, { abortEarly: false });
|
|
16941
|
-
if (error) {
|
|
16942
|
-
throw new Error(`Validation error: ${error.details.map((x) => x.message).join(", ")}`);
|
|
16943
|
-
}
|
|
16944
|
-
return this.makeCalculationRequest(value);
|
|
16945
|
-
}
|
|
16946
|
-
|
|
16947
|
-
makeCalculationRequest(data: VesselLeakMaxFlammableCloudCalculationRequestSchemaData): VesselLeakMaxFlammableCloudCalculationRequest {
|
|
16948
|
-
return new VesselLeakMaxFlammableCloudCalculationRequest(
|
|
16949
|
-
data.vessel,
|
|
16950
|
-
data.leak,
|
|
16951
|
-
data.weather,
|
|
16952
|
-
data.substrate,
|
|
16953
|
-
data.dischargeParameters,
|
|
16954
|
-
data.dispersionParameters,
|
|
16955
|
-
data.dispersionOutputConfig
|
|
16956
|
-
);
|
|
16957
|
-
}
|
|
16958
|
-
}
|
|
16959
|
-
|
|
16960
|
-
export class VesselLeakMaxFlammableCloudCalculation extends CalculationBase {
|
|
16961
|
-
vessel: Entities.Vessel;
|
|
16962
|
-
leak: Entities.Leak;
|
|
16963
|
-
weather: Entities.Weather;
|
|
16964
|
-
substrate: Entities.Substrate;
|
|
16965
|
-
dischargeParameters: Entities.DischargeParameters;
|
|
16966
|
-
dispersionParameters: Entities.DispersionParameters;
|
|
16967
|
-
dispersionOutputConfig: Entities.DispersionOutputConfig;
|
|
16968
|
-
vesselLeakMaxFlammableCloudResults?: Entities.VesselLeakMaxFlammableCloudResults;
|
|
16969
|
-
|
|
16970
|
-
/**
|
|
16971
|
-
* Performs an end-to-end consequence calculation of a leak of flammable gas. It comprises a leak source term, dispersion, and calculation of max footprint and sideview information to determine the extent of the flammable cloud. Results are returned in a summary output structure which includes:
|
|
16972
|
-
maximum discharge rate, post-expansion fluid phase, post-expansion temperature, maximum downwind distance and height to LFL and LFL area.
|
|
16973
|
-
*
|
|
16974
|
-
* @param {Entities.Vessel} vessel - A Vessel entity.
|
|
16975
|
-
* @param {Entities.Leak} leak - A Leak entity.
|
|
16976
|
-
* @param {Entities.Weather} weather - A Weather entity.
|
|
16977
|
-
* @param {Entities.Substrate} substrate - A Substrate entity.
|
|
16978
|
-
* @param {Entities.DischargeParameters} dischargeParameters - A Discharge Parameters entity.
|
|
16979
|
-
* @param {Entities.DispersionParameters} dispersionParameters - A Dispersion Parameters entity.
|
|
16980
|
-
* @param {Entities.DispersionOutputConfig} dispersionOutputConfig - A Dispersion Output Config entity, used to set height of interest.
|
|
16981
|
-
*/
|
|
16982
|
-
constructor(
|
|
16983
|
-
vessel: Entities.Vessel,
|
|
16984
|
-
leak: Entities.Leak,
|
|
16985
|
-
weather: Entities.Weather,
|
|
16986
|
-
substrate: Entities.Substrate,
|
|
16987
|
-
dischargeParameters: Entities.DischargeParameters,
|
|
16988
|
-
dispersionParameters: Entities.DispersionParameters,
|
|
16989
|
-
dispersionOutputConfig: Entities.DispersionOutputConfig
|
|
16990
|
-
) {
|
|
16991
|
-
super();
|
|
16992
|
-
this.vessel = vessel;
|
|
16993
|
-
this.leak = leak;
|
|
16994
|
-
this.weather = weather;
|
|
16995
|
-
this.substrate = substrate;
|
|
16996
|
-
this.dischargeParameters = dischargeParameters;
|
|
16997
|
-
this.dispersionParameters = dispersionParameters;
|
|
16998
|
-
this.dispersionOutputConfig = dispersionOutputConfig;
|
|
16999
|
-
}
|
|
17000
|
-
|
|
17001
|
-
async run() {
|
|
17002
|
-
try {
|
|
17003
|
-
const request = new VesselLeakMaxFlammableCloudCalculationRequest(
|
|
17004
|
-
this.vessel,
|
|
17005
|
-
this.leak,
|
|
17006
|
-
this.weather,
|
|
17007
|
-
this.substrate,
|
|
17008
|
-
this.dischargeParameters,
|
|
17009
|
-
this.dispersionParameters,
|
|
17010
|
-
this.dispersionOutputConfig
|
|
17011
|
-
);
|
|
17012
|
-
|
|
17013
|
-
const schema = new VesselLeakMaxFlammableCloudCalculationRequestSchema();
|
|
17014
|
-
const validatedRequest = schema.validate(request);
|
|
17015
|
-
|
|
17016
|
-
const requestJson = JSON.stringify(validatedRequest);
|
|
17017
|
-
const url = `${getAnalyticsApiTarget()}calculatevesselleakmaxflammablecloud?clientId=${getClientAliasId()}`;
|
|
17018
|
-
|
|
17019
|
-
this.resultCode = Enums.ResultCode.UNEXPECTED_APPLICATION_ERROR;
|
|
17020
|
-
|
|
17021
|
-
const response = await this.postRequest(url, requestJson);
|
|
17022
|
-
|
|
17023
|
-
if (response.status >= 200 && response.status < 300) {
|
|
17024
|
-
const schema = new VesselLeakMaxFlammableCloudCalculationResponseSchema();
|
|
17025
|
-
const validatedResponse = schema.validate(response.data);
|
|
17026
|
-
|
|
17027
|
-
this.resultCode = validatedResponse.resultCode;
|
|
17028
|
-
if (this.resultCode === Enums.ResultCode.SUCCESS) {
|
|
17029
|
-
this.vesselLeakMaxFlammableCloudResults = validatedResponse.vesselLeakMaxFlammableCloudResults;
|
|
17030
|
-
this.resultCode = validatedResponse.resultCode;
|
|
17031
|
-
this.messages = validatedResponse.messages ?? [];
|
|
17032
|
-
this.calculationElapsedTime = validatedResponse.calculationElapsedTime;
|
|
17033
|
-
this.operationId = validatedResponse.operationId;
|
|
17034
|
-
} else {
|
|
17035
|
-
this.messages.push(...(validatedResponse.messages ?? []));
|
|
17036
|
-
}
|
|
17037
|
-
} else {
|
|
17038
|
-
this.handleFailedResponse(response);
|
|
17039
|
-
}
|
|
17040
|
-
} catch (error) {
|
|
17041
|
-
if (error instanceof Error) {
|
|
17042
|
-
this.messages.push(`Error: ${error.message}`);
|
|
17043
|
-
} else {
|
|
17044
|
-
this.messages.push(`Unexpected error: ${JSON.stringify(error)}`);
|
|
17045
|
-
}
|
|
17046
|
-
console.error(error);
|
|
17047
|
-
this.resultCode = Enums.ResultCode.UNEXPECTED_APPLICATION_ERROR;
|
|
17048
|
-
}
|
|
17049
|
-
|
|
17050
|
-
return this.resultCode;
|
|
17051
|
-
}
|
|
17052
|
-
|
|
17053
|
-
toString() {
|
|
17054
|
-
const parts = ["* VesselLeakMaxFlammableCloud"];
|
|
17055
|
-
|
|
17056
|
-
parts.push(`vesselLeakMaxFlammableCloudResults: ${String(this.vesselLeakMaxFlammableCloudResults)}`);
|
|
17057
|
-
parts.push(`resultCode: ${String(this.resultCode)}`);
|
|
17058
|
-
parts.push("*** messages:");
|
|
17059
|
-
parts.push(`messages: ${this.messages !== undefined ? this.messages : "(None)"}`);
|
|
17060
|
-
parts.push(`calculationElapsedTime: ${this.calculationElapsedTime !== undefined ? this.calculationElapsedTime : "(None)"}`);
|
|
17061
|
-
parts.push(`operationId: ${this.operationId !== undefined ? this.operationId : "(None)"}`);
|
|
17062
|
-
|
|
17063
|
-
return parts.join("\n");
|
|
17064
|
-
}
|
|
17065
|
-
}
|
|
17066
|
-
|
|
17067
|
-
export class VesselLeakMaxFlammableCloudCalculationResponse extends CalculationResponseBase {
|
|
17068
|
-
vesselLeakMaxFlammableCloudResults: Entities.VesselLeakMaxFlammableCloudResults;
|
|
17069
|
-
|
|
17070
|
-
/**
|
|
17071
|
-
* VesselLeakMaxFlammableCloud calculation response class.
|
|
17072
|
-
*
|
|
17073
|
-
* @param {Entities.VesselLeakMaxFlammableCloudResults} vesselLeakMaxFlammableCloudResults - A Vessel Leak Max Flammable Cloud Results entity.
|
|
17074
|
-
*/
|
|
17075
|
-
constructor(
|
|
17076
|
-
vesselLeakMaxFlammableCloudResults: Entities.VesselLeakMaxFlammableCloudResults,
|
|
17077
|
-
resultCode: Enums.ResultCode,
|
|
17078
|
-
messages: string[],
|
|
17079
|
-
calculationElapsedTime: number,
|
|
17080
|
-
operationId: string
|
|
17081
|
-
) {
|
|
17082
|
-
super();
|
|
17083
|
-
this.vesselLeakMaxFlammableCloudResults = vesselLeakMaxFlammableCloudResults;
|
|
17084
|
-
this.resultCode = resultCode;
|
|
17085
|
-
this.messages = messages;
|
|
17086
|
-
this.calculationElapsedTime = calculationElapsedTime;
|
|
17087
|
-
this.operationId = operationId;
|
|
17088
|
-
}
|
|
17089
|
-
|
|
17090
|
-
initialiseFromDictionary(data: { [key: string]: unknown }) {
|
|
17091
|
-
if (data.vesselLeakMaxFlammableCloudResults) {
|
|
17092
|
-
this.vesselLeakMaxFlammableCloudResults = new Entities.VesselLeakMaxFlammableCloudResults();
|
|
17093
|
-
this.vesselLeakMaxFlammableCloudResults.initialiseFromDictionary(data.vesselLeakMaxFlammableCloudResults);
|
|
17094
|
-
}
|
|
17095
|
-
if (data.resultCode !== undefined && (typeof data.resultCode === "string" || typeof data.resultCode === "number")) {
|
|
17096
|
-
this.resultCode = data.resultCode as Enums.ResultCode;
|
|
17097
|
-
}
|
|
17098
|
-
this.messages = this.messages ?? [];
|
|
17099
|
-
if (data.messages && Array.isArray(data.messages)) {
|
|
17100
|
-
this.messages.push(...data.messages);
|
|
17101
|
-
}
|
|
17102
|
-
if (data.calculationElapsedTime !== undefined && typeof data.calculationElapsedTime === "number") {
|
|
17103
|
-
this.calculationElapsedTime = data.calculationElapsedTime as number;
|
|
17104
|
-
}
|
|
17105
|
-
if (data.operationId !== undefined && typeof data.operationId === "string") {
|
|
17106
|
-
this.operationId = data.operationId as string;
|
|
17107
|
-
}
|
|
17108
|
-
}
|
|
17109
|
-
}
|
|
17110
|
-
|
|
17111
|
-
export interface VesselLeakMaxFlammableCloudCalculationResponseSchemaData {
|
|
17112
|
-
vesselLeakMaxFlammableCloudResults: Entities.VesselLeakMaxFlammableCloudResults;
|
|
17113
|
-
resultCode: Enums.ResultCode;
|
|
17114
|
-
messages: string[];
|
|
17115
|
-
calculationElapsedTime: number;
|
|
17116
|
-
operationId: string;
|
|
17117
|
-
}
|
|
17118
|
-
|
|
17119
|
-
export class VesselLeakMaxFlammableCloudCalculationResponseSchema {
|
|
17120
|
-
schema: Joi.ObjectSchema;
|
|
17121
|
-
propertyTypes: Record<string, string>;
|
|
17122
|
-
|
|
17123
|
-
/**
|
|
17124
|
-
* Schema for the VesselLeakMaxFlammableCloud calculation response.
|
|
17125
|
-
*/
|
|
17126
|
-
constructor() {
|
|
17127
|
-
this.schema = Joi.object({
|
|
17128
|
-
vesselLeakMaxFlammableCloudResults: new EntitySchemas.VesselLeakMaxFlammableCloudResultsSchema().schema,
|
|
17129
|
-
resultCode: Joi.string().valid(...Object.values(Enums.ResultCode)),
|
|
17130
|
-
messages: Joi.array().items(Joi.string()),
|
|
17131
|
-
calculationElapsedTime: Joi.number().unsafe(),
|
|
17132
|
-
operationId: Joi.string().uuid().allow(null),
|
|
17133
|
-
}).unknown(true);
|
|
17134
|
-
|
|
17135
|
-
this.propertyTypes = {
|
|
17136
|
-
vesselLeakMaxFlammableCloudResults: "Entities.VesselLeakMaxFlammableCloudResults",
|
|
17137
|
-
};
|
|
17138
|
-
}
|
|
17139
|
-
|
|
17140
|
-
validate(data: VesselLeakMaxFlammableCloudCalculationResponseSchemaData): VesselLeakMaxFlammableCloudCalculationResponse {
|
|
17141
|
-
const { error, value } = this.schema.validate(data, { abortEarly: false });
|
|
17142
|
-
if (error) {
|
|
17143
|
-
throw new Error(`Validation error: ${error.details.map((x) => x.message).join(", ")}`);
|
|
17144
|
-
}
|
|
17145
|
-
return this.makeCalculationResponse(value);
|
|
17146
|
-
}
|
|
17147
|
-
|
|
17148
|
-
makeCalculationResponse(data: VesselLeakMaxFlammableCloudCalculationResponseSchemaData): VesselLeakMaxFlammableCloudCalculationResponse {
|
|
17149
|
-
return new VesselLeakMaxFlammableCloudCalculationResponse(
|
|
17150
|
-
data.vesselLeakMaxFlammableCloudResults,
|
|
17151
|
-
data.resultCode,
|
|
17152
|
-
data.messages,
|
|
17153
|
-
data.calculationElapsedTime,
|
|
17154
|
-
data.operationId
|
|
17155
|
-
);
|
|
17156
|
-
}
|
|
17157
|
-
}
|
|
17158
|
-
|
|
17159
15179
|
export interface VesselLineRuptureCalculationRequestSchemaData {
|
|
17160
15180
|
vessel: Entities.Vessel;
|
|
17161
15181
|
lineRupture: Entities.LineRupture;
|
|
@@ -17355,11 +15375,11 @@ export class VesselLineRuptureCalculationResponse extends CalculationResponseBas
|
|
|
17355
15375
|
initialiseFromDictionary(data: { [key: string]: unknown }) {
|
|
17356
15376
|
if (data.exitMaterial) {
|
|
17357
15377
|
this.exitMaterial = new Entities.Material();
|
|
17358
|
-
this.exitMaterial.initialiseFromDictionary(data.exitMaterial);
|
|
15378
|
+
this.exitMaterial.initialiseFromDictionary(data.exitMaterial as { [key: string]: unknown });
|
|
17359
15379
|
}
|
|
17360
15380
|
if (data.dischargeResult) {
|
|
17361
15381
|
this.dischargeResult = new Entities.DischargeResult();
|
|
17362
|
-
this.dischargeResult.initialiseFromDictionary(data.dischargeResult);
|
|
15382
|
+
this.dischargeResult.initialiseFromDictionary(data.dischargeResult as { [key: string]: unknown });
|
|
17363
15383
|
}
|
|
17364
15384
|
if (data.dischargeRecords && Array.isArray(data.dischargeRecords)) {
|
|
17365
15385
|
this.dischargeRecords = data.dischargeRecords.map(
|
|
@@ -18085,7 +16105,7 @@ export class VesselLineRuptureLinkedRunCalculationResponse extends CalculationRe
|
|
|
18085
16105
|
initialiseFromDictionary(data: { [key: string]: unknown }) {
|
|
18086
16106
|
if (data.dischargeRecord) {
|
|
18087
16107
|
this.dischargeRecord = new Entities.DischargeRecord();
|
|
18088
|
-
this.dischargeRecord.initialiseFromDictionary(data.dischargeRecord);
|
|
16108
|
+
this.dischargeRecord.initialiseFromDictionary(data.dischargeRecord as { [key: string]: unknown });
|
|
18089
16109
|
}
|
|
18090
16110
|
if (data.distancesToJetFireRadiation && Array.isArray(data.distancesToJetFireRadiation)) {
|
|
18091
16111
|
this.distancesToJetFireRadiation = data.distancesToJetFireRadiation.map((item) => parseFloat(item));
|
|
@@ -18176,11 +16196,11 @@ export class VesselLineRuptureLinkedRunCalculationResponse extends CalculationRe
|
|
|
18176
16196
|
}
|
|
18177
16197
|
if (data.jetFireFlameResult) {
|
|
18178
16198
|
this.jetFireFlameResult = new Entities.FlameResult();
|
|
18179
|
-
this.jetFireFlameResult.initialiseFromDictionary(data.jetFireFlameResult);
|
|
16199
|
+
this.jetFireFlameResult.initialiseFromDictionary(data.jetFireFlameResult as { [key: string]: unknown });
|
|
18180
16200
|
}
|
|
18181
16201
|
if (data.poolFireFlameResult) {
|
|
18182
16202
|
this.poolFireFlameResult = new Entities.PoolFireFlameResult();
|
|
18183
|
-
this.poolFireFlameResult.initialiseFromDictionary(data.poolFireFlameResult);
|
|
16203
|
+
this.poolFireFlameResult.initialiseFromDictionary(data.poolFireFlameResult as { [key: string]: unknown });
|
|
18184
16204
|
}
|
|
18185
16205
|
if (data.resultCode !== undefined && (typeof data.resultCode === "string" || typeof data.resultCode === "number")) {
|
|
18186
16206
|
this.resultCode = data.resultCode as Enums.ResultCode;
|
|
@@ -18529,11 +16549,11 @@ export class VesselReliefValveCalculationResponse extends CalculationResponseBas
|
|
|
18529
16549
|
initialiseFromDictionary(data: { [key: string]: unknown }) {
|
|
18530
16550
|
if (data.exitMaterial) {
|
|
18531
16551
|
this.exitMaterial = new Entities.Material();
|
|
18532
|
-
this.exitMaterial.initialiseFromDictionary(data.exitMaterial);
|
|
16552
|
+
this.exitMaterial.initialiseFromDictionary(data.exitMaterial as { [key: string]: unknown });
|
|
18533
16553
|
}
|
|
18534
16554
|
if (data.dischargeResult) {
|
|
18535
16555
|
this.dischargeResult = new Entities.DischargeResult();
|
|
18536
|
-
this.dischargeResult.initialiseFromDictionary(data.dischargeResult);
|
|
16556
|
+
this.dischargeResult.initialiseFromDictionary(data.dischargeResult as { [key: string]: unknown });
|
|
18537
16557
|
}
|
|
18538
16558
|
if (data.dischargeRecords && Array.isArray(data.dischargeRecords)) {
|
|
18539
16559
|
this.dischargeRecords = data.dischargeRecords.map(
|
|
@@ -19259,7 +17279,7 @@ export class VesselReliefValveLinkedRunCalculationResponse extends CalculationRe
|
|
|
19259
17279
|
initialiseFromDictionary(data: { [key: string]: unknown }) {
|
|
19260
17280
|
if (data.dischargeRecord) {
|
|
19261
17281
|
this.dischargeRecord = new Entities.DischargeRecord();
|
|
19262
|
-
this.dischargeRecord.initialiseFromDictionary(data.dischargeRecord);
|
|
17282
|
+
this.dischargeRecord.initialiseFromDictionary(data.dischargeRecord as { [key: string]: unknown });
|
|
19263
17283
|
}
|
|
19264
17284
|
if (data.distancesToJetFireRadiation && Array.isArray(data.distancesToJetFireRadiation)) {
|
|
19265
17285
|
this.distancesToJetFireRadiation = data.distancesToJetFireRadiation.map((item) => parseFloat(item));
|
|
@@ -19350,11 +17370,11 @@ export class VesselReliefValveLinkedRunCalculationResponse extends CalculationRe
|
|
|
19350
17370
|
}
|
|
19351
17371
|
if (data.jetFireFlameResult) {
|
|
19352
17372
|
this.jetFireFlameResult = new Entities.FlameResult();
|
|
19353
|
-
this.jetFireFlameResult.initialiseFromDictionary(data.jetFireFlameResult);
|
|
17373
|
+
this.jetFireFlameResult.initialiseFromDictionary(data.jetFireFlameResult as { [key: string]: unknown });
|
|
19354
17374
|
}
|
|
19355
17375
|
if (data.poolFireFlameResult) {
|
|
19356
17376
|
this.poolFireFlameResult = new Entities.PoolFireFlameResult();
|
|
19357
|
-
this.poolFireFlameResult.initialiseFromDictionary(data.poolFireFlameResult);
|
|
17377
|
+
this.poolFireFlameResult.initialiseFromDictionary(data.poolFireFlameResult as { [key: string]: unknown });
|
|
19358
17378
|
}
|
|
19359
17379
|
if (data.resultCode !== undefined && (typeof data.resultCode === "string" || typeof data.resultCode === "number")) {
|
|
19360
17380
|
this.resultCode = data.resultCode as Enums.ResultCode;
|
|
@@ -19683,7 +17703,7 @@ export class VesselStateCalculationResponse extends CalculationResponseBase {
|
|
|
19683
17703
|
}
|
|
19684
17704
|
if (data.outputState) {
|
|
19685
17705
|
this.outputState = new Entities.State();
|
|
19686
|
-
this.outputState.initialiseFromDictionary(data.outputState);
|
|
17706
|
+
this.outputState.initialiseFromDictionary(data.outputState as { [key: string]: unknown });
|
|
19687
17707
|
}
|
|
19688
17708
|
if (data.resultCode !== undefined && (typeof data.resultCode === "string" || typeof data.resultCode === "number")) {
|
|
19689
17709
|
this.resultCode = data.resultCode as Enums.ResultCode;
|