@dnv-plant/typescriptpws 1.0.86 → 1.0.88
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.vscode/launch.json +16 -0
- package/azure-test-folder-job.yml +2 -2
- package/index.ts +3 -3
- package/package.json +7 -6
- package/src/calculations/applicationTools.ts +29 -36
- package/src/calculations/discharge.ts +423 -321
- package/src/calculations/dispersion.ts +52 -84
- package/src/calculations/dispersionView.ts +311 -549
- package/src/calculations/fireball.ts +45 -69
- package/src/calculations/jetFire.ts +80 -129
- package/src/calculations/lateExplosion.ts +120 -210
- package/src/calculations/linkedRunners.ts +727 -1275
- package/src/calculations/poolFire.ts +45 -69
- package/src/calculations/properties.ts +32 -42
- package/src/calculations/radiation.ts +415 -714
- package/src/calculations/standalones.ts +39 -57
- package/src/calculations/toxics.ts +50 -78
- package/src/calculations/utilities.ts +357 -588
- package/src/constants.ts +9 -3
- package/src/entities.ts +3 -3
- package/src/entity-schemas.ts +3 -3
- package/src/enums.ts +4 -27
- package/src/materials.ts +236 -75
- package/src/utilities.ts +40 -9
- package/tsconfig.json +0 -100
- package/vitest.config.ts +9 -0
|
@@ -6,12 +6,10 @@
|
|
|
6
6
|
* Editing it may lead to inconsistent results and limit DNV's ability to provide support.
|
|
7
7
|
* Please contact DNV if you believe changes are required.
|
|
8
8
|
*
|
|
9
|
-
* Version: 1.0.
|
|
10
|
-
* Date/time:
|
|
9
|
+
* Version: 1.0.89
|
|
10
|
+
* Date/time: 29 Jul 2025 17:59:11
|
|
11
11
|
* Template: templates/typescriptpws/calculations.razor.
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
***********************************************************************/
|
|
15
13
|
|
|
16
14
|
import * as Enums from "../enums";
|
|
17
15
|
import * as Entities from "../entities";
|
|
@@ -36,12 +34,17 @@ class CalculationBase {
|
|
|
36
34
|
messages: string[] = [];
|
|
37
35
|
calculationElapsedTime?: number = 0.0;
|
|
38
36
|
operationId?: string = "";
|
|
37
|
+
controller?: AbortController;
|
|
38
|
+
|
|
39
|
+
constructor(controller?: AbortController) {
|
|
40
|
+
this.controller = controller;
|
|
41
|
+
}
|
|
39
42
|
|
|
40
43
|
/**
|
|
41
44
|
* Post JSON to URL and time the call
|
|
42
45
|
*/
|
|
43
46
|
async postRequest(url: string, data: string): Promise<AxiosResponse> {
|
|
44
|
-
return postRequest(url, data);
|
|
47
|
+
return postRequest(url, data, this.controller);
|
|
45
48
|
}
|
|
46
49
|
|
|
47
50
|
/**
|
|
@@ -153,15 +156,11 @@ class CalculationFailedResponseSchema {
|
|
|
153
156
|
}
|
|
154
157
|
}
|
|
155
158
|
|
|
156
|
-
export interface
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
dischargeRecords: Entities.DischargeRecord[];
|
|
160
|
-
dischargeRecordCount: number;
|
|
161
|
-
phaseToBeReleased: Enums.Phase;
|
|
162
|
-
dischargeParameters: Entities.DischargeParameters;
|
|
163
|
-
substrate: Entities.Substrate;
|
|
159
|
+
export interface BESSLinkedRunnerCalculationRequestSchemaData {
|
|
160
|
+
bessUnit: Entities.BESSUnit;
|
|
161
|
+
bessRelease: Entities.BESSRelease;
|
|
164
162
|
weather: Entities.Weather;
|
|
163
|
+
substrate: Entities.Substrate;
|
|
165
164
|
dispersionParameters: Entities.DispersionParameters[];
|
|
166
165
|
dispersionParameterCount: number;
|
|
167
166
|
endPointConcentration: number;
|
|
@@ -179,15 +178,11 @@ export interface UserDefinedSourceLinkedRunCalculationRequestSchemaData {
|
|
|
179
178
|
explosionConfinedVolumeCount: number;
|
|
180
179
|
}
|
|
181
180
|
|
|
182
|
-
class
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
dischargeRecords: Entities.DischargeRecord[];
|
|
186
|
-
dischargeRecordCount: number;
|
|
187
|
-
phaseToBeReleased: Enums.Phase;
|
|
188
|
-
dischargeParameters: Entities.DischargeParameters;
|
|
189
|
-
substrate: Entities.Substrate;
|
|
181
|
+
class BESSLinkedRunnerCalculationRequest extends CalculationRequestBase {
|
|
182
|
+
bessUnit: Entities.BESSUnit;
|
|
183
|
+
bessRelease: Entities.BESSRelease;
|
|
190
184
|
weather: Entities.Weather;
|
|
185
|
+
substrate: Entities.Substrate;
|
|
191
186
|
dispersionParameters: Entities.DispersionParameters[];
|
|
192
187
|
dispersionParameterCount: number;
|
|
193
188
|
endPointConcentration: number;
|
|
@@ -205,41 +200,14 @@ class UserDefinedSourceLinkedRunCalculationRequest extends CalculationRequestBas
|
|
|
205
200
|
explosionConfinedVolumeCount: number;
|
|
206
201
|
|
|
207
202
|
/**
|
|
208
|
-
*
|
|
203
|
+
* BESSLinkedRunner calculation request class.
|
|
209
204
|
*
|
|
210
|
-
* @param {Entities.Material} material - a material entity.
|
|
211
|
-
* @param {Entities.DischargeResult} dischargeResult - Scalar discharge data.
|
|
212
|
-
* @param {Entities.DischargeRecord[]} dischargeRecords - an array of discharge records.
|
|
213
|
-
* @param {number} dischargeRecordCount - Number of discharge records.
|
|
214
|
-
* @param {Enums.Phase} phaseToBeReleased - Phase to be released ( vapour, two-phase or liquid).
|
|
215
|
-
* @param {Entities.DischargeParameters} dischargeParameters - a discharge parameters entity.
|
|
216
|
-
* @param {Entities.Substrate} substrate - a substrate entity.
|
|
217
|
-
* @param {Entities.Weather} weather - a weather entity.
|
|
218
|
-
* @param {Entities.DispersionParameters[]} dispersionParameters - an array of dispersion parameters.
|
|
219
|
-
* @param {number} dispersionParameterCount - Number of dispersion parameters.
|
|
220
|
-
* @param {number} endPointConcentration - Concentration at which the dispersion calculations will terminate (v/v fraction).
|
|
221
|
-
* @param {Entities.FlammableParameters} flammableParameters - a flammable parameters entity.
|
|
222
|
-
* @param {Entities.ExplosionParameters} explosionParameters - an explosion parameters entity.
|
|
223
|
-
* @param {Entities.DispersionOutputConfig[]} dispersionFlamOutputConfigs - an array of dispersion output configs for flammable concentrations of interest.
|
|
224
|
-
* @param {number} dispersionFlamOutputConfigCount - Number of dispersion output configs for flammable concentrations of interest.
|
|
225
|
-
* @param {Entities.DispersionOutputConfig[]} dispersionToxicOutputConfigs - an array of dispersion output configs for toxic concentrations of interest.
|
|
226
|
-
* @param {number} dispersionToxicOutputConfigCount - Number of dispersion output configs for toxic concentrations of interest.
|
|
227
|
-
* @param {Entities.FlammableOutputConfig[]} flammableOutputConfigs - an array of flammable output configs for radiation levels of interest.
|
|
228
|
-
* @param {number} flammableOutputConfigCount - Number of flammable ouput configs for radiation levels of interest.
|
|
229
|
-
* @param {Entities.ExplosionOutputConfig[]} explosionOutputConfigs - an array of explosion output configs for overpressure levels of interest.
|
|
230
|
-
* @param {number} explosionOutputConfigCount - Number of explosion output configs for overpressure levels of interest.
|
|
231
|
-
* @param {Entities.ExplosionConfinedVolume[]} explosionConfinedVolumes - an array of explosion confined volumes.
|
|
232
|
-
* @param {number} explosionConfinedVolumeCount - Number of explosion confined volumes.
|
|
233
205
|
*/
|
|
234
|
-
constructor(
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
dischargeRecords: Entities.DischargeRecord[],
|
|
238
|
-
dischargeRecordCount: number,
|
|
239
|
-
phaseToBeReleased: Enums.Phase,
|
|
240
|
-
dischargeParameters: Entities.DischargeParameters,
|
|
241
|
-
substrate: Entities.Substrate,
|
|
206
|
+
constructor(data: {
|
|
207
|
+
bessUnit: Entities.BESSUnit,
|
|
208
|
+
bessRelease: Entities.BESSRelease,
|
|
242
209
|
weather: Entities.Weather,
|
|
210
|
+
substrate: Entities.Substrate,
|
|
243
211
|
dispersionParameters: Entities.DispersionParameters[],
|
|
244
212
|
dispersionParameterCount: number,
|
|
245
213
|
endPointConcentration: number,
|
|
@@ -255,51 +223,43 @@ class UserDefinedSourceLinkedRunCalculationRequest extends CalculationRequestBas
|
|
|
255
223
|
explosionOutputConfigCount: number,
|
|
256
224
|
explosionConfinedVolumes: Entities.ExplosionConfinedVolume[],
|
|
257
225
|
explosionConfinedVolumeCount: number
|
|
258
|
-
) {
|
|
226
|
+
}) {
|
|
259
227
|
super();
|
|
260
|
-
this.
|
|
261
|
-
this.
|
|
262
|
-
this.
|
|
263
|
-
this.
|
|
264
|
-
this.
|
|
265
|
-
this.
|
|
266
|
-
this.
|
|
267
|
-
this.
|
|
268
|
-
this.
|
|
269
|
-
this.
|
|
270
|
-
this.
|
|
271
|
-
this.
|
|
272
|
-
this.
|
|
273
|
-
this.
|
|
274
|
-
this.
|
|
275
|
-
this.
|
|
276
|
-
this.
|
|
277
|
-
this.
|
|
278
|
-
this.
|
|
279
|
-
this.explosionOutputConfigs = explosionOutputConfigs;
|
|
280
|
-
this.explosionOutputConfigCount = explosionOutputConfigCount;
|
|
281
|
-
this.explosionConfinedVolumes = explosionConfinedVolumes;
|
|
282
|
-
this.explosionConfinedVolumeCount = explosionConfinedVolumeCount;
|
|
228
|
+
this.bessUnit = data.bessUnit;
|
|
229
|
+
this.bessRelease = data.bessRelease;
|
|
230
|
+
this.weather = data.weather;
|
|
231
|
+
this.substrate = data.substrate;
|
|
232
|
+
this.dispersionParameters = data.dispersionParameters;
|
|
233
|
+
this.dispersionParameterCount = data.dispersionParameterCount;
|
|
234
|
+
this.endPointConcentration = data.endPointConcentration;
|
|
235
|
+
this.flammableParameters = data.flammableParameters;
|
|
236
|
+
this.explosionParameters = data.explosionParameters;
|
|
237
|
+
this.dispersionFlamOutputConfigs = data.dispersionFlamOutputConfigs;
|
|
238
|
+
this.dispersionFlamOutputConfigCount = data.dispersionFlamOutputConfigCount;
|
|
239
|
+
this.dispersionToxicOutputConfigs = data.dispersionToxicOutputConfigs;
|
|
240
|
+
this.dispersionToxicOutputConfigCount = data.dispersionToxicOutputConfigCount;
|
|
241
|
+
this.flammableOutputConfigs = data.flammableOutputConfigs;
|
|
242
|
+
this.flammableOutputConfigCount = data.flammableOutputConfigCount;
|
|
243
|
+
this.explosionOutputConfigs = data.explosionOutputConfigs;
|
|
244
|
+
this.explosionOutputConfigCount = data.explosionOutputConfigCount;
|
|
245
|
+
this.explosionConfinedVolumes = data.explosionConfinedVolumes;
|
|
246
|
+
this.explosionConfinedVolumeCount = data.explosionConfinedVolumeCount;
|
|
283
247
|
}
|
|
284
248
|
}
|
|
285
249
|
|
|
286
|
-
export class
|
|
250
|
+
export class BESSLinkedRunnerCalculationRequestSchema {
|
|
287
251
|
schema: Joi.ObjectSchema;
|
|
288
252
|
propertyTypes: Record<string, string>;
|
|
289
253
|
|
|
290
254
|
/**
|
|
291
|
-
* Schema for the
|
|
255
|
+
* Schema for the BESSLinkedRunner calculation request.
|
|
292
256
|
*/
|
|
293
257
|
constructor() {
|
|
294
258
|
this.schema = Joi.object({
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
dischargeRecords: Joi.array().items(new EntitySchemas.DischargeRecordSchema().schema).allow(null),
|
|
298
|
-
dischargeRecordCount: Joi.number().integer(),
|
|
299
|
-
phaseToBeReleased: Joi.string().valid(...Object.values(Enums.Phase)),
|
|
300
|
-
dischargeParameters: new EntitySchemas.DischargeParametersSchema().schema,
|
|
301
|
-
substrate: new EntitySchemas.SubstrateSchema().schema,
|
|
259
|
+
bessUnit: new EntitySchemas.BESSUnitSchema().schema,
|
|
260
|
+
bessRelease: new EntitySchemas.BESSReleaseSchema().schema,
|
|
302
261
|
weather: new EntitySchemas.WeatherSchema().schema,
|
|
262
|
+
substrate: new EntitySchemas.SubstrateSchema().schema,
|
|
303
263
|
dispersionParameters: Joi.array().items(new EntitySchemas.DispersionParametersSchema().schema).allow(null),
|
|
304
264
|
dispersionParameterCount: Joi.number().integer(),
|
|
305
265
|
endPointConcentration: Joi.number().unsafe(),
|
|
@@ -318,14 +278,10 @@ export class UserDefinedSourceLinkedRunCalculationRequestSchema {
|
|
|
318
278
|
}).unknown(true);
|
|
319
279
|
|
|
320
280
|
this.propertyTypes = {
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
dischargeRecords: "Entities.DischargeRecord[]",
|
|
324
|
-
dischargeRecordCount: "number",
|
|
325
|
-
phaseToBeReleased: "Enums.Phase",
|
|
326
|
-
dischargeParameters: "Entities.DischargeParameters",
|
|
327
|
-
substrate: "Entities.Substrate",
|
|
281
|
+
bessUnit: "Entities.BESSUnit",
|
|
282
|
+
bessRelease: "Entities.BESSRelease",
|
|
328
283
|
weather: "Entities.Weather",
|
|
284
|
+
substrate: "Entities.Substrate",
|
|
329
285
|
dispersionParameters: "Entities.DispersionParameters[]",
|
|
330
286
|
dispersionParameterCount: "number",
|
|
331
287
|
endPointConcentration: "number",
|
|
@@ -344,7 +300,7 @@ export class UserDefinedSourceLinkedRunCalculationRequestSchema {
|
|
|
344
300
|
};
|
|
345
301
|
}
|
|
346
302
|
|
|
347
|
-
validate(data:
|
|
303
|
+
validate(data: BESSLinkedRunnerCalculationRequestSchemaData): BESSLinkedRunnerCalculationRequest {
|
|
348
304
|
const { error, value } = this.schema.validate(data, { abortEarly: false });
|
|
349
305
|
if (error) {
|
|
350
306
|
throw new Error(`Validation error: ${error.details.map((x) => x.message).join(", ")}`);
|
|
@@ -352,44 +308,16 @@ export class UserDefinedSourceLinkedRunCalculationRequestSchema {
|
|
|
352
308
|
return this.makeCalculationRequest(value);
|
|
353
309
|
}
|
|
354
310
|
|
|
355
|
-
makeCalculationRequest(data:
|
|
356
|
-
return new
|
|
357
|
-
data.material,
|
|
358
|
-
data.dischargeResult,
|
|
359
|
-
data.dischargeRecords,
|
|
360
|
-
data.dischargeRecordCount,
|
|
361
|
-
data.phaseToBeReleased,
|
|
362
|
-
data.dischargeParameters,
|
|
363
|
-
data.substrate,
|
|
364
|
-
data.weather,
|
|
365
|
-
data.dispersionParameters,
|
|
366
|
-
data.dispersionParameterCount,
|
|
367
|
-
data.endPointConcentration,
|
|
368
|
-
data.flammableParameters,
|
|
369
|
-
data.explosionParameters,
|
|
370
|
-
data.dispersionFlamOutputConfigs,
|
|
371
|
-
data.dispersionFlamOutputConfigCount,
|
|
372
|
-
data.dispersionToxicOutputConfigs,
|
|
373
|
-
data.dispersionToxicOutputConfigCount,
|
|
374
|
-
data.flammableOutputConfigs,
|
|
375
|
-
data.flammableOutputConfigCount,
|
|
376
|
-
data.explosionOutputConfigs,
|
|
377
|
-
data.explosionOutputConfigCount,
|
|
378
|
-
data.explosionConfinedVolumes,
|
|
379
|
-
data.explosionConfinedVolumeCount
|
|
380
|
-
);
|
|
311
|
+
makeCalculationRequest(data: BESSLinkedRunnerCalculationRequestSchemaData): BESSLinkedRunnerCalculationRequest {
|
|
312
|
+
return new BESSLinkedRunnerCalculationRequest(data);
|
|
381
313
|
}
|
|
382
314
|
}
|
|
383
315
|
|
|
384
|
-
export class
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
dischargeRecords: Entities.DischargeRecord[];
|
|
388
|
-
dischargeRecordCount: number;
|
|
389
|
-
phaseToBeReleased: Enums.Phase;
|
|
390
|
-
dischargeParameters: Entities.DischargeParameters;
|
|
391
|
-
substrate: Entities.Substrate;
|
|
316
|
+
export class BESSLinkedRunnerCalculation extends CalculationBase {
|
|
317
|
+
bessUnit: Entities.BESSUnit;
|
|
318
|
+
bessRelease: Entities.BESSRelease;
|
|
392
319
|
weather: Entities.Weather;
|
|
320
|
+
substrate: Entities.Substrate;
|
|
393
321
|
dispersionParameters: Entities.DispersionParameters[];
|
|
394
322
|
dispersionParameterCount: number;
|
|
395
323
|
endPointConcentration: number;
|
|
@@ -405,6 +333,8 @@ export class UserDefinedSourceLinkedRunCalculation extends CalculationBase {
|
|
|
405
333
|
explosionOutputConfigCount: number;
|
|
406
334
|
explosionConfinedVolumes: Entities.ExplosionConfinedVolume[];
|
|
407
335
|
explosionConfinedVolumeCount: number;
|
|
336
|
+
exitMaterial?: Entities.Material;
|
|
337
|
+
dischargeRecord?: Entities.DischargeRecord;
|
|
408
338
|
distancesToJetFireRadiation?: number[];
|
|
409
339
|
jetContourPoints?: Entities.LocalPosition[];
|
|
410
340
|
nJetContourPoints?: number[];
|
|
@@ -428,41 +358,14 @@ export class UserDefinedSourceLinkedRunCalculation extends CalculationBase {
|
|
|
428
358
|
poolFireFlameResult?: Entities.PoolFireFlameResult;
|
|
429
359
|
|
|
430
360
|
/**
|
|
431
|
-
* Calculates maximum distance to a number of concentration
|
|
361
|
+
* Calculates maximum distance to a number of concentration levels for toxic materials, given a BESS unit, BESS release and weather definition.
|
|
432
362
|
*
|
|
433
|
-
* @param {Entities.Material} material - a material entity.
|
|
434
|
-
* @param {Entities.DischargeResult} dischargeResult - Scalar discharge data.
|
|
435
|
-
* @param {Entities.DischargeRecord[]} dischargeRecords - an array of discharge records.
|
|
436
|
-
* @param {number} dischargeRecordCount - Number of discharge records.
|
|
437
|
-
* @param {Enums.Phase} phaseToBeReleased - Phase to be released ( vapour, two-phase or liquid).
|
|
438
|
-
* @param {Entities.DischargeParameters} dischargeParameters - a discharge parameters entity.
|
|
439
|
-
* @param {Entities.Substrate} substrate - a substrate entity.
|
|
440
|
-
* @param {Entities.Weather} weather - a weather entity.
|
|
441
|
-
* @param {Entities.DispersionParameters[]} dispersionParameters - an array of dispersion parameters.
|
|
442
|
-
* @param {number} dispersionParameterCount - Number of dispersion parameters.
|
|
443
|
-
* @param {number} endPointConcentration - Concentration at which the dispersion calculations will terminate (v/v fraction).
|
|
444
|
-
* @param {Entities.FlammableParameters} flammableParameters - a flammable parameters entity.
|
|
445
|
-
* @param {Entities.ExplosionParameters} explosionParameters - an explosion parameters entity.
|
|
446
|
-
* @param {Entities.DispersionOutputConfig[]} dispersionFlamOutputConfigs - an array of dispersion output configs for flammable concentrations of interest.
|
|
447
|
-
* @param {number} dispersionFlamOutputConfigCount - Number of dispersion output configs for flammable concentrations of interest.
|
|
448
|
-
* @param {Entities.DispersionOutputConfig[]} dispersionToxicOutputConfigs - an array of dispersion output configs for toxic concentrations of interest.
|
|
449
|
-
* @param {number} dispersionToxicOutputConfigCount - Number of dispersion output configs for toxic concentrations of interest.
|
|
450
|
-
* @param {Entities.FlammableOutputConfig[]} flammableOutputConfigs - an array of flammable output configs for radiation levels of interest.
|
|
451
|
-
* @param {number} flammableOutputConfigCount - Number of flammable ouput configs for radiation levels of interest.
|
|
452
|
-
* @param {Entities.ExplosionOutputConfig[]} explosionOutputConfigs - an array of explosion output configs for overpressure levels of interest.
|
|
453
|
-
* @param {number} explosionOutputConfigCount - Number of explosion output configs for overpressure levels of interest.
|
|
454
|
-
* @param {Entities.ExplosionConfinedVolume[]} explosionConfinedVolumes - an array of explosion confined volumes.
|
|
455
|
-
* @param {number} explosionConfinedVolumeCount - Number of explosion confined volumes.
|
|
456
363
|
*/
|
|
457
|
-
constructor(
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
dischargeRecords: Entities.DischargeRecord[],
|
|
461
|
-
dischargeRecordCount: number,
|
|
462
|
-
phaseToBeReleased: Enums.Phase,
|
|
463
|
-
dischargeParameters: Entities.DischargeParameters,
|
|
464
|
-
substrate: Entities.Substrate,
|
|
364
|
+
constructor(data: {
|
|
365
|
+
bessUnit: Entities.BESSUnit,
|
|
366
|
+
bessRelease: Entities.BESSRelease,
|
|
465
367
|
weather: Entities.Weather,
|
|
368
|
+
substrate: Entities.Substrate,
|
|
466
369
|
dispersionParameters: Entities.DispersionParameters[],
|
|
467
370
|
dispersionParameterCount: number,
|
|
468
371
|
endPointConcentration: number,
|
|
@@ -478,77 +381,72 @@ export class UserDefinedSourceLinkedRunCalculation extends CalculationBase {
|
|
|
478
381
|
explosionOutputConfigCount: number,
|
|
479
382
|
explosionConfinedVolumes: Entities.ExplosionConfinedVolume[],
|
|
480
383
|
explosionConfinedVolumeCount: number
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
this.
|
|
485
|
-
this.
|
|
486
|
-
this.
|
|
487
|
-
this.
|
|
488
|
-
this.
|
|
489
|
-
this.
|
|
490
|
-
this.
|
|
491
|
-
this.
|
|
492
|
-
this.
|
|
493
|
-
this.
|
|
494
|
-
this.
|
|
495
|
-
this.
|
|
496
|
-
this.
|
|
497
|
-
this.
|
|
498
|
-
this.
|
|
499
|
-
this.
|
|
500
|
-
this.
|
|
501
|
-
this.
|
|
502
|
-
this.
|
|
503
|
-
this.explosionOutputConfigCount = explosionOutputConfigCount;
|
|
504
|
-
this.explosionConfinedVolumes = explosionConfinedVolumes;
|
|
505
|
-
this.explosionConfinedVolumeCount = explosionConfinedVolumeCount;
|
|
384
|
+
controller?: AbortController;
|
|
385
|
+
}) {
|
|
386
|
+
super(data.controller);
|
|
387
|
+
this.bessUnit = data.bessUnit;
|
|
388
|
+
this.bessRelease = data.bessRelease;
|
|
389
|
+
this.weather = data.weather;
|
|
390
|
+
this.substrate = data.substrate;
|
|
391
|
+
this.dispersionParameters = data.dispersionParameters;
|
|
392
|
+
this.dispersionParameterCount = data.dispersionParameterCount;
|
|
393
|
+
this.endPointConcentration = data.endPointConcentration;
|
|
394
|
+
this.flammableParameters = data.flammableParameters;
|
|
395
|
+
this.explosionParameters = data.explosionParameters;
|
|
396
|
+
this.dispersionFlamOutputConfigs = data.dispersionFlamOutputConfigs;
|
|
397
|
+
this.dispersionFlamOutputConfigCount = data.dispersionFlamOutputConfigCount;
|
|
398
|
+
this.dispersionToxicOutputConfigs = data.dispersionToxicOutputConfigs;
|
|
399
|
+
this.dispersionToxicOutputConfigCount = data.dispersionToxicOutputConfigCount;
|
|
400
|
+
this.flammableOutputConfigs = data.flammableOutputConfigs;
|
|
401
|
+
this.flammableOutputConfigCount = data.flammableOutputConfigCount;
|
|
402
|
+
this.explosionOutputConfigs = data.explosionOutputConfigs;
|
|
403
|
+
this.explosionOutputConfigCount = data.explosionOutputConfigCount;
|
|
404
|
+
this.explosionConfinedVolumes = data.explosionConfinedVolumes;
|
|
405
|
+
this.explosionConfinedVolumeCount = data.explosionConfinedVolumeCount;
|
|
506
406
|
}
|
|
507
407
|
|
|
508
408
|
async run() {
|
|
509
409
|
try {
|
|
510
|
-
const request = new
|
|
511
|
-
this.
|
|
512
|
-
this.
|
|
513
|
-
this.
|
|
514
|
-
this.
|
|
515
|
-
this.
|
|
516
|
-
this.
|
|
517
|
-
this.
|
|
518
|
-
this.
|
|
519
|
-
this.
|
|
520
|
-
this.
|
|
521
|
-
this.
|
|
522
|
-
this.
|
|
523
|
-
this.
|
|
524
|
-
this.
|
|
525
|
-
this.
|
|
526
|
-
this.
|
|
527
|
-
this.
|
|
528
|
-
this.
|
|
529
|
-
this.
|
|
530
|
-
|
|
531
|
-
this.explosionOutputConfigCount,
|
|
532
|
-
this.explosionConfinedVolumes,
|
|
533
|
-
this.explosionConfinedVolumeCount
|
|
534
|
-
);
|
|
410
|
+
const request = new BESSLinkedRunnerCalculationRequest({
|
|
411
|
+
bessUnit: this.bessUnit,
|
|
412
|
+
bessRelease: this.bessRelease,
|
|
413
|
+
weather: this.weather,
|
|
414
|
+
substrate: this.substrate,
|
|
415
|
+
dispersionParameters: this.dispersionParameters,
|
|
416
|
+
dispersionParameterCount: this.dispersionParameterCount,
|
|
417
|
+
endPointConcentration: this.endPointConcentration,
|
|
418
|
+
flammableParameters: this.flammableParameters,
|
|
419
|
+
explosionParameters: this.explosionParameters,
|
|
420
|
+
dispersionFlamOutputConfigs: this.dispersionFlamOutputConfigs,
|
|
421
|
+
dispersionFlamOutputConfigCount: this.dispersionFlamOutputConfigCount,
|
|
422
|
+
dispersionToxicOutputConfigs: this.dispersionToxicOutputConfigs,
|
|
423
|
+
dispersionToxicOutputConfigCount: this.dispersionToxicOutputConfigCount,
|
|
424
|
+
flammableOutputConfigs: this.flammableOutputConfigs,
|
|
425
|
+
flammableOutputConfigCount: this.flammableOutputConfigCount,
|
|
426
|
+
explosionOutputConfigs: this.explosionOutputConfigs,
|
|
427
|
+
explosionOutputConfigCount: this.explosionOutputConfigCount,
|
|
428
|
+
explosionConfinedVolumes: this.explosionConfinedVolumes,
|
|
429
|
+
explosionConfinedVolumeCount: this.explosionConfinedVolumeCount
|
|
430
|
+
});
|
|
535
431
|
|
|
536
|
-
const schema = new
|
|
432
|
+
const schema = new BESSLinkedRunnerCalculationRequestSchema();
|
|
537
433
|
const validatedRequest = schema.validate(request);
|
|
538
434
|
|
|
539
435
|
const requestJson = JSON.stringify(validatedRequest);
|
|
540
|
-
const url = `${getAnalyticsApiTarget()}
|
|
436
|
+
const url = `${getAnalyticsApiTarget()}batteryhazardlinkedrun?clientId=${getClientAliasId()}`;
|
|
541
437
|
|
|
542
438
|
this.resultCode = Enums.ResultCode.UNEXPECTED_APPLICATION_ERROR;
|
|
543
439
|
|
|
544
440
|
const { data } = await this.postRequest(url, requestJson);
|
|
545
441
|
|
|
546
|
-
const responseSchema = new
|
|
442
|
+
const responseSchema = new BESSLinkedRunnerCalculationResponseSchema();
|
|
547
443
|
const validatedResponse = responseSchema.validate(data);
|
|
548
444
|
|
|
549
445
|
this.resultCode = validatedResponse.resultCode;
|
|
550
446
|
if (this.resultCode === Enums.ResultCode.SUCCESS) {
|
|
551
447
|
Object.assign(this, {
|
|
448
|
+
exitMaterial: validatedResponse.exitMaterial,
|
|
449
|
+
dischargeRecord: validatedResponse.dischargeRecord,
|
|
552
450
|
distancesToJetFireRadiation: validatedResponse.distancesToJetFireRadiation,
|
|
553
451
|
jetContourPoints: validatedResponse.jetContourPoints,
|
|
554
452
|
nJetContourPoints: validatedResponse.nJetContourPoints,
|
|
@@ -591,8 +489,10 @@ export class UserDefinedSourceLinkedRunCalculation extends CalculationBase {
|
|
|
591
489
|
}
|
|
592
490
|
|
|
593
491
|
toString() {
|
|
594
|
-
const parts = ["*
|
|
492
|
+
const parts = ["* BESSLinkedRunner"];
|
|
595
493
|
|
|
494
|
+
parts.push(`exitMaterial: ${String(this.exitMaterial)}`);
|
|
495
|
+
parts.push(`dischargeRecord: ${String(this.dischargeRecord)}`);
|
|
596
496
|
parts.push("*** distancesToJetFireRadiation:");
|
|
597
497
|
parts.push(
|
|
598
498
|
this.distancesToJetFireRadiation && this.distancesToJetFireRadiation.length > 0
|
|
@@ -719,7 +619,9 @@ export class UserDefinedSourceLinkedRunCalculation extends CalculationBase {
|
|
|
719
619
|
}
|
|
720
620
|
}
|
|
721
621
|
|
|
722
|
-
export class
|
|
622
|
+
export class BESSLinkedRunnerCalculationResponse extends CalculationResponseBase {
|
|
623
|
+
exitMaterial: Entities.Material;
|
|
624
|
+
dischargeRecord: Entities.DischargeRecord;
|
|
723
625
|
distancesToJetFireRadiation: number[];
|
|
724
626
|
jetContourPoints: Entities.LocalPosition[];
|
|
725
627
|
nJetContourPoints: number[];
|
|
@@ -743,31 +645,12 @@ export class UserDefinedSourceLinkedRunCalculationResponse extends CalculationRe
|
|
|
743
645
|
poolFireFlameResult: Entities.PoolFireFlameResult;
|
|
744
646
|
|
|
745
647
|
/**
|
|
746
|
-
*
|
|
648
|
+
* BESSLinkedRunner calculation response class.
|
|
747
649
|
*
|
|
748
|
-
* @param {number[]} distancesToJetFireRadiation - an array of distances to jet fire radiation levels, ordered according to the flammable output configs.
|
|
749
|
-
* @param {Entities.LocalPosition[]} jetContourPoints - an array of jet fire radiation contour points, ordered according to the flammable output configs.
|
|
750
|
-
* @param {number[]} nJetContourPoints - an array of the number of jet fire radiation contour points, ordered according to the flammable output configs.
|
|
751
|
-
* @param {number[]} areaContourJet - an array of areas of the jet fire contours, ordered according to the flammable output configs.
|
|
752
|
-
* @param {number[]} distancesToFlamConcentration - an array of distances to flammable concentration levels, ordered according to the dispersion output configs for flammable concentrations of interest.
|
|
753
|
-
* @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.
|
|
754
|
-
* @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.
|
|
755
|
-
* @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.
|
|
756
|
-
* @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.
|
|
757
|
-
* @param {number[]} distancesToPoolFireRadiation - an array of distances to pool fire radiation levels, ordered according to the flammable output configs.
|
|
758
|
-
* @param {Entities.LocalPosition[]} poolContourPoints - an array of pool fire radiation contour points, ordered according to the flammable output configs.
|
|
759
|
-
* @param {number[]} nPoolContourPoints - an array of the number of pool fire radiation contour points, ordered according to the flammable output configs.
|
|
760
|
-
* @param {number[]} areaContourPool - an array of areas of the pool fire contours, ordered according to the flammable output configs.
|
|
761
|
-
* @param {Entities.ExplosionOverpressureResult[]} explosionOverpressureResults - an array of explosion overpressure results, ordered according to the explosion output configs.
|
|
762
|
-
* @param {number[]} distancesToToxicConcentration - an array of distances to toxic concentration levels, ordered according to the dispersion output configs for toxic concentrations of interest.
|
|
763
|
-
* @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.
|
|
764
|
-
* @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.
|
|
765
|
-
* @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.
|
|
766
|
-
* @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.
|
|
767
|
-
* @param {Entities.FlameResult} jetFireFlameResult - a flame results entity, for jet fire.
|
|
768
|
-
* @param {Entities.PoolFireFlameResult} poolFireFlameResult - a pool fire flame results entity, for pool fire.
|
|
769
650
|
*/
|
|
770
|
-
constructor(
|
|
651
|
+
constructor(data: {
|
|
652
|
+
exitMaterial: Entities.Material,
|
|
653
|
+
dischargeRecord: Entities.DischargeRecord,
|
|
771
654
|
distancesToJetFireRadiation: number[],
|
|
772
655
|
jetContourPoints: Entities.LocalPosition[],
|
|
773
656
|
nJetContourPoints: number[],
|
|
@@ -793,36 +676,46 @@ export class UserDefinedSourceLinkedRunCalculationResponse extends CalculationRe
|
|
|
793
676
|
messages: string[],
|
|
794
677
|
calculationElapsedTime: number,
|
|
795
678
|
operationId: string
|
|
796
|
-
) {
|
|
679
|
+
}) {
|
|
797
680
|
super();
|
|
798
|
-
this.
|
|
799
|
-
this.
|
|
800
|
-
this.
|
|
801
|
-
this.
|
|
802
|
-
this.
|
|
803
|
-
this.
|
|
804
|
-
this.
|
|
805
|
-
this.
|
|
806
|
-
this.
|
|
807
|
-
this.
|
|
808
|
-
this.
|
|
809
|
-
this.
|
|
810
|
-
this.
|
|
811
|
-
this.
|
|
812
|
-
this.
|
|
813
|
-
this.
|
|
814
|
-
this.
|
|
815
|
-
this.
|
|
816
|
-
this.
|
|
817
|
-
this.
|
|
818
|
-
this.
|
|
819
|
-
this.
|
|
820
|
-
this.
|
|
821
|
-
this.
|
|
822
|
-
this.
|
|
681
|
+
this.exitMaterial = data.exitMaterial;
|
|
682
|
+
this.dischargeRecord = data.dischargeRecord;
|
|
683
|
+
this.distancesToJetFireRadiation = data.distancesToJetFireRadiation;
|
|
684
|
+
this.jetContourPoints = data.jetContourPoints;
|
|
685
|
+
this.nJetContourPoints = data.nJetContourPoints;
|
|
686
|
+
this.areaContourJet = data.areaContourJet;
|
|
687
|
+
this.distancesToFlamConcentration = data.distancesToFlamConcentration;
|
|
688
|
+
this.flamConcentrationsUsed = data.flamConcentrationsUsed;
|
|
689
|
+
this.flamConcContourPoints = data.flamConcContourPoints;
|
|
690
|
+
this.nFlamConcContourPoints = data.nFlamConcContourPoints;
|
|
691
|
+
this.areaFootprintFlamConc = data.areaFootprintFlamConc;
|
|
692
|
+
this.distancesToPoolFireRadiation = data.distancesToPoolFireRadiation;
|
|
693
|
+
this.poolContourPoints = data.poolContourPoints;
|
|
694
|
+
this.nPoolContourPoints = data.nPoolContourPoints;
|
|
695
|
+
this.areaContourPool = data.areaContourPool;
|
|
696
|
+
this.explosionOverpressureResults = data.explosionOverpressureResults;
|
|
697
|
+
this.distancesToToxicConcentration = data.distancesToToxicConcentration;
|
|
698
|
+
this.toxicConcentrationUsed = data.toxicConcentrationUsed;
|
|
699
|
+
this.toxicConcContourPoints = data.toxicConcContourPoints;
|
|
700
|
+
this.nToxicConcContourPoints = data.nToxicConcContourPoints;
|
|
701
|
+
this.areaFootprintToxicConc = data.areaFootprintToxicConc;
|
|
702
|
+
this.jetFireFlameResult = data.jetFireFlameResult;
|
|
703
|
+
this.poolFireFlameResult = data.poolFireFlameResult;
|
|
704
|
+
this.resultCode = data.resultCode;
|
|
705
|
+
this.messages = data.messages;
|
|
706
|
+
this.calculationElapsedTime = data.calculationElapsedTime;
|
|
707
|
+
this.operationId = data.operationId;
|
|
823
708
|
}
|
|
824
709
|
|
|
825
710
|
initialiseFromDictionary(data: { [key: string]: unknown }) {
|
|
711
|
+
if (data.exitMaterial) {
|
|
712
|
+
this.exitMaterial = new Entities.Material();
|
|
713
|
+
this.exitMaterial.initialiseFromDictionary(data.exitMaterial as { [key: string]: unknown });
|
|
714
|
+
}
|
|
715
|
+
if (data.dischargeRecord) {
|
|
716
|
+
this.dischargeRecord = new Entities.DischargeRecord();
|
|
717
|
+
this.dischargeRecord.initialiseFromDictionary(data.dischargeRecord as { [key: string]: unknown });
|
|
718
|
+
}
|
|
826
719
|
if (data.distancesToJetFireRadiation && Array.isArray(data.distancesToJetFireRadiation)) {
|
|
827
720
|
this.distancesToJetFireRadiation = data.distancesToJetFireRadiation.map((item) => parseFloat(item));
|
|
828
721
|
}
|
|
@@ -934,7 +827,9 @@ export class UserDefinedSourceLinkedRunCalculationResponse extends CalculationRe
|
|
|
934
827
|
}
|
|
935
828
|
}
|
|
936
829
|
|
|
937
|
-
export interface
|
|
830
|
+
export interface BESSLinkedRunnerCalculationResponseSchemaData {
|
|
831
|
+
exitMaterial: Entities.Material;
|
|
832
|
+
dischargeRecord: Entities.DischargeRecord;
|
|
938
833
|
distancesToJetFireRadiation: number[];
|
|
939
834
|
jetContourPoints: Entities.LocalPosition[];
|
|
940
835
|
nJetContourPoints: number[];
|
|
@@ -962,15 +857,17 @@ export interface UserDefinedSourceLinkedRunCalculationResponseSchemaData {
|
|
|
962
857
|
operationId: string;
|
|
963
858
|
}
|
|
964
859
|
|
|
965
|
-
export class
|
|
860
|
+
export class BESSLinkedRunnerCalculationResponseSchema {
|
|
966
861
|
schema: Joi.ObjectSchema;
|
|
967
862
|
propertyTypes: Record<string, string>;
|
|
968
863
|
|
|
969
864
|
/**
|
|
970
|
-
* Schema for the
|
|
865
|
+
* Schema for the BESSLinkedRunner calculation response.
|
|
971
866
|
*/
|
|
972
867
|
constructor() {
|
|
973
868
|
this.schema = Joi.object({
|
|
869
|
+
exitMaterial: new EntitySchemas.MaterialSchema().schema,
|
|
870
|
+
dischargeRecord: new EntitySchemas.DischargeRecordSchema().schema,
|
|
974
871
|
distancesToJetFireRadiation: Joi.array().items(Joi.number().unsafe()).allow(null),
|
|
975
872
|
jetContourPoints: Joi.array().items(new EntitySchemas.LocalPositionSchema().schema).allow(null),
|
|
976
873
|
nJetContourPoints: Joi.array().items(Joi.number().integer()).allow(null),
|
|
@@ -999,6 +896,8 @@ export class UserDefinedSourceLinkedRunCalculationResponseSchema {
|
|
|
999
896
|
}).unknown(true);
|
|
1000
897
|
|
|
1001
898
|
this.propertyTypes = {
|
|
899
|
+
exitMaterial: "Entities.Material",
|
|
900
|
+
dischargeRecord: "Entities.DischargeRecord",
|
|
1002
901
|
distancesToJetFireRadiation: "number[]",
|
|
1003
902
|
jetContourPoints: "Entities.LocalPosition[]",
|
|
1004
903
|
nJetContourPoints: "number[]",
|
|
@@ -1023,7 +922,7 @@ export class UserDefinedSourceLinkedRunCalculationResponseSchema {
|
|
|
1023
922
|
};
|
|
1024
923
|
}
|
|
1025
924
|
|
|
1026
|
-
validate(data:
|
|
925
|
+
validate(data: BESSLinkedRunnerCalculationResponseSchemaData): BESSLinkedRunnerCalculationResponse {
|
|
1027
926
|
const { error, value } = this.schema.validate(data, { abortEarly: false });
|
|
1028
927
|
if (error) {
|
|
1029
928
|
throw new Error(`Validation error: ${error.details.map((x) => x.message).join(", ")}`);
|
|
@@ -1031,40 +930,17 @@ export class UserDefinedSourceLinkedRunCalculationResponseSchema {
|
|
|
1031
930
|
return this.makeCalculationResponse(value);
|
|
1032
931
|
}
|
|
1033
932
|
|
|
1034
|
-
makeCalculationResponse(data:
|
|
1035
|
-
return new
|
|
1036
|
-
data.distancesToJetFireRadiation,
|
|
1037
|
-
data.jetContourPoints,
|
|
1038
|
-
data.nJetContourPoints,
|
|
1039
|
-
data.areaContourJet,
|
|
1040
|
-
data.distancesToFlamConcentration,
|
|
1041
|
-
data.flamConcentrationsUsed,
|
|
1042
|
-
data.flamConcContourPoints,
|
|
1043
|
-
data.nFlamConcContourPoints,
|
|
1044
|
-
data.areaFootprintFlamConc,
|
|
1045
|
-
data.distancesToPoolFireRadiation,
|
|
1046
|
-
data.poolContourPoints,
|
|
1047
|
-
data.nPoolContourPoints,
|
|
1048
|
-
data.areaContourPool,
|
|
1049
|
-
data.explosionOverpressureResults,
|
|
1050
|
-
data.distancesToToxicConcentration,
|
|
1051
|
-
data.toxicConcentrationUsed,
|
|
1052
|
-
data.toxicConcContourPoints,
|
|
1053
|
-
data.nToxicConcContourPoints,
|
|
1054
|
-
data.areaFootprintToxicConc,
|
|
1055
|
-
data.jetFireFlameResult,
|
|
1056
|
-
data.poolFireFlameResult,
|
|
1057
|
-
data.resultCode,
|
|
1058
|
-
data.messages,
|
|
1059
|
-
data.calculationElapsedTime,
|
|
1060
|
-
data.operationId
|
|
1061
|
-
);
|
|
933
|
+
makeCalculationResponse(data: BESSLinkedRunnerCalculationResponseSchemaData): BESSLinkedRunnerCalculationResponse {
|
|
934
|
+
return new BESSLinkedRunnerCalculationResponse(data);
|
|
1062
935
|
}
|
|
1063
936
|
}
|
|
1064
937
|
|
|
1065
|
-
export interface
|
|
1066
|
-
|
|
1067
|
-
|
|
938
|
+
export interface UserDefinedSourceLinkedRunCalculationRequestSchemaData {
|
|
939
|
+
material: Entities.Material;
|
|
940
|
+
dischargeResult: Entities.DischargeResult;
|
|
941
|
+
dischargeRecords: Entities.DischargeRecord[];
|
|
942
|
+
dischargeRecordCount: number;
|
|
943
|
+
phaseToBeReleased: Enums.Phase;
|
|
1068
944
|
dischargeParameters: Entities.DischargeParameters;
|
|
1069
945
|
substrate: Entities.Substrate;
|
|
1070
946
|
weather: Entities.Weather;
|
|
@@ -1085,9 +961,12 @@ export interface VesselLeakLinkedRunCalculationRequestSchemaData {
|
|
|
1085
961
|
explosionConfinedVolumeCount: number;
|
|
1086
962
|
}
|
|
1087
963
|
|
|
1088
|
-
class
|
|
1089
|
-
|
|
1090
|
-
|
|
964
|
+
class UserDefinedSourceLinkedRunCalculationRequest extends CalculationRequestBase {
|
|
965
|
+
material: Entities.Material;
|
|
966
|
+
dischargeResult: Entities.DischargeResult;
|
|
967
|
+
dischargeRecords: Entities.DischargeRecord[];
|
|
968
|
+
dischargeRecordCount: number;
|
|
969
|
+
phaseToBeReleased: Enums.Phase;
|
|
1091
970
|
dischargeParameters: Entities.DischargeParameters;
|
|
1092
971
|
substrate: Entities.Substrate;
|
|
1093
972
|
weather: Entities.Weather;
|
|
@@ -1108,32 +987,15 @@ class VesselLeakLinkedRunCalculationRequest extends CalculationRequestBase {
|
|
|
1108
987
|
explosionConfinedVolumeCount: number;
|
|
1109
988
|
|
|
1110
989
|
/**
|
|
1111
|
-
*
|
|
990
|
+
* UserDefinedSourceLinkedRun calculation request class.
|
|
1112
991
|
*
|
|
1113
|
-
* @param {Entities.Vessel} vessel - a vessel entity.
|
|
1114
|
-
* @param {Entities.Leak} leak - a leak entity.
|
|
1115
|
-
* @param {Entities.DischargeParameters} dischargeParameters - a discharge parameters entity.
|
|
1116
|
-
* @param {Entities.Substrate} substrate - a substrate entity.
|
|
1117
|
-
* @param {Entities.Weather} weather - a weather entity.
|
|
1118
|
-
* @param {Entities.DispersionParameters[]} dispersionParameters - an array of dispersion parameters.
|
|
1119
|
-
* @param {number} dispersionParameterCount - Number of dispersion parameters.
|
|
1120
|
-
* @param {number} endPointConcentration - Concentration at which the dispersion calculations will terminate (v/v fraction).
|
|
1121
|
-
* @param {Entities.FlammableParameters} flammableParameters - a flammable parameters entity.
|
|
1122
|
-
* @param {Entities.ExplosionParameters} explosionParameters - an explosion parameters entity.
|
|
1123
|
-
* @param {Entities.DispersionOutputConfig[]} dispersionFlamOutputConfigs - an array of dispersion output configs for flammable concentrations of interest.
|
|
1124
|
-
* @param {number} dispersionFlamOutputConfigCount - Number of dispersion output configs for flammable concentrations of interest.
|
|
1125
|
-
* @param {Entities.DispersionOutputConfig[]} dispersionToxicOutputConfigs - an array of dispersion output configs for toxic concentrations of interest.
|
|
1126
|
-
* @param {number} dispersionToxicOutputConfigCount - Number of dispersion output configs for toxic concentrations of interest.
|
|
1127
|
-
* @param {Entities.FlammableOutputConfig[]} flammableOutputConfigs - an array of flammable output configs for radiation levels of interest.
|
|
1128
|
-
* @param {number} flammableOutputConfigCount - Number of flammable ouput configs for radiation levels of interest.
|
|
1129
|
-
* @param {Entities.ExplosionOutputConfig[]} explosionOutputConfigs - an array of explosion output configs for overpressure levels of interest.
|
|
1130
|
-
* @param {number} explosionOutputConfigCount - Number of explosion output configs for overpressure levels of interest.
|
|
1131
|
-
* @param {Entities.ExplosionConfinedVolume[]} explosionConfinedVolumes - an array of explosion confined volumes.
|
|
1132
|
-
* @param {number} explosionConfinedVolumeCount - Number of explosion confined volumes.
|
|
1133
992
|
*/
|
|
1134
|
-
constructor(
|
|
1135
|
-
|
|
1136
|
-
|
|
993
|
+
constructor(data: {
|
|
994
|
+
material: Entities.Material,
|
|
995
|
+
dischargeResult: Entities.DischargeResult,
|
|
996
|
+
dischargeRecords: Entities.DischargeRecord[],
|
|
997
|
+
dischargeRecordCount: number,
|
|
998
|
+
phaseToBeReleased: Enums.Phase,
|
|
1137
999
|
dischargeParameters: Entities.DischargeParameters,
|
|
1138
1000
|
substrate: Entities.Substrate,
|
|
1139
1001
|
weather: Entities.Weather,
|
|
@@ -1152,42 +1014,48 @@ class VesselLeakLinkedRunCalculationRequest extends CalculationRequestBase {
|
|
|
1152
1014
|
explosionOutputConfigCount: number,
|
|
1153
1015
|
explosionConfinedVolumes: Entities.ExplosionConfinedVolume[],
|
|
1154
1016
|
explosionConfinedVolumeCount: number
|
|
1155
|
-
) {
|
|
1017
|
+
}) {
|
|
1156
1018
|
super();
|
|
1157
|
-
this.
|
|
1158
|
-
this.
|
|
1159
|
-
this.
|
|
1160
|
-
this.
|
|
1161
|
-
this.
|
|
1162
|
-
this.
|
|
1163
|
-
this.
|
|
1164
|
-
this.
|
|
1165
|
-
this.
|
|
1166
|
-
this.
|
|
1167
|
-
this.
|
|
1168
|
-
this.
|
|
1169
|
-
this.
|
|
1170
|
-
this.
|
|
1171
|
-
this.
|
|
1172
|
-
this.
|
|
1173
|
-
this.
|
|
1174
|
-
this.
|
|
1175
|
-
this.
|
|
1176
|
-
this.
|
|
1019
|
+
this.material = data.material;
|
|
1020
|
+
this.dischargeResult = data.dischargeResult;
|
|
1021
|
+
this.dischargeRecords = data.dischargeRecords;
|
|
1022
|
+
this.dischargeRecordCount = data.dischargeRecordCount;
|
|
1023
|
+
this.phaseToBeReleased = data.phaseToBeReleased;
|
|
1024
|
+
this.dischargeParameters = data.dischargeParameters;
|
|
1025
|
+
this.substrate = data.substrate;
|
|
1026
|
+
this.weather = data.weather;
|
|
1027
|
+
this.dispersionParameters = data.dispersionParameters;
|
|
1028
|
+
this.dispersionParameterCount = data.dispersionParameterCount;
|
|
1029
|
+
this.endPointConcentration = data.endPointConcentration;
|
|
1030
|
+
this.flammableParameters = data.flammableParameters;
|
|
1031
|
+
this.explosionParameters = data.explosionParameters;
|
|
1032
|
+
this.dispersionFlamOutputConfigs = data.dispersionFlamOutputConfigs;
|
|
1033
|
+
this.dispersionFlamOutputConfigCount = data.dispersionFlamOutputConfigCount;
|
|
1034
|
+
this.dispersionToxicOutputConfigs = data.dispersionToxicOutputConfigs;
|
|
1035
|
+
this.dispersionToxicOutputConfigCount = data.dispersionToxicOutputConfigCount;
|
|
1036
|
+
this.flammableOutputConfigs = data.flammableOutputConfigs;
|
|
1037
|
+
this.flammableOutputConfigCount = data.flammableOutputConfigCount;
|
|
1038
|
+
this.explosionOutputConfigs = data.explosionOutputConfigs;
|
|
1039
|
+
this.explosionOutputConfigCount = data.explosionOutputConfigCount;
|
|
1040
|
+
this.explosionConfinedVolumes = data.explosionConfinedVolumes;
|
|
1041
|
+
this.explosionConfinedVolumeCount = data.explosionConfinedVolumeCount;
|
|
1177
1042
|
}
|
|
1178
1043
|
}
|
|
1179
1044
|
|
|
1180
|
-
export class
|
|
1045
|
+
export class UserDefinedSourceLinkedRunCalculationRequestSchema {
|
|
1181
1046
|
schema: Joi.ObjectSchema;
|
|
1182
1047
|
propertyTypes: Record<string, string>;
|
|
1183
1048
|
|
|
1184
1049
|
/**
|
|
1185
|
-
* Schema for the
|
|
1050
|
+
* Schema for the UserDefinedSourceLinkedRun calculation request.
|
|
1186
1051
|
*/
|
|
1187
1052
|
constructor() {
|
|
1188
1053
|
this.schema = Joi.object({
|
|
1189
|
-
|
|
1190
|
-
|
|
1054
|
+
material: new EntitySchemas.MaterialSchema().schema,
|
|
1055
|
+
dischargeResult: new EntitySchemas.DischargeResultSchema().schema,
|
|
1056
|
+
dischargeRecords: Joi.array().items(new EntitySchemas.DischargeRecordSchema().schema).allow(null),
|
|
1057
|
+
dischargeRecordCount: Joi.number().integer(),
|
|
1058
|
+
phaseToBeReleased: Joi.string().valid(...Object.values(Enums.Phase)),
|
|
1191
1059
|
dischargeParameters: new EntitySchemas.DischargeParametersSchema().schema,
|
|
1192
1060
|
substrate: new EntitySchemas.SubstrateSchema().schema,
|
|
1193
1061
|
weather: new EntitySchemas.WeatherSchema().schema,
|
|
@@ -1209,8 +1077,11 @@ export class VesselLeakLinkedRunCalculationRequestSchema {
|
|
|
1209
1077
|
}).unknown(true);
|
|
1210
1078
|
|
|
1211
1079
|
this.propertyTypes = {
|
|
1212
|
-
|
|
1213
|
-
|
|
1080
|
+
material: "Entities.Material",
|
|
1081
|
+
dischargeResult: "Entities.DischargeResult",
|
|
1082
|
+
dischargeRecords: "Entities.DischargeRecord[]",
|
|
1083
|
+
dischargeRecordCount: "number",
|
|
1084
|
+
phaseToBeReleased: "Enums.Phase",
|
|
1214
1085
|
dischargeParameters: "Entities.DischargeParameters",
|
|
1215
1086
|
substrate: "Entities.Substrate",
|
|
1216
1087
|
weather: "Entities.Weather",
|
|
@@ -1232,7 +1103,7 @@ export class VesselLeakLinkedRunCalculationRequestSchema {
|
|
|
1232
1103
|
};
|
|
1233
1104
|
}
|
|
1234
1105
|
|
|
1235
|
-
validate(data:
|
|
1106
|
+
validate(data: UserDefinedSourceLinkedRunCalculationRequestSchemaData): UserDefinedSourceLinkedRunCalculationRequest {
|
|
1236
1107
|
const { error, value } = this.schema.validate(data, { abortEarly: false });
|
|
1237
1108
|
if (error) {
|
|
1238
1109
|
throw new Error(`Validation error: ${error.details.map((x) => x.message).join(", ")}`);
|
|
@@ -1240,35 +1111,17 @@ export class VesselLeakLinkedRunCalculationRequestSchema {
|
|
|
1240
1111
|
return this.makeCalculationRequest(value);
|
|
1241
1112
|
}
|
|
1242
1113
|
|
|
1243
|
-
makeCalculationRequest(data:
|
|
1244
|
-
return new
|
|
1245
|
-
data.vessel,
|
|
1246
|
-
data.leak,
|
|
1247
|
-
data.dischargeParameters,
|
|
1248
|
-
data.substrate,
|
|
1249
|
-
data.weather,
|
|
1250
|
-
data.dispersionParameters,
|
|
1251
|
-
data.dispersionParameterCount,
|
|
1252
|
-
data.endPointConcentration,
|
|
1253
|
-
data.flammableParameters,
|
|
1254
|
-
data.explosionParameters,
|
|
1255
|
-
data.dispersionFlamOutputConfigs,
|
|
1256
|
-
data.dispersionFlamOutputConfigCount,
|
|
1257
|
-
data.dispersionToxicOutputConfigs,
|
|
1258
|
-
data.dispersionToxicOutputConfigCount,
|
|
1259
|
-
data.flammableOutputConfigs,
|
|
1260
|
-
data.flammableOutputConfigCount,
|
|
1261
|
-
data.explosionOutputConfigs,
|
|
1262
|
-
data.explosionOutputConfigCount,
|
|
1263
|
-
data.explosionConfinedVolumes,
|
|
1264
|
-
data.explosionConfinedVolumeCount
|
|
1265
|
-
);
|
|
1114
|
+
makeCalculationRequest(data: UserDefinedSourceLinkedRunCalculationRequestSchemaData): UserDefinedSourceLinkedRunCalculationRequest {
|
|
1115
|
+
return new UserDefinedSourceLinkedRunCalculationRequest(data);
|
|
1266
1116
|
}
|
|
1267
1117
|
}
|
|
1268
1118
|
|
|
1269
|
-
export class
|
|
1270
|
-
|
|
1271
|
-
|
|
1119
|
+
export class UserDefinedSourceLinkedRunCalculation extends CalculationBase {
|
|
1120
|
+
material: Entities.Material;
|
|
1121
|
+
dischargeResult: Entities.DischargeResult;
|
|
1122
|
+
dischargeRecords: Entities.DischargeRecord[];
|
|
1123
|
+
dischargeRecordCount: number;
|
|
1124
|
+
phaseToBeReleased: Enums.Phase;
|
|
1272
1125
|
dischargeParameters: Entities.DischargeParameters;
|
|
1273
1126
|
substrate: Entities.Substrate;
|
|
1274
1127
|
weather: Entities.Weather;
|
|
@@ -1287,7 +1140,6 @@ export class VesselLeakLinkedRunCalculation extends CalculationBase {
|
|
|
1287
1140
|
explosionOutputConfigCount: number;
|
|
1288
1141
|
explosionConfinedVolumes: Entities.ExplosionConfinedVolume[];
|
|
1289
1142
|
explosionConfinedVolumeCount: number;
|
|
1290
|
-
dischargeRecord?: Entities.DischargeRecord;
|
|
1291
1143
|
distancesToJetFireRadiation?: number[];
|
|
1292
1144
|
jetContourPoints?: Entities.LocalPosition[];
|
|
1293
1145
|
nJetContourPoints?: number[];
|
|
@@ -1311,32 +1163,15 @@ export class VesselLeakLinkedRunCalculation extends CalculationBase {
|
|
|
1311
1163
|
poolFireFlameResult?: Entities.PoolFireFlameResult;
|
|
1312
1164
|
|
|
1313
1165
|
/**
|
|
1314
|
-
* Calculates maximum distance to a number of concentration, radiation and overpressure levels for flammable and toxic materials, given
|
|
1166
|
+
* Calculates maximum distance to a number of concentration, radiation and overpressure levels for flammable and toxic materials, given the discharge inputs and weather definition.
|
|
1315
1167
|
*
|
|
1316
|
-
* @param {Entities.Vessel} vessel - a vessel entity.
|
|
1317
|
-
* @param {Entities.Leak} leak - a leak entity.
|
|
1318
|
-
* @param {Entities.DischargeParameters} dischargeParameters - a discharge parameters entity.
|
|
1319
|
-
* @param {Entities.Substrate} substrate - a substrate entity.
|
|
1320
|
-
* @param {Entities.Weather} weather - a weather entity.
|
|
1321
|
-
* @param {Entities.DispersionParameters[]} dispersionParameters - an array of dispersion parameters.
|
|
1322
|
-
* @param {number} dispersionParameterCount - Number of dispersion parameters.
|
|
1323
|
-
* @param {number} endPointConcentration - Concentration at which the dispersion calculations will terminate (v/v fraction).
|
|
1324
|
-
* @param {Entities.FlammableParameters} flammableParameters - a flammable parameters entity.
|
|
1325
|
-
* @param {Entities.ExplosionParameters} explosionParameters - an explosion parameters entity.
|
|
1326
|
-
* @param {Entities.DispersionOutputConfig[]} dispersionFlamOutputConfigs - an array of dispersion output configs for flammable concentrations of interest.
|
|
1327
|
-
* @param {number} dispersionFlamOutputConfigCount - Number of dispersion output configs for flammable concentrations of interest.
|
|
1328
|
-
* @param {Entities.DispersionOutputConfig[]} dispersionToxicOutputConfigs - an array of dispersion output configs for toxic concentrations of interest.
|
|
1329
|
-
* @param {number} dispersionToxicOutputConfigCount - Number of dispersion output configs for toxic concentrations of interest.
|
|
1330
|
-
* @param {Entities.FlammableOutputConfig[]} flammableOutputConfigs - an array of flammable output configs for radiation levels of interest.
|
|
1331
|
-
* @param {number} flammableOutputConfigCount - Number of flammable ouput configs for radiation levels of interest.
|
|
1332
|
-
* @param {Entities.ExplosionOutputConfig[]} explosionOutputConfigs - an array of explosion output configs for overpressure levels of interest.
|
|
1333
|
-
* @param {number} explosionOutputConfigCount - Number of explosion output configs for overpressure levels of interest.
|
|
1334
|
-
* @param {Entities.ExplosionConfinedVolume[]} explosionConfinedVolumes - an array of explosion confined volumes.
|
|
1335
|
-
* @param {number} explosionConfinedVolumeCount - Number of explosion confined volumes.
|
|
1336
1168
|
*/
|
|
1337
|
-
constructor(
|
|
1338
|
-
|
|
1339
|
-
|
|
1169
|
+
constructor(data: {
|
|
1170
|
+
material: Entities.Material,
|
|
1171
|
+
dischargeResult: Entities.DischargeResult,
|
|
1172
|
+
dischargeRecords: Entities.DischargeRecord[],
|
|
1173
|
+
dischargeRecordCount: number,
|
|
1174
|
+
phaseToBeReleased: Enums.Phase,
|
|
1340
1175
|
dischargeParameters: Entities.DischargeParameters,
|
|
1341
1176
|
substrate: Entities.Substrate,
|
|
1342
1177
|
weather: Entities.Weather,
|
|
@@ -1355,72 +1190,78 @@ export class VesselLeakLinkedRunCalculation extends CalculationBase {
|
|
|
1355
1190
|
explosionOutputConfigCount: number,
|
|
1356
1191
|
explosionConfinedVolumes: Entities.ExplosionConfinedVolume[],
|
|
1357
1192
|
explosionConfinedVolumeCount: number
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
this.
|
|
1362
|
-
this.
|
|
1363
|
-
this.
|
|
1364
|
-
this.
|
|
1365
|
-
this.
|
|
1366
|
-
this.
|
|
1367
|
-
this.
|
|
1368
|
-
this.
|
|
1369
|
-
this.
|
|
1370
|
-
this.
|
|
1371
|
-
this.
|
|
1372
|
-
this.
|
|
1373
|
-
this.
|
|
1374
|
-
this.
|
|
1375
|
-
this.
|
|
1376
|
-
this.
|
|
1377
|
-
this.
|
|
1378
|
-
this.
|
|
1379
|
-
this.
|
|
1193
|
+
controller?: AbortController;
|
|
1194
|
+
}) {
|
|
1195
|
+
super(data.controller);
|
|
1196
|
+
this.material = data.material;
|
|
1197
|
+
this.dischargeResult = data.dischargeResult;
|
|
1198
|
+
this.dischargeRecords = data.dischargeRecords;
|
|
1199
|
+
this.dischargeRecordCount = data.dischargeRecordCount;
|
|
1200
|
+
this.phaseToBeReleased = data.phaseToBeReleased;
|
|
1201
|
+
this.dischargeParameters = data.dischargeParameters;
|
|
1202
|
+
this.substrate = data.substrate;
|
|
1203
|
+
this.weather = data.weather;
|
|
1204
|
+
this.dispersionParameters = data.dispersionParameters;
|
|
1205
|
+
this.dispersionParameterCount = data.dispersionParameterCount;
|
|
1206
|
+
this.endPointConcentration = data.endPointConcentration;
|
|
1207
|
+
this.flammableParameters = data.flammableParameters;
|
|
1208
|
+
this.explosionParameters = data.explosionParameters;
|
|
1209
|
+
this.dispersionFlamOutputConfigs = data.dispersionFlamOutputConfigs;
|
|
1210
|
+
this.dispersionFlamOutputConfigCount = data.dispersionFlamOutputConfigCount;
|
|
1211
|
+
this.dispersionToxicOutputConfigs = data.dispersionToxicOutputConfigs;
|
|
1212
|
+
this.dispersionToxicOutputConfigCount = data.dispersionToxicOutputConfigCount;
|
|
1213
|
+
this.flammableOutputConfigs = data.flammableOutputConfigs;
|
|
1214
|
+
this.flammableOutputConfigCount = data.flammableOutputConfigCount;
|
|
1215
|
+
this.explosionOutputConfigs = data.explosionOutputConfigs;
|
|
1216
|
+
this.explosionOutputConfigCount = data.explosionOutputConfigCount;
|
|
1217
|
+
this.explosionConfinedVolumes = data.explosionConfinedVolumes;
|
|
1218
|
+
this.explosionConfinedVolumeCount = data.explosionConfinedVolumeCount;
|
|
1380
1219
|
}
|
|
1381
1220
|
|
|
1382
1221
|
async run() {
|
|
1383
1222
|
try {
|
|
1384
|
-
const request = new
|
|
1385
|
-
this.
|
|
1386
|
-
this.
|
|
1387
|
-
this.
|
|
1388
|
-
this.
|
|
1389
|
-
this.
|
|
1390
|
-
this.
|
|
1391
|
-
this.
|
|
1392
|
-
this.
|
|
1393
|
-
this.
|
|
1394
|
-
this.
|
|
1395
|
-
this.
|
|
1396
|
-
this.
|
|
1397
|
-
this.
|
|
1398
|
-
this.
|
|
1399
|
-
this.
|
|
1400
|
-
this.
|
|
1401
|
-
this.
|
|
1402
|
-
this.
|
|
1403
|
-
this.
|
|
1404
|
-
this.
|
|
1405
|
-
|
|
1223
|
+
const request = new UserDefinedSourceLinkedRunCalculationRequest({
|
|
1224
|
+
material: this.material,
|
|
1225
|
+
dischargeResult: this.dischargeResult,
|
|
1226
|
+
dischargeRecords: this.dischargeRecords,
|
|
1227
|
+
dischargeRecordCount: this.dischargeRecordCount,
|
|
1228
|
+
phaseToBeReleased: this.phaseToBeReleased,
|
|
1229
|
+
dischargeParameters: this.dischargeParameters,
|
|
1230
|
+
substrate: this.substrate,
|
|
1231
|
+
weather: this.weather,
|
|
1232
|
+
dispersionParameters: this.dispersionParameters,
|
|
1233
|
+
dispersionParameterCount: this.dispersionParameterCount,
|
|
1234
|
+
endPointConcentration: this.endPointConcentration,
|
|
1235
|
+
flammableParameters: this.flammableParameters,
|
|
1236
|
+
explosionParameters: this.explosionParameters,
|
|
1237
|
+
dispersionFlamOutputConfigs: this.dispersionFlamOutputConfigs,
|
|
1238
|
+
dispersionFlamOutputConfigCount: this.dispersionFlamOutputConfigCount,
|
|
1239
|
+
dispersionToxicOutputConfigs: this.dispersionToxicOutputConfigs,
|
|
1240
|
+
dispersionToxicOutputConfigCount: this.dispersionToxicOutputConfigCount,
|
|
1241
|
+
flammableOutputConfigs: this.flammableOutputConfigs,
|
|
1242
|
+
flammableOutputConfigCount: this.flammableOutputConfigCount,
|
|
1243
|
+
explosionOutputConfigs: this.explosionOutputConfigs,
|
|
1244
|
+
explosionOutputConfigCount: this.explosionOutputConfigCount,
|
|
1245
|
+
explosionConfinedVolumes: this.explosionConfinedVolumes,
|
|
1246
|
+
explosionConfinedVolumeCount: this.explosionConfinedVolumeCount
|
|
1247
|
+
});
|
|
1406
1248
|
|
|
1407
|
-
const schema = new
|
|
1249
|
+
const schema = new UserDefinedSourceLinkedRunCalculationRequestSchema();
|
|
1408
1250
|
const validatedRequest = schema.validate(request);
|
|
1409
1251
|
|
|
1410
1252
|
const requestJson = JSON.stringify(validatedRequest);
|
|
1411
|
-
const url = `${getAnalyticsApiTarget()}
|
|
1253
|
+
const url = `${getAnalyticsApiTarget()}userdefinedsourcelinkedrun?clientId=${getClientAliasId()}`;
|
|
1412
1254
|
|
|
1413
1255
|
this.resultCode = Enums.ResultCode.UNEXPECTED_APPLICATION_ERROR;
|
|
1414
1256
|
|
|
1415
1257
|
const { data } = await this.postRequest(url, requestJson);
|
|
1416
1258
|
|
|
1417
|
-
const responseSchema = new
|
|
1259
|
+
const responseSchema = new UserDefinedSourceLinkedRunCalculationResponseSchema();
|
|
1418
1260
|
const validatedResponse = responseSchema.validate(data);
|
|
1419
1261
|
|
|
1420
1262
|
this.resultCode = validatedResponse.resultCode;
|
|
1421
1263
|
if (this.resultCode === Enums.ResultCode.SUCCESS) {
|
|
1422
1264
|
Object.assign(this, {
|
|
1423
|
-
dischargeRecord: validatedResponse.dischargeRecord,
|
|
1424
1265
|
distancesToJetFireRadiation: validatedResponse.distancesToJetFireRadiation,
|
|
1425
1266
|
jetContourPoints: validatedResponse.jetContourPoints,
|
|
1426
1267
|
nJetContourPoints: validatedResponse.nJetContourPoints,
|
|
@@ -1463,9 +1304,8 @@ export class VesselLeakLinkedRunCalculation extends CalculationBase {
|
|
|
1463
1304
|
}
|
|
1464
1305
|
|
|
1465
1306
|
toString() {
|
|
1466
|
-
const parts = ["*
|
|
1307
|
+
const parts = ["* UserDefinedSourceLinkedRun"];
|
|
1467
1308
|
|
|
1468
|
-
parts.push(`dischargeRecord: ${String(this.dischargeRecord)}`);
|
|
1469
1309
|
parts.push("*** distancesToJetFireRadiation:");
|
|
1470
1310
|
parts.push(
|
|
1471
1311
|
this.distancesToJetFireRadiation && this.distancesToJetFireRadiation.length > 0
|
|
@@ -1592,8 +1432,7 @@ export class VesselLeakLinkedRunCalculation extends CalculationBase {
|
|
|
1592
1432
|
}
|
|
1593
1433
|
}
|
|
1594
1434
|
|
|
1595
|
-
export class
|
|
1596
|
-
dischargeRecord: Entities.DischargeRecord;
|
|
1435
|
+
export class UserDefinedSourceLinkedRunCalculationResponse extends CalculationResponseBase {
|
|
1597
1436
|
distancesToJetFireRadiation: number[];
|
|
1598
1437
|
jetContourPoints: Entities.LocalPosition[];
|
|
1599
1438
|
nJetContourPoints: number[];
|
|
@@ -1617,33 +1456,10 @@ export class VesselLeakLinkedRunCalculationResponse extends CalculationResponseB
|
|
|
1617
1456
|
poolFireFlameResult: Entities.PoolFireFlameResult;
|
|
1618
1457
|
|
|
1619
1458
|
/**
|
|
1620
|
-
*
|
|
1459
|
+
* UserDefinedSourceLinkedRun calculation response class.
|
|
1621
1460
|
*
|
|
1622
|
-
* @param {Entities.DischargeRecord} dischargeRecord - a discharge record entity.
|
|
1623
|
-
* @param {number[]} distancesToJetFireRadiation - an array of distances to jet fire radiation levels, ordered according to the flammable output configs.
|
|
1624
|
-
* @param {Entities.LocalPosition[]} jetContourPoints - an array of jet fire radiation contour points, ordered according to the flammable output configs.
|
|
1625
|
-
* @param {number[]} nJetContourPoints - an array of the number of jet fire radiation contour points, ordered according to the flammable output configs.
|
|
1626
|
-
* @param {number[]} areaContourJet - an array of areas of the jet fire contours, ordered according to the flammable output configs.
|
|
1627
|
-
* @param {number[]} distancesToFlamConcentration - an array of distances to flammable concentration levels, ordered according to the dispersion output configs for flammable concentrations of interest.
|
|
1628
|
-
* @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.
|
|
1629
|
-
* @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.
|
|
1630
|
-
* @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.
|
|
1631
|
-
* @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.
|
|
1632
|
-
* @param {number[]} distancesToPoolFireRadiation - an array of distances to pool fire radiation levels, ordered according to the flammable output configs.
|
|
1633
|
-
* @param {Entities.LocalPosition[]} poolContourPoints - an array of pool fire radiation contour points, ordered according to the flammable output configs.
|
|
1634
|
-
* @param {number[]} nPoolContourPoints - an array of the number of pool fire radiation contour points, ordered according to the flammable output configs.
|
|
1635
|
-
* @param {number[]} areaContourPool - an array of areas of the pool fire contours, ordered according to the flammable output configs.
|
|
1636
|
-
* @param {Entities.ExplosionOverpressureResult[]} explosionOverpressureResults - an array of explosion overpressure results, ordered according to the explosion output configs.
|
|
1637
|
-
* @param {number[]} distancesToToxicConcentration - an array of distances to toxic concentration levels, ordered according to the dispersion output configs for toxic concentrations of interest.
|
|
1638
|
-
* @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.
|
|
1639
|
-
* @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.
|
|
1640
|
-
* @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.
|
|
1641
|
-
* @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.
|
|
1642
|
-
* @param {Entities.FlameResult} jetFireFlameResult - a flame results entity, for jet fire.
|
|
1643
|
-
* @param {Entities.PoolFireFlameResult} poolFireFlameResult - a pool fire flame results entity, for pool fire.
|
|
1644
1461
|
*/
|
|
1645
|
-
constructor(
|
|
1646
|
-
dischargeRecord: Entities.DischargeRecord,
|
|
1462
|
+
constructor(data: {
|
|
1647
1463
|
distancesToJetFireRadiation: number[],
|
|
1648
1464
|
jetContourPoints: Entities.LocalPosition[],
|
|
1649
1465
|
nJetContourPoints: number[],
|
|
@@ -1669,41 +1485,36 @@ export class VesselLeakLinkedRunCalculationResponse extends CalculationResponseB
|
|
|
1669
1485
|
messages: string[],
|
|
1670
1486
|
calculationElapsedTime: number,
|
|
1671
1487
|
operationId: string
|
|
1672
|
-
) {
|
|
1488
|
+
}) {
|
|
1673
1489
|
super();
|
|
1674
|
-
this.
|
|
1675
|
-
this.
|
|
1676
|
-
this.
|
|
1677
|
-
this.
|
|
1678
|
-
this.
|
|
1679
|
-
this.
|
|
1680
|
-
this.
|
|
1681
|
-
this.
|
|
1682
|
-
this.
|
|
1683
|
-
this.
|
|
1684
|
-
this.
|
|
1685
|
-
this.
|
|
1686
|
-
this.
|
|
1687
|
-
this.
|
|
1688
|
-
this.
|
|
1689
|
-
this.
|
|
1690
|
-
this.
|
|
1691
|
-
this.
|
|
1692
|
-
this.
|
|
1693
|
-
this.
|
|
1694
|
-
this.
|
|
1695
|
-
this.
|
|
1696
|
-
this.
|
|
1697
|
-
this.
|
|
1698
|
-
this.
|
|
1699
|
-
this.operationId = operationId;
|
|
1490
|
+
this.distancesToJetFireRadiation = data.distancesToJetFireRadiation;
|
|
1491
|
+
this.jetContourPoints = data.jetContourPoints;
|
|
1492
|
+
this.nJetContourPoints = data.nJetContourPoints;
|
|
1493
|
+
this.areaContourJet = data.areaContourJet;
|
|
1494
|
+
this.distancesToFlamConcentration = data.distancesToFlamConcentration;
|
|
1495
|
+
this.flamConcentrationsUsed = data.flamConcentrationsUsed;
|
|
1496
|
+
this.flamConcContourPoints = data.flamConcContourPoints;
|
|
1497
|
+
this.nFlamConcContourPoints = data.nFlamConcContourPoints;
|
|
1498
|
+
this.areaFootprintFlamConc = data.areaFootprintFlamConc;
|
|
1499
|
+
this.distancesToPoolFireRadiation = data.distancesToPoolFireRadiation;
|
|
1500
|
+
this.poolContourPoints = data.poolContourPoints;
|
|
1501
|
+
this.nPoolContourPoints = data.nPoolContourPoints;
|
|
1502
|
+
this.areaContourPool = data.areaContourPool;
|
|
1503
|
+
this.explosionOverpressureResults = data.explosionOverpressureResults;
|
|
1504
|
+
this.distancesToToxicConcentration = data.distancesToToxicConcentration;
|
|
1505
|
+
this.toxicConcentrationUsed = data.toxicConcentrationUsed;
|
|
1506
|
+
this.toxicConcContourPoints = data.toxicConcContourPoints;
|
|
1507
|
+
this.nToxicConcContourPoints = data.nToxicConcContourPoints;
|
|
1508
|
+
this.areaFootprintToxicConc = data.areaFootprintToxicConc;
|
|
1509
|
+
this.jetFireFlameResult = data.jetFireFlameResult;
|
|
1510
|
+
this.poolFireFlameResult = data.poolFireFlameResult;
|
|
1511
|
+
this.resultCode = data.resultCode;
|
|
1512
|
+
this.messages = data.messages;
|
|
1513
|
+
this.calculationElapsedTime = data.calculationElapsedTime;
|
|
1514
|
+
this.operationId = data.operationId;
|
|
1700
1515
|
}
|
|
1701
1516
|
|
|
1702
1517
|
initialiseFromDictionary(data: { [key: string]: unknown }) {
|
|
1703
|
-
if (data.dischargeRecord) {
|
|
1704
|
-
this.dischargeRecord = new Entities.DischargeRecord();
|
|
1705
|
-
this.dischargeRecord.initialiseFromDictionary(data.dischargeRecord as { [key: string]: unknown });
|
|
1706
|
-
}
|
|
1707
1518
|
if (data.distancesToJetFireRadiation && Array.isArray(data.distancesToJetFireRadiation)) {
|
|
1708
1519
|
this.distancesToJetFireRadiation = data.distancesToJetFireRadiation.map((item) => parseFloat(item));
|
|
1709
1520
|
}
|
|
@@ -1815,8 +1626,7 @@ export class VesselLeakLinkedRunCalculationResponse extends CalculationResponseB
|
|
|
1815
1626
|
}
|
|
1816
1627
|
}
|
|
1817
1628
|
|
|
1818
|
-
export interface
|
|
1819
|
-
dischargeRecord: Entities.DischargeRecord;
|
|
1629
|
+
export interface UserDefinedSourceLinkedRunCalculationResponseSchemaData {
|
|
1820
1630
|
distancesToJetFireRadiation: number[];
|
|
1821
1631
|
jetContourPoints: Entities.LocalPosition[];
|
|
1822
1632
|
nJetContourPoints: number[];
|
|
@@ -1844,16 +1654,15 @@ export interface VesselLeakLinkedRunCalculationResponseSchemaData {
|
|
|
1844
1654
|
operationId: string;
|
|
1845
1655
|
}
|
|
1846
1656
|
|
|
1847
|
-
export class
|
|
1657
|
+
export class UserDefinedSourceLinkedRunCalculationResponseSchema {
|
|
1848
1658
|
schema: Joi.ObjectSchema;
|
|
1849
1659
|
propertyTypes: Record<string, string>;
|
|
1850
1660
|
|
|
1851
1661
|
/**
|
|
1852
|
-
* Schema for the
|
|
1662
|
+
* Schema for the UserDefinedSourceLinkedRun calculation response.
|
|
1853
1663
|
*/
|
|
1854
1664
|
constructor() {
|
|
1855
1665
|
this.schema = Joi.object({
|
|
1856
|
-
dischargeRecord: new EntitySchemas.DischargeRecordSchema().schema,
|
|
1857
1666
|
distancesToJetFireRadiation: Joi.array().items(Joi.number().unsafe()).allow(null),
|
|
1858
1667
|
jetContourPoints: Joi.array().items(new EntitySchemas.LocalPositionSchema().schema).allow(null),
|
|
1859
1668
|
nJetContourPoints: Joi.array().items(Joi.number().integer()).allow(null),
|
|
@@ -1882,7 +1691,6 @@ export class VesselLeakLinkedRunCalculationResponseSchema {
|
|
|
1882
1691
|
}).unknown(true);
|
|
1883
1692
|
|
|
1884
1693
|
this.propertyTypes = {
|
|
1885
|
-
dischargeRecord: "Entities.DischargeRecord",
|
|
1886
1694
|
distancesToJetFireRadiation: "number[]",
|
|
1887
1695
|
jetContourPoints: "Entities.LocalPosition[]",
|
|
1888
1696
|
nJetContourPoints: "number[]",
|
|
@@ -1907,7 +1715,7 @@ export class VesselLeakLinkedRunCalculationResponseSchema {
|
|
|
1907
1715
|
};
|
|
1908
1716
|
}
|
|
1909
1717
|
|
|
1910
|
-
validate(data:
|
|
1718
|
+
validate(data: UserDefinedSourceLinkedRunCalculationResponseSchemaData): UserDefinedSourceLinkedRunCalculationResponse {
|
|
1911
1719
|
const { error, value } = this.schema.validate(data, { abortEarly: false });
|
|
1912
1720
|
if (error) {
|
|
1913
1721
|
throw new Error(`Validation error: ${error.details.map((x) => x.message).join(", ")}`);
|
|
@@ -1915,41 +1723,14 @@ export class VesselLeakLinkedRunCalculationResponseSchema {
|
|
|
1915
1723
|
return this.makeCalculationResponse(value);
|
|
1916
1724
|
}
|
|
1917
1725
|
|
|
1918
|
-
makeCalculationResponse(data:
|
|
1919
|
-
return new
|
|
1920
|
-
data.dischargeRecord,
|
|
1921
|
-
data.distancesToJetFireRadiation,
|
|
1922
|
-
data.jetContourPoints,
|
|
1923
|
-
data.nJetContourPoints,
|
|
1924
|
-
data.areaContourJet,
|
|
1925
|
-
data.distancesToFlamConcentration,
|
|
1926
|
-
data.flamConcentrationsUsed,
|
|
1927
|
-
data.flamConcContourPoints,
|
|
1928
|
-
data.nFlamConcContourPoints,
|
|
1929
|
-
data.areaFootprintFlamConc,
|
|
1930
|
-
data.distancesToPoolFireRadiation,
|
|
1931
|
-
data.poolContourPoints,
|
|
1932
|
-
data.nPoolContourPoints,
|
|
1933
|
-
data.areaContourPool,
|
|
1934
|
-
data.explosionOverpressureResults,
|
|
1935
|
-
data.distancesToToxicConcentration,
|
|
1936
|
-
data.toxicConcentrationUsed,
|
|
1937
|
-
data.toxicConcContourPoints,
|
|
1938
|
-
data.nToxicConcContourPoints,
|
|
1939
|
-
data.areaFootprintToxicConc,
|
|
1940
|
-
data.jetFireFlameResult,
|
|
1941
|
-
data.poolFireFlameResult,
|
|
1942
|
-
data.resultCode,
|
|
1943
|
-
data.messages,
|
|
1944
|
-
data.calculationElapsedTime,
|
|
1945
|
-
data.operationId
|
|
1946
|
-
);
|
|
1726
|
+
makeCalculationResponse(data: UserDefinedSourceLinkedRunCalculationResponseSchemaData): UserDefinedSourceLinkedRunCalculationResponse {
|
|
1727
|
+
return new UserDefinedSourceLinkedRunCalculationResponse(data);
|
|
1947
1728
|
}
|
|
1948
1729
|
}
|
|
1949
1730
|
|
|
1950
|
-
export interface
|
|
1731
|
+
export interface VesselLeakLinkedRunCalculationRequestSchemaData {
|
|
1951
1732
|
vessel: Entities.Vessel;
|
|
1952
|
-
|
|
1733
|
+
leak: Entities.Leak;
|
|
1953
1734
|
dischargeParameters: Entities.DischargeParameters;
|
|
1954
1735
|
substrate: Entities.Substrate;
|
|
1955
1736
|
weather: Entities.Weather;
|
|
@@ -1970,9 +1751,9 @@ export interface VesselLineRuptureLinkedRunCalculationRequestSchemaData {
|
|
|
1970
1751
|
explosionConfinedVolumeCount: number;
|
|
1971
1752
|
}
|
|
1972
1753
|
|
|
1973
|
-
class
|
|
1754
|
+
class VesselLeakLinkedRunCalculationRequest extends CalculationRequestBase {
|
|
1974
1755
|
vessel: Entities.Vessel;
|
|
1975
|
-
|
|
1756
|
+
leak: Entities.Leak;
|
|
1976
1757
|
dischargeParameters: Entities.DischargeParameters;
|
|
1977
1758
|
substrate: Entities.Substrate;
|
|
1978
1759
|
weather: Entities.Weather;
|
|
@@ -1993,32 +1774,12 @@ class VesselLineRuptureLinkedRunCalculationRequest extends CalculationRequestBas
|
|
|
1993
1774
|
explosionConfinedVolumeCount: number;
|
|
1994
1775
|
|
|
1995
1776
|
/**
|
|
1996
|
-
*
|
|
1777
|
+
* VesselLeakLinkedRun calculation request class.
|
|
1997
1778
|
*
|
|
1998
|
-
* @param {Entities.Vessel} vessel - a vessel entity.
|
|
1999
|
-
* @param {Entities.LineRupture} lineRupture - a line rupture entity.
|
|
2000
|
-
* @param {Entities.DischargeParameters} dischargeParameters - a discharge parameters entity.
|
|
2001
|
-
* @param {Entities.Substrate} substrate - a substrate entity.
|
|
2002
|
-
* @param {Entities.Weather} weather - a weather entity.
|
|
2003
|
-
* @param {Entities.DispersionParameters[]} dispersionParameters - an array of dispersion parameters.
|
|
2004
|
-
* @param {number} dispersionParameterCount - Number of dispersion parameters.
|
|
2005
|
-
* @param {number} endPointConcentration - Concentration at which the dispersion calculations will terminate (v/v fraction).
|
|
2006
|
-
* @param {Entities.FlammableParameters} flammableParameters - a flammable parameters entity.
|
|
2007
|
-
* @param {Entities.ExplosionParameters} explosionParameters - an explosion parameters entity.
|
|
2008
|
-
* @param {Entities.DispersionOutputConfig[]} dispersionFlamOutputConfigs - an array of dispersion output configs for flammable concentrations of interest.
|
|
2009
|
-
* @param {number} dispersionFlamOutputConfigCount - Number of dispersion output configs for flammable concentrations of interest.
|
|
2010
|
-
* @param {Entities.DispersionOutputConfig[]} dispersionToxicOutputConfigs - an array of dispersion output configs for toxic concentrations of interest.
|
|
2011
|
-
* @param {number} dispersionToxicOutputConfigCount - Number of dispersion output configs for toxic concentrations of interest.
|
|
2012
|
-
* @param {Entities.FlammableOutputConfig[]} flammableOutputConfigs - an array of flammable output configs for radiation levels of interest.
|
|
2013
|
-
* @param {number} flammableOutputConfigCount - Number of flammable ouput configs for radiation levels of interest.
|
|
2014
|
-
* @param {Entities.ExplosionOutputConfig[]} explosionOutputConfigs - an array of explosion output configs for overpressure levels of interest.
|
|
2015
|
-
* @param {number} explosionOutputConfigCount - Number of explosion output configs for overpressure levels of interest.
|
|
2016
|
-
* @param {Entities.ExplosionConfinedVolume[]} explosionConfinedVolumes - an array of explosion confined volumes.
|
|
2017
|
-
* @param {number} explosionConfinedVolumeCount - Number of explosion confined volumes.
|
|
2018
1779
|
*/
|
|
2019
|
-
constructor(
|
|
1780
|
+
constructor(data: {
|
|
2020
1781
|
vessel: Entities.Vessel,
|
|
2021
|
-
|
|
1782
|
+
leak: Entities.Leak,
|
|
2022
1783
|
dischargeParameters: Entities.DischargeParameters,
|
|
2023
1784
|
substrate: Entities.Substrate,
|
|
2024
1785
|
weather: Entities.Weather,
|
|
@@ -2037,42 +1798,42 @@ class VesselLineRuptureLinkedRunCalculationRequest extends CalculationRequestBas
|
|
|
2037
1798
|
explosionOutputConfigCount: number,
|
|
2038
1799
|
explosionConfinedVolumes: Entities.ExplosionConfinedVolume[],
|
|
2039
1800
|
explosionConfinedVolumeCount: number
|
|
2040
|
-
) {
|
|
1801
|
+
}) {
|
|
2041
1802
|
super();
|
|
2042
|
-
this.vessel = vessel;
|
|
2043
|
-
this.
|
|
2044
|
-
this.dischargeParameters = dischargeParameters;
|
|
2045
|
-
this.substrate = substrate;
|
|
2046
|
-
this.weather = weather;
|
|
2047
|
-
this.dispersionParameters = dispersionParameters;
|
|
2048
|
-
this.dispersionParameterCount = dispersionParameterCount;
|
|
2049
|
-
this.endPointConcentration = endPointConcentration;
|
|
2050
|
-
this.flammableParameters = flammableParameters;
|
|
2051
|
-
this.explosionParameters = explosionParameters;
|
|
2052
|
-
this.dispersionFlamOutputConfigs = dispersionFlamOutputConfigs;
|
|
2053
|
-
this.dispersionFlamOutputConfigCount = dispersionFlamOutputConfigCount;
|
|
2054
|
-
this.dispersionToxicOutputConfigs = dispersionToxicOutputConfigs;
|
|
2055
|
-
this.dispersionToxicOutputConfigCount = dispersionToxicOutputConfigCount;
|
|
2056
|
-
this.flammableOutputConfigs = flammableOutputConfigs;
|
|
2057
|
-
this.flammableOutputConfigCount = flammableOutputConfigCount;
|
|
2058
|
-
this.explosionOutputConfigs = explosionOutputConfigs;
|
|
2059
|
-
this.explosionOutputConfigCount = explosionOutputConfigCount;
|
|
2060
|
-
this.explosionConfinedVolumes = explosionConfinedVolumes;
|
|
2061
|
-
this.explosionConfinedVolumeCount = explosionConfinedVolumeCount;
|
|
1803
|
+
this.vessel = data.vessel;
|
|
1804
|
+
this.leak = data.leak;
|
|
1805
|
+
this.dischargeParameters = data.dischargeParameters;
|
|
1806
|
+
this.substrate = data.substrate;
|
|
1807
|
+
this.weather = data.weather;
|
|
1808
|
+
this.dispersionParameters = data.dispersionParameters;
|
|
1809
|
+
this.dispersionParameterCount = data.dispersionParameterCount;
|
|
1810
|
+
this.endPointConcentration = data.endPointConcentration;
|
|
1811
|
+
this.flammableParameters = data.flammableParameters;
|
|
1812
|
+
this.explosionParameters = data.explosionParameters;
|
|
1813
|
+
this.dispersionFlamOutputConfigs = data.dispersionFlamOutputConfigs;
|
|
1814
|
+
this.dispersionFlamOutputConfigCount = data.dispersionFlamOutputConfigCount;
|
|
1815
|
+
this.dispersionToxicOutputConfigs = data.dispersionToxicOutputConfigs;
|
|
1816
|
+
this.dispersionToxicOutputConfigCount = data.dispersionToxicOutputConfigCount;
|
|
1817
|
+
this.flammableOutputConfigs = data.flammableOutputConfigs;
|
|
1818
|
+
this.flammableOutputConfigCount = data.flammableOutputConfigCount;
|
|
1819
|
+
this.explosionOutputConfigs = data.explosionOutputConfigs;
|
|
1820
|
+
this.explosionOutputConfigCount = data.explosionOutputConfigCount;
|
|
1821
|
+
this.explosionConfinedVolumes = data.explosionConfinedVolumes;
|
|
1822
|
+
this.explosionConfinedVolumeCount = data.explosionConfinedVolumeCount;
|
|
2062
1823
|
}
|
|
2063
1824
|
}
|
|
2064
1825
|
|
|
2065
|
-
export class
|
|
1826
|
+
export class VesselLeakLinkedRunCalculationRequestSchema {
|
|
2066
1827
|
schema: Joi.ObjectSchema;
|
|
2067
1828
|
propertyTypes: Record<string, string>;
|
|
2068
1829
|
|
|
2069
1830
|
/**
|
|
2070
|
-
* Schema for the
|
|
1831
|
+
* Schema for the VesselLeakLinkedRun calculation request.
|
|
2071
1832
|
*/
|
|
2072
1833
|
constructor() {
|
|
2073
1834
|
this.schema = Joi.object({
|
|
2074
1835
|
vessel: new EntitySchemas.VesselSchema().schema,
|
|
2075
|
-
|
|
1836
|
+
leak: new EntitySchemas.LeakSchema().schema,
|
|
2076
1837
|
dischargeParameters: new EntitySchemas.DischargeParametersSchema().schema,
|
|
2077
1838
|
substrate: new EntitySchemas.SubstrateSchema().schema,
|
|
2078
1839
|
weather: new EntitySchemas.WeatherSchema().schema,
|
|
@@ -2095,7 +1856,7 @@ export class VesselLineRuptureLinkedRunCalculationRequestSchema {
|
|
|
2095
1856
|
|
|
2096
1857
|
this.propertyTypes = {
|
|
2097
1858
|
vessel: "Entities.Vessel",
|
|
2098
|
-
|
|
1859
|
+
leak: "Entities.Leak",
|
|
2099
1860
|
dischargeParameters: "Entities.DischargeParameters",
|
|
2100
1861
|
substrate: "Entities.Substrate",
|
|
2101
1862
|
weather: "Entities.Weather",
|
|
@@ -2117,7 +1878,7 @@ export class VesselLineRuptureLinkedRunCalculationRequestSchema {
|
|
|
2117
1878
|
};
|
|
2118
1879
|
}
|
|
2119
1880
|
|
|
2120
|
-
validate(data:
|
|
1881
|
+
validate(data: VesselLeakLinkedRunCalculationRequestSchemaData): VesselLeakLinkedRunCalculationRequest {
|
|
2121
1882
|
const { error, value } = this.schema.validate(data, { abortEarly: false });
|
|
2122
1883
|
if (error) {
|
|
2123
1884
|
throw new Error(`Validation error: ${error.details.map((x) => x.message).join(", ")}`);
|
|
@@ -2125,35 +1886,14 @@ export class VesselLineRuptureLinkedRunCalculationRequestSchema {
|
|
|
2125
1886
|
return this.makeCalculationRequest(value);
|
|
2126
1887
|
}
|
|
2127
1888
|
|
|
2128
|
-
makeCalculationRequest(data:
|
|
2129
|
-
return new
|
|
2130
|
-
data.vessel,
|
|
2131
|
-
data.lineRupture,
|
|
2132
|
-
data.dischargeParameters,
|
|
2133
|
-
data.substrate,
|
|
2134
|
-
data.weather,
|
|
2135
|
-
data.dispersionParameters,
|
|
2136
|
-
data.dispersionParameterCount,
|
|
2137
|
-
data.endPointConcentration,
|
|
2138
|
-
data.flammableParameters,
|
|
2139
|
-
data.explosionParameters,
|
|
2140
|
-
data.dispersionFlamOutputConfigs,
|
|
2141
|
-
data.dispersionFlamOutputConfigCount,
|
|
2142
|
-
data.dispersionToxicOutputConfigs,
|
|
2143
|
-
data.dispersionToxicOutputConfigCount,
|
|
2144
|
-
data.flammableOutputConfigs,
|
|
2145
|
-
data.flammableOutputConfigCount,
|
|
2146
|
-
data.explosionOutputConfigs,
|
|
2147
|
-
data.explosionOutputConfigCount,
|
|
2148
|
-
data.explosionConfinedVolumes,
|
|
2149
|
-
data.explosionConfinedVolumeCount
|
|
2150
|
-
);
|
|
1889
|
+
makeCalculationRequest(data: VesselLeakLinkedRunCalculationRequestSchemaData): VesselLeakLinkedRunCalculationRequest {
|
|
1890
|
+
return new VesselLeakLinkedRunCalculationRequest(data);
|
|
2151
1891
|
}
|
|
2152
1892
|
}
|
|
2153
1893
|
|
|
2154
|
-
export class
|
|
1894
|
+
export class VesselLeakLinkedRunCalculation extends CalculationBase {
|
|
2155
1895
|
vessel: Entities.Vessel;
|
|
2156
|
-
|
|
1896
|
+
leak: Entities.Leak;
|
|
2157
1897
|
dischargeParameters: Entities.DischargeParameters;
|
|
2158
1898
|
substrate: Entities.Substrate;
|
|
2159
1899
|
weather: Entities.Weather;
|
|
@@ -2196,32 +1936,12 @@ export class VesselLineRuptureLinkedRunCalculation extends CalculationBase {
|
|
|
2196
1936
|
poolFireFlameResult?: Entities.PoolFireFlameResult;
|
|
2197
1937
|
|
|
2198
1938
|
/**
|
|
2199
|
-
* Calculates maximum distance to a number of concentration, radiation and overpressure levels for flammable and toxic materials, given a vessel,
|
|
1939
|
+
* Calculates maximum distance to a number of concentration, radiation and overpressure levels for flammable and toxic materials, given a vessel, leak and weather definition.
|
|
2200
1940
|
*
|
|
2201
|
-
* @param {Entities.Vessel} vessel - a vessel entity.
|
|
2202
|
-
* @param {Entities.LineRupture} lineRupture - a line rupture entity.
|
|
2203
|
-
* @param {Entities.DischargeParameters} dischargeParameters - a discharge parameters entity.
|
|
2204
|
-
* @param {Entities.Substrate} substrate - a substrate entity.
|
|
2205
|
-
* @param {Entities.Weather} weather - a weather entity.
|
|
2206
|
-
* @param {Entities.DispersionParameters[]} dispersionParameters - an array of dispersion parameters.
|
|
2207
|
-
* @param {number} dispersionParameterCount - Number of dispersion parameters.
|
|
2208
|
-
* @param {number} endPointConcentration - Concentration at which the dispersion calculations will terminate (v/v fraction).
|
|
2209
|
-
* @param {Entities.FlammableParameters} flammableParameters - a flammable parameters entity.
|
|
2210
|
-
* @param {Entities.ExplosionParameters} explosionParameters - an explosion parameters entity.
|
|
2211
|
-
* @param {Entities.DispersionOutputConfig[]} dispersionFlamOutputConfigs - an array of dispersion output configs for flammable concentrations of interest.
|
|
2212
|
-
* @param {number} dispersionFlamOutputConfigCount - Number of dispersion output configs for flammable concentrations of interest.
|
|
2213
|
-
* @param {Entities.DispersionOutputConfig[]} dispersionToxicOutputConfigs - an array of dispersion output configs for toxic concentrations of interest.
|
|
2214
|
-
* @param {number} dispersionToxicOutputConfigCount - Number of dispersion output configs for toxic concentrations of interest.
|
|
2215
|
-
* @param {Entities.FlammableOutputConfig[]} flammableOutputConfigs - an array of flammable output configs for radiation levels of interest.
|
|
2216
|
-
* @param {number} flammableOutputConfigCount - Number of flammable ouput configs for radiation levels of interest.
|
|
2217
|
-
* @param {Entities.ExplosionOutputConfig[]} explosionOutputConfigs - an array of explosion output configs for overpressure levels of interest.
|
|
2218
|
-
* @param {number} explosionOutputConfigCount - Number of explosion output configs for overpressure levels of interest.
|
|
2219
|
-
* @param {Entities.ExplosionConfinedVolume[]} explosionConfinedVolumes - an array of explosion confined volumes.
|
|
2220
|
-
* @param {number} explosionConfinedVolumeCount - Number of explosion confined volumes.
|
|
2221
1941
|
*/
|
|
2222
|
-
constructor(
|
|
1942
|
+
constructor(data: {
|
|
2223
1943
|
vessel: Entities.Vessel,
|
|
2224
|
-
|
|
1944
|
+
leak: Entities.Leak,
|
|
2225
1945
|
dischargeParameters: Entities.DischargeParameters,
|
|
2226
1946
|
substrate: Entities.Substrate,
|
|
2227
1947
|
weather: Entities.Weather,
|
|
@@ -2240,66 +1960,67 @@ export class VesselLineRuptureLinkedRunCalculation extends CalculationBase {
|
|
|
2240
1960
|
explosionOutputConfigCount: number,
|
|
2241
1961
|
explosionConfinedVolumes: Entities.ExplosionConfinedVolume[],
|
|
2242
1962
|
explosionConfinedVolumeCount: number
|
|
2243
|
-
|
|
2244
|
-
|
|
2245
|
-
|
|
2246
|
-
this.
|
|
2247
|
-
this.
|
|
2248
|
-
this.
|
|
2249
|
-
this.
|
|
2250
|
-
this.
|
|
2251
|
-
this.
|
|
2252
|
-
this.
|
|
2253
|
-
this.
|
|
2254
|
-
this.
|
|
2255
|
-
this.
|
|
2256
|
-
this.
|
|
2257
|
-
this.
|
|
2258
|
-
this.
|
|
2259
|
-
this.
|
|
2260
|
-
this.
|
|
2261
|
-
this.
|
|
2262
|
-
this.
|
|
2263
|
-
this.
|
|
2264
|
-
this.
|
|
1963
|
+
controller?: AbortController;
|
|
1964
|
+
}) {
|
|
1965
|
+
super(data.controller);
|
|
1966
|
+
this.vessel = data.vessel;
|
|
1967
|
+
this.leak = data.leak;
|
|
1968
|
+
this.dischargeParameters = data.dischargeParameters;
|
|
1969
|
+
this.substrate = data.substrate;
|
|
1970
|
+
this.weather = data.weather;
|
|
1971
|
+
this.dispersionParameters = data.dispersionParameters;
|
|
1972
|
+
this.dispersionParameterCount = data.dispersionParameterCount;
|
|
1973
|
+
this.endPointConcentration = data.endPointConcentration;
|
|
1974
|
+
this.flammableParameters = data.flammableParameters;
|
|
1975
|
+
this.explosionParameters = data.explosionParameters;
|
|
1976
|
+
this.dispersionFlamOutputConfigs = data.dispersionFlamOutputConfigs;
|
|
1977
|
+
this.dispersionFlamOutputConfigCount = data.dispersionFlamOutputConfigCount;
|
|
1978
|
+
this.dispersionToxicOutputConfigs = data.dispersionToxicOutputConfigs;
|
|
1979
|
+
this.dispersionToxicOutputConfigCount = data.dispersionToxicOutputConfigCount;
|
|
1980
|
+
this.flammableOutputConfigs = data.flammableOutputConfigs;
|
|
1981
|
+
this.flammableOutputConfigCount = data.flammableOutputConfigCount;
|
|
1982
|
+
this.explosionOutputConfigs = data.explosionOutputConfigs;
|
|
1983
|
+
this.explosionOutputConfigCount = data.explosionOutputConfigCount;
|
|
1984
|
+
this.explosionConfinedVolumes = data.explosionConfinedVolumes;
|
|
1985
|
+
this.explosionConfinedVolumeCount = data.explosionConfinedVolumeCount;
|
|
2265
1986
|
}
|
|
2266
1987
|
|
|
2267
1988
|
async run() {
|
|
2268
1989
|
try {
|
|
2269
|
-
const request = new
|
|
2270
|
-
this.vessel,
|
|
2271
|
-
this.
|
|
2272
|
-
this.dischargeParameters,
|
|
2273
|
-
this.substrate,
|
|
2274
|
-
this.weather,
|
|
2275
|
-
this.dispersionParameters,
|
|
2276
|
-
this.dispersionParameterCount,
|
|
2277
|
-
this.endPointConcentration,
|
|
2278
|
-
this.flammableParameters,
|
|
2279
|
-
this.explosionParameters,
|
|
2280
|
-
this.dispersionFlamOutputConfigs,
|
|
2281
|
-
this.dispersionFlamOutputConfigCount,
|
|
2282
|
-
this.dispersionToxicOutputConfigs,
|
|
2283
|
-
this.dispersionToxicOutputConfigCount,
|
|
2284
|
-
this.flammableOutputConfigs,
|
|
2285
|
-
this.flammableOutputConfigCount,
|
|
2286
|
-
this.explosionOutputConfigs,
|
|
2287
|
-
this.explosionOutputConfigCount,
|
|
2288
|
-
this.explosionConfinedVolumes,
|
|
2289
|
-
this.explosionConfinedVolumeCount
|
|
2290
|
-
);
|
|
1990
|
+
const request = new VesselLeakLinkedRunCalculationRequest({
|
|
1991
|
+
vessel: this.vessel,
|
|
1992
|
+
leak: this.leak,
|
|
1993
|
+
dischargeParameters: this.dischargeParameters,
|
|
1994
|
+
substrate: this.substrate,
|
|
1995
|
+
weather: this.weather,
|
|
1996
|
+
dispersionParameters: this.dispersionParameters,
|
|
1997
|
+
dispersionParameterCount: this.dispersionParameterCount,
|
|
1998
|
+
endPointConcentration: this.endPointConcentration,
|
|
1999
|
+
flammableParameters: this.flammableParameters,
|
|
2000
|
+
explosionParameters: this.explosionParameters,
|
|
2001
|
+
dispersionFlamOutputConfigs: this.dispersionFlamOutputConfigs,
|
|
2002
|
+
dispersionFlamOutputConfigCount: this.dispersionFlamOutputConfigCount,
|
|
2003
|
+
dispersionToxicOutputConfigs: this.dispersionToxicOutputConfigs,
|
|
2004
|
+
dispersionToxicOutputConfigCount: this.dispersionToxicOutputConfigCount,
|
|
2005
|
+
flammableOutputConfigs: this.flammableOutputConfigs,
|
|
2006
|
+
flammableOutputConfigCount: this.flammableOutputConfigCount,
|
|
2007
|
+
explosionOutputConfigs: this.explosionOutputConfigs,
|
|
2008
|
+
explosionOutputConfigCount: this.explosionOutputConfigCount,
|
|
2009
|
+
explosionConfinedVolumes: this.explosionConfinedVolumes,
|
|
2010
|
+
explosionConfinedVolumeCount: this.explosionConfinedVolumeCount
|
|
2011
|
+
});
|
|
2291
2012
|
|
|
2292
|
-
const schema = new
|
|
2013
|
+
const schema = new VesselLeakLinkedRunCalculationRequestSchema();
|
|
2293
2014
|
const validatedRequest = schema.validate(request);
|
|
2294
2015
|
|
|
2295
2016
|
const requestJson = JSON.stringify(validatedRequest);
|
|
2296
|
-
const url = `${getAnalyticsApiTarget()}
|
|
2017
|
+
const url = `${getAnalyticsApiTarget()}vesselleaklinkedrun?clientId=${getClientAliasId()}`;
|
|
2297
2018
|
|
|
2298
2019
|
this.resultCode = Enums.ResultCode.UNEXPECTED_APPLICATION_ERROR;
|
|
2299
2020
|
|
|
2300
2021
|
const { data } = await this.postRequest(url, requestJson);
|
|
2301
2022
|
|
|
2302
|
-
const responseSchema = new
|
|
2023
|
+
const responseSchema = new VesselLeakLinkedRunCalculationResponseSchema();
|
|
2303
2024
|
const validatedResponse = responseSchema.validate(data);
|
|
2304
2025
|
|
|
2305
2026
|
this.resultCode = validatedResponse.resultCode;
|
|
@@ -2348,7 +2069,7 @@ export class VesselLineRuptureLinkedRunCalculation extends CalculationBase {
|
|
|
2348
2069
|
}
|
|
2349
2070
|
|
|
2350
2071
|
toString() {
|
|
2351
|
-
const parts = ["*
|
|
2072
|
+
const parts = ["* VesselLeakLinkedRun"];
|
|
2352
2073
|
|
|
2353
2074
|
parts.push(`dischargeRecord: ${String(this.dischargeRecord)}`);
|
|
2354
2075
|
parts.push("*** distancesToJetFireRadiation:");
|
|
@@ -2477,7 +2198,7 @@ export class VesselLineRuptureLinkedRunCalculation extends CalculationBase {
|
|
|
2477
2198
|
}
|
|
2478
2199
|
}
|
|
2479
2200
|
|
|
2480
|
-
export class
|
|
2201
|
+
export class VesselLeakLinkedRunCalculationResponse extends CalculationResponseBase {
|
|
2481
2202
|
dischargeRecord: Entities.DischargeRecord;
|
|
2482
2203
|
distancesToJetFireRadiation: number[];
|
|
2483
2204
|
jetContourPoints: Entities.LocalPosition[];
|
|
@@ -2502,32 +2223,10 @@ export class VesselLineRuptureLinkedRunCalculationResponse extends CalculationRe
|
|
|
2502
2223
|
poolFireFlameResult: Entities.PoolFireFlameResult;
|
|
2503
2224
|
|
|
2504
2225
|
/**
|
|
2505
|
-
*
|
|
2226
|
+
* VesselLeakLinkedRun calculation response class.
|
|
2506
2227
|
*
|
|
2507
|
-
* @param {Entities.DischargeRecord} dischargeRecord - a discharge record entity.
|
|
2508
|
-
* @param {number[]} distancesToJetFireRadiation - an array of distances to jet fire radiation levels, ordered according to the flammable output configs.
|
|
2509
|
-
* @param {Entities.LocalPosition[]} jetContourPoints - an array of jet fire radiation contour points, ordered according to the flammable output configs.
|
|
2510
|
-
* @param {number[]} nJetContourPoints - an array of the number of jet fire radiation contour points, ordered according to the flammable output configs.
|
|
2511
|
-
* @param {number[]} areaContourJet - an array of areas of the jet fire contours, ordered according to the flammable output configs.
|
|
2512
|
-
* @param {number[]} distancesToFlamConcentration - an array of distances to flammable concentration levels, ordered according to the dispersion output configs for flammable concentrations of interest.
|
|
2513
|
-
* @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.
|
|
2514
|
-
* @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.
|
|
2515
|
-
* @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.
|
|
2516
|
-
* @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.
|
|
2517
|
-
* @param {number[]} distancesToPoolFireRadiation - an array of distances to pool fire radiation levels, ordered according to the flammable output configs.
|
|
2518
|
-
* @param {Entities.LocalPosition[]} poolContourPoints - an array of pool fire radiation contour points, ordered according to the flammable output configs.
|
|
2519
|
-
* @param {number[]} nPoolContourPoints - an array of the number of pool fire radiation contour points, ordered according to the flammable output configs.
|
|
2520
|
-
* @param {number[]} areaContourPool - an array of areas of the pool fire contours, ordered according to the flammable output configs.
|
|
2521
|
-
* @param {Entities.ExplosionOverpressureResult[]} explosionOverpressureResults - an array of explosion overpressure results, ordered according to the explosion output configs.
|
|
2522
|
-
* @param {number[]} distancesToToxicConcentration - an array of distances to toxic concentration levels, ordered according to the dispersion output configs for toxic concentrations of interest.
|
|
2523
|
-
* @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.
|
|
2524
|
-
* @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.
|
|
2525
|
-
* @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.
|
|
2526
|
-
* @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.
|
|
2527
|
-
* @param {Entities.FlameResult} jetFireFlameResult - a flame results entity, for jet fire.
|
|
2528
|
-
* @param {Entities.PoolFireFlameResult} poolFireFlameResult - a pool fire flame results entity, for pool fire.
|
|
2529
2228
|
*/
|
|
2530
|
-
constructor(
|
|
2229
|
+
constructor(data: {
|
|
2531
2230
|
dischargeRecord: Entities.DischargeRecord,
|
|
2532
2231
|
distancesToJetFireRadiation: number[],
|
|
2533
2232
|
jetContourPoints: Entities.LocalPosition[],
|
|
@@ -2554,34 +2253,34 @@ export class VesselLineRuptureLinkedRunCalculationResponse extends CalculationRe
|
|
|
2554
2253
|
messages: string[],
|
|
2555
2254
|
calculationElapsedTime: number,
|
|
2556
2255
|
operationId: string
|
|
2557
|
-
) {
|
|
2256
|
+
}) {
|
|
2558
2257
|
super();
|
|
2559
|
-
this.dischargeRecord = dischargeRecord;
|
|
2560
|
-
this.distancesToJetFireRadiation = distancesToJetFireRadiation;
|
|
2561
|
-
this.jetContourPoints = jetContourPoints;
|
|
2562
|
-
this.nJetContourPoints = nJetContourPoints;
|
|
2563
|
-
this.areaContourJet = areaContourJet;
|
|
2564
|
-
this.distancesToFlamConcentration = distancesToFlamConcentration;
|
|
2565
|
-
this.flamConcentrationsUsed = flamConcentrationsUsed;
|
|
2566
|
-
this.flamConcContourPoints = flamConcContourPoints;
|
|
2567
|
-
this.nFlamConcContourPoints = nFlamConcContourPoints;
|
|
2568
|
-
this.areaFootprintFlamConc = areaFootprintFlamConc;
|
|
2569
|
-
this.distancesToPoolFireRadiation = distancesToPoolFireRadiation;
|
|
2570
|
-
this.poolContourPoints = poolContourPoints;
|
|
2571
|
-
this.nPoolContourPoints = nPoolContourPoints;
|
|
2572
|
-
this.areaContourPool = areaContourPool;
|
|
2573
|
-
this.explosionOverpressureResults = explosionOverpressureResults;
|
|
2574
|
-
this.distancesToToxicConcentration = distancesToToxicConcentration;
|
|
2575
|
-
this.toxicConcentrationUsed = toxicConcentrationUsed;
|
|
2576
|
-
this.toxicConcContourPoints = toxicConcContourPoints;
|
|
2577
|
-
this.nToxicConcContourPoints = nToxicConcContourPoints;
|
|
2578
|
-
this.areaFootprintToxicConc = areaFootprintToxicConc;
|
|
2579
|
-
this.jetFireFlameResult = jetFireFlameResult;
|
|
2580
|
-
this.poolFireFlameResult = poolFireFlameResult;
|
|
2581
|
-
this.resultCode = resultCode;
|
|
2582
|
-
this.messages = messages;
|
|
2583
|
-
this.calculationElapsedTime = calculationElapsedTime;
|
|
2584
|
-
this.operationId = operationId;
|
|
2258
|
+
this.dischargeRecord = data.dischargeRecord;
|
|
2259
|
+
this.distancesToJetFireRadiation = data.distancesToJetFireRadiation;
|
|
2260
|
+
this.jetContourPoints = data.jetContourPoints;
|
|
2261
|
+
this.nJetContourPoints = data.nJetContourPoints;
|
|
2262
|
+
this.areaContourJet = data.areaContourJet;
|
|
2263
|
+
this.distancesToFlamConcentration = data.distancesToFlamConcentration;
|
|
2264
|
+
this.flamConcentrationsUsed = data.flamConcentrationsUsed;
|
|
2265
|
+
this.flamConcContourPoints = data.flamConcContourPoints;
|
|
2266
|
+
this.nFlamConcContourPoints = data.nFlamConcContourPoints;
|
|
2267
|
+
this.areaFootprintFlamConc = data.areaFootprintFlamConc;
|
|
2268
|
+
this.distancesToPoolFireRadiation = data.distancesToPoolFireRadiation;
|
|
2269
|
+
this.poolContourPoints = data.poolContourPoints;
|
|
2270
|
+
this.nPoolContourPoints = data.nPoolContourPoints;
|
|
2271
|
+
this.areaContourPool = data.areaContourPool;
|
|
2272
|
+
this.explosionOverpressureResults = data.explosionOverpressureResults;
|
|
2273
|
+
this.distancesToToxicConcentration = data.distancesToToxicConcentration;
|
|
2274
|
+
this.toxicConcentrationUsed = data.toxicConcentrationUsed;
|
|
2275
|
+
this.toxicConcContourPoints = data.toxicConcContourPoints;
|
|
2276
|
+
this.nToxicConcContourPoints = data.nToxicConcContourPoints;
|
|
2277
|
+
this.areaFootprintToxicConc = data.areaFootprintToxicConc;
|
|
2278
|
+
this.jetFireFlameResult = data.jetFireFlameResult;
|
|
2279
|
+
this.poolFireFlameResult = data.poolFireFlameResult;
|
|
2280
|
+
this.resultCode = data.resultCode;
|
|
2281
|
+
this.messages = data.messages;
|
|
2282
|
+
this.calculationElapsedTime = data.calculationElapsedTime;
|
|
2283
|
+
this.operationId = data.operationId;
|
|
2585
2284
|
}
|
|
2586
2285
|
|
|
2587
2286
|
initialiseFromDictionary(data: { [key: string]: unknown }) {
|
|
@@ -2700,7 +2399,7 @@ export class VesselLineRuptureLinkedRunCalculationResponse extends CalculationRe
|
|
|
2700
2399
|
}
|
|
2701
2400
|
}
|
|
2702
2401
|
|
|
2703
|
-
export interface
|
|
2402
|
+
export interface VesselLeakLinkedRunCalculationResponseSchemaData {
|
|
2704
2403
|
dischargeRecord: Entities.DischargeRecord;
|
|
2705
2404
|
distancesToJetFireRadiation: number[];
|
|
2706
2405
|
jetContourPoints: Entities.LocalPosition[];
|
|
@@ -2729,12 +2428,12 @@ export interface VesselLineRuptureLinkedRunCalculationResponseSchemaData {
|
|
|
2729
2428
|
operationId: string;
|
|
2730
2429
|
}
|
|
2731
2430
|
|
|
2732
|
-
export class
|
|
2431
|
+
export class VesselLeakLinkedRunCalculationResponseSchema {
|
|
2733
2432
|
schema: Joi.ObjectSchema;
|
|
2734
2433
|
propertyTypes: Record<string, string>;
|
|
2735
2434
|
|
|
2736
2435
|
/**
|
|
2737
|
-
* Schema for the
|
|
2436
|
+
* Schema for the VesselLeakLinkedRun calculation response.
|
|
2738
2437
|
*/
|
|
2739
2438
|
constructor() {
|
|
2740
2439
|
this.schema = Joi.object({
|
|
@@ -2792,7 +2491,7 @@ export class VesselLineRuptureLinkedRunCalculationResponseSchema {
|
|
|
2792
2491
|
};
|
|
2793
2492
|
}
|
|
2794
2493
|
|
|
2795
|
-
validate(data:
|
|
2494
|
+
validate(data: VesselLeakLinkedRunCalculationResponseSchemaData): VesselLeakLinkedRunCalculationResponse {
|
|
2796
2495
|
const { error, value } = this.schema.validate(data, { abortEarly: false });
|
|
2797
2496
|
if (error) {
|
|
2798
2497
|
throw new Error(`Validation error: ${error.details.map((x) => x.message).join(", ")}`);
|
|
@@ -2800,41 +2499,14 @@ export class VesselLineRuptureLinkedRunCalculationResponseSchema {
|
|
|
2800
2499
|
return this.makeCalculationResponse(value);
|
|
2801
2500
|
}
|
|
2802
2501
|
|
|
2803
|
-
makeCalculationResponse(data:
|
|
2804
|
-
return new
|
|
2805
|
-
data.dischargeRecord,
|
|
2806
|
-
data.distancesToJetFireRadiation,
|
|
2807
|
-
data.jetContourPoints,
|
|
2808
|
-
data.nJetContourPoints,
|
|
2809
|
-
data.areaContourJet,
|
|
2810
|
-
data.distancesToFlamConcentration,
|
|
2811
|
-
data.flamConcentrationsUsed,
|
|
2812
|
-
data.flamConcContourPoints,
|
|
2813
|
-
data.nFlamConcContourPoints,
|
|
2814
|
-
data.areaFootprintFlamConc,
|
|
2815
|
-
data.distancesToPoolFireRadiation,
|
|
2816
|
-
data.poolContourPoints,
|
|
2817
|
-
data.nPoolContourPoints,
|
|
2818
|
-
data.areaContourPool,
|
|
2819
|
-
data.explosionOverpressureResults,
|
|
2820
|
-
data.distancesToToxicConcentration,
|
|
2821
|
-
data.toxicConcentrationUsed,
|
|
2822
|
-
data.toxicConcContourPoints,
|
|
2823
|
-
data.nToxicConcContourPoints,
|
|
2824
|
-
data.areaFootprintToxicConc,
|
|
2825
|
-
data.jetFireFlameResult,
|
|
2826
|
-
data.poolFireFlameResult,
|
|
2827
|
-
data.resultCode,
|
|
2828
|
-
data.messages,
|
|
2829
|
-
data.calculationElapsedTime,
|
|
2830
|
-
data.operationId
|
|
2831
|
-
);
|
|
2502
|
+
makeCalculationResponse(data: VesselLeakLinkedRunCalculationResponseSchemaData): VesselLeakLinkedRunCalculationResponse {
|
|
2503
|
+
return new VesselLeakLinkedRunCalculationResponse(data);
|
|
2832
2504
|
}
|
|
2833
2505
|
}
|
|
2834
2506
|
|
|
2835
|
-
export interface
|
|
2507
|
+
export interface VesselLineRuptureLinkedRunCalculationRequestSchemaData {
|
|
2836
2508
|
vessel: Entities.Vessel;
|
|
2837
|
-
|
|
2509
|
+
lineRupture: Entities.LineRupture;
|
|
2838
2510
|
dischargeParameters: Entities.DischargeParameters;
|
|
2839
2511
|
substrate: Entities.Substrate;
|
|
2840
2512
|
weather: Entities.Weather;
|
|
@@ -2855,9 +2527,9 @@ export interface VesselReliefValveLinkedRunCalculationRequestSchemaData {
|
|
|
2855
2527
|
explosionConfinedVolumeCount: number;
|
|
2856
2528
|
}
|
|
2857
2529
|
|
|
2858
|
-
class
|
|
2530
|
+
class VesselLineRuptureLinkedRunCalculationRequest extends CalculationRequestBase {
|
|
2859
2531
|
vessel: Entities.Vessel;
|
|
2860
|
-
|
|
2532
|
+
lineRupture: Entities.LineRupture;
|
|
2861
2533
|
dischargeParameters: Entities.DischargeParameters;
|
|
2862
2534
|
substrate: Entities.Substrate;
|
|
2863
2535
|
weather: Entities.Weather;
|
|
@@ -2878,32 +2550,12 @@ class VesselReliefValveLinkedRunCalculationRequest extends CalculationRequestBas
|
|
|
2878
2550
|
explosionConfinedVolumeCount: number;
|
|
2879
2551
|
|
|
2880
2552
|
/**
|
|
2881
|
-
*
|
|
2553
|
+
* VesselLineRuptureLinkedRun calculation request class.
|
|
2882
2554
|
*
|
|
2883
|
-
* @param {Entities.Vessel} vessel - a vessel entity.
|
|
2884
|
-
* @param {Entities.ReliefValve} reliefValve - a relief valve entity.
|
|
2885
|
-
* @param {Entities.DischargeParameters} dischargeParameters - a discharge parameters entity.
|
|
2886
|
-
* @param {Entities.Substrate} substrate - a substrate entity.
|
|
2887
|
-
* @param {Entities.Weather} weather - a weather entity.
|
|
2888
|
-
* @param {Entities.DispersionParameters[]} dispersionParameters - an array of dispersion parameters.
|
|
2889
|
-
* @param {number} dispersionParameterCount - Number of dispersion parameters.
|
|
2890
|
-
* @param {number} endPointConcentration - Concentration at which the dispersion calculations will terminate (v/v fraction).
|
|
2891
|
-
* @param {Entities.FlammableParameters} flammableParameters - a flammable parameters entity.
|
|
2892
|
-
* @param {Entities.ExplosionParameters} explosionParameters - an explosion parameters entity.
|
|
2893
|
-
* @param {Entities.DispersionOutputConfig[]} dispersionFlamOutputConfigs - an array of dispersion output configs for flammable concentrations of interest.
|
|
2894
|
-
* @param {number} dispersionFlamOutputConfigCount - Number of dispersion output configs for flammable concentrations of interest.
|
|
2895
|
-
* @param {Entities.DispersionOutputConfig[]} dispersionToxicOutputConfigs - an array of dispersion output configs for toxic concentrations of interest.
|
|
2896
|
-
* @param {number} dispersionToxicOutputConfigCount - Number of dispersion output configs for toxic concentrations of interest.
|
|
2897
|
-
* @param {Entities.FlammableOutputConfig[]} flammableOutputConfigs - an array of flammable output configs for radiation levels of interest.
|
|
2898
|
-
* @param {number} flammableOutputConfigCount - Number of flammable ouput configs for radiation levels of interest.
|
|
2899
|
-
* @param {Entities.ExplosionOutputConfig[]} explosionOutputConfigs - an array of explosion output configs for overpressure levels of interest.
|
|
2900
|
-
* @param {number} explosionOutputConfigCount - Number of explosion output configs for overpressure levels of interest.
|
|
2901
|
-
* @param {Entities.ExplosionConfinedVolume[]} explosionConfinedVolumes - an array of explosion confined volumes.
|
|
2902
|
-
* @param {number} explosionConfinedVolumeCount - Number of explosion confined volumes.
|
|
2903
2555
|
*/
|
|
2904
|
-
constructor(
|
|
2556
|
+
constructor(data: {
|
|
2905
2557
|
vessel: Entities.Vessel,
|
|
2906
|
-
|
|
2558
|
+
lineRupture: Entities.LineRupture,
|
|
2907
2559
|
dischargeParameters: Entities.DischargeParameters,
|
|
2908
2560
|
substrate: Entities.Substrate,
|
|
2909
2561
|
weather: Entities.Weather,
|
|
@@ -2922,42 +2574,42 @@ class VesselReliefValveLinkedRunCalculationRequest extends CalculationRequestBas
|
|
|
2922
2574
|
explosionOutputConfigCount: number,
|
|
2923
2575
|
explosionConfinedVolumes: Entities.ExplosionConfinedVolume[],
|
|
2924
2576
|
explosionConfinedVolumeCount: number
|
|
2925
|
-
) {
|
|
2577
|
+
}) {
|
|
2926
2578
|
super();
|
|
2927
|
-
this.vessel = vessel;
|
|
2928
|
-
this.
|
|
2929
|
-
this.dischargeParameters = dischargeParameters;
|
|
2930
|
-
this.substrate = substrate;
|
|
2931
|
-
this.weather = weather;
|
|
2932
|
-
this.dispersionParameters = dispersionParameters;
|
|
2933
|
-
this.dispersionParameterCount = dispersionParameterCount;
|
|
2934
|
-
this.endPointConcentration = endPointConcentration;
|
|
2935
|
-
this.flammableParameters = flammableParameters;
|
|
2936
|
-
this.explosionParameters = explosionParameters;
|
|
2937
|
-
this.dispersionFlamOutputConfigs = dispersionFlamOutputConfigs;
|
|
2938
|
-
this.dispersionFlamOutputConfigCount = dispersionFlamOutputConfigCount;
|
|
2939
|
-
this.dispersionToxicOutputConfigs = dispersionToxicOutputConfigs;
|
|
2940
|
-
this.dispersionToxicOutputConfigCount = dispersionToxicOutputConfigCount;
|
|
2941
|
-
this.flammableOutputConfigs = flammableOutputConfigs;
|
|
2942
|
-
this.flammableOutputConfigCount = flammableOutputConfigCount;
|
|
2943
|
-
this.explosionOutputConfigs = explosionOutputConfigs;
|
|
2944
|
-
this.explosionOutputConfigCount = explosionOutputConfigCount;
|
|
2945
|
-
this.explosionConfinedVolumes = explosionConfinedVolumes;
|
|
2946
|
-
this.explosionConfinedVolumeCount = explosionConfinedVolumeCount;
|
|
2579
|
+
this.vessel = data.vessel;
|
|
2580
|
+
this.lineRupture = data.lineRupture;
|
|
2581
|
+
this.dischargeParameters = data.dischargeParameters;
|
|
2582
|
+
this.substrate = data.substrate;
|
|
2583
|
+
this.weather = data.weather;
|
|
2584
|
+
this.dispersionParameters = data.dispersionParameters;
|
|
2585
|
+
this.dispersionParameterCount = data.dispersionParameterCount;
|
|
2586
|
+
this.endPointConcentration = data.endPointConcentration;
|
|
2587
|
+
this.flammableParameters = data.flammableParameters;
|
|
2588
|
+
this.explosionParameters = data.explosionParameters;
|
|
2589
|
+
this.dispersionFlamOutputConfigs = data.dispersionFlamOutputConfigs;
|
|
2590
|
+
this.dispersionFlamOutputConfigCount = data.dispersionFlamOutputConfigCount;
|
|
2591
|
+
this.dispersionToxicOutputConfigs = data.dispersionToxicOutputConfigs;
|
|
2592
|
+
this.dispersionToxicOutputConfigCount = data.dispersionToxicOutputConfigCount;
|
|
2593
|
+
this.flammableOutputConfigs = data.flammableOutputConfigs;
|
|
2594
|
+
this.flammableOutputConfigCount = data.flammableOutputConfigCount;
|
|
2595
|
+
this.explosionOutputConfigs = data.explosionOutputConfigs;
|
|
2596
|
+
this.explosionOutputConfigCount = data.explosionOutputConfigCount;
|
|
2597
|
+
this.explosionConfinedVolumes = data.explosionConfinedVolumes;
|
|
2598
|
+
this.explosionConfinedVolumeCount = data.explosionConfinedVolumeCount;
|
|
2947
2599
|
}
|
|
2948
2600
|
}
|
|
2949
2601
|
|
|
2950
|
-
export class
|
|
2602
|
+
export class VesselLineRuptureLinkedRunCalculationRequestSchema {
|
|
2951
2603
|
schema: Joi.ObjectSchema;
|
|
2952
2604
|
propertyTypes: Record<string, string>;
|
|
2953
2605
|
|
|
2954
2606
|
/**
|
|
2955
|
-
* Schema for the
|
|
2607
|
+
* Schema for the VesselLineRuptureLinkedRun calculation request.
|
|
2956
2608
|
*/
|
|
2957
2609
|
constructor() {
|
|
2958
2610
|
this.schema = Joi.object({
|
|
2959
2611
|
vessel: new EntitySchemas.VesselSchema().schema,
|
|
2960
|
-
|
|
2612
|
+
lineRupture: new EntitySchemas.LineRuptureSchema().schema,
|
|
2961
2613
|
dischargeParameters: new EntitySchemas.DischargeParametersSchema().schema,
|
|
2962
2614
|
substrate: new EntitySchemas.SubstrateSchema().schema,
|
|
2963
2615
|
weather: new EntitySchemas.WeatherSchema().schema,
|
|
@@ -2980,7 +2632,7 @@ export class VesselReliefValveLinkedRunCalculationRequestSchema {
|
|
|
2980
2632
|
|
|
2981
2633
|
this.propertyTypes = {
|
|
2982
2634
|
vessel: "Entities.Vessel",
|
|
2983
|
-
|
|
2635
|
+
lineRupture: "Entities.LineRupture",
|
|
2984
2636
|
dischargeParameters: "Entities.DischargeParameters",
|
|
2985
2637
|
substrate: "Entities.Substrate",
|
|
2986
2638
|
weather: "Entities.Weather",
|
|
@@ -3002,7 +2654,7 @@ export class VesselReliefValveLinkedRunCalculationRequestSchema {
|
|
|
3002
2654
|
};
|
|
3003
2655
|
}
|
|
3004
2656
|
|
|
3005
|
-
validate(data:
|
|
2657
|
+
validate(data: VesselLineRuptureLinkedRunCalculationRequestSchemaData): VesselLineRuptureLinkedRunCalculationRequest {
|
|
3006
2658
|
const { error, value } = this.schema.validate(data, { abortEarly: false });
|
|
3007
2659
|
if (error) {
|
|
3008
2660
|
throw new Error(`Validation error: ${error.details.map((x) => x.message).join(", ")}`);
|
|
@@ -3010,35 +2662,14 @@ export class VesselReliefValveLinkedRunCalculationRequestSchema {
|
|
|
3010
2662
|
return this.makeCalculationRequest(value);
|
|
3011
2663
|
}
|
|
3012
2664
|
|
|
3013
|
-
makeCalculationRequest(data:
|
|
3014
|
-
return new
|
|
3015
|
-
data.vessel,
|
|
3016
|
-
data.reliefValve,
|
|
3017
|
-
data.dischargeParameters,
|
|
3018
|
-
data.substrate,
|
|
3019
|
-
data.weather,
|
|
3020
|
-
data.dispersionParameters,
|
|
3021
|
-
data.dispersionParameterCount,
|
|
3022
|
-
data.endPointConcentration,
|
|
3023
|
-
data.flammableParameters,
|
|
3024
|
-
data.explosionParameters,
|
|
3025
|
-
data.dispersionFlamOutputConfigs,
|
|
3026
|
-
data.dispersionFlamOutputConfigCount,
|
|
3027
|
-
data.dispersionToxicOutputConfigs,
|
|
3028
|
-
data.dispersionToxicOutputConfigCount,
|
|
3029
|
-
data.flammableOutputConfigs,
|
|
3030
|
-
data.flammableOutputConfigCount,
|
|
3031
|
-
data.explosionOutputConfigs,
|
|
3032
|
-
data.explosionOutputConfigCount,
|
|
3033
|
-
data.explosionConfinedVolumes,
|
|
3034
|
-
data.explosionConfinedVolumeCount
|
|
3035
|
-
);
|
|
2665
|
+
makeCalculationRequest(data: VesselLineRuptureLinkedRunCalculationRequestSchemaData): VesselLineRuptureLinkedRunCalculationRequest {
|
|
2666
|
+
return new VesselLineRuptureLinkedRunCalculationRequest(data);
|
|
3036
2667
|
}
|
|
3037
2668
|
}
|
|
3038
2669
|
|
|
3039
|
-
export class
|
|
2670
|
+
export class VesselLineRuptureLinkedRunCalculation extends CalculationBase {
|
|
3040
2671
|
vessel: Entities.Vessel;
|
|
3041
|
-
|
|
2672
|
+
lineRupture: Entities.LineRupture;
|
|
3042
2673
|
dischargeParameters: Entities.DischargeParameters;
|
|
3043
2674
|
substrate: Entities.Substrate;
|
|
3044
2675
|
weather: Entities.Weather;
|
|
@@ -3081,32 +2712,12 @@ export class VesselReliefValveLinkedRunCalculation extends CalculationBase {
|
|
|
3081
2712
|
poolFireFlameResult?: Entities.PoolFireFlameResult;
|
|
3082
2713
|
|
|
3083
2714
|
/**
|
|
3084
|
-
* Calculates maximum distance to a number of concentration, radiation and overpressure levels for flammable and toxic materials, given a vessel,
|
|
2715
|
+
* Calculates maximum distance to a number of concentration, radiation and overpressure levels for flammable and toxic materials, given a vessel, line rupture and weather definition.
|
|
3085
2716
|
*
|
|
3086
|
-
* @param {Entities.Vessel} vessel - a vessel entity.
|
|
3087
|
-
* @param {Entities.ReliefValve} reliefValve - a relief valve entity.
|
|
3088
|
-
* @param {Entities.DischargeParameters} dischargeParameters - a discharge parameters entity.
|
|
3089
|
-
* @param {Entities.Substrate} substrate - a substrate entity.
|
|
3090
|
-
* @param {Entities.Weather} weather - a weather entity.
|
|
3091
|
-
* @param {Entities.DispersionParameters[]} dispersionParameters - an array of dispersion parameters.
|
|
3092
|
-
* @param {number} dispersionParameterCount - Number of dispersion parameters.
|
|
3093
|
-
* @param {number} endPointConcentration - Concentration at which the dispersion calculations will terminate (v/v fraction).
|
|
3094
|
-
* @param {Entities.FlammableParameters} flammableParameters - a flammable parameters entity.
|
|
3095
|
-
* @param {Entities.ExplosionParameters} explosionParameters - an explosion parameters entity.
|
|
3096
|
-
* @param {Entities.DispersionOutputConfig[]} dispersionFlamOutputConfigs - an array of dispersion output configs for flammable concentrations of interest.
|
|
3097
|
-
* @param {number} dispersionFlamOutputConfigCount - Number of dispersion output configs for flammable concentrations of interest.
|
|
3098
|
-
* @param {Entities.DispersionOutputConfig[]} dispersionToxicOutputConfigs - an array of dispersion output configs for toxic concentrations of interest.
|
|
3099
|
-
* @param {number} dispersionToxicOutputConfigCount - Number of dispersion output configs for toxic concentrations of interest.
|
|
3100
|
-
* @param {Entities.FlammableOutputConfig[]} flammableOutputConfigs - an array of flammable output configs for radiation levels of interest.
|
|
3101
|
-
* @param {number} flammableOutputConfigCount - Number of flammable ouput configs for radiation levels of interest.
|
|
3102
|
-
* @param {Entities.ExplosionOutputConfig[]} explosionOutputConfigs - an array of explosion output configs for overpressure levels of interest.
|
|
3103
|
-
* @param {number} explosionOutputConfigCount - Number of explosion output configs for overpressure levels of interest.
|
|
3104
|
-
* @param {Entities.ExplosionConfinedVolume[]} explosionConfinedVolumes - an array of explosion confined volumes.
|
|
3105
|
-
* @param {number} explosionConfinedVolumeCount - Number of explosion confined volumes.
|
|
3106
2717
|
*/
|
|
3107
|
-
constructor(
|
|
2718
|
+
constructor(data: {
|
|
3108
2719
|
vessel: Entities.Vessel,
|
|
3109
|
-
|
|
2720
|
+
lineRupture: Entities.LineRupture,
|
|
3110
2721
|
dischargeParameters: Entities.DischargeParameters,
|
|
3111
2722
|
substrate: Entities.Substrate,
|
|
3112
2723
|
weather: Entities.Weather,
|
|
@@ -3125,66 +2736,67 @@ export class VesselReliefValveLinkedRunCalculation extends CalculationBase {
|
|
|
3125
2736
|
explosionOutputConfigCount: number,
|
|
3126
2737
|
explosionConfinedVolumes: Entities.ExplosionConfinedVolume[],
|
|
3127
2738
|
explosionConfinedVolumeCount: number
|
|
3128
|
-
|
|
3129
|
-
|
|
3130
|
-
|
|
3131
|
-
this.
|
|
3132
|
-
this.
|
|
3133
|
-
this.
|
|
3134
|
-
this.
|
|
3135
|
-
this.
|
|
3136
|
-
this.
|
|
3137
|
-
this.
|
|
3138
|
-
this.
|
|
3139
|
-
this.
|
|
3140
|
-
this.
|
|
3141
|
-
this.
|
|
3142
|
-
this.
|
|
3143
|
-
this.
|
|
3144
|
-
this.
|
|
3145
|
-
this.
|
|
3146
|
-
this.
|
|
3147
|
-
this.
|
|
3148
|
-
this.
|
|
3149
|
-
this.
|
|
2739
|
+
controller?: AbortController;
|
|
2740
|
+
}) {
|
|
2741
|
+
super(data.controller);
|
|
2742
|
+
this.vessel = data.vessel;
|
|
2743
|
+
this.lineRupture = data.lineRupture;
|
|
2744
|
+
this.dischargeParameters = data.dischargeParameters;
|
|
2745
|
+
this.substrate = data.substrate;
|
|
2746
|
+
this.weather = data.weather;
|
|
2747
|
+
this.dispersionParameters = data.dispersionParameters;
|
|
2748
|
+
this.dispersionParameterCount = data.dispersionParameterCount;
|
|
2749
|
+
this.endPointConcentration = data.endPointConcentration;
|
|
2750
|
+
this.flammableParameters = data.flammableParameters;
|
|
2751
|
+
this.explosionParameters = data.explosionParameters;
|
|
2752
|
+
this.dispersionFlamOutputConfigs = data.dispersionFlamOutputConfigs;
|
|
2753
|
+
this.dispersionFlamOutputConfigCount = data.dispersionFlamOutputConfigCount;
|
|
2754
|
+
this.dispersionToxicOutputConfigs = data.dispersionToxicOutputConfigs;
|
|
2755
|
+
this.dispersionToxicOutputConfigCount = data.dispersionToxicOutputConfigCount;
|
|
2756
|
+
this.flammableOutputConfigs = data.flammableOutputConfigs;
|
|
2757
|
+
this.flammableOutputConfigCount = data.flammableOutputConfigCount;
|
|
2758
|
+
this.explosionOutputConfigs = data.explosionOutputConfigs;
|
|
2759
|
+
this.explosionOutputConfigCount = data.explosionOutputConfigCount;
|
|
2760
|
+
this.explosionConfinedVolumes = data.explosionConfinedVolumes;
|
|
2761
|
+
this.explosionConfinedVolumeCount = data.explosionConfinedVolumeCount;
|
|
3150
2762
|
}
|
|
3151
2763
|
|
|
3152
2764
|
async run() {
|
|
3153
2765
|
try {
|
|
3154
|
-
const request = new
|
|
3155
|
-
this.vessel,
|
|
3156
|
-
this.
|
|
3157
|
-
this.dischargeParameters,
|
|
3158
|
-
this.substrate,
|
|
3159
|
-
this.weather,
|
|
3160
|
-
this.dispersionParameters,
|
|
3161
|
-
this.dispersionParameterCount,
|
|
3162
|
-
this.endPointConcentration,
|
|
3163
|
-
this.flammableParameters,
|
|
3164
|
-
this.explosionParameters,
|
|
3165
|
-
this.dispersionFlamOutputConfigs,
|
|
3166
|
-
this.dispersionFlamOutputConfigCount,
|
|
3167
|
-
this.dispersionToxicOutputConfigs,
|
|
3168
|
-
this.dispersionToxicOutputConfigCount,
|
|
3169
|
-
this.flammableOutputConfigs,
|
|
3170
|
-
this.flammableOutputConfigCount,
|
|
3171
|
-
this.explosionOutputConfigs,
|
|
3172
|
-
this.explosionOutputConfigCount,
|
|
3173
|
-
this.explosionConfinedVolumes,
|
|
3174
|
-
this.explosionConfinedVolumeCount
|
|
3175
|
-
);
|
|
2766
|
+
const request = new VesselLineRuptureLinkedRunCalculationRequest({
|
|
2767
|
+
vessel: this.vessel,
|
|
2768
|
+
lineRupture: this.lineRupture,
|
|
2769
|
+
dischargeParameters: this.dischargeParameters,
|
|
2770
|
+
substrate: this.substrate,
|
|
2771
|
+
weather: this.weather,
|
|
2772
|
+
dispersionParameters: this.dispersionParameters,
|
|
2773
|
+
dispersionParameterCount: this.dispersionParameterCount,
|
|
2774
|
+
endPointConcentration: this.endPointConcentration,
|
|
2775
|
+
flammableParameters: this.flammableParameters,
|
|
2776
|
+
explosionParameters: this.explosionParameters,
|
|
2777
|
+
dispersionFlamOutputConfigs: this.dispersionFlamOutputConfigs,
|
|
2778
|
+
dispersionFlamOutputConfigCount: this.dispersionFlamOutputConfigCount,
|
|
2779
|
+
dispersionToxicOutputConfigs: this.dispersionToxicOutputConfigs,
|
|
2780
|
+
dispersionToxicOutputConfigCount: this.dispersionToxicOutputConfigCount,
|
|
2781
|
+
flammableOutputConfigs: this.flammableOutputConfigs,
|
|
2782
|
+
flammableOutputConfigCount: this.flammableOutputConfigCount,
|
|
2783
|
+
explosionOutputConfigs: this.explosionOutputConfigs,
|
|
2784
|
+
explosionOutputConfigCount: this.explosionOutputConfigCount,
|
|
2785
|
+
explosionConfinedVolumes: this.explosionConfinedVolumes,
|
|
2786
|
+
explosionConfinedVolumeCount: this.explosionConfinedVolumeCount
|
|
2787
|
+
});
|
|
3176
2788
|
|
|
3177
|
-
const schema = new
|
|
2789
|
+
const schema = new VesselLineRuptureLinkedRunCalculationRequestSchema();
|
|
3178
2790
|
const validatedRequest = schema.validate(request);
|
|
3179
2791
|
|
|
3180
2792
|
const requestJson = JSON.stringify(validatedRequest);
|
|
3181
|
-
const url = `${getAnalyticsApiTarget()}
|
|
2793
|
+
const url = `${getAnalyticsApiTarget()}vessellinerupturelinkedrun?clientId=${getClientAliasId()}`;
|
|
3182
2794
|
|
|
3183
2795
|
this.resultCode = Enums.ResultCode.UNEXPECTED_APPLICATION_ERROR;
|
|
3184
2796
|
|
|
3185
2797
|
const { data } = await this.postRequest(url, requestJson);
|
|
3186
2798
|
|
|
3187
|
-
const responseSchema = new
|
|
2799
|
+
const responseSchema = new VesselLineRuptureLinkedRunCalculationResponseSchema();
|
|
3188
2800
|
const validatedResponse = responseSchema.validate(data);
|
|
3189
2801
|
|
|
3190
2802
|
this.resultCode = validatedResponse.resultCode;
|
|
@@ -3233,7 +2845,7 @@ export class VesselReliefValveLinkedRunCalculation extends CalculationBase {
|
|
|
3233
2845
|
}
|
|
3234
2846
|
|
|
3235
2847
|
toString() {
|
|
3236
|
-
const parts = ["*
|
|
2848
|
+
const parts = ["* VesselLineRuptureLinkedRun"];
|
|
3237
2849
|
|
|
3238
2850
|
parts.push(`dischargeRecord: ${String(this.dischargeRecord)}`);
|
|
3239
2851
|
parts.push("*** distancesToJetFireRadiation:");
|
|
@@ -3362,7 +2974,7 @@ export class VesselReliefValveLinkedRunCalculation extends CalculationBase {
|
|
|
3362
2974
|
}
|
|
3363
2975
|
}
|
|
3364
2976
|
|
|
3365
|
-
export class
|
|
2977
|
+
export class VesselLineRuptureLinkedRunCalculationResponse extends CalculationResponseBase {
|
|
3366
2978
|
dischargeRecord: Entities.DischargeRecord;
|
|
3367
2979
|
distancesToJetFireRadiation: number[];
|
|
3368
2980
|
jetContourPoints: Entities.LocalPosition[];
|
|
@@ -3387,32 +2999,10 @@ export class VesselReliefValveLinkedRunCalculationResponse extends CalculationRe
|
|
|
3387
2999
|
poolFireFlameResult: Entities.PoolFireFlameResult;
|
|
3388
3000
|
|
|
3389
3001
|
/**
|
|
3390
|
-
*
|
|
3002
|
+
* VesselLineRuptureLinkedRun calculation response class.
|
|
3391
3003
|
*
|
|
3392
|
-
* @param {Entities.DischargeRecord} dischargeRecord - a discharge record entity.
|
|
3393
|
-
* @param {number[]} distancesToJetFireRadiation - an array of distances to jet fire radiation levels, ordered according to the flammable output configs.
|
|
3394
|
-
* @param {Entities.LocalPosition[]} jetContourPoints - an array of jet fire radiation ellipse contour points, ordered according to the flammable output configs.
|
|
3395
|
-
* @param {number[]} nJetContourPoints - an array of the number of jet fire radiation ellipse contour points, ordered according to the flammable output configs.
|
|
3396
|
-
* @param {number[]} areaContourJet - an array of areas of the jet fire ellipses, ordered according to the flammable output configs.
|
|
3397
|
-
* @param {number[]} distancesToFlamConcentration - an array of distances to flammable concentration levels, ordered according to the dispersion output configs for flammable concentrations of interest.
|
|
3398
|
-
* @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.
|
|
3399
|
-
* @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.
|
|
3400
|
-
* @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.
|
|
3401
|
-
* @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.
|
|
3402
|
-
* @param {number[]} distancesToPoolFireRadiation - an array of distances to pool fire radiation levels, ordered according to the flammable output configs.
|
|
3403
|
-
* @param {Entities.LocalPosition[]} poolContourPoints - an array of pool fire radiation contour points, ordered according to the flammable output configs.
|
|
3404
|
-
* @param {number[]} nPoolContourPoints - an array of the number of pool fire radiation contour points, ordered according to the flammable output configs.
|
|
3405
|
-
* @param {number[]} areaContourPool - an array of areas of the pool fire ellipses, ordered according to the flammable output configs.
|
|
3406
|
-
* @param {Entities.ExplosionOverpressureResult[]} explosionOverpressureResults - an array of explosion overpressure results, ordered according to the explosion output configs.
|
|
3407
|
-
* @param {number[]} distancesToToxicConcentration - an array of distances to toxic concentration levels, ordered according to the dispersion output configs for toxic concentrations of interest.
|
|
3408
|
-
* @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.
|
|
3409
|
-
* @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.
|
|
3410
|
-
* @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.
|
|
3411
|
-
* @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.
|
|
3412
|
-
* @param {Entities.FlameResult} jetFireFlameResult - a flame results entity, for jet fire.
|
|
3413
|
-
* @param {Entities.PoolFireFlameResult} poolFireFlameResult - a pool fire flame results entity, for pool fire.
|
|
3414
3004
|
*/
|
|
3415
|
-
constructor(
|
|
3005
|
+
constructor(data: {
|
|
3416
3006
|
dischargeRecord: Entities.DischargeRecord,
|
|
3417
3007
|
distancesToJetFireRadiation: number[],
|
|
3418
3008
|
jetContourPoints: Entities.LocalPosition[],
|
|
@@ -3439,34 +3029,34 @@ export class VesselReliefValveLinkedRunCalculationResponse extends CalculationRe
|
|
|
3439
3029
|
messages: string[],
|
|
3440
3030
|
calculationElapsedTime: number,
|
|
3441
3031
|
operationId: string
|
|
3442
|
-
) {
|
|
3032
|
+
}) {
|
|
3443
3033
|
super();
|
|
3444
|
-
this.dischargeRecord = dischargeRecord;
|
|
3445
|
-
this.distancesToJetFireRadiation = distancesToJetFireRadiation;
|
|
3446
|
-
this.jetContourPoints = jetContourPoints;
|
|
3447
|
-
this.nJetContourPoints = nJetContourPoints;
|
|
3448
|
-
this.areaContourJet = areaContourJet;
|
|
3449
|
-
this.distancesToFlamConcentration = distancesToFlamConcentration;
|
|
3450
|
-
this.flamConcentrationsUsed = flamConcentrationsUsed;
|
|
3451
|
-
this.flamConcContourPoints = flamConcContourPoints;
|
|
3452
|
-
this.nFlamConcContourPoints = nFlamConcContourPoints;
|
|
3453
|
-
this.areaFootprintFlamConc = areaFootprintFlamConc;
|
|
3454
|
-
this.distancesToPoolFireRadiation = distancesToPoolFireRadiation;
|
|
3455
|
-
this.poolContourPoints = poolContourPoints;
|
|
3456
|
-
this.nPoolContourPoints = nPoolContourPoints;
|
|
3457
|
-
this.areaContourPool = areaContourPool;
|
|
3458
|
-
this.explosionOverpressureResults = explosionOverpressureResults;
|
|
3459
|
-
this.distancesToToxicConcentration = distancesToToxicConcentration;
|
|
3460
|
-
this.toxicConcentrationUsed = toxicConcentrationUsed;
|
|
3461
|
-
this.toxicConcContourPoints = toxicConcContourPoints;
|
|
3462
|
-
this.nToxicConcContourPoints = nToxicConcContourPoints;
|
|
3463
|
-
this.areaFootprintToxicConc = areaFootprintToxicConc;
|
|
3464
|
-
this.jetFireFlameResult = jetFireFlameResult;
|
|
3465
|
-
this.poolFireFlameResult = poolFireFlameResult;
|
|
3466
|
-
this.resultCode = resultCode;
|
|
3467
|
-
this.messages = messages;
|
|
3468
|
-
this.calculationElapsedTime = calculationElapsedTime;
|
|
3469
|
-
this.operationId = operationId;
|
|
3034
|
+
this.dischargeRecord = data.dischargeRecord;
|
|
3035
|
+
this.distancesToJetFireRadiation = data.distancesToJetFireRadiation;
|
|
3036
|
+
this.jetContourPoints = data.jetContourPoints;
|
|
3037
|
+
this.nJetContourPoints = data.nJetContourPoints;
|
|
3038
|
+
this.areaContourJet = data.areaContourJet;
|
|
3039
|
+
this.distancesToFlamConcentration = data.distancesToFlamConcentration;
|
|
3040
|
+
this.flamConcentrationsUsed = data.flamConcentrationsUsed;
|
|
3041
|
+
this.flamConcContourPoints = data.flamConcContourPoints;
|
|
3042
|
+
this.nFlamConcContourPoints = data.nFlamConcContourPoints;
|
|
3043
|
+
this.areaFootprintFlamConc = data.areaFootprintFlamConc;
|
|
3044
|
+
this.distancesToPoolFireRadiation = data.distancesToPoolFireRadiation;
|
|
3045
|
+
this.poolContourPoints = data.poolContourPoints;
|
|
3046
|
+
this.nPoolContourPoints = data.nPoolContourPoints;
|
|
3047
|
+
this.areaContourPool = data.areaContourPool;
|
|
3048
|
+
this.explosionOverpressureResults = data.explosionOverpressureResults;
|
|
3049
|
+
this.distancesToToxicConcentration = data.distancesToToxicConcentration;
|
|
3050
|
+
this.toxicConcentrationUsed = data.toxicConcentrationUsed;
|
|
3051
|
+
this.toxicConcContourPoints = data.toxicConcContourPoints;
|
|
3052
|
+
this.nToxicConcContourPoints = data.nToxicConcContourPoints;
|
|
3053
|
+
this.areaFootprintToxicConc = data.areaFootprintToxicConc;
|
|
3054
|
+
this.jetFireFlameResult = data.jetFireFlameResult;
|
|
3055
|
+
this.poolFireFlameResult = data.poolFireFlameResult;
|
|
3056
|
+
this.resultCode = data.resultCode;
|
|
3057
|
+
this.messages = data.messages;
|
|
3058
|
+
this.calculationElapsedTime = data.calculationElapsedTime;
|
|
3059
|
+
this.operationId = data.operationId;
|
|
3470
3060
|
}
|
|
3471
3061
|
|
|
3472
3062
|
initialiseFromDictionary(data: { [key: string]: unknown }) {
|
|
@@ -3585,7 +3175,7 @@ export class VesselReliefValveLinkedRunCalculationResponse extends CalculationRe
|
|
|
3585
3175
|
}
|
|
3586
3176
|
}
|
|
3587
3177
|
|
|
3588
|
-
export interface
|
|
3178
|
+
export interface VesselLineRuptureLinkedRunCalculationResponseSchemaData {
|
|
3589
3179
|
dischargeRecord: Entities.DischargeRecord;
|
|
3590
3180
|
distancesToJetFireRadiation: number[];
|
|
3591
3181
|
jetContourPoints: Entities.LocalPosition[];
|
|
@@ -3614,12 +3204,12 @@ export interface VesselReliefValveLinkedRunCalculationResponseSchemaData {
|
|
|
3614
3204
|
operationId: string;
|
|
3615
3205
|
}
|
|
3616
3206
|
|
|
3617
|
-
export class
|
|
3207
|
+
export class VesselLineRuptureLinkedRunCalculationResponseSchema {
|
|
3618
3208
|
schema: Joi.ObjectSchema;
|
|
3619
3209
|
propertyTypes: Record<string, string>;
|
|
3620
3210
|
|
|
3621
3211
|
/**
|
|
3622
|
-
* Schema for the
|
|
3212
|
+
* Schema for the VesselLineRuptureLinkedRun calculation response.
|
|
3623
3213
|
*/
|
|
3624
3214
|
constructor() {
|
|
3625
3215
|
this.schema = Joi.object({
|
|
@@ -3677,7 +3267,7 @@ export class VesselReliefValveLinkedRunCalculationResponseSchema {
|
|
|
3677
3267
|
};
|
|
3678
3268
|
}
|
|
3679
3269
|
|
|
3680
|
-
validate(data:
|
|
3270
|
+
validate(data: VesselLineRuptureLinkedRunCalculationResponseSchemaData): VesselLineRuptureLinkedRunCalculationResponse {
|
|
3681
3271
|
const { error, value } = this.schema.validate(data, { abortEarly: false });
|
|
3682
3272
|
if (error) {
|
|
3683
3273
|
throw new Error(`Validation error: ${error.details.map((x) => x.message).join(", ")}`);
|
|
@@ -3685,43 +3275,17 @@ export class VesselReliefValveLinkedRunCalculationResponseSchema {
|
|
|
3685
3275
|
return this.makeCalculationResponse(value);
|
|
3686
3276
|
}
|
|
3687
3277
|
|
|
3688
|
-
makeCalculationResponse(data:
|
|
3689
|
-
return new
|
|
3690
|
-
data.dischargeRecord,
|
|
3691
|
-
data.distancesToJetFireRadiation,
|
|
3692
|
-
data.jetContourPoints,
|
|
3693
|
-
data.nJetContourPoints,
|
|
3694
|
-
data.areaContourJet,
|
|
3695
|
-
data.distancesToFlamConcentration,
|
|
3696
|
-
data.flamConcentrationsUsed,
|
|
3697
|
-
data.flamConcContourPoints,
|
|
3698
|
-
data.nFlamConcContourPoints,
|
|
3699
|
-
data.areaFootprintFlamConc,
|
|
3700
|
-
data.distancesToPoolFireRadiation,
|
|
3701
|
-
data.poolContourPoints,
|
|
3702
|
-
data.nPoolContourPoints,
|
|
3703
|
-
data.areaContourPool,
|
|
3704
|
-
data.explosionOverpressureResults,
|
|
3705
|
-
data.distancesToToxicConcentration,
|
|
3706
|
-
data.toxicConcentrationUsed,
|
|
3707
|
-
data.toxicConcContourPoints,
|
|
3708
|
-
data.nToxicConcContourPoints,
|
|
3709
|
-
data.areaFootprintToxicConc,
|
|
3710
|
-
data.jetFireFlameResult,
|
|
3711
|
-
data.poolFireFlameResult,
|
|
3712
|
-
data.resultCode,
|
|
3713
|
-
data.messages,
|
|
3714
|
-
data.calculationElapsedTime,
|
|
3715
|
-
data.operationId
|
|
3716
|
-
);
|
|
3278
|
+
makeCalculationResponse(data: VesselLineRuptureLinkedRunCalculationResponseSchemaData): VesselLineRuptureLinkedRunCalculationResponse {
|
|
3279
|
+
return new VesselLineRuptureLinkedRunCalculationResponse(data);
|
|
3717
3280
|
}
|
|
3718
3281
|
}
|
|
3719
3282
|
|
|
3720
|
-
export interface
|
|
3721
|
-
|
|
3722
|
-
|
|
3723
|
-
|
|
3283
|
+
export interface VesselReliefValveLinkedRunCalculationRequestSchemaData {
|
|
3284
|
+
vessel: Entities.Vessel;
|
|
3285
|
+
reliefValve: Entities.ReliefValve;
|
|
3286
|
+
dischargeParameters: Entities.DischargeParameters;
|
|
3724
3287
|
substrate: Entities.Substrate;
|
|
3288
|
+
weather: Entities.Weather;
|
|
3725
3289
|
dispersionParameters: Entities.DispersionParameters[];
|
|
3726
3290
|
dispersionParameterCount: number;
|
|
3727
3291
|
endPointConcentration: number;
|
|
@@ -3739,11 +3303,12 @@ export interface BESSLinkedRunnerCalculationRequestSchemaData {
|
|
|
3739
3303
|
explosionConfinedVolumeCount: number;
|
|
3740
3304
|
}
|
|
3741
3305
|
|
|
3742
|
-
class
|
|
3743
|
-
|
|
3744
|
-
|
|
3745
|
-
|
|
3306
|
+
class VesselReliefValveLinkedRunCalculationRequest extends CalculationRequestBase {
|
|
3307
|
+
vessel: Entities.Vessel;
|
|
3308
|
+
reliefValve: Entities.ReliefValve;
|
|
3309
|
+
dischargeParameters: Entities.DischargeParameters;
|
|
3746
3310
|
substrate: Entities.Substrate;
|
|
3311
|
+
weather: Entities.Weather;
|
|
3747
3312
|
dispersionParameters: Entities.DispersionParameters[];
|
|
3748
3313
|
dispersionParameterCount: number;
|
|
3749
3314
|
endPointConcentration: number;
|
|
@@ -3761,33 +3326,15 @@ class BESSLinkedRunnerCalculationRequest extends CalculationRequestBase {
|
|
|
3761
3326
|
explosionConfinedVolumeCount: number;
|
|
3762
3327
|
|
|
3763
3328
|
/**
|
|
3764
|
-
*
|
|
3329
|
+
* VesselReliefValveLinkedRun calculation request class.
|
|
3765
3330
|
*
|
|
3766
|
-
* @param {Entities.BESSUnit} bessUnit - a BESS unit entity.
|
|
3767
|
-
* @param {Entities.BESSRelease} bessRelease - a BESS release entity.
|
|
3768
|
-
* @param {Entities.Weather} weather - a weather entity.
|
|
3769
|
-
* @param {Entities.Substrate} substrate - a substrate entity.
|
|
3770
|
-
* @param {Entities.DispersionParameters[]} dispersionParameters - an array of dispersion parameters.
|
|
3771
|
-
* @param {number} dispersionParameterCount - Number of dispersion parameters.
|
|
3772
|
-
* @param {number} endPointConcentration - Concentration at which the dispersion calculations will terminate (v/v fraction).
|
|
3773
|
-
* @param {Entities.FlammableParameters} flammableParameters - a flammable parameters entity.
|
|
3774
|
-
* @param {Entities.ExplosionParameters} explosionParameters - an explosion parameters entity.
|
|
3775
|
-
* @param {Entities.DispersionOutputConfig[]} dispersionFlamOutputConfigs - an array of dispersion output configs for flammable concentrations of interest.
|
|
3776
|
-
* @param {number} dispersionFlamOutputConfigCount - Number of dispersion output configs for flammable concentrations of interest.
|
|
3777
|
-
* @param {Entities.DispersionOutputConfig[]} dispersionToxicOutputConfigs - an array of dispersion output configs for toxic concentrations of interest.
|
|
3778
|
-
* @param {number} dispersionToxicOutputConfigCount - Number of dispersion output configs for toxic concentrations of interest.
|
|
3779
|
-
* @param {Entities.FlammableOutputConfig[]} flammableOutputConfigs - an array of flammable output configs for radiation levels of interest.
|
|
3780
|
-
* @param {number} flammableOutputConfigCount - Number of flammable ouput configs for radiation levels of interest.
|
|
3781
|
-
* @param {Entities.ExplosionOutputConfig[]} explosionOutputConfigs - an array of explosion output configs for overpressure levels of interest.
|
|
3782
|
-
* @param {number} explosionOutputConfigCount - Number of explosion output configs for overpressure levels of interest.
|
|
3783
|
-
* @param {Entities.ExplosionConfinedVolume[]} explosionConfinedVolumes - an array of explosion confined volumes.
|
|
3784
|
-
* @param {number} explosionConfinedVolumeCount - Number of explosion confined volumes.
|
|
3785
3331
|
*/
|
|
3786
|
-
constructor(
|
|
3787
|
-
|
|
3788
|
-
|
|
3789
|
-
|
|
3332
|
+
constructor(data: {
|
|
3333
|
+
vessel: Entities.Vessel,
|
|
3334
|
+
reliefValve: Entities.ReliefValve,
|
|
3335
|
+
dischargeParameters: Entities.DischargeParameters,
|
|
3790
3336
|
substrate: Entities.Substrate,
|
|
3337
|
+
weather: Entities.Weather,
|
|
3791
3338
|
dispersionParameters: Entities.DispersionParameters[],
|
|
3792
3339
|
dispersionParameterCount: number,
|
|
3793
3340
|
endPointConcentration: number,
|
|
@@ -3803,43 +3350,45 @@ class BESSLinkedRunnerCalculationRequest extends CalculationRequestBase {
|
|
|
3803
3350
|
explosionOutputConfigCount: number,
|
|
3804
3351
|
explosionConfinedVolumes: Entities.ExplosionConfinedVolume[],
|
|
3805
3352
|
explosionConfinedVolumeCount: number
|
|
3806
|
-
) {
|
|
3353
|
+
}) {
|
|
3807
3354
|
super();
|
|
3808
|
-
this.
|
|
3809
|
-
this.
|
|
3810
|
-
this.
|
|
3811
|
-
this.substrate = substrate;
|
|
3812
|
-
this.
|
|
3813
|
-
this.
|
|
3814
|
-
this.
|
|
3815
|
-
this.
|
|
3816
|
-
this.
|
|
3817
|
-
this.
|
|
3818
|
-
this.
|
|
3819
|
-
this.
|
|
3820
|
-
this.
|
|
3821
|
-
this.
|
|
3822
|
-
this.
|
|
3823
|
-
this.
|
|
3824
|
-
this.
|
|
3825
|
-
this.
|
|
3826
|
-
this.
|
|
3355
|
+
this.vessel = data.vessel;
|
|
3356
|
+
this.reliefValve = data.reliefValve;
|
|
3357
|
+
this.dischargeParameters = data.dischargeParameters;
|
|
3358
|
+
this.substrate = data.substrate;
|
|
3359
|
+
this.weather = data.weather;
|
|
3360
|
+
this.dispersionParameters = data.dispersionParameters;
|
|
3361
|
+
this.dispersionParameterCount = data.dispersionParameterCount;
|
|
3362
|
+
this.endPointConcentration = data.endPointConcentration;
|
|
3363
|
+
this.flammableParameters = data.flammableParameters;
|
|
3364
|
+
this.explosionParameters = data.explosionParameters;
|
|
3365
|
+
this.dispersionFlamOutputConfigs = data.dispersionFlamOutputConfigs;
|
|
3366
|
+
this.dispersionFlamOutputConfigCount = data.dispersionFlamOutputConfigCount;
|
|
3367
|
+
this.dispersionToxicOutputConfigs = data.dispersionToxicOutputConfigs;
|
|
3368
|
+
this.dispersionToxicOutputConfigCount = data.dispersionToxicOutputConfigCount;
|
|
3369
|
+
this.flammableOutputConfigs = data.flammableOutputConfigs;
|
|
3370
|
+
this.flammableOutputConfigCount = data.flammableOutputConfigCount;
|
|
3371
|
+
this.explosionOutputConfigs = data.explosionOutputConfigs;
|
|
3372
|
+
this.explosionOutputConfigCount = data.explosionOutputConfigCount;
|
|
3373
|
+
this.explosionConfinedVolumes = data.explosionConfinedVolumes;
|
|
3374
|
+
this.explosionConfinedVolumeCount = data.explosionConfinedVolumeCount;
|
|
3827
3375
|
}
|
|
3828
3376
|
}
|
|
3829
3377
|
|
|
3830
|
-
export class
|
|
3378
|
+
export class VesselReliefValveLinkedRunCalculationRequestSchema {
|
|
3831
3379
|
schema: Joi.ObjectSchema;
|
|
3832
3380
|
propertyTypes: Record<string, string>;
|
|
3833
3381
|
|
|
3834
3382
|
/**
|
|
3835
|
-
* Schema for the
|
|
3383
|
+
* Schema for the VesselReliefValveLinkedRun calculation request.
|
|
3836
3384
|
*/
|
|
3837
3385
|
constructor() {
|
|
3838
3386
|
this.schema = Joi.object({
|
|
3839
|
-
|
|
3840
|
-
|
|
3841
|
-
|
|
3387
|
+
vessel: new EntitySchemas.VesselSchema().schema,
|
|
3388
|
+
reliefValve: new EntitySchemas.ReliefValveSchema().schema,
|
|
3389
|
+
dischargeParameters: new EntitySchemas.DischargeParametersSchema().schema,
|
|
3842
3390
|
substrate: new EntitySchemas.SubstrateSchema().schema,
|
|
3391
|
+
weather: new EntitySchemas.WeatherSchema().schema,
|
|
3843
3392
|
dispersionParameters: Joi.array().items(new EntitySchemas.DispersionParametersSchema().schema).allow(null),
|
|
3844
3393
|
dispersionParameterCount: Joi.number().integer(),
|
|
3845
3394
|
endPointConcentration: Joi.number().unsafe(),
|
|
@@ -3858,10 +3407,11 @@ export class BESSLinkedRunnerCalculationRequestSchema {
|
|
|
3858
3407
|
}).unknown(true);
|
|
3859
3408
|
|
|
3860
3409
|
this.propertyTypes = {
|
|
3861
|
-
|
|
3862
|
-
|
|
3863
|
-
|
|
3410
|
+
vessel: "Entities.Vessel",
|
|
3411
|
+
reliefValve: "Entities.ReliefValve",
|
|
3412
|
+
dischargeParameters: "Entities.DischargeParameters",
|
|
3864
3413
|
substrate: "Entities.Substrate",
|
|
3414
|
+
weather: "Entities.Weather",
|
|
3865
3415
|
dispersionParameters: "Entities.DispersionParameters[]",
|
|
3866
3416
|
dispersionParameterCount: "number",
|
|
3867
3417
|
endPointConcentration: "number",
|
|
@@ -3880,7 +3430,7 @@ export class BESSLinkedRunnerCalculationRequestSchema {
|
|
|
3880
3430
|
};
|
|
3881
3431
|
}
|
|
3882
3432
|
|
|
3883
|
-
validate(data:
|
|
3433
|
+
validate(data: VesselReliefValveLinkedRunCalculationRequestSchemaData): VesselReliefValveLinkedRunCalculationRequest {
|
|
3884
3434
|
const { error, value } = this.schema.validate(data, { abortEarly: false });
|
|
3885
3435
|
if (error) {
|
|
3886
3436
|
throw new Error(`Validation error: ${error.details.map((x) => x.message).join(", ")}`);
|
|
@@ -3888,36 +3438,17 @@ export class BESSLinkedRunnerCalculationRequestSchema {
|
|
|
3888
3438
|
return this.makeCalculationRequest(value);
|
|
3889
3439
|
}
|
|
3890
3440
|
|
|
3891
|
-
makeCalculationRequest(data:
|
|
3892
|
-
return new
|
|
3893
|
-
data.bessUnit,
|
|
3894
|
-
data.bessRelease,
|
|
3895
|
-
data.weather,
|
|
3896
|
-
data.substrate,
|
|
3897
|
-
data.dispersionParameters,
|
|
3898
|
-
data.dispersionParameterCount,
|
|
3899
|
-
data.endPointConcentration,
|
|
3900
|
-
data.flammableParameters,
|
|
3901
|
-
data.explosionParameters,
|
|
3902
|
-
data.dispersionFlamOutputConfigs,
|
|
3903
|
-
data.dispersionFlamOutputConfigCount,
|
|
3904
|
-
data.dispersionToxicOutputConfigs,
|
|
3905
|
-
data.dispersionToxicOutputConfigCount,
|
|
3906
|
-
data.flammableOutputConfigs,
|
|
3907
|
-
data.flammableOutputConfigCount,
|
|
3908
|
-
data.explosionOutputConfigs,
|
|
3909
|
-
data.explosionOutputConfigCount,
|
|
3910
|
-
data.explosionConfinedVolumes,
|
|
3911
|
-
data.explosionConfinedVolumeCount
|
|
3912
|
-
);
|
|
3441
|
+
makeCalculationRequest(data: VesselReliefValveLinkedRunCalculationRequestSchemaData): VesselReliefValveLinkedRunCalculationRequest {
|
|
3442
|
+
return new VesselReliefValveLinkedRunCalculationRequest(data);
|
|
3913
3443
|
}
|
|
3914
3444
|
}
|
|
3915
3445
|
|
|
3916
|
-
export class
|
|
3917
|
-
|
|
3918
|
-
|
|
3919
|
-
|
|
3446
|
+
export class VesselReliefValveLinkedRunCalculation extends CalculationBase {
|
|
3447
|
+
vessel: Entities.Vessel;
|
|
3448
|
+
reliefValve: Entities.ReliefValve;
|
|
3449
|
+
dischargeParameters: Entities.DischargeParameters;
|
|
3920
3450
|
substrate: Entities.Substrate;
|
|
3451
|
+
weather: Entities.Weather;
|
|
3921
3452
|
dispersionParameters: Entities.DispersionParameters[];
|
|
3922
3453
|
dispersionParameterCount: number;
|
|
3923
3454
|
endPointConcentration: number;
|
|
@@ -3933,7 +3464,6 @@ export class BESSLinkedRunnerCalculation extends CalculationBase {
|
|
|
3933
3464
|
explosionOutputConfigCount: number;
|
|
3934
3465
|
explosionConfinedVolumes: Entities.ExplosionConfinedVolume[];
|
|
3935
3466
|
explosionConfinedVolumeCount: number;
|
|
3936
|
-
exitMaterial?: Entities.Material;
|
|
3937
3467
|
dischargeRecord?: Entities.DischargeRecord;
|
|
3938
3468
|
distancesToJetFireRadiation?: number[];
|
|
3939
3469
|
jetContourPoints?: Entities.LocalPosition[];
|
|
@@ -3958,33 +3488,15 @@ export class BESSLinkedRunnerCalculation extends CalculationBase {
|
|
|
3958
3488
|
poolFireFlameResult?: Entities.PoolFireFlameResult;
|
|
3959
3489
|
|
|
3960
3490
|
/**
|
|
3961
|
-
* Calculates maximum distance to a number of concentration levels for
|
|
3491
|
+
* Calculates maximum distance to a number of concentration, radiation and overpressure levels for flammable and toxic materials, given a vessel, relief valve and weather definition.
|
|
3962
3492
|
*
|
|
3963
|
-
* @param {Entities.BESSUnit} bessUnit - a BESS unit entity.
|
|
3964
|
-
* @param {Entities.BESSRelease} bessRelease - a BESS release entity.
|
|
3965
|
-
* @param {Entities.Weather} weather - a weather entity.
|
|
3966
|
-
* @param {Entities.Substrate} substrate - a substrate entity.
|
|
3967
|
-
* @param {Entities.DispersionParameters[]} dispersionParameters - an array of dispersion parameters.
|
|
3968
|
-
* @param {number} dispersionParameterCount - Number of dispersion parameters.
|
|
3969
|
-
* @param {number} endPointConcentration - Concentration at which the dispersion calculations will terminate (v/v fraction).
|
|
3970
|
-
* @param {Entities.FlammableParameters} flammableParameters - a flammable parameters entity.
|
|
3971
|
-
* @param {Entities.ExplosionParameters} explosionParameters - an explosion parameters entity.
|
|
3972
|
-
* @param {Entities.DispersionOutputConfig[]} dispersionFlamOutputConfigs - an array of dispersion output configs for flammable concentrations of interest.
|
|
3973
|
-
* @param {number} dispersionFlamOutputConfigCount - Number of dispersion output configs for flammable concentrations of interest.
|
|
3974
|
-
* @param {Entities.DispersionOutputConfig[]} dispersionToxicOutputConfigs - an array of dispersion output configs for toxic concentrations of interest.
|
|
3975
|
-
* @param {number} dispersionToxicOutputConfigCount - Number of dispersion output configs for toxic concentrations of interest.
|
|
3976
|
-
* @param {Entities.FlammableOutputConfig[]} flammableOutputConfigs - an array of flammable output configs for radiation levels of interest.
|
|
3977
|
-
* @param {number} flammableOutputConfigCount - Number of flammable ouput configs for radiation levels of interest.
|
|
3978
|
-
* @param {Entities.ExplosionOutputConfig[]} explosionOutputConfigs - an array of explosion output configs for overpressure levels of interest.
|
|
3979
|
-
* @param {number} explosionOutputConfigCount - Number of explosion output configs for overpressure levels of interest.
|
|
3980
|
-
* @param {Entities.ExplosionConfinedVolume[]} explosionConfinedVolumes - an array of explosion confined volumes.
|
|
3981
|
-
* @param {number} explosionConfinedVolumeCount - Number of explosion confined volumes.
|
|
3982
3493
|
*/
|
|
3983
|
-
constructor(
|
|
3984
|
-
|
|
3985
|
-
|
|
3986
|
-
|
|
3494
|
+
constructor(data: {
|
|
3495
|
+
vessel: Entities.Vessel,
|
|
3496
|
+
reliefValve: Entities.ReliefValve,
|
|
3497
|
+
dischargeParameters: Entities.DischargeParameters,
|
|
3987
3498
|
substrate: Entities.Substrate,
|
|
3499
|
+
weather: Entities.Weather,
|
|
3988
3500
|
dispersionParameters: Entities.DispersionParameters[],
|
|
3989
3501
|
dispersionParameterCount: number,
|
|
3990
3502
|
endPointConcentration: number,
|
|
@@ -4000,70 +3512,72 @@ export class BESSLinkedRunnerCalculation extends CalculationBase {
|
|
|
4000
3512
|
explosionOutputConfigCount: number,
|
|
4001
3513
|
explosionConfinedVolumes: Entities.ExplosionConfinedVolume[],
|
|
4002
3514
|
explosionConfinedVolumeCount: number
|
|
4003
|
-
|
|
4004
|
-
|
|
4005
|
-
|
|
4006
|
-
this.
|
|
4007
|
-
this.
|
|
4008
|
-
this.
|
|
4009
|
-
this.
|
|
4010
|
-
this.
|
|
4011
|
-
this.
|
|
4012
|
-
this.
|
|
4013
|
-
this.
|
|
4014
|
-
this.
|
|
4015
|
-
this.
|
|
4016
|
-
this.
|
|
4017
|
-
this.
|
|
4018
|
-
this.
|
|
4019
|
-
this.
|
|
4020
|
-
this.
|
|
4021
|
-
this.
|
|
4022
|
-
this.
|
|
4023
|
-
this.
|
|
3515
|
+
controller?: AbortController;
|
|
3516
|
+
}) {
|
|
3517
|
+
super(data.controller);
|
|
3518
|
+
this.vessel = data.vessel;
|
|
3519
|
+
this.reliefValve = data.reliefValve;
|
|
3520
|
+
this.dischargeParameters = data.dischargeParameters;
|
|
3521
|
+
this.substrate = data.substrate;
|
|
3522
|
+
this.weather = data.weather;
|
|
3523
|
+
this.dispersionParameters = data.dispersionParameters;
|
|
3524
|
+
this.dispersionParameterCount = data.dispersionParameterCount;
|
|
3525
|
+
this.endPointConcentration = data.endPointConcentration;
|
|
3526
|
+
this.flammableParameters = data.flammableParameters;
|
|
3527
|
+
this.explosionParameters = data.explosionParameters;
|
|
3528
|
+
this.dispersionFlamOutputConfigs = data.dispersionFlamOutputConfigs;
|
|
3529
|
+
this.dispersionFlamOutputConfigCount = data.dispersionFlamOutputConfigCount;
|
|
3530
|
+
this.dispersionToxicOutputConfigs = data.dispersionToxicOutputConfigs;
|
|
3531
|
+
this.dispersionToxicOutputConfigCount = data.dispersionToxicOutputConfigCount;
|
|
3532
|
+
this.flammableOutputConfigs = data.flammableOutputConfigs;
|
|
3533
|
+
this.flammableOutputConfigCount = data.flammableOutputConfigCount;
|
|
3534
|
+
this.explosionOutputConfigs = data.explosionOutputConfigs;
|
|
3535
|
+
this.explosionOutputConfigCount = data.explosionOutputConfigCount;
|
|
3536
|
+
this.explosionConfinedVolumes = data.explosionConfinedVolumes;
|
|
3537
|
+
this.explosionConfinedVolumeCount = data.explosionConfinedVolumeCount;
|
|
4024
3538
|
}
|
|
4025
3539
|
|
|
4026
3540
|
async run() {
|
|
4027
3541
|
try {
|
|
4028
|
-
const request = new
|
|
4029
|
-
this.
|
|
4030
|
-
this.
|
|
4031
|
-
this.
|
|
4032
|
-
this.substrate,
|
|
4033
|
-
this.
|
|
4034
|
-
this.
|
|
4035
|
-
this.
|
|
4036
|
-
this.
|
|
4037
|
-
this.
|
|
4038
|
-
this.
|
|
4039
|
-
this.
|
|
4040
|
-
this.
|
|
4041
|
-
this.
|
|
4042
|
-
this.
|
|
4043
|
-
this.
|
|
4044
|
-
this.
|
|
4045
|
-
this.
|
|
4046
|
-
this.
|
|
4047
|
-
this.
|
|
4048
|
-
|
|
3542
|
+
const request = new VesselReliefValveLinkedRunCalculationRequest({
|
|
3543
|
+
vessel: this.vessel,
|
|
3544
|
+
reliefValve: this.reliefValve,
|
|
3545
|
+
dischargeParameters: this.dischargeParameters,
|
|
3546
|
+
substrate: this.substrate,
|
|
3547
|
+
weather: this.weather,
|
|
3548
|
+
dispersionParameters: this.dispersionParameters,
|
|
3549
|
+
dispersionParameterCount: this.dispersionParameterCount,
|
|
3550
|
+
endPointConcentration: this.endPointConcentration,
|
|
3551
|
+
flammableParameters: this.flammableParameters,
|
|
3552
|
+
explosionParameters: this.explosionParameters,
|
|
3553
|
+
dispersionFlamOutputConfigs: this.dispersionFlamOutputConfigs,
|
|
3554
|
+
dispersionFlamOutputConfigCount: this.dispersionFlamOutputConfigCount,
|
|
3555
|
+
dispersionToxicOutputConfigs: this.dispersionToxicOutputConfigs,
|
|
3556
|
+
dispersionToxicOutputConfigCount: this.dispersionToxicOutputConfigCount,
|
|
3557
|
+
flammableOutputConfigs: this.flammableOutputConfigs,
|
|
3558
|
+
flammableOutputConfigCount: this.flammableOutputConfigCount,
|
|
3559
|
+
explosionOutputConfigs: this.explosionOutputConfigs,
|
|
3560
|
+
explosionOutputConfigCount: this.explosionOutputConfigCount,
|
|
3561
|
+
explosionConfinedVolumes: this.explosionConfinedVolumes,
|
|
3562
|
+
explosionConfinedVolumeCount: this.explosionConfinedVolumeCount
|
|
3563
|
+
});
|
|
4049
3564
|
|
|
4050
|
-
const schema = new
|
|
3565
|
+
const schema = new VesselReliefValveLinkedRunCalculationRequestSchema();
|
|
4051
3566
|
const validatedRequest = schema.validate(request);
|
|
4052
3567
|
|
|
4053
3568
|
const requestJson = JSON.stringify(validatedRequest);
|
|
4054
|
-
const url = `${getAnalyticsApiTarget()}
|
|
3569
|
+
const url = `${getAnalyticsApiTarget()}vesselreliefvalvelinkedrun?clientId=${getClientAliasId()}`;
|
|
4055
3570
|
|
|
4056
3571
|
this.resultCode = Enums.ResultCode.UNEXPECTED_APPLICATION_ERROR;
|
|
4057
3572
|
|
|
4058
3573
|
const { data } = await this.postRequest(url, requestJson);
|
|
4059
3574
|
|
|
4060
|
-
const responseSchema = new
|
|
3575
|
+
const responseSchema = new VesselReliefValveLinkedRunCalculationResponseSchema();
|
|
4061
3576
|
const validatedResponse = responseSchema.validate(data);
|
|
4062
3577
|
|
|
4063
3578
|
this.resultCode = validatedResponse.resultCode;
|
|
4064
3579
|
if (this.resultCode === Enums.ResultCode.SUCCESS) {
|
|
4065
3580
|
Object.assign(this, {
|
|
4066
|
-
exitMaterial: validatedResponse.exitMaterial,
|
|
4067
3581
|
dischargeRecord: validatedResponse.dischargeRecord,
|
|
4068
3582
|
distancesToJetFireRadiation: validatedResponse.distancesToJetFireRadiation,
|
|
4069
3583
|
jetContourPoints: validatedResponse.jetContourPoints,
|
|
@@ -4107,9 +3621,8 @@ export class BESSLinkedRunnerCalculation extends CalculationBase {
|
|
|
4107
3621
|
}
|
|
4108
3622
|
|
|
4109
3623
|
toString() {
|
|
4110
|
-
const parts = ["*
|
|
3624
|
+
const parts = ["* VesselReliefValveLinkedRun"];
|
|
4111
3625
|
|
|
4112
|
-
parts.push(`exitMaterial: ${String(this.exitMaterial)}`);
|
|
4113
3626
|
parts.push(`dischargeRecord: ${String(this.dischargeRecord)}`);
|
|
4114
3627
|
parts.push("*** distancesToJetFireRadiation:");
|
|
4115
3628
|
parts.push(
|
|
@@ -4237,8 +3750,7 @@ export class BESSLinkedRunnerCalculation extends CalculationBase {
|
|
|
4237
3750
|
}
|
|
4238
3751
|
}
|
|
4239
3752
|
|
|
4240
|
-
export class
|
|
4241
|
-
exitMaterial: Entities.Material;
|
|
3753
|
+
export class VesselReliefValveLinkedRunCalculationResponse extends CalculationResponseBase {
|
|
4242
3754
|
dischargeRecord: Entities.DischargeRecord;
|
|
4243
3755
|
distancesToJetFireRadiation: number[];
|
|
4244
3756
|
jetContourPoints: Entities.LocalPosition[];
|
|
@@ -4263,34 +3775,10 @@ export class BESSLinkedRunnerCalculationResponse extends CalculationResponseBase
|
|
|
4263
3775
|
poolFireFlameResult: Entities.PoolFireFlameResult;
|
|
4264
3776
|
|
|
4265
3777
|
/**
|
|
4266
|
-
*
|
|
3778
|
+
* VesselReliefValveLinkedRun calculation response class.
|
|
4267
3779
|
*
|
|
4268
|
-
* @param {Entities.Material} exitMaterial - Exit material from the BESS unit, dependent on BESS chemistry.
|
|
4269
|
-
* @param {Entities.DischargeRecord} dischargeRecord - a discharge record entity.
|
|
4270
|
-
* @param {number[]} distancesToJetFireRadiation - an array of distances to jet fire radiation levels, ordered according to the flammable output configs.
|
|
4271
|
-
* @param {Entities.LocalPosition[]} jetContourPoints - an array of jet fire radiation contour points, ordered according to the flammable output configs.
|
|
4272
|
-
* @param {number[]} nJetContourPoints - an array of the number of jet fire radiation contour points, ordered according to the flammable output configs.
|
|
4273
|
-
* @param {number[]} areaContourJet - an array of areas of the jet fire contours, ordered according to the flammable output configs.
|
|
4274
|
-
* @param {number[]} distancesToFlamConcentration - an array of distances to flammable concentration levels, ordered according to the dispersion output configs for flammable concentrations of interest.
|
|
4275
|
-
* @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.
|
|
4276
|
-
* @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.
|
|
4277
|
-
* @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.
|
|
4278
|
-
* @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.
|
|
4279
|
-
* @param {number[]} distancesToPoolFireRadiation - an array of distances to pool fire radiation levels, ordered according to the flammable output configs.
|
|
4280
|
-
* @param {Entities.LocalPosition[]} poolContourPoints - an array of pool fire radiation contour points, ordered according to the flammable output configs.
|
|
4281
|
-
* @param {number[]} nPoolContourPoints - an array of the number of pool fire radiation contour points, ordered according to the flammable output configs.
|
|
4282
|
-
* @param {number[]} areaContourPool - an array of areas of the pool fire contours, ordered according to the flammable output configs.
|
|
4283
|
-
* @param {Entities.ExplosionOverpressureResult[]} explosionOverpressureResults - an array of explosion overpressure results, ordered according to the explosion output configs.
|
|
4284
|
-
* @param {number[]} distancesToToxicConcentration - an array of distances to toxic concentration levels, ordered according to the dispersion output configs for toxic concentrations of interest.
|
|
4285
|
-
* @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.
|
|
4286
|
-
* @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.
|
|
4287
|
-
* @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.
|
|
4288
|
-
* @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.
|
|
4289
|
-
* @param {Entities.FlameResult} jetFireFlameResult - a flame results entity, for jet fire.
|
|
4290
|
-
* @param {Entities.PoolFireFlameResult} poolFireFlameResult - a pool fire flame results entity, for pool fire.
|
|
4291
3780
|
*/
|
|
4292
|
-
constructor(
|
|
4293
|
-
exitMaterial: Entities.Material,
|
|
3781
|
+
constructor(data: {
|
|
4294
3782
|
dischargeRecord: Entities.DischargeRecord,
|
|
4295
3783
|
distancesToJetFireRadiation: number[],
|
|
4296
3784
|
jetContourPoints: Entities.LocalPosition[],
|
|
@@ -4317,42 +3805,37 @@ export class BESSLinkedRunnerCalculationResponse extends CalculationResponseBase
|
|
|
4317
3805
|
messages: string[],
|
|
4318
3806
|
calculationElapsedTime: number,
|
|
4319
3807
|
operationId: string
|
|
4320
|
-
) {
|
|
3808
|
+
}) {
|
|
4321
3809
|
super();
|
|
4322
|
-
this.
|
|
4323
|
-
this.
|
|
4324
|
-
this.
|
|
4325
|
-
this.
|
|
4326
|
-
this.
|
|
4327
|
-
this.
|
|
4328
|
-
this.
|
|
4329
|
-
this.
|
|
4330
|
-
this.
|
|
4331
|
-
this.
|
|
4332
|
-
this.
|
|
4333
|
-
this.
|
|
4334
|
-
this.
|
|
4335
|
-
this.
|
|
4336
|
-
this.
|
|
4337
|
-
this.
|
|
4338
|
-
this.
|
|
4339
|
-
this.
|
|
4340
|
-
this.
|
|
4341
|
-
this.
|
|
4342
|
-
this.
|
|
4343
|
-
this.
|
|
4344
|
-
this.
|
|
4345
|
-
this.
|
|
4346
|
-
this.
|
|
4347
|
-
this.
|
|
4348
|
-
this.operationId = operationId;
|
|
3810
|
+
this.dischargeRecord = data.dischargeRecord;
|
|
3811
|
+
this.distancesToJetFireRadiation = data.distancesToJetFireRadiation;
|
|
3812
|
+
this.jetContourPoints = data.jetContourPoints;
|
|
3813
|
+
this.nJetContourPoints = data.nJetContourPoints;
|
|
3814
|
+
this.areaContourJet = data.areaContourJet;
|
|
3815
|
+
this.distancesToFlamConcentration = data.distancesToFlamConcentration;
|
|
3816
|
+
this.flamConcentrationsUsed = data.flamConcentrationsUsed;
|
|
3817
|
+
this.flamConcContourPoints = data.flamConcContourPoints;
|
|
3818
|
+
this.nFlamConcContourPoints = data.nFlamConcContourPoints;
|
|
3819
|
+
this.areaFootprintFlamConc = data.areaFootprintFlamConc;
|
|
3820
|
+
this.distancesToPoolFireRadiation = data.distancesToPoolFireRadiation;
|
|
3821
|
+
this.poolContourPoints = data.poolContourPoints;
|
|
3822
|
+
this.nPoolContourPoints = data.nPoolContourPoints;
|
|
3823
|
+
this.areaContourPool = data.areaContourPool;
|
|
3824
|
+
this.explosionOverpressureResults = data.explosionOverpressureResults;
|
|
3825
|
+
this.distancesToToxicConcentration = data.distancesToToxicConcentration;
|
|
3826
|
+
this.toxicConcentrationUsed = data.toxicConcentrationUsed;
|
|
3827
|
+
this.toxicConcContourPoints = data.toxicConcContourPoints;
|
|
3828
|
+
this.nToxicConcContourPoints = data.nToxicConcContourPoints;
|
|
3829
|
+
this.areaFootprintToxicConc = data.areaFootprintToxicConc;
|
|
3830
|
+
this.jetFireFlameResult = data.jetFireFlameResult;
|
|
3831
|
+
this.poolFireFlameResult = data.poolFireFlameResult;
|
|
3832
|
+
this.resultCode = data.resultCode;
|
|
3833
|
+
this.messages = data.messages;
|
|
3834
|
+
this.calculationElapsedTime = data.calculationElapsedTime;
|
|
3835
|
+
this.operationId = data.operationId;
|
|
4349
3836
|
}
|
|
4350
3837
|
|
|
4351
3838
|
initialiseFromDictionary(data: { [key: string]: unknown }) {
|
|
4352
|
-
if (data.exitMaterial) {
|
|
4353
|
-
this.exitMaterial = new Entities.Material();
|
|
4354
|
-
this.exitMaterial.initialiseFromDictionary(data.exitMaterial as { [key: string]: unknown });
|
|
4355
|
-
}
|
|
4356
3839
|
if (data.dischargeRecord) {
|
|
4357
3840
|
this.dischargeRecord = new Entities.DischargeRecord();
|
|
4358
3841
|
this.dischargeRecord.initialiseFromDictionary(data.dischargeRecord as { [key: string]: unknown });
|
|
@@ -4468,8 +3951,7 @@ export class BESSLinkedRunnerCalculationResponse extends CalculationResponseBase
|
|
|
4468
3951
|
}
|
|
4469
3952
|
}
|
|
4470
3953
|
|
|
4471
|
-
export interface
|
|
4472
|
-
exitMaterial: Entities.Material;
|
|
3954
|
+
export interface VesselReliefValveLinkedRunCalculationResponseSchemaData {
|
|
4473
3955
|
dischargeRecord: Entities.DischargeRecord;
|
|
4474
3956
|
distancesToJetFireRadiation: number[];
|
|
4475
3957
|
jetContourPoints: Entities.LocalPosition[];
|
|
@@ -4498,16 +3980,15 @@ export interface BESSLinkedRunnerCalculationResponseSchemaData {
|
|
|
4498
3980
|
operationId: string;
|
|
4499
3981
|
}
|
|
4500
3982
|
|
|
4501
|
-
export class
|
|
3983
|
+
export class VesselReliefValveLinkedRunCalculationResponseSchema {
|
|
4502
3984
|
schema: Joi.ObjectSchema;
|
|
4503
3985
|
propertyTypes: Record<string, string>;
|
|
4504
3986
|
|
|
4505
3987
|
/**
|
|
4506
|
-
* Schema for the
|
|
3988
|
+
* Schema for the VesselReliefValveLinkedRun calculation response.
|
|
4507
3989
|
*/
|
|
4508
3990
|
constructor() {
|
|
4509
3991
|
this.schema = Joi.object({
|
|
4510
|
-
exitMaterial: new EntitySchemas.MaterialSchema().schema,
|
|
4511
3992
|
dischargeRecord: new EntitySchemas.DischargeRecordSchema().schema,
|
|
4512
3993
|
distancesToJetFireRadiation: Joi.array().items(Joi.number().unsafe()).allow(null),
|
|
4513
3994
|
jetContourPoints: Joi.array().items(new EntitySchemas.LocalPositionSchema().schema).allow(null),
|
|
@@ -4537,7 +4018,6 @@ export class BESSLinkedRunnerCalculationResponseSchema {
|
|
|
4537
4018
|
}).unknown(true);
|
|
4538
4019
|
|
|
4539
4020
|
this.propertyTypes = {
|
|
4540
|
-
exitMaterial: "Entities.Material",
|
|
4541
4021
|
dischargeRecord: "Entities.DischargeRecord",
|
|
4542
4022
|
distancesToJetFireRadiation: "number[]",
|
|
4543
4023
|
jetContourPoints: "Entities.LocalPosition[]",
|
|
@@ -4563,7 +4043,7 @@ export class BESSLinkedRunnerCalculationResponseSchema {
|
|
|
4563
4043
|
};
|
|
4564
4044
|
}
|
|
4565
4045
|
|
|
4566
|
-
validate(data:
|
|
4046
|
+
validate(data: VesselReliefValveLinkedRunCalculationResponseSchemaData): VesselReliefValveLinkedRunCalculationResponse {
|
|
4567
4047
|
const { error, value } = this.schema.validate(data, { abortEarly: false });
|
|
4568
4048
|
if (error) {
|
|
4569
4049
|
throw new Error(`Validation error: ${error.details.map((x) => x.message).join(", ")}`);
|
|
@@ -4571,35 +4051,7 @@ export class BESSLinkedRunnerCalculationResponseSchema {
|
|
|
4571
4051
|
return this.makeCalculationResponse(value);
|
|
4572
4052
|
}
|
|
4573
4053
|
|
|
4574
|
-
makeCalculationResponse(data:
|
|
4575
|
-
return new
|
|
4576
|
-
data.exitMaterial,
|
|
4577
|
-
data.dischargeRecord,
|
|
4578
|
-
data.distancesToJetFireRadiation,
|
|
4579
|
-
data.jetContourPoints,
|
|
4580
|
-
data.nJetContourPoints,
|
|
4581
|
-
data.areaContourJet,
|
|
4582
|
-
data.distancesToFlamConcentration,
|
|
4583
|
-
data.flamConcentrationsUsed,
|
|
4584
|
-
data.flamConcContourPoints,
|
|
4585
|
-
data.nFlamConcContourPoints,
|
|
4586
|
-
data.areaFootprintFlamConc,
|
|
4587
|
-
data.distancesToPoolFireRadiation,
|
|
4588
|
-
data.poolContourPoints,
|
|
4589
|
-
data.nPoolContourPoints,
|
|
4590
|
-
data.areaContourPool,
|
|
4591
|
-
data.explosionOverpressureResults,
|
|
4592
|
-
data.distancesToToxicConcentration,
|
|
4593
|
-
data.toxicConcentrationUsed,
|
|
4594
|
-
data.toxicConcContourPoints,
|
|
4595
|
-
data.nToxicConcContourPoints,
|
|
4596
|
-
data.areaFootprintToxicConc,
|
|
4597
|
-
data.jetFireFlameResult,
|
|
4598
|
-
data.poolFireFlameResult,
|
|
4599
|
-
data.resultCode,
|
|
4600
|
-
data.messages,
|
|
4601
|
-
data.calculationElapsedTime,
|
|
4602
|
-
data.operationId
|
|
4603
|
-
);
|
|
4054
|
+
makeCalculationResponse(data: VesselReliefValveLinkedRunCalculationResponseSchemaData): VesselReliefValveLinkedRunCalculationResponse {
|
|
4055
|
+
return new VesselReliefValveLinkedRunCalculationResponse(data);
|
|
4604
4056
|
}
|
|
4605
4057
|
}
|