@dnv-plant/typescriptpws 1.0.27 → 1.0.38
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.ts +17 -4
- package/package.json +1 -1
- package/src/calculations/applicationTools.ts +368 -0
- package/src/calculations/discharge.ts +1817 -0
- package/src/calculations/dispersion.ts +511 -0
- package/src/calculations/dispersionView.ts +2544 -0
- package/src/calculations/fireball.ts +458 -0
- package/src/calculations/jetFire.ts +760 -0
- package/src/calculations/lateExplosion.ts +937 -0
- package/src/calculations/linkedRunners.ts +3724 -0
- package/src/calculations/poolFire.ts +458 -0
- package/src/calculations/properties.ts +382 -0
- package/src/calculations/radiation.ts +3521 -0
- package/src/calculations/standalones.ts +432 -0
- package/src/calculations/toxics.ts +469 -0
- package/src/calculations/utilities.ts +3320 -0
- package/src/constants.ts +2 -2
- package/src/entities.ts +2 -2
- package/src/entity-schemas.ts +2 -2
- package/src/enums.ts +2 -2
- package/src/materials.ts +2 -2
- package/src/utilities.ts +2 -2
- package/src/calculations.ts +0 -17774
|
@@ -0,0 +1,3724 @@
|
|
|
1
|
+
/***********************************************************************
|
|
2
|
+
* This file has been auto-generated by a code generation tool.
|
|
3
|
+
* Version: 1.0.38
|
|
4
|
+
* Date/time: 24 Mar 2025 16:46:20
|
|
5
|
+
* Template: templates/typescriptpws/calculations.razor.
|
|
6
|
+
***********************************************************************/
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
import * as Enums from "../enums";
|
|
11
|
+
import * as Entities from "../entities";
|
|
12
|
+
import * as EntitySchemas from "../entity-schemas";
|
|
13
|
+
import { getAnalyticsApiTarget, getClientAliasId, postRequest } from "../utilities";
|
|
14
|
+
|
|
15
|
+
import Joi from "joi";
|
|
16
|
+
import { AxiosResponse } from "axios";
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
class CalculationRequestBase {
|
|
20
|
+
/**
|
|
21
|
+
* Calculation request base class.
|
|
22
|
+
*/
|
|
23
|
+
constructor() {
|
|
24
|
+
// Base class initialization code
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
class CalculationBase {
|
|
29
|
+
resultCode?: Enums.ResultCode = Enums.ResultCode.SUCCESS;
|
|
30
|
+
messages: string[] = [];
|
|
31
|
+
calculationElapsedTime?: number = 0.0;
|
|
32
|
+
operationId?: string = "";
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Post JSON to URL and time the call
|
|
36
|
+
*/
|
|
37
|
+
async postRequest(url: string, data: string): Promise<AxiosResponse> {
|
|
38
|
+
return postRequest(url, data);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Utility method to print the messages returned by the calculation.
|
|
43
|
+
*/
|
|
44
|
+
printMessages(): void {
|
|
45
|
+
if (this.messages && this.messages.length > 0) {
|
|
46
|
+
this.messages.forEach((message) => console.log(message));
|
|
47
|
+
} else {
|
|
48
|
+
console.log("No messages");
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Utility method to handle a failed response.
|
|
54
|
+
*/
|
|
55
|
+
handleFailedResponse(response: AxiosResponse): void {
|
|
56
|
+
try {
|
|
57
|
+
const validatedFailedResponse = new CalculationFailedResponseSchema().validate(response.data);
|
|
58
|
+
|
|
59
|
+
this.resultCode = validatedFailedResponse.resultCode;
|
|
60
|
+
this.messages.push(...(validatedFailedResponse.messages ?? []));
|
|
61
|
+
this.calculationElapsedTime = validatedFailedResponse.calculationElapsedTime;
|
|
62
|
+
this.operationId = validatedFailedResponse.operationId;
|
|
63
|
+
} catch (error) {
|
|
64
|
+
if (error instanceof Error) {
|
|
65
|
+
this.messages.push(`Failed to parse response: ${error.message}`);
|
|
66
|
+
} else {
|
|
67
|
+
this.messages.push("An unknown error occurred during response parsing.");
|
|
68
|
+
}
|
|
69
|
+
console.error("Failed to parse response:", error);
|
|
70
|
+
} finally {
|
|
71
|
+
this.messages.push(`${response.statusText} (Status code: ${response.status})`);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
class CalculationResponseBase {
|
|
77
|
+
resultCode?: Enums.ResultCode;
|
|
78
|
+
messages?: string[];
|
|
79
|
+
calculationElapsedTime?: number;
|
|
80
|
+
operationId?: string;
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Calculation response base class.
|
|
84
|
+
*/
|
|
85
|
+
constructor(
|
|
86
|
+
resultCode?: Enums.ResultCode,
|
|
87
|
+
messages?: string[],
|
|
88
|
+
calculationElapsedTime?: number,
|
|
89
|
+
operationId?: string
|
|
90
|
+
) {
|
|
91
|
+
this.resultCode = resultCode;
|
|
92
|
+
this.messages = messages;
|
|
93
|
+
this.calculationElapsedTime = calculationElapsedTime;
|
|
94
|
+
this.operationId = operationId;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
class CalculationFailedResponse extends CalculationResponseBase {
|
|
99
|
+
/**
|
|
100
|
+
* Calculation failed response class.
|
|
101
|
+
*/
|
|
102
|
+
constructor(
|
|
103
|
+
resultCode?: Enums.ResultCode,
|
|
104
|
+
messages: string[] = [],
|
|
105
|
+
calculationElapsedTime: number = 0,
|
|
106
|
+
operationId: string = ""
|
|
107
|
+
) {
|
|
108
|
+
super(resultCode, messages, calculationElapsedTime, operationId);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
class CalculationFailedResponseSchema {
|
|
113
|
+
schema: Joi.ObjectSchema;
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Calculation failed response schema.
|
|
117
|
+
*/
|
|
118
|
+
constructor() {
|
|
119
|
+
this.schema = Joi.object({
|
|
120
|
+
resultCode: Joi.string()
|
|
121
|
+
.valid(...Object.values(Enums.ResultCode))
|
|
122
|
+
.required(),
|
|
123
|
+
messages: Joi.array().items(Joi.string()).required(),
|
|
124
|
+
calculationElapsedTime: Joi.number().required(),
|
|
125
|
+
operationId: Joi.string().required(),
|
|
126
|
+
}).unknown(true);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
validate(data: {
|
|
130
|
+
resultCode: Enums.ResultCode;
|
|
131
|
+
messages: string[];
|
|
132
|
+
calculationElapsedTime: number;
|
|
133
|
+
operationId: string;
|
|
134
|
+
}) {
|
|
135
|
+
const { error, value } = this.schema.validate(data);
|
|
136
|
+
if (error) throw new Error(`Validation error: ${error.details.map((x) => x.message).join(", ")}`);
|
|
137
|
+
return this.makeCalculationFailedResponse(value);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
makeCalculationFailedResponse(data: {
|
|
141
|
+
resultCode: Enums.ResultCode;
|
|
142
|
+
messages: string[];
|
|
143
|
+
calculationElapsedTime: number;
|
|
144
|
+
operationId: string;
|
|
145
|
+
}) {
|
|
146
|
+
return new CalculationFailedResponse(data.resultCode, data.messages, data.calculationElapsedTime, data.operationId);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
export interface UserDefinedSourceLinkedRunCalculationRequestSchemaData {
|
|
151
|
+
material: Entities.Material;
|
|
152
|
+
dischargeResult: Entities.DischargeResult;
|
|
153
|
+
dischargeRecords: Entities.DischargeRecord[];
|
|
154
|
+
dischargeRecordCount: number;
|
|
155
|
+
phaseToBeReleased: Enums.Phase;
|
|
156
|
+
dischargeParameters: Entities.DischargeParameters;
|
|
157
|
+
substrate: Entities.Substrate;
|
|
158
|
+
weather: Entities.Weather;
|
|
159
|
+
dispersionParameters: Entities.DispersionParameters[];
|
|
160
|
+
dispersionParameterCount: number;
|
|
161
|
+
endPointConcentration: number;
|
|
162
|
+
flammableParameters: Entities.FlammableParameters;
|
|
163
|
+
explosionParameters: Entities.ExplosionParameters;
|
|
164
|
+
dispersionFlamOutputConfigs: Entities.DispersionOutputConfig[];
|
|
165
|
+
dispersionFlamOutputConfigCount: number;
|
|
166
|
+
dispersionToxicOutputConfigs: Entities.DispersionOutputConfig[];
|
|
167
|
+
dispersionToxicOutputConfigCount: number;
|
|
168
|
+
flammableOutputConfigs: Entities.FlammableOutputConfig[];
|
|
169
|
+
flammableOutputConfigCount: number;
|
|
170
|
+
explosionOutputConfigs: Entities.ExplosionOutputConfig[];
|
|
171
|
+
explosionOutputConfigCount: number;
|
|
172
|
+
explosionConfinedVolumes: Entities.ExplosionConfinedVolume[];
|
|
173
|
+
explosionConfinedVolumeCount: number;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
class UserDefinedSourceLinkedRunCalculationRequest extends CalculationRequestBase {
|
|
177
|
+
material: Entities.Material;
|
|
178
|
+
dischargeResult: Entities.DischargeResult;
|
|
179
|
+
dischargeRecords: Entities.DischargeRecord[];
|
|
180
|
+
dischargeRecordCount: number;
|
|
181
|
+
phaseToBeReleased: Enums.Phase;
|
|
182
|
+
dischargeParameters: Entities.DischargeParameters;
|
|
183
|
+
substrate: Entities.Substrate;
|
|
184
|
+
weather: Entities.Weather;
|
|
185
|
+
dispersionParameters: Entities.DispersionParameters[];
|
|
186
|
+
dispersionParameterCount: number;
|
|
187
|
+
endPointConcentration: number;
|
|
188
|
+
flammableParameters: Entities.FlammableParameters;
|
|
189
|
+
explosionParameters: Entities.ExplosionParameters;
|
|
190
|
+
dispersionFlamOutputConfigs: Entities.DispersionOutputConfig[];
|
|
191
|
+
dispersionFlamOutputConfigCount: number;
|
|
192
|
+
dispersionToxicOutputConfigs: Entities.DispersionOutputConfig[];
|
|
193
|
+
dispersionToxicOutputConfigCount: number;
|
|
194
|
+
flammableOutputConfigs: Entities.FlammableOutputConfig[];
|
|
195
|
+
flammableOutputConfigCount: number;
|
|
196
|
+
explosionOutputConfigs: Entities.ExplosionOutputConfig[];
|
|
197
|
+
explosionOutputConfigCount: number;
|
|
198
|
+
explosionConfinedVolumes: Entities.ExplosionConfinedVolume[];
|
|
199
|
+
explosionConfinedVolumeCount: number;
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* UserDefinedSourceLinkedRun calculation request class.
|
|
203
|
+
*
|
|
204
|
+
* @param {Entities.Material} material - A Material entity.
|
|
205
|
+
* @param {Entities.DischargeResult} dischargeResult - Scalar discharge data.
|
|
206
|
+
* @param {Entities.DischargeRecord[]} dischargeRecords - An array of Discharge Records.
|
|
207
|
+
* @param {number} dischargeRecordCount - Number of Discharge Records.
|
|
208
|
+
* @param {Enums.Phase} phaseToBeReleased - Phase to be released ( Vapour, Two-phase or Liquid).
|
|
209
|
+
* @param {Entities.DischargeParameters} dischargeParameters - A Discharge Parameters entity.
|
|
210
|
+
* @param {Entities.Substrate} substrate - A Substrate entity.
|
|
211
|
+
* @param {Entities.Weather} weather - A Weather entity.
|
|
212
|
+
* @param {Entities.DispersionParameters[]} dispersionParameters - An array of Dispersion Parameters.
|
|
213
|
+
* @param {number} dispersionParameterCount - Number of Dispersion Parameters.
|
|
214
|
+
* @param {number} endPointConcentration - Concentration at which the dispersion calculations will terminate (v/v fraction).
|
|
215
|
+
* @param {Entities.FlammableParameters} flammableParameters - A Flammable Parameters entity.
|
|
216
|
+
* @param {Entities.ExplosionParameters} explosionParameters - An Explosion Parameters entity.
|
|
217
|
+
* @param {Entities.DispersionOutputConfig[]} dispersionFlamOutputConfigs - An array of Dispersion Output Configs for flammable concentrations of interest.
|
|
218
|
+
* @param {number} dispersionFlamOutputConfigCount - Number of Dispersion Output Configs for flammable concentrations of interest.
|
|
219
|
+
* @param {Entities.DispersionOutputConfig[]} dispersionToxicOutputConfigs - An array of Dispersion Output Configs for toxic concentrations of interest.
|
|
220
|
+
* @param {number} dispersionToxicOutputConfigCount - Number of Dispersion Output Configs for toxic concentrations of interest.
|
|
221
|
+
* @param {Entities.FlammableOutputConfig[]} flammableOutputConfigs - An array of Flammable Output Configs for radiation levels of interest.
|
|
222
|
+
* @param {number} flammableOutputConfigCount - Number of Flammable Ouput Configs for radiation levels of interest.
|
|
223
|
+
* @param {Entities.ExplosionOutputConfig[]} explosionOutputConfigs - An array of Explosion Output Configs for overpressure levels of interest.
|
|
224
|
+
* @param {number} explosionOutputConfigCount - Number of Explosion Output Configs for overpressure levels of interest.
|
|
225
|
+
* @param {Entities.ExplosionConfinedVolume[]} explosionConfinedVolumes - An array of Explosion Confined Volumes.
|
|
226
|
+
* @param {number} explosionConfinedVolumeCount - Number of Explosion Confined Volumes.
|
|
227
|
+
*/
|
|
228
|
+
constructor(
|
|
229
|
+
material: Entities.Material,
|
|
230
|
+
dischargeResult: Entities.DischargeResult,
|
|
231
|
+
dischargeRecords: Entities.DischargeRecord[],
|
|
232
|
+
dischargeRecordCount: number,
|
|
233
|
+
phaseToBeReleased: Enums.Phase,
|
|
234
|
+
dischargeParameters: Entities.DischargeParameters,
|
|
235
|
+
substrate: Entities.Substrate,
|
|
236
|
+
weather: Entities.Weather,
|
|
237
|
+
dispersionParameters: Entities.DispersionParameters[],
|
|
238
|
+
dispersionParameterCount: number,
|
|
239
|
+
endPointConcentration: number,
|
|
240
|
+
flammableParameters: Entities.FlammableParameters,
|
|
241
|
+
explosionParameters: Entities.ExplosionParameters,
|
|
242
|
+
dispersionFlamOutputConfigs: Entities.DispersionOutputConfig[],
|
|
243
|
+
dispersionFlamOutputConfigCount: number,
|
|
244
|
+
dispersionToxicOutputConfigs: Entities.DispersionOutputConfig[],
|
|
245
|
+
dispersionToxicOutputConfigCount: number,
|
|
246
|
+
flammableOutputConfigs: Entities.FlammableOutputConfig[],
|
|
247
|
+
flammableOutputConfigCount: number,
|
|
248
|
+
explosionOutputConfigs: Entities.ExplosionOutputConfig[],
|
|
249
|
+
explosionOutputConfigCount: number,
|
|
250
|
+
explosionConfinedVolumes: Entities.ExplosionConfinedVolume[],
|
|
251
|
+
explosionConfinedVolumeCount: number
|
|
252
|
+
) {
|
|
253
|
+
super();
|
|
254
|
+
this.material = material;
|
|
255
|
+
this.dischargeResult = dischargeResult;
|
|
256
|
+
this.dischargeRecords = dischargeRecords;
|
|
257
|
+
this.dischargeRecordCount = dischargeRecordCount;
|
|
258
|
+
this.phaseToBeReleased = phaseToBeReleased;
|
|
259
|
+
this.dischargeParameters = dischargeParameters;
|
|
260
|
+
this.substrate = substrate;
|
|
261
|
+
this.weather = weather;
|
|
262
|
+
this.dispersionParameters = dispersionParameters;
|
|
263
|
+
this.dispersionParameterCount = dispersionParameterCount;
|
|
264
|
+
this.endPointConcentration = endPointConcentration;
|
|
265
|
+
this.flammableParameters = flammableParameters;
|
|
266
|
+
this.explosionParameters = explosionParameters;
|
|
267
|
+
this.dispersionFlamOutputConfigs = dispersionFlamOutputConfigs;
|
|
268
|
+
this.dispersionFlamOutputConfigCount = dispersionFlamOutputConfigCount;
|
|
269
|
+
this.dispersionToxicOutputConfigs = dispersionToxicOutputConfigs;
|
|
270
|
+
this.dispersionToxicOutputConfigCount = dispersionToxicOutputConfigCount;
|
|
271
|
+
this.flammableOutputConfigs = flammableOutputConfigs;
|
|
272
|
+
this.flammableOutputConfigCount = flammableOutputConfigCount;
|
|
273
|
+
this.explosionOutputConfigs = explosionOutputConfigs;
|
|
274
|
+
this.explosionOutputConfigCount = explosionOutputConfigCount;
|
|
275
|
+
this.explosionConfinedVolumes = explosionConfinedVolumes;
|
|
276
|
+
this.explosionConfinedVolumeCount = explosionConfinedVolumeCount;
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
export class UserDefinedSourceLinkedRunCalculationRequestSchema {
|
|
281
|
+
schema: Joi.ObjectSchema;
|
|
282
|
+
propertyTypes: Record<string, string>;
|
|
283
|
+
|
|
284
|
+
/**
|
|
285
|
+
* Schema for the UserDefinedSourceLinkedRun calculation request.
|
|
286
|
+
*/
|
|
287
|
+
constructor() {
|
|
288
|
+
this.schema = Joi.object({
|
|
289
|
+
material: new EntitySchemas.MaterialSchema().schema,
|
|
290
|
+
dischargeResult: new EntitySchemas.DischargeResultSchema().schema,
|
|
291
|
+
dischargeRecords: Joi.array().items(new EntitySchemas.DischargeRecordSchema().schema).allow(null),
|
|
292
|
+
dischargeRecordCount: Joi.number().integer(),
|
|
293
|
+
phaseToBeReleased: Joi.string().valid(...Object.values(Enums.Phase)),
|
|
294
|
+
dischargeParameters: new EntitySchemas.DischargeParametersSchema().schema,
|
|
295
|
+
substrate: new EntitySchemas.SubstrateSchema().schema,
|
|
296
|
+
weather: new EntitySchemas.WeatherSchema().schema,
|
|
297
|
+
dispersionParameters: Joi.array().items(new EntitySchemas.DispersionParametersSchema().schema).allow(null),
|
|
298
|
+
dispersionParameterCount: Joi.number().integer(),
|
|
299
|
+
endPointConcentration: Joi.number().unsafe(),
|
|
300
|
+
flammableParameters: new EntitySchemas.FlammableParametersSchema().schema,
|
|
301
|
+
explosionParameters: new EntitySchemas.ExplosionParametersSchema().schema,
|
|
302
|
+
dispersionFlamOutputConfigs: Joi.array().items(new EntitySchemas.DispersionOutputConfigSchema().schema).allow(null),
|
|
303
|
+
dispersionFlamOutputConfigCount: Joi.number().integer(),
|
|
304
|
+
dispersionToxicOutputConfigs: Joi.array().items(new EntitySchemas.DispersionOutputConfigSchema().schema).allow(null),
|
|
305
|
+
dispersionToxicOutputConfigCount: Joi.number().integer(),
|
|
306
|
+
flammableOutputConfigs: Joi.array().items(new EntitySchemas.FlammableOutputConfigSchema().schema).allow(null),
|
|
307
|
+
flammableOutputConfigCount: Joi.number().integer(),
|
|
308
|
+
explosionOutputConfigs: Joi.array().items(new EntitySchemas.ExplosionOutputConfigSchema().schema).allow(null),
|
|
309
|
+
explosionOutputConfigCount: Joi.number().integer(),
|
|
310
|
+
explosionConfinedVolumes: Joi.array().items(new EntitySchemas.ExplosionConfinedVolumeSchema().schema).allow(null),
|
|
311
|
+
explosionConfinedVolumeCount: Joi.number().integer(),
|
|
312
|
+
}).unknown(true);
|
|
313
|
+
|
|
314
|
+
this.propertyTypes = {
|
|
315
|
+
material: "Entities.Material",
|
|
316
|
+
dischargeResult: "Entities.DischargeResult",
|
|
317
|
+
dischargeRecords: "Entities.DischargeRecord[]",
|
|
318
|
+
dischargeRecordCount: "number",
|
|
319
|
+
phaseToBeReleased: "Enums.Phase",
|
|
320
|
+
dischargeParameters: "Entities.DischargeParameters",
|
|
321
|
+
substrate: "Entities.Substrate",
|
|
322
|
+
weather: "Entities.Weather",
|
|
323
|
+
dispersionParameters: "Entities.DispersionParameters[]",
|
|
324
|
+
dispersionParameterCount: "number",
|
|
325
|
+
endPointConcentration: "number",
|
|
326
|
+
flammableParameters: "Entities.FlammableParameters",
|
|
327
|
+
explosionParameters: "Entities.ExplosionParameters",
|
|
328
|
+
dispersionFlamOutputConfigs: "Entities.DispersionOutputConfig[]",
|
|
329
|
+
dispersionFlamOutputConfigCount: "number",
|
|
330
|
+
dispersionToxicOutputConfigs: "Entities.DispersionOutputConfig[]",
|
|
331
|
+
dispersionToxicOutputConfigCount: "number",
|
|
332
|
+
flammableOutputConfigs: "Entities.FlammableOutputConfig[]",
|
|
333
|
+
flammableOutputConfigCount: "number",
|
|
334
|
+
explosionOutputConfigs: "Entities.ExplosionOutputConfig[]",
|
|
335
|
+
explosionOutputConfigCount: "number",
|
|
336
|
+
explosionConfinedVolumes: "Entities.ExplosionConfinedVolume[]",
|
|
337
|
+
explosionConfinedVolumeCount: "number",
|
|
338
|
+
};
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
validate(data: UserDefinedSourceLinkedRunCalculationRequestSchemaData): UserDefinedSourceLinkedRunCalculationRequest {
|
|
342
|
+
const { error, value } = this.schema.validate(data, { abortEarly: false });
|
|
343
|
+
if (error) {
|
|
344
|
+
throw new Error(`Validation error: ${error.details.map((x) => x.message).join(", ")}`);
|
|
345
|
+
}
|
|
346
|
+
return this.makeCalculationRequest(value);
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
makeCalculationRequest(data: UserDefinedSourceLinkedRunCalculationRequestSchemaData): UserDefinedSourceLinkedRunCalculationRequest {
|
|
350
|
+
return new UserDefinedSourceLinkedRunCalculationRequest(
|
|
351
|
+
data.material,
|
|
352
|
+
data.dischargeResult,
|
|
353
|
+
data.dischargeRecords,
|
|
354
|
+
data.dischargeRecordCount,
|
|
355
|
+
data.phaseToBeReleased,
|
|
356
|
+
data.dischargeParameters,
|
|
357
|
+
data.substrate,
|
|
358
|
+
data.weather,
|
|
359
|
+
data.dispersionParameters,
|
|
360
|
+
data.dispersionParameterCount,
|
|
361
|
+
data.endPointConcentration,
|
|
362
|
+
data.flammableParameters,
|
|
363
|
+
data.explosionParameters,
|
|
364
|
+
data.dispersionFlamOutputConfigs,
|
|
365
|
+
data.dispersionFlamOutputConfigCount,
|
|
366
|
+
data.dispersionToxicOutputConfigs,
|
|
367
|
+
data.dispersionToxicOutputConfigCount,
|
|
368
|
+
data.flammableOutputConfigs,
|
|
369
|
+
data.flammableOutputConfigCount,
|
|
370
|
+
data.explosionOutputConfigs,
|
|
371
|
+
data.explosionOutputConfigCount,
|
|
372
|
+
data.explosionConfinedVolumes,
|
|
373
|
+
data.explosionConfinedVolumeCount
|
|
374
|
+
);
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
export class UserDefinedSourceLinkedRunCalculation extends CalculationBase {
|
|
379
|
+
material: Entities.Material;
|
|
380
|
+
dischargeResult: Entities.DischargeResult;
|
|
381
|
+
dischargeRecords: Entities.DischargeRecord[];
|
|
382
|
+
dischargeRecordCount: number;
|
|
383
|
+
phaseToBeReleased: Enums.Phase;
|
|
384
|
+
dischargeParameters: Entities.DischargeParameters;
|
|
385
|
+
substrate: Entities.Substrate;
|
|
386
|
+
weather: Entities.Weather;
|
|
387
|
+
dispersionParameters: Entities.DispersionParameters[];
|
|
388
|
+
dispersionParameterCount: number;
|
|
389
|
+
endPointConcentration: number;
|
|
390
|
+
flammableParameters: Entities.FlammableParameters;
|
|
391
|
+
explosionParameters: Entities.ExplosionParameters;
|
|
392
|
+
dispersionFlamOutputConfigs: Entities.DispersionOutputConfig[];
|
|
393
|
+
dispersionFlamOutputConfigCount: number;
|
|
394
|
+
dispersionToxicOutputConfigs: Entities.DispersionOutputConfig[];
|
|
395
|
+
dispersionToxicOutputConfigCount: number;
|
|
396
|
+
flammableOutputConfigs: Entities.FlammableOutputConfig[];
|
|
397
|
+
flammableOutputConfigCount: number;
|
|
398
|
+
explosionOutputConfigs: Entities.ExplosionOutputConfig[];
|
|
399
|
+
explosionOutputConfigCount: number;
|
|
400
|
+
explosionConfinedVolumes: Entities.ExplosionConfinedVolume[];
|
|
401
|
+
explosionConfinedVolumeCount: number;
|
|
402
|
+
distancesToJetFireRadiation?: number[];
|
|
403
|
+
jetContourPoints?: Entities.LocalPosition[];
|
|
404
|
+
nJetContourPoints?: number[];
|
|
405
|
+
areaContourJet?: number[];
|
|
406
|
+
distancesToFlamConcentration?: number[];
|
|
407
|
+
flamConcentrationsUsed?: number[];
|
|
408
|
+
flamConcContourPoints?: Entities.LocalPosition[];
|
|
409
|
+
nFlamConcContourPoints?: number[];
|
|
410
|
+
areaFootprintFlamConc?: number[];
|
|
411
|
+
distancesToPoolFireRadiation?: number[];
|
|
412
|
+
poolContourPoints?: Entities.LocalPosition[];
|
|
413
|
+
nPoolContourPoints?: number[];
|
|
414
|
+
areaContourPool?: number[];
|
|
415
|
+
explosionOverpressureResults?: Entities.ExplosionOverpressureResult[];
|
|
416
|
+
distancesToToxicConcentration?: number[];
|
|
417
|
+
toxicConcentrationUsed?: number[];
|
|
418
|
+
toxicConcContourPoints?: Entities.LocalPosition[];
|
|
419
|
+
nToxicConcContourPoints?: number[];
|
|
420
|
+
areaFootprintToxicConc?: number[];
|
|
421
|
+
jetFireFlameResult?: Entities.FlameResult;
|
|
422
|
+
poolFireFlameResult?: Entities.PoolFireFlameResult;
|
|
423
|
+
|
|
424
|
+
/**
|
|
425
|
+
* Calculates maximum distance to a number of concentration, radiation and overpressure levels for flammable and toxic materials, given user-specified discharge and inputs and weather definition.
|
|
426
|
+
*
|
|
427
|
+
* @param {Entities.Material} material - A Material entity.
|
|
428
|
+
* @param {Entities.DischargeResult} dischargeResult - Scalar discharge data.
|
|
429
|
+
* @param {Entities.DischargeRecord[]} dischargeRecords - An array of Discharge Records.
|
|
430
|
+
* @param {number} dischargeRecordCount - Number of Discharge Records.
|
|
431
|
+
* @param {Enums.Phase} phaseToBeReleased - Phase to be released ( Vapour, Two-phase or Liquid).
|
|
432
|
+
* @param {Entities.DischargeParameters} dischargeParameters - A Discharge Parameters entity.
|
|
433
|
+
* @param {Entities.Substrate} substrate - A Substrate entity.
|
|
434
|
+
* @param {Entities.Weather} weather - A Weather entity.
|
|
435
|
+
* @param {Entities.DispersionParameters[]} dispersionParameters - An array of Dispersion Parameters.
|
|
436
|
+
* @param {number} dispersionParameterCount - Number of Dispersion Parameters.
|
|
437
|
+
* @param {number} endPointConcentration - Concentration at which the dispersion calculations will terminate (v/v fraction).
|
|
438
|
+
* @param {Entities.FlammableParameters} flammableParameters - A Flammable Parameters entity.
|
|
439
|
+
* @param {Entities.ExplosionParameters} explosionParameters - An Explosion Parameters entity.
|
|
440
|
+
* @param {Entities.DispersionOutputConfig[]} dispersionFlamOutputConfigs - An array of Dispersion Output Configs for flammable concentrations of interest.
|
|
441
|
+
* @param {number} dispersionFlamOutputConfigCount - Number of Dispersion Output Configs for flammable concentrations of interest.
|
|
442
|
+
* @param {Entities.DispersionOutputConfig[]} dispersionToxicOutputConfigs - An array of Dispersion Output Configs for toxic concentrations of interest.
|
|
443
|
+
* @param {number} dispersionToxicOutputConfigCount - Number of Dispersion Output Configs for toxic concentrations of interest.
|
|
444
|
+
* @param {Entities.FlammableOutputConfig[]} flammableOutputConfigs - An array of Flammable Output Configs for radiation levels of interest.
|
|
445
|
+
* @param {number} flammableOutputConfigCount - Number of Flammable Ouput Configs for radiation levels of interest.
|
|
446
|
+
* @param {Entities.ExplosionOutputConfig[]} explosionOutputConfigs - An array of Explosion Output Configs for overpressure levels of interest.
|
|
447
|
+
* @param {number} explosionOutputConfigCount - Number of Explosion Output Configs for overpressure levels of interest.
|
|
448
|
+
* @param {Entities.ExplosionConfinedVolume[]} explosionConfinedVolumes - An array of Explosion Confined Volumes.
|
|
449
|
+
* @param {number} explosionConfinedVolumeCount - Number of Explosion Confined Volumes.
|
|
450
|
+
*/
|
|
451
|
+
constructor(
|
|
452
|
+
material: Entities.Material,
|
|
453
|
+
dischargeResult: Entities.DischargeResult,
|
|
454
|
+
dischargeRecords: Entities.DischargeRecord[],
|
|
455
|
+
dischargeRecordCount: number,
|
|
456
|
+
phaseToBeReleased: Enums.Phase,
|
|
457
|
+
dischargeParameters: Entities.DischargeParameters,
|
|
458
|
+
substrate: Entities.Substrate,
|
|
459
|
+
weather: Entities.Weather,
|
|
460
|
+
dispersionParameters: Entities.DispersionParameters[],
|
|
461
|
+
dispersionParameterCount: number,
|
|
462
|
+
endPointConcentration: number,
|
|
463
|
+
flammableParameters: Entities.FlammableParameters,
|
|
464
|
+
explosionParameters: Entities.ExplosionParameters,
|
|
465
|
+
dispersionFlamOutputConfigs: Entities.DispersionOutputConfig[],
|
|
466
|
+
dispersionFlamOutputConfigCount: number,
|
|
467
|
+
dispersionToxicOutputConfigs: Entities.DispersionOutputConfig[],
|
|
468
|
+
dispersionToxicOutputConfigCount: number,
|
|
469
|
+
flammableOutputConfigs: Entities.FlammableOutputConfig[],
|
|
470
|
+
flammableOutputConfigCount: number,
|
|
471
|
+
explosionOutputConfigs: Entities.ExplosionOutputConfig[],
|
|
472
|
+
explosionOutputConfigCount: number,
|
|
473
|
+
explosionConfinedVolumes: Entities.ExplosionConfinedVolume[],
|
|
474
|
+
explosionConfinedVolumeCount: number
|
|
475
|
+
) {
|
|
476
|
+
super();
|
|
477
|
+
this.material = material;
|
|
478
|
+
this.dischargeResult = dischargeResult;
|
|
479
|
+
this.dischargeRecords = dischargeRecords;
|
|
480
|
+
this.dischargeRecordCount = dischargeRecordCount;
|
|
481
|
+
this.phaseToBeReleased = phaseToBeReleased;
|
|
482
|
+
this.dischargeParameters = dischargeParameters;
|
|
483
|
+
this.substrate = substrate;
|
|
484
|
+
this.weather = weather;
|
|
485
|
+
this.dispersionParameters = dispersionParameters;
|
|
486
|
+
this.dispersionParameterCount = dispersionParameterCount;
|
|
487
|
+
this.endPointConcentration = endPointConcentration;
|
|
488
|
+
this.flammableParameters = flammableParameters;
|
|
489
|
+
this.explosionParameters = explosionParameters;
|
|
490
|
+
this.dispersionFlamOutputConfigs = dispersionFlamOutputConfigs;
|
|
491
|
+
this.dispersionFlamOutputConfigCount = dispersionFlamOutputConfigCount;
|
|
492
|
+
this.dispersionToxicOutputConfigs = dispersionToxicOutputConfigs;
|
|
493
|
+
this.dispersionToxicOutputConfigCount = dispersionToxicOutputConfigCount;
|
|
494
|
+
this.flammableOutputConfigs = flammableOutputConfigs;
|
|
495
|
+
this.flammableOutputConfigCount = flammableOutputConfigCount;
|
|
496
|
+
this.explosionOutputConfigs = explosionOutputConfigs;
|
|
497
|
+
this.explosionOutputConfigCount = explosionOutputConfigCount;
|
|
498
|
+
this.explosionConfinedVolumes = explosionConfinedVolumes;
|
|
499
|
+
this.explosionConfinedVolumeCount = explosionConfinedVolumeCount;
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
async run() {
|
|
503
|
+
try {
|
|
504
|
+
const request = new UserDefinedSourceLinkedRunCalculationRequest(
|
|
505
|
+
this.material,
|
|
506
|
+
this.dischargeResult,
|
|
507
|
+
this.dischargeRecords,
|
|
508
|
+
this.dischargeRecordCount,
|
|
509
|
+
this.phaseToBeReleased,
|
|
510
|
+
this.dischargeParameters,
|
|
511
|
+
this.substrate,
|
|
512
|
+
this.weather,
|
|
513
|
+
this.dispersionParameters,
|
|
514
|
+
this.dispersionParameterCount,
|
|
515
|
+
this.endPointConcentration,
|
|
516
|
+
this.flammableParameters,
|
|
517
|
+
this.explosionParameters,
|
|
518
|
+
this.dispersionFlamOutputConfigs,
|
|
519
|
+
this.dispersionFlamOutputConfigCount,
|
|
520
|
+
this.dispersionToxicOutputConfigs,
|
|
521
|
+
this.dispersionToxicOutputConfigCount,
|
|
522
|
+
this.flammableOutputConfigs,
|
|
523
|
+
this.flammableOutputConfigCount,
|
|
524
|
+
this.explosionOutputConfigs,
|
|
525
|
+
this.explosionOutputConfigCount,
|
|
526
|
+
this.explosionConfinedVolumes,
|
|
527
|
+
this.explosionConfinedVolumeCount
|
|
528
|
+
);
|
|
529
|
+
|
|
530
|
+
const schema = new UserDefinedSourceLinkedRunCalculationRequestSchema();
|
|
531
|
+
const validatedRequest = schema.validate(request);
|
|
532
|
+
|
|
533
|
+
const requestJson = JSON.stringify(validatedRequest);
|
|
534
|
+
const url = `${getAnalyticsApiTarget()}calculateuserdefinedsourcelinkedrun?clientId=${getClientAliasId()}`;
|
|
535
|
+
|
|
536
|
+
this.resultCode = Enums.ResultCode.UNEXPECTED_APPLICATION_ERROR;
|
|
537
|
+
|
|
538
|
+
const response = await this.postRequest(url, requestJson);
|
|
539
|
+
|
|
540
|
+
if (response.status >= 200 && response.status < 300) {
|
|
541
|
+
const schema = new UserDefinedSourceLinkedRunCalculationResponseSchema();
|
|
542
|
+
const validatedResponse = schema.validate(response.data);
|
|
543
|
+
|
|
544
|
+
this.resultCode = validatedResponse.resultCode;
|
|
545
|
+
if (this.resultCode === Enums.ResultCode.SUCCESS) {
|
|
546
|
+
this.distancesToJetFireRadiation = validatedResponse.distancesToJetFireRadiation;
|
|
547
|
+
this.jetContourPoints = validatedResponse.jetContourPoints;
|
|
548
|
+
this.nJetContourPoints = validatedResponse.nJetContourPoints;
|
|
549
|
+
this.areaContourJet = validatedResponse.areaContourJet;
|
|
550
|
+
this.distancesToFlamConcentration = validatedResponse.distancesToFlamConcentration;
|
|
551
|
+
this.flamConcentrationsUsed = validatedResponse.flamConcentrationsUsed;
|
|
552
|
+
this.flamConcContourPoints = validatedResponse.flamConcContourPoints;
|
|
553
|
+
this.nFlamConcContourPoints = validatedResponse.nFlamConcContourPoints;
|
|
554
|
+
this.areaFootprintFlamConc = validatedResponse.areaFootprintFlamConc;
|
|
555
|
+
this.distancesToPoolFireRadiation = validatedResponse.distancesToPoolFireRadiation;
|
|
556
|
+
this.poolContourPoints = validatedResponse.poolContourPoints;
|
|
557
|
+
this.nPoolContourPoints = validatedResponse.nPoolContourPoints;
|
|
558
|
+
this.areaContourPool = validatedResponse.areaContourPool;
|
|
559
|
+
this.explosionOverpressureResults = validatedResponse.explosionOverpressureResults;
|
|
560
|
+
this.distancesToToxicConcentration = validatedResponse.distancesToToxicConcentration;
|
|
561
|
+
this.toxicConcentrationUsed = validatedResponse.toxicConcentrationUsed;
|
|
562
|
+
this.toxicConcContourPoints = validatedResponse.toxicConcContourPoints;
|
|
563
|
+
this.nToxicConcContourPoints = validatedResponse.nToxicConcContourPoints;
|
|
564
|
+
this.areaFootprintToxicConc = validatedResponse.areaFootprintToxicConc;
|
|
565
|
+
this.jetFireFlameResult = validatedResponse.jetFireFlameResult;
|
|
566
|
+
this.poolFireFlameResult = validatedResponse.poolFireFlameResult;
|
|
567
|
+
this.resultCode = validatedResponse.resultCode;
|
|
568
|
+
this.messages = validatedResponse.messages ?? [];
|
|
569
|
+
this.calculationElapsedTime = validatedResponse.calculationElapsedTime;
|
|
570
|
+
this.operationId = validatedResponse.operationId;
|
|
571
|
+
} else {
|
|
572
|
+
this.messages.push(...(validatedResponse.messages ?? []));
|
|
573
|
+
}
|
|
574
|
+
} else {
|
|
575
|
+
this.handleFailedResponse(response);
|
|
576
|
+
}
|
|
577
|
+
} catch (error) {
|
|
578
|
+
if (error instanceof Error) {
|
|
579
|
+
this.messages.push(`Error: ${error.message}`);
|
|
580
|
+
} else {
|
|
581
|
+
this.messages.push(`Unexpected error: ${JSON.stringify(error)}`);
|
|
582
|
+
}
|
|
583
|
+
console.error(error);
|
|
584
|
+
this.resultCode = Enums.ResultCode.UNEXPECTED_APPLICATION_ERROR;
|
|
585
|
+
}
|
|
586
|
+
|
|
587
|
+
return this.resultCode;
|
|
588
|
+
}
|
|
589
|
+
|
|
590
|
+
toString() {
|
|
591
|
+
const parts = ["* UserDefinedSourceLinkedRun"];
|
|
592
|
+
|
|
593
|
+
parts.push("*** distancesToJetFireRadiation:");
|
|
594
|
+
parts.push(
|
|
595
|
+
this.distancesToJetFireRadiation && this.distancesToJetFireRadiation.length > 0
|
|
596
|
+
? this.distancesToJetFireRadiation.map((point) => `distancesToJetFireRadiationElement: ${point}`).join("\n")
|
|
597
|
+
: "distancesToJetFireRadiation does not contain any elements"
|
|
598
|
+
);
|
|
599
|
+
parts.push("*** jetContourPoints:");
|
|
600
|
+
parts.push(
|
|
601
|
+
this.jetContourPoints && this.jetContourPoints.length > 0
|
|
602
|
+
? this.jetContourPoints.map((point) => `jetContourPointsElement: ${point}`).join("\n")
|
|
603
|
+
: "jetContourPoints does not contain any elements"
|
|
604
|
+
);
|
|
605
|
+
parts.push("*** nJetContourPoints:");
|
|
606
|
+
parts.push(
|
|
607
|
+
this.nJetContourPoints && this.nJetContourPoints.length > 0
|
|
608
|
+
? this.nJetContourPoints.map((point) => `nJetContourPointsElement: ${point}`).join("\n")
|
|
609
|
+
: "nJetContourPoints does not contain any elements"
|
|
610
|
+
);
|
|
611
|
+
parts.push("*** areaContourJet:");
|
|
612
|
+
parts.push(
|
|
613
|
+
this.areaContourJet && this.areaContourJet.length > 0
|
|
614
|
+
? this.areaContourJet.map((point) => `areaContourJetElement: ${point}`).join("\n")
|
|
615
|
+
: "areaContourJet does not contain any elements"
|
|
616
|
+
);
|
|
617
|
+
parts.push("*** distancesToFlamConcentration:");
|
|
618
|
+
parts.push(
|
|
619
|
+
this.distancesToFlamConcentration && this.distancesToFlamConcentration.length > 0
|
|
620
|
+
? this.distancesToFlamConcentration.map((point) => `distancesToFlamConcentrationElement: ${point}`).join("\n")
|
|
621
|
+
: "distancesToFlamConcentration does not contain any elements"
|
|
622
|
+
);
|
|
623
|
+
parts.push("*** flamConcentrationsUsed:");
|
|
624
|
+
parts.push(
|
|
625
|
+
this.flamConcentrationsUsed && this.flamConcentrationsUsed.length > 0
|
|
626
|
+
? this.flamConcentrationsUsed.map((point) => `flamConcentrationsUsedElement: ${point}`).join("\n")
|
|
627
|
+
: "flamConcentrationsUsed does not contain any elements"
|
|
628
|
+
);
|
|
629
|
+
parts.push("*** flamConcContourPoints:");
|
|
630
|
+
parts.push(
|
|
631
|
+
this.flamConcContourPoints && this.flamConcContourPoints.length > 0
|
|
632
|
+
? this.flamConcContourPoints.map((point) => `flamConcContourPointsElement: ${point}`).join("\n")
|
|
633
|
+
: "flamConcContourPoints does not contain any elements"
|
|
634
|
+
);
|
|
635
|
+
parts.push("*** nFlamConcContourPoints:");
|
|
636
|
+
parts.push(
|
|
637
|
+
this.nFlamConcContourPoints && this.nFlamConcContourPoints.length > 0
|
|
638
|
+
? this.nFlamConcContourPoints.map((point) => `nFlamConcContourPointsElement: ${point}`).join("\n")
|
|
639
|
+
: "nFlamConcContourPoints does not contain any elements"
|
|
640
|
+
);
|
|
641
|
+
parts.push("*** areaFootprintFlamConc:");
|
|
642
|
+
parts.push(
|
|
643
|
+
this.areaFootprintFlamConc && this.areaFootprintFlamConc.length > 0
|
|
644
|
+
? this.areaFootprintFlamConc.map((point) => `areaFootprintFlamConcElement: ${point}`).join("\n")
|
|
645
|
+
: "areaFootprintFlamConc does not contain any elements"
|
|
646
|
+
);
|
|
647
|
+
parts.push("*** distancesToPoolFireRadiation:");
|
|
648
|
+
parts.push(
|
|
649
|
+
this.distancesToPoolFireRadiation && this.distancesToPoolFireRadiation.length > 0
|
|
650
|
+
? this.distancesToPoolFireRadiation.map((point) => `distancesToPoolFireRadiationElement: ${point}`).join("\n")
|
|
651
|
+
: "distancesToPoolFireRadiation does not contain any elements"
|
|
652
|
+
);
|
|
653
|
+
parts.push("*** poolContourPoints:");
|
|
654
|
+
parts.push(
|
|
655
|
+
this.poolContourPoints && this.poolContourPoints.length > 0
|
|
656
|
+
? this.poolContourPoints.map((point) => `poolContourPointsElement: ${point}`).join("\n")
|
|
657
|
+
: "poolContourPoints does not contain any elements"
|
|
658
|
+
);
|
|
659
|
+
parts.push("*** nPoolContourPoints:");
|
|
660
|
+
parts.push(
|
|
661
|
+
this.nPoolContourPoints && this.nPoolContourPoints.length > 0
|
|
662
|
+
? this.nPoolContourPoints.map((point) => `nPoolContourPointsElement: ${point}`).join("\n")
|
|
663
|
+
: "nPoolContourPoints does not contain any elements"
|
|
664
|
+
);
|
|
665
|
+
parts.push("*** areaContourPool:");
|
|
666
|
+
parts.push(
|
|
667
|
+
this.areaContourPool && this.areaContourPool.length > 0
|
|
668
|
+
? this.areaContourPool.map((point) => `areaContourPoolElement: ${point}`).join("\n")
|
|
669
|
+
: "areaContourPool does not contain any elements"
|
|
670
|
+
);
|
|
671
|
+
parts.push("*** explosionOverpressureResults:");
|
|
672
|
+
parts.push(
|
|
673
|
+
this.explosionOverpressureResults && this.explosionOverpressureResults.length > 0
|
|
674
|
+
? this.explosionOverpressureResults.map((point) => `explosionOverpressureResultsElement: ${point}`).join("\n")
|
|
675
|
+
: "explosionOverpressureResults does not contain any elements"
|
|
676
|
+
);
|
|
677
|
+
parts.push("*** distancesToToxicConcentration:");
|
|
678
|
+
parts.push(
|
|
679
|
+
this.distancesToToxicConcentration && this.distancesToToxicConcentration.length > 0
|
|
680
|
+
? this.distancesToToxicConcentration.map((point) => `distancesToToxicConcentrationElement: ${point}`).join("\n")
|
|
681
|
+
: "distancesToToxicConcentration does not contain any elements"
|
|
682
|
+
);
|
|
683
|
+
parts.push("*** toxicConcentrationUsed:");
|
|
684
|
+
parts.push(
|
|
685
|
+
this.toxicConcentrationUsed && this.toxicConcentrationUsed.length > 0
|
|
686
|
+
? this.toxicConcentrationUsed.map((point) => `toxicConcentrationUsedElement: ${point}`).join("\n")
|
|
687
|
+
: "toxicConcentrationUsed does not contain any elements"
|
|
688
|
+
);
|
|
689
|
+
parts.push("*** toxicConcContourPoints:");
|
|
690
|
+
parts.push(
|
|
691
|
+
this.toxicConcContourPoints && this.toxicConcContourPoints.length > 0
|
|
692
|
+
? this.toxicConcContourPoints.map((point) => `toxicConcContourPointsElement: ${point}`).join("\n")
|
|
693
|
+
: "toxicConcContourPoints does not contain any elements"
|
|
694
|
+
);
|
|
695
|
+
parts.push("*** nToxicConcContourPoints:");
|
|
696
|
+
parts.push(
|
|
697
|
+
this.nToxicConcContourPoints && this.nToxicConcContourPoints.length > 0
|
|
698
|
+
? this.nToxicConcContourPoints.map((point) => `nToxicConcContourPointsElement: ${point}`).join("\n")
|
|
699
|
+
: "nToxicConcContourPoints does not contain any elements"
|
|
700
|
+
);
|
|
701
|
+
parts.push("*** areaFootprintToxicConc:");
|
|
702
|
+
parts.push(
|
|
703
|
+
this.areaFootprintToxicConc && this.areaFootprintToxicConc.length > 0
|
|
704
|
+
? this.areaFootprintToxicConc.map((point) => `areaFootprintToxicConcElement: ${point}`).join("\n")
|
|
705
|
+
: "areaFootprintToxicConc does not contain any elements"
|
|
706
|
+
);
|
|
707
|
+
parts.push(`jetFireFlameResult: ${String(this.jetFireFlameResult)}`);
|
|
708
|
+
parts.push(`poolFireFlameResult: ${String(this.poolFireFlameResult)}`);
|
|
709
|
+
parts.push(`resultCode: ${String(this.resultCode)}`);
|
|
710
|
+
parts.push("*** messages:");
|
|
711
|
+
parts.push(`messages: ${this.messages !== undefined ? this.messages : "(None)"}`);
|
|
712
|
+
parts.push(`calculationElapsedTime: ${this.calculationElapsedTime !== undefined ? this.calculationElapsedTime : "(None)"}`);
|
|
713
|
+
parts.push(`operationId: ${this.operationId !== undefined ? this.operationId : "(None)"}`);
|
|
714
|
+
|
|
715
|
+
return parts.join("\n");
|
|
716
|
+
}
|
|
717
|
+
}
|
|
718
|
+
|
|
719
|
+
export class UserDefinedSourceLinkedRunCalculationResponse extends CalculationResponseBase {
|
|
720
|
+
distancesToJetFireRadiation: number[];
|
|
721
|
+
jetContourPoints: Entities.LocalPosition[];
|
|
722
|
+
nJetContourPoints: number[];
|
|
723
|
+
areaContourJet: number[];
|
|
724
|
+
distancesToFlamConcentration: number[];
|
|
725
|
+
flamConcentrationsUsed: number[];
|
|
726
|
+
flamConcContourPoints: Entities.LocalPosition[];
|
|
727
|
+
nFlamConcContourPoints: number[];
|
|
728
|
+
areaFootprintFlamConc: number[];
|
|
729
|
+
distancesToPoolFireRadiation: number[];
|
|
730
|
+
poolContourPoints: Entities.LocalPosition[];
|
|
731
|
+
nPoolContourPoints: number[];
|
|
732
|
+
areaContourPool: number[];
|
|
733
|
+
explosionOverpressureResults: Entities.ExplosionOverpressureResult[];
|
|
734
|
+
distancesToToxicConcentration: number[];
|
|
735
|
+
toxicConcentrationUsed: number[];
|
|
736
|
+
toxicConcContourPoints: Entities.LocalPosition[];
|
|
737
|
+
nToxicConcContourPoints: number[];
|
|
738
|
+
areaFootprintToxicConc: number[];
|
|
739
|
+
jetFireFlameResult: Entities.FlameResult;
|
|
740
|
+
poolFireFlameResult: Entities.PoolFireFlameResult;
|
|
741
|
+
|
|
742
|
+
/**
|
|
743
|
+
* UserDefinedSourceLinkedRun calculation response class.
|
|
744
|
+
*
|
|
745
|
+
* @param {number[]} distancesToJetFireRadiation - An array of distances to jet fire radiation levels, ordered according to the Flammable Output Configs.
|
|
746
|
+
* @param {Entities.LocalPosition[]} jetContourPoints - An array of jet fire radiation contour points, ordered according to the Flammable Output Configs.
|
|
747
|
+
* @param {number[]} nJetContourPoints - An array of the number of jet fire radiation contour points, ordered according to the Flammable Output Configs.
|
|
748
|
+
* @param {number[]} areaContourJet - An array of areas of the jet fire contours, ordered according to the Flammable Output Configs.
|
|
749
|
+
* @param {number[]} distancesToFlamConcentration - An array of distances to flammable concentration levels, ordered according to the Dispersion Output Configs for flammable concentrations of interest.
|
|
750
|
+
* @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.
|
|
751
|
+
* @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.
|
|
752
|
+
* @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.
|
|
753
|
+
* @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.
|
|
754
|
+
* @param {number[]} distancesToPoolFireRadiation - An array of distances to pool fire radiation levels, ordered according to the Flammable Output Configs.
|
|
755
|
+
* @param {Entities.LocalPosition[]} poolContourPoints - An array of pool fire radiation contour points, ordered according to the Flammable Output Configs.
|
|
756
|
+
* @param {number[]} nPoolContourPoints - An array of the number of pool fire radiation contour points, ordered according to the Flammable Output Configs.
|
|
757
|
+
* @param {number[]} areaContourPool - An array of areas of the pool fire contours, ordered according to the Flammable Output Configs.
|
|
758
|
+
* @param {Entities.ExplosionOverpressureResult[]} explosionOverpressureResults - An array of Explosion Overpressure Results, ordered according to the Explosion Output Configs.
|
|
759
|
+
* @param {number[]} distancesToToxicConcentration - An array of distances to toxic concentration levels, ordered according to the Dispersion Output Configs for toxic concentrations of interest.
|
|
760
|
+
* @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.
|
|
761
|
+
* @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.
|
|
762
|
+
* @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.
|
|
763
|
+
* @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.
|
|
764
|
+
* @param {Entities.FlameResult} jetFireFlameResult - A Flame Results entity, for jet fire.
|
|
765
|
+
* @param {Entities.PoolFireFlameResult} poolFireFlameResult - A Pool Fire Flame Results entity, for pool fire.
|
|
766
|
+
*/
|
|
767
|
+
constructor(
|
|
768
|
+
distancesToJetFireRadiation: number[],
|
|
769
|
+
jetContourPoints: Entities.LocalPosition[],
|
|
770
|
+
nJetContourPoints: number[],
|
|
771
|
+
areaContourJet: number[],
|
|
772
|
+
distancesToFlamConcentration: number[],
|
|
773
|
+
flamConcentrationsUsed: number[],
|
|
774
|
+
flamConcContourPoints: Entities.LocalPosition[],
|
|
775
|
+
nFlamConcContourPoints: number[],
|
|
776
|
+
areaFootprintFlamConc: number[],
|
|
777
|
+
distancesToPoolFireRadiation: number[],
|
|
778
|
+
poolContourPoints: Entities.LocalPosition[],
|
|
779
|
+
nPoolContourPoints: number[],
|
|
780
|
+
areaContourPool: number[],
|
|
781
|
+
explosionOverpressureResults: Entities.ExplosionOverpressureResult[],
|
|
782
|
+
distancesToToxicConcentration: number[],
|
|
783
|
+
toxicConcentrationUsed: number[],
|
|
784
|
+
toxicConcContourPoints: Entities.LocalPosition[],
|
|
785
|
+
nToxicConcContourPoints: number[],
|
|
786
|
+
areaFootprintToxicConc: number[],
|
|
787
|
+
jetFireFlameResult: Entities.FlameResult,
|
|
788
|
+
poolFireFlameResult: Entities.PoolFireFlameResult,
|
|
789
|
+
resultCode: Enums.ResultCode,
|
|
790
|
+
messages: string[],
|
|
791
|
+
calculationElapsedTime: number,
|
|
792
|
+
operationId: string
|
|
793
|
+
) {
|
|
794
|
+
super();
|
|
795
|
+
this.distancesToJetFireRadiation = distancesToJetFireRadiation;
|
|
796
|
+
this.jetContourPoints = jetContourPoints;
|
|
797
|
+
this.nJetContourPoints = nJetContourPoints;
|
|
798
|
+
this.areaContourJet = areaContourJet;
|
|
799
|
+
this.distancesToFlamConcentration = distancesToFlamConcentration;
|
|
800
|
+
this.flamConcentrationsUsed = flamConcentrationsUsed;
|
|
801
|
+
this.flamConcContourPoints = flamConcContourPoints;
|
|
802
|
+
this.nFlamConcContourPoints = nFlamConcContourPoints;
|
|
803
|
+
this.areaFootprintFlamConc = areaFootprintFlamConc;
|
|
804
|
+
this.distancesToPoolFireRadiation = distancesToPoolFireRadiation;
|
|
805
|
+
this.poolContourPoints = poolContourPoints;
|
|
806
|
+
this.nPoolContourPoints = nPoolContourPoints;
|
|
807
|
+
this.areaContourPool = areaContourPool;
|
|
808
|
+
this.explosionOverpressureResults = explosionOverpressureResults;
|
|
809
|
+
this.distancesToToxicConcentration = distancesToToxicConcentration;
|
|
810
|
+
this.toxicConcentrationUsed = toxicConcentrationUsed;
|
|
811
|
+
this.toxicConcContourPoints = toxicConcContourPoints;
|
|
812
|
+
this.nToxicConcContourPoints = nToxicConcContourPoints;
|
|
813
|
+
this.areaFootprintToxicConc = areaFootprintToxicConc;
|
|
814
|
+
this.jetFireFlameResult = jetFireFlameResult;
|
|
815
|
+
this.poolFireFlameResult = poolFireFlameResult;
|
|
816
|
+
this.resultCode = resultCode;
|
|
817
|
+
this.messages = messages;
|
|
818
|
+
this.calculationElapsedTime = calculationElapsedTime;
|
|
819
|
+
this.operationId = operationId;
|
|
820
|
+
}
|
|
821
|
+
|
|
822
|
+
initialiseFromDictionary(data: { [key: string]: unknown }) {
|
|
823
|
+
if (data.distancesToJetFireRadiation && Array.isArray(data.distancesToJetFireRadiation)) {
|
|
824
|
+
this.distancesToJetFireRadiation = data.distancesToJetFireRadiation.map((item) => parseFloat(item));
|
|
825
|
+
}
|
|
826
|
+
if (data.jetContourPoints && Array.isArray(data.jetContourPoints)) {
|
|
827
|
+
this.jetContourPoints = data.jetContourPoints.map(
|
|
828
|
+
(item) => {
|
|
829
|
+
const record = new Entities.LocalPosition();
|
|
830
|
+
record.initialiseFromDictionary(item);
|
|
831
|
+
return record;
|
|
832
|
+
}
|
|
833
|
+
);
|
|
834
|
+
}
|
|
835
|
+
if (data.nJetContourPoints && Array.isArray(data.nJetContourPoints)) {
|
|
836
|
+
this.nJetContourPoints = data.nJetContourPoints.map((item) => parseInt(item));
|
|
837
|
+
}
|
|
838
|
+
if (data.areaContourJet && Array.isArray(data.areaContourJet)) {
|
|
839
|
+
this.areaContourJet = data.areaContourJet.map((item) => parseFloat(item));
|
|
840
|
+
}
|
|
841
|
+
if (data.distancesToFlamConcentration && Array.isArray(data.distancesToFlamConcentration)) {
|
|
842
|
+
this.distancesToFlamConcentration = data.distancesToFlamConcentration.map((item) => parseFloat(item));
|
|
843
|
+
}
|
|
844
|
+
if (data.flamConcentrationsUsed && Array.isArray(data.flamConcentrationsUsed)) {
|
|
845
|
+
this.flamConcentrationsUsed = data.flamConcentrationsUsed.map((item) => parseFloat(item));
|
|
846
|
+
}
|
|
847
|
+
if (data.flamConcContourPoints && Array.isArray(data.flamConcContourPoints)) {
|
|
848
|
+
this.flamConcContourPoints = data.flamConcContourPoints.map(
|
|
849
|
+
(item) => {
|
|
850
|
+
const record = new Entities.LocalPosition();
|
|
851
|
+
record.initialiseFromDictionary(item);
|
|
852
|
+
return record;
|
|
853
|
+
}
|
|
854
|
+
);
|
|
855
|
+
}
|
|
856
|
+
if (data.nFlamConcContourPoints && Array.isArray(data.nFlamConcContourPoints)) {
|
|
857
|
+
this.nFlamConcContourPoints = data.nFlamConcContourPoints.map((item) => parseInt(item));
|
|
858
|
+
}
|
|
859
|
+
if (data.areaFootprintFlamConc && Array.isArray(data.areaFootprintFlamConc)) {
|
|
860
|
+
this.areaFootprintFlamConc = data.areaFootprintFlamConc.map((item) => parseFloat(item));
|
|
861
|
+
}
|
|
862
|
+
if (data.distancesToPoolFireRadiation && Array.isArray(data.distancesToPoolFireRadiation)) {
|
|
863
|
+
this.distancesToPoolFireRadiation = data.distancesToPoolFireRadiation.map((item) => parseFloat(item));
|
|
864
|
+
}
|
|
865
|
+
if (data.poolContourPoints && Array.isArray(data.poolContourPoints)) {
|
|
866
|
+
this.poolContourPoints = data.poolContourPoints.map(
|
|
867
|
+
(item) => {
|
|
868
|
+
const record = new Entities.LocalPosition();
|
|
869
|
+
record.initialiseFromDictionary(item);
|
|
870
|
+
return record;
|
|
871
|
+
}
|
|
872
|
+
);
|
|
873
|
+
}
|
|
874
|
+
if (data.nPoolContourPoints && Array.isArray(data.nPoolContourPoints)) {
|
|
875
|
+
this.nPoolContourPoints = data.nPoolContourPoints.map((item) => parseInt(item));
|
|
876
|
+
}
|
|
877
|
+
if (data.areaContourPool && Array.isArray(data.areaContourPool)) {
|
|
878
|
+
this.areaContourPool = data.areaContourPool.map((item) => parseFloat(item));
|
|
879
|
+
}
|
|
880
|
+
if (data.explosionOverpressureResults && Array.isArray(data.explosionOverpressureResults)) {
|
|
881
|
+
this.explosionOverpressureResults = data.explosionOverpressureResults.map(
|
|
882
|
+
(item) => {
|
|
883
|
+
const record = new Entities.ExplosionOverpressureResult();
|
|
884
|
+
record.initialiseFromDictionary(item);
|
|
885
|
+
return record;
|
|
886
|
+
}
|
|
887
|
+
);
|
|
888
|
+
}
|
|
889
|
+
if (data.distancesToToxicConcentration && Array.isArray(data.distancesToToxicConcentration)) {
|
|
890
|
+
this.distancesToToxicConcentration = data.distancesToToxicConcentration.map((item) => parseFloat(item));
|
|
891
|
+
}
|
|
892
|
+
if (data.toxicConcentrationUsed && Array.isArray(data.toxicConcentrationUsed)) {
|
|
893
|
+
this.toxicConcentrationUsed = data.toxicConcentrationUsed.map((item) => parseFloat(item));
|
|
894
|
+
}
|
|
895
|
+
if (data.toxicConcContourPoints && Array.isArray(data.toxicConcContourPoints)) {
|
|
896
|
+
this.toxicConcContourPoints = data.toxicConcContourPoints.map(
|
|
897
|
+
(item) => {
|
|
898
|
+
const record = new Entities.LocalPosition();
|
|
899
|
+
record.initialiseFromDictionary(item);
|
|
900
|
+
return record;
|
|
901
|
+
}
|
|
902
|
+
);
|
|
903
|
+
}
|
|
904
|
+
if (data.nToxicConcContourPoints && Array.isArray(data.nToxicConcContourPoints)) {
|
|
905
|
+
this.nToxicConcContourPoints = data.nToxicConcContourPoints.map((item) => parseInt(item));
|
|
906
|
+
}
|
|
907
|
+
if (data.areaFootprintToxicConc && Array.isArray(data.areaFootprintToxicConc)) {
|
|
908
|
+
this.areaFootprintToxicConc = data.areaFootprintToxicConc.map((item) => parseFloat(item));
|
|
909
|
+
}
|
|
910
|
+
if (data.jetFireFlameResult) {
|
|
911
|
+
this.jetFireFlameResult = new Entities.FlameResult();
|
|
912
|
+
this.jetFireFlameResult.initialiseFromDictionary(data.jetFireFlameResult as { [key: string]: unknown });
|
|
913
|
+
}
|
|
914
|
+
if (data.poolFireFlameResult) {
|
|
915
|
+
this.poolFireFlameResult = new Entities.PoolFireFlameResult();
|
|
916
|
+
this.poolFireFlameResult.initialiseFromDictionary(data.poolFireFlameResult as { [key: string]: unknown });
|
|
917
|
+
}
|
|
918
|
+
if (data.resultCode !== undefined && (typeof data.resultCode === "string" || typeof data.resultCode === "number")) {
|
|
919
|
+
this.resultCode = data.resultCode as Enums.ResultCode;
|
|
920
|
+
}
|
|
921
|
+
this.messages = this.messages ?? [];
|
|
922
|
+
if (data.messages && Array.isArray(data.messages)) {
|
|
923
|
+
this.messages.push(...data.messages);
|
|
924
|
+
}
|
|
925
|
+
if (data.calculationElapsedTime !== undefined && typeof data.calculationElapsedTime === "number") {
|
|
926
|
+
this.calculationElapsedTime = data.calculationElapsedTime as number;
|
|
927
|
+
}
|
|
928
|
+
if (data.operationId !== undefined && typeof data.operationId === "string") {
|
|
929
|
+
this.operationId = data.operationId as string;
|
|
930
|
+
}
|
|
931
|
+
}
|
|
932
|
+
}
|
|
933
|
+
|
|
934
|
+
export interface UserDefinedSourceLinkedRunCalculationResponseSchemaData {
|
|
935
|
+
distancesToJetFireRadiation: number[];
|
|
936
|
+
jetContourPoints: Entities.LocalPosition[];
|
|
937
|
+
nJetContourPoints: number[];
|
|
938
|
+
areaContourJet: number[];
|
|
939
|
+
distancesToFlamConcentration: number[];
|
|
940
|
+
flamConcentrationsUsed: number[];
|
|
941
|
+
flamConcContourPoints: Entities.LocalPosition[];
|
|
942
|
+
nFlamConcContourPoints: number[];
|
|
943
|
+
areaFootprintFlamConc: number[];
|
|
944
|
+
distancesToPoolFireRadiation: number[];
|
|
945
|
+
poolContourPoints: Entities.LocalPosition[];
|
|
946
|
+
nPoolContourPoints: number[];
|
|
947
|
+
areaContourPool: number[];
|
|
948
|
+
explosionOverpressureResults: Entities.ExplosionOverpressureResult[];
|
|
949
|
+
distancesToToxicConcentration: number[];
|
|
950
|
+
toxicConcentrationUsed: number[];
|
|
951
|
+
toxicConcContourPoints: Entities.LocalPosition[];
|
|
952
|
+
nToxicConcContourPoints: number[];
|
|
953
|
+
areaFootprintToxicConc: number[];
|
|
954
|
+
jetFireFlameResult: Entities.FlameResult;
|
|
955
|
+
poolFireFlameResult: Entities.PoolFireFlameResult;
|
|
956
|
+
resultCode: Enums.ResultCode;
|
|
957
|
+
messages: string[];
|
|
958
|
+
calculationElapsedTime: number;
|
|
959
|
+
operationId: string;
|
|
960
|
+
}
|
|
961
|
+
|
|
962
|
+
export class UserDefinedSourceLinkedRunCalculationResponseSchema {
|
|
963
|
+
schema: Joi.ObjectSchema;
|
|
964
|
+
propertyTypes: Record<string, string>;
|
|
965
|
+
|
|
966
|
+
/**
|
|
967
|
+
* Schema for the UserDefinedSourceLinkedRun calculation response.
|
|
968
|
+
*/
|
|
969
|
+
constructor() {
|
|
970
|
+
this.schema = Joi.object({
|
|
971
|
+
distancesToJetFireRadiation: Joi.array().items(Joi.number().unsafe()).allow(null),
|
|
972
|
+
jetContourPoints: Joi.array().items(new EntitySchemas.LocalPositionSchema().schema).allow(null),
|
|
973
|
+
nJetContourPoints: Joi.array().items(Joi.number().integer()).allow(null),
|
|
974
|
+
areaContourJet: Joi.array().items(Joi.number().unsafe()).allow(null),
|
|
975
|
+
distancesToFlamConcentration: Joi.array().items(Joi.number().unsafe()).allow(null),
|
|
976
|
+
flamConcentrationsUsed: Joi.array().items(Joi.number().unsafe()).allow(null),
|
|
977
|
+
flamConcContourPoints: Joi.array().items(new EntitySchemas.LocalPositionSchema().schema).allow(null),
|
|
978
|
+
nFlamConcContourPoints: Joi.array().items(Joi.number().integer()).allow(null),
|
|
979
|
+
areaFootprintFlamConc: Joi.array().items(Joi.number().unsafe()).allow(null),
|
|
980
|
+
distancesToPoolFireRadiation: Joi.array().items(Joi.number().unsafe()).allow(null),
|
|
981
|
+
poolContourPoints: Joi.array().items(new EntitySchemas.LocalPositionSchema().schema).allow(null),
|
|
982
|
+
nPoolContourPoints: Joi.array().items(Joi.number().integer()).allow(null),
|
|
983
|
+
areaContourPool: Joi.array().items(Joi.number().unsafe()).allow(null),
|
|
984
|
+
explosionOverpressureResults: Joi.array().items(new EntitySchemas.ExplosionOverpressureResultSchema().schema).allow(null),
|
|
985
|
+
distancesToToxicConcentration: Joi.array().items(Joi.number().unsafe()).allow(null),
|
|
986
|
+
toxicConcentrationUsed: Joi.array().items(Joi.number().unsafe()).allow(null),
|
|
987
|
+
toxicConcContourPoints: Joi.array().items(new EntitySchemas.LocalPositionSchema().schema).allow(null),
|
|
988
|
+
nToxicConcContourPoints: Joi.array().items(Joi.number().integer()).allow(null),
|
|
989
|
+
areaFootprintToxicConc: Joi.array().items(Joi.number().unsafe()).allow(null),
|
|
990
|
+
jetFireFlameResult: new EntitySchemas.FlameResultSchema().schema,
|
|
991
|
+
poolFireFlameResult: new EntitySchemas.PoolFireFlameResultSchema().schema,
|
|
992
|
+
resultCode: Joi.string().valid(...Object.values(Enums.ResultCode)),
|
|
993
|
+
messages: Joi.array().items(Joi.string()),
|
|
994
|
+
calculationElapsedTime: Joi.number().unsafe(),
|
|
995
|
+
operationId: Joi.string().uuid().allow(null),
|
|
996
|
+
}).unknown(true);
|
|
997
|
+
|
|
998
|
+
this.propertyTypes = {
|
|
999
|
+
distancesToJetFireRadiation: "number[]",
|
|
1000
|
+
jetContourPoints: "Entities.LocalPosition[]",
|
|
1001
|
+
nJetContourPoints: "number[]",
|
|
1002
|
+
areaContourJet: "number[]",
|
|
1003
|
+
distancesToFlamConcentration: "number[]",
|
|
1004
|
+
flamConcentrationsUsed: "number[]",
|
|
1005
|
+
flamConcContourPoints: "Entities.LocalPosition[]",
|
|
1006
|
+
nFlamConcContourPoints: "number[]",
|
|
1007
|
+
areaFootprintFlamConc: "number[]",
|
|
1008
|
+
distancesToPoolFireRadiation: "number[]",
|
|
1009
|
+
poolContourPoints: "Entities.LocalPosition[]",
|
|
1010
|
+
nPoolContourPoints: "number[]",
|
|
1011
|
+
areaContourPool: "number[]",
|
|
1012
|
+
explosionOverpressureResults: "Entities.ExplosionOverpressureResult[]",
|
|
1013
|
+
distancesToToxicConcentration: "number[]",
|
|
1014
|
+
toxicConcentrationUsed: "number[]",
|
|
1015
|
+
toxicConcContourPoints: "Entities.LocalPosition[]",
|
|
1016
|
+
nToxicConcContourPoints: "number[]",
|
|
1017
|
+
areaFootprintToxicConc: "number[]",
|
|
1018
|
+
jetFireFlameResult: "Entities.FlameResult",
|
|
1019
|
+
poolFireFlameResult: "Entities.PoolFireFlameResult",
|
|
1020
|
+
};
|
|
1021
|
+
}
|
|
1022
|
+
|
|
1023
|
+
validate(data: UserDefinedSourceLinkedRunCalculationResponseSchemaData): UserDefinedSourceLinkedRunCalculationResponse {
|
|
1024
|
+
const { error, value } = this.schema.validate(data, { abortEarly: false });
|
|
1025
|
+
if (error) {
|
|
1026
|
+
throw new Error(`Validation error: ${error.details.map((x) => x.message).join(", ")}`);
|
|
1027
|
+
}
|
|
1028
|
+
return this.makeCalculationResponse(value);
|
|
1029
|
+
}
|
|
1030
|
+
|
|
1031
|
+
makeCalculationResponse(data: UserDefinedSourceLinkedRunCalculationResponseSchemaData): UserDefinedSourceLinkedRunCalculationResponse {
|
|
1032
|
+
return new UserDefinedSourceLinkedRunCalculationResponse(
|
|
1033
|
+
data.distancesToJetFireRadiation,
|
|
1034
|
+
data.jetContourPoints,
|
|
1035
|
+
data.nJetContourPoints,
|
|
1036
|
+
data.areaContourJet,
|
|
1037
|
+
data.distancesToFlamConcentration,
|
|
1038
|
+
data.flamConcentrationsUsed,
|
|
1039
|
+
data.flamConcContourPoints,
|
|
1040
|
+
data.nFlamConcContourPoints,
|
|
1041
|
+
data.areaFootprintFlamConc,
|
|
1042
|
+
data.distancesToPoolFireRadiation,
|
|
1043
|
+
data.poolContourPoints,
|
|
1044
|
+
data.nPoolContourPoints,
|
|
1045
|
+
data.areaContourPool,
|
|
1046
|
+
data.explosionOverpressureResults,
|
|
1047
|
+
data.distancesToToxicConcentration,
|
|
1048
|
+
data.toxicConcentrationUsed,
|
|
1049
|
+
data.toxicConcContourPoints,
|
|
1050
|
+
data.nToxicConcContourPoints,
|
|
1051
|
+
data.areaFootprintToxicConc,
|
|
1052
|
+
data.jetFireFlameResult,
|
|
1053
|
+
data.poolFireFlameResult,
|
|
1054
|
+
data.resultCode,
|
|
1055
|
+
data.messages,
|
|
1056
|
+
data.calculationElapsedTime,
|
|
1057
|
+
data.operationId
|
|
1058
|
+
);
|
|
1059
|
+
}
|
|
1060
|
+
}
|
|
1061
|
+
|
|
1062
|
+
export interface VesselLeakLinkedRunCalculationRequestSchemaData {
|
|
1063
|
+
vessel: Entities.Vessel;
|
|
1064
|
+
leak: Entities.Leak;
|
|
1065
|
+
dischargeParameters: Entities.DischargeParameters;
|
|
1066
|
+
substrate: Entities.Substrate;
|
|
1067
|
+
weather: Entities.Weather;
|
|
1068
|
+
dispersionParameters: Entities.DispersionParameters[];
|
|
1069
|
+
dispersionParameterCount: number;
|
|
1070
|
+
endPointConcentration: number;
|
|
1071
|
+
flammableParameters: Entities.FlammableParameters;
|
|
1072
|
+
explosionParameters: Entities.ExplosionParameters;
|
|
1073
|
+
dispersionFlamOutputConfigs: Entities.DispersionOutputConfig[];
|
|
1074
|
+
dispersionFlamOutputConfigCount: number;
|
|
1075
|
+
dispersionToxicOutputConfigs: Entities.DispersionOutputConfig[];
|
|
1076
|
+
dispersionToxicOutputConfigCount: number;
|
|
1077
|
+
flammableOutputConfigs: Entities.FlammableOutputConfig[];
|
|
1078
|
+
flammableOutputConfigCount: number;
|
|
1079
|
+
explosionOutputConfigs: Entities.ExplosionOutputConfig[];
|
|
1080
|
+
explosionOutputConfigCount: number;
|
|
1081
|
+
explosionConfinedVolumes: Entities.ExplosionConfinedVolume[];
|
|
1082
|
+
explosionConfinedVolumeCount: number;
|
|
1083
|
+
}
|
|
1084
|
+
|
|
1085
|
+
class VesselLeakLinkedRunCalculationRequest extends CalculationRequestBase {
|
|
1086
|
+
vessel: Entities.Vessel;
|
|
1087
|
+
leak: Entities.Leak;
|
|
1088
|
+
dischargeParameters: Entities.DischargeParameters;
|
|
1089
|
+
substrate: Entities.Substrate;
|
|
1090
|
+
weather: Entities.Weather;
|
|
1091
|
+
dispersionParameters: Entities.DispersionParameters[];
|
|
1092
|
+
dispersionParameterCount: number;
|
|
1093
|
+
endPointConcentration: number;
|
|
1094
|
+
flammableParameters: Entities.FlammableParameters;
|
|
1095
|
+
explosionParameters: Entities.ExplosionParameters;
|
|
1096
|
+
dispersionFlamOutputConfigs: Entities.DispersionOutputConfig[];
|
|
1097
|
+
dispersionFlamOutputConfigCount: number;
|
|
1098
|
+
dispersionToxicOutputConfigs: Entities.DispersionOutputConfig[];
|
|
1099
|
+
dispersionToxicOutputConfigCount: number;
|
|
1100
|
+
flammableOutputConfigs: Entities.FlammableOutputConfig[];
|
|
1101
|
+
flammableOutputConfigCount: number;
|
|
1102
|
+
explosionOutputConfigs: Entities.ExplosionOutputConfig[];
|
|
1103
|
+
explosionOutputConfigCount: number;
|
|
1104
|
+
explosionConfinedVolumes: Entities.ExplosionConfinedVolume[];
|
|
1105
|
+
explosionConfinedVolumeCount: number;
|
|
1106
|
+
|
|
1107
|
+
/**
|
|
1108
|
+
* VesselLeakLinkedRun calculation request class.
|
|
1109
|
+
*
|
|
1110
|
+
* @param {Entities.Vessel} vessel - A Vessel entity.
|
|
1111
|
+
* @param {Entities.Leak} leak - A Leak entity.
|
|
1112
|
+
* @param {Entities.DischargeParameters} dischargeParameters - A Discharge Parameters entity.
|
|
1113
|
+
* @param {Entities.Substrate} substrate - A Substrate entity.
|
|
1114
|
+
* @param {Entities.Weather} weather - A Weather entity.
|
|
1115
|
+
* @param {Entities.DispersionParameters[]} dispersionParameters - An array of Dispersion Parameters.
|
|
1116
|
+
* @param {number} dispersionParameterCount - Number of Dispersion Parameters.
|
|
1117
|
+
* @param {number} endPointConcentration - Concentration at which the dispersion calculations will terminate (v/v fraction).
|
|
1118
|
+
* @param {Entities.FlammableParameters} flammableParameters - A Flammable Parameters entity.
|
|
1119
|
+
* @param {Entities.ExplosionParameters} explosionParameters - An Explosion Parameters entity.
|
|
1120
|
+
* @param {Entities.DispersionOutputConfig[]} dispersionFlamOutputConfigs - An array of Dispersion Output Configs for flammable concentrations of interest.
|
|
1121
|
+
* @param {number} dispersionFlamOutputConfigCount - Number of Dispersion Output Configs for flammable concentrations of interest.
|
|
1122
|
+
* @param {Entities.DispersionOutputConfig[]} dispersionToxicOutputConfigs - An array of Dispersion Output Configs for toxic concentrations of interest.
|
|
1123
|
+
* @param {number} dispersionToxicOutputConfigCount - Number of Dispersion Output Configs for toxic concentrations of interest.
|
|
1124
|
+
* @param {Entities.FlammableOutputConfig[]} flammableOutputConfigs - An array of Flammable Output Configs for radiation levels of interest.
|
|
1125
|
+
* @param {number} flammableOutputConfigCount - Number of Flammable Ouput Configs for radiation levels of interest.
|
|
1126
|
+
* @param {Entities.ExplosionOutputConfig[]} explosionOutputConfigs - An array of Explosion Output Configs for overpressure levels of interest.
|
|
1127
|
+
* @param {number} explosionOutputConfigCount - Number of Explosion Output Configs for overpressure levels of interest.
|
|
1128
|
+
* @param {Entities.ExplosionConfinedVolume[]} explosionConfinedVolumes - An array of Explosion Confined Volumes.
|
|
1129
|
+
* @param {number} explosionConfinedVolumeCount - Number of Explosion Confined Volumes.
|
|
1130
|
+
*/
|
|
1131
|
+
constructor(
|
|
1132
|
+
vessel: Entities.Vessel,
|
|
1133
|
+
leak: Entities.Leak,
|
|
1134
|
+
dischargeParameters: Entities.DischargeParameters,
|
|
1135
|
+
substrate: Entities.Substrate,
|
|
1136
|
+
weather: Entities.Weather,
|
|
1137
|
+
dispersionParameters: Entities.DispersionParameters[],
|
|
1138
|
+
dispersionParameterCount: number,
|
|
1139
|
+
endPointConcentration: number,
|
|
1140
|
+
flammableParameters: Entities.FlammableParameters,
|
|
1141
|
+
explosionParameters: Entities.ExplosionParameters,
|
|
1142
|
+
dispersionFlamOutputConfigs: Entities.DispersionOutputConfig[],
|
|
1143
|
+
dispersionFlamOutputConfigCount: number,
|
|
1144
|
+
dispersionToxicOutputConfigs: Entities.DispersionOutputConfig[],
|
|
1145
|
+
dispersionToxicOutputConfigCount: number,
|
|
1146
|
+
flammableOutputConfigs: Entities.FlammableOutputConfig[],
|
|
1147
|
+
flammableOutputConfigCount: number,
|
|
1148
|
+
explosionOutputConfigs: Entities.ExplosionOutputConfig[],
|
|
1149
|
+
explosionOutputConfigCount: number,
|
|
1150
|
+
explosionConfinedVolumes: Entities.ExplosionConfinedVolume[],
|
|
1151
|
+
explosionConfinedVolumeCount: number
|
|
1152
|
+
) {
|
|
1153
|
+
super();
|
|
1154
|
+
this.vessel = vessel;
|
|
1155
|
+
this.leak = leak;
|
|
1156
|
+
this.dischargeParameters = dischargeParameters;
|
|
1157
|
+
this.substrate = substrate;
|
|
1158
|
+
this.weather = weather;
|
|
1159
|
+
this.dispersionParameters = dispersionParameters;
|
|
1160
|
+
this.dispersionParameterCount = dispersionParameterCount;
|
|
1161
|
+
this.endPointConcentration = endPointConcentration;
|
|
1162
|
+
this.flammableParameters = flammableParameters;
|
|
1163
|
+
this.explosionParameters = explosionParameters;
|
|
1164
|
+
this.dispersionFlamOutputConfigs = dispersionFlamOutputConfigs;
|
|
1165
|
+
this.dispersionFlamOutputConfigCount = dispersionFlamOutputConfigCount;
|
|
1166
|
+
this.dispersionToxicOutputConfigs = dispersionToxicOutputConfigs;
|
|
1167
|
+
this.dispersionToxicOutputConfigCount = dispersionToxicOutputConfigCount;
|
|
1168
|
+
this.flammableOutputConfigs = flammableOutputConfigs;
|
|
1169
|
+
this.flammableOutputConfigCount = flammableOutputConfigCount;
|
|
1170
|
+
this.explosionOutputConfigs = explosionOutputConfigs;
|
|
1171
|
+
this.explosionOutputConfigCount = explosionOutputConfigCount;
|
|
1172
|
+
this.explosionConfinedVolumes = explosionConfinedVolumes;
|
|
1173
|
+
this.explosionConfinedVolumeCount = explosionConfinedVolumeCount;
|
|
1174
|
+
}
|
|
1175
|
+
}
|
|
1176
|
+
|
|
1177
|
+
export class VesselLeakLinkedRunCalculationRequestSchema {
|
|
1178
|
+
schema: Joi.ObjectSchema;
|
|
1179
|
+
propertyTypes: Record<string, string>;
|
|
1180
|
+
|
|
1181
|
+
/**
|
|
1182
|
+
* Schema for the VesselLeakLinkedRun calculation request.
|
|
1183
|
+
*/
|
|
1184
|
+
constructor() {
|
|
1185
|
+
this.schema = Joi.object({
|
|
1186
|
+
vessel: new EntitySchemas.VesselSchema().schema,
|
|
1187
|
+
leak: new EntitySchemas.LeakSchema().schema,
|
|
1188
|
+
dischargeParameters: new EntitySchemas.DischargeParametersSchema().schema,
|
|
1189
|
+
substrate: new EntitySchemas.SubstrateSchema().schema,
|
|
1190
|
+
weather: new EntitySchemas.WeatherSchema().schema,
|
|
1191
|
+
dispersionParameters: Joi.array().items(new EntitySchemas.DispersionParametersSchema().schema).allow(null),
|
|
1192
|
+
dispersionParameterCount: Joi.number().integer(),
|
|
1193
|
+
endPointConcentration: Joi.number().unsafe(),
|
|
1194
|
+
flammableParameters: new EntitySchemas.FlammableParametersSchema().schema,
|
|
1195
|
+
explosionParameters: new EntitySchemas.ExplosionParametersSchema().schema,
|
|
1196
|
+
dispersionFlamOutputConfigs: Joi.array().items(new EntitySchemas.DispersionOutputConfigSchema().schema).allow(null),
|
|
1197
|
+
dispersionFlamOutputConfigCount: Joi.number().integer(),
|
|
1198
|
+
dispersionToxicOutputConfigs: Joi.array().items(new EntitySchemas.DispersionOutputConfigSchema().schema).allow(null),
|
|
1199
|
+
dispersionToxicOutputConfigCount: Joi.number().integer(),
|
|
1200
|
+
flammableOutputConfigs: Joi.array().items(new EntitySchemas.FlammableOutputConfigSchema().schema).allow(null),
|
|
1201
|
+
flammableOutputConfigCount: Joi.number().integer(),
|
|
1202
|
+
explosionOutputConfigs: Joi.array().items(new EntitySchemas.ExplosionOutputConfigSchema().schema).allow(null),
|
|
1203
|
+
explosionOutputConfigCount: Joi.number().integer(),
|
|
1204
|
+
explosionConfinedVolumes: Joi.array().items(new EntitySchemas.ExplosionConfinedVolumeSchema().schema).allow(null),
|
|
1205
|
+
explosionConfinedVolumeCount: Joi.number().integer(),
|
|
1206
|
+
}).unknown(true);
|
|
1207
|
+
|
|
1208
|
+
this.propertyTypes = {
|
|
1209
|
+
vessel: "Entities.Vessel",
|
|
1210
|
+
leak: "Entities.Leak",
|
|
1211
|
+
dischargeParameters: "Entities.DischargeParameters",
|
|
1212
|
+
substrate: "Entities.Substrate",
|
|
1213
|
+
weather: "Entities.Weather",
|
|
1214
|
+
dispersionParameters: "Entities.DispersionParameters[]",
|
|
1215
|
+
dispersionParameterCount: "number",
|
|
1216
|
+
endPointConcentration: "number",
|
|
1217
|
+
flammableParameters: "Entities.FlammableParameters",
|
|
1218
|
+
explosionParameters: "Entities.ExplosionParameters",
|
|
1219
|
+
dispersionFlamOutputConfigs: "Entities.DispersionOutputConfig[]",
|
|
1220
|
+
dispersionFlamOutputConfigCount: "number",
|
|
1221
|
+
dispersionToxicOutputConfigs: "Entities.DispersionOutputConfig[]",
|
|
1222
|
+
dispersionToxicOutputConfigCount: "number",
|
|
1223
|
+
flammableOutputConfigs: "Entities.FlammableOutputConfig[]",
|
|
1224
|
+
flammableOutputConfigCount: "number",
|
|
1225
|
+
explosionOutputConfigs: "Entities.ExplosionOutputConfig[]",
|
|
1226
|
+
explosionOutputConfigCount: "number",
|
|
1227
|
+
explosionConfinedVolumes: "Entities.ExplosionConfinedVolume[]",
|
|
1228
|
+
explosionConfinedVolumeCount: "number",
|
|
1229
|
+
};
|
|
1230
|
+
}
|
|
1231
|
+
|
|
1232
|
+
validate(data: VesselLeakLinkedRunCalculationRequestSchemaData): VesselLeakLinkedRunCalculationRequest {
|
|
1233
|
+
const { error, value } = this.schema.validate(data, { abortEarly: false });
|
|
1234
|
+
if (error) {
|
|
1235
|
+
throw new Error(`Validation error: ${error.details.map((x) => x.message).join(", ")}`);
|
|
1236
|
+
}
|
|
1237
|
+
return this.makeCalculationRequest(value);
|
|
1238
|
+
}
|
|
1239
|
+
|
|
1240
|
+
makeCalculationRequest(data: VesselLeakLinkedRunCalculationRequestSchemaData): VesselLeakLinkedRunCalculationRequest {
|
|
1241
|
+
return new VesselLeakLinkedRunCalculationRequest(
|
|
1242
|
+
data.vessel,
|
|
1243
|
+
data.leak,
|
|
1244
|
+
data.dischargeParameters,
|
|
1245
|
+
data.substrate,
|
|
1246
|
+
data.weather,
|
|
1247
|
+
data.dispersionParameters,
|
|
1248
|
+
data.dispersionParameterCount,
|
|
1249
|
+
data.endPointConcentration,
|
|
1250
|
+
data.flammableParameters,
|
|
1251
|
+
data.explosionParameters,
|
|
1252
|
+
data.dispersionFlamOutputConfigs,
|
|
1253
|
+
data.dispersionFlamOutputConfigCount,
|
|
1254
|
+
data.dispersionToxicOutputConfigs,
|
|
1255
|
+
data.dispersionToxicOutputConfigCount,
|
|
1256
|
+
data.flammableOutputConfigs,
|
|
1257
|
+
data.flammableOutputConfigCount,
|
|
1258
|
+
data.explosionOutputConfigs,
|
|
1259
|
+
data.explosionOutputConfigCount,
|
|
1260
|
+
data.explosionConfinedVolumes,
|
|
1261
|
+
data.explosionConfinedVolumeCount
|
|
1262
|
+
);
|
|
1263
|
+
}
|
|
1264
|
+
}
|
|
1265
|
+
|
|
1266
|
+
export class VesselLeakLinkedRunCalculation extends CalculationBase {
|
|
1267
|
+
vessel: Entities.Vessel;
|
|
1268
|
+
leak: Entities.Leak;
|
|
1269
|
+
dischargeParameters: Entities.DischargeParameters;
|
|
1270
|
+
substrate: Entities.Substrate;
|
|
1271
|
+
weather: Entities.Weather;
|
|
1272
|
+
dispersionParameters: Entities.DispersionParameters[];
|
|
1273
|
+
dispersionParameterCount: number;
|
|
1274
|
+
endPointConcentration: number;
|
|
1275
|
+
flammableParameters: Entities.FlammableParameters;
|
|
1276
|
+
explosionParameters: Entities.ExplosionParameters;
|
|
1277
|
+
dispersionFlamOutputConfigs: Entities.DispersionOutputConfig[];
|
|
1278
|
+
dispersionFlamOutputConfigCount: number;
|
|
1279
|
+
dispersionToxicOutputConfigs: Entities.DispersionOutputConfig[];
|
|
1280
|
+
dispersionToxicOutputConfigCount: number;
|
|
1281
|
+
flammableOutputConfigs: Entities.FlammableOutputConfig[];
|
|
1282
|
+
flammableOutputConfigCount: number;
|
|
1283
|
+
explosionOutputConfigs: Entities.ExplosionOutputConfig[];
|
|
1284
|
+
explosionOutputConfigCount: number;
|
|
1285
|
+
explosionConfinedVolumes: Entities.ExplosionConfinedVolume[];
|
|
1286
|
+
explosionConfinedVolumeCount: number;
|
|
1287
|
+
dischargeRecord?: Entities.DischargeRecord;
|
|
1288
|
+
distancesToJetFireRadiation?: number[];
|
|
1289
|
+
jetContourPoints?: Entities.LocalPosition[];
|
|
1290
|
+
nJetContourPoints?: number[];
|
|
1291
|
+
areaContourJet?: number[];
|
|
1292
|
+
distancesToFlamConcentration?: number[];
|
|
1293
|
+
flamConcentrationsUsed?: number[];
|
|
1294
|
+
flamConcContourPoints?: Entities.LocalPosition[];
|
|
1295
|
+
nFlamConcContourPoints?: number[];
|
|
1296
|
+
areaFootprintFlamConc?: number[];
|
|
1297
|
+
distancesToPoolFireRadiation?: number[];
|
|
1298
|
+
poolContourPoints?: Entities.LocalPosition[];
|
|
1299
|
+
nPoolContourPoints?: number[];
|
|
1300
|
+
areaContourPool?: number[];
|
|
1301
|
+
explosionOverpressureResults?: Entities.ExplosionOverpressureResult[];
|
|
1302
|
+
distancesToToxicConcentration?: number[];
|
|
1303
|
+
toxicConcentrationUsed?: number[];
|
|
1304
|
+
toxicConcContourPoints?: Entities.LocalPosition[];
|
|
1305
|
+
nToxicConcContourPoints?: number[];
|
|
1306
|
+
areaFootprintToxicConc?: number[];
|
|
1307
|
+
jetFireFlameResult?: Entities.FlameResult;
|
|
1308
|
+
poolFireFlameResult?: Entities.PoolFireFlameResult;
|
|
1309
|
+
|
|
1310
|
+
/**
|
|
1311
|
+
* Calculates maximum distance to a number of concentration, radiation and overpressure levels for flammable and toxic materials, given a vessel, leak and weather definition.
|
|
1312
|
+
*
|
|
1313
|
+
* @param {Entities.Vessel} vessel - A Vessel entity.
|
|
1314
|
+
* @param {Entities.Leak} leak - A Leak entity.
|
|
1315
|
+
* @param {Entities.DischargeParameters} dischargeParameters - A Discharge Parameters entity.
|
|
1316
|
+
* @param {Entities.Substrate} substrate - A Substrate entity.
|
|
1317
|
+
* @param {Entities.Weather} weather - A Weather entity.
|
|
1318
|
+
* @param {Entities.DispersionParameters[]} dispersionParameters - An array of Dispersion Parameters.
|
|
1319
|
+
* @param {number} dispersionParameterCount - Number of Dispersion Parameters.
|
|
1320
|
+
* @param {number} endPointConcentration - Concentration at which the dispersion calculations will terminate (v/v fraction).
|
|
1321
|
+
* @param {Entities.FlammableParameters} flammableParameters - A Flammable Parameters entity.
|
|
1322
|
+
* @param {Entities.ExplosionParameters} explosionParameters - An Explosion Parameters entity.
|
|
1323
|
+
* @param {Entities.DispersionOutputConfig[]} dispersionFlamOutputConfigs - An array of Dispersion Output Configs for flammable concentrations of interest.
|
|
1324
|
+
* @param {number} dispersionFlamOutputConfigCount - Number of Dispersion Output Configs for flammable concentrations of interest.
|
|
1325
|
+
* @param {Entities.DispersionOutputConfig[]} dispersionToxicOutputConfigs - An array of Dispersion Output Configs for toxic concentrations of interest.
|
|
1326
|
+
* @param {number} dispersionToxicOutputConfigCount - Number of Dispersion Output Configs for toxic concentrations of interest.
|
|
1327
|
+
* @param {Entities.FlammableOutputConfig[]} flammableOutputConfigs - An array of Flammable Output Configs for radiation levels of interest.
|
|
1328
|
+
* @param {number} flammableOutputConfigCount - Number of Flammable Ouput Configs for radiation levels of interest.
|
|
1329
|
+
* @param {Entities.ExplosionOutputConfig[]} explosionOutputConfigs - An array of Explosion Output Configs for overpressure levels of interest.
|
|
1330
|
+
* @param {number} explosionOutputConfigCount - Number of Explosion Output Configs for overpressure levels of interest.
|
|
1331
|
+
* @param {Entities.ExplosionConfinedVolume[]} explosionConfinedVolumes - An array of Explosion Confined Volumes.
|
|
1332
|
+
* @param {number} explosionConfinedVolumeCount - Number of Explosion Confined Volumes.
|
|
1333
|
+
*/
|
|
1334
|
+
constructor(
|
|
1335
|
+
vessel: Entities.Vessel,
|
|
1336
|
+
leak: Entities.Leak,
|
|
1337
|
+
dischargeParameters: Entities.DischargeParameters,
|
|
1338
|
+
substrate: Entities.Substrate,
|
|
1339
|
+
weather: Entities.Weather,
|
|
1340
|
+
dispersionParameters: Entities.DispersionParameters[],
|
|
1341
|
+
dispersionParameterCount: number,
|
|
1342
|
+
endPointConcentration: number,
|
|
1343
|
+
flammableParameters: Entities.FlammableParameters,
|
|
1344
|
+
explosionParameters: Entities.ExplosionParameters,
|
|
1345
|
+
dispersionFlamOutputConfigs: Entities.DispersionOutputConfig[],
|
|
1346
|
+
dispersionFlamOutputConfigCount: number,
|
|
1347
|
+
dispersionToxicOutputConfigs: Entities.DispersionOutputConfig[],
|
|
1348
|
+
dispersionToxicOutputConfigCount: number,
|
|
1349
|
+
flammableOutputConfigs: Entities.FlammableOutputConfig[],
|
|
1350
|
+
flammableOutputConfigCount: number,
|
|
1351
|
+
explosionOutputConfigs: Entities.ExplosionOutputConfig[],
|
|
1352
|
+
explosionOutputConfigCount: number,
|
|
1353
|
+
explosionConfinedVolumes: Entities.ExplosionConfinedVolume[],
|
|
1354
|
+
explosionConfinedVolumeCount: number
|
|
1355
|
+
) {
|
|
1356
|
+
super();
|
|
1357
|
+
this.vessel = vessel;
|
|
1358
|
+
this.leak = leak;
|
|
1359
|
+
this.dischargeParameters = dischargeParameters;
|
|
1360
|
+
this.substrate = substrate;
|
|
1361
|
+
this.weather = weather;
|
|
1362
|
+
this.dispersionParameters = dispersionParameters;
|
|
1363
|
+
this.dispersionParameterCount = dispersionParameterCount;
|
|
1364
|
+
this.endPointConcentration = endPointConcentration;
|
|
1365
|
+
this.flammableParameters = flammableParameters;
|
|
1366
|
+
this.explosionParameters = explosionParameters;
|
|
1367
|
+
this.dispersionFlamOutputConfigs = dispersionFlamOutputConfigs;
|
|
1368
|
+
this.dispersionFlamOutputConfigCount = dispersionFlamOutputConfigCount;
|
|
1369
|
+
this.dispersionToxicOutputConfigs = dispersionToxicOutputConfigs;
|
|
1370
|
+
this.dispersionToxicOutputConfigCount = dispersionToxicOutputConfigCount;
|
|
1371
|
+
this.flammableOutputConfigs = flammableOutputConfigs;
|
|
1372
|
+
this.flammableOutputConfigCount = flammableOutputConfigCount;
|
|
1373
|
+
this.explosionOutputConfigs = explosionOutputConfigs;
|
|
1374
|
+
this.explosionOutputConfigCount = explosionOutputConfigCount;
|
|
1375
|
+
this.explosionConfinedVolumes = explosionConfinedVolumes;
|
|
1376
|
+
this.explosionConfinedVolumeCount = explosionConfinedVolumeCount;
|
|
1377
|
+
}
|
|
1378
|
+
|
|
1379
|
+
async run() {
|
|
1380
|
+
try {
|
|
1381
|
+
const request = new VesselLeakLinkedRunCalculationRequest(
|
|
1382
|
+
this.vessel,
|
|
1383
|
+
this.leak,
|
|
1384
|
+
this.dischargeParameters,
|
|
1385
|
+
this.substrate,
|
|
1386
|
+
this.weather,
|
|
1387
|
+
this.dispersionParameters,
|
|
1388
|
+
this.dispersionParameterCount,
|
|
1389
|
+
this.endPointConcentration,
|
|
1390
|
+
this.flammableParameters,
|
|
1391
|
+
this.explosionParameters,
|
|
1392
|
+
this.dispersionFlamOutputConfigs,
|
|
1393
|
+
this.dispersionFlamOutputConfigCount,
|
|
1394
|
+
this.dispersionToxicOutputConfigs,
|
|
1395
|
+
this.dispersionToxicOutputConfigCount,
|
|
1396
|
+
this.flammableOutputConfigs,
|
|
1397
|
+
this.flammableOutputConfigCount,
|
|
1398
|
+
this.explosionOutputConfigs,
|
|
1399
|
+
this.explosionOutputConfigCount,
|
|
1400
|
+
this.explosionConfinedVolumes,
|
|
1401
|
+
this.explosionConfinedVolumeCount
|
|
1402
|
+
);
|
|
1403
|
+
|
|
1404
|
+
const schema = new VesselLeakLinkedRunCalculationRequestSchema();
|
|
1405
|
+
const validatedRequest = schema.validate(request);
|
|
1406
|
+
|
|
1407
|
+
const requestJson = JSON.stringify(validatedRequest);
|
|
1408
|
+
const url = `${getAnalyticsApiTarget()}vesselleaklinkedrun?clientId=${getClientAliasId()}`;
|
|
1409
|
+
|
|
1410
|
+
this.resultCode = Enums.ResultCode.UNEXPECTED_APPLICATION_ERROR;
|
|
1411
|
+
|
|
1412
|
+
const response = await this.postRequest(url, requestJson);
|
|
1413
|
+
|
|
1414
|
+
if (response.status >= 200 && response.status < 300) {
|
|
1415
|
+
const schema = new VesselLeakLinkedRunCalculationResponseSchema();
|
|
1416
|
+
const validatedResponse = schema.validate(response.data);
|
|
1417
|
+
|
|
1418
|
+
this.resultCode = validatedResponse.resultCode;
|
|
1419
|
+
if (this.resultCode === Enums.ResultCode.SUCCESS) {
|
|
1420
|
+
this.dischargeRecord = validatedResponse.dischargeRecord;
|
|
1421
|
+
this.distancesToJetFireRadiation = validatedResponse.distancesToJetFireRadiation;
|
|
1422
|
+
this.jetContourPoints = validatedResponse.jetContourPoints;
|
|
1423
|
+
this.nJetContourPoints = validatedResponse.nJetContourPoints;
|
|
1424
|
+
this.areaContourJet = validatedResponse.areaContourJet;
|
|
1425
|
+
this.distancesToFlamConcentration = validatedResponse.distancesToFlamConcentration;
|
|
1426
|
+
this.flamConcentrationsUsed = validatedResponse.flamConcentrationsUsed;
|
|
1427
|
+
this.flamConcContourPoints = validatedResponse.flamConcContourPoints;
|
|
1428
|
+
this.nFlamConcContourPoints = validatedResponse.nFlamConcContourPoints;
|
|
1429
|
+
this.areaFootprintFlamConc = validatedResponse.areaFootprintFlamConc;
|
|
1430
|
+
this.distancesToPoolFireRadiation = validatedResponse.distancesToPoolFireRadiation;
|
|
1431
|
+
this.poolContourPoints = validatedResponse.poolContourPoints;
|
|
1432
|
+
this.nPoolContourPoints = validatedResponse.nPoolContourPoints;
|
|
1433
|
+
this.areaContourPool = validatedResponse.areaContourPool;
|
|
1434
|
+
this.explosionOverpressureResults = validatedResponse.explosionOverpressureResults;
|
|
1435
|
+
this.distancesToToxicConcentration = validatedResponse.distancesToToxicConcentration;
|
|
1436
|
+
this.toxicConcentrationUsed = validatedResponse.toxicConcentrationUsed;
|
|
1437
|
+
this.toxicConcContourPoints = validatedResponse.toxicConcContourPoints;
|
|
1438
|
+
this.nToxicConcContourPoints = validatedResponse.nToxicConcContourPoints;
|
|
1439
|
+
this.areaFootprintToxicConc = validatedResponse.areaFootprintToxicConc;
|
|
1440
|
+
this.jetFireFlameResult = validatedResponse.jetFireFlameResult;
|
|
1441
|
+
this.poolFireFlameResult = validatedResponse.poolFireFlameResult;
|
|
1442
|
+
this.resultCode = validatedResponse.resultCode;
|
|
1443
|
+
this.messages = validatedResponse.messages ?? [];
|
|
1444
|
+
this.calculationElapsedTime = validatedResponse.calculationElapsedTime;
|
|
1445
|
+
this.operationId = validatedResponse.operationId;
|
|
1446
|
+
} else {
|
|
1447
|
+
this.messages.push(...(validatedResponse.messages ?? []));
|
|
1448
|
+
}
|
|
1449
|
+
} else {
|
|
1450
|
+
this.handleFailedResponse(response);
|
|
1451
|
+
}
|
|
1452
|
+
} catch (error) {
|
|
1453
|
+
if (error instanceof Error) {
|
|
1454
|
+
this.messages.push(`Error: ${error.message}`);
|
|
1455
|
+
} else {
|
|
1456
|
+
this.messages.push(`Unexpected error: ${JSON.stringify(error)}`);
|
|
1457
|
+
}
|
|
1458
|
+
console.error(error);
|
|
1459
|
+
this.resultCode = Enums.ResultCode.UNEXPECTED_APPLICATION_ERROR;
|
|
1460
|
+
}
|
|
1461
|
+
|
|
1462
|
+
return this.resultCode;
|
|
1463
|
+
}
|
|
1464
|
+
|
|
1465
|
+
toString() {
|
|
1466
|
+
const parts = ["* VesselLeakLinkedRun"];
|
|
1467
|
+
|
|
1468
|
+
parts.push(`dischargeRecord: ${String(this.dischargeRecord)}`);
|
|
1469
|
+
parts.push("*** distancesToJetFireRadiation:");
|
|
1470
|
+
parts.push(
|
|
1471
|
+
this.distancesToJetFireRadiation && this.distancesToJetFireRadiation.length > 0
|
|
1472
|
+
? this.distancesToJetFireRadiation.map((point) => `distancesToJetFireRadiationElement: ${point}`).join("\n")
|
|
1473
|
+
: "distancesToJetFireRadiation does not contain any elements"
|
|
1474
|
+
);
|
|
1475
|
+
parts.push("*** jetContourPoints:");
|
|
1476
|
+
parts.push(
|
|
1477
|
+
this.jetContourPoints && this.jetContourPoints.length > 0
|
|
1478
|
+
? this.jetContourPoints.map((point) => `jetContourPointsElement: ${point}`).join("\n")
|
|
1479
|
+
: "jetContourPoints does not contain any elements"
|
|
1480
|
+
);
|
|
1481
|
+
parts.push("*** nJetContourPoints:");
|
|
1482
|
+
parts.push(
|
|
1483
|
+
this.nJetContourPoints && this.nJetContourPoints.length > 0
|
|
1484
|
+
? this.nJetContourPoints.map((point) => `nJetContourPointsElement: ${point}`).join("\n")
|
|
1485
|
+
: "nJetContourPoints does not contain any elements"
|
|
1486
|
+
);
|
|
1487
|
+
parts.push("*** areaContourJet:");
|
|
1488
|
+
parts.push(
|
|
1489
|
+
this.areaContourJet && this.areaContourJet.length > 0
|
|
1490
|
+
? this.areaContourJet.map((point) => `areaContourJetElement: ${point}`).join("\n")
|
|
1491
|
+
: "areaContourJet does not contain any elements"
|
|
1492
|
+
);
|
|
1493
|
+
parts.push("*** distancesToFlamConcentration:");
|
|
1494
|
+
parts.push(
|
|
1495
|
+
this.distancesToFlamConcentration && this.distancesToFlamConcentration.length > 0
|
|
1496
|
+
? this.distancesToFlamConcentration.map((point) => `distancesToFlamConcentrationElement: ${point}`).join("\n")
|
|
1497
|
+
: "distancesToFlamConcentration does not contain any elements"
|
|
1498
|
+
);
|
|
1499
|
+
parts.push("*** flamConcentrationsUsed:");
|
|
1500
|
+
parts.push(
|
|
1501
|
+
this.flamConcentrationsUsed && this.flamConcentrationsUsed.length > 0
|
|
1502
|
+
? this.flamConcentrationsUsed.map((point) => `flamConcentrationsUsedElement: ${point}`).join("\n")
|
|
1503
|
+
: "flamConcentrationsUsed does not contain any elements"
|
|
1504
|
+
);
|
|
1505
|
+
parts.push("*** flamConcContourPoints:");
|
|
1506
|
+
parts.push(
|
|
1507
|
+
this.flamConcContourPoints && this.flamConcContourPoints.length > 0
|
|
1508
|
+
? this.flamConcContourPoints.map((point) => `flamConcContourPointsElement: ${point}`).join("\n")
|
|
1509
|
+
: "flamConcContourPoints does not contain any elements"
|
|
1510
|
+
);
|
|
1511
|
+
parts.push("*** nFlamConcContourPoints:");
|
|
1512
|
+
parts.push(
|
|
1513
|
+
this.nFlamConcContourPoints && this.nFlamConcContourPoints.length > 0
|
|
1514
|
+
? this.nFlamConcContourPoints.map((point) => `nFlamConcContourPointsElement: ${point}`).join("\n")
|
|
1515
|
+
: "nFlamConcContourPoints does not contain any elements"
|
|
1516
|
+
);
|
|
1517
|
+
parts.push("*** areaFootprintFlamConc:");
|
|
1518
|
+
parts.push(
|
|
1519
|
+
this.areaFootprintFlamConc && this.areaFootprintFlamConc.length > 0
|
|
1520
|
+
? this.areaFootprintFlamConc.map((point) => `areaFootprintFlamConcElement: ${point}`).join("\n")
|
|
1521
|
+
: "areaFootprintFlamConc does not contain any elements"
|
|
1522
|
+
);
|
|
1523
|
+
parts.push("*** distancesToPoolFireRadiation:");
|
|
1524
|
+
parts.push(
|
|
1525
|
+
this.distancesToPoolFireRadiation && this.distancesToPoolFireRadiation.length > 0
|
|
1526
|
+
? this.distancesToPoolFireRadiation.map((point) => `distancesToPoolFireRadiationElement: ${point}`).join("\n")
|
|
1527
|
+
: "distancesToPoolFireRadiation does not contain any elements"
|
|
1528
|
+
);
|
|
1529
|
+
parts.push("*** poolContourPoints:");
|
|
1530
|
+
parts.push(
|
|
1531
|
+
this.poolContourPoints && this.poolContourPoints.length > 0
|
|
1532
|
+
? this.poolContourPoints.map((point) => `poolContourPointsElement: ${point}`).join("\n")
|
|
1533
|
+
: "poolContourPoints does not contain any elements"
|
|
1534
|
+
);
|
|
1535
|
+
parts.push("*** nPoolContourPoints:");
|
|
1536
|
+
parts.push(
|
|
1537
|
+
this.nPoolContourPoints && this.nPoolContourPoints.length > 0
|
|
1538
|
+
? this.nPoolContourPoints.map((point) => `nPoolContourPointsElement: ${point}`).join("\n")
|
|
1539
|
+
: "nPoolContourPoints does not contain any elements"
|
|
1540
|
+
);
|
|
1541
|
+
parts.push("*** areaContourPool:");
|
|
1542
|
+
parts.push(
|
|
1543
|
+
this.areaContourPool && this.areaContourPool.length > 0
|
|
1544
|
+
? this.areaContourPool.map((point) => `areaContourPoolElement: ${point}`).join("\n")
|
|
1545
|
+
: "areaContourPool does not contain any elements"
|
|
1546
|
+
);
|
|
1547
|
+
parts.push("*** explosionOverpressureResults:");
|
|
1548
|
+
parts.push(
|
|
1549
|
+
this.explosionOverpressureResults && this.explosionOverpressureResults.length > 0
|
|
1550
|
+
? this.explosionOverpressureResults.map((point) => `explosionOverpressureResultsElement: ${point}`).join("\n")
|
|
1551
|
+
: "explosionOverpressureResults does not contain any elements"
|
|
1552
|
+
);
|
|
1553
|
+
parts.push("*** distancesToToxicConcentration:");
|
|
1554
|
+
parts.push(
|
|
1555
|
+
this.distancesToToxicConcentration && this.distancesToToxicConcentration.length > 0
|
|
1556
|
+
? this.distancesToToxicConcentration.map((point) => `distancesToToxicConcentrationElement: ${point}`).join("\n")
|
|
1557
|
+
: "distancesToToxicConcentration does not contain any elements"
|
|
1558
|
+
);
|
|
1559
|
+
parts.push("*** toxicConcentrationUsed:");
|
|
1560
|
+
parts.push(
|
|
1561
|
+
this.toxicConcentrationUsed && this.toxicConcentrationUsed.length > 0
|
|
1562
|
+
? this.toxicConcentrationUsed.map((point) => `toxicConcentrationUsedElement: ${point}`).join("\n")
|
|
1563
|
+
: "toxicConcentrationUsed does not contain any elements"
|
|
1564
|
+
);
|
|
1565
|
+
parts.push("*** toxicConcContourPoints:");
|
|
1566
|
+
parts.push(
|
|
1567
|
+
this.toxicConcContourPoints && this.toxicConcContourPoints.length > 0
|
|
1568
|
+
? this.toxicConcContourPoints.map((point) => `toxicConcContourPointsElement: ${point}`).join("\n")
|
|
1569
|
+
: "toxicConcContourPoints does not contain any elements"
|
|
1570
|
+
);
|
|
1571
|
+
parts.push("*** nToxicConcContourPoints:");
|
|
1572
|
+
parts.push(
|
|
1573
|
+
this.nToxicConcContourPoints && this.nToxicConcContourPoints.length > 0
|
|
1574
|
+
? this.nToxicConcContourPoints.map((point) => `nToxicConcContourPointsElement: ${point}`).join("\n")
|
|
1575
|
+
: "nToxicConcContourPoints does not contain any elements"
|
|
1576
|
+
);
|
|
1577
|
+
parts.push("*** areaFootprintToxicConc:");
|
|
1578
|
+
parts.push(
|
|
1579
|
+
this.areaFootprintToxicConc && this.areaFootprintToxicConc.length > 0
|
|
1580
|
+
? this.areaFootprintToxicConc.map((point) => `areaFootprintToxicConcElement: ${point}`).join("\n")
|
|
1581
|
+
: "areaFootprintToxicConc does not contain any elements"
|
|
1582
|
+
);
|
|
1583
|
+
parts.push(`jetFireFlameResult: ${String(this.jetFireFlameResult)}`);
|
|
1584
|
+
parts.push(`poolFireFlameResult: ${String(this.poolFireFlameResult)}`);
|
|
1585
|
+
parts.push(`resultCode: ${String(this.resultCode)}`);
|
|
1586
|
+
parts.push("*** messages:");
|
|
1587
|
+
parts.push(`messages: ${this.messages !== undefined ? this.messages : "(None)"}`);
|
|
1588
|
+
parts.push(`calculationElapsedTime: ${this.calculationElapsedTime !== undefined ? this.calculationElapsedTime : "(None)"}`);
|
|
1589
|
+
parts.push(`operationId: ${this.operationId !== undefined ? this.operationId : "(None)"}`);
|
|
1590
|
+
|
|
1591
|
+
return parts.join("\n");
|
|
1592
|
+
}
|
|
1593
|
+
}
|
|
1594
|
+
|
|
1595
|
+
export class VesselLeakLinkedRunCalculationResponse extends CalculationResponseBase {
|
|
1596
|
+
dischargeRecord: Entities.DischargeRecord;
|
|
1597
|
+
distancesToJetFireRadiation: number[];
|
|
1598
|
+
jetContourPoints: Entities.LocalPosition[];
|
|
1599
|
+
nJetContourPoints: number[];
|
|
1600
|
+
areaContourJet: number[];
|
|
1601
|
+
distancesToFlamConcentration: number[];
|
|
1602
|
+
flamConcentrationsUsed: number[];
|
|
1603
|
+
flamConcContourPoints: Entities.LocalPosition[];
|
|
1604
|
+
nFlamConcContourPoints: number[];
|
|
1605
|
+
areaFootprintFlamConc: number[];
|
|
1606
|
+
distancesToPoolFireRadiation: number[];
|
|
1607
|
+
poolContourPoints: Entities.LocalPosition[];
|
|
1608
|
+
nPoolContourPoints: number[];
|
|
1609
|
+
areaContourPool: number[];
|
|
1610
|
+
explosionOverpressureResults: Entities.ExplosionOverpressureResult[];
|
|
1611
|
+
distancesToToxicConcentration: number[];
|
|
1612
|
+
toxicConcentrationUsed: number[];
|
|
1613
|
+
toxicConcContourPoints: Entities.LocalPosition[];
|
|
1614
|
+
nToxicConcContourPoints: number[];
|
|
1615
|
+
areaFootprintToxicConc: number[];
|
|
1616
|
+
jetFireFlameResult: Entities.FlameResult;
|
|
1617
|
+
poolFireFlameResult: Entities.PoolFireFlameResult;
|
|
1618
|
+
|
|
1619
|
+
/**
|
|
1620
|
+
* VesselLeakLinkedRun calculation response class.
|
|
1621
|
+
*
|
|
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
|
+
*/
|
|
1645
|
+
constructor(
|
|
1646
|
+
dischargeRecord: Entities.DischargeRecord,
|
|
1647
|
+
distancesToJetFireRadiation: number[],
|
|
1648
|
+
jetContourPoints: Entities.LocalPosition[],
|
|
1649
|
+
nJetContourPoints: number[],
|
|
1650
|
+
areaContourJet: number[],
|
|
1651
|
+
distancesToFlamConcentration: number[],
|
|
1652
|
+
flamConcentrationsUsed: number[],
|
|
1653
|
+
flamConcContourPoints: Entities.LocalPosition[],
|
|
1654
|
+
nFlamConcContourPoints: number[],
|
|
1655
|
+
areaFootprintFlamConc: number[],
|
|
1656
|
+
distancesToPoolFireRadiation: number[],
|
|
1657
|
+
poolContourPoints: Entities.LocalPosition[],
|
|
1658
|
+
nPoolContourPoints: number[],
|
|
1659
|
+
areaContourPool: number[],
|
|
1660
|
+
explosionOverpressureResults: Entities.ExplosionOverpressureResult[],
|
|
1661
|
+
distancesToToxicConcentration: number[],
|
|
1662
|
+
toxicConcentrationUsed: number[],
|
|
1663
|
+
toxicConcContourPoints: Entities.LocalPosition[],
|
|
1664
|
+
nToxicConcContourPoints: number[],
|
|
1665
|
+
areaFootprintToxicConc: number[],
|
|
1666
|
+
jetFireFlameResult: Entities.FlameResult,
|
|
1667
|
+
poolFireFlameResult: Entities.PoolFireFlameResult,
|
|
1668
|
+
resultCode: Enums.ResultCode,
|
|
1669
|
+
messages: string[],
|
|
1670
|
+
calculationElapsedTime: number,
|
|
1671
|
+
operationId: string
|
|
1672
|
+
) {
|
|
1673
|
+
super();
|
|
1674
|
+
this.dischargeRecord = dischargeRecord;
|
|
1675
|
+
this.distancesToJetFireRadiation = distancesToJetFireRadiation;
|
|
1676
|
+
this.jetContourPoints = jetContourPoints;
|
|
1677
|
+
this.nJetContourPoints = nJetContourPoints;
|
|
1678
|
+
this.areaContourJet = areaContourJet;
|
|
1679
|
+
this.distancesToFlamConcentration = distancesToFlamConcentration;
|
|
1680
|
+
this.flamConcentrationsUsed = flamConcentrationsUsed;
|
|
1681
|
+
this.flamConcContourPoints = flamConcContourPoints;
|
|
1682
|
+
this.nFlamConcContourPoints = nFlamConcContourPoints;
|
|
1683
|
+
this.areaFootprintFlamConc = areaFootprintFlamConc;
|
|
1684
|
+
this.distancesToPoolFireRadiation = distancesToPoolFireRadiation;
|
|
1685
|
+
this.poolContourPoints = poolContourPoints;
|
|
1686
|
+
this.nPoolContourPoints = nPoolContourPoints;
|
|
1687
|
+
this.areaContourPool = areaContourPool;
|
|
1688
|
+
this.explosionOverpressureResults = explosionOverpressureResults;
|
|
1689
|
+
this.distancesToToxicConcentration = distancesToToxicConcentration;
|
|
1690
|
+
this.toxicConcentrationUsed = toxicConcentrationUsed;
|
|
1691
|
+
this.toxicConcContourPoints = toxicConcContourPoints;
|
|
1692
|
+
this.nToxicConcContourPoints = nToxicConcContourPoints;
|
|
1693
|
+
this.areaFootprintToxicConc = areaFootprintToxicConc;
|
|
1694
|
+
this.jetFireFlameResult = jetFireFlameResult;
|
|
1695
|
+
this.poolFireFlameResult = poolFireFlameResult;
|
|
1696
|
+
this.resultCode = resultCode;
|
|
1697
|
+
this.messages = messages;
|
|
1698
|
+
this.calculationElapsedTime = calculationElapsedTime;
|
|
1699
|
+
this.operationId = operationId;
|
|
1700
|
+
}
|
|
1701
|
+
|
|
1702
|
+
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
|
+
if (data.distancesToJetFireRadiation && Array.isArray(data.distancesToJetFireRadiation)) {
|
|
1708
|
+
this.distancesToJetFireRadiation = data.distancesToJetFireRadiation.map((item) => parseFloat(item));
|
|
1709
|
+
}
|
|
1710
|
+
if (data.jetContourPoints && Array.isArray(data.jetContourPoints)) {
|
|
1711
|
+
this.jetContourPoints = data.jetContourPoints.map(
|
|
1712
|
+
(item) => {
|
|
1713
|
+
const record = new Entities.LocalPosition();
|
|
1714
|
+
record.initialiseFromDictionary(item);
|
|
1715
|
+
return record;
|
|
1716
|
+
}
|
|
1717
|
+
);
|
|
1718
|
+
}
|
|
1719
|
+
if (data.nJetContourPoints && Array.isArray(data.nJetContourPoints)) {
|
|
1720
|
+
this.nJetContourPoints = data.nJetContourPoints.map((item) => parseInt(item));
|
|
1721
|
+
}
|
|
1722
|
+
if (data.areaContourJet && Array.isArray(data.areaContourJet)) {
|
|
1723
|
+
this.areaContourJet = data.areaContourJet.map((item) => parseFloat(item));
|
|
1724
|
+
}
|
|
1725
|
+
if (data.distancesToFlamConcentration && Array.isArray(data.distancesToFlamConcentration)) {
|
|
1726
|
+
this.distancesToFlamConcentration = data.distancesToFlamConcentration.map((item) => parseFloat(item));
|
|
1727
|
+
}
|
|
1728
|
+
if (data.flamConcentrationsUsed && Array.isArray(data.flamConcentrationsUsed)) {
|
|
1729
|
+
this.flamConcentrationsUsed = data.flamConcentrationsUsed.map((item) => parseFloat(item));
|
|
1730
|
+
}
|
|
1731
|
+
if (data.flamConcContourPoints && Array.isArray(data.flamConcContourPoints)) {
|
|
1732
|
+
this.flamConcContourPoints = data.flamConcContourPoints.map(
|
|
1733
|
+
(item) => {
|
|
1734
|
+
const record = new Entities.LocalPosition();
|
|
1735
|
+
record.initialiseFromDictionary(item);
|
|
1736
|
+
return record;
|
|
1737
|
+
}
|
|
1738
|
+
);
|
|
1739
|
+
}
|
|
1740
|
+
if (data.nFlamConcContourPoints && Array.isArray(data.nFlamConcContourPoints)) {
|
|
1741
|
+
this.nFlamConcContourPoints = data.nFlamConcContourPoints.map((item) => parseInt(item));
|
|
1742
|
+
}
|
|
1743
|
+
if (data.areaFootprintFlamConc && Array.isArray(data.areaFootprintFlamConc)) {
|
|
1744
|
+
this.areaFootprintFlamConc = data.areaFootprintFlamConc.map((item) => parseFloat(item));
|
|
1745
|
+
}
|
|
1746
|
+
if (data.distancesToPoolFireRadiation && Array.isArray(data.distancesToPoolFireRadiation)) {
|
|
1747
|
+
this.distancesToPoolFireRadiation = data.distancesToPoolFireRadiation.map((item) => parseFloat(item));
|
|
1748
|
+
}
|
|
1749
|
+
if (data.poolContourPoints && Array.isArray(data.poolContourPoints)) {
|
|
1750
|
+
this.poolContourPoints = data.poolContourPoints.map(
|
|
1751
|
+
(item) => {
|
|
1752
|
+
const record = new Entities.LocalPosition();
|
|
1753
|
+
record.initialiseFromDictionary(item);
|
|
1754
|
+
return record;
|
|
1755
|
+
}
|
|
1756
|
+
);
|
|
1757
|
+
}
|
|
1758
|
+
if (data.nPoolContourPoints && Array.isArray(data.nPoolContourPoints)) {
|
|
1759
|
+
this.nPoolContourPoints = data.nPoolContourPoints.map((item) => parseInt(item));
|
|
1760
|
+
}
|
|
1761
|
+
if (data.areaContourPool && Array.isArray(data.areaContourPool)) {
|
|
1762
|
+
this.areaContourPool = data.areaContourPool.map((item) => parseFloat(item));
|
|
1763
|
+
}
|
|
1764
|
+
if (data.explosionOverpressureResults && Array.isArray(data.explosionOverpressureResults)) {
|
|
1765
|
+
this.explosionOverpressureResults = data.explosionOverpressureResults.map(
|
|
1766
|
+
(item) => {
|
|
1767
|
+
const record = new Entities.ExplosionOverpressureResult();
|
|
1768
|
+
record.initialiseFromDictionary(item);
|
|
1769
|
+
return record;
|
|
1770
|
+
}
|
|
1771
|
+
);
|
|
1772
|
+
}
|
|
1773
|
+
if (data.distancesToToxicConcentration && Array.isArray(data.distancesToToxicConcentration)) {
|
|
1774
|
+
this.distancesToToxicConcentration = data.distancesToToxicConcentration.map((item) => parseFloat(item));
|
|
1775
|
+
}
|
|
1776
|
+
if (data.toxicConcentrationUsed && Array.isArray(data.toxicConcentrationUsed)) {
|
|
1777
|
+
this.toxicConcentrationUsed = data.toxicConcentrationUsed.map((item) => parseFloat(item));
|
|
1778
|
+
}
|
|
1779
|
+
if (data.toxicConcContourPoints && Array.isArray(data.toxicConcContourPoints)) {
|
|
1780
|
+
this.toxicConcContourPoints = data.toxicConcContourPoints.map(
|
|
1781
|
+
(item) => {
|
|
1782
|
+
const record = new Entities.LocalPosition();
|
|
1783
|
+
record.initialiseFromDictionary(item);
|
|
1784
|
+
return record;
|
|
1785
|
+
}
|
|
1786
|
+
);
|
|
1787
|
+
}
|
|
1788
|
+
if (data.nToxicConcContourPoints && Array.isArray(data.nToxicConcContourPoints)) {
|
|
1789
|
+
this.nToxicConcContourPoints = data.nToxicConcContourPoints.map((item) => parseInt(item));
|
|
1790
|
+
}
|
|
1791
|
+
if (data.areaFootprintToxicConc && Array.isArray(data.areaFootprintToxicConc)) {
|
|
1792
|
+
this.areaFootprintToxicConc = data.areaFootprintToxicConc.map((item) => parseFloat(item));
|
|
1793
|
+
}
|
|
1794
|
+
if (data.jetFireFlameResult) {
|
|
1795
|
+
this.jetFireFlameResult = new Entities.FlameResult();
|
|
1796
|
+
this.jetFireFlameResult.initialiseFromDictionary(data.jetFireFlameResult as { [key: string]: unknown });
|
|
1797
|
+
}
|
|
1798
|
+
if (data.poolFireFlameResult) {
|
|
1799
|
+
this.poolFireFlameResult = new Entities.PoolFireFlameResult();
|
|
1800
|
+
this.poolFireFlameResult.initialiseFromDictionary(data.poolFireFlameResult as { [key: string]: unknown });
|
|
1801
|
+
}
|
|
1802
|
+
if (data.resultCode !== undefined && (typeof data.resultCode === "string" || typeof data.resultCode === "number")) {
|
|
1803
|
+
this.resultCode = data.resultCode as Enums.ResultCode;
|
|
1804
|
+
}
|
|
1805
|
+
this.messages = this.messages ?? [];
|
|
1806
|
+
if (data.messages && Array.isArray(data.messages)) {
|
|
1807
|
+
this.messages.push(...data.messages);
|
|
1808
|
+
}
|
|
1809
|
+
if (data.calculationElapsedTime !== undefined && typeof data.calculationElapsedTime === "number") {
|
|
1810
|
+
this.calculationElapsedTime = data.calculationElapsedTime as number;
|
|
1811
|
+
}
|
|
1812
|
+
if (data.operationId !== undefined && typeof data.operationId === "string") {
|
|
1813
|
+
this.operationId = data.operationId as string;
|
|
1814
|
+
}
|
|
1815
|
+
}
|
|
1816
|
+
}
|
|
1817
|
+
|
|
1818
|
+
export interface VesselLeakLinkedRunCalculationResponseSchemaData {
|
|
1819
|
+
dischargeRecord: Entities.DischargeRecord;
|
|
1820
|
+
distancesToJetFireRadiation: number[];
|
|
1821
|
+
jetContourPoints: Entities.LocalPosition[];
|
|
1822
|
+
nJetContourPoints: number[];
|
|
1823
|
+
areaContourJet: number[];
|
|
1824
|
+
distancesToFlamConcentration: number[];
|
|
1825
|
+
flamConcentrationsUsed: number[];
|
|
1826
|
+
flamConcContourPoints: Entities.LocalPosition[];
|
|
1827
|
+
nFlamConcContourPoints: number[];
|
|
1828
|
+
areaFootprintFlamConc: number[];
|
|
1829
|
+
distancesToPoolFireRadiation: number[];
|
|
1830
|
+
poolContourPoints: Entities.LocalPosition[];
|
|
1831
|
+
nPoolContourPoints: number[];
|
|
1832
|
+
areaContourPool: number[];
|
|
1833
|
+
explosionOverpressureResults: Entities.ExplosionOverpressureResult[];
|
|
1834
|
+
distancesToToxicConcentration: number[];
|
|
1835
|
+
toxicConcentrationUsed: number[];
|
|
1836
|
+
toxicConcContourPoints: Entities.LocalPosition[];
|
|
1837
|
+
nToxicConcContourPoints: number[];
|
|
1838
|
+
areaFootprintToxicConc: number[];
|
|
1839
|
+
jetFireFlameResult: Entities.FlameResult;
|
|
1840
|
+
poolFireFlameResult: Entities.PoolFireFlameResult;
|
|
1841
|
+
resultCode: Enums.ResultCode;
|
|
1842
|
+
messages: string[];
|
|
1843
|
+
calculationElapsedTime: number;
|
|
1844
|
+
operationId: string;
|
|
1845
|
+
}
|
|
1846
|
+
|
|
1847
|
+
export class VesselLeakLinkedRunCalculationResponseSchema {
|
|
1848
|
+
schema: Joi.ObjectSchema;
|
|
1849
|
+
propertyTypes: Record<string, string>;
|
|
1850
|
+
|
|
1851
|
+
/**
|
|
1852
|
+
* Schema for the VesselLeakLinkedRun calculation response.
|
|
1853
|
+
*/
|
|
1854
|
+
constructor() {
|
|
1855
|
+
this.schema = Joi.object({
|
|
1856
|
+
dischargeRecord: new EntitySchemas.DischargeRecordSchema().schema,
|
|
1857
|
+
distancesToJetFireRadiation: Joi.array().items(Joi.number().unsafe()).allow(null),
|
|
1858
|
+
jetContourPoints: Joi.array().items(new EntitySchemas.LocalPositionSchema().schema).allow(null),
|
|
1859
|
+
nJetContourPoints: Joi.array().items(Joi.number().integer()).allow(null),
|
|
1860
|
+
areaContourJet: Joi.array().items(Joi.number().unsafe()).allow(null),
|
|
1861
|
+
distancesToFlamConcentration: Joi.array().items(Joi.number().unsafe()).allow(null),
|
|
1862
|
+
flamConcentrationsUsed: Joi.array().items(Joi.number().unsafe()).allow(null),
|
|
1863
|
+
flamConcContourPoints: Joi.array().items(new EntitySchemas.LocalPositionSchema().schema).allow(null),
|
|
1864
|
+
nFlamConcContourPoints: Joi.array().items(Joi.number().integer()).allow(null),
|
|
1865
|
+
areaFootprintFlamConc: Joi.array().items(Joi.number().unsafe()).allow(null),
|
|
1866
|
+
distancesToPoolFireRadiation: Joi.array().items(Joi.number().unsafe()).allow(null),
|
|
1867
|
+
poolContourPoints: Joi.array().items(new EntitySchemas.LocalPositionSchema().schema).allow(null),
|
|
1868
|
+
nPoolContourPoints: Joi.array().items(Joi.number().integer()).allow(null),
|
|
1869
|
+
areaContourPool: Joi.array().items(Joi.number().unsafe()).allow(null),
|
|
1870
|
+
explosionOverpressureResults: Joi.array().items(new EntitySchemas.ExplosionOverpressureResultSchema().schema).allow(null),
|
|
1871
|
+
distancesToToxicConcentration: Joi.array().items(Joi.number().unsafe()).allow(null),
|
|
1872
|
+
toxicConcentrationUsed: Joi.array().items(Joi.number().unsafe()).allow(null),
|
|
1873
|
+
toxicConcContourPoints: Joi.array().items(new EntitySchemas.LocalPositionSchema().schema).allow(null),
|
|
1874
|
+
nToxicConcContourPoints: Joi.array().items(Joi.number().integer()).allow(null),
|
|
1875
|
+
areaFootprintToxicConc: Joi.array().items(Joi.number().unsafe()).allow(null),
|
|
1876
|
+
jetFireFlameResult: new EntitySchemas.FlameResultSchema().schema,
|
|
1877
|
+
poolFireFlameResult: new EntitySchemas.PoolFireFlameResultSchema().schema,
|
|
1878
|
+
resultCode: Joi.string().valid(...Object.values(Enums.ResultCode)),
|
|
1879
|
+
messages: Joi.array().items(Joi.string()),
|
|
1880
|
+
calculationElapsedTime: Joi.number().unsafe(),
|
|
1881
|
+
operationId: Joi.string().uuid().allow(null),
|
|
1882
|
+
}).unknown(true);
|
|
1883
|
+
|
|
1884
|
+
this.propertyTypes = {
|
|
1885
|
+
dischargeRecord: "Entities.DischargeRecord",
|
|
1886
|
+
distancesToJetFireRadiation: "number[]",
|
|
1887
|
+
jetContourPoints: "Entities.LocalPosition[]",
|
|
1888
|
+
nJetContourPoints: "number[]",
|
|
1889
|
+
areaContourJet: "number[]",
|
|
1890
|
+
distancesToFlamConcentration: "number[]",
|
|
1891
|
+
flamConcentrationsUsed: "number[]",
|
|
1892
|
+
flamConcContourPoints: "Entities.LocalPosition[]",
|
|
1893
|
+
nFlamConcContourPoints: "number[]",
|
|
1894
|
+
areaFootprintFlamConc: "number[]",
|
|
1895
|
+
distancesToPoolFireRadiation: "number[]",
|
|
1896
|
+
poolContourPoints: "Entities.LocalPosition[]",
|
|
1897
|
+
nPoolContourPoints: "number[]",
|
|
1898
|
+
areaContourPool: "number[]",
|
|
1899
|
+
explosionOverpressureResults: "Entities.ExplosionOverpressureResult[]",
|
|
1900
|
+
distancesToToxicConcentration: "number[]",
|
|
1901
|
+
toxicConcentrationUsed: "number[]",
|
|
1902
|
+
toxicConcContourPoints: "Entities.LocalPosition[]",
|
|
1903
|
+
nToxicConcContourPoints: "number[]",
|
|
1904
|
+
areaFootprintToxicConc: "number[]",
|
|
1905
|
+
jetFireFlameResult: "Entities.FlameResult",
|
|
1906
|
+
poolFireFlameResult: "Entities.PoolFireFlameResult",
|
|
1907
|
+
};
|
|
1908
|
+
}
|
|
1909
|
+
|
|
1910
|
+
validate(data: VesselLeakLinkedRunCalculationResponseSchemaData): VesselLeakLinkedRunCalculationResponse {
|
|
1911
|
+
const { error, value } = this.schema.validate(data, { abortEarly: false });
|
|
1912
|
+
if (error) {
|
|
1913
|
+
throw new Error(`Validation error: ${error.details.map((x) => x.message).join(", ")}`);
|
|
1914
|
+
}
|
|
1915
|
+
return this.makeCalculationResponse(value);
|
|
1916
|
+
}
|
|
1917
|
+
|
|
1918
|
+
makeCalculationResponse(data: VesselLeakLinkedRunCalculationResponseSchemaData): VesselLeakLinkedRunCalculationResponse {
|
|
1919
|
+
return new VesselLeakLinkedRunCalculationResponse(
|
|
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
|
+
);
|
|
1947
|
+
}
|
|
1948
|
+
}
|
|
1949
|
+
|
|
1950
|
+
export interface VesselLineRuptureLinkedRunCalculationRequestSchemaData {
|
|
1951
|
+
vessel: Entities.Vessel;
|
|
1952
|
+
lineRupture: Entities.LineRupture;
|
|
1953
|
+
dischargeParameters: Entities.DischargeParameters;
|
|
1954
|
+
substrate: Entities.Substrate;
|
|
1955
|
+
weather: Entities.Weather;
|
|
1956
|
+
dispersionParameters: Entities.DispersionParameters[];
|
|
1957
|
+
dispersionParameterCount: number;
|
|
1958
|
+
endPointConcentration: number;
|
|
1959
|
+
flammableParameters: Entities.FlammableParameters;
|
|
1960
|
+
explosionParameters: Entities.ExplosionParameters;
|
|
1961
|
+
dispersionFlamOutputConfigs: Entities.DispersionOutputConfig[];
|
|
1962
|
+
dispersionFlamOutputConfigCount: number;
|
|
1963
|
+
dispersionToxicOutputConfigs: Entities.DispersionOutputConfig[];
|
|
1964
|
+
dispersionToxicOutputConfigCount: number;
|
|
1965
|
+
flammableOutputConfigs: Entities.FlammableOutputConfig[];
|
|
1966
|
+
flammableOutputConfigCount: number;
|
|
1967
|
+
explosionOutputConfigs: Entities.ExplosionOutputConfig[];
|
|
1968
|
+
explosionOutputConfigCount: number;
|
|
1969
|
+
explosionConfinedVolumes: Entities.ExplosionConfinedVolume[];
|
|
1970
|
+
explosionConfinedVolumeCount: number;
|
|
1971
|
+
}
|
|
1972
|
+
|
|
1973
|
+
class VesselLineRuptureLinkedRunCalculationRequest extends CalculationRequestBase {
|
|
1974
|
+
vessel: Entities.Vessel;
|
|
1975
|
+
lineRupture: Entities.LineRupture;
|
|
1976
|
+
dischargeParameters: Entities.DischargeParameters;
|
|
1977
|
+
substrate: Entities.Substrate;
|
|
1978
|
+
weather: Entities.Weather;
|
|
1979
|
+
dispersionParameters: Entities.DispersionParameters[];
|
|
1980
|
+
dispersionParameterCount: number;
|
|
1981
|
+
endPointConcentration: number;
|
|
1982
|
+
flammableParameters: Entities.FlammableParameters;
|
|
1983
|
+
explosionParameters: Entities.ExplosionParameters;
|
|
1984
|
+
dispersionFlamOutputConfigs: Entities.DispersionOutputConfig[];
|
|
1985
|
+
dispersionFlamOutputConfigCount: number;
|
|
1986
|
+
dispersionToxicOutputConfigs: Entities.DispersionOutputConfig[];
|
|
1987
|
+
dispersionToxicOutputConfigCount: number;
|
|
1988
|
+
flammableOutputConfigs: Entities.FlammableOutputConfig[];
|
|
1989
|
+
flammableOutputConfigCount: number;
|
|
1990
|
+
explosionOutputConfigs: Entities.ExplosionOutputConfig[];
|
|
1991
|
+
explosionOutputConfigCount: number;
|
|
1992
|
+
explosionConfinedVolumes: Entities.ExplosionConfinedVolume[];
|
|
1993
|
+
explosionConfinedVolumeCount: number;
|
|
1994
|
+
|
|
1995
|
+
/**
|
|
1996
|
+
* VesselLineRuptureLinkedRun calculation request class.
|
|
1997
|
+
*
|
|
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
|
+
*/
|
|
2019
|
+
constructor(
|
|
2020
|
+
vessel: Entities.Vessel,
|
|
2021
|
+
lineRupture: Entities.LineRupture,
|
|
2022
|
+
dischargeParameters: Entities.DischargeParameters,
|
|
2023
|
+
substrate: Entities.Substrate,
|
|
2024
|
+
weather: Entities.Weather,
|
|
2025
|
+
dispersionParameters: Entities.DispersionParameters[],
|
|
2026
|
+
dispersionParameterCount: number,
|
|
2027
|
+
endPointConcentration: number,
|
|
2028
|
+
flammableParameters: Entities.FlammableParameters,
|
|
2029
|
+
explosionParameters: Entities.ExplosionParameters,
|
|
2030
|
+
dispersionFlamOutputConfigs: Entities.DispersionOutputConfig[],
|
|
2031
|
+
dispersionFlamOutputConfigCount: number,
|
|
2032
|
+
dispersionToxicOutputConfigs: Entities.DispersionOutputConfig[],
|
|
2033
|
+
dispersionToxicOutputConfigCount: number,
|
|
2034
|
+
flammableOutputConfigs: Entities.FlammableOutputConfig[],
|
|
2035
|
+
flammableOutputConfigCount: number,
|
|
2036
|
+
explosionOutputConfigs: Entities.ExplosionOutputConfig[],
|
|
2037
|
+
explosionOutputConfigCount: number,
|
|
2038
|
+
explosionConfinedVolumes: Entities.ExplosionConfinedVolume[],
|
|
2039
|
+
explosionConfinedVolumeCount: number
|
|
2040
|
+
) {
|
|
2041
|
+
super();
|
|
2042
|
+
this.vessel = vessel;
|
|
2043
|
+
this.lineRupture = lineRupture;
|
|
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;
|
|
2062
|
+
}
|
|
2063
|
+
}
|
|
2064
|
+
|
|
2065
|
+
export class VesselLineRuptureLinkedRunCalculationRequestSchema {
|
|
2066
|
+
schema: Joi.ObjectSchema;
|
|
2067
|
+
propertyTypes: Record<string, string>;
|
|
2068
|
+
|
|
2069
|
+
/**
|
|
2070
|
+
* Schema for the VesselLineRuptureLinkedRun calculation request.
|
|
2071
|
+
*/
|
|
2072
|
+
constructor() {
|
|
2073
|
+
this.schema = Joi.object({
|
|
2074
|
+
vessel: new EntitySchemas.VesselSchema().schema,
|
|
2075
|
+
lineRupture: new EntitySchemas.LineRuptureSchema().schema,
|
|
2076
|
+
dischargeParameters: new EntitySchemas.DischargeParametersSchema().schema,
|
|
2077
|
+
substrate: new EntitySchemas.SubstrateSchema().schema,
|
|
2078
|
+
weather: new EntitySchemas.WeatherSchema().schema,
|
|
2079
|
+
dispersionParameters: Joi.array().items(new EntitySchemas.DispersionParametersSchema().schema).allow(null),
|
|
2080
|
+
dispersionParameterCount: Joi.number().integer(),
|
|
2081
|
+
endPointConcentration: Joi.number().unsafe(),
|
|
2082
|
+
flammableParameters: new EntitySchemas.FlammableParametersSchema().schema,
|
|
2083
|
+
explosionParameters: new EntitySchemas.ExplosionParametersSchema().schema,
|
|
2084
|
+
dispersionFlamOutputConfigs: Joi.array().items(new EntitySchemas.DispersionOutputConfigSchema().schema).allow(null),
|
|
2085
|
+
dispersionFlamOutputConfigCount: Joi.number().integer(),
|
|
2086
|
+
dispersionToxicOutputConfigs: Joi.array().items(new EntitySchemas.DispersionOutputConfigSchema().schema).allow(null),
|
|
2087
|
+
dispersionToxicOutputConfigCount: Joi.number().integer(),
|
|
2088
|
+
flammableOutputConfigs: Joi.array().items(new EntitySchemas.FlammableOutputConfigSchema().schema).allow(null),
|
|
2089
|
+
flammableOutputConfigCount: Joi.number().integer(),
|
|
2090
|
+
explosionOutputConfigs: Joi.array().items(new EntitySchemas.ExplosionOutputConfigSchema().schema).allow(null),
|
|
2091
|
+
explosionOutputConfigCount: Joi.number().integer(),
|
|
2092
|
+
explosionConfinedVolumes: Joi.array().items(new EntitySchemas.ExplosionConfinedVolumeSchema().schema).allow(null),
|
|
2093
|
+
explosionConfinedVolumeCount: Joi.number().integer(),
|
|
2094
|
+
}).unknown(true);
|
|
2095
|
+
|
|
2096
|
+
this.propertyTypes = {
|
|
2097
|
+
vessel: "Entities.Vessel",
|
|
2098
|
+
lineRupture: "Entities.LineRupture",
|
|
2099
|
+
dischargeParameters: "Entities.DischargeParameters",
|
|
2100
|
+
substrate: "Entities.Substrate",
|
|
2101
|
+
weather: "Entities.Weather",
|
|
2102
|
+
dispersionParameters: "Entities.DispersionParameters[]",
|
|
2103
|
+
dispersionParameterCount: "number",
|
|
2104
|
+
endPointConcentration: "number",
|
|
2105
|
+
flammableParameters: "Entities.FlammableParameters",
|
|
2106
|
+
explosionParameters: "Entities.ExplosionParameters",
|
|
2107
|
+
dispersionFlamOutputConfigs: "Entities.DispersionOutputConfig[]",
|
|
2108
|
+
dispersionFlamOutputConfigCount: "number",
|
|
2109
|
+
dispersionToxicOutputConfigs: "Entities.DispersionOutputConfig[]",
|
|
2110
|
+
dispersionToxicOutputConfigCount: "number",
|
|
2111
|
+
flammableOutputConfigs: "Entities.FlammableOutputConfig[]",
|
|
2112
|
+
flammableOutputConfigCount: "number",
|
|
2113
|
+
explosionOutputConfigs: "Entities.ExplosionOutputConfig[]",
|
|
2114
|
+
explosionOutputConfigCount: "number",
|
|
2115
|
+
explosionConfinedVolumes: "Entities.ExplosionConfinedVolume[]",
|
|
2116
|
+
explosionConfinedVolumeCount: "number",
|
|
2117
|
+
};
|
|
2118
|
+
}
|
|
2119
|
+
|
|
2120
|
+
validate(data: VesselLineRuptureLinkedRunCalculationRequestSchemaData): VesselLineRuptureLinkedRunCalculationRequest {
|
|
2121
|
+
const { error, value } = this.schema.validate(data, { abortEarly: false });
|
|
2122
|
+
if (error) {
|
|
2123
|
+
throw new Error(`Validation error: ${error.details.map((x) => x.message).join(", ")}`);
|
|
2124
|
+
}
|
|
2125
|
+
return this.makeCalculationRequest(value);
|
|
2126
|
+
}
|
|
2127
|
+
|
|
2128
|
+
makeCalculationRequest(data: VesselLineRuptureLinkedRunCalculationRequestSchemaData): VesselLineRuptureLinkedRunCalculationRequest {
|
|
2129
|
+
return new VesselLineRuptureLinkedRunCalculationRequest(
|
|
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
|
+
);
|
|
2151
|
+
}
|
|
2152
|
+
}
|
|
2153
|
+
|
|
2154
|
+
export class VesselLineRuptureLinkedRunCalculation extends CalculationBase {
|
|
2155
|
+
vessel: Entities.Vessel;
|
|
2156
|
+
lineRupture: Entities.LineRupture;
|
|
2157
|
+
dischargeParameters: Entities.DischargeParameters;
|
|
2158
|
+
substrate: Entities.Substrate;
|
|
2159
|
+
weather: Entities.Weather;
|
|
2160
|
+
dispersionParameters: Entities.DispersionParameters[];
|
|
2161
|
+
dispersionParameterCount: number;
|
|
2162
|
+
endPointConcentration: number;
|
|
2163
|
+
flammableParameters: Entities.FlammableParameters;
|
|
2164
|
+
explosionParameters: Entities.ExplosionParameters;
|
|
2165
|
+
dispersionFlamOutputConfigs: Entities.DispersionOutputConfig[];
|
|
2166
|
+
dispersionFlamOutputConfigCount: number;
|
|
2167
|
+
dispersionToxicOutputConfigs: Entities.DispersionOutputConfig[];
|
|
2168
|
+
dispersionToxicOutputConfigCount: number;
|
|
2169
|
+
flammableOutputConfigs: Entities.FlammableOutputConfig[];
|
|
2170
|
+
flammableOutputConfigCount: number;
|
|
2171
|
+
explosionOutputConfigs: Entities.ExplosionOutputConfig[];
|
|
2172
|
+
explosionOutputConfigCount: number;
|
|
2173
|
+
explosionConfinedVolumes: Entities.ExplosionConfinedVolume[];
|
|
2174
|
+
explosionConfinedVolumeCount: number;
|
|
2175
|
+
dischargeRecord?: Entities.DischargeRecord;
|
|
2176
|
+
distancesToJetFireRadiation?: number[];
|
|
2177
|
+
jetContourPoints?: Entities.LocalPosition[];
|
|
2178
|
+
nJetContourPoints?: number[];
|
|
2179
|
+
areaContourJet?: number[];
|
|
2180
|
+
distancesToFlamConcentration?: number[];
|
|
2181
|
+
flamConcentrationsUsed?: number[];
|
|
2182
|
+
flamConcContourPoints?: Entities.LocalPosition[];
|
|
2183
|
+
nFlamConcContourPoints?: number[];
|
|
2184
|
+
areaFootprintFlamConc?: number[];
|
|
2185
|
+
distancesToPoolFireRadiation?: number[];
|
|
2186
|
+
poolContourPoints?: Entities.LocalPosition[];
|
|
2187
|
+
nPoolContourPoints?: number[];
|
|
2188
|
+
areaContourPool?: number[];
|
|
2189
|
+
explosionOverpressureResults?: Entities.ExplosionOverpressureResult[];
|
|
2190
|
+
distancesToToxicConcentration?: number[];
|
|
2191
|
+
toxicConcentrationUsed?: number[];
|
|
2192
|
+
toxicConcContourPoints?: Entities.LocalPosition[];
|
|
2193
|
+
nToxicConcContourPoints?: number[];
|
|
2194
|
+
areaFootprintToxicConc?: number[];
|
|
2195
|
+
jetFireFlameResult?: Entities.FlameResult;
|
|
2196
|
+
poolFireFlameResult?: Entities.PoolFireFlameResult;
|
|
2197
|
+
|
|
2198
|
+
/**
|
|
2199
|
+
* 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.
|
|
2200
|
+
*
|
|
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
|
+
*/
|
|
2222
|
+
constructor(
|
|
2223
|
+
vessel: Entities.Vessel,
|
|
2224
|
+
lineRupture: Entities.LineRupture,
|
|
2225
|
+
dischargeParameters: Entities.DischargeParameters,
|
|
2226
|
+
substrate: Entities.Substrate,
|
|
2227
|
+
weather: Entities.Weather,
|
|
2228
|
+
dispersionParameters: Entities.DispersionParameters[],
|
|
2229
|
+
dispersionParameterCount: number,
|
|
2230
|
+
endPointConcentration: number,
|
|
2231
|
+
flammableParameters: Entities.FlammableParameters,
|
|
2232
|
+
explosionParameters: Entities.ExplosionParameters,
|
|
2233
|
+
dispersionFlamOutputConfigs: Entities.DispersionOutputConfig[],
|
|
2234
|
+
dispersionFlamOutputConfigCount: number,
|
|
2235
|
+
dispersionToxicOutputConfigs: Entities.DispersionOutputConfig[],
|
|
2236
|
+
dispersionToxicOutputConfigCount: number,
|
|
2237
|
+
flammableOutputConfigs: Entities.FlammableOutputConfig[],
|
|
2238
|
+
flammableOutputConfigCount: number,
|
|
2239
|
+
explosionOutputConfigs: Entities.ExplosionOutputConfig[],
|
|
2240
|
+
explosionOutputConfigCount: number,
|
|
2241
|
+
explosionConfinedVolumes: Entities.ExplosionConfinedVolume[],
|
|
2242
|
+
explosionConfinedVolumeCount: number
|
|
2243
|
+
) {
|
|
2244
|
+
super();
|
|
2245
|
+
this.vessel = vessel;
|
|
2246
|
+
this.lineRupture = lineRupture;
|
|
2247
|
+
this.dischargeParameters = dischargeParameters;
|
|
2248
|
+
this.substrate = substrate;
|
|
2249
|
+
this.weather = weather;
|
|
2250
|
+
this.dispersionParameters = dispersionParameters;
|
|
2251
|
+
this.dispersionParameterCount = dispersionParameterCount;
|
|
2252
|
+
this.endPointConcentration = endPointConcentration;
|
|
2253
|
+
this.flammableParameters = flammableParameters;
|
|
2254
|
+
this.explosionParameters = explosionParameters;
|
|
2255
|
+
this.dispersionFlamOutputConfigs = dispersionFlamOutputConfigs;
|
|
2256
|
+
this.dispersionFlamOutputConfigCount = dispersionFlamOutputConfigCount;
|
|
2257
|
+
this.dispersionToxicOutputConfigs = dispersionToxicOutputConfigs;
|
|
2258
|
+
this.dispersionToxicOutputConfigCount = dispersionToxicOutputConfigCount;
|
|
2259
|
+
this.flammableOutputConfigs = flammableOutputConfigs;
|
|
2260
|
+
this.flammableOutputConfigCount = flammableOutputConfigCount;
|
|
2261
|
+
this.explosionOutputConfigs = explosionOutputConfigs;
|
|
2262
|
+
this.explosionOutputConfigCount = explosionOutputConfigCount;
|
|
2263
|
+
this.explosionConfinedVolumes = explosionConfinedVolumes;
|
|
2264
|
+
this.explosionConfinedVolumeCount = explosionConfinedVolumeCount;
|
|
2265
|
+
}
|
|
2266
|
+
|
|
2267
|
+
async run() {
|
|
2268
|
+
try {
|
|
2269
|
+
const request = new VesselLineRuptureLinkedRunCalculationRequest(
|
|
2270
|
+
this.vessel,
|
|
2271
|
+
this.lineRupture,
|
|
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
|
+
);
|
|
2291
|
+
|
|
2292
|
+
const schema = new VesselLineRuptureLinkedRunCalculationRequestSchema();
|
|
2293
|
+
const validatedRequest = schema.validate(request);
|
|
2294
|
+
|
|
2295
|
+
const requestJson = JSON.stringify(validatedRequest);
|
|
2296
|
+
const url = `${getAnalyticsApiTarget()}calculatevessellinerupturelinkedrun?clientId=${getClientAliasId()}`;
|
|
2297
|
+
|
|
2298
|
+
this.resultCode = Enums.ResultCode.UNEXPECTED_APPLICATION_ERROR;
|
|
2299
|
+
|
|
2300
|
+
const response = await this.postRequest(url, requestJson);
|
|
2301
|
+
|
|
2302
|
+
if (response.status >= 200 && response.status < 300) {
|
|
2303
|
+
const schema = new VesselLineRuptureLinkedRunCalculationResponseSchema();
|
|
2304
|
+
const validatedResponse = schema.validate(response.data);
|
|
2305
|
+
|
|
2306
|
+
this.resultCode = validatedResponse.resultCode;
|
|
2307
|
+
if (this.resultCode === Enums.ResultCode.SUCCESS) {
|
|
2308
|
+
this.dischargeRecord = validatedResponse.dischargeRecord;
|
|
2309
|
+
this.distancesToJetFireRadiation = validatedResponse.distancesToJetFireRadiation;
|
|
2310
|
+
this.jetContourPoints = validatedResponse.jetContourPoints;
|
|
2311
|
+
this.nJetContourPoints = validatedResponse.nJetContourPoints;
|
|
2312
|
+
this.areaContourJet = validatedResponse.areaContourJet;
|
|
2313
|
+
this.distancesToFlamConcentration = validatedResponse.distancesToFlamConcentration;
|
|
2314
|
+
this.flamConcentrationsUsed = validatedResponse.flamConcentrationsUsed;
|
|
2315
|
+
this.flamConcContourPoints = validatedResponse.flamConcContourPoints;
|
|
2316
|
+
this.nFlamConcContourPoints = validatedResponse.nFlamConcContourPoints;
|
|
2317
|
+
this.areaFootprintFlamConc = validatedResponse.areaFootprintFlamConc;
|
|
2318
|
+
this.distancesToPoolFireRadiation = validatedResponse.distancesToPoolFireRadiation;
|
|
2319
|
+
this.poolContourPoints = validatedResponse.poolContourPoints;
|
|
2320
|
+
this.nPoolContourPoints = validatedResponse.nPoolContourPoints;
|
|
2321
|
+
this.areaContourPool = validatedResponse.areaContourPool;
|
|
2322
|
+
this.explosionOverpressureResults = validatedResponse.explosionOverpressureResults;
|
|
2323
|
+
this.distancesToToxicConcentration = validatedResponse.distancesToToxicConcentration;
|
|
2324
|
+
this.toxicConcentrationUsed = validatedResponse.toxicConcentrationUsed;
|
|
2325
|
+
this.toxicConcContourPoints = validatedResponse.toxicConcContourPoints;
|
|
2326
|
+
this.nToxicConcContourPoints = validatedResponse.nToxicConcContourPoints;
|
|
2327
|
+
this.areaFootprintToxicConc = validatedResponse.areaFootprintToxicConc;
|
|
2328
|
+
this.jetFireFlameResult = validatedResponse.jetFireFlameResult;
|
|
2329
|
+
this.poolFireFlameResult = validatedResponse.poolFireFlameResult;
|
|
2330
|
+
this.resultCode = validatedResponse.resultCode;
|
|
2331
|
+
this.messages = validatedResponse.messages ?? [];
|
|
2332
|
+
this.calculationElapsedTime = validatedResponse.calculationElapsedTime;
|
|
2333
|
+
this.operationId = validatedResponse.operationId;
|
|
2334
|
+
} else {
|
|
2335
|
+
this.messages.push(...(validatedResponse.messages ?? []));
|
|
2336
|
+
}
|
|
2337
|
+
} else {
|
|
2338
|
+
this.handleFailedResponse(response);
|
|
2339
|
+
}
|
|
2340
|
+
} catch (error) {
|
|
2341
|
+
if (error instanceof Error) {
|
|
2342
|
+
this.messages.push(`Error: ${error.message}`);
|
|
2343
|
+
} else {
|
|
2344
|
+
this.messages.push(`Unexpected error: ${JSON.stringify(error)}`);
|
|
2345
|
+
}
|
|
2346
|
+
console.error(error);
|
|
2347
|
+
this.resultCode = Enums.ResultCode.UNEXPECTED_APPLICATION_ERROR;
|
|
2348
|
+
}
|
|
2349
|
+
|
|
2350
|
+
return this.resultCode;
|
|
2351
|
+
}
|
|
2352
|
+
|
|
2353
|
+
toString() {
|
|
2354
|
+
const parts = ["* VesselLineRuptureLinkedRun"];
|
|
2355
|
+
|
|
2356
|
+
parts.push(`dischargeRecord: ${String(this.dischargeRecord)}`);
|
|
2357
|
+
parts.push("*** distancesToJetFireRadiation:");
|
|
2358
|
+
parts.push(
|
|
2359
|
+
this.distancesToJetFireRadiation && this.distancesToJetFireRadiation.length > 0
|
|
2360
|
+
? this.distancesToJetFireRadiation.map((point) => `distancesToJetFireRadiationElement: ${point}`).join("\n")
|
|
2361
|
+
: "distancesToJetFireRadiation does not contain any elements"
|
|
2362
|
+
);
|
|
2363
|
+
parts.push("*** jetContourPoints:");
|
|
2364
|
+
parts.push(
|
|
2365
|
+
this.jetContourPoints && this.jetContourPoints.length > 0
|
|
2366
|
+
? this.jetContourPoints.map((point) => `jetContourPointsElement: ${point}`).join("\n")
|
|
2367
|
+
: "jetContourPoints does not contain any elements"
|
|
2368
|
+
);
|
|
2369
|
+
parts.push("*** nJetContourPoints:");
|
|
2370
|
+
parts.push(
|
|
2371
|
+
this.nJetContourPoints && this.nJetContourPoints.length > 0
|
|
2372
|
+
? this.nJetContourPoints.map((point) => `nJetContourPointsElement: ${point}`).join("\n")
|
|
2373
|
+
: "nJetContourPoints does not contain any elements"
|
|
2374
|
+
);
|
|
2375
|
+
parts.push("*** areaContourJet:");
|
|
2376
|
+
parts.push(
|
|
2377
|
+
this.areaContourJet && this.areaContourJet.length > 0
|
|
2378
|
+
? this.areaContourJet.map((point) => `areaContourJetElement: ${point}`).join("\n")
|
|
2379
|
+
: "areaContourJet does not contain any elements"
|
|
2380
|
+
);
|
|
2381
|
+
parts.push("*** distancesToFlamConcentration:");
|
|
2382
|
+
parts.push(
|
|
2383
|
+
this.distancesToFlamConcentration && this.distancesToFlamConcentration.length > 0
|
|
2384
|
+
? this.distancesToFlamConcentration.map((point) => `distancesToFlamConcentrationElement: ${point}`).join("\n")
|
|
2385
|
+
: "distancesToFlamConcentration does not contain any elements"
|
|
2386
|
+
);
|
|
2387
|
+
parts.push("*** flamConcentrationsUsed:");
|
|
2388
|
+
parts.push(
|
|
2389
|
+
this.flamConcentrationsUsed && this.flamConcentrationsUsed.length > 0
|
|
2390
|
+
? this.flamConcentrationsUsed.map((point) => `flamConcentrationsUsedElement: ${point}`).join("\n")
|
|
2391
|
+
: "flamConcentrationsUsed does not contain any elements"
|
|
2392
|
+
);
|
|
2393
|
+
parts.push("*** flamConcContourPoints:");
|
|
2394
|
+
parts.push(
|
|
2395
|
+
this.flamConcContourPoints && this.flamConcContourPoints.length > 0
|
|
2396
|
+
? this.flamConcContourPoints.map((point) => `flamConcContourPointsElement: ${point}`).join("\n")
|
|
2397
|
+
: "flamConcContourPoints does not contain any elements"
|
|
2398
|
+
);
|
|
2399
|
+
parts.push("*** nFlamConcContourPoints:");
|
|
2400
|
+
parts.push(
|
|
2401
|
+
this.nFlamConcContourPoints && this.nFlamConcContourPoints.length > 0
|
|
2402
|
+
? this.nFlamConcContourPoints.map((point) => `nFlamConcContourPointsElement: ${point}`).join("\n")
|
|
2403
|
+
: "nFlamConcContourPoints does not contain any elements"
|
|
2404
|
+
);
|
|
2405
|
+
parts.push("*** areaFootprintFlamConc:");
|
|
2406
|
+
parts.push(
|
|
2407
|
+
this.areaFootprintFlamConc && this.areaFootprintFlamConc.length > 0
|
|
2408
|
+
? this.areaFootprintFlamConc.map((point) => `areaFootprintFlamConcElement: ${point}`).join("\n")
|
|
2409
|
+
: "areaFootprintFlamConc does not contain any elements"
|
|
2410
|
+
);
|
|
2411
|
+
parts.push("*** distancesToPoolFireRadiation:");
|
|
2412
|
+
parts.push(
|
|
2413
|
+
this.distancesToPoolFireRadiation && this.distancesToPoolFireRadiation.length > 0
|
|
2414
|
+
? this.distancesToPoolFireRadiation.map((point) => `distancesToPoolFireRadiationElement: ${point}`).join("\n")
|
|
2415
|
+
: "distancesToPoolFireRadiation does not contain any elements"
|
|
2416
|
+
);
|
|
2417
|
+
parts.push("*** poolContourPoints:");
|
|
2418
|
+
parts.push(
|
|
2419
|
+
this.poolContourPoints && this.poolContourPoints.length > 0
|
|
2420
|
+
? this.poolContourPoints.map((point) => `poolContourPointsElement: ${point}`).join("\n")
|
|
2421
|
+
: "poolContourPoints does not contain any elements"
|
|
2422
|
+
);
|
|
2423
|
+
parts.push("*** nPoolContourPoints:");
|
|
2424
|
+
parts.push(
|
|
2425
|
+
this.nPoolContourPoints && this.nPoolContourPoints.length > 0
|
|
2426
|
+
? this.nPoolContourPoints.map((point) => `nPoolContourPointsElement: ${point}`).join("\n")
|
|
2427
|
+
: "nPoolContourPoints does not contain any elements"
|
|
2428
|
+
);
|
|
2429
|
+
parts.push("*** areaContourPool:");
|
|
2430
|
+
parts.push(
|
|
2431
|
+
this.areaContourPool && this.areaContourPool.length > 0
|
|
2432
|
+
? this.areaContourPool.map((point) => `areaContourPoolElement: ${point}`).join("\n")
|
|
2433
|
+
: "areaContourPool does not contain any elements"
|
|
2434
|
+
);
|
|
2435
|
+
parts.push("*** explosionOverpressureResults:");
|
|
2436
|
+
parts.push(
|
|
2437
|
+
this.explosionOverpressureResults && this.explosionOverpressureResults.length > 0
|
|
2438
|
+
? this.explosionOverpressureResults.map((point) => `explosionOverpressureResultsElement: ${point}`).join("\n")
|
|
2439
|
+
: "explosionOverpressureResults does not contain any elements"
|
|
2440
|
+
);
|
|
2441
|
+
parts.push("*** distancesToToxicConcentration:");
|
|
2442
|
+
parts.push(
|
|
2443
|
+
this.distancesToToxicConcentration && this.distancesToToxicConcentration.length > 0
|
|
2444
|
+
? this.distancesToToxicConcentration.map((point) => `distancesToToxicConcentrationElement: ${point}`).join("\n")
|
|
2445
|
+
: "distancesToToxicConcentration does not contain any elements"
|
|
2446
|
+
);
|
|
2447
|
+
parts.push("*** toxicConcentrationUsed:");
|
|
2448
|
+
parts.push(
|
|
2449
|
+
this.toxicConcentrationUsed && this.toxicConcentrationUsed.length > 0
|
|
2450
|
+
? this.toxicConcentrationUsed.map((point) => `toxicConcentrationUsedElement: ${point}`).join("\n")
|
|
2451
|
+
: "toxicConcentrationUsed does not contain any elements"
|
|
2452
|
+
);
|
|
2453
|
+
parts.push("*** toxicConcContourPoints:");
|
|
2454
|
+
parts.push(
|
|
2455
|
+
this.toxicConcContourPoints && this.toxicConcContourPoints.length > 0
|
|
2456
|
+
? this.toxicConcContourPoints.map((point) => `toxicConcContourPointsElement: ${point}`).join("\n")
|
|
2457
|
+
: "toxicConcContourPoints does not contain any elements"
|
|
2458
|
+
);
|
|
2459
|
+
parts.push("*** nToxicConcContourPoints:");
|
|
2460
|
+
parts.push(
|
|
2461
|
+
this.nToxicConcContourPoints && this.nToxicConcContourPoints.length > 0
|
|
2462
|
+
? this.nToxicConcContourPoints.map((point) => `nToxicConcContourPointsElement: ${point}`).join("\n")
|
|
2463
|
+
: "nToxicConcContourPoints does not contain any elements"
|
|
2464
|
+
);
|
|
2465
|
+
parts.push("*** areaFootprintToxicConc:");
|
|
2466
|
+
parts.push(
|
|
2467
|
+
this.areaFootprintToxicConc && this.areaFootprintToxicConc.length > 0
|
|
2468
|
+
? this.areaFootprintToxicConc.map((point) => `areaFootprintToxicConcElement: ${point}`).join("\n")
|
|
2469
|
+
: "areaFootprintToxicConc does not contain any elements"
|
|
2470
|
+
);
|
|
2471
|
+
parts.push(`jetFireFlameResult: ${String(this.jetFireFlameResult)}`);
|
|
2472
|
+
parts.push(`poolFireFlameResult: ${String(this.poolFireFlameResult)}`);
|
|
2473
|
+
parts.push(`resultCode: ${String(this.resultCode)}`);
|
|
2474
|
+
parts.push("*** messages:");
|
|
2475
|
+
parts.push(`messages: ${this.messages !== undefined ? this.messages : "(None)"}`);
|
|
2476
|
+
parts.push(`calculationElapsedTime: ${this.calculationElapsedTime !== undefined ? this.calculationElapsedTime : "(None)"}`);
|
|
2477
|
+
parts.push(`operationId: ${this.operationId !== undefined ? this.operationId : "(None)"}`);
|
|
2478
|
+
|
|
2479
|
+
return parts.join("\n");
|
|
2480
|
+
}
|
|
2481
|
+
}
|
|
2482
|
+
|
|
2483
|
+
export class VesselLineRuptureLinkedRunCalculationResponse extends CalculationResponseBase {
|
|
2484
|
+
dischargeRecord: Entities.DischargeRecord;
|
|
2485
|
+
distancesToJetFireRadiation: number[];
|
|
2486
|
+
jetContourPoints: Entities.LocalPosition[];
|
|
2487
|
+
nJetContourPoints: number[];
|
|
2488
|
+
areaContourJet: number[];
|
|
2489
|
+
distancesToFlamConcentration: number[];
|
|
2490
|
+
flamConcentrationsUsed: number[];
|
|
2491
|
+
flamConcContourPoints: Entities.LocalPosition[];
|
|
2492
|
+
nFlamConcContourPoints: number[];
|
|
2493
|
+
areaFootprintFlamConc: number[];
|
|
2494
|
+
distancesToPoolFireRadiation: number[];
|
|
2495
|
+
poolContourPoints: Entities.LocalPosition[];
|
|
2496
|
+
nPoolContourPoints: number[];
|
|
2497
|
+
areaContourPool: number[];
|
|
2498
|
+
explosionOverpressureResults: Entities.ExplosionOverpressureResult[];
|
|
2499
|
+
distancesToToxicConcentration: number[];
|
|
2500
|
+
toxicConcentrationUsed: number[];
|
|
2501
|
+
toxicConcContourPoints: Entities.LocalPosition[];
|
|
2502
|
+
nToxicConcContourPoints: number[];
|
|
2503
|
+
areaFootprintToxicConc: number[];
|
|
2504
|
+
jetFireFlameResult: Entities.FlameResult;
|
|
2505
|
+
poolFireFlameResult: Entities.PoolFireFlameResult;
|
|
2506
|
+
|
|
2507
|
+
/**
|
|
2508
|
+
* VesselLineRuptureLinkedRun calculation response class.
|
|
2509
|
+
*
|
|
2510
|
+
* @param {Entities.DischargeRecord} dischargeRecord - A Discharge Record entity.
|
|
2511
|
+
* @param {number[]} distancesToJetFireRadiation - An array of distances to jet fire radiation levels, ordered according to the Flammable Output Configs.
|
|
2512
|
+
* @param {Entities.LocalPosition[]} jetContourPoints - An array of jet fire radiation contour points, ordered according to the Flammable Output Configs.
|
|
2513
|
+
* @param {number[]} nJetContourPoints - An array of the number of jet fire radiation contour points, ordered according to the Flammable Output Configs.
|
|
2514
|
+
* @param {number[]} areaContourJet - An array of areas of the jet fire contours, ordered according to the Flammable Output Configs.
|
|
2515
|
+
* @param {number[]} distancesToFlamConcentration - An array of distances to flammable concentration levels, ordered according to the Dispersion Output Configs for flammable concentrations of interest.
|
|
2516
|
+
* @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.
|
|
2517
|
+
* @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.
|
|
2518
|
+
* @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.
|
|
2519
|
+
* @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.
|
|
2520
|
+
* @param {number[]} distancesToPoolFireRadiation - An array of distances to pool fire radiation levels, ordered according to the Flammable Output Configs.
|
|
2521
|
+
* @param {Entities.LocalPosition[]} poolContourPoints - An array of pool fire radiation contour points, ordered according to the Flammable Output Configs.
|
|
2522
|
+
* @param {number[]} nPoolContourPoints - An array of the number of pool fire radiation contour points, ordered according to the Flammable Output Configs.
|
|
2523
|
+
* @param {number[]} areaContourPool - An array of areas of the pool fire contours, ordered according to the Flammable Output Configs.
|
|
2524
|
+
* @param {Entities.ExplosionOverpressureResult[]} explosionOverpressureResults - An array of Explosion Overpressure Results, ordered according to the Explosion Output Configs.
|
|
2525
|
+
* @param {number[]} distancesToToxicConcentration - An array of distances to toxic concentration levels, ordered according to the Dispersion Output Configs for toxic concentrations of interest.
|
|
2526
|
+
* @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.
|
|
2527
|
+
* @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.
|
|
2528
|
+
* @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.
|
|
2529
|
+
* @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.
|
|
2530
|
+
* @param {Entities.FlameResult} jetFireFlameResult - A Flame Results entity, for jet fire.
|
|
2531
|
+
* @param {Entities.PoolFireFlameResult} poolFireFlameResult - A Pool Fire Flame Results entity, for pool fire.
|
|
2532
|
+
*/
|
|
2533
|
+
constructor(
|
|
2534
|
+
dischargeRecord: Entities.DischargeRecord,
|
|
2535
|
+
distancesToJetFireRadiation: number[],
|
|
2536
|
+
jetContourPoints: Entities.LocalPosition[],
|
|
2537
|
+
nJetContourPoints: number[],
|
|
2538
|
+
areaContourJet: number[],
|
|
2539
|
+
distancesToFlamConcentration: number[],
|
|
2540
|
+
flamConcentrationsUsed: number[],
|
|
2541
|
+
flamConcContourPoints: Entities.LocalPosition[],
|
|
2542
|
+
nFlamConcContourPoints: number[],
|
|
2543
|
+
areaFootprintFlamConc: number[],
|
|
2544
|
+
distancesToPoolFireRadiation: number[],
|
|
2545
|
+
poolContourPoints: Entities.LocalPosition[],
|
|
2546
|
+
nPoolContourPoints: number[],
|
|
2547
|
+
areaContourPool: number[],
|
|
2548
|
+
explosionOverpressureResults: Entities.ExplosionOverpressureResult[],
|
|
2549
|
+
distancesToToxicConcentration: number[],
|
|
2550
|
+
toxicConcentrationUsed: number[],
|
|
2551
|
+
toxicConcContourPoints: Entities.LocalPosition[],
|
|
2552
|
+
nToxicConcContourPoints: number[],
|
|
2553
|
+
areaFootprintToxicConc: number[],
|
|
2554
|
+
jetFireFlameResult: Entities.FlameResult,
|
|
2555
|
+
poolFireFlameResult: Entities.PoolFireFlameResult,
|
|
2556
|
+
resultCode: Enums.ResultCode,
|
|
2557
|
+
messages: string[],
|
|
2558
|
+
calculationElapsedTime: number,
|
|
2559
|
+
operationId: string
|
|
2560
|
+
) {
|
|
2561
|
+
super();
|
|
2562
|
+
this.dischargeRecord = dischargeRecord;
|
|
2563
|
+
this.distancesToJetFireRadiation = distancesToJetFireRadiation;
|
|
2564
|
+
this.jetContourPoints = jetContourPoints;
|
|
2565
|
+
this.nJetContourPoints = nJetContourPoints;
|
|
2566
|
+
this.areaContourJet = areaContourJet;
|
|
2567
|
+
this.distancesToFlamConcentration = distancesToFlamConcentration;
|
|
2568
|
+
this.flamConcentrationsUsed = flamConcentrationsUsed;
|
|
2569
|
+
this.flamConcContourPoints = flamConcContourPoints;
|
|
2570
|
+
this.nFlamConcContourPoints = nFlamConcContourPoints;
|
|
2571
|
+
this.areaFootprintFlamConc = areaFootprintFlamConc;
|
|
2572
|
+
this.distancesToPoolFireRadiation = distancesToPoolFireRadiation;
|
|
2573
|
+
this.poolContourPoints = poolContourPoints;
|
|
2574
|
+
this.nPoolContourPoints = nPoolContourPoints;
|
|
2575
|
+
this.areaContourPool = areaContourPool;
|
|
2576
|
+
this.explosionOverpressureResults = explosionOverpressureResults;
|
|
2577
|
+
this.distancesToToxicConcentration = distancesToToxicConcentration;
|
|
2578
|
+
this.toxicConcentrationUsed = toxicConcentrationUsed;
|
|
2579
|
+
this.toxicConcContourPoints = toxicConcContourPoints;
|
|
2580
|
+
this.nToxicConcContourPoints = nToxicConcContourPoints;
|
|
2581
|
+
this.areaFootprintToxicConc = areaFootprintToxicConc;
|
|
2582
|
+
this.jetFireFlameResult = jetFireFlameResult;
|
|
2583
|
+
this.poolFireFlameResult = poolFireFlameResult;
|
|
2584
|
+
this.resultCode = resultCode;
|
|
2585
|
+
this.messages = messages;
|
|
2586
|
+
this.calculationElapsedTime = calculationElapsedTime;
|
|
2587
|
+
this.operationId = operationId;
|
|
2588
|
+
}
|
|
2589
|
+
|
|
2590
|
+
initialiseFromDictionary(data: { [key: string]: unknown }) {
|
|
2591
|
+
if (data.dischargeRecord) {
|
|
2592
|
+
this.dischargeRecord = new Entities.DischargeRecord();
|
|
2593
|
+
this.dischargeRecord.initialiseFromDictionary(data.dischargeRecord as { [key: string]: unknown });
|
|
2594
|
+
}
|
|
2595
|
+
if (data.distancesToJetFireRadiation && Array.isArray(data.distancesToJetFireRadiation)) {
|
|
2596
|
+
this.distancesToJetFireRadiation = data.distancesToJetFireRadiation.map((item) => parseFloat(item));
|
|
2597
|
+
}
|
|
2598
|
+
if (data.jetContourPoints && Array.isArray(data.jetContourPoints)) {
|
|
2599
|
+
this.jetContourPoints = data.jetContourPoints.map(
|
|
2600
|
+
(item) => {
|
|
2601
|
+
const record = new Entities.LocalPosition();
|
|
2602
|
+
record.initialiseFromDictionary(item);
|
|
2603
|
+
return record;
|
|
2604
|
+
}
|
|
2605
|
+
);
|
|
2606
|
+
}
|
|
2607
|
+
if (data.nJetContourPoints && Array.isArray(data.nJetContourPoints)) {
|
|
2608
|
+
this.nJetContourPoints = data.nJetContourPoints.map((item) => parseInt(item));
|
|
2609
|
+
}
|
|
2610
|
+
if (data.areaContourJet && Array.isArray(data.areaContourJet)) {
|
|
2611
|
+
this.areaContourJet = data.areaContourJet.map((item) => parseFloat(item));
|
|
2612
|
+
}
|
|
2613
|
+
if (data.distancesToFlamConcentration && Array.isArray(data.distancesToFlamConcentration)) {
|
|
2614
|
+
this.distancesToFlamConcentration = data.distancesToFlamConcentration.map((item) => parseFloat(item));
|
|
2615
|
+
}
|
|
2616
|
+
if (data.flamConcentrationsUsed && Array.isArray(data.flamConcentrationsUsed)) {
|
|
2617
|
+
this.flamConcentrationsUsed = data.flamConcentrationsUsed.map((item) => parseFloat(item));
|
|
2618
|
+
}
|
|
2619
|
+
if (data.flamConcContourPoints && Array.isArray(data.flamConcContourPoints)) {
|
|
2620
|
+
this.flamConcContourPoints = data.flamConcContourPoints.map(
|
|
2621
|
+
(item) => {
|
|
2622
|
+
const record = new Entities.LocalPosition();
|
|
2623
|
+
record.initialiseFromDictionary(item);
|
|
2624
|
+
return record;
|
|
2625
|
+
}
|
|
2626
|
+
);
|
|
2627
|
+
}
|
|
2628
|
+
if (data.nFlamConcContourPoints && Array.isArray(data.nFlamConcContourPoints)) {
|
|
2629
|
+
this.nFlamConcContourPoints = data.nFlamConcContourPoints.map((item) => parseInt(item));
|
|
2630
|
+
}
|
|
2631
|
+
if (data.areaFootprintFlamConc && Array.isArray(data.areaFootprintFlamConc)) {
|
|
2632
|
+
this.areaFootprintFlamConc = data.areaFootprintFlamConc.map((item) => parseFloat(item));
|
|
2633
|
+
}
|
|
2634
|
+
if (data.distancesToPoolFireRadiation && Array.isArray(data.distancesToPoolFireRadiation)) {
|
|
2635
|
+
this.distancesToPoolFireRadiation = data.distancesToPoolFireRadiation.map((item) => parseFloat(item));
|
|
2636
|
+
}
|
|
2637
|
+
if (data.poolContourPoints && Array.isArray(data.poolContourPoints)) {
|
|
2638
|
+
this.poolContourPoints = data.poolContourPoints.map(
|
|
2639
|
+
(item) => {
|
|
2640
|
+
const record = new Entities.LocalPosition();
|
|
2641
|
+
record.initialiseFromDictionary(item);
|
|
2642
|
+
return record;
|
|
2643
|
+
}
|
|
2644
|
+
);
|
|
2645
|
+
}
|
|
2646
|
+
if (data.nPoolContourPoints && Array.isArray(data.nPoolContourPoints)) {
|
|
2647
|
+
this.nPoolContourPoints = data.nPoolContourPoints.map((item) => parseInt(item));
|
|
2648
|
+
}
|
|
2649
|
+
if (data.areaContourPool && Array.isArray(data.areaContourPool)) {
|
|
2650
|
+
this.areaContourPool = data.areaContourPool.map((item) => parseFloat(item));
|
|
2651
|
+
}
|
|
2652
|
+
if (data.explosionOverpressureResults && Array.isArray(data.explosionOverpressureResults)) {
|
|
2653
|
+
this.explosionOverpressureResults = data.explosionOverpressureResults.map(
|
|
2654
|
+
(item) => {
|
|
2655
|
+
const record = new Entities.ExplosionOverpressureResult();
|
|
2656
|
+
record.initialiseFromDictionary(item);
|
|
2657
|
+
return record;
|
|
2658
|
+
}
|
|
2659
|
+
);
|
|
2660
|
+
}
|
|
2661
|
+
if (data.distancesToToxicConcentration && Array.isArray(data.distancesToToxicConcentration)) {
|
|
2662
|
+
this.distancesToToxicConcentration = data.distancesToToxicConcentration.map((item) => parseFloat(item));
|
|
2663
|
+
}
|
|
2664
|
+
if (data.toxicConcentrationUsed && Array.isArray(data.toxicConcentrationUsed)) {
|
|
2665
|
+
this.toxicConcentrationUsed = data.toxicConcentrationUsed.map((item) => parseFloat(item));
|
|
2666
|
+
}
|
|
2667
|
+
if (data.toxicConcContourPoints && Array.isArray(data.toxicConcContourPoints)) {
|
|
2668
|
+
this.toxicConcContourPoints = data.toxicConcContourPoints.map(
|
|
2669
|
+
(item) => {
|
|
2670
|
+
const record = new Entities.LocalPosition();
|
|
2671
|
+
record.initialiseFromDictionary(item);
|
|
2672
|
+
return record;
|
|
2673
|
+
}
|
|
2674
|
+
);
|
|
2675
|
+
}
|
|
2676
|
+
if (data.nToxicConcContourPoints && Array.isArray(data.nToxicConcContourPoints)) {
|
|
2677
|
+
this.nToxicConcContourPoints = data.nToxicConcContourPoints.map((item) => parseInt(item));
|
|
2678
|
+
}
|
|
2679
|
+
if (data.areaFootprintToxicConc && Array.isArray(data.areaFootprintToxicConc)) {
|
|
2680
|
+
this.areaFootprintToxicConc = data.areaFootprintToxicConc.map((item) => parseFloat(item));
|
|
2681
|
+
}
|
|
2682
|
+
if (data.jetFireFlameResult) {
|
|
2683
|
+
this.jetFireFlameResult = new Entities.FlameResult();
|
|
2684
|
+
this.jetFireFlameResult.initialiseFromDictionary(data.jetFireFlameResult as { [key: string]: unknown });
|
|
2685
|
+
}
|
|
2686
|
+
if (data.poolFireFlameResult) {
|
|
2687
|
+
this.poolFireFlameResult = new Entities.PoolFireFlameResult();
|
|
2688
|
+
this.poolFireFlameResult.initialiseFromDictionary(data.poolFireFlameResult as { [key: string]: unknown });
|
|
2689
|
+
}
|
|
2690
|
+
if (data.resultCode !== undefined && (typeof data.resultCode === "string" || typeof data.resultCode === "number")) {
|
|
2691
|
+
this.resultCode = data.resultCode as Enums.ResultCode;
|
|
2692
|
+
}
|
|
2693
|
+
this.messages = this.messages ?? [];
|
|
2694
|
+
if (data.messages && Array.isArray(data.messages)) {
|
|
2695
|
+
this.messages.push(...data.messages);
|
|
2696
|
+
}
|
|
2697
|
+
if (data.calculationElapsedTime !== undefined && typeof data.calculationElapsedTime === "number") {
|
|
2698
|
+
this.calculationElapsedTime = data.calculationElapsedTime as number;
|
|
2699
|
+
}
|
|
2700
|
+
if (data.operationId !== undefined && typeof data.operationId === "string") {
|
|
2701
|
+
this.operationId = data.operationId as string;
|
|
2702
|
+
}
|
|
2703
|
+
}
|
|
2704
|
+
}
|
|
2705
|
+
|
|
2706
|
+
export interface VesselLineRuptureLinkedRunCalculationResponseSchemaData {
|
|
2707
|
+
dischargeRecord: Entities.DischargeRecord;
|
|
2708
|
+
distancesToJetFireRadiation: number[];
|
|
2709
|
+
jetContourPoints: Entities.LocalPosition[];
|
|
2710
|
+
nJetContourPoints: number[];
|
|
2711
|
+
areaContourJet: number[];
|
|
2712
|
+
distancesToFlamConcentration: number[];
|
|
2713
|
+
flamConcentrationsUsed: number[];
|
|
2714
|
+
flamConcContourPoints: Entities.LocalPosition[];
|
|
2715
|
+
nFlamConcContourPoints: number[];
|
|
2716
|
+
areaFootprintFlamConc: number[];
|
|
2717
|
+
distancesToPoolFireRadiation: number[];
|
|
2718
|
+
poolContourPoints: Entities.LocalPosition[];
|
|
2719
|
+
nPoolContourPoints: number[];
|
|
2720
|
+
areaContourPool: number[];
|
|
2721
|
+
explosionOverpressureResults: Entities.ExplosionOverpressureResult[];
|
|
2722
|
+
distancesToToxicConcentration: number[];
|
|
2723
|
+
toxicConcentrationUsed: number[];
|
|
2724
|
+
toxicConcContourPoints: Entities.LocalPosition[];
|
|
2725
|
+
nToxicConcContourPoints: number[];
|
|
2726
|
+
areaFootprintToxicConc: number[];
|
|
2727
|
+
jetFireFlameResult: Entities.FlameResult;
|
|
2728
|
+
poolFireFlameResult: Entities.PoolFireFlameResult;
|
|
2729
|
+
resultCode: Enums.ResultCode;
|
|
2730
|
+
messages: string[];
|
|
2731
|
+
calculationElapsedTime: number;
|
|
2732
|
+
operationId: string;
|
|
2733
|
+
}
|
|
2734
|
+
|
|
2735
|
+
export class VesselLineRuptureLinkedRunCalculationResponseSchema {
|
|
2736
|
+
schema: Joi.ObjectSchema;
|
|
2737
|
+
propertyTypes: Record<string, string>;
|
|
2738
|
+
|
|
2739
|
+
/**
|
|
2740
|
+
* Schema for the VesselLineRuptureLinkedRun calculation response.
|
|
2741
|
+
*/
|
|
2742
|
+
constructor() {
|
|
2743
|
+
this.schema = Joi.object({
|
|
2744
|
+
dischargeRecord: new EntitySchemas.DischargeRecordSchema().schema,
|
|
2745
|
+
distancesToJetFireRadiation: Joi.array().items(Joi.number().unsafe()).allow(null),
|
|
2746
|
+
jetContourPoints: Joi.array().items(new EntitySchemas.LocalPositionSchema().schema).allow(null),
|
|
2747
|
+
nJetContourPoints: Joi.array().items(Joi.number().integer()).allow(null),
|
|
2748
|
+
areaContourJet: Joi.array().items(Joi.number().unsafe()).allow(null),
|
|
2749
|
+
distancesToFlamConcentration: Joi.array().items(Joi.number().unsafe()).allow(null),
|
|
2750
|
+
flamConcentrationsUsed: Joi.array().items(Joi.number().unsafe()).allow(null),
|
|
2751
|
+
flamConcContourPoints: Joi.array().items(new EntitySchemas.LocalPositionSchema().schema).allow(null),
|
|
2752
|
+
nFlamConcContourPoints: Joi.array().items(Joi.number().integer()).allow(null),
|
|
2753
|
+
areaFootprintFlamConc: Joi.array().items(Joi.number().unsafe()).allow(null),
|
|
2754
|
+
distancesToPoolFireRadiation: Joi.array().items(Joi.number().unsafe()).allow(null),
|
|
2755
|
+
poolContourPoints: Joi.array().items(new EntitySchemas.LocalPositionSchema().schema).allow(null),
|
|
2756
|
+
nPoolContourPoints: Joi.array().items(Joi.number().integer()).allow(null),
|
|
2757
|
+
areaContourPool: Joi.array().items(Joi.number().unsafe()).allow(null),
|
|
2758
|
+
explosionOverpressureResults: Joi.array().items(new EntitySchemas.ExplosionOverpressureResultSchema().schema).allow(null),
|
|
2759
|
+
distancesToToxicConcentration: Joi.array().items(Joi.number().unsafe()).allow(null),
|
|
2760
|
+
toxicConcentrationUsed: Joi.array().items(Joi.number().unsafe()).allow(null),
|
|
2761
|
+
toxicConcContourPoints: Joi.array().items(new EntitySchemas.LocalPositionSchema().schema).allow(null),
|
|
2762
|
+
nToxicConcContourPoints: Joi.array().items(Joi.number().integer()).allow(null),
|
|
2763
|
+
areaFootprintToxicConc: Joi.array().items(Joi.number().unsafe()).allow(null),
|
|
2764
|
+
jetFireFlameResult: new EntitySchemas.FlameResultSchema().schema,
|
|
2765
|
+
poolFireFlameResult: new EntitySchemas.PoolFireFlameResultSchema().schema,
|
|
2766
|
+
resultCode: Joi.string().valid(...Object.values(Enums.ResultCode)),
|
|
2767
|
+
messages: Joi.array().items(Joi.string()),
|
|
2768
|
+
calculationElapsedTime: Joi.number().unsafe(),
|
|
2769
|
+
operationId: Joi.string().uuid().allow(null),
|
|
2770
|
+
}).unknown(true);
|
|
2771
|
+
|
|
2772
|
+
this.propertyTypes = {
|
|
2773
|
+
dischargeRecord: "Entities.DischargeRecord",
|
|
2774
|
+
distancesToJetFireRadiation: "number[]",
|
|
2775
|
+
jetContourPoints: "Entities.LocalPosition[]",
|
|
2776
|
+
nJetContourPoints: "number[]",
|
|
2777
|
+
areaContourJet: "number[]",
|
|
2778
|
+
distancesToFlamConcentration: "number[]",
|
|
2779
|
+
flamConcentrationsUsed: "number[]",
|
|
2780
|
+
flamConcContourPoints: "Entities.LocalPosition[]",
|
|
2781
|
+
nFlamConcContourPoints: "number[]",
|
|
2782
|
+
areaFootprintFlamConc: "number[]",
|
|
2783
|
+
distancesToPoolFireRadiation: "number[]",
|
|
2784
|
+
poolContourPoints: "Entities.LocalPosition[]",
|
|
2785
|
+
nPoolContourPoints: "number[]",
|
|
2786
|
+
areaContourPool: "number[]",
|
|
2787
|
+
explosionOverpressureResults: "Entities.ExplosionOverpressureResult[]",
|
|
2788
|
+
distancesToToxicConcentration: "number[]",
|
|
2789
|
+
toxicConcentrationUsed: "number[]",
|
|
2790
|
+
toxicConcContourPoints: "Entities.LocalPosition[]",
|
|
2791
|
+
nToxicConcContourPoints: "number[]",
|
|
2792
|
+
areaFootprintToxicConc: "number[]",
|
|
2793
|
+
jetFireFlameResult: "Entities.FlameResult",
|
|
2794
|
+
poolFireFlameResult: "Entities.PoolFireFlameResult",
|
|
2795
|
+
};
|
|
2796
|
+
}
|
|
2797
|
+
|
|
2798
|
+
validate(data: VesselLineRuptureLinkedRunCalculationResponseSchemaData): VesselLineRuptureLinkedRunCalculationResponse {
|
|
2799
|
+
const { error, value } = this.schema.validate(data, { abortEarly: false });
|
|
2800
|
+
if (error) {
|
|
2801
|
+
throw new Error(`Validation error: ${error.details.map((x) => x.message).join(", ")}`);
|
|
2802
|
+
}
|
|
2803
|
+
return this.makeCalculationResponse(value);
|
|
2804
|
+
}
|
|
2805
|
+
|
|
2806
|
+
makeCalculationResponse(data: VesselLineRuptureLinkedRunCalculationResponseSchemaData): VesselLineRuptureLinkedRunCalculationResponse {
|
|
2807
|
+
return new VesselLineRuptureLinkedRunCalculationResponse(
|
|
2808
|
+
data.dischargeRecord,
|
|
2809
|
+
data.distancesToJetFireRadiation,
|
|
2810
|
+
data.jetContourPoints,
|
|
2811
|
+
data.nJetContourPoints,
|
|
2812
|
+
data.areaContourJet,
|
|
2813
|
+
data.distancesToFlamConcentration,
|
|
2814
|
+
data.flamConcentrationsUsed,
|
|
2815
|
+
data.flamConcContourPoints,
|
|
2816
|
+
data.nFlamConcContourPoints,
|
|
2817
|
+
data.areaFootprintFlamConc,
|
|
2818
|
+
data.distancesToPoolFireRadiation,
|
|
2819
|
+
data.poolContourPoints,
|
|
2820
|
+
data.nPoolContourPoints,
|
|
2821
|
+
data.areaContourPool,
|
|
2822
|
+
data.explosionOverpressureResults,
|
|
2823
|
+
data.distancesToToxicConcentration,
|
|
2824
|
+
data.toxicConcentrationUsed,
|
|
2825
|
+
data.toxicConcContourPoints,
|
|
2826
|
+
data.nToxicConcContourPoints,
|
|
2827
|
+
data.areaFootprintToxicConc,
|
|
2828
|
+
data.jetFireFlameResult,
|
|
2829
|
+
data.poolFireFlameResult,
|
|
2830
|
+
data.resultCode,
|
|
2831
|
+
data.messages,
|
|
2832
|
+
data.calculationElapsedTime,
|
|
2833
|
+
data.operationId
|
|
2834
|
+
);
|
|
2835
|
+
}
|
|
2836
|
+
}
|
|
2837
|
+
|
|
2838
|
+
export interface VesselReliefValveLinkedRunCalculationRequestSchemaData {
|
|
2839
|
+
vessel: Entities.Vessel;
|
|
2840
|
+
reliefValve: Entities.ReliefValve;
|
|
2841
|
+
dischargeParameters: Entities.DischargeParameters;
|
|
2842
|
+
substrate: Entities.Substrate;
|
|
2843
|
+
weather: Entities.Weather;
|
|
2844
|
+
dispersionParameters: Entities.DispersionParameters[];
|
|
2845
|
+
dispersionParameterCount: number;
|
|
2846
|
+
endPointConcentration: number;
|
|
2847
|
+
flammableParameters: Entities.FlammableParameters;
|
|
2848
|
+
explosionParameters: Entities.ExplosionParameters;
|
|
2849
|
+
dispersionFlamOutputConfigs: Entities.DispersionOutputConfig[];
|
|
2850
|
+
dispersionFlamOutputConfigCount: number;
|
|
2851
|
+
dispersionToxicOutputConfigs: Entities.DispersionOutputConfig[];
|
|
2852
|
+
dispersionToxicOutputConfigCount: number;
|
|
2853
|
+
flammableOutputConfigs: Entities.FlammableOutputConfig[];
|
|
2854
|
+
flammableOutputConfigCount: number;
|
|
2855
|
+
explosionOutputConfigs: Entities.ExplosionOutputConfig[];
|
|
2856
|
+
explosionOutputConfigCount: number;
|
|
2857
|
+
explosionConfinedVolumes: Entities.ExplosionConfinedVolume[];
|
|
2858
|
+
explosionConfinedVolumeCount: number;
|
|
2859
|
+
}
|
|
2860
|
+
|
|
2861
|
+
class VesselReliefValveLinkedRunCalculationRequest extends CalculationRequestBase {
|
|
2862
|
+
vessel: Entities.Vessel;
|
|
2863
|
+
reliefValve: Entities.ReliefValve;
|
|
2864
|
+
dischargeParameters: Entities.DischargeParameters;
|
|
2865
|
+
substrate: Entities.Substrate;
|
|
2866
|
+
weather: Entities.Weather;
|
|
2867
|
+
dispersionParameters: Entities.DispersionParameters[];
|
|
2868
|
+
dispersionParameterCount: number;
|
|
2869
|
+
endPointConcentration: number;
|
|
2870
|
+
flammableParameters: Entities.FlammableParameters;
|
|
2871
|
+
explosionParameters: Entities.ExplosionParameters;
|
|
2872
|
+
dispersionFlamOutputConfigs: Entities.DispersionOutputConfig[];
|
|
2873
|
+
dispersionFlamOutputConfigCount: number;
|
|
2874
|
+
dispersionToxicOutputConfigs: Entities.DispersionOutputConfig[];
|
|
2875
|
+
dispersionToxicOutputConfigCount: number;
|
|
2876
|
+
flammableOutputConfigs: Entities.FlammableOutputConfig[];
|
|
2877
|
+
flammableOutputConfigCount: number;
|
|
2878
|
+
explosionOutputConfigs: Entities.ExplosionOutputConfig[];
|
|
2879
|
+
explosionOutputConfigCount: number;
|
|
2880
|
+
explosionConfinedVolumes: Entities.ExplosionConfinedVolume[];
|
|
2881
|
+
explosionConfinedVolumeCount: number;
|
|
2882
|
+
|
|
2883
|
+
/**
|
|
2884
|
+
* VesselReliefValveLinkedRun calculation request class.
|
|
2885
|
+
*
|
|
2886
|
+
* @param {Entities.Vessel} vessel - A Vessel entity.
|
|
2887
|
+
* @param {Entities.ReliefValve} reliefValve - A Relief Valve entity.
|
|
2888
|
+
* @param {Entities.DischargeParameters} dischargeParameters - A Discharge Parameters entity.
|
|
2889
|
+
* @param {Entities.Substrate} substrate - A Substrate entity.
|
|
2890
|
+
* @param {Entities.Weather} weather - A Weather entity.
|
|
2891
|
+
* @param {Entities.DispersionParameters[]} dispersionParameters - An array of Dispersion Parameters.
|
|
2892
|
+
* @param {number} dispersionParameterCount - Number of Dispersion Parameters.
|
|
2893
|
+
* @param {number} endPointConcentration - Concentration at which the dispersion calculations will terminate (v/v fraction).
|
|
2894
|
+
* @param {Entities.FlammableParameters} flammableParameters - A Flammable Parameters entity.
|
|
2895
|
+
* @param {Entities.ExplosionParameters} explosionParameters - An Explosion Parameters entity.
|
|
2896
|
+
* @param {Entities.DispersionOutputConfig[]} dispersionFlamOutputConfigs - An array of Dispersion Output Configs for flammable concentrations of interest.
|
|
2897
|
+
* @param {number} dispersionFlamOutputConfigCount - Number of Dispersion Output Configs for flammable concentrations of interest.
|
|
2898
|
+
* @param {Entities.DispersionOutputConfig[]} dispersionToxicOutputConfigs - An array of Dispersion Output Configs for toxic concentrations of interest.
|
|
2899
|
+
* @param {number} dispersionToxicOutputConfigCount - Number of Dispersion Output Configs for toxic concentrations of interest.
|
|
2900
|
+
* @param {Entities.FlammableOutputConfig[]} flammableOutputConfigs - An array of Flammable Output Configs for radiation levels of interest.
|
|
2901
|
+
* @param {number} flammableOutputConfigCount - Number of Flammable Ouput Configs for radiation levels of interest.
|
|
2902
|
+
* @param {Entities.ExplosionOutputConfig[]} explosionOutputConfigs - An array of Explosion Output Configs for overpressure levels of interest.
|
|
2903
|
+
* @param {number} explosionOutputConfigCount - Number of Explosion Output Configs for overpressure levels of interest.
|
|
2904
|
+
* @param {Entities.ExplosionConfinedVolume[]} explosionConfinedVolumes - An array of Explosion Confined Volumes.
|
|
2905
|
+
* @param {number} explosionConfinedVolumeCount - Number of Explosion Confined Volumes.
|
|
2906
|
+
*/
|
|
2907
|
+
constructor(
|
|
2908
|
+
vessel: Entities.Vessel,
|
|
2909
|
+
reliefValve: Entities.ReliefValve,
|
|
2910
|
+
dischargeParameters: Entities.DischargeParameters,
|
|
2911
|
+
substrate: Entities.Substrate,
|
|
2912
|
+
weather: Entities.Weather,
|
|
2913
|
+
dispersionParameters: Entities.DispersionParameters[],
|
|
2914
|
+
dispersionParameterCount: number,
|
|
2915
|
+
endPointConcentration: number,
|
|
2916
|
+
flammableParameters: Entities.FlammableParameters,
|
|
2917
|
+
explosionParameters: Entities.ExplosionParameters,
|
|
2918
|
+
dispersionFlamOutputConfigs: Entities.DispersionOutputConfig[],
|
|
2919
|
+
dispersionFlamOutputConfigCount: number,
|
|
2920
|
+
dispersionToxicOutputConfigs: Entities.DispersionOutputConfig[],
|
|
2921
|
+
dispersionToxicOutputConfigCount: number,
|
|
2922
|
+
flammableOutputConfigs: Entities.FlammableOutputConfig[],
|
|
2923
|
+
flammableOutputConfigCount: number,
|
|
2924
|
+
explosionOutputConfigs: Entities.ExplosionOutputConfig[],
|
|
2925
|
+
explosionOutputConfigCount: number,
|
|
2926
|
+
explosionConfinedVolumes: Entities.ExplosionConfinedVolume[],
|
|
2927
|
+
explosionConfinedVolumeCount: number
|
|
2928
|
+
) {
|
|
2929
|
+
super();
|
|
2930
|
+
this.vessel = vessel;
|
|
2931
|
+
this.reliefValve = reliefValve;
|
|
2932
|
+
this.dischargeParameters = dischargeParameters;
|
|
2933
|
+
this.substrate = substrate;
|
|
2934
|
+
this.weather = weather;
|
|
2935
|
+
this.dispersionParameters = dispersionParameters;
|
|
2936
|
+
this.dispersionParameterCount = dispersionParameterCount;
|
|
2937
|
+
this.endPointConcentration = endPointConcentration;
|
|
2938
|
+
this.flammableParameters = flammableParameters;
|
|
2939
|
+
this.explosionParameters = explosionParameters;
|
|
2940
|
+
this.dispersionFlamOutputConfigs = dispersionFlamOutputConfigs;
|
|
2941
|
+
this.dispersionFlamOutputConfigCount = dispersionFlamOutputConfigCount;
|
|
2942
|
+
this.dispersionToxicOutputConfigs = dispersionToxicOutputConfigs;
|
|
2943
|
+
this.dispersionToxicOutputConfigCount = dispersionToxicOutputConfigCount;
|
|
2944
|
+
this.flammableOutputConfigs = flammableOutputConfigs;
|
|
2945
|
+
this.flammableOutputConfigCount = flammableOutputConfigCount;
|
|
2946
|
+
this.explosionOutputConfigs = explosionOutputConfigs;
|
|
2947
|
+
this.explosionOutputConfigCount = explosionOutputConfigCount;
|
|
2948
|
+
this.explosionConfinedVolumes = explosionConfinedVolumes;
|
|
2949
|
+
this.explosionConfinedVolumeCount = explosionConfinedVolumeCount;
|
|
2950
|
+
}
|
|
2951
|
+
}
|
|
2952
|
+
|
|
2953
|
+
export class VesselReliefValveLinkedRunCalculationRequestSchema {
|
|
2954
|
+
schema: Joi.ObjectSchema;
|
|
2955
|
+
propertyTypes: Record<string, string>;
|
|
2956
|
+
|
|
2957
|
+
/**
|
|
2958
|
+
* Schema for the VesselReliefValveLinkedRun calculation request.
|
|
2959
|
+
*/
|
|
2960
|
+
constructor() {
|
|
2961
|
+
this.schema = Joi.object({
|
|
2962
|
+
vessel: new EntitySchemas.VesselSchema().schema,
|
|
2963
|
+
reliefValve: new EntitySchemas.ReliefValveSchema().schema,
|
|
2964
|
+
dischargeParameters: new EntitySchemas.DischargeParametersSchema().schema,
|
|
2965
|
+
substrate: new EntitySchemas.SubstrateSchema().schema,
|
|
2966
|
+
weather: new EntitySchemas.WeatherSchema().schema,
|
|
2967
|
+
dispersionParameters: Joi.array().items(new EntitySchemas.DispersionParametersSchema().schema).allow(null),
|
|
2968
|
+
dispersionParameterCount: Joi.number().integer(),
|
|
2969
|
+
endPointConcentration: Joi.number().unsafe(),
|
|
2970
|
+
flammableParameters: new EntitySchemas.FlammableParametersSchema().schema,
|
|
2971
|
+
explosionParameters: new EntitySchemas.ExplosionParametersSchema().schema,
|
|
2972
|
+
dispersionFlamOutputConfigs: Joi.array().items(new EntitySchemas.DispersionOutputConfigSchema().schema).allow(null),
|
|
2973
|
+
dispersionFlamOutputConfigCount: Joi.number().integer(),
|
|
2974
|
+
dispersionToxicOutputConfigs: Joi.array().items(new EntitySchemas.DispersionOutputConfigSchema().schema).allow(null),
|
|
2975
|
+
dispersionToxicOutputConfigCount: Joi.number().integer(),
|
|
2976
|
+
flammableOutputConfigs: Joi.array().items(new EntitySchemas.FlammableOutputConfigSchema().schema).allow(null),
|
|
2977
|
+
flammableOutputConfigCount: Joi.number().integer(),
|
|
2978
|
+
explosionOutputConfigs: Joi.array().items(new EntitySchemas.ExplosionOutputConfigSchema().schema).allow(null),
|
|
2979
|
+
explosionOutputConfigCount: Joi.number().integer(),
|
|
2980
|
+
explosionConfinedVolumes: Joi.array().items(new EntitySchemas.ExplosionConfinedVolumeSchema().schema).allow(null),
|
|
2981
|
+
explosionConfinedVolumeCount: Joi.number().integer(),
|
|
2982
|
+
}).unknown(true);
|
|
2983
|
+
|
|
2984
|
+
this.propertyTypes = {
|
|
2985
|
+
vessel: "Entities.Vessel",
|
|
2986
|
+
reliefValve: "Entities.ReliefValve",
|
|
2987
|
+
dischargeParameters: "Entities.DischargeParameters",
|
|
2988
|
+
substrate: "Entities.Substrate",
|
|
2989
|
+
weather: "Entities.Weather",
|
|
2990
|
+
dispersionParameters: "Entities.DispersionParameters[]",
|
|
2991
|
+
dispersionParameterCount: "number",
|
|
2992
|
+
endPointConcentration: "number",
|
|
2993
|
+
flammableParameters: "Entities.FlammableParameters",
|
|
2994
|
+
explosionParameters: "Entities.ExplosionParameters",
|
|
2995
|
+
dispersionFlamOutputConfigs: "Entities.DispersionOutputConfig[]",
|
|
2996
|
+
dispersionFlamOutputConfigCount: "number",
|
|
2997
|
+
dispersionToxicOutputConfigs: "Entities.DispersionOutputConfig[]",
|
|
2998
|
+
dispersionToxicOutputConfigCount: "number",
|
|
2999
|
+
flammableOutputConfigs: "Entities.FlammableOutputConfig[]",
|
|
3000
|
+
flammableOutputConfigCount: "number",
|
|
3001
|
+
explosionOutputConfigs: "Entities.ExplosionOutputConfig[]",
|
|
3002
|
+
explosionOutputConfigCount: "number",
|
|
3003
|
+
explosionConfinedVolumes: "Entities.ExplosionConfinedVolume[]",
|
|
3004
|
+
explosionConfinedVolumeCount: "number",
|
|
3005
|
+
};
|
|
3006
|
+
}
|
|
3007
|
+
|
|
3008
|
+
validate(data: VesselReliefValveLinkedRunCalculationRequestSchemaData): VesselReliefValveLinkedRunCalculationRequest {
|
|
3009
|
+
const { error, value } = this.schema.validate(data, { abortEarly: false });
|
|
3010
|
+
if (error) {
|
|
3011
|
+
throw new Error(`Validation error: ${error.details.map((x) => x.message).join(", ")}`);
|
|
3012
|
+
}
|
|
3013
|
+
return this.makeCalculationRequest(value);
|
|
3014
|
+
}
|
|
3015
|
+
|
|
3016
|
+
makeCalculationRequest(data: VesselReliefValveLinkedRunCalculationRequestSchemaData): VesselReliefValveLinkedRunCalculationRequest {
|
|
3017
|
+
return new VesselReliefValveLinkedRunCalculationRequest(
|
|
3018
|
+
data.vessel,
|
|
3019
|
+
data.reliefValve,
|
|
3020
|
+
data.dischargeParameters,
|
|
3021
|
+
data.substrate,
|
|
3022
|
+
data.weather,
|
|
3023
|
+
data.dispersionParameters,
|
|
3024
|
+
data.dispersionParameterCount,
|
|
3025
|
+
data.endPointConcentration,
|
|
3026
|
+
data.flammableParameters,
|
|
3027
|
+
data.explosionParameters,
|
|
3028
|
+
data.dispersionFlamOutputConfigs,
|
|
3029
|
+
data.dispersionFlamOutputConfigCount,
|
|
3030
|
+
data.dispersionToxicOutputConfigs,
|
|
3031
|
+
data.dispersionToxicOutputConfigCount,
|
|
3032
|
+
data.flammableOutputConfigs,
|
|
3033
|
+
data.flammableOutputConfigCount,
|
|
3034
|
+
data.explosionOutputConfigs,
|
|
3035
|
+
data.explosionOutputConfigCount,
|
|
3036
|
+
data.explosionConfinedVolumes,
|
|
3037
|
+
data.explosionConfinedVolumeCount
|
|
3038
|
+
);
|
|
3039
|
+
}
|
|
3040
|
+
}
|
|
3041
|
+
|
|
3042
|
+
export class VesselReliefValveLinkedRunCalculation extends CalculationBase {
|
|
3043
|
+
vessel: Entities.Vessel;
|
|
3044
|
+
reliefValve: Entities.ReliefValve;
|
|
3045
|
+
dischargeParameters: Entities.DischargeParameters;
|
|
3046
|
+
substrate: Entities.Substrate;
|
|
3047
|
+
weather: Entities.Weather;
|
|
3048
|
+
dispersionParameters: Entities.DispersionParameters[];
|
|
3049
|
+
dispersionParameterCount: number;
|
|
3050
|
+
endPointConcentration: number;
|
|
3051
|
+
flammableParameters: Entities.FlammableParameters;
|
|
3052
|
+
explosionParameters: Entities.ExplosionParameters;
|
|
3053
|
+
dispersionFlamOutputConfigs: Entities.DispersionOutputConfig[];
|
|
3054
|
+
dispersionFlamOutputConfigCount: number;
|
|
3055
|
+
dispersionToxicOutputConfigs: Entities.DispersionOutputConfig[];
|
|
3056
|
+
dispersionToxicOutputConfigCount: number;
|
|
3057
|
+
flammableOutputConfigs: Entities.FlammableOutputConfig[];
|
|
3058
|
+
flammableOutputConfigCount: number;
|
|
3059
|
+
explosionOutputConfigs: Entities.ExplosionOutputConfig[];
|
|
3060
|
+
explosionOutputConfigCount: number;
|
|
3061
|
+
explosionConfinedVolumes: Entities.ExplosionConfinedVolume[];
|
|
3062
|
+
explosionConfinedVolumeCount: number;
|
|
3063
|
+
dischargeRecord?: Entities.DischargeRecord;
|
|
3064
|
+
distancesToJetFireRadiation?: number[];
|
|
3065
|
+
jetContourPoints?: Entities.LocalPosition[];
|
|
3066
|
+
nJetContourPoints?: number[];
|
|
3067
|
+
areaContourJet?: number[];
|
|
3068
|
+
distancesToFlamConcentration?: number[];
|
|
3069
|
+
flamConcentrationsUsed?: number[];
|
|
3070
|
+
flamConcContourPoints?: Entities.LocalPosition[];
|
|
3071
|
+
nFlamConcContourPoints?: number[];
|
|
3072
|
+
areaFootprintFlamConc?: number[];
|
|
3073
|
+
distancesToPoolFireRadiation?: number[];
|
|
3074
|
+
poolContourPoints?: Entities.LocalPosition[];
|
|
3075
|
+
nPoolContourPoints?: number[];
|
|
3076
|
+
areaContourPool?: number[];
|
|
3077
|
+
explosionOverpressureResults?: Entities.ExplosionOverpressureResult[];
|
|
3078
|
+
distancesToToxicConcentration?: number[];
|
|
3079
|
+
toxicConcentrationUsed?: number[];
|
|
3080
|
+
toxicConcContourPoints?: Entities.LocalPosition[];
|
|
3081
|
+
nToxicConcContourPoints?: number[];
|
|
3082
|
+
areaFootprintToxicConc?: number[];
|
|
3083
|
+
jetFireFlameResult?: Entities.FlameResult;
|
|
3084
|
+
poolFireFlameResult?: Entities.PoolFireFlameResult;
|
|
3085
|
+
|
|
3086
|
+
/**
|
|
3087
|
+
* 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.
|
|
3088
|
+
*
|
|
3089
|
+
* @param {Entities.Vessel} vessel - A Vessel entity.
|
|
3090
|
+
* @param {Entities.ReliefValve} reliefValve - A Relief Valve entity.
|
|
3091
|
+
* @param {Entities.DischargeParameters} dischargeParameters - A Discharge Parameters entity.
|
|
3092
|
+
* @param {Entities.Substrate} substrate - A Substrate entity.
|
|
3093
|
+
* @param {Entities.Weather} weather - A Weather entity.
|
|
3094
|
+
* @param {Entities.DispersionParameters[]} dispersionParameters - An array of Dispersion Parameters.
|
|
3095
|
+
* @param {number} dispersionParameterCount - Number of Dispersion Parameters.
|
|
3096
|
+
* @param {number} endPointConcentration - Concentration at which the dispersion calculations will terminate (v/v fraction).
|
|
3097
|
+
* @param {Entities.FlammableParameters} flammableParameters - A Flammable Parameters entity.
|
|
3098
|
+
* @param {Entities.ExplosionParameters} explosionParameters - An Explosion Parameters entity.
|
|
3099
|
+
* @param {Entities.DispersionOutputConfig[]} dispersionFlamOutputConfigs - An array of Dispersion Output Configs for flammable concentrations of interest.
|
|
3100
|
+
* @param {number} dispersionFlamOutputConfigCount - Number of Dispersion Output Configs for flammable concentrations of interest.
|
|
3101
|
+
* @param {Entities.DispersionOutputConfig[]} dispersionToxicOutputConfigs - An array of Dispersion Output Configs for toxic concentrations of interest.
|
|
3102
|
+
* @param {number} dispersionToxicOutputConfigCount - Number of Dispersion Output Configs for toxic concentrations of interest.
|
|
3103
|
+
* @param {Entities.FlammableOutputConfig[]} flammableOutputConfigs - An array of Flammable Output Configs for radiation levels of interest.
|
|
3104
|
+
* @param {number} flammableOutputConfigCount - Number of Flammable Ouput Configs for radiation levels of interest.
|
|
3105
|
+
* @param {Entities.ExplosionOutputConfig[]} explosionOutputConfigs - An array of Explosion Output Configs for overpressure levels of interest.
|
|
3106
|
+
* @param {number} explosionOutputConfigCount - Number of Explosion Output Configs for overpressure levels of interest.
|
|
3107
|
+
* @param {Entities.ExplosionConfinedVolume[]} explosionConfinedVolumes - An array of Explosion Confined Volumes.
|
|
3108
|
+
* @param {number} explosionConfinedVolumeCount - Number of Explosion Confined Volumes.
|
|
3109
|
+
*/
|
|
3110
|
+
constructor(
|
|
3111
|
+
vessel: Entities.Vessel,
|
|
3112
|
+
reliefValve: Entities.ReliefValve,
|
|
3113
|
+
dischargeParameters: Entities.DischargeParameters,
|
|
3114
|
+
substrate: Entities.Substrate,
|
|
3115
|
+
weather: Entities.Weather,
|
|
3116
|
+
dispersionParameters: Entities.DispersionParameters[],
|
|
3117
|
+
dispersionParameterCount: number,
|
|
3118
|
+
endPointConcentration: number,
|
|
3119
|
+
flammableParameters: Entities.FlammableParameters,
|
|
3120
|
+
explosionParameters: Entities.ExplosionParameters,
|
|
3121
|
+
dispersionFlamOutputConfigs: Entities.DispersionOutputConfig[],
|
|
3122
|
+
dispersionFlamOutputConfigCount: number,
|
|
3123
|
+
dispersionToxicOutputConfigs: Entities.DispersionOutputConfig[],
|
|
3124
|
+
dispersionToxicOutputConfigCount: number,
|
|
3125
|
+
flammableOutputConfigs: Entities.FlammableOutputConfig[],
|
|
3126
|
+
flammableOutputConfigCount: number,
|
|
3127
|
+
explosionOutputConfigs: Entities.ExplosionOutputConfig[],
|
|
3128
|
+
explosionOutputConfigCount: number,
|
|
3129
|
+
explosionConfinedVolumes: Entities.ExplosionConfinedVolume[],
|
|
3130
|
+
explosionConfinedVolumeCount: number
|
|
3131
|
+
) {
|
|
3132
|
+
super();
|
|
3133
|
+
this.vessel = vessel;
|
|
3134
|
+
this.reliefValve = reliefValve;
|
|
3135
|
+
this.dischargeParameters = dischargeParameters;
|
|
3136
|
+
this.substrate = substrate;
|
|
3137
|
+
this.weather = weather;
|
|
3138
|
+
this.dispersionParameters = dispersionParameters;
|
|
3139
|
+
this.dispersionParameterCount = dispersionParameterCount;
|
|
3140
|
+
this.endPointConcentration = endPointConcentration;
|
|
3141
|
+
this.flammableParameters = flammableParameters;
|
|
3142
|
+
this.explosionParameters = explosionParameters;
|
|
3143
|
+
this.dispersionFlamOutputConfigs = dispersionFlamOutputConfigs;
|
|
3144
|
+
this.dispersionFlamOutputConfigCount = dispersionFlamOutputConfigCount;
|
|
3145
|
+
this.dispersionToxicOutputConfigs = dispersionToxicOutputConfigs;
|
|
3146
|
+
this.dispersionToxicOutputConfigCount = dispersionToxicOutputConfigCount;
|
|
3147
|
+
this.flammableOutputConfigs = flammableOutputConfigs;
|
|
3148
|
+
this.flammableOutputConfigCount = flammableOutputConfigCount;
|
|
3149
|
+
this.explosionOutputConfigs = explosionOutputConfigs;
|
|
3150
|
+
this.explosionOutputConfigCount = explosionOutputConfigCount;
|
|
3151
|
+
this.explosionConfinedVolumes = explosionConfinedVolumes;
|
|
3152
|
+
this.explosionConfinedVolumeCount = explosionConfinedVolumeCount;
|
|
3153
|
+
}
|
|
3154
|
+
|
|
3155
|
+
async run() {
|
|
3156
|
+
try {
|
|
3157
|
+
const request = new VesselReliefValveLinkedRunCalculationRequest(
|
|
3158
|
+
this.vessel,
|
|
3159
|
+
this.reliefValve,
|
|
3160
|
+
this.dischargeParameters,
|
|
3161
|
+
this.substrate,
|
|
3162
|
+
this.weather,
|
|
3163
|
+
this.dispersionParameters,
|
|
3164
|
+
this.dispersionParameterCount,
|
|
3165
|
+
this.endPointConcentration,
|
|
3166
|
+
this.flammableParameters,
|
|
3167
|
+
this.explosionParameters,
|
|
3168
|
+
this.dispersionFlamOutputConfigs,
|
|
3169
|
+
this.dispersionFlamOutputConfigCount,
|
|
3170
|
+
this.dispersionToxicOutputConfigs,
|
|
3171
|
+
this.dispersionToxicOutputConfigCount,
|
|
3172
|
+
this.flammableOutputConfigs,
|
|
3173
|
+
this.flammableOutputConfigCount,
|
|
3174
|
+
this.explosionOutputConfigs,
|
|
3175
|
+
this.explosionOutputConfigCount,
|
|
3176
|
+
this.explosionConfinedVolumes,
|
|
3177
|
+
this.explosionConfinedVolumeCount
|
|
3178
|
+
);
|
|
3179
|
+
|
|
3180
|
+
const schema = new VesselReliefValveLinkedRunCalculationRequestSchema();
|
|
3181
|
+
const validatedRequest = schema.validate(request);
|
|
3182
|
+
|
|
3183
|
+
const requestJson = JSON.stringify(validatedRequest);
|
|
3184
|
+
const url = `${getAnalyticsApiTarget()}calculatevesselreliefvalvelinkedrun?clientId=${getClientAliasId()}`;
|
|
3185
|
+
|
|
3186
|
+
this.resultCode = Enums.ResultCode.UNEXPECTED_APPLICATION_ERROR;
|
|
3187
|
+
|
|
3188
|
+
const response = await this.postRequest(url, requestJson);
|
|
3189
|
+
|
|
3190
|
+
if (response.status >= 200 && response.status < 300) {
|
|
3191
|
+
const schema = new VesselReliefValveLinkedRunCalculationResponseSchema();
|
|
3192
|
+
const validatedResponse = schema.validate(response.data);
|
|
3193
|
+
|
|
3194
|
+
this.resultCode = validatedResponse.resultCode;
|
|
3195
|
+
if (this.resultCode === Enums.ResultCode.SUCCESS) {
|
|
3196
|
+
this.dischargeRecord = validatedResponse.dischargeRecord;
|
|
3197
|
+
this.distancesToJetFireRadiation = validatedResponse.distancesToJetFireRadiation;
|
|
3198
|
+
this.jetContourPoints = validatedResponse.jetContourPoints;
|
|
3199
|
+
this.nJetContourPoints = validatedResponse.nJetContourPoints;
|
|
3200
|
+
this.areaContourJet = validatedResponse.areaContourJet;
|
|
3201
|
+
this.distancesToFlamConcentration = validatedResponse.distancesToFlamConcentration;
|
|
3202
|
+
this.flamConcentrationsUsed = validatedResponse.flamConcentrationsUsed;
|
|
3203
|
+
this.flamConcContourPoints = validatedResponse.flamConcContourPoints;
|
|
3204
|
+
this.nFlamConcContourPoints = validatedResponse.nFlamConcContourPoints;
|
|
3205
|
+
this.areaFootprintFlamConc = validatedResponse.areaFootprintFlamConc;
|
|
3206
|
+
this.distancesToPoolFireRadiation = validatedResponse.distancesToPoolFireRadiation;
|
|
3207
|
+
this.poolContourPoints = validatedResponse.poolContourPoints;
|
|
3208
|
+
this.nPoolContourPoints = validatedResponse.nPoolContourPoints;
|
|
3209
|
+
this.areaContourPool = validatedResponse.areaContourPool;
|
|
3210
|
+
this.explosionOverpressureResults = validatedResponse.explosionOverpressureResults;
|
|
3211
|
+
this.distancesToToxicConcentration = validatedResponse.distancesToToxicConcentration;
|
|
3212
|
+
this.toxicConcentrationUsed = validatedResponse.toxicConcentrationUsed;
|
|
3213
|
+
this.toxicConcContourPoints = validatedResponse.toxicConcContourPoints;
|
|
3214
|
+
this.nToxicConcContourPoints = validatedResponse.nToxicConcContourPoints;
|
|
3215
|
+
this.areaFootprintToxicConc = validatedResponse.areaFootprintToxicConc;
|
|
3216
|
+
this.jetFireFlameResult = validatedResponse.jetFireFlameResult;
|
|
3217
|
+
this.poolFireFlameResult = validatedResponse.poolFireFlameResult;
|
|
3218
|
+
this.resultCode = validatedResponse.resultCode;
|
|
3219
|
+
this.messages = validatedResponse.messages ?? [];
|
|
3220
|
+
this.calculationElapsedTime = validatedResponse.calculationElapsedTime;
|
|
3221
|
+
this.operationId = validatedResponse.operationId;
|
|
3222
|
+
} else {
|
|
3223
|
+
this.messages.push(...(validatedResponse.messages ?? []));
|
|
3224
|
+
}
|
|
3225
|
+
} else {
|
|
3226
|
+
this.handleFailedResponse(response);
|
|
3227
|
+
}
|
|
3228
|
+
} catch (error) {
|
|
3229
|
+
if (error instanceof Error) {
|
|
3230
|
+
this.messages.push(`Error: ${error.message}`);
|
|
3231
|
+
} else {
|
|
3232
|
+
this.messages.push(`Unexpected error: ${JSON.stringify(error)}`);
|
|
3233
|
+
}
|
|
3234
|
+
console.error(error);
|
|
3235
|
+
this.resultCode = Enums.ResultCode.UNEXPECTED_APPLICATION_ERROR;
|
|
3236
|
+
}
|
|
3237
|
+
|
|
3238
|
+
return this.resultCode;
|
|
3239
|
+
}
|
|
3240
|
+
|
|
3241
|
+
toString() {
|
|
3242
|
+
const parts = ["* VesselReliefValveLinkedRun"];
|
|
3243
|
+
|
|
3244
|
+
parts.push(`dischargeRecord: ${String(this.dischargeRecord)}`);
|
|
3245
|
+
parts.push("*** distancesToJetFireRadiation:");
|
|
3246
|
+
parts.push(
|
|
3247
|
+
this.distancesToJetFireRadiation && this.distancesToJetFireRadiation.length > 0
|
|
3248
|
+
? this.distancesToJetFireRadiation.map((point) => `distancesToJetFireRadiationElement: ${point}`).join("\n")
|
|
3249
|
+
: "distancesToJetFireRadiation does not contain any elements"
|
|
3250
|
+
);
|
|
3251
|
+
parts.push("*** jetContourPoints:");
|
|
3252
|
+
parts.push(
|
|
3253
|
+
this.jetContourPoints && this.jetContourPoints.length > 0
|
|
3254
|
+
? this.jetContourPoints.map((point) => `jetContourPointsElement: ${point}`).join("\n")
|
|
3255
|
+
: "jetContourPoints does not contain any elements"
|
|
3256
|
+
);
|
|
3257
|
+
parts.push("*** nJetContourPoints:");
|
|
3258
|
+
parts.push(
|
|
3259
|
+
this.nJetContourPoints && this.nJetContourPoints.length > 0
|
|
3260
|
+
? this.nJetContourPoints.map((point) => `nJetContourPointsElement: ${point}`).join("\n")
|
|
3261
|
+
: "nJetContourPoints does not contain any elements"
|
|
3262
|
+
);
|
|
3263
|
+
parts.push("*** areaContourJet:");
|
|
3264
|
+
parts.push(
|
|
3265
|
+
this.areaContourJet && this.areaContourJet.length > 0
|
|
3266
|
+
? this.areaContourJet.map((point) => `areaContourJetElement: ${point}`).join("\n")
|
|
3267
|
+
: "areaContourJet does not contain any elements"
|
|
3268
|
+
);
|
|
3269
|
+
parts.push("*** distancesToFlamConcentration:");
|
|
3270
|
+
parts.push(
|
|
3271
|
+
this.distancesToFlamConcentration && this.distancesToFlamConcentration.length > 0
|
|
3272
|
+
? this.distancesToFlamConcentration.map((point) => `distancesToFlamConcentrationElement: ${point}`).join("\n")
|
|
3273
|
+
: "distancesToFlamConcentration does not contain any elements"
|
|
3274
|
+
);
|
|
3275
|
+
parts.push("*** flamConcentrationsUsed:");
|
|
3276
|
+
parts.push(
|
|
3277
|
+
this.flamConcentrationsUsed && this.flamConcentrationsUsed.length > 0
|
|
3278
|
+
? this.flamConcentrationsUsed.map((point) => `flamConcentrationsUsedElement: ${point}`).join("\n")
|
|
3279
|
+
: "flamConcentrationsUsed does not contain any elements"
|
|
3280
|
+
);
|
|
3281
|
+
parts.push("*** flamConcContourPoints:");
|
|
3282
|
+
parts.push(
|
|
3283
|
+
this.flamConcContourPoints && this.flamConcContourPoints.length > 0
|
|
3284
|
+
? this.flamConcContourPoints.map((point) => `flamConcContourPointsElement: ${point}`).join("\n")
|
|
3285
|
+
: "flamConcContourPoints does not contain any elements"
|
|
3286
|
+
);
|
|
3287
|
+
parts.push("*** nFlamConcContourPoints:");
|
|
3288
|
+
parts.push(
|
|
3289
|
+
this.nFlamConcContourPoints && this.nFlamConcContourPoints.length > 0
|
|
3290
|
+
? this.nFlamConcContourPoints.map((point) => `nFlamConcContourPointsElement: ${point}`).join("\n")
|
|
3291
|
+
: "nFlamConcContourPoints does not contain any elements"
|
|
3292
|
+
);
|
|
3293
|
+
parts.push("*** areaFootprintFlamConc:");
|
|
3294
|
+
parts.push(
|
|
3295
|
+
this.areaFootprintFlamConc && this.areaFootprintFlamConc.length > 0
|
|
3296
|
+
? this.areaFootprintFlamConc.map((point) => `areaFootprintFlamConcElement: ${point}`).join("\n")
|
|
3297
|
+
: "areaFootprintFlamConc does not contain any elements"
|
|
3298
|
+
);
|
|
3299
|
+
parts.push("*** distancesToPoolFireRadiation:");
|
|
3300
|
+
parts.push(
|
|
3301
|
+
this.distancesToPoolFireRadiation && this.distancesToPoolFireRadiation.length > 0
|
|
3302
|
+
? this.distancesToPoolFireRadiation.map((point) => `distancesToPoolFireRadiationElement: ${point}`).join("\n")
|
|
3303
|
+
: "distancesToPoolFireRadiation does not contain any elements"
|
|
3304
|
+
);
|
|
3305
|
+
parts.push("*** poolContourPoints:");
|
|
3306
|
+
parts.push(
|
|
3307
|
+
this.poolContourPoints && this.poolContourPoints.length > 0
|
|
3308
|
+
? this.poolContourPoints.map((point) => `poolContourPointsElement: ${point}`).join("\n")
|
|
3309
|
+
: "poolContourPoints does not contain any elements"
|
|
3310
|
+
);
|
|
3311
|
+
parts.push("*** nPoolContourPoints:");
|
|
3312
|
+
parts.push(
|
|
3313
|
+
this.nPoolContourPoints && this.nPoolContourPoints.length > 0
|
|
3314
|
+
? this.nPoolContourPoints.map((point) => `nPoolContourPointsElement: ${point}`).join("\n")
|
|
3315
|
+
: "nPoolContourPoints does not contain any elements"
|
|
3316
|
+
);
|
|
3317
|
+
parts.push("*** areaContourPool:");
|
|
3318
|
+
parts.push(
|
|
3319
|
+
this.areaContourPool && this.areaContourPool.length > 0
|
|
3320
|
+
? this.areaContourPool.map((point) => `areaContourPoolElement: ${point}`).join("\n")
|
|
3321
|
+
: "areaContourPool does not contain any elements"
|
|
3322
|
+
);
|
|
3323
|
+
parts.push("*** explosionOverpressureResults:");
|
|
3324
|
+
parts.push(
|
|
3325
|
+
this.explosionOverpressureResults && this.explosionOverpressureResults.length > 0
|
|
3326
|
+
? this.explosionOverpressureResults.map((point) => `explosionOverpressureResultsElement: ${point}`).join("\n")
|
|
3327
|
+
: "explosionOverpressureResults does not contain any elements"
|
|
3328
|
+
);
|
|
3329
|
+
parts.push("*** distancesToToxicConcentration:");
|
|
3330
|
+
parts.push(
|
|
3331
|
+
this.distancesToToxicConcentration && this.distancesToToxicConcentration.length > 0
|
|
3332
|
+
? this.distancesToToxicConcentration.map((point) => `distancesToToxicConcentrationElement: ${point}`).join("\n")
|
|
3333
|
+
: "distancesToToxicConcentration does not contain any elements"
|
|
3334
|
+
);
|
|
3335
|
+
parts.push("*** toxicConcentrationUsed:");
|
|
3336
|
+
parts.push(
|
|
3337
|
+
this.toxicConcentrationUsed && this.toxicConcentrationUsed.length > 0
|
|
3338
|
+
? this.toxicConcentrationUsed.map((point) => `toxicConcentrationUsedElement: ${point}`).join("\n")
|
|
3339
|
+
: "toxicConcentrationUsed does not contain any elements"
|
|
3340
|
+
);
|
|
3341
|
+
parts.push("*** toxicConcContourPoints:");
|
|
3342
|
+
parts.push(
|
|
3343
|
+
this.toxicConcContourPoints && this.toxicConcContourPoints.length > 0
|
|
3344
|
+
? this.toxicConcContourPoints.map((point) => `toxicConcContourPointsElement: ${point}`).join("\n")
|
|
3345
|
+
: "toxicConcContourPoints does not contain any elements"
|
|
3346
|
+
);
|
|
3347
|
+
parts.push("*** nToxicConcContourPoints:");
|
|
3348
|
+
parts.push(
|
|
3349
|
+
this.nToxicConcContourPoints && this.nToxicConcContourPoints.length > 0
|
|
3350
|
+
? this.nToxicConcContourPoints.map((point) => `nToxicConcContourPointsElement: ${point}`).join("\n")
|
|
3351
|
+
: "nToxicConcContourPoints does not contain any elements"
|
|
3352
|
+
);
|
|
3353
|
+
parts.push("*** areaFootprintToxicConc:");
|
|
3354
|
+
parts.push(
|
|
3355
|
+
this.areaFootprintToxicConc && this.areaFootprintToxicConc.length > 0
|
|
3356
|
+
? this.areaFootprintToxicConc.map((point) => `areaFootprintToxicConcElement: ${point}`).join("\n")
|
|
3357
|
+
: "areaFootprintToxicConc does not contain any elements"
|
|
3358
|
+
);
|
|
3359
|
+
parts.push(`jetFireFlameResult: ${String(this.jetFireFlameResult)}`);
|
|
3360
|
+
parts.push(`poolFireFlameResult: ${String(this.poolFireFlameResult)}`);
|
|
3361
|
+
parts.push(`resultCode: ${String(this.resultCode)}`);
|
|
3362
|
+
parts.push("*** messages:");
|
|
3363
|
+
parts.push(`messages: ${this.messages !== undefined ? this.messages : "(None)"}`);
|
|
3364
|
+
parts.push(`calculationElapsedTime: ${this.calculationElapsedTime !== undefined ? this.calculationElapsedTime : "(None)"}`);
|
|
3365
|
+
parts.push(`operationId: ${this.operationId !== undefined ? this.operationId : "(None)"}`);
|
|
3366
|
+
|
|
3367
|
+
return parts.join("\n");
|
|
3368
|
+
}
|
|
3369
|
+
}
|
|
3370
|
+
|
|
3371
|
+
export class VesselReliefValveLinkedRunCalculationResponse extends CalculationResponseBase {
|
|
3372
|
+
dischargeRecord: Entities.DischargeRecord;
|
|
3373
|
+
distancesToJetFireRadiation: number[];
|
|
3374
|
+
jetContourPoints: Entities.LocalPosition[];
|
|
3375
|
+
nJetContourPoints: number[];
|
|
3376
|
+
areaContourJet: number[];
|
|
3377
|
+
distancesToFlamConcentration: number[];
|
|
3378
|
+
flamConcentrationsUsed: number[];
|
|
3379
|
+
flamConcContourPoints: Entities.LocalPosition[];
|
|
3380
|
+
nFlamConcContourPoints: number[];
|
|
3381
|
+
areaFootprintFlamConc: number[];
|
|
3382
|
+
distancesToPoolFireRadiation: number[];
|
|
3383
|
+
poolContourPoints: Entities.LocalPosition[];
|
|
3384
|
+
nPoolContourPoints: number[];
|
|
3385
|
+
areaContourPool: number[];
|
|
3386
|
+
explosionOverpressureResults: Entities.ExplosionOverpressureResult[];
|
|
3387
|
+
distancesToToxicConcentration: number[];
|
|
3388
|
+
toxicConcentrationUsed: number[];
|
|
3389
|
+
toxicConcContourPoints: Entities.LocalPosition[];
|
|
3390
|
+
nToxicConcContourPoints: number[];
|
|
3391
|
+
areaFootprintToxicConc: number[];
|
|
3392
|
+
jetFireFlameResult: Entities.FlameResult;
|
|
3393
|
+
poolFireFlameResult: Entities.PoolFireFlameResult;
|
|
3394
|
+
|
|
3395
|
+
/**
|
|
3396
|
+
* VesselReliefValveLinkedRun calculation response class.
|
|
3397
|
+
*
|
|
3398
|
+
* @param {Entities.DischargeRecord} dischargeRecord - A Discharge Record entity.
|
|
3399
|
+
* @param {number[]} distancesToJetFireRadiation - An array of distances to jet fire radiation levels, ordered according to the Flammable Output Configs.
|
|
3400
|
+
* @param {Entities.LocalPosition[]} jetContourPoints - An array of jet fire radiation ellipse contour points, ordered according to the Flammable Output Configs.
|
|
3401
|
+
* @param {number[]} nJetContourPoints - An array of the number of jet fire radiation ellipse contour points, ordered according to the Flammable Output Configs.
|
|
3402
|
+
* @param {number[]} areaContourJet - An array of areas of the jet fire ellipses, ordered according to the Flammable Output Configs.
|
|
3403
|
+
* @param {number[]} distancesToFlamConcentration - An array of distances to flammable concentration levels, ordered according to the Dispersion Output Configs for flammable concentrations of interest.
|
|
3404
|
+
* @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.
|
|
3405
|
+
* @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.
|
|
3406
|
+
* @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.
|
|
3407
|
+
* @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.
|
|
3408
|
+
* @param {number[]} distancesToPoolFireRadiation - An array of distances to pool fire radiation levels, ordered according to the Flammable Output Configs.
|
|
3409
|
+
* @param {Entities.LocalPosition[]} poolContourPoints - An array of pool fire radiation contour points, ordered according to the Flammable Output Configs.
|
|
3410
|
+
* @param {number[]} nPoolContourPoints - An array of the number of pool fire radiation contour points, ordered according to the Flammable Output Configs.
|
|
3411
|
+
* @param {number[]} areaContourPool - An array of areas of the pool fire ellipses, ordered according to the Flammable Output Configs.
|
|
3412
|
+
* @param {Entities.ExplosionOverpressureResult[]} explosionOverpressureResults - An array of Explosion Overpressure Results, ordered according to the Explosion Output Configs.
|
|
3413
|
+
* @param {number[]} distancesToToxicConcentration - An array of distances to toxic concentration levels, ordered according to the Dispersion Output Configs for toxic concentrations of interest.
|
|
3414
|
+
* @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.
|
|
3415
|
+
* @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.
|
|
3416
|
+
* @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.
|
|
3417
|
+
* @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.
|
|
3418
|
+
* @param {Entities.FlameResult} jetFireFlameResult - A Flame Results entity, for jet fire.
|
|
3419
|
+
* @param {Entities.PoolFireFlameResult} poolFireFlameResult - A Pool Fire Flame Results entity, for pool fire.
|
|
3420
|
+
*/
|
|
3421
|
+
constructor(
|
|
3422
|
+
dischargeRecord: Entities.DischargeRecord,
|
|
3423
|
+
distancesToJetFireRadiation: number[],
|
|
3424
|
+
jetContourPoints: Entities.LocalPosition[],
|
|
3425
|
+
nJetContourPoints: number[],
|
|
3426
|
+
areaContourJet: number[],
|
|
3427
|
+
distancesToFlamConcentration: number[],
|
|
3428
|
+
flamConcentrationsUsed: number[],
|
|
3429
|
+
flamConcContourPoints: Entities.LocalPosition[],
|
|
3430
|
+
nFlamConcContourPoints: number[],
|
|
3431
|
+
areaFootprintFlamConc: number[],
|
|
3432
|
+
distancesToPoolFireRadiation: number[],
|
|
3433
|
+
poolContourPoints: Entities.LocalPosition[],
|
|
3434
|
+
nPoolContourPoints: number[],
|
|
3435
|
+
areaContourPool: number[],
|
|
3436
|
+
explosionOverpressureResults: Entities.ExplosionOverpressureResult[],
|
|
3437
|
+
distancesToToxicConcentration: number[],
|
|
3438
|
+
toxicConcentrationUsed: number[],
|
|
3439
|
+
toxicConcContourPoints: Entities.LocalPosition[],
|
|
3440
|
+
nToxicConcContourPoints: number[],
|
|
3441
|
+
areaFootprintToxicConc: number[],
|
|
3442
|
+
jetFireFlameResult: Entities.FlameResult,
|
|
3443
|
+
poolFireFlameResult: Entities.PoolFireFlameResult,
|
|
3444
|
+
resultCode: Enums.ResultCode,
|
|
3445
|
+
messages: string[],
|
|
3446
|
+
calculationElapsedTime: number,
|
|
3447
|
+
operationId: string
|
|
3448
|
+
) {
|
|
3449
|
+
super();
|
|
3450
|
+
this.dischargeRecord = dischargeRecord;
|
|
3451
|
+
this.distancesToJetFireRadiation = distancesToJetFireRadiation;
|
|
3452
|
+
this.jetContourPoints = jetContourPoints;
|
|
3453
|
+
this.nJetContourPoints = nJetContourPoints;
|
|
3454
|
+
this.areaContourJet = areaContourJet;
|
|
3455
|
+
this.distancesToFlamConcentration = distancesToFlamConcentration;
|
|
3456
|
+
this.flamConcentrationsUsed = flamConcentrationsUsed;
|
|
3457
|
+
this.flamConcContourPoints = flamConcContourPoints;
|
|
3458
|
+
this.nFlamConcContourPoints = nFlamConcContourPoints;
|
|
3459
|
+
this.areaFootprintFlamConc = areaFootprintFlamConc;
|
|
3460
|
+
this.distancesToPoolFireRadiation = distancesToPoolFireRadiation;
|
|
3461
|
+
this.poolContourPoints = poolContourPoints;
|
|
3462
|
+
this.nPoolContourPoints = nPoolContourPoints;
|
|
3463
|
+
this.areaContourPool = areaContourPool;
|
|
3464
|
+
this.explosionOverpressureResults = explosionOverpressureResults;
|
|
3465
|
+
this.distancesToToxicConcentration = distancesToToxicConcentration;
|
|
3466
|
+
this.toxicConcentrationUsed = toxicConcentrationUsed;
|
|
3467
|
+
this.toxicConcContourPoints = toxicConcContourPoints;
|
|
3468
|
+
this.nToxicConcContourPoints = nToxicConcContourPoints;
|
|
3469
|
+
this.areaFootprintToxicConc = areaFootprintToxicConc;
|
|
3470
|
+
this.jetFireFlameResult = jetFireFlameResult;
|
|
3471
|
+
this.poolFireFlameResult = poolFireFlameResult;
|
|
3472
|
+
this.resultCode = resultCode;
|
|
3473
|
+
this.messages = messages;
|
|
3474
|
+
this.calculationElapsedTime = calculationElapsedTime;
|
|
3475
|
+
this.operationId = operationId;
|
|
3476
|
+
}
|
|
3477
|
+
|
|
3478
|
+
initialiseFromDictionary(data: { [key: string]: unknown }) {
|
|
3479
|
+
if (data.dischargeRecord) {
|
|
3480
|
+
this.dischargeRecord = new Entities.DischargeRecord();
|
|
3481
|
+
this.dischargeRecord.initialiseFromDictionary(data.dischargeRecord as { [key: string]: unknown });
|
|
3482
|
+
}
|
|
3483
|
+
if (data.distancesToJetFireRadiation && Array.isArray(data.distancesToJetFireRadiation)) {
|
|
3484
|
+
this.distancesToJetFireRadiation = data.distancesToJetFireRadiation.map((item) => parseFloat(item));
|
|
3485
|
+
}
|
|
3486
|
+
if (data.jetContourPoints && Array.isArray(data.jetContourPoints)) {
|
|
3487
|
+
this.jetContourPoints = data.jetContourPoints.map(
|
|
3488
|
+
(item) => {
|
|
3489
|
+
const record = new Entities.LocalPosition();
|
|
3490
|
+
record.initialiseFromDictionary(item);
|
|
3491
|
+
return record;
|
|
3492
|
+
}
|
|
3493
|
+
);
|
|
3494
|
+
}
|
|
3495
|
+
if (data.nJetContourPoints && Array.isArray(data.nJetContourPoints)) {
|
|
3496
|
+
this.nJetContourPoints = data.nJetContourPoints.map((item) => parseInt(item));
|
|
3497
|
+
}
|
|
3498
|
+
if (data.areaContourJet && Array.isArray(data.areaContourJet)) {
|
|
3499
|
+
this.areaContourJet = data.areaContourJet.map((item) => parseFloat(item));
|
|
3500
|
+
}
|
|
3501
|
+
if (data.distancesToFlamConcentration && Array.isArray(data.distancesToFlamConcentration)) {
|
|
3502
|
+
this.distancesToFlamConcentration = data.distancesToFlamConcentration.map((item) => parseFloat(item));
|
|
3503
|
+
}
|
|
3504
|
+
if (data.flamConcentrationsUsed && Array.isArray(data.flamConcentrationsUsed)) {
|
|
3505
|
+
this.flamConcentrationsUsed = data.flamConcentrationsUsed.map((item) => parseFloat(item));
|
|
3506
|
+
}
|
|
3507
|
+
if (data.flamConcContourPoints && Array.isArray(data.flamConcContourPoints)) {
|
|
3508
|
+
this.flamConcContourPoints = data.flamConcContourPoints.map(
|
|
3509
|
+
(item) => {
|
|
3510
|
+
const record = new Entities.LocalPosition();
|
|
3511
|
+
record.initialiseFromDictionary(item);
|
|
3512
|
+
return record;
|
|
3513
|
+
}
|
|
3514
|
+
);
|
|
3515
|
+
}
|
|
3516
|
+
if (data.nFlamConcContourPoints && Array.isArray(data.nFlamConcContourPoints)) {
|
|
3517
|
+
this.nFlamConcContourPoints = data.nFlamConcContourPoints.map((item) => parseInt(item));
|
|
3518
|
+
}
|
|
3519
|
+
if (data.areaFootprintFlamConc && Array.isArray(data.areaFootprintFlamConc)) {
|
|
3520
|
+
this.areaFootprintFlamConc = data.areaFootprintFlamConc.map((item) => parseFloat(item));
|
|
3521
|
+
}
|
|
3522
|
+
if (data.distancesToPoolFireRadiation && Array.isArray(data.distancesToPoolFireRadiation)) {
|
|
3523
|
+
this.distancesToPoolFireRadiation = data.distancesToPoolFireRadiation.map((item) => parseFloat(item));
|
|
3524
|
+
}
|
|
3525
|
+
if (data.poolContourPoints && Array.isArray(data.poolContourPoints)) {
|
|
3526
|
+
this.poolContourPoints = data.poolContourPoints.map(
|
|
3527
|
+
(item) => {
|
|
3528
|
+
const record = new Entities.LocalPosition();
|
|
3529
|
+
record.initialiseFromDictionary(item);
|
|
3530
|
+
return record;
|
|
3531
|
+
}
|
|
3532
|
+
);
|
|
3533
|
+
}
|
|
3534
|
+
if (data.nPoolContourPoints && Array.isArray(data.nPoolContourPoints)) {
|
|
3535
|
+
this.nPoolContourPoints = data.nPoolContourPoints.map((item) => parseInt(item));
|
|
3536
|
+
}
|
|
3537
|
+
if (data.areaContourPool && Array.isArray(data.areaContourPool)) {
|
|
3538
|
+
this.areaContourPool = data.areaContourPool.map((item) => parseFloat(item));
|
|
3539
|
+
}
|
|
3540
|
+
if (data.explosionOverpressureResults && Array.isArray(data.explosionOverpressureResults)) {
|
|
3541
|
+
this.explosionOverpressureResults = data.explosionOverpressureResults.map(
|
|
3542
|
+
(item) => {
|
|
3543
|
+
const record = new Entities.ExplosionOverpressureResult();
|
|
3544
|
+
record.initialiseFromDictionary(item);
|
|
3545
|
+
return record;
|
|
3546
|
+
}
|
|
3547
|
+
);
|
|
3548
|
+
}
|
|
3549
|
+
if (data.distancesToToxicConcentration && Array.isArray(data.distancesToToxicConcentration)) {
|
|
3550
|
+
this.distancesToToxicConcentration = data.distancesToToxicConcentration.map((item) => parseFloat(item));
|
|
3551
|
+
}
|
|
3552
|
+
if (data.toxicConcentrationUsed && Array.isArray(data.toxicConcentrationUsed)) {
|
|
3553
|
+
this.toxicConcentrationUsed = data.toxicConcentrationUsed.map((item) => parseFloat(item));
|
|
3554
|
+
}
|
|
3555
|
+
if (data.toxicConcContourPoints && Array.isArray(data.toxicConcContourPoints)) {
|
|
3556
|
+
this.toxicConcContourPoints = data.toxicConcContourPoints.map(
|
|
3557
|
+
(item) => {
|
|
3558
|
+
const record = new Entities.LocalPosition();
|
|
3559
|
+
record.initialiseFromDictionary(item);
|
|
3560
|
+
return record;
|
|
3561
|
+
}
|
|
3562
|
+
);
|
|
3563
|
+
}
|
|
3564
|
+
if (data.nToxicConcContourPoints && Array.isArray(data.nToxicConcContourPoints)) {
|
|
3565
|
+
this.nToxicConcContourPoints = data.nToxicConcContourPoints.map((item) => parseInt(item));
|
|
3566
|
+
}
|
|
3567
|
+
if (data.areaFootprintToxicConc && Array.isArray(data.areaFootprintToxicConc)) {
|
|
3568
|
+
this.areaFootprintToxicConc = data.areaFootprintToxicConc.map((item) => parseFloat(item));
|
|
3569
|
+
}
|
|
3570
|
+
if (data.jetFireFlameResult) {
|
|
3571
|
+
this.jetFireFlameResult = new Entities.FlameResult();
|
|
3572
|
+
this.jetFireFlameResult.initialiseFromDictionary(data.jetFireFlameResult as { [key: string]: unknown });
|
|
3573
|
+
}
|
|
3574
|
+
if (data.poolFireFlameResult) {
|
|
3575
|
+
this.poolFireFlameResult = new Entities.PoolFireFlameResult();
|
|
3576
|
+
this.poolFireFlameResult.initialiseFromDictionary(data.poolFireFlameResult as { [key: string]: unknown });
|
|
3577
|
+
}
|
|
3578
|
+
if (data.resultCode !== undefined && (typeof data.resultCode === "string" || typeof data.resultCode === "number")) {
|
|
3579
|
+
this.resultCode = data.resultCode as Enums.ResultCode;
|
|
3580
|
+
}
|
|
3581
|
+
this.messages = this.messages ?? [];
|
|
3582
|
+
if (data.messages && Array.isArray(data.messages)) {
|
|
3583
|
+
this.messages.push(...data.messages);
|
|
3584
|
+
}
|
|
3585
|
+
if (data.calculationElapsedTime !== undefined && typeof data.calculationElapsedTime === "number") {
|
|
3586
|
+
this.calculationElapsedTime = data.calculationElapsedTime as number;
|
|
3587
|
+
}
|
|
3588
|
+
if (data.operationId !== undefined && typeof data.operationId === "string") {
|
|
3589
|
+
this.operationId = data.operationId as string;
|
|
3590
|
+
}
|
|
3591
|
+
}
|
|
3592
|
+
}
|
|
3593
|
+
|
|
3594
|
+
export interface VesselReliefValveLinkedRunCalculationResponseSchemaData {
|
|
3595
|
+
dischargeRecord: Entities.DischargeRecord;
|
|
3596
|
+
distancesToJetFireRadiation: number[];
|
|
3597
|
+
jetContourPoints: Entities.LocalPosition[];
|
|
3598
|
+
nJetContourPoints: number[];
|
|
3599
|
+
areaContourJet: number[];
|
|
3600
|
+
distancesToFlamConcentration: number[];
|
|
3601
|
+
flamConcentrationsUsed: number[];
|
|
3602
|
+
flamConcContourPoints: Entities.LocalPosition[];
|
|
3603
|
+
nFlamConcContourPoints: number[];
|
|
3604
|
+
areaFootprintFlamConc: number[];
|
|
3605
|
+
distancesToPoolFireRadiation: number[];
|
|
3606
|
+
poolContourPoints: Entities.LocalPosition[];
|
|
3607
|
+
nPoolContourPoints: number[];
|
|
3608
|
+
areaContourPool: number[];
|
|
3609
|
+
explosionOverpressureResults: Entities.ExplosionOverpressureResult[];
|
|
3610
|
+
distancesToToxicConcentration: number[];
|
|
3611
|
+
toxicConcentrationUsed: number[];
|
|
3612
|
+
toxicConcContourPoints: Entities.LocalPosition[];
|
|
3613
|
+
nToxicConcContourPoints: number[];
|
|
3614
|
+
areaFootprintToxicConc: number[];
|
|
3615
|
+
jetFireFlameResult: Entities.FlameResult;
|
|
3616
|
+
poolFireFlameResult: Entities.PoolFireFlameResult;
|
|
3617
|
+
resultCode: Enums.ResultCode;
|
|
3618
|
+
messages: string[];
|
|
3619
|
+
calculationElapsedTime: number;
|
|
3620
|
+
operationId: string;
|
|
3621
|
+
}
|
|
3622
|
+
|
|
3623
|
+
export class VesselReliefValveLinkedRunCalculationResponseSchema {
|
|
3624
|
+
schema: Joi.ObjectSchema;
|
|
3625
|
+
propertyTypes: Record<string, string>;
|
|
3626
|
+
|
|
3627
|
+
/**
|
|
3628
|
+
* Schema for the VesselReliefValveLinkedRun calculation response.
|
|
3629
|
+
*/
|
|
3630
|
+
constructor() {
|
|
3631
|
+
this.schema = Joi.object({
|
|
3632
|
+
dischargeRecord: new EntitySchemas.DischargeRecordSchema().schema,
|
|
3633
|
+
distancesToJetFireRadiation: Joi.array().items(Joi.number().unsafe()).allow(null),
|
|
3634
|
+
jetContourPoints: Joi.array().items(new EntitySchemas.LocalPositionSchema().schema).allow(null),
|
|
3635
|
+
nJetContourPoints: Joi.array().items(Joi.number().integer()).allow(null),
|
|
3636
|
+
areaContourJet: Joi.array().items(Joi.number().unsafe()).allow(null),
|
|
3637
|
+
distancesToFlamConcentration: Joi.array().items(Joi.number().unsafe()).allow(null),
|
|
3638
|
+
flamConcentrationsUsed: Joi.array().items(Joi.number().unsafe()).allow(null),
|
|
3639
|
+
flamConcContourPoints: Joi.array().items(new EntitySchemas.LocalPositionSchema().schema).allow(null),
|
|
3640
|
+
nFlamConcContourPoints: Joi.array().items(Joi.number().integer()).allow(null),
|
|
3641
|
+
areaFootprintFlamConc: Joi.array().items(Joi.number().unsafe()).allow(null),
|
|
3642
|
+
distancesToPoolFireRadiation: Joi.array().items(Joi.number().unsafe()).allow(null),
|
|
3643
|
+
poolContourPoints: Joi.array().items(new EntitySchemas.LocalPositionSchema().schema).allow(null),
|
|
3644
|
+
nPoolContourPoints: Joi.array().items(Joi.number().integer()).allow(null),
|
|
3645
|
+
areaContourPool: Joi.array().items(Joi.number().unsafe()).allow(null),
|
|
3646
|
+
explosionOverpressureResults: Joi.array().items(new EntitySchemas.ExplosionOverpressureResultSchema().schema).allow(null),
|
|
3647
|
+
distancesToToxicConcentration: Joi.array().items(Joi.number().unsafe()).allow(null),
|
|
3648
|
+
toxicConcentrationUsed: Joi.array().items(Joi.number().unsafe()).allow(null),
|
|
3649
|
+
toxicConcContourPoints: Joi.array().items(new EntitySchemas.LocalPositionSchema().schema).allow(null),
|
|
3650
|
+
nToxicConcContourPoints: Joi.array().items(Joi.number().integer()).allow(null),
|
|
3651
|
+
areaFootprintToxicConc: Joi.array().items(Joi.number().unsafe()).allow(null),
|
|
3652
|
+
jetFireFlameResult: new EntitySchemas.FlameResultSchema().schema,
|
|
3653
|
+
poolFireFlameResult: new EntitySchemas.PoolFireFlameResultSchema().schema,
|
|
3654
|
+
resultCode: Joi.string().valid(...Object.values(Enums.ResultCode)),
|
|
3655
|
+
messages: Joi.array().items(Joi.string()),
|
|
3656
|
+
calculationElapsedTime: Joi.number().unsafe(),
|
|
3657
|
+
operationId: Joi.string().uuid().allow(null),
|
|
3658
|
+
}).unknown(true);
|
|
3659
|
+
|
|
3660
|
+
this.propertyTypes = {
|
|
3661
|
+
dischargeRecord: "Entities.DischargeRecord",
|
|
3662
|
+
distancesToJetFireRadiation: "number[]",
|
|
3663
|
+
jetContourPoints: "Entities.LocalPosition[]",
|
|
3664
|
+
nJetContourPoints: "number[]",
|
|
3665
|
+
areaContourJet: "number[]",
|
|
3666
|
+
distancesToFlamConcentration: "number[]",
|
|
3667
|
+
flamConcentrationsUsed: "number[]",
|
|
3668
|
+
flamConcContourPoints: "Entities.LocalPosition[]",
|
|
3669
|
+
nFlamConcContourPoints: "number[]",
|
|
3670
|
+
areaFootprintFlamConc: "number[]",
|
|
3671
|
+
distancesToPoolFireRadiation: "number[]",
|
|
3672
|
+
poolContourPoints: "Entities.LocalPosition[]",
|
|
3673
|
+
nPoolContourPoints: "number[]",
|
|
3674
|
+
areaContourPool: "number[]",
|
|
3675
|
+
explosionOverpressureResults: "Entities.ExplosionOverpressureResult[]",
|
|
3676
|
+
distancesToToxicConcentration: "number[]",
|
|
3677
|
+
toxicConcentrationUsed: "number[]",
|
|
3678
|
+
toxicConcContourPoints: "Entities.LocalPosition[]",
|
|
3679
|
+
nToxicConcContourPoints: "number[]",
|
|
3680
|
+
areaFootprintToxicConc: "number[]",
|
|
3681
|
+
jetFireFlameResult: "Entities.FlameResult",
|
|
3682
|
+
poolFireFlameResult: "Entities.PoolFireFlameResult",
|
|
3683
|
+
};
|
|
3684
|
+
}
|
|
3685
|
+
|
|
3686
|
+
validate(data: VesselReliefValveLinkedRunCalculationResponseSchemaData): VesselReliefValveLinkedRunCalculationResponse {
|
|
3687
|
+
const { error, value } = this.schema.validate(data, { abortEarly: false });
|
|
3688
|
+
if (error) {
|
|
3689
|
+
throw new Error(`Validation error: ${error.details.map((x) => x.message).join(", ")}`);
|
|
3690
|
+
}
|
|
3691
|
+
return this.makeCalculationResponse(value);
|
|
3692
|
+
}
|
|
3693
|
+
|
|
3694
|
+
makeCalculationResponse(data: VesselReliefValveLinkedRunCalculationResponseSchemaData): VesselReliefValveLinkedRunCalculationResponse {
|
|
3695
|
+
return new VesselReliefValveLinkedRunCalculationResponse(
|
|
3696
|
+
data.dischargeRecord,
|
|
3697
|
+
data.distancesToJetFireRadiation,
|
|
3698
|
+
data.jetContourPoints,
|
|
3699
|
+
data.nJetContourPoints,
|
|
3700
|
+
data.areaContourJet,
|
|
3701
|
+
data.distancesToFlamConcentration,
|
|
3702
|
+
data.flamConcentrationsUsed,
|
|
3703
|
+
data.flamConcContourPoints,
|
|
3704
|
+
data.nFlamConcContourPoints,
|
|
3705
|
+
data.areaFootprintFlamConc,
|
|
3706
|
+
data.distancesToPoolFireRadiation,
|
|
3707
|
+
data.poolContourPoints,
|
|
3708
|
+
data.nPoolContourPoints,
|
|
3709
|
+
data.areaContourPool,
|
|
3710
|
+
data.explosionOverpressureResults,
|
|
3711
|
+
data.distancesToToxicConcentration,
|
|
3712
|
+
data.toxicConcentrationUsed,
|
|
3713
|
+
data.toxicConcContourPoints,
|
|
3714
|
+
data.nToxicConcContourPoints,
|
|
3715
|
+
data.areaFootprintToxicConc,
|
|
3716
|
+
data.jetFireFlameResult,
|
|
3717
|
+
data.poolFireFlameResult,
|
|
3718
|
+
data.resultCode,
|
|
3719
|
+
data.messages,
|
|
3720
|
+
data.calculationElapsedTime,
|
|
3721
|
+
data.operationId
|
|
3722
|
+
);
|
|
3723
|
+
}
|
|
3724
|
+
}
|