@dnv-plant/typescriptpws 1.0.97 → 1.0.98-alpha.2397542

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/src/entities.ts CHANGED
@@ -1,15 +1,19 @@
1
- /***********************************************************************
2
- * This file has been auto-generated by a code generation tool.
3
- *
4
- * DO NOT MODIFY THIS FILE
5
- * This file is maintained by DNV.
6
- * Editing it may lead to inconsistent results and limit DNV's ability to provide support.
7
- * Please contact DNV if you believe changes are required.
8
- *
9
- * Version: 1.0.97
10
- * Date/time: 13 Apr 2026 17:02:52
11
- * Template: templates/typescriptpws/entities.razor.
12
- ***********************************************************************/
1
+ // ************************************************************************************
2
+ // *
3
+ // * This file has been auto-generated by a code generation tool.
4
+ // *
5
+ // * DO NOT MODIFY THIS FILE
6
+ // * This file is maintained by DNV.
7
+ // * Editing it may lead to inconsistent results and limit DNV's ability to provide support.
8
+ // * Please contact DNV if you believe changes are required.
9
+ // *
10
+ // * API version: 1.0.
11
+ // * MDE version: 9.3.8211.
12
+ // * Package version: 1.0.98
13
+ // * Date/time: 23 Jun 2026 12:11:11.
14
+ // * Template: TYPE_SCRIPT_PWS/entities.sbn.
15
+ // *
16
+ // ************************************************************************************
13
17
 
14
18
  import * as Enums from './enums';
15
19
 
@@ -23,6 +27,18 @@ class EntityBase {
23
27
  this.typeId = typeId;
24
28
  this.displayName = displayName;
25
29
  }
30
+
31
+ /**
32
+ * Getter for Id property (PascalCase for REST API compatibility).
33
+ */
34
+ get Id(): string | undefined {
35
+ return this.id;
36
+ }
37
+
38
+ set Id(value: string | undefined) {
39
+ this.id = value;
40
+ }
41
+
26
42
  /**
27
43
  * Base class for all entities.
28
44
  */
@@ -30,6 +46,9 @@ class EntityBase {
30
46
  if (data.id !== undefined && typeof data.id === 'string') {
31
47
  this.id = data.id as string;
32
48
  }
49
+ if (data.Id !== undefined && typeof data.Id === 'string') {
50
+ this.id = data.Id as string;
51
+ }
33
52
  if (data.typeId !== undefined && typeof data.typeId === 'string') {
34
53
  this.typeId = data.typeId as string;
35
54
  }
@@ -48,7 +67,6 @@ export class LocalPosition extends EntityBase {
48
67
  x: number;
49
68
  y: number;
50
69
  z: number;
51
-
52
70
  /**
53
71
  * Position with reference to some arbitrary local origin and axes.
54
72
  *
@@ -86,7 +104,6 @@ export class LocalPosition extends EntityBase {
86
104
 
87
105
  export class Asset extends EntityBase {
88
106
  location: LocalPosition;
89
-
90
107
  /**
91
108
  * Any equipment to be modeled, vessels, pipelines.
92
109
  *
@@ -116,12 +133,11 @@ export class Asset extends EntityBase {
116
133
  export class MaterialComponent extends EntityBase {
117
134
  name: string;
118
135
  moleFraction: number;
119
-
120
136
  /**
121
137
  * Constituent component of a material.
122
138
  *
123
139
  * @param {Object} options - Initialisation options
124
- * @param {string} options.name - Name of the component. (default value is "")
140
+ * @param {string} options.name - Name of the component.
125
141
  * @param {number} options.moleFraction - Mole fraction of the component in the material. [fraction] (default value is 1)
126
142
  */
127
143
  constructor(options?: { id?: string; typeId?: string; displayName?: string; name?: string; moleFraction?: number }) {
@@ -149,30 +165,35 @@ export class MaterialComponent extends EntityBase {
149
165
 
150
166
  export class Material extends EntityBase {
151
167
  name: string;
152
- components: MaterialComponent[];
153
168
  componentCount: number;
169
+ components: MaterialComponent[];
154
170
  propertyTemplate?: Enums.PropertyTemplate;
155
-
156
171
  /**
157
172
  * The material to use in calculations.
158
173
  *
159
174
  * @param {Object} options - Initialisation options
160
175
  * @param {string} options.name - Name of the material.
161
- * @param {MaterialComponent[]} options.components - Constituent components.
162
176
  * @param {number} options.componentCount - Number of components in the material. (default value is 1)
177
+ * @param {MaterialComponent[]} options.components - Constituent components.
163
178
  * @param {Enums.PropertyTemplate} options.propertyTemplate - The template to be used for the selection of calculation methods for material properties. (default value is Enums.PropertyTemplate.PHAST_MC)
164
179
  */
165
- constructor(options?: { id?: string; typeId?: string; displayName?: string; name?: string; components?: MaterialComponent[]; componentCount?: number; propertyTemplate?: Enums.PropertyTemplate }) {
180
+ constructor(options?: { id?: string; typeId?: string; displayName?: string; name?: string; componentCount?: number; components?: MaterialComponent[]; propertyTemplate?: Enums.PropertyTemplate }) {
166
181
  super(options?.id, options?.typeId, options?.displayName);
167
- this.components = options?.components ?? [new MaterialComponent()];
168
182
  this.name = options?.name ?? '';
169
183
  this.componentCount = options?.componentCount ?? 1;
184
+ this.components = options?.components ?? [new MaterialComponent()];
170
185
  this.propertyTemplate = options?.propertyTemplate ?? Enums.PropertyTemplate.PHAST_MC;
171
186
  }
172
187
 
173
188
  /** Initialise the entity with data from a dictionary. */
174
189
  initialiseFromDictionary(data: { [key: string]: unknown }) {
175
190
  super.initialiseFromDictionary(data);
191
+ if (data.name !== undefined && typeof data.name === 'string') {
192
+ this.name = data.name as string;
193
+ }
194
+ if (data.componentCount !== undefined && typeof data.componentCount === 'number') {
195
+ this.componentCount = data.componentCount as number;
196
+ }
176
197
  if (data.components && Array.isArray(data.components)) {
177
198
  this.components = data.components.map((item) => {
178
199
  const record = new MaterialComponent();
@@ -180,18 +201,12 @@ export class Material extends EntityBase {
180
201
  return record;
181
202
  });
182
203
  }
183
- if (data.name !== undefined && typeof data.name === 'string') {
184
- this.name = data.name as string;
185
- }
186
- if (data.componentCount !== undefined && typeof data.componentCount === 'number') {
187
- this.componentCount = data.componentCount as number;
188
- }
189
204
  if (data.propertyTemplate !== undefined && (typeof data.propertyTemplate === 'string' || typeof data.propertyTemplate === 'number')) {
190
205
  this.propertyTemplate = this.parseEnumValue(data.propertyTemplate, Enums.PropertyTemplate);
191
206
  }
192
207
  }
193
208
 
194
- private parseEnumValue<T extends object>(value: unknown, enumType: T): T[keyof T] | undefined {
209
+ protected parseEnumValue<T extends object>(value: unknown, enumType: T): T[keyof T] | undefined {
195
210
  if (typeof value === 'string' && value in enumType) {
196
211
  return enumType[value as keyof T];
197
212
  } else if (typeof value === 'number' && Object.values(enumType).includes(value)) {
@@ -204,9 +219,9 @@ export class Material extends EntityBase {
204
219
  const parts = [
205
220
  super.toString(),
206
221
  '* Material',
207
- this.components?.map((item) => item?.toString()).join('\n'),
208
222
  `name: ${this.name}`,
209
223
  `componentCount: ${this.componentCount}`,
224
+ this.components?.map((item) => item?.toString()).join('\n'),
210
225
  `propertyTemplate: ${this.propertyTemplate}`,
211
226
  ];
212
227
  return parts.join('\n');
@@ -219,7 +234,6 @@ export class State extends EntityBase {
219
234
  liquidFraction?: number;
220
235
  flashFlag?: Enums.FluidSpec;
221
236
  mixtureModelling?: Enums.MixtureModelling;
222
-
223
237
  /**
224
238
  * Description of the fluid state.
225
239
  *
@@ -268,7 +282,7 @@ export class State extends EntityBase {
268
282
  }
269
283
  }
270
284
 
271
- private parseEnumValue<T extends object>(value: unknown, enumType: T): T[keyof T] | undefined {
285
+ protected parseEnumValue<T extends object>(value: unknown, enumType: T): T[keyof T] | undefined {
272
286
  if (typeof value === 'string' && value in enumType) {
273
287
  return enumType[value as keyof T];
274
288
  } else if (typeof value === 'number' && Object.values(enumType).includes(value)) {
@@ -297,7 +311,6 @@ export class AtmosphericStorageTank extends Asset {
297
311
  height?: number;
298
312
  material: Material;
299
313
  liquidFillFractionByVolume: number;
300
-
301
314
  /**
302
315
  * An atmospheric storage tank asset to model events that involve releases from unpressurised containment.
303
316
  *
@@ -388,7 +401,6 @@ export class Scenario extends EntityBase {
388
401
  export class ReleaseOverTime extends Scenario {
389
402
  releaseAngle: number;
390
403
  timeVaryingOption?: Enums.TimeVaryingOption;
391
-
392
404
  /**
393
405
  * Scenario representing a release over time.
394
406
  *
@@ -413,7 +425,7 @@ export class ReleaseOverTime extends Scenario {
413
425
  }
414
426
  }
415
427
 
416
- private parseEnumValue<T extends object>(value: unknown, enumType: T): T[keyof T] | undefined {
428
+ protected parseEnumValue<T extends object>(value: unknown, enumType: T): T[keyof T] | undefined {
417
429
  if (typeof value === 'string' && value in enumType) {
418
430
  return enumType[value as keyof T];
419
431
  } else if (typeof value === 'number' && Object.values(enumType).includes(value)) {
@@ -430,35 +442,34 @@ export class ReleaseOverTime extends Scenario {
430
442
 
431
443
  export class BESSRelease extends ReleaseOverTime {
432
444
  height?: number;
433
- area?: number;
445
+ ventArea?: number;
434
446
  temperature?: number;
435
447
  duration?: number;
436
-
437
448
  /**
438
449
  * A release from a BESS unit in thermal runaway.
439
450
  *
440
451
  * @param {Object} options - Initialisation options
452
+ * @param {number} options.releaseAngle - Angle of release above a horizontal plane. [rad] (default value is 0.0)
453
+ * @param {Enums.TimeVaryingOption} options.timeVaryingOption - Whether the release is a time-varying release or a steady state release using the initial rate. (default value is Enums.TimeVaryingOption.INITIAL_RATE)
441
454
  * @param {number} options.height - The height from which the release occurs. [m]
442
- * @param {number} options.area - The area over which the release occurs. [m2]
455
+ * @param {number} options.ventArea - The area over which the release occurs. [m2]
443
456
  * @param {number} options.temperature - The exit temperature of the release (from the BESS unit). [K]
444
457
  * @param {number} options.duration - The duration of the release. [s]
445
- * @param {number} options.releaseAngle - Angle of release above a horizontal plane. [rad] (default value is 0.0)
446
- * @param {Enums.TimeVaryingOption} options.timeVaryingOption - Whether the release is a time-varying release or a steady state release using the initial rate. (default value is Enums.TimeVaryingOption.INITIAL_RATE)
447
458
  */
448
459
  constructor(options?: {
449
460
  id?: string;
450
461
  typeId?: string;
451
462
  displayName?: string;
463
+ releaseAngle?: number;
464
+ timeVaryingOption?: Enums.TimeVaryingOption;
452
465
  height?: number;
453
- area?: number;
466
+ ventArea?: number;
454
467
  temperature?: number;
455
468
  duration?: number;
456
- releaseAngle?: number;
457
- timeVaryingOption?: Enums.TimeVaryingOption;
458
469
  }) {
459
470
  super(options);
460
471
  this.height = options?.height;
461
- this.area = options?.area;
472
+ this.ventArea = options?.ventArea;
462
473
  this.temperature = options?.temperature;
463
474
  this.duration = options?.duration;
464
475
  }
@@ -469,8 +480,8 @@ export class BESSRelease extends ReleaseOverTime {
469
480
  if (data.height !== undefined && typeof data.height === 'number') {
470
481
  this.height = data.height as number;
471
482
  }
472
- if (data.area !== undefined && typeof data.area === 'number') {
473
- this.area = data.area as number;
483
+ if (data.ventArea !== undefined && typeof data.ventArea === 'number') {
484
+ this.ventArea = data.ventArea as number;
474
485
  }
475
486
  if (data.temperature !== undefined && typeof data.temperature === 'number') {
476
487
  this.temperature = data.temperature as number;
@@ -484,12 +495,44 @@ export class BESSRelease extends ReleaseOverTime {
484
495
  const parts = [
485
496
  super.toString(),
486
497
  '* BESSRelease',
498
+ `releaseAngle: ${this.releaseAngle}`,
499
+ `timeVaryingOption: ${this.timeVaryingOption}`,
487
500
  `height: ${this.height}`,
488
- `area: ${this.area}`,
501
+ `ventArea: ${this.ventArea}`,
489
502
  `temperature: ${this.temperature}`,
490
503
  `duration: ${this.duration}`,
491
- `releaseAngle: ${this.releaseAngle}`,
492
- `timeVaryingOption: ${this.timeVaryingOption}`,
504
+ ];
505
+ return parts.join('\n');
506
+ }
507
+ }
508
+
509
+ export class OffGasComposition extends Material {
510
+ /**
511
+ * The off-gas composition to use in calculations.
512
+ *
513
+ * @param {Object} options - Initialisation options
514
+ * @param {string} options.name - Name of the material.
515
+ * @param {number} options.componentCount - Number of components in the material. (default value is 1)
516
+ * @param {MaterialComponent[]} options.components - Constituent components.
517
+ * @param {Enums.PropertyTemplate} options.propertyTemplate - The template to be used for the selection of calculation methods for material properties. (default value is Enums.PropertyTemplate.PHAST_MC)
518
+ */
519
+ constructor(options?: { id?: string; typeId?: string; displayName?: string; name?: string; componentCount?: number; components?: MaterialComponent[]; propertyTemplate?: Enums.PropertyTemplate }) {
520
+ super(options);
521
+ }
522
+
523
+ /** Initialise the entity with data from a dictionary. */
524
+ initialiseFromDictionary(data: { [key: string]: unknown }) {
525
+ super.initialiseFromDictionary(data);
526
+ }
527
+
528
+ toString() {
529
+ const parts = [
530
+ super.toString(),
531
+ '* OffGasComposition',
532
+ `name: ${this.name}`,
533
+ `componentCount: ${this.componentCount}`,
534
+ this.components?.map((item) => item?.toString()).join('\n'),
535
+ `propertyTemplate: ${this.propertyTemplate}`,
493
536
  ];
494
537
  return parts.join('\n');
495
538
  }
@@ -498,7 +541,8 @@ export class BESSRelease extends ReleaseOverTime {
498
541
  export class BESSUnit extends Asset {
499
542
  energyCapacity?: number;
500
543
  chemistry?: Enums.BESSChemistry;
501
-
544
+ offGasComposition: OffGasComposition;
545
+ offGasVolume: number;
502
546
  /**
503
547
  * A BESS unit, containing Li-ion betteries.
504
548
  *
@@ -506,11 +550,24 @@ export class BESSUnit extends Asset {
506
550
  * @param {LocalPosition} options.location - Location of the asset.
507
551
  * @param {number} options.energyCapacity - The energy capacity of the installation. [J]
508
552
  * @param {Enums.BESSChemistry} options.chemistry - The chemistry type of the BESS unit. (default value is Enums.BESSChemistry.LFP)
553
+ * @param {OffGasComposition} options.offGasComposition - The composition representing the off-gas.
554
+ * @param {number} options.offGasVolume - The user-defined volume of off-gas for the scenario. (default value is 0)
509
555
  */
510
- constructor(options?: { id?: string; typeId?: string; displayName?: string; location?: LocalPosition; energyCapacity?: number; chemistry?: Enums.BESSChemistry }) {
556
+ constructor(options?: {
557
+ id?: string;
558
+ typeId?: string;
559
+ displayName?: string;
560
+ location?: LocalPosition;
561
+ energyCapacity?: number;
562
+ chemistry?: Enums.BESSChemistry;
563
+ offGasComposition?: OffGasComposition;
564
+ offGasVolume?: number;
565
+ }) {
511
566
  super(options);
512
567
  this.energyCapacity = options?.energyCapacity;
513
568
  this.chemistry = options?.chemistry ?? Enums.BESSChemistry.LFP;
569
+ this.offGasComposition = options?.offGasComposition ?? new OffGasComposition();
570
+ this.offGasVolume = options?.offGasVolume ?? 0;
514
571
  }
515
572
 
516
573
  /** Initialise the entity with data from a dictionary. */
@@ -522,9 +579,16 @@ export class BESSUnit extends Asset {
522
579
  if (data.chemistry !== undefined && (typeof data.chemistry === 'string' || typeof data.chemistry === 'number')) {
523
580
  this.chemistry = this.parseEnumValue(data.chemistry, Enums.BESSChemistry);
524
581
  }
582
+ if (data.offGasComposition) {
583
+ this.offGasComposition = new OffGasComposition();
584
+ this.offGasComposition.initialiseFromDictionary(data.offGasComposition as { [key: string]: unknown });
585
+ }
586
+ if (data.offGasVolume !== undefined && typeof data.offGasVolume === 'number') {
587
+ this.offGasVolume = data.offGasVolume as number;
588
+ }
525
589
  }
526
590
 
527
- private parseEnumValue<T extends object>(value: unknown, enumType: T): T[keyof T] | undefined {
591
+ protected parseEnumValue<T extends object>(value: unknown, enumType: T): T[keyof T] | undefined {
528
592
  if (typeof value === 'string' && value in enumType) {
529
593
  return enumType[value as keyof T];
530
594
  } else if (typeof value === 'number' && Object.values(enumType).includes(value)) {
@@ -534,7 +598,60 @@ export class BESSUnit extends Asset {
534
598
  }
535
599
 
536
600
  toString() {
537
- const parts = [super.toString(), '* BESSUnit', `location: ${this.location?.toString()}`, `energyCapacity: ${this.energyCapacity}`, `chemistry: ${this.chemistry}`];
601
+ const parts = [
602
+ super.toString(),
603
+ '* BESSUnit',
604
+ `location: ${this.location?.toString()}`,
605
+ `energyCapacity: ${this.energyCapacity}`,
606
+ `chemistry: ${this.chemistry}`,
607
+ `offGasComposition: ${this.offGasComposition?.toString()}`,
608
+ `offGasVolume: ${this.offGasVolume}`,
609
+ ];
610
+ return parts.join('\n');
611
+ }
612
+ }
613
+
614
+ export class BESSVolume extends EntityBase {
615
+ volume: number;
616
+ isEstimate: boolean;
617
+ upperCI: number;
618
+ lowerCI: number;
619
+ /**
620
+ * Represents the off-gas volume for a calculation.
621
+ *
622
+ * @param {Object} options - Initialisation options
623
+ * @param {number} options.volume - Off gas volume in m3. (default value is 0)
624
+ * @param {boolean} options.isEstimate - Indicates whether the volume is an estimate or user-defined. (default value is true)
625
+ * @param {number} options.upperCI - upper 95% confidence interval for an estimated volume. (default value is 0)
626
+ * @param {number} options.lowerCI - lower confidence interval for an estimated volume. (default value is 0)
627
+ */
628
+ constructor(options?: { id?: string; typeId?: string; displayName?: string; volume?: number; isEstimate?: boolean; upperCI?: number; lowerCI?: number }) {
629
+ super(options?.id, options?.typeId, options?.displayName);
630
+ this.volume = options?.volume ?? 0;
631
+ this.isEstimate = options?.isEstimate ?? true;
632
+ this.upperCI = options?.upperCI ?? 0;
633
+ this.lowerCI = options?.lowerCI ?? 0;
634
+ }
635
+
636
+ /** Initialise the entity with data from a dictionary. */
637
+ initialiseFromDictionary(data: { [key: string]: unknown }) {
638
+ super.initialiseFromDictionary(data);
639
+ if (data.volume !== undefined && typeof data.volume === 'number') {
640
+ this.volume = data.volume as number;
641
+ }
642
+ if (data.isEstimate !== undefined && typeof data.isEstimate === 'boolean') {
643
+ this.isEstimate = data.isEstimate as boolean;
644
+ }
645
+ if (data.upperCI !== undefined && typeof data.upperCI === 'number') {
646
+ this.upperCI = data.upperCI as number;
647
+ }
648
+ if (data.lowerCI !== undefined && typeof data.lowerCI === 'number') {
649
+ this.lowerCI = data.lowerCI as number;
650
+ }
651
+ }
652
+
653
+ toString() {
654
+ const parts = [super.toString(), '* BESSVolume', `volume: ${this.volume}`, `isEstimate: ${this.isEstimate}`, `upperCI: ${this.upperCI}`, `lowerCI: ${this.lowerCI}`];
538
655
  return parts.join('\n');
539
656
  }
540
657
  }
@@ -543,14 +660,13 @@ export class Bund extends EntityBase {
543
660
  bundHeight: number;
544
661
  bundDiameter: number;
545
662
  specifyBund: boolean;
546
-
547
663
  /**
548
664
  * A bund entity used in the modelling of pool spreading and vaporisation.
549
665
  *
550
666
  * @param {Object} options - Initialisation options
551
667
  * @param {number} options.bundHeight - Used in calculating the volume of the bund and in modelling bund failure and the location of rainout. [m] (default value is 0.0)
552
668
  * @param {number} options.bundDiameter - The diameter of the (circular) bund. [m] (default value is 0.0)
553
- * @param {boolean} options.specifyBund - Whether to model the effect of a bund on the spreading of a liquid pool. (default value is false)
669
+ * @param {boolean} options.specifyBund - Whether to model the effect of a bund on the spreading of a liquid pool. (default value is False)
554
670
  */
555
671
  constructor(options?: { id?: string; typeId?: string; displayName?: string; bundHeight?: number; bundDiameter?: number; specifyBund?: boolean }) {
556
672
  super(options?.id, options?.typeId, options?.displayName);
@@ -600,21 +716,34 @@ export class Instantaneous extends Scenario {
600
716
  }
601
717
 
602
718
  export class CatastrophicRupture extends Instantaneous {
719
+ useVesselBurstPressure: boolean;
720
+ vesselBurstPressure: number;
603
721
  /**
604
722
  * An instanaeous release of the entire inventory of an associated vessel, intended to model an incident in which the vessel is destroyed by an impact, a crack, or some other failure which propagates very quickly.
605
723
  *
724
+ * @param {Object} options - Initialisation options
725
+ * @param {boolean} options.useVesselBurstPressure - Flag to control the use of vessel burst pressure. (default value is false)
726
+ * @param {number} options.vesselBurstPressure - Vessel burst pressure. [N/m2] (default value is 101325)
606
727
  */
607
- constructor(options?: { id?: string; typeId?: string; displayName?: string }) {
728
+ constructor(options?: { id?: string; typeId?: string; displayName?: string; useVesselBurstPressure?: boolean; vesselBurstPressure?: number }) {
608
729
  super(options);
730
+ this.useVesselBurstPressure = options?.useVesselBurstPressure ?? false;
731
+ this.vesselBurstPressure = options?.vesselBurstPressure ?? 101325;
609
732
  }
610
733
 
611
734
  /** Initialise the entity with data from a dictionary. */
612
735
  initialiseFromDictionary(data: { [key: string]: unknown }) {
613
736
  super.initialiseFromDictionary(data);
737
+ if (data.useVesselBurstPressure !== undefined && typeof data.useVesselBurstPressure === 'boolean') {
738
+ this.useVesselBurstPressure = data.useVesselBurstPressure as boolean;
739
+ }
740
+ if (data.vesselBurstPressure !== undefined && typeof data.vesselBurstPressure === 'number') {
741
+ this.vesselBurstPressure = data.vesselBurstPressure as number;
742
+ }
614
743
  }
615
744
 
616
745
  toString() {
617
- const parts = [super.toString(), '* CatastrophicRupture'];
746
+ const parts = [super.toString(), '* CatastrophicRupture', `useVesselBurstPressure: ${this.useVesselBurstPressure}`, `vesselBurstPressure: ${this.vesselBurstPressure}`];
618
747
  return parts.join('\n');
619
748
  }
620
749
  }
@@ -622,7 +751,6 @@ export class CatastrophicRupture extends Instantaneous {
622
751
  export class ConcentrationRecord extends EntityBase {
623
752
  concentration?: number;
624
753
  position: LocalPosition;
625
-
626
754
  /**
627
755
  * A record containing the cloud concentration at a specified x, y, z position.
628
756
  *
@@ -658,7 +786,6 @@ export class ConstantMaterialResult extends EntityBase {
658
786
  criticalPressure?: number;
659
787
  criticalTemperature?: number;
660
788
  totalMolecularWeight?: number;
661
-
662
789
  /**
663
790
  * Constant material properties, i.e. critical pressure, temperature, molecular weight.
664
791
  *
@@ -702,16 +829,18 @@ export class ConstantMaterialResult extends EntityBase {
702
829
 
703
830
  export class DischargeParameters extends EntityBase {
704
831
  flashAtOrifice?: Enums.FlashAtOrifice;
705
-
832
+ maxReleaseDuration: number;
706
833
  /**
707
834
  * A set of parameters used in discharge calculations.
708
835
  *
709
836
  * @param {Object} options - Initialisation options
710
837
  * @param {Enums.FlashAtOrifice} options.flashAtOrifice - Whether discharge calculations should allow the phase to change between storage and orifice conditions. (default value is Enums.FlashAtOrifice.DISALLOW_LIQUID_FLASH)
838
+ * @param {number} options.maxReleaseDuration - Maximum release duration. [s] (default value is 3600)
711
839
  */
712
- constructor(options?: { id?: string; typeId?: string; displayName?: string; flashAtOrifice?: Enums.FlashAtOrifice }) {
840
+ constructor(options?: { id?: string; typeId?: string; displayName?: string; flashAtOrifice?: Enums.FlashAtOrifice; maxReleaseDuration?: number }) {
713
841
  super(options?.id, options?.typeId, options?.displayName);
714
842
  this.flashAtOrifice = options?.flashAtOrifice ?? Enums.FlashAtOrifice.DISALLOW_LIQUID_FLASH;
843
+ this.maxReleaseDuration = options?.maxReleaseDuration ?? 3600;
715
844
  }
716
845
 
717
846
  /** Initialise the entity with data from a dictionary. */
@@ -720,9 +849,12 @@ export class DischargeParameters extends EntityBase {
720
849
  if (data.flashAtOrifice !== undefined && (typeof data.flashAtOrifice === 'string' || typeof data.flashAtOrifice === 'number')) {
721
850
  this.flashAtOrifice = this.parseEnumValue(data.flashAtOrifice, Enums.FlashAtOrifice);
722
851
  }
852
+ if (data.maxReleaseDuration !== undefined && typeof data.maxReleaseDuration === 'number') {
853
+ this.maxReleaseDuration = data.maxReleaseDuration as number;
854
+ }
723
855
  }
724
856
 
725
- private parseEnumValue<T extends object>(value: unknown, enumType: T): T[keyof T] | undefined {
857
+ protected parseEnumValue<T extends object>(value: unknown, enumType: T): T[keyof T] | undefined {
726
858
  if (typeof value === 'string' && value in enumType) {
727
859
  return enumType[value as keyof T];
728
860
  } else if (typeof value === 'number' && Object.values(enumType).includes(value)) {
@@ -732,7 +864,7 @@ export class DischargeParameters extends EntityBase {
732
864
  }
733
865
 
734
866
  toString() {
735
- const parts = [super.toString(), '* DischargeParameters', `flashAtOrifice: ${this.flashAtOrifice}`];
867
+ const parts = [super.toString(), '* DischargeParameters', `flashAtOrifice: ${this.flashAtOrifice}`, `maxReleaseDuration: ${this.maxReleaseDuration}`];
736
868
  return parts.join('\n');
737
869
  }
738
870
  }
@@ -747,7 +879,6 @@ export class DischargeRecord extends EntityBase {
747
879
  storageState: State;
748
880
  dropletDiameter?: number;
749
881
  expandedDiameter: number;
750
-
751
882
  /**
752
883
  * A record containing discharge results at a given time.
753
884
  *
@@ -846,20 +977,19 @@ export class DischargeResult extends EntityBase {
846
977
  releaseMass?: number;
847
978
  height?: number;
848
979
  angle?: number;
849
- holeDiameter?: number;
850
980
  releaseType?: Enums.DynamicType;
981
+ holeDiameter?: number;
851
982
  preDilutionAirRate: number;
852
-
853
983
  /**
854
984
  * A set of discharge results that do not vary with time.
855
985
  *
856
986
  * @param {Object} options - Initialisation options
857
- * @param {number} options.expansionEnergy - The energy released when a pressurized substance, such as a liquid or vapor, is released following an instantaneous rupture. [J]
987
+ * @param {number} options.expansionEnergy - The energy released when a pressurized substance, such as a liquid or vapor, is released following an instantaneous rupture. . [J]
858
988
  * @param {number} options.releaseMass - Amount of mass released during the discharge. [kg]
859
989
  * @param {number} options.height - Release height above ground. [m]
860
990
  * @param {number} options.angle - Release angle (non-instantaneous releases only). [rad]
861
- * @param {number} options.holeDiameter - Diameter of the hole. [m]
862
991
  * @param {Enums.DynamicType} options.releaseType - Instantaneous, continuous or time-varying. (default value is Enums.DynamicType.UNSET)
992
+ * @param {number} options.holeDiameter - Diameter of the hole. [m]
863
993
  * @param {number} options.preDilutionAirRate - The rate at which air at ambient conditions mixes with the released material before the cloud starts to move away from the point of release. [kg/s] (default value is 0)
864
994
  */
865
995
  constructor(options?: {
@@ -870,8 +1000,8 @@ export class DischargeResult extends EntityBase {
870
1000
  releaseMass?: number;
871
1001
  height?: number;
872
1002
  angle?: number;
873
- holeDiameter?: number;
874
1003
  releaseType?: Enums.DynamicType;
1004
+ holeDiameter?: number;
875
1005
  preDilutionAirRate?: number;
876
1006
  }) {
877
1007
  super(options?.id, options?.typeId, options?.displayName);
@@ -879,8 +1009,8 @@ export class DischargeResult extends EntityBase {
879
1009
  this.releaseMass = options?.releaseMass;
880
1010
  this.height = options?.height;
881
1011
  this.angle = options?.angle;
882
- this.holeDiameter = options?.holeDiameter;
883
1012
  this.releaseType = options?.releaseType ?? Enums.DynamicType.UNSET;
1013
+ this.holeDiameter = options?.holeDiameter;
884
1014
  this.preDilutionAirRate = options?.preDilutionAirRate ?? 0;
885
1015
  }
886
1016
 
@@ -899,18 +1029,18 @@ export class DischargeResult extends EntityBase {
899
1029
  if (data.angle !== undefined && typeof data.angle === 'number') {
900
1030
  this.angle = data.angle as number;
901
1031
  }
902
- if (data.holeDiameter !== undefined && typeof data.holeDiameter === 'number') {
903
- this.holeDiameter = data.holeDiameter as number;
904
- }
905
1032
  if (data.releaseType !== undefined && (typeof data.releaseType === 'string' || typeof data.releaseType === 'number')) {
906
1033
  this.releaseType = this.parseEnumValue(data.releaseType, Enums.DynamicType);
907
1034
  }
1035
+ if (data.holeDiameter !== undefined && typeof data.holeDiameter === 'number') {
1036
+ this.holeDiameter = data.holeDiameter as number;
1037
+ }
908
1038
  if (data.preDilutionAirRate !== undefined && typeof data.preDilutionAirRate === 'number') {
909
1039
  this.preDilutionAirRate = data.preDilutionAirRate as number;
910
1040
  }
911
1041
  }
912
1042
 
913
- private parseEnumValue<T extends object>(value: unknown, enumType: T): T[keyof T] | undefined {
1043
+ protected parseEnumValue<T extends object>(value: unknown, enumType: T): T[keyof T] | undefined {
914
1044
  if (typeof value === 'string' && value in enumType) {
915
1045
  return enumType[value as keyof T];
916
1046
  } else if (typeof value === 'number' && Object.values(enumType).includes(value)) {
@@ -927,8 +1057,8 @@ export class DischargeResult extends EntityBase {
927
1057
  `releaseMass: ${this.releaseMass}`,
928
1058
  `height: ${this.height}`,
929
1059
  `angle: ${this.angle}`,
930
- `holeDiameter: ${this.holeDiameter}`,
931
1060
  `releaseType: ${this.releaseType}`,
1061
+ `holeDiameter: ${this.holeDiameter}`,
932
1062
  `preDilutionAirRate: ${this.preDilutionAirRate}`,
933
1063
  ];
934
1064
  return parts.join('\n');
@@ -945,9 +1075,7 @@ export class DispersionOutputConfig extends EntityBase {
945
1075
  crosswindDistance: number;
946
1076
  contourType?: Enums.ContourType;
947
1077
  lflFractionValue: number;
948
- componentToTrackIndex: number;
949
1078
  componentToTrackName: string;
950
-
951
1079
  /**
952
1080
  * Dispersion plotting and reporting parameters.
953
1081
  *
@@ -961,7 +1089,6 @@ export class DispersionOutputConfig extends EntityBase {
961
1089
  * @param {number} options.crosswindDistance - The distance that an XZ plane of interest is offset from the downwind direction (x-axis). [m] (default value is 0)
962
1090
  * @param {Enums.ContourType} options.contourType - The type of contour on which the contour points will be based. (default value is Enums.ContourType.FOOTPRINT)
963
1091
  * @param {number} options.lflFractionValue - Value of the lower flammable limit fraction, used when SpecialConcentration is set to Min or LflFraction. [fraction] (default value is 0.5)
964
- * @param {number} options.componentToTrackIndex - Index of a component that you want to track within a mixture. (default value is -1)
965
1092
  * @param {string} options.componentToTrackName - Name of the component to track.
966
1093
  */
967
1094
  constructor(options?: {
@@ -977,7 +1104,6 @@ export class DispersionOutputConfig extends EntityBase {
977
1104
  crosswindDistance?: number;
978
1105
  contourType?: Enums.ContourType;
979
1106
  lflFractionValue?: number;
980
- componentToTrackIndex?: number;
981
1107
  componentToTrackName?: string;
982
1108
  }) {
983
1109
  super(options?.id, options?.typeId, options?.displayName);
@@ -990,7 +1116,6 @@ export class DispersionOutputConfig extends EntityBase {
990
1116
  this.crosswindDistance = options?.crosswindDistance ?? 0;
991
1117
  this.contourType = options?.contourType ?? Enums.ContourType.FOOTPRINT;
992
1118
  this.lflFractionValue = options?.lflFractionValue ?? 0.5;
993
- this.componentToTrackIndex = options?.componentToTrackIndex ?? -1;
994
1119
  this.componentToTrackName = options?.componentToTrackName ?? '';
995
1120
  }
996
1121
 
@@ -1024,15 +1149,12 @@ export class DispersionOutputConfig extends EntityBase {
1024
1149
  if (data.lflFractionValue !== undefined && typeof data.lflFractionValue === 'number') {
1025
1150
  this.lflFractionValue = data.lflFractionValue as number;
1026
1151
  }
1027
- if (data.componentToTrackIndex !== undefined && typeof data.componentToTrackIndex === 'number') {
1028
- this.componentToTrackIndex = data.componentToTrackIndex as number;
1029
- }
1030
1152
  if (data.componentToTrackName !== undefined && typeof data.componentToTrackName === 'string') {
1031
1153
  this.componentToTrackName = data.componentToTrackName as string;
1032
1154
  }
1033
1155
  }
1034
1156
 
1035
- private parseEnumValue<T extends object>(value: unknown, enumType: T): T[keyof T] | undefined {
1157
+ protected parseEnumValue<T extends object>(value: unknown, enumType: T): T[keyof T] | undefined {
1036
1158
  if (typeof value === 'string' && value in enumType) {
1037
1159
  return enumType[value as keyof T];
1038
1160
  } else if (typeof value === 'number' && Object.values(enumType).includes(value)) {
@@ -1054,7 +1176,6 @@ export class DispersionOutputConfig extends EntityBase {
1054
1176
  `crosswindDistance: ${this.crosswindDistance}`,
1055
1177
  `contourType: ${this.contourType}`,
1056
1178
  `lflFractionValue: ${this.lflFractionValue}`,
1057
- `componentToTrackIndex: ${this.componentToTrackIndex}`,
1058
1179
  `componentToTrackName: ${this.componentToTrackName}`,
1059
1180
  ];
1060
1181
  return parts.join('\n');
@@ -1072,7 +1193,10 @@ export class DispersionParameters extends EntityBase {
1072
1193
  numberOfPoolObservers: number;
1073
1194
  averagingTime: number;
1074
1195
  lflFractionToStop: number;
1075
-
1196
+ maxReleaseDuration: number;
1197
+ releaseAveragingMethod?: Enums.ReleaseAveragingMethod;
1198
+ firstTimeForBetweenTwoTimes: number;
1199
+ secondTimeForBetweenTwoTimes: number;
1076
1200
  /**
1077
1201
  * A set of parameters used in dispersion calculations.
1078
1202
  *
@@ -1082,11 +1206,15 @@ export class DispersionParameters extends EntityBase {
1082
1206
  * @param {number} options.fixedStepSize - The size of steps within the core dispersion calculations. [s] (default value is 0.01)
1083
1207
  * @param {number} options.outputStepMultiplier - Multiplier to increase each step size after the initial fixed steps. (default value is 1.2)
1084
1208
  * @param {number} options.maxDispersionDistance - The maximum dispersion distance that will be modelled. Modelling will stop at this distance even if the lowest concentration of interest has not been reached. [m] (default value is 50000)
1085
- * @param {number} options.maxDispersionHeight - The dispersion calculation will stop when this height is exceeded. This provides a means of preventing the calculation of dispersion of buoyant releases going too far above the ground. [m] (default value is 1000)
1209
+ * @param {number} options.maxDispersionHeight - The dispersion calculation will stop when this height is exceeded. This provides a means of preventing the calculation of dispersion of buoyant releases going too far above the ground. . [m] (default value is 1000)
1086
1210
  * @param {number} options.numberOfReleaseObservers - Number of release observers for time-varying releases. (default value is 5)
1087
1211
  * @param {number} options.numberOfPoolObservers - Number of pool observers for rainout cases. (default value is 10)
1088
1212
  * @param {number} options.averagingTime - The core averaging time, used to take into account the effects of changes in the wind direction over the course of the release. [s] (default value is 18.75)
1089
1213
  * @param {number} options.lflFractionToStop - The LFL multipler, which determines the minimum concentration of interest for a flammable release. If the concentration of interest determined from the DispersionOutputConfig is lowest than this value, an error will occur. [fraction] (default value is 0.5)
1214
+ * @param {number} options.maxReleaseDuration - Maximum duration of the release. [s] (default value is 3600)
1215
+ * @param {Enums.ReleaseAveragingMethod} options.releaseAveragingMethod - Averaging method to determine the input to the dispersion. (default value is Enums.ReleaseAveragingMethod.UP_TO_TEN_RATES)
1216
+ * @param {number} options.firstTimeForBetweenTwoTimes - Initial time for averaging between two rates. [s] (default value is 0)
1217
+ * @param {number} options.secondTimeForBetweenTwoTimes - Final time for averaging between two rates. [s] (default value is 20)
1090
1218
  */
1091
1219
  constructor(options?: {
1092
1220
  id?: string;
@@ -1102,6 +1230,10 @@ export class DispersionParameters extends EntityBase {
1102
1230
  numberOfPoolObservers?: number;
1103
1231
  averagingTime?: number;
1104
1232
  lflFractionToStop?: number;
1233
+ maxReleaseDuration?: number;
1234
+ releaseAveragingMethod?: Enums.ReleaseAveragingMethod;
1235
+ firstTimeForBetweenTwoTimes?: number;
1236
+ secondTimeForBetweenTwoTimes?: number;
1105
1237
  }) {
1106
1238
  super(options?.id, options?.typeId, options?.displayName);
1107
1239
  this.relativeTolerance = options?.relativeTolerance ?? 0.0001;
@@ -1114,6 +1246,10 @@ export class DispersionParameters extends EntityBase {
1114
1246
  this.numberOfPoolObservers = options?.numberOfPoolObservers ?? 10;
1115
1247
  this.averagingTime = options?.averagingTime ?? 18.75;
1116
1248
  this.lflFractionToStop = options?.lflFractionToStop ?? 0.5;
1249
+ this.maxReleaseDuration = options?.maxReleaseDuration ?? 3600;
1250
+ this.releaseAveragingMethod = options?.releaseAveragingMethod ?? Enums.ReleaseAveragingMethod.UP_TO_TEN_RATES;
1251
+ this.firstTimeForBetweenTwoTimes = options?.firstTimeForBetweenTwoTimes ?? 0;
1252
+ this.secondTimeForBetweenTwoTimes = options?.secondTimeForBetweenTwoTimes ?? 20;
1117
1253
  }
1118
1254
 
1119
1255
  /** Initialise the entity with data from a dictionary. */
@@ -1149,9 +1285,21 @@ export class DispersionParameters extends EntityBase {
1149
1285
  if (data.lflFractionToStop !== undefined && typeof data.lflFractionToStop === 'number') {
1150
1286
  this.lflFractionToStop = data.lflFractionToStop as number;
1151
1287
  }
1288
+ if (data.maxReleaseDuration !== undefined && typeof data.maxReleaseDuration === 'number') {
1289
+ this.maxReleaseDuration = data.maxReleaseDuration as number;
1290
+ }
1291
+ if (data.releaseAveragingMethod !== undefined && (typeof data.releaseAveragingMethod === 'string' || typeof data.releaseAveragingMethod === 'number')) {
1292
+ this.releaseAveragingMethod = this.parseEnumValue(data.releaseAveragingMethod, Enums.ReleaseAveragingMethod);
1293
+ }
1294
+ if (data.firstTimeForBetweenTwoTimes !== undefined && typeof data.firstTimeForBetweenTwoTimes === 'number') {
1295
+ this.firstTimeForBetweenTwoTimes = data.firstTimeForBetweenTwoTimes as number;
1296
+ }
1297
+ if (data.secondTimeForBetweenTwoTimes !== undefined && typeof data.secondTimeForBetweenTwoTimes === 'number') {
1298
+ this.secondTimeForBetweenTwoTimes = data.secondTimeForBetweenTwoTimes as number;
1299
+ }
1152
1300
  }
1153
1301
 
1154
- private parseEnumValue<T extends object>(value: unknown, enumType: T): T[keyof T] | undefined {
1302
+ protected parseEnumValue<T extends object>(value: unknown, enumType: T): T[keyof T] | undefined {
1155
1303
  if (typeof value === 'string' && value in enumType) {
1156
1304
  return enumType[value as keyof T];
1157
1305
  } else if (typeof value === 'number' && Object.values(enumType).includes(value)) {
@@ -1174,6 +1322,10 @@ export class DispersionParameters extends EntityBase {
1174
1322
  `numberOfPoolObservers: ${this.numberOfPoolObservers}`,
1175
1323
  `averagingTime: ${this.averagingTime}`,
1176
1324
  `lflFractionToStop: ${this.lflFractionToStop}`,
1325
+ `maxReleaseDuration: ${this.maxReleaseDuration}`,
1326
+ `releaseAveragingMethod: ${this.releaseAveragingMethod}`,
1327
+ `firstTimeForBetweenTwoTimes: ${this.firstTimeForBetweenTwoTimes}`,
1328
+ `secondTimeForBetweenTwoTimes: ${this.secondTimeForBetweenTwoTimes}`,
1177
1329
  ];
1178
1330
  return parts.join('\n');
1179
1331
  }
@@ -1196,6 +1348,7 @@ export class DispersionRecord extends EntityBase {
1196
1348
  massConc?: number;
1197
1349
  velocity?: number;
1198
1350
  massFlow?: number;
1351
+ instCon?: Enums.DynamicType;
1199
1352
  profileFlag?: number;
1200
1353
  elevFlag?: number;
1201
1354
  rhoCloud?: number;
@@ -1208,8 +1361,6 @@ export class DispersionRecord extends EntityBase {
1208
1361
  dropletHeight?: number;
1209
1362
  dropletDistance?: number;
1210
1363
  mass?: number;
1211
- instCon?: Enums.DynamicType;
1212
-
1213
1364
  /**
1214
1365
  * A record containing observer dispersion results at a given time.
1215
1366
  *
@@ -1226,10 +1377,11 @@ export class DispersionRecord extends EntityBase {
1226
1377
  * @param {number} options.theta - Centreline angle from horizontal. [rad]
1227
1378
  * @param {number} options.centrelineHeight - The height of the centreline of the cloud, measured from ground level. [m]
1228
1379
  * @param {number} options.liquidFraction - The liquid fraction in the cloud. If there is liquid in the cloud at the start of the release, the fraction will usually drop gradually during the dispersion as the liquid droplets evaporate, and then drop to zero at the end of the segment when the droplets reach the ground and rain out of the cloud to form a pool. [fraction]
1229
- * @param {number} options.vapourTemperature - The temperature of the vapour portion of the cloud, including entrained air and any entrained water vapour. [K]
1380
+ * @param {number} options.vapourTemperature - The temperature of the vapour portion of the cloud, including entrained air and any entrained water vapour. . [K]
1230
1381
  * @param {number} options.massConc - The mass concentration of release material, given as the mass in a given volume of cloud. The concentration is calculated using the Averaging Time set in the Dispersion Parameters. At the beginning of the release, this will be the same as the Cloud density, and it then drops below the density as air is entrained into the cloud. [kg/m3]
1231
- * @param {number} options.velocity - The velocity of the cloud at the centroid. [m/s]
1382
+ * @param {number} options.velocity - The velocity of the cloud at the centroid. . [m/s]
1232
1383
  * @param {number} options.massFlow - Mass flow rate of material in the cloud (non-instantaneous releases) . The value will be constant for a given segment, but can be useful when you are investigating the effects of rainout and evaporation, and the segments that model these phenomena. [kg/s]
1384
+ * @param {Enums.DynamicType} options.instCon - Instantanous or continuous (time-varying not permitted). (default value is Enums.DynamicType.UNSET)
1233
1385
  * @param {number} options.profileFlag - This shows the type of dispersion modelling being used for the current step.
1234
1386
  * @param {number} options.elevFlag - A flag to indicate whether the release is elevated, touching down, grounded or capped (by the mixing layer height).
1235
1387
  * @param {number} options.rhoCloud - The density of the cloud at the centreline. [kg/m3]
@@ -1242,7 +1394,6 @@ export class DispersionRecord extends EntityBase {
1242
1394
  * @param {number} options.dropletHeight - The representative height for liquid droplets in the cloud, measured above ground level. [m]
1243
1395
  * @param {number} options.dropletDistance - The downwind distance of droplets in the cloud. [m]
1244
1396
  * @param {number} options.mass - The mass of released material in the cloud (instantaneous releases). [kg]
1245
- * @param {Enums.DynamicType} options.instCon - Instantanous or continuous (time-varying not permitted). (default value is Enums.DynamicType.UNSET)
1246
1397
  */
1247
1398
  constructor(options?: {
1248
1399
  id?: string;
@@ -1264,6 +1415,7 @@ export class DispersionRecord extends EntityBase {
1264
1415
  massConc?: number;
1265
1416
  velocity?: number;
1266
1417
  massFlow?: number;
1418
+ instCon?: Enums.DynamicType;
1267
1419
  profileFlag?: number;
1268
1420
  elevFlag?: number;
1269
1421
  rhoCloud?: number;
@@ -1276,7 +1428,6 @@ export class DispersionRecord extends EntityBase {
1276
1428
  dropletHeight?: number;
1277
1429
  dropletDistance?: number;
1278
1430
  mass?: number;
1279
- instCon?: Enums.DynamicType;
1280
1431
  }) {
1281
1432
  super(options?.id, options?.typeId, options?.displayName);
1282
1433
  this.observerIndex = options?.observerIndex;
@@ -1295,6 +1446,7 @@ export class DispersionRecord extends EntityBase {
1295
1446
  this.massConc = options?.massConc;
1296
1447
  this.velocity = options?.velocity;
1297
1448
  this.massFlow = options?.massFlow;
1449
+ this.instCon = options?.instCon ?? Enums.DynamicType.UNSET;
1298
1450
  this.profileFlag = options?.profileFlag;
1299
1451
  this.elevFlag = options?.elevFlag;
1300
1452
  this.rhoCloud = options?.rhoCloud;
@@ -1307,7 +1459,6 @@ export class DispersionRecord extends EntityBase {
1307
1459
  this.dropletHeight = options?.dropletHeight;
1308
1460
  this.dropletDistance = options?.dropletDistance;
1309
1461
  this.mass = options?.mass;
1310
- this.instCon = options?.instCon ?? Enums.DynamicType.UNSET;
1311
1462
  }
1312
1463
 
1313
1464
  /** Initialise the entity with data from a dictionary. */
@@ -1361,6 +1512,9 @@ export class DispersionRecord extends EntityBase {
1361
1512
  if (data.massFlow !== undefined && typeof data.massFlow === 'number') {
1362
1513
  this.massFlow = data.massFlow as number;
1363
1514
  }
1515
+ if (data.instCon !== undefined && (typeof data.instCon === 'string' || typeof data.instCon === 'number')) {
1516
+ this.instCon = this.parseEnumValue(data.instCon, Enums.DynamicType);
1517
+ }
1364
1518
  if (data.profileFlag !== undefined && typeof data.profileFlag === 'number') {
1365
1519
  this.profileFlag = data.profileFlag as number;
1366
1520
  }
@@ -1397,12 +1551,9 @@ export class DispersionRecord extends EntityBase {
1397
1551
  if (data.mass !== undefined && typeof data.mass === 'number') {
1398
1552
  this.mass = data.mass as number;
1399
1553
  }
1400
- if (data.instCon !== undefined && (typeof data.instCon === 'string' || typeof data.instCon === 'number')) {
1401
- this.instCon = this.parseEnumValue(data.instCon, Enums.DynamicType);
1402
- }
1403
1554
  }
1404
1555
 
1405
- private parseEnumValue<T extends object>(value: unknown, enumType: T): T[keyof T] | undefined {
1556
+ protected parseEnumValue<T extends object>(value: unknown, enumType: T): T[keyof T] | undefined {
1406
1557
  if (typeof value === 'string' && value in enumType) {
1407
1558
  return enumType[value as keyof T];
1408
1559
  } else if (typeof value === 'number' && Object.values(enumType).includes(value)) {
@@ -1431,6 +1582,7 @@ export class DispersionRecord extends EntityBase {
1431
1582
  `massConc: ${this.massConc}`,
1432
1583
  `velocity: ${this.velocity}`,
1433
1584
  `massFlow: ${this.massFlow}`,
1585
+ `instCon: ${this.instCon}`,
1434
1586
  `profileFlag: ${this.profileFlag}`,
1435
1587
  `elevFlag: ${this.elevFlag}`,
1436
1588
  `rhoCloud: ${this.rhoCloud}`,
@@ -1443,7 +1595,6 @@ export class DispersionRecord extends EntityBase {
1443
1595
  `dropletHeight: ${this.dropletHeight}`,
1444
1596
  `dropletDistance: ${this.dropletDistance}`,
1445
1597
  `mass: ${this.mass}`,
1446
- `instCon: ${this.instCon}`,
1447
1598
  ];
1448
1599
  return parts.join('\n');
1449
1600
  }
@@ -1452,12 +1603,11 @@ export class DispersionRecord extends EntityBase {
1452
1603
  export class ExplosionConfinedVolume extends EntityBase {
1453
1604
  confinedStrength: number;
1454
1605
  confinedVolume: number;
1455
-
1456
1606
  /**
1457
1607
  * Confined explosion volume data.
1458
1608
  *
1459
1609
  * @param {Object} options - Initialisation options
1460
- * @param {number} options.confinedStrength - The degree of confinement in the area or source, described by an integer between 3 (lowest) and 10 (highest). (default value is 7)
1610
+ * @param {number} options.confinedStrength - The degree of confinement in the area or source, described by an integer between 3 (lowest) and 10 (highest). . (default value is 7)
1461
1611
  * @param {number} options.confinedVolume - The volume of the cloud that is contained in the area of confinement. [m3] (default value is 1)
1462
1612
  */
1463
1613
  constructor(options?: { id?: string; typeId?: string; displayName?: string; confinedStrength?: number; confinedVolume?: number }) {
@@ -1485,19 +1635,18 @@ export class ExplosionConfinedVolume extends EntityBase {
1485
1635
 
1486
1636
  export class ExplosionOutputConfig extends EntityBase {
1487
1637
  overpressureLevel: number;
1488
- meConfinedMethod?: Enums.MEConfinedMethod;
1489
-
1638
+ MEConfinedMethod?: Enums.MEConfinedMethod;
1490
1639
  /**
1491
1640
  * Explosion plotting and reporting parameters.
1492
1641
  *
1493
1642
  * @param {Object} options - Initialisation options
1494
1643
  * @param {number} options.overpressureLevel - Overpressure of interest for explosions. [N/m2] (default value is 2068)
1495
- * @param {Enums.MEConfinedMethod} options.meConfinedMethod - The multi energy confined method for modelling the effects of explosions. (default value is Enums.MEConfinedMethod.UNIFORM_CONFINED)
1644
+ * @param {Enums.MEConfinedMethod} options.MEConfinedMethod - The multi energy confined method for modelling the effects of explosions. (default value is Enums.MEConfinedMethod.UNIFORM_CONFINED)
1496
1645
  */
1497
- constructor(options?: { id?: string; typeId?: string; displayName?: string; overpressureLevel?: number; meConfinedMethod?: Enums.MEConfinedMethod }) {
1646
+ constructor(options?: { id?: string; typeId?: string; displayName?: string; overpressureLevel?: number; MEConfinedMethod?: Enums.MEConfinedMethod }) {
1498
1647
  super(options?.id, options?.typeId, options?.displayName);
1499
1648
  this.overpressureLevel = options?.overpressureLevel ?? 2068;
1500
- this.meConfinedMethod = options?.meConfinedMethod ?? Enums.MEConfinedMethod.UNIFORM_CONFINED;
1649
+ this.MEConfinedMethod = options?.MEConfinedMethod ?? Enums.MEConfinedMethod.UNIFORM_CONFINED;
1501
1650
  }
1502
1651
 
1503
1652
  /** Initialise the entity with data from a dictionary. */
@@ -1506,12 +1655,12 @@ export class ExplosionOutputConfig extends EntityBase {
1506
1655
  if (data.overpressureLevel !== undefined && typeof data.overpressureLevel === 'number') {
1507
1656
  this.overpressureLevel = data.overpressureLevel as number;
1508
1657
  }
1509
- if (data.meConfinedMethod !== undefined && (typeof data.meConfinedMethod === 'string' || typeof data.meConfinedMethod === 'number')) {
1510
- this.meConfinedMethod = this.parseEnumValue(data.meConfinedMethod, Enums.MEConfinedMethod);
1658
+ if (data.MEConfinedMethod !== undefined && (typeof data.MEConfinedMethod === 'string' || typeof data.MEConfinedMethod === 'number')) {
1659
+ this.MEConfinedMethod = this.parseEnumValue(data.MEConfinedMethod, Enums.MEConfinedMethod);
1511
1660
  }
1512
1661
  }
1513
1662
 
1514
- private parseEnumValue<T extends object>(value: unknown, enumType: T): T[keyof T] | undefined {
1663
+ protected parseEnumValue<T extends object>(value: unknown, enumType: T): T[keyof T] | undefined {
1515
1664
  if (typeof value === 'string' && value in enumType) {
1516
1665
  return enumType[value as keyof T];
1517
1666
  } else if (typeof value === 'number' && Object.values(enumType).includes(value)) {
@@ -1521,7 +1670,7 @@ export class ExplosionOutputConfig extends EntityBase {
1521
1670
  }
1522
1671
 
1523
1672
  toString() {
1524
- const parts = [super.toString(), '* ExplosionOutputConfig', `overpressureLevel: ${this.overpressureLevel}`, `meConfinedMethod: ${this.meConfinedMethod}`];
1673
+ const parts = [super.toString(), '* ExplosionOutputConfig', `overpressureLevel: ${this.overpressureLevel}`, `MEConfinedMethod: ${this.MEConfinedMethod}`];
1525
1674
  return parts.join('\n');
1526
1675
  }
1527
1676
  }
@@ -1533,7 +1682,6 @@ export class ExplosionOverpressureResult extends EntityBase {
1533
1682
  explodedMass?: number;
1534
1683
  ignitionTime?: number;
1535
1684
  radius?: number;
1536
-
1537
1685
  /**
1538
1686
  * Worst case explosion summary results for a given overpressure.
1539
1687
  *
@@ -1605,7 +1753,6 @@ export class ExplosionOverpressureResult extends EntityBase {
1605
1753
 
1606
1754
  export class ExplosionParameters extends EntityBase {
1607
1755
  explosionUniformStrength: number;
1608
-
1609
1756
  /**
1610
1757
  * A set of parameters used in explosion calculations.
1611
1758
  *
@@ -1636,7 +1783,6 @@ export class FlameRecord extends EntityBase {
1636
1783
  zCoordinate?: number;
1637
1784
  rCoordinate?: number;
1638
1785
  phiCoordinate?: number;
1639
-
1640
1786
  /**
1641
1787
  * A record containing flame geometry data.
1642
1788
  *
@@ -1687,21 +1833,20 @@ export class FlameRecord extends EntityBase {
1687
1833
  export class FlameResult extends EntityBase {
1688
1834
  time?: number;
1689
1835
  surfaceEmissivePower?: number;
1836
+ fireType?: Enums.FireType;
1690
1837
  flameLength?: number;
1691
1838
  flameDiameter?: number;
1692
- fireType?: Enums.FireType;
1693
1839
  liftOffHeight?: number;
1694
1840
  liftOffTime?: number;
1695
-
1696
1841
  /**
1697
1842
  * A set of flame results.
1698
1843
  *
1699
1844
  * @param {Object} options - Initialisation options
1700
1845
  * @param {number} options.time - Time of interest for time varying releases, or duration for initial rate releases. [s]
1701
1846
  * @param {number} options.surfaceEmissivePower - The rate at which thermal radiation is emitted from the surface of a flame per unit area. [W/m2]
1847
+ * @param {Enums.FireType} options.fireType - Type of fire. (default value is Enums.FireType.NO_FIRE)
1702
1848
  * @param {number} options.flameLength - Length of the flame. [m]
1703
1849
  * @param {number} options.flameDiameter - Diameter of the flame. [m]
1704
- * @param {Enums.FireType} options.fireType - Type of fire. (default value is Enums.FireType.NO_FIRE)
1705
1850
  * @param {number} options.liftOffHeight - Fireball centre height. [m]
1706
1851
  * @param {number} options.liftOffTime - Time to lift off. [s]
1707
1852
  */
@@ -1711,18 +1856,18 @@ export class FlameResult extends EntityBase {
1711
1856
  displayName?: string;
1712
1857
  time?: number;
1713
1858
  surfaceEmissivePower?: number;
1859
+ fireType?: Enums.FireType;
1714
1860
  flameLength?: number;
1715
1861
  flameDiameter?: number;
1716
- fireType?: Enums.FireType;
1717
1862
  liftOffHeight?: number;
1718
1863
  liftOffTime?: number;
1719
1864
  }) {
1720
1865
  super(options?.id, options?.typeId, options?.displayName);
1721
1866
  this.time = options?.time;
1722
1867
  this.surfaceEmissivePower = options?.surfaceEmissivePower;
1868
+ this.fireType = options?.fireType ?? Enums.FireType.NO_FIRE;
1723
1869
  this.flameLength = options?.flameLength;
1724
1870
  this.flameDiameter = options?.flameDiameter;
1725
- this.fireType = options?.fireType ?? Enums.FireType.NO_FIRE;
1726
1871
  this.liftOffHeight = options?.liftOffHeight;
1727
1872
  this.liftOffTime = options?.liftOffTime;
1728
1873
  }
@@ -1736,15 +1881,15 @@ export class FlameResult extends EntityBase {
1736
1881
  if (data.surfaceEmissivePower !== undefined && typeof data.surfaceEmissivePower === 'number') {
1737
1882
  this.surfaceEmissivePower = data.surfaceEmissivePower as number;
1738
1883
  }
1884
+ if (data.fireType !== undefined && (typeof data.fireType === 'string' || typeof data.fireType === 'number')) {
1885
+ this.fireType = this.parseEnumValue(data.fireType, Enums.FireType);
1886
+ }
1739
1887
  if (data.flameLength !== undefined && typeof data.flameLength === 'number') {
1740
1888
  this.flameLength = data.flameLength as number;
1741
1889
  }
1742
1890
  if (data.flameDiameter !== undefined && typeof data.flameDiameter === 'number') {
1743
1891
  this.flameDiameter = data.flameDiameter as number;
1744
1892
  }
1745
- if (data.fireType !== undefined && (typeof data.fireType === 'string' || typeof data.fireType === 'number')) {
1746
- this.fireType = this.parseEnumValue(data.fireType, Enums.FireType);
1747
- }
1748
1893
  if (data.liftOffHeight !== undefined && typeof data.liftOffHeight === 'number') {
1749
1894
  this.liftOffHeight = data.liftOffHeight as number;
1750
1895
  }
@@ -1753,7 +1898,7 @@ export class FlameResult extends EntityBase {
1753
1898
  }
1754
1899
  }
1755
1900
 
1756
- private parseEnumValue<T extends object>(value: unknown, enumType: T): T[keyof T] | undefined {
1901
+ protected parseEnumValue<T extends object>(value: unknown, enumType: T): T[keyof T] | undefined {
1757
1902
  if (typeof value === 'string' && value in enumType) {
1758
1903
  return enumType[value as keyof T];
1759
1904
  } else if (typeof value === 'number' && Object.values(enumType).includes(value)) {
@@ -1768,9 +1913,9 @@ export class FlameResult extends EntityBase {
1768
1913
  '* FlameResult',
1769
1914
  `time: ${this.time}`,
1770
1915
  `surfaceEmissivePower: ${this.surfaceEmissivePower}`,
1916
+ `fireType: ${this.fireType}`,
1771
1917
  `flameLength: ${this.flameLength}`,
1772
1918
  `flameDiameter: ${this.flameDiameter}`,
1773
- `fireType: ${this.fireType}`,
1774
1919
  `liftOffHeight: ${this.liftOffHeight}`,
1775
1920
  `liftOffTime: ${this.liftOffTime}`,
1776
1921
  ];
@@ -1781,7 +1926,6 @@ export class FlameResult extends EntityBase {
1781
1926
  export class Transect extends EntityBase {
1782
1927
  transectStartPoint: LocalPosition;
1783
1928
  transectEndPoint: LocalPosition;
1784
-
1785
1929
  /**
1786
1930
  * A line segment, along which results are provided.
1787
1931
  *
@@ -1816,26 +1960,25 @@ export class Transect extends EntityBase {
1816
1960
 
1817
1961
  export class FlammableOutputConfig extends EntityBase {
1818
1962
  position: LocalPosition;
1819
- transect: Transect;
1820
1963
  radiationType?: Enums.RadiationType;
1821
1964
  contourType?: Enums.ContourType;
1822
1965
  radiationLevel: number;
1823
1966
  radiationResolution?: Enums.Resolution;
1967
+ transect: Transect;
1824
1968
  fixedOrientation: number;
1825
1969
  orientation: number;
1826
1970
  fixedInclination: number;
1827
1971
  inclination: number;
1828
-
1829
1972
  /**
1830
1973
  * Fire and radiation plotting and reporting parameters.
1831
1974
  *
1832
1975
  * @param {Object} options - Initialisation options
1833
1976
  * @param {LocalPosition} options.position - Position used for radiation calculations (except Transect).
1834
- * @param {Transect} options.transect - A line segment, along which results are provided.
1835
1977
  * @param {Enums.RadiationType} options.radiationType - The type of radiation result of interest. (default value is Enums.RadiationType.INTENSITY)
1836
1978
  * @param {Enums.ContourType} options.contourType - The type of contour plot. (default value is Enums.ContourType.FOOTPRINT_ELLIPSE)
1837
1979
  * @param {number} options.radiationLevel - The radiation level of interest for the RadiationType. (default value is 4000)
1838
1980
  * @param {Enums.Resolution} options.radiationResolution - Spatial resolution for radiation calculations. (default value is Enums.Resolution.MEDIUM)
1981
+ * @param {Transect} options.transect - A line segment, along which results are provided.
1839
1982
  * @param {number} options.fixedOrientation - Whether to specify the orientation of a flat surface on which an observer lies with respect to the flame. (default value is 0)
1840
1983
  * @param {number} options.orientation - Angle between the projection of the observer normal onto the horizontal plane and the y axis. [rad] (default value is 0)
1841
1984
  * @param {number} options.fixedInclination - Whether to specify the inclination of a flat surface on which an observer lies with respect to the flame. (default value is 0)
@@ -1846,11 +1989,11 @@ export class FlammableOutputConfig extends EntityBase {
1846
1989
  typeId?: string;
1847
1990
  displayName?: string;
1848
1991
  position?: LocalPosition;
1849
- transect?: Transect;
1850
1992
  radiationType?: Enums.RadiationType;
1851
1993
  contourType?: Enums.ContourType;
1852
1994
  radiationLevel?: number;
1853
1995
  radiationResolution?: Enums.Resolution;
1996
+ transect?: Transect;
1854
1997
  fixedOrientation?: number;
1855
1998
  orientation?: number;
1856
1999
  fixedInclination?: number;
@@ -1858,11 +2001,11 @@ export class FlammableOutputConfig extends EntityBase {
1858
2001
  }) {
1859
2002
  super(options?.id, options?.typeId, options?.displayName);
1860
2003
  this.position = options?.position ?? new LocalPosition();
1861
- this.transect = options?.transect ?? new Transect();
1862
2004
  this.radiationType = options?.radiationType ?? Enums.RadiationType.INTENSITY;
1863
2005
  this.contourType = options?.contourType ?? Enums.ContourType.FOOTPRINT_ELLIPSE;
1864
2006
  this.radiationLevel = options?.radiationLevel ?? 4000;
1865
2007
  this.radiationResolution = options?.radiationResolution ?? Enums.Resolution.MEDIUM;
2008
+ this.transect = options?.transect ?? new Transect();
1866
2009
  this.fixedOrientation = options?.fixedOrientation ?? 0;
1867
2010
  this.orientation = options?.orientation ?? 0;
1868
2011
  this.fixedInclination = options?.fixedInclination ?? 0;
@@ -1876,10 +2019,6 @@ export class FlammableOutputConfig extends EntityBase {
1876
2019
  this.position = new LocalPosition();
1877
2020
  this.position.initialiseFromDictionary(data.position as { [key: string]: unknown });
1878
2021
  }
1879
- if (data.transect) {
1880
- this.transect = new Transect();
1881
- this.transect.initialiseFromDictionary(data.transect as { [key: string]: unknown });
1882
- }
1883
2022
  if (data.radiationType !== undefined && (typeof data.radiationType === 'string' || typeof data.radiationType === 'number')) {
1884
2023
  this.radiationType = this.parseEnumValue(data.radiationType, Enums.RadiationType);
1885
2024
  }
@@ -1892,6 +2031,10 @@ export class FlammableOutputConfig extends EntityBase {
1892
2031
  if (data.radiationResolution !== undefined && (typeof data.radiationResolution === 'string' || typeof data.radiationResolution === 'number')) {
1893
2032
  this.radiationResolution = this.parseEnumValue(data.radiationResolution, Enums.Resolution);
1894
2033
  }
2034
+ if (data.transect) {
2035
+ this.transect = new Transect();
2036
+ this.transect.initialiseFromDictionary(data.transect as { [key: string]: unknown });
2037
+ }
1895
2038
  if (data.fixedOrientation !== undefined && typeof data.fixedOrientation === 'number') {
1896
2039
  this.fixedOrientation = data.fixedOrientation as number;
1897
2040
  }
@@ -1906,7 +2049,7 @@ export class FlammableOutputConfig extends EntityBase {
1906
2049
  }
1907
2050
  }
1908
2051
 
1909
- private parseEnumValue<T extends object>(value: unknown, enumType: T): T[keyof T] | undefined {
2052
+ protected parseEnumValue<T extends object>(value: unknown, enumType: T): T[keyof T] | undefined {
1910
2053
  if (typeof value === 'string' && value in enumType) {
1911
2054
  return enumType[value as keyof T];
1912
2055
  } else if (typeof value === 'number' && Object.values(enumType).includes(value)) {
@@ -1920,11 +2063,11 @@ export class FlammableOutputConfig extends EntityBase {
1920
2063
  super.toString(),
1921
2064
  '* FlammableOutputConfig',
1922
2065
  `position: ${this.position?.toString()}`,
1923
- `transect: ${this.transect?.toString()}`,
1924
2066
  `radiationType: ${this.radiationType}`,
1925
2067
  `contourType: ${this.contourType}`,
1926
2068
  `radiationLevel: ${this.radiationLevel}`,
1927
2069
  `radiationResolution: ${this.radiationResolution}`,
2070
+ `transect: ${this.transect?.toString()}`,
1928
2071
  `fixedOrientation: ${this.fixedOrientation}`,
1929
2072
  `orientation: ${this.orientation}`,
1930
2073
  `fixedInclination: ${this.fixedInclination}`,
@@ -1941,7 +2084,6 @@ export class FlammableParameters extends EntityBase {
1941
2084
  jetFireAutoSelect: boolean;
1942
2085
  timeAveraging: boolean;
1943
2086
  timeOfInterest: number;
1944
-
1945
2087
  /**
1946
2088
  * A set of parameters used in fire and radiation calculations.
1947
2089
  *
@@ -1949,8 +2091,8 @@ export class FlammableParameters extends EntityBase {
1949
2091
  * @param {number} options.maxExposureDuration - The time that someone will remain in range of the radiation before attempting to escape. It is used in the calculations of dose and lethality. [s] (default value is 20)
1950
2092
  * @param {number} options.radiationRelativeTolerance - Controls the precision of the numerical integration over the visible surface of the flame when calculating the view factor of the flame as seen by an observer at a specific position. [fraction] (default value is 0.01)
1951
2093
  * @param {Enums.PoolFireType} options.poolFireType - Type of pool fire modelling. (default value is Enums.PoolFireType.LATE)
1952
- * @param {boolean} options.jetFireAutoSelect - Whether to have the calculations automatically select the type of jet fire modelling. (default value is false)
1953
- * @param {boolean} options.timeAveraging - Whether to base the jet fire calculations on a discharge rate averaged between 0 seconds and a TimeOfInterest. (default value is true)
2094
+ * @param {boolean} options.jetFireAutoSelect - Whether to have the calculations automatically select the type of jet fire modelling. (default value is False)
2095
+ * @param {boolean} options.timeAveraging - Whether to base the jet fire calculations on a discharge rate averaged between 0 seconds and a TimeOfInterest. (default value is True)
1954
2096
  * @param {number} options.timeOfInterest - The time of interest in the jet fire calculations. The jet fire will be based on the discharge results either at the TimeOfInterest or averaged between 0 seconds and the TimeOfInterest, depending on the TimeAveraging option. (default value is 20)
1955
2097
  */
1956
2098
  constructor(options?: {
@@ -1996,7 +2138,7 @@ export class FlammableParameters extends EntityBase {
1996
2138
  }
1997
2139
  }
1998
2140
 
1999
- private parseEnumValue<T extends object>(value: unknown, enumType: T): T[keyof T] | undefined {
2141
+ protected parseEnumValue<T extends object>(value: unknown, enumType: T): T[keyof T] | undefined {
2000
2142
  if (typeof value === 'string' && value in enumType) {
2001
2143
  return enumType[value as keyof T];
2002
2144
  } else if (typeof value === 'number' && Object.values(enumType).includes(value)) {
@@ -2030,14 +2172,13 @@ export class FlashResult extends EntityBase {
2030
2172
  vapourEntropy?: number;
2031
2173
  liquidEnthalpy?: number;
2032
2174
  vapourEnthalpy?: number;
2175
+ fluidPhase?: Enums.Phase;
2033
2176
  bubblePointPressure?: number;
2034
2177
  bubblePointTemperature?: number;
2035
2178
  dewPointPressure?: number;
2036
2179
  dewPointTemperature?: number;
2037
2180
  totalFluidDensity?: number;
2038
2181
  liquidMassFraction?: number;
2039
- fluidPhase?: Enums.Phase;
2040
-
2041
2182
  /**
2042
2183
  * Physical properties for a material generated at a particular pressure and temperature.
2043
2184
  *
@@ -2051,13 +2192,13 @@ export class FlashResult extends EntityBase {
2051
2192
  * @param {number} options.vapourEntropy - Entropy of vapour phase. [J/kg.K]
2052
2193
  * @param {number} options.liquidEnthalpy - Enthalpy of liquid phase.
2053
2194
  * @param {number} options.vapourEnthalpy - Enthalpy of vapour phase.
2195
+ * @param {Enums.Phase} options.fluidPhase - Vapour, liquid or two-phase. (default value is Enums.Phase.UNSET)
2054
2196
  * @param {number} options.bubblePointPressure - Mixture bubble point pressure at given temperature. [N/m2]
2055
2197
  * @param {number} options.bubblePointTemperature - Mixture bubble point temperature at given pressure. [K]
2056
2198
  * @param {number} options.dewPointPressure - Mixture dew point pressure at given temperature. [N/m2]
2057
2199
  * @param {number} options.dewPointTemperature - Mixture dew point temperature at given pressure. [K]
2058
2200
  * @param {number} options.totalFluidDensity - Total fluid density (mass-based). [kg/m3]
2059
2201
  * @param {number} options.liquidMassFraction - Liquid mass fraction. [fraction]
2060
- * @param {Enums.Phase} options.fluidPhase - Vapour, liquid or two-phase. (default value is Enums.Phase.UNSET)
2061
2202
  */
2062
2203
  constructor(options?: {
2063
2204
  id?: string;
@@ -2072,13 +2213,13 @@ export class FlashResult extends EntityBase {
2072
2213
  vapourEntropy?: number;
2073
2214
  liquidEnthalpy?: number;
2074
2215
  vapourEnthalpy?: number;
2216
+ fluidPhase?: Enums.Phase;
2075
2217
  bubblePointPressure?: number;
2076
2218
  bubblePointTemperature?: number;
2077
2219
  dewPointPressure?: number;
2078
2220
  dewPointTemperature?: number;
2079
2221
  totalFluidDensity?: number;
2080
2222
  liquidMassFraction?: number;
2081
- fluidPhase?: Enums.Phase;
2082
2223
  }) {
2083
2224
  super(options?.id, options?.typeId, options?.displayName);
2084
2225
  this.pressure = options?.pressure;
@@ -2090,13 +2231,13 @@ export class FlashResult extends EntityBase {
2090
2231
  this.vapourEntropy = options?.vapourEntropy;
2091
2232
  this.liquidEnthalpy = options?.liquidEnthalpy;
2092
2233
  this.vapourEnthalpy = options?.vapourEnthalpy;
2234
+ this.fluidPhase = options?.fluidPhase ?? Enums.Phase.UNSET;
2093
2235
  this.bubblePointPressure = options?.bubblePointPressure;
2094
2236
  this.bubblePointTemperature = options?.bubblePointTemperature;
2095
2237
  this.dewPointPressure = options?.dewPointPressure;
2096
2238
  this.dewPointTemperature = options?.dewPointTemperature;
2097
2239
  this.totalFluidDensity = options?.totalFluidDensity;
2098
2240
  this.liquidMassFraction = options?.liquidMassFraction;
2099
- this.fluidPhase = options?.fluidPhase ?? Enums.Phase.UNSET;
2100
2241
  }
2101
2242
 
2102
2243
  /** Initialise the entity with data from a dictionary. */
@@ -2129,6 +2270,9 @@ export class FlashResult extends EntityBase {
2129
2270
  if (data.vapourEnthalpy !== undefined && typeof data.vapourEnthalpy === 'number') {
2130
2271
  this.vapourEnthalpy = data.vapourEnthalpy as number;
2131
2272
  }
2273
+ if (data.fluidPhase !== undefined && (typeof data.fluidPhase === 'string' || typeof data.fluidPhase === 'number')) {
2274
+ this.fluidPhase = this.parseEnumValue(data.fluidPhase, Enums.Phase);
2275
+ }
2132
2276
  if (data.bubblePointPressure !== undefined && typeof data.bubblePointPressure === 'number') {
2133
2277
  this.bubblePointPressure = data.bubblePointPressure as number;
2134
2278
  }
@@ -2147,12 +2291,9 @@ export class FlashResult extends EntityBase {
2147
2291
  if (data.liquidMassFraction !== undefined && typeof data.liquidMassFraction === 'number') {
2148
2292
  this.liquidMassFraction = data.liquidMassFraction as number;
2149
2293
  }
2150
- if (data.fluidPhase !== undefined && (typeof data.fluidPhase === 'string' || typeof data.fluidPhase === 'number')) {
2151
- this.fluidPhase = this.parseEnumValue(data.fluidPhase, Enums.Phase);
2152
- }
2153
2294
  }
2154
2295
 
2155
- private parseEnumValue<T extends object>(value: unknown, enumType: T): T[keyof T] | undefined {
2296
+ protected parseEnumValue<T extends object>(value: unknown, enumType: T): T[keyof T] | undefined {
2156
2297
  if (typeof value === 'string' && value in enumType) {
2157
2298
  return enumType[value as keyof T];
2158
2299
  } else if (typeof value === 'number' && Object.values(enumType).includes(value)) {
@@ -2174,13 +2315,13 @@ export class FlashResult extends EntityBase {
2174
2315
  `vapourEntropy: ${this.vapourEntropy}`,
2175
2316
  `liquidEnthalpy: ${this.liquidEnthalpy}`,
2176
2317
  `vapourEnthalpy: ${this.vapourEnthalpy}`,
2318
+ `fluidPhase: ${this.fluidPhase}`,
2177
2319
  `bubblePointPressure: ${this.bubblePointPressure}`,
2178
2320
  `bubblePointTemperature: ${this.bubblePointTemperature}`,
2179
2321
  `dewPointPressure: ${this.dewPointPressure}`,
2180
2322
  `dewPointTemperature: ${this.dewPointTemperature}`,
2181
2323
  `totalFluidDensity: ${this.totalFluidDensity}`,
2182
2324
  `liquidMassFraction: ${this.liquidMassFraction}`,
2183
- `fluidPhase: ${this.fluidPhase}`,
2184
2325
  ];
2185
2326
  return parts.join('\n');
2186
2327
  }
@@ -2190,14 +2331,13 @@ export class Leak extends ReleaseOverTime {
2190
2331
  holeDiameter?: number;
2191
2332
  holeHeightFraction: number;
2192
2333
  releaseElevation: number;
2193
-
2194
2334
  /**
2195
2335
  * A storage scenario which models a release of material through a hole in a vessel or pipe.
2196
2336
  *
2197
2337
  * @param {Object} options - Initialisation options
2198
- * @param {number} options.holeDiameter - The diameter of the equivalent circular orifice with the same area as the area of the leak. [m]
2199
2338
  * @param {number} options.releaseAngle - Angle of release above a horizontal plane. [rad] (default value is 0.0)
2200
2339
  * @param {Enums.TimeVaryingOption} options.timeVaryingOption - Whether the release is a time-varying release or a steady state release using the initial rate. (default value is Enums.TimeVaryingOption.INITIAL_RATE)
2340
+ * @param {number} options.holeDiameter - The diameter of the equivalent circular orifice with the same area as the area of the leak. [m]
2201
2341
  * @param {number} options.holeHeightFraction - Location of the hole above the base of a vessel as a fraction of the vessel's vertical dimension. [fraction] (default value is 0.5)
2202
2342
  * @param {number} options.releaseElevation - The elevation of the release. [m] (default value is 1)
2203
2343
  */
@@ -2205,9 +2345,9 @@ export class Leak extends ReleaseOverTime {
2205
2345
  id?: string;
2206
2346
  typeId?: string;
2207
2347
  displayName?: string;
2208
- holeDiameter?: number;
2209
2348
  releaseAngle?: number;
2210
2349
  timeVaryingOption?: Enums.TimeVaryingOption;
2350
+ holeDiameter?: number;
2211
2351
  holeHeightFraction?: number;
2212
2352
  releaseElevation?: number;
2213
2353
  }) {
@@ -2235,9 +2375,9 @@ export class Leak extends ReleaseOverTime {
2235
2375
  const parts = [
2236
2376
  super.toString(),
2237
2377
  '* Leak',
2238
- `holeDiameter: ${this.holeDiameter}`,
2239
2378
  `releaseAngle: ${this.releaseAngle}`,
2240
2379
  `timeVaryingOption: ${this.timeVaryingOption}`,
2380
+ `holeDiameter: ${this.holeDiameter}`,
2241
2381
  `holeHeightFraction: ${this.holeHeightFraction}`,
2242
2382
  `releaseElevation: ${this.releaseElevation}`,
2243
2383
  ];
@@ -2250,15 +2390,14 @@ export class LineRupture extends ReleaseOverTime {
2250
2390
  pipeLength?: number;
2251
2391
  pipeRoughness: number;
2252
2392
  pipeHeightFraction: number;
2253
-
2254
2393
  /**
2255
2394
  * A storage scenario which models a release of material due to rupture of a short length of pipework attached to a vessel or any kind of pressure reservoir.
2256
2395
  *
2257
2396
  * @param {Object} options - Initialisation options
2258
- * @param {number} options.pipeDiameter - Internal diameter of the short pipe. [m]
2259
- * @param {number} options.pipeLength - Length of the short pipe. [m]
2260
2397
  * @param {number} options.releaseAngle - Angle of release above a horizontal plane. [rad] (default value is 0.0)
2261
2398
  * @param {Enums.TimeVaryingOption} options.timeVaryingOption - Whether the release is a time-varying release or a steady state release using the initial rate. (default value is Enums.TimeVaryingOption.INITIAL_RATE)
2399
+ * @param {number} options.pipeDiameter - Internal diameter of the short pipe. [m]
2400
+ * @param {number} options.pipeLength - Length of the short pipe. [m]
2262
2401
  * @param {number} options.pipeRoughness - Roughness of the short pipe. [m] (default value is 0.000045)
2263
2402
  * @param {number} options.pipeHeightFraction - Height of the pipe connection measured from the base of the vessel. [fraction] (default value is 0.5)
2264
2403
  */
@@ -2266,10 +2405,10 @@ export class LineRupture extends ReleaseOverTime {
2266
2405
  id?: string;
2267
2406
  typeId?: string;
2268
2407
  displayName?: string;
2269
- pipeDiameter?: number;
2270
- pipeLength?: number;
2271
2408
  releaseAngle?: number;
2272
2409
  timeVaryingOption?: Enums.TimeVaryingOption;
2410
+ pipeDiameter?: number;
2411
+ pipeLength?: number;
2273
2412
  pipeRoughness?: number;
2274
2413
  pipeHeightFraction?: number;
2275
2414
  }) {
@@ -2301,10 +2440,10 @@ export class LineRupture extends ReleaseOverTime {
2301
2440
  const parts = [
2302
2441
  super.toString(),
2303
2442
  '* LineRupture',
2304
- `pipeDiameter: ${this.pipeDiameter}`,
2305
- `pipeLength: ${this.pipeLength}`,
2306
2443
  `releaseAngle: ${this.releaseAngle}`,
2307
2444
  `timeVaryingOption: ${this.timeVaryingOption}`,
2445
+ `pipeDiameter: ${this.pipeDiameter}`,
2446
+ `pipeLength: ${this.pipeLength}`,
2308
2447
  `pipeRoughness: ${this.pipeRoughness}`,
2309
2448
  `pipeHeightFraction: ${this.pipeHeightFraction}`,
2310
2449
  ];
@@ -2320,7 +2459,6 @@ export class MaterialComponentDataItem extends EntityBase {
2320
2459
  calculationLimits?: number[];
2321
2460
  supercriticalExtrapolation: number;
2322
2461
  fractionTc: number;
2323
-
2324
2462
  /**
2325
2463
  * Material component data item.
2326
2464
  *
@@ -2346,11 +2484,11 @@ export class MaterialComponentDataItem extends EntityBase {
2346
2484
  fractionTc?: number;
2347
2485
  }) {
2348
2486
  super(options?.id, options?.typeId, options?.displayName);
2349
- this.equationNumber = options?.equationNumber;
2350
- this.equationCoefficients = options?.equationCoefficients;
2351
- this.calculationLimits = options?.calculationLimits;
2352
2487
  this.description = options?.description ?? '';
2488
+ this.equationNumber = options?.equationNumber;
2353
2489
  this.equationString = options?.equationString ?? '';
2490
+ this.equationCoefficients = options?.equationCoefficients ?? [];
2491
+ this.calculationLimits = options?.calculationLimits ?? [];
2354
2492
  this.supercriticalExtrapolation = options?.supercriticalExtrapolation ?? 0;
2355
2493
  this.fractionTc = options?.fractionTc ?? 1;
2356
2494
  }
@@ -2358,21 +2496,21 @@ export class MaterialComponentDataItem extends EntityBase {
2358
2496
  /** Initialise the entity with data from a dictionary. */
2359
2497
  initialiseFromDictionary(data: { [key: string]: unknown }) {
2360
2498
  super.initialiseFromDictionary(data);
2361
- if (data.equationNumber !== undefined && typeof data.equationNumber === 'number') {
2362
- this.equationNumber = data.equationNumber as number;
2363
- }
2364
- if (data.equationCoefficients && Array.isArray(data.equationCoefficients)) {
2365
- this.equationCoefficients = (data.equationCoefficients ?? []).map((item) => parseFloat(item));
2366
- }
2367
- if (data.calculationLimits && Array.isArray(data.calculationLimits)) {
2368
- this.calculationLimits = (data.calculationLimits ?? []).map((item) => parseFloat(item));
2369
- }
2370
2499
  if (data.description !== undefined && typeof data.description === 'string') {
2371
2500
  this.description = data.description as string;
2372
2501
  }
2502
+ if (data.equationNumber !== undefined && typeof data.equationNumber === 'number') {
2503
+ this.equationNumber = data.equationNumber as number;
2504
+ }
2373
2505
  if (data.equationString !== undefined && typeof data.equationString === 'string') {
2374
2506
  this.equationString = data.equationString as string;
2375
2507
  }
2508
+ if (data.equationCoefficients !== undefined && Array.isArray(data.equationCoefficients)) {
2509
+ this.equationCoefficients = data.equationCoefficients as number[];
2510
+ }
2511
+ if (data.calculationLimits !== undefined && Array.isArray(data.calculationLimits)) {
2512
+ this.calculationLimits = data.calculationLimits as number[];
2513
+ }
2376
2514
  if (data.supercriticalExtrapolation !== undefined && typeof data.supercriticalExtrapolation === 'number') {
2377
2515
  this.supercriticalExtrapolation = data.supercriticalExtrapolation as number;
2378
2516
  }
@@ -2385,11 +2523,11 @@ export class MaterialComponentDataItem extends EntityBase {
2385
2523
  const parts = [
2386
2524
  super.toString(),
2387
2525
  '* MaterialComponentDataItem',
2388
- `equationNumber: ${this.equationNumber}`,
2389
- this.equationCoefficients?.map((item) => item?.toString()).join('\n'),
2390
- this.calculationLimits?.map((item) => item?.toString()).join('\n'),
2391
2526
  `description: ${this.description}`,
2527
+ `equationNumber: ${this.equationNumber}`,
2392
2528
  `equationString: ${this.equationString}`,
2529
+ `equationCoefficients: ${this.equationCoefficients}`,
2530
+ `calculationLimits: ${this.calculationLimits}`,
2393
2531
  `supercriticalExtrapolation: ${this.supercriticalExtrapolation}`,
2394
2532
  `fractionTc: ${this.fractionTc}`,
2395
2533
  ];
@@ -2402,7 +2540,6 @@ export class MaterialComponentData extends EntityBase {
2402
2540
  dipprVersion?: number;
2403
2541
  casId?: number;
2404
2542
  dataItem: MaterialComponentDataItem[];
2405
-
2406
2543
  /**
2407
2544
  * Data related to a MaterialComponent.
2408
2545
  *
@@ -2414,15 +2551,18 @@ export class MaterialComponentData extends EntityBase {
2414
2551
  */
2415
2552
  constructor(options?: { id?: string; typeId?: string; displayName?: string; name?: string; dipprVersion?: number; casId?: number; dataItem?: MaterialComponentDataItem[] }) {
2416
2553
  super(options?.id, options?.typeId, options?.displayName);
2554
+ this.name = options?.name ?? '';
2417
2555
  this.dipprVersion = options?.dipprVersion;
2418
2556
  this.casId = options?.casId;
2419
2557
  this.dataItem = options?.dataItem ?? [new MaterialComponentDataItem()];
2420
- this.name = options?.name ?? '';
2421
2558
  }
2422
2559
 
2423
2560
  /** Initialise the entity with data from a dictionary. */
2424
2561
  initialiseFromDictionary(data: { [key: string]: unknown }) {
2425
2562
  super.initialiseFromDictionary(data);
2563
+ if (data.name !== undefined && typeof data.name === 'string') {
2564
+ this.name = data.name as string;
2565
+ }
2426
2566
  if (data.dipprVersion !== undefined && typeof data.dipprVersion === 'number') {
2427
2567
  this.dipprVersion = data.dipprVersion as number;
2428
2568
  }
@@ -2436,19 +2576,16 @@ export class MaterialComponentData extends EntityBase {
2436
2576
  return record;
2437
2577
  });
2438
2578
  }
2439
- if (data.name !== undefined && typeof data.name === 'string') {
2440
- this.name = data.name as string;
2441
- }
2442
2579
  }
2443
2580
 
2444
2581
  toString() {
2445
2582
  const parts = [
2446
2583
  super.toString(),
2447
2584
  '* MaterialComponentData',
2585
+ `name: ${this.name}`,
2448
2586
  `dipprVersion: ${this.dipprVersion}`,
2449
2587
  `casId: ${this.casId}`,
2450
2588
  this.dataItem?.map((item) => item?.toString()).join('\n'),
2451
- `name: ${this.name}`,
2452
2589
  ];
2453
2590
  return parts.join('\n');
2454
2591
  }
@@ -2459,6 +2596,7 @@ export class MixtureConstantPropertiesResult extends EntityBase {
2459
2596
  upperFlammabilityLimit?: number;
2460
2597
  criticalPressure?: number;
2461
2598
  criticalTemperature?: number;
2599
+ flammableToxicFlag?: Enums.FlammableToxic;
2462
2600
  flashPoint?: number;
2463
2601
  heatCombustion?: number;
2464
2602
  maximumBurnRate?: number;
@@ -2466,12 +2604,10 @@ export class MixtureConstantPropertiesResult extends EntityBase {
2466
2604
  molecularWeight?: number;
2467
2605
  bubblePoint?: number;
2468
2606
  poolFireBurnRateLength?: number;
2607
+ luminousSmokyFlame?: Enums.LuminousSmokyFlame;
2469
2608
  dewPoint?: number;
2470
2609
  emissivePowerLengthScale?: number;
2471
2610
  laminarBurningVelocity?: number;
2472
- flammableToxicFlag?: Enums.FlammableToxic;
2473
- luminousSmokyFlame?: Enums.LuminousSmokyFlame;
2474
-
2475
2611
  /**
2476
2612
  * Constant properties of a mixture.
2477
2613
  *
@@ -2480,6 +2616,7 @@ export class MixtureConstantPropertiesResult extends EntityBase {
2480
2616
  * @param {number} options.upperFlammabilityLimit - The maximum concentration of vapour in air that is capable of propagating a flame through a homogeneous mixture of air and the vapour. [fraction]
2481
2617
  * @param {number} options.criticalPressure - The pressure above which liquid and gas cannot coexist at any temperature. [N/m2]
2482
2618
  * @param {number} options.criticalTemperature - The temperature above which the gas cannot become liquid, regardless of the applied pressure. [K]
2619
+ * @param {Enums.FlammableToxic} options.flammableToxicFlag - Whether a material is flammable, toxic, both or inert. (default value is Enums.FlammableToxic.INERT)
2483
2620
  * @param {number} options.flashPoint - The lowest temperature at which a liquid can create enough vapour to ignite when exposed to an external heat source. [K]
2484
2621
  * @param {number} options.heatCombustion - The amount of energy released in the form of heat when one mole of a substance is burned.
2485
2622
  * @param {number} options.maximumBurnRate - The maximum mass rate at which a material burns per unit area, used in pool fire modelling.
@@ -2487,11 +2624,10 @@ export class MixtureConstantPropertiesResult extends EntityBase {
2487
2624
  * @param {number} options.molecularWeight - The sum of the atomic masses of all atoms in a molecule. [kg/kmol]
2488
2625
  * @param {number} options.bubblePoint - The temperature where the first bubble of vapor is formed when heating a liquid at atmospheric pressure. [K]
2489
2626
  * @param {number} options.poolFireBurnRateLength - A characteristic pool fire burn rate length. [m]
2627
+ * @param {Enums.LuminousSmokyFlame} options.luminousSmokyFlame - A flag to indicate whether a flame is luminous or smoky. (default value is Enums.LuminousSmokyFlame.GENERAL)
2490
2628
  * @param {number} options.dewPoint - The temperature at which the first liquid drop will form when cooling a gas at atmospheric pressure. [K]
2491
2629
  * @param {number} options.emissivePowerLengthScale - Used in pool fire modelling for calculating the emissive power for a fire with a given diameter. [m]
2492
2630
  * @param {number} options.laminarBurningVelocity - The flame speed, used in the Multi-Energy explosion modelling to calculate the peak overpressure, and can also be used in the pool fire calculations to calculate the MaximumBurnRate. [m/s]
2493
- * @param {Enums.FlammableToxic} options.flammableToxicFlag - Whether a material is flammable, toxic, both or inert. (default value is Enums.FlammableToxic.INERT)
2494
- * @param {Enums.LuminousSmokyFlame} options.luminousSmokyFlame - A flag to indicate whether a flame is luminous or smoky. (default value is Enums.LuminousSmokyFlame.GENERAL)
2495
2631
  */
2496
2632
  constructor(options?: {
2497
2633
  id?: string;
@@ -2501,6 +2637,7 @@ export class MixtureConstantPropertiesResult extends EntityBase {
2501
2637
  upperFlammabilityLimit?: number;
2502
2638
  criticalPressure?: number;
2503
2639
  criticalTemperature?: number;
2640
+ flammableToxicFlag?: Enums.FlammableToxic;
2504
2641
  flashPoint?: number;
2505
2642
  heatCombustion?: number;
2506
2643
  maximumBurnRate?: number;
@@ -2508,17 +2645,17 @@ export class MixtureConstantPropertiesResult extends EntityBase {
2508
2645
  molecularWeight?: number;
2509
2646
  bubblePoint?: number;
2510
2647
  poolFireBurnRateLength?: number;
2648
+ luminousSmokyFlame?: Enums.LuminousSmokyFlame;
2511
2649
  dewPoint?: number;
2512
2650
  emissivePowerLengthScale?: number;
2513
2651
  laminarBurningVelocity?: number;
2514
- flammableToxicFlag?: Enums.FlammableToxic;
2515
- luminousSmokyFlame?: Enums.LuminousSmokyFlame;
2516
2652
  }) {
2517
2653
  super(options?.id, options?.typeId, options?.displayName);
2518
2654
  this.lowerFlammabilityLimit = options?.lowerFlammabilityLimit;
2519
2655
  this.upperFlammabilityLimit = options?.upperFlammabilityLimit;
2520
2656
  this.criticalPressure = options?.criticalPressure;
2521
2657
  this.criticalTemperature = options?.criticalTemperature;
2658
+ this.flammableToxicFlag = options?.flammableToxicFlag ?? Enums.FlammableToxic.INERT;
2522
2659
  this.flashPoint = options?.flashPoint;
2523
2660
  this.heatCombustion = options?.heatCombustion;
2524
2661
  this.maximumBurnRate = options?.maximumBurnRate;
@@ -2526,11 +2663,10 @@ export class MixtureConstantPropertiesResult extends EntityBase {
2526
2663
  this.molecularWeight = options?.molecularWeight;
2527
2664
  this.bubblePoint = options?.bubblePoint;
2528
2665
  this.poolFireBurnRateLength = options?.poolFireBurnRateLength;
2666
+ this.luminousSmokyFlame = options?.luminousSmokyFlame ?? Enums.LuminousSmokyFlame.GENERAL;
2529
2667
  this.dewPoint = options?.dewPoint;
2530
2668
  this.emissivePowerLengthScale = options?.emissivePowerLengthScale;
2531
2669
  this.laminarBurningVelocity = options?.laminarBurningVelocity;
2532
- this.flammableToxicFlag = options?.flammableToxicFlag ?? Enums.FlammableToxic.INERT;
2533
- this.luminousSmokyFlame = options?.luminousSmokyFlame ?? Enums.LuminousSmokyFlame.GENERAL;
2534
2670
  }
2535
2671
 
2536
2672
  /** Initialise the entity with data from a dictionary. */
@@ -2548,6 +2684,9 @@ export class MixtureConstantPropertiesResult extends EntityBase {
2548
2684
  if (data.criticalTemperature !== undefined && typeof data.criticalTemperature === 'number') {
2549
2685
  this.criticalTemperature = data.criticalTemperature as number;
2550
2686
  }
2687
+ if (data.flammableToxicFlag !== undefined && (typeof data.flammableToxicFlag === 'string' || typeof data.flammableToxicFlag === 'number')) {
2688
+ this.flammableToxicFlag = this.parseEnumValue(data.flammableToxicFlag, Enums.FlammableToxic);
2689
+ }
2551
2690
  if (data.flashPoint !== undefined && typeof data.flashPoint === 'number') {
2552
2691
  this.flashPoint = data.flashPoint as number;
2553
2692
  }
@@ -2569,6 +2708,9 @@ export class MixtureConstantPropertiesResult extends EntityBase {
2569
2708
  if (data.poolFireBurnRateLength !== undefined && typeof data.poolFireBurnRateLength === 'number') {
2570
2709
  this.poolFireBurnRateLength = data.poolFireBurnRateLength as number;
2571
2710
  }
2711
+ if (data.luminousSmokyFlame !== undefined && (typeof data.luminousSmokyFlame === 'string' || typeof data.luminousSmokyFlame === 'number')) {
2712
+ this.luminousSmokyFlame = this.parseEnumValue(data.luminousSmokyFlame, Enums.LuminousSmokyFlame);
2713
+ }
2572
2714
  if (data.dewPoint !== undefined && typeof data.dewPoint === 'number') {
2573
2715
  this.dewPoint = data.dewPoint as number;
2574
2716
  }
@@ -2578,15 +2720,9 @@ export class MixtureConstantPropertiesResult extends EntityBase {
2578
2720
  if (data.laminarBurningVelocity !== undefined && typeof data.laminarBurningVelocity === 'number') {
2579
2721
  this.laminarBurningVelocity = data.laminarBurningVelocity as number;
2580
2722
  }
2581
- if (data.flammableToxicFlag !== undefined && (typeof data.flammableToxicFlag === 'string' || typeof data.flammableToxicFlag === 'number')) {
2582
- this.flammableToxicFlag = this.parseEnumValue(data.flammableToxicFlag, Enums.FlammableToxic);
2583
- }
2584
- if (data.luminousSmokyFlame !== undefined && (typeof data.luminousSmokyFlame === 'string' || typeof data.luminousSmokyFlame === 'number')) {
2585
- this.luminousSmokyFlame = this.parseEnumValue(data.luminousSmokyFlame, Enums.LuminousSmokyFlame);
2586
- }
2587
2723
  }
2588
2724
 
2589
- private parseEnumValue<T extends object>(value: unknown, enumType: T): T[keyof T] | undefined {
2725
+ protected parseEnumValue<T extends object>(value: unknown, enumType: T): T[keyof T] | undefined {
2590
2726
  if (typeof value === 'string' && value in enumType) {
2591
2727
  return enumType[value as keyof T];
2592
2728
  } else if (typeof value === 'number' && Object.values(enumType).includes(value)) {
@@ -2603,6 +2739,7 @@ export class MixtureConstantPropertiesResult extends EntityBase {
2603
2739
  `upperFlammabilityLimit: ${this.upperFlammabilityLimit}`,
2604
2740
  `criticalPressure: ${this.criticalPressure}`,
2605
2741
  `criticalTemperature: ${this.criticalTemperature}`,
2742
+ `flammableToxicFlag: ${this.flammableToxicFlag}`,
2606
2743
  `flashPoint: ${this.flashPoint}`,
2607
2744
  `heatCombustion: ${this.heatCombustion}`,
2608
2745
  `maximumBurnRate: ${this.maximumBurnRate}`,
@@ -2610,11 +2747,10 @@ export class MixtureConstantPropertiesResult extends EntityBase {
2610
2747
  `molecularWeight: ${this.molecularWeight}`,
2611
2748
  `bubblePoint: ${this.bubblePoint}`,
2612
2749
  `poolFireBurnRateLength: ${this.poolFireBurnRateLength}`,
2750
+ `luminousSmokyFlame: ${this.luminousSmokyFlame}`,
2613
2751
  `dewPoint: ${this.dewPoint}`,
2614
2752
  `emissivePowerLengthScale: ${this.emissivePowerLengthScale}`,
2615
2753
  `laminarBurningVelocity: ${this.laminarBurningVelocity}`,
2616
- `flammableToxicFlag: ${this.flammableToxicFlag}`,
2617
- `luminousSmokyFlame: ${this.luminousSmokyFlame}`,
2618
2754
  ];
2619
2755
  return parts.join('\n');
2620
2756
  }
@@ -2624,11 +2760,10 @@ export class Pipe extends Asset {
2624
2760
  nodes: LocalPosition[];
2625
2761
  nodeCount?: number;
2626
2762
  diameter?: number;
2763
+ roughness: number;
2627
2764
  material: Material;
2628
2765
  state: State;
2629
- roughness: number;
2630
2766
  pumpedInflow: number;
2631
-
2632
2767
  /**
2633
2768
  * An asset to model events that involve releases from pressurised pipelines.
2634
2769
  *
@@ -2637,9 +2772,9 @@ export class Pipe extends Asset {
2637
2772
  * @param {LocalPosition[]} options.nodes - A set of points along the pipe.
2638
2773
  * @param {number} options.nodeCount - The number of nodes along the pipe.
2639
2774
  * @param {number} options.diameter - Diameter of the pipe. [m]
2775
+ * @param {number} options.roughness - A measure of the roughness of internal surfaces of the pipe. [m] (default value is 4.5e-5)
2640
2776
  * @param {Material} options.material - Material.
2641
2777
  * @param {State} options.state - Fluid state in the pipe.
2642
- * @param {number} options.roughness - A measure of the roughness of internal surfaces of the pipe. [m] (default value is 4.5e-5)
2643
2778
  * @param {number} options.pumpedInflow - Flowrate along the pipeline under normal operating conditions. [kg/s] (default value is 0)
2644
2779
  */
2645
2780
  constructor(options?: {
@@ -2650,18 +2785,18 @@ export class Pipe extends Asset {
2650
2785
  nodes?: LocalPosition[];
2651
2786
  nodeCount?: number;
2652
2787
  diameter?: number;
2788
+ roughness?: number;
2653
2789
  material?: Material;
2654
2790
  state?: State;
2655
- roughness?: number;
2656
2791
  pumpedInflow?: number;
2657
2792
  }) {
2658
2793
  super(options);
2659
2794
  this.nodes = options?.nodes ?? [new LocalPosition()];
2660
2795
  this.nodeCount = options?.nodeCount;
2661
2796
  this.diameter = options?.diameter;
2797
+ this.roughness = options?.roughness ?? 4.5e-5;
2662
2798
  this.material = options?.material ?? new Material();
2663
2799
  this.state = options?.state ?? new State();
2664
- this.roughness = options?.roughness ?? 4.5e-5;
2665
2800
  this.pumpedInflow = options?.pumpedInflow ?? 0;
2666
2801
  }
2667
2802
 
@@ -2681,6 +2816,9 @@ export class Pipe extends Asset {
2681
2816
  if (data.diameter !== undefined && typeof data.diameter === 'number') {
2682
2817
  this.diameter = data.diameter as number;
2683
2818
  }
2819
+ if (data.roughness !== undefined && typeof data.roughness === 'number') {
2820
+ this.roughness = data.roughness as number;
2821
+ }
2684
2822
  if (data.material) {
2685
2823
  this.material = new Material();
2686
2824
  this.material.initialiseFromDictionary(data.material as { [key: string]: unknown });
@@ -2689,9 +2827,6 @@ export class Pipe extends Asset {
2689
2827
  this.state = new State();
2690
2828
  this.state.initialiseFromDictionary(data.state as { [key: string]: unknown });
2691
2829
  }
2692
- if (data.roughness !== undefined && typeof data.roughness === 'number') {
2693
- this.roughness = data.roughness as number;
2694
- }
2695
2830
  if (data.pumpedInflow !== undefined && typeof data.pumpedInflow === 'number') {
2696
2831
  this.pumpedInflow = data.pumpedInflow as number;
2697
2832
  }
@@ -2705,9 +2840,9 @@ export class Pipe extends Asset {
2705
2840
  this.nodes?.map((item) => item?.toString()).join('\n'),
2706
2841
  `nodeCount: ${this.nodeCount}`,
2707
2842
  `diameter: ${this.diameter}`,
2843
+ `roughness: ${this.roughness}`,
2708
2844
  `material: ${this.material?.toString()}`,
2709
2845
  `state: ${this.state?.toString()}`,
2710
- `roughness: ${this.roughness}`,
2711
2846
  `pumpedInflow: ${this.pumpedInflow}`,
2712
2847
  ];
2713
2848
  return parts.join('\n');
@@ -2717,28 +2852,35 @@ export class Pipe extends Asset {
2717
2852
  export class PipeBreach extends ReleaseOverTime {
2718
2853
  distanceDownstream?: number;
2719
2854
  relativeAperture: number;
2720
-
2855
+ holeDiameter: number;
2856
+ breachSizingMethod?: Enums.BreachSizingMethod;
2721
2857
  /**
2722
2858
  * A storage scenario which models a time-dependent release of material from its process or transport conditions in a pipeline.
2723
2859
  *
2724
2860
  * @param {Object} options - Initialisation options
2725
- * @param {number} options.distanceDownstream - The distance of the pipe breach, measured along the pipeline from the upstream end. [m]
2726
2861
  * @param {number} options.releaseAngle - Angle of release above a horizontal plane. [rad] (default value is 0.0)
2727
2862
  * @param {Enums.TimeVaryingOption} options.timeVaryingOption - Whether the release is a time-varying release or a steady state release using the initial rate. (default value is Enums.TimeVaryingOption.INITIAL_RATE)
2863
+ * @param {number} options.distanceDownstream - The distance of the pipe breach, measured along the pipeline from the upstream end. [m]
2728
2864
  * @param {number} options.relativeAperture - The size of the outflow area as a fraction of the total potential outflow area for the breach location. [fraction] (default value is 1)
2865
+ * @param {number} options.holeDiameter - Diameter of the breach. [m] (default value is 0.05)
2866
+ * @param {Enums.BreachSizingMethod} options.breachSizingMethod - Selection of the breach size method. (default value is Enums.BreachSizingMethod.RELATIVE_SIZE)
2729
2867
  */
2730
2868
  constructor(options?: {
2731
2869
  id?: string;
2732
2870
  typeId?: string;
2733
2871
  displayName?: string;
2734
- distanceDownstream?: number;
2735
2872
  releaseAngle?: number;
2736
2873
  timeVaryingOption?: Enums.TimeVaryingOption;
2874
+ distanceDownstream?: number;
2737
2875
  relativeAperture?: number;
2876
+ holeDiameter?: number;
2877
+ breachSizingMethod?: Enums.BreachSizingMethod;
2738
2878
  }) {
2739
2879
  super(options);
2740
2880
  this.distanceDownstream = options?.distanceDownstream;
2741
2881
  this.relativeAperture = options?.relativeAperture ?? 1;
2882
+ this.holeDiameter = options?.holeDiameter ?? 0.05;
2883
+ this.breachSizingMethod = options?.breachSizingMethod ?? Enums.BreachSizingMethod.RELATIVE_SIZE;
2742
2884
  }
2743
2885
 
2744
2886
  /** Initialise the entity with data from a dictionary. */
@@ -2750,16 +2892,24 @@ export class PipeBreach extends ReleaseOverTime {
2750
2892
  if (data.relativeAperture !== undefined && typeof data.relativeAperture === 'number') {
2751
2893
  this.relativeAperture = data.relativeAperture as number;
2752
2894
  }
2895
+ if (data.holeDiameter !== undefined && typeof data.holeDiameter === 'number') {
2896
+ this.holeDiameter = data.holeDiameter as number;
2897
+ }
2898
+ if (data.breachSizingMethod !== undefined && (typeof data.breachSizingMethod === 'string' || typeof data.breachSizingMethod === 'number')) {
2899
+ this.breachSizingMethod = this.parseEnumValue(data.breachSizingMethod, Enums.BreachSizingMethod);
2900
+ }
2753
2901
  }
2754
2902
 
2755
2903
  toString() {
2756
2904
  const parts = [
2757
2905
  super.toString(),
2758
2906
  '* PipeBreach',
2759
- `distanceDownstream: ${this.distanceDownstream}`,
2760
2907
  `releaseAngle: ${this.releaseAngle}`,
2761
2908
  `timeVaryingOption: ${this.timeVaryingOption}`,
2909
+ `distanceDownstream: ${this.distanceDownstream}`,
2762
2910
  `relativeAperture: ${this.relativeAperture}`,
2911
+ `holeDiameter: ${this.holeDiameter}`,
2912
+ `breachSizingMethod: ${this.breachSizingMethod}`,
2763
2913
  ];
2764
2914
  return parts.join('\n');
2765
2915
  }
@@ -2768,20 +2918,19 @@ export class PipeBreach extends ReleaseOverTime {
2768
2918
  export class PoolFireFlameResult extends FlameResult {
2769
2919
  poolZoneSEP?: number[];
2770
2920
  poolCentre?: number;
2771
-
2772
2921
  /**
2773
2922
  * Flame results for a pool fire.
2774
2923
  *
2775
2924
  * @param {Object} options - Initialisation options
2776
2925
  * @param {number} options.time - Time of interest for time varying releases, or duration for initial rate releases. [s]
2777
2926
  * @param {number} options.surfaceEmissivePower - The rate at which thermal radiation is emitted from the surface of a flame per unit area. [W/m2]
2927
+ * @param {Enums.FireType} options.fireType - Type of fire. (default value is Enums.FireType.NO_FIRE)
2778
2928
  * @param {number} options.flameLength - Length of the flame. [m]
2779
2929
  * @param {number} options.flameDiameter - Diameter of the flame. [m]
2780
- * @param {number[]} options.poolZoneSEP - Surface emissive power from each of the two pool fire zones. [W/m2]
2781
- * @param {number} options.poolCentre - The downwind distance to the centre of the pool fire. [m]
2782
- * @param {Enums.FireType} options.fireType - Type of fire. (default value is Enums.FireType.NO_FIRE)
2783
2930
  * @param {number} options.liftOffHeight - Fireball centre height. [m]
2784
2931
  * @param {number} options.liftOffTime - Time to lift off. [s]
2932
+ * @param {number[]} options.poolZoneSEP - Surface emissive power from each of the two pool fire zones. [W/m2]
2933
+ * @param {number} options.poolCentre - Location downwind of the centre of the pool. [m]
2785
2934
  */
2786
2935
  constructor(options?: {
2787
2936
  id?: string;
@@ -2789,24 +2938,24 @@ export class PoolFireFlameResult extends FlameResult {
2789
2938
  displayName?: string;
2790
2939
  time?: number;
2791
2940
  surfaceEmissivePower?: number;
2941
+ fireType?: Enums.FireType;
2792
2942
  flameLength?: number;
2793
2943
  flameDiameter?: number;
2794
- poolZoneSEP?: number[];
2795
- poolCentre?: number;
2796
- fireType?: Enums.FireType;
2797
2944
  liftOffHeight?: number;
2798
2945
  liftOffTime?: number;
2946
+ poolZoneSEP?: number[];
2947
+ poolCentre?: number;
2799
2948
  }) {
2800
2949
  super(options);
2801
- this.poolZoneSEP = options?.poolZoneSEP;
2950
+ this.poolZoneSEP = options?.poolZoneSEP ?? [];
2802
2951
  this.poolCentre = options?.poolCentre;
2803
2952
  }
2804
2953
 
2805
2954
  /** Initialise the entity with data from a dictionary. */
2806
2955
  initialiseFromDictionary(data: { [key: string]: unknown }) {
2807
2956
  super.initialiseFromDictionary(data);
2808
- if (data.poolZoneSEP && Array.isArray(data.poolZoneSEP)) {
2809
- this.poolZoneSEP = (data.poolZoneSEP ?? []).map((item) => parseFloat(item));
2957
+ if (data.poolZoneSEP !== undefined && Array.isArray(data.poolZoneSEP)) {
2958
+ this.poolZoneSEP = data.poolZoneSEP as number[];
2810
2959
  }
2811
2960
  if (data.poolCentre !== undefined && typeof data.poolCentre === 'number') {
2812
2961
  this.poolCentre = data.poolCentre as number;
@@ -2819,13 +2968,13 @@ export class PoolFireFlameResult extends FlameResult {
2819
2968
  '* PoolFireFlameResult',
2820
2969
  `time: ${this.time}`,
2821
2970
  `surfaceEmissivePower: ${this.surfaceEmissivePower}`,
2971
+ `fireType: ${this.fireType}`,
2822
2972
  `flameLength: ${this.flameLength}`,
2823
2973
  `flameDiameter: ${this.flameDiameter}`,
2824
- this.poolZoneSEP?.map((item) => item?.toString()).join('\n'),
2825
- `poolCentre: ${this.poolCentre}`,
2826
- `fireType: ${this.fireType}`,
2827
2974
  `liftOffHeight: ${this.liftOffHeight}`,
2828
2975
  `liftOffTime: ${this.liftOffTime}`,
2976
+ `poolZoneSEP: ${this.poolZoneSEP}`,
2977
+ `poolCentre: ${this.poolCentre}`,
2829
2978
  ];
2830
2979
  return parts.join('\n');
2831
2980
  }
@@ -2845,7 +2994,6 @@ export class PoolRecord extends EntityBase {
2845
2994
  spillRate?: number;
2846
2995
  actualRadius?: number;
2847
2996
  poolCentre?: number;
2848
-
2849
2997
  /**
2850
2998
  * A record containing pool results at a given time.
2851
2999
  *
@@ -2968,7 +3116,6 @@ export class PoolVapourisationParameters extends EntityBase {
2968
3116
  toxicsCutoffRate: number;
2969
3117
  flammableCutoffRate: number;
2970
3118
  relativeTolerance: number;
2971
-
2972
3119
  /**
2973
3120
  * Pool vapourisation parameters.
2974
3121
  *
@@ -3012,22 +3159,21 @@ export class PoolVapourisationParameters extends EntityBase {
3012
3159
 
3013
3160
  export class RadiationRecord extends EntityBase {
3014
3161
  position: LocalPosition;
3015
- radiationResult?: number;
3016
3162
  radiationType?: Enums.RadiationType;
3017
-
3163
+ radiationResult?: number;
3018
3164
  /**
3019
3165
  * A record of the radiation type and level at a specific point (x,y,z).
3020
3166
  *
3021
3167
  * @param {Object} options - Initialisation options
3022
3168
  * @param {LocalPosition} options.position - Cartesian coordinates of a point of interest.
3023
- * @param {number} options.radiationResult - The value for the RadiationType at the specified position.
3024
3169
  * @param {Enums.RadiationType} options.radiationType - The type of radiation result of interest. (default value is Enums.RadiationType.UNSET)
3170
+ * @param {number} options.radiationResult - The value for the RadiationType at the specified position.
3025
3171
  */
3026
- constructor(options?: { id?: string; typeId?: string; displayName?: string; position?: LocalPosition; radiationResult?: number; radiationType?: Enums.RadiationType }) {
3172
+ constructor(options?: { id?: string; typeId?: string; displayName?: string; position?: LocalPosition; radiationType?: Enums.RadiationType; radiationResult?: number }) {
3027
3173
  super(options?.id, options?.typeId, options?.displayName);
3028
3174
  this.position = options?.position ?? new LocalPosition();
3029
- this.radiationResult = options?.radiationResult;
3030
3175
  this.radiationType = options?.radiationType ?? Enums.RadiationType.UNSET;
3176
+ this.radiationResult = options?.radiationResult;
3031
3177
  }
3032
3178
 
3033
3179
  /** Initialise the entity with data from a dictionary. */
@@ -3037,15 +3183,15 @@ export class RadiationRecord extends EntityBase {
3037
3183
  this.position = new LocalPosition();
3038
3184
  this.position.initialiseFromDictionary(data.position as { [key: string]: unknown });
3039
3185
  }
3040
- if (data.radiationResult !== undefined && typeof data.radiationResult === 'number') {
3041
- this.radiationResult = data.radiationResult as number;
3042
- }
3043
3186
  if (data.radiationType !== undefined && (typeof data.radiationType === 'string' || typeof data.radiationType === 'number')) {
3044
3187
  this.radiationType = this.parseEnumValue(data.radiationType, Enums.RadiationType);
3045
3188
  }
3189
+ if (data.radiationResult !== undefined && typeof data.radiationResult === 'number') {
3190
+ this.radiationResult = data.radiationResult as number;
3191
+ }
3046
3192
  }
3047
3193
 
3048
- private parseEnumValue<T extends object>(value: unknown, enumType: T): T[keyof T] | undefined {
3194
+ protected parseEnumValue<T extends object>(value: unknown, enumType: T): T[keyof T] | undefined {
3049
3195
  if (typeof value === 'string' && value in enumType) {
3050
3196
  return enumType[value as keyof T];
3051
3197
  } else if (typeof value === 'number' && Object.values(enumType).includes(value)) {
@@ -3055,7 +3201,7 @@ export class RadiationRecord extends EntityBase {
3055
3201
  }
3056
3202
 
3057
3203
  toString() {
3058
- const parts = [super.toString(), '* RadiationRecord', `position: ${this.position?.toString()}`, `radiationResult: ${this.radiationResult}`, `radiationType: ${this.radiationType}`];
3204
+ const parts = [super.toString(), '* RadiationRecord', `position: ${this.position?.toString()}`, `radiationType: ${this.radiationType}`, `radiationResult: ${this.radiationResult}`];
3059
3205
  return parts.join('\n');
3060
3206
  }
3061
3207
  }
@@ -3066,16 +3212,15 @@ export class ReliefValve extends ReleaseOverTime {
3066
3212
  pipeLength?: number;
3067
3213
  pipeRoughness: number;
3068
3214
  pipeHeightFraction: number;
3069
-
3070
3215
  /**
3071
3216
  * A storage scenario which models a release of material from the vapour side of a vessel due to the lifting of a relief valve.
3072
3217
  *
3073
3218
  * @param {Object} options - Initialisation options
3219
+ * @param {number} options.releaseAngle - Angle of release above a horizontal plane. [rad] (default value is 0.0)
3220
+ * @param {Enums.TimeVaryingOption} options.timeVaryingOption - Whether the release is a time-varying release or a steady state release using the initial rate. (default value is Enums.TimeVaryingOption.INITIAL_RATE)
3074
3221
  * @param {number} options.reliefValveConstrictionDiameter - Constriction at the upstream end of the pipe. [m]
3075
3222
  * @param {number} options.pipeDiameter - Internal diameter of the short pipe. [m]
3076
3223
  * @param {number} options.pipeLength - Length of the short pipe. [m]
3077
- * @param {number} options.releaseAngle - Angle of release above a horizontal plane. [rad] (default value is 0.0)
3078
- * @param {Enums.TimeVaryingOption} options.timeVaryingOption - Whether the release is a time-varying release or a steady state release using the initial rate. (default value is Enums.TimeVaryingOption.INITIAL_RATE)
3079
3224
  * @param {number} options.pipeRoughness - Roughness of the short pipe. [m] (default value is 0.000045)
3080
3225
  * @param {number} options.pipeHeightFraction - Location of the pipe connection above the base of the vessel. [fraction] (default value is 0.5)
3081
3226
  */
@@ -3083,11 +3228,11 @@ export class ReliefValve extends ReleaseOverTime {
3083
3228
  id?: string;
3084
3229
  typeId?: string;
3085
3230
  displayName?: string;
3231
+ releaseAngle?: number;
3232
+ timeVaryingOption?: Enums.TimeVaryingOption;
3086
3233
  reliefValveConstrictionDiameter?: number;
3087
3234
  pipeDiameter?: number;
3088
3235
  pipeLength?: number;
3089
- releaseAngle?: number;
3090
- timeVaryingOption?: Enums.TimeVaryingOption;
3091
3236
  pipeRoughness?: number;
3092
3237
  pipeHeightFraction?: number;
3093
3238
  }) {
@@ -3123,11 +3268,11 @@ export class ReliefValve extends ReleaseOverTime {
3123
3268
  const parts = [
3124
3269
  super.toString(),
3125
3270
  '* ReliefValve',
3271
+ `releaseAngle: ${this.releaseAngle}`,
3272
+ `timeVaryingOption: ${this.timeVaryingOption}`,
3126
3273
  `reliefValveConstrictionDiameter: ${this.reliefValveConstrictionDiameter}`,
3127
3274
  `pipeDiameter: ${this.pipeDiameter}`,
3128
3275
  `pipeLength: ${this.pipeLength}`,
3129
- `releaseAngle: ${this.releaseAngle}`,
3130
- `timeVaryingOption: ${this.timeVaryingOption}`,
3131
3276
  `pipeRoughness: ${this.pipeRoughness}`,
3132
3277
  `pipeHeightFraction: ${this.pipeHeightFraction}`,
3133
3278
  ];
@@ -3142,16 +3287,15 @@ export class SafetySystem extends EntityBase {
3142
3287
  blowdownTime: number;
3143
3288
  blowdownSuccess: boolean;
3144
3289
  blowdownValveSize: number;
3145
-
3146
3290
  /**
3147
3291
  * A safety system entity which defines isolation and blowdown settings for a pressurised vessel.
3148
3292
  *
3149
3293
  * @param {Object} options - Initialisation options
3150
3294
  * @param {number} options.isolationTime - Time from start of release to failed or successful isolation. [s] (default value is 0.0)
3151
- * @param {boolean} options.isolationSuccess - Does isolation succeed?. (default value is true)
3295
+ * @param {boolean} options.isolationSuccess - Does isolation succeed?. (default value is True)
3152
3296
  * @param {number} options.massAddedIsolationFailure - Upstream mass to add in case of isolation failure. [kg] (default value is 0.0)
3153
3297
  * @param {number} options.blowdownTime - Time from start of release to failed or successful blowdown. [s] (default value is 0.0)
3154
- * @param {boolean} options.blowdownSuccess - Does blowdown succeed?. (default value is false)
3298
+ * @param {boolean} options.blowdownSuccess - Does blowdown succeed?. (default value is False)
3155
3299
  * @param {number} options.blowdownValveSize - Diameter of blowdown valve. [m] (default value is 0.025)
3156
3300
  */
3157
3301
  constructor(options?: {
@@ -3215,23 +3359,22 @@ export class SafetySystem extends EntityBase {
3215
3359
  export class ScalarUdmOutputs extends EntityBase {
3216
3360
  observerCount?: number;
3217
3361
  recordCount?: number;
3362
+ cloudType?: Enums.DynamicType;
3218
3363
  minimumConcentration?: number;
3219
3364
  windPower?: number;
3220
3365
  frictionVelocity?: number;
3221
3366
  dispersionReleaseDuration?: number;
3222
- cloudType?: Enums.DynamicType;
3223
-
3224
3367
  /**
3225
3368
  * Scalar UDM output values required for post processing dispersion results.
3226
3369
  *
3227
3370
  * @param {Object} options - Initialisation options
3228
3371
  * @param {number} options.observerCount - Number of observers either from the release or from the pool.
3229
3372
  * @param {number} options.recordCount - Number of total dispersion records from all observers.
3373
+ * @param {Enums.DynamicType} options.cloudType - Type of release or cloud. (default value is Enums.DynamicType.UNSET)
3230
3374
  * @param {number} options.minimumConcentration - Minimum concentration to which dispersion calculations have been performed. [fraction]
3231
3375
  * @param {number} options.windPower - A wind profile exponent describing how wind changes with height.
3232
3376
  * @param {number} options.frictionVelocity - The shear stress between the air and the ground. [m/s]
3233
3377
  * @param {number} options.dispersionReleaseDuration - The time at which the last observer is released. [s]
3234
- * @param {Enums.DynamicType} options.cloudType - Type of release or cloud. (default value is Enums.DynamicType.UNSET)
3235
3378
  */
3236
3379
  constructor(options?: {
3237
3380
  id?: string;
@@ -3239,20 +3382,20 @@ export class ScalarUdmOutputs extends EntityBase {
3239
3382
  displayName?: string;
3240
3383
  observerCount?: number;
3241
3384
  recordCount?: number;
3385
+ cloudType?: Enums.DynamicType;
3242
3386
  minimumConcentration?: number;
3243
3387
  windPower?: number;
3244
3388
  frictionVelocity?: number;
3245
3389
  dispersionReleaseDuration?: number;
3246
- cloudType?: Enums.DynamicType;
3247
3390
  }) {
3248
3391
  super(options?.id, options?.typeId, options?.displayName);
3249
3392
  this.observerCount = options?.observerCount;
3250
3393
  this.recordCount = options?.recordCount;
3394
+ this.cloudType = options?.cloudType ?? Enums.DynamicType.UNSET;
3251
3395
  this.minimumConcentration = options?.minimumConcentration;
3252
3396
  this.windPower = options?.windPower;
3253
3397
  this.frictionVelocity = options?.frictionVelocity;
3254
3398
  this.dispersionReleaseDuration = options?.dispersionReleaseDuration;
3255
- this.cloudType = options?.cloudType ?? Enums.DynamicType.UNSET;
3256
3399
  }
3257
3400
 
3258
3401
  /** Initialise the entity with data from a dictionary. */
@@ -3264,6 +3407,9 @@ export class ScalarUdmOutputs extends EntityBase {
3264
3407
  if (data.recordCount !== undefined && typeof data.recordCount === 'number') {
3265
3408
  this.recordCount = data.recordCount as number;
3266
3409
  }
3410
+ if (data.cloudType !== undefined && (typeof data.cloudType === 'string' || typeof data.cloudType === 'number')) {
3411
+ this.cloudType = this.parseEnumValue(data.cloudType, Enums.DynamicType);
3412
+ }
3267
3413
  if (data.minimumConcentration !== undefined && typeof data.minimumConcentration === 'number') {
3268
3414
  this.minimumConcentration = data.minimumConcentration as number;
3269
3415
  }
@@ -3276,12 +3422,9 @@ export class ScalarUdmOutputs extends EntityBase {
3276
3422
  if (data.dispersionReleaseDuration !== undefined && typeof data.dispersionReleaseDuration === 'number') {
3277
3423
  this.dispersionReleaseDuration = data.dispersionReleaseDuration as number;
3278
3424
  }
3279
- if (data.cloudType !== undefined && (typeof data.cloudType === 'string' || typeof data.cloudType === 'number')) {
3280
- this.cloudType = this.parseEnumValue(data.cloudType, Enums.DynamicType);
3281
- }
3282
3425
  }
3283
3426
 
3284
- private parseEnumValue<T extends object>(value: unknown, enumType: T): T[keyof T] | undefined {
3427
+ protected parseEnumValue<T extends object>(value: unknown, enumType: T): T[keyof T] | undefined {
3285
3428
  if (typeof value === 'string' && value in enumType) {
3286
3429
  return enumType[value as keyof T];
3287
3430
  } else if (typeof value === 'number' && Object.values(enumType).includes(value)) {
@@ -3296,11 +3439,11 @@ export class ScalarUdmOutputs extends EntityBase {
3296
3439
  '* ScalarUdmOutputs',
3297
3440
  `observerCount: ${this.observerCount}`,
3298
3441
  `recordCount: ${this.recordCount}`,
3442
+ `cloudType: ${this.cloudType}`,
3299
3443
  `minimumConcentration: ${this.minimumConcentration}`,
3300
3444
  `windPower: ${this.windPower}`,
3301
3445
  `frictionVelocity: ${this.frictionVelocity}`,
3302
3446
  `dispersionReleaseDuration: ${this.dispersionReleaseDuration}`,
3303
- `cloudType: ${this.cloudType}`,
3304
3447
  ];
3305
3448
  return parts.join('\n');
3306
3449
  }
@@ -3311,15 +3454,14 @@ export class ShortPipeRupture extends ReleaseOverTime {
3311
3454
  pipeDiameter?: number;
3312
3455
  pipeRoughness: number;
3313
3456
  pipeHeightFraction: number;
3314
-
3315
3457
  /**
3316
3458
  * Short pipe rupture scenario.
3317
3459
  *
3318
3460
  * @param {Object} options - Initialisation options
3319
- * @param {number} options.pipeLength - Length of short pipe. [m]
3320
- * @param {number} options.pipeDiameter - Inner diameter of the short pipe. [m]
3321
3461
  * @param {number} options.releaseAngle - Angle of release above a horizontal plane. [rad] (default value is 0.0)
3322
3462
  * @param {Enums.TimeVaryingOption} options.timeVaryingOption - Whether the release is a time-varying release or a steady state release using the initial rate. (default value is Enums.TimeVaryingOption.INITIAL_RATE)
3463
+ * @param {number} options.pipeLength - Length of short pipe. [m]
3464
+ * @param {number} options.pipeDiameter - Inner diameter of the short pipe. [m]
3323
3465
  * @param {number} options.pipeRoughness - Roughness of the short pipe. [m] (default value is 0.000045)
3324
3466
  * @param {number} options.pipeHeightFraction - Location of the pipe connection above the base of the vessel. [fraction] (default value is 0.5)
3325
3467
  */
@@ -3327,10 +3469,10 @@ export class ShortPipeRupture extends ReleaseOverTime {
3327
3469
  id?: string;
3328
3470
  typeId?: string;
3329
3471
  displayName?: string;
3330
- pipeLength?: number;
3331
- pipeDiameter?: number;
3332
3472
  releaseAngle?: number;
3333
3473
  timeVaryingOption?: Enums.TimeVaryingOption;
3474
+ pipeLength?: number;
3475
+ pipeDiameter?: number;
3334
3476
  pipeRoughness?: number;
3335
3477
  pipeHeightFraction?: number;
3336
3478
  }) {
@@ -3362,10 +3504,10 @@ export class ShortPipeRupture extends ReleaseOverTime {
3362
3504
  const parts = [
3363
3505
  super.toString(),
3364
3506
  '* ShortPipeRupture',
3365
- `pipeLength: ${this.pipeLength}`,
3366
- `pipeDiameter: ${this.pipeDiameter}`,
3367
3507
  `releaseAngle: ${this.releaseAngle}`,
3368
3508
  `timeVaryingOption: ${this.timeVaryingOption}`,
3509
+ `pipeLength: ${this.pipeLength}`,
3510
+ `pipeDiameter: ${this.pipeDiameter}`,
3369
3511
  `pipeRoughness: ${this.pipeRoughness}`,
3370
3512
  `pipeHeightFraction: ${this.pipeHeightFraction}`,
3371
3513
  ];
@@ -3376,7 +3518,6 @@ export class ShortPipeRupture extends ReleaseOverTime {
3376
3518
  export class Structure extends EntityBase {
3377
3519
  explosionConfinedVolume: ExplosionConfinedVolume;
3378
3520
  location: LocalPosition;
3379
-
3380
3521
  /**
3381
3522
  * A building or process plant structure.
3382
3523
  *
@@ -3410,35 +3551,30 @@ export class Structure extends EntityBase {
3410
3551
  }
3411
3552
 
3412
3553
  export class Substrate extends EntityBase {
3413
- bund: Bund;
3414
3554
  surfaceRoughness: number;
3415
3555
  surfaceType?: Enums.SurfaceType;
3416
3556
  poolSurfaceType?: Enums.PoolSurfaceType;
3417
-
3557
+ bund: Bund;
3418
3558
  /**
3419
3559
  * The ground over which a release is taking place.
3420
3560
  *
3421
3561
  * @param {Object} options - Initialisation options
3422
- * @param {Bund} options.bund - A bund entity used in the modelling of pool spreading and vaporisation.
3423
3562
  * @param {number} options.surfaceRoughness - The height above the ground below which the wind speed is theoretically zero due to friction from the surface. [m] (default value is 0.183)
3424
3563
  * @param {Enums.SurfaceType} options.surfaceType - Surface over which the dispersion occurs. (default value is Enums.SurfaceType.LAND)
3425
3564
  * @param {Enums.PoolSurfaceType} options.poolSurfaceType - Surface onto which the liquid which rains out will spread. (default value is Enums.PoolSurfaceType.CONCRETE)
3565
+ * @param {Bund} options.bund - A bund entity used in the modelling of pool spreading and vaporisation.
3426
3566
  */
3427
- constructor(options?: { id?: string; typeId?: string; displayName?: string; bund?: Bund; surfaceRoughness?: number; surfaceType?: Enums.SurfaceType; poolSurfaceType?: Enums.PoolSurfaceType }) {
3567
+ constructor(options?: { id?: string; typeId?: string; displayName?: string; surfaceRoughness?: number; surfaceType?: Enums.SurfaceType; poolSurfaceType?: Enums.PoolSurfaceType; bund?: Bund }) {
3428
3568
  super(options?.id, options?.typeId, options?.displayName);
3429
- this.bund = options?.bund ?? new Bund();
3430
3569
  this.surfaceRoughness = options?.surfaceRoughness ?? 0.183;
3431
3570
  this.surfaceType = options?.surfaceType ?? Enums.SurfaceType.LAND;
3432
3571
  this.poolSurfaceType = options?.poolSurfaceType ?? Enums.PoolSurfaceType.CONCRETE;
3572
+ this.bund = options?.bund ?? new Bund();
3433
3573
  }
3434
3574
 
3435
3575
  /** Initialise the entity with data from a dictionary. */
3436
3576
  initialiseFromDictionary(data: { [key: string]: unknown }) {
3437
3577
  super.initialiseFromDictionary(data);
3438
- if (data.bund) {
3439
- this.bund = new Bund();
3440
- this.bund.initialiseFromDictionary(data.bund as { [key: string]: unknown });
3441
- }
3442
3578
  if (data.surfaceRoughness !== undefined && typeof data.surfaceRoughness === 'number') {
3443
3579
  this.surfaceRoughness = data.surfaceRoughness as number;
3444
3580
  }
@@ -3448,9 +3584,13 @@ export class Substrate extends EntityBase {
3448
3584
  if (data.poolSurfaceType !== undefined && (typeof data.poolSurfaceType === 'string' || typeof data.poolSurfaceType === 'number')) {
3449
3585
  this.poolSurfaceType = this.parseEnumValue(data.poolSurfaceType, Enums.PoolSurfaceType);
3450
3586
  }
3587
+ if (data.bund) {
3588
+ this.bund = new Bund();
3589
+ this.bund.initialiseFromDictionary(data.bund as { [key: string]: unknown });
3590
+ }
3451
3591
  }
3452
3592
 
3453
- private parseEnumValue<T extends object>(value: unknown, enumType: T): T[keyof T] | undefined {
3593
+ protected parseEnumValue<T extends object>(value: unknown, enumType: T): T[keyof T] | undefined {
3454
3594
  if (typeof value === 'string' && value in enumType) {
3455
3595
  return enumType[value as keyof T];
3456
3596
  } else if (typeof value === 'number' && Object.values(enumType).includes(value)) {
@@ -3463,10 +3603,10 @@ export class Substrate extends EntityBase {
3463
3603
  const parts = [
3464
3604
  super.toString(),
3465
3605
  '* Substrate',
3466
- `bund: ${this.bund?.toString()}`,
3467
3606
  `surfaceRoughness: ${this.surfaceRoughness}`,
3468
3607
  `surfaceType: ${this.surfaceType}`,
3469
3608
  `poolSurfaceType: ${this.poolSurfaceType}`,
3609
+ `bund: ${this.bund?.toString()}`,
3470
3610
  ];
3471
3611
  return parts.join('\n');
3472
3612
  }
@@ -3474,22 +3614,21 @@ export class Substrate extends EntityBase {
3474
3614
 
3475
3615
  export class ToxicRecord extends EntityBase {
3476
3616
  position: LocalPosition;
3477
- toxicResult?: number;
3478
3617
  toxicResultType?: Enums.ToxicResultType;
3479
-
3618
+ toxicResult?: number;
3480
3619
  /**
3481
3620
  * A record of the toxic result type and level at a specific point (x,y,z).
3482
3621
  *
3483
3622
  * @param {Object} options - Initialisation options
3484
3623
  * @param {LocalPosition} options.position - Cartesian coordinates of a point of interest.
3485
- * @param {number} options.toxicResult - The value for the ToxicResultType at the specified position.
3486
3624
  * @param {Enums.ToxicResultType} options.toxicResultType - The type of toxic result. (default value is Enums.ToxicResultType.UNSET)
3625
+ * @param {number} options.toxicResult - The value for the ToxicResultType at the specified position.
3487
3626
  */
3488
- constructor(options?: { id?: string; typeId?: string; displayName?: string; position?: LocalPosition; toxicResult?: number; toxicResultType?: Enums.ToxicResultType }) {
3627
+ constructor(options?: { id?: string; typeId?: string; displayName?: string; position?: LocalPosition; toxicResultType?: Enums.ToxicResultType; toxicResult?: number }) {
3489
3628
  super(options?.id, options?.typeId, options?.displayName);
3490
3629
  this.position = options?.position ?? new LocalPosition();
3491
- this.toxicResult = options?.toxicResult;
3492
3630
  this.toxicResultType = options?.toxicResultType ?? Enums.ToxicResultType.UNSET;
3631
+ this.toxicResult = options?.toxicResult;
3493
3632
  }
3494
3633
 
3495
3634
  /** Initialise the entity with data from a dictionary. */
@@ -3499,15 +3638,15 @@ export class ToxicRecord extends EntityBase {
3499
3638
  this.position = new LocalPosition();
3500
3639
  this.position.initialiseFromDictionary(data.position as { [key: string]: unknown });
3501
3640
  }
3502
- if (data.toxicResult !== undefined && typeof data.toxicResult === 'number') {
3503
- this.toxicResult = data.toxicResult as number;
3504
- }
3505
3641
  if (data.toxicResultType !== undefined && (typeof data.toxicResultType === 'string' || typeof data.toxicResultType === 'number')) {
3506
3642
  this.toxicResultType = this.parseEnumValue(data.toxicResultType, Enums.ToxicResultType);
3507
3643
  }
3644
+ if (data.toxicResult !== undefined && typeof data.toxicResult === 'number') {
3645
+ this.toxicResult = data.toxicResult as number;
3646
+ }
3508
3647
  }
3509
3648
 
3510
- private parseEnumValue<T extends object>(value: unknown, enumType: T): T[keyof T] | undefined {
3649
+ protected parseEnumValue<T extends object>(value: unknown, enumType: T): T[keyof T] | undefined {
3511
3650
  if (typeof value === 'string' && value in enumType) {
3512
3651
  return enumType[value as keyof T];
3513
3652
  } else if (typeof value === 'number' && Object.values(enumType).includes(value)) {
@@ -3517,38 +3656,37 @@ export class ToxicRecord extends EntityBase {
3517
3656
  }
3518
3657
 
3519
3658
  toString() {
3520
- const parts = [super.toString(), '* ToxicRecord', `position: ${this.position?.toString()}`, `toxicResult: ${this.toxicResult}`, `toxicResultType: ${this.toxicResultType}`];
3659
+ const parts = [super.toString(), '* ToxicRecord', `position: ${this.position?.toString()}`, `toxicResultType: ${this.toxicResultType}`, `toxicResult: ${this.toxicResult}`];
3521
3660
  return parts.join('\n');
3522
3661
  }
3523
3662
  }
3524
3663
 
3525
3664
  export class Vessel extends Asset {
3526
3665
  state: State;
3527
- material: Material;
3528
- safetySystem: SafetySystem;
3529
3666
  diameter: number;
3530
3667
  height: number;
3531
3668
  length: number;
3532
3669
  width: number;
3533
3670
  shape?: Enums.VesselShape;
3671
+ material: Material;
3534
3672
  vesselConditions?: Enums.VesselConditions;
3535
3673
  liquidFillFractionByVolume: number;
3536
-
3674
+ safetySystem: SafetySystem;
3537
3675
  /**
3538
3676
  * A pressue vessel asset to represent pressurised containment.
3539
3677
  *
3540
3678
  * @param {Object} options - Initialisation options
3541
3679
  * @param {LocalPosition} options.location - Location of the asset.
3542
3680
  * @param {State} options.state - Fluid state in the vessel.
3543
- * @param {Material} options.material - Material in the vessel.
3544
- * @param {SafetySystem} options.safetySystem - A safety system entity which defines isolation and blowdown settings for a pressurised vessel.
3545
3681
  * @param {number} options.diameter - Internal diameter of the vessel. [m] (default value is 2)
3546
3682
  * @param {number} options.height - Internal height of a VerticalCylinder or VesselCuboid. [m] (default value is 4)
3547
3683
  * @param {number} options.length - Internal length of HorizontalCylinder or VesselCuboid. [m] (default value is 4)
3548
3684
  * @param {number} options.width - Internal width of a VesselCuboid. [m] (default value is 2.0)
3549
3685
  * @param {Enums.VesselShape} options.shape - Shape of the vessel. (default value is Enums.VesselShape.HORIZONTAL_CYLINDER)
3686
+ * @param {Material} options.material - Material in the vessel.
3550
3687
  * @param {Enums.VesselConditions} options.vesselConditions - The conditions inside the vessel. (default value is Enums.VesselConditions.UNSET)
3551
3688
  * @param {number} options.liquidFillFractionByVolume - The proportion of the vessel occupied by liquid. Used when the VesselConditions are two-phase or pressurized liquid. [fraction] (default value is 0.0)
3689
+ * @param {SafetySystem} options.safetySystem - A safety system entity which defines isolation and blowdown settings for a pressurised vessel.
3552
3690
  */
3553
3691
  constructor(options?: {
3554
3692
  id?: string;
@@ -3556,27 +3694,27 @@ export class Vessel extends Asset {
3556
3694
  displayName?: string;
3557
3695
  location?: LocalPosition;
3558
3696
  state?: State;
3559
- material?: Material;
3560
- safetySystem?: SafetySystem;
3561
3697
  diameter?: number;
3562
3698
  height?: number;
3563
3699
  length?: number;
3564
3700
  width?: number;
3565
3701
  shape?: Enums.VesselShape;
3702
+ material?: Material;
3566
3703
  vesselConditions?: Enums.VesselConditions;
3567
3704
  liquidFillFractionByVolume?: number;
3705
+ safetySystem?: SafetySystem;
3568
3706
  }) {
3569
3707
  super(options);
3570
3708
  this.state = options?.state ?? new State();
3571
- this.material = options?.material ?? new Material();
3572
- this.safetySystem = options?.safetySystem ?? new SafetySystem();
3573
3709
  this.diameter = options?.diameter ?? 2;
3574
3710
  this.height = options?.height ?? 4;
3575
3711
  this.length = options?.length ?? 4;
3576
3712
  this.width = options?.width ?? 2.0;
3577
3713
  this.shape = options?.shape ?? Enums.VesselShape.HORIZONTAL_CYLINDER;
3714
+ this.material = options?.material ?? new Material();
3578
3715
  this.vesselConditions = options?.vesselConditions ?? Enums.VesselConditions.UNSET;
3579
3716
  this.liquidFillFractionByVolume = options?.liquidFillFractionByVolume ?? 0.0;
3717
+ this.safetySystem = options?.safetySystem ?? new SafetySystem();
3580
3718
  }
3581
3719
 
3582
3720
  /** Initialise the entity with data from a dictionary. */
@@ -3586,14 +3724,6 @@ export class Vessel extends Asset {
3586
3724
  this.state = new State();
3587
3725
  this.state.initialiseFromDictionary(data.state as { [key: string]: unknown });
3588
3726
  }
3589
- if (data.material) {
3590
- this.material = new Material();
3591
- this.material.initialiseFromDictionary(data.material as { [key: string]: unknown });
3592
- }
3593
- if (data.safetySystem) {
3594
- this.safetySystem = new SafetySystem();
3595
- this.safetySystem.initialiseFromDictionary(data.safetySystem as { [key: string]: unknown });
3596
- }
3597
3727
  if (data.diameter !== undefined && typeof data.diameter === 'number') {
3598
3728
  this.diameter = data.diameter as number;
3599
3729
  }
@@ -3609,15 +3739,23 @@ export class Vessel extends Asset {
3609
3739
  if (data.shape !== undefined && (typeof data.shape === 'string' || typeof data.shape === 'number')) {
3610
3740
  this.shape = this.parseEnumValue(data.shape, Enums.VesselShape);
3611
3741
  }
3742
+ if (data.material) {
3743
+ this.material = new Material();
3744
+ this.material.initialiseFromDictionary(data.material as { [key: string]: unknown });
3745
+ }
3612
3746
  if (data.vesselConditions !== undefined && (typeof data.vesselConditions === 'string' || typeof data.vesselConditions === 'number')) {
3613
3747
  this.vesselConditions = this.parseEnumValue(data.vesselConditions, Enums.VesselConditions);
3614
3748
  }
3615
3749
  if (data.liquidFillFractionByVolume !== undefined && typeof data.liquidFillFractionByVolume === 'number') {
3616
3750
  this.liquidFillFractionByVolume = data.liquidFillFractionByVolume as number;
3617
3751
  }
3752
+ if (data.safetySystem) {
3753
+ this.safetySystem = new SafetySystem();
3754
+ this.safetySystem.initialiseFromDictionary(data.safetySystem as { [key: string]: unknown });
3755
+ }
3618
3756
  }
3619
3757
 
3620
- private parseEnumValue<T extends object>(value: unknown, enumType: T): T[keyof T] | undefined {
3758
+ protected parseEnumValue<T extends object>(value: unknown, enumType: T): T[keyof T] | undefined {
3621
3759
  if (typeof value === 'string' && value in enumType) {
3622
3760
  return enumType[value as keyof T];
3623
3761
  } else if (typeof value === 'number' && Object.values(enumType).includes(value)) {
@@ -3632,15 +3770,15 @@ export class Vessel extends Asset {
3632
3770
  '* Vessel',
3633
3771
  `location: ${this.location?.toString()}`,
3634
3772
  `state: ${this.state?.toString()}`,
3635
- `material: ${this.material?.toString()}`,
3636
- `safetySystem: ${this.safetySystem?.toString()}`,
3637
3773
  `diameter: ${this.diameter}`,
3638
3774
  `height: ${this.height}`,
3639
3775
  `length: ${this.length}`,
3640
3776
  `width: ${this.width}`,
3641
3777
  `shape: ${this.shape}`,
3778
+ `material: ${this.material?.toString()}`,
3642
3779
  `vesselConditions: ${this.vesselConditions}`,
3643
3780
  `liquidFillFractionByVolume: ${this.liquidFillFractionByVolume}`,
3781
+ `safetySystem: ${this.safetySystem?.toString()}`,
3644
3782
  ];
3645
3783
  return parts.join('\n');
3646
3784
  }
@@ -3649,21 +3787,20 @@ export class Vessel extends Asset {
3649
3787
  export class VesselLeakMaxFlammableCloudResults extends EntityBase {
3650
3788
  dischargeRate?: number;
3651
3789
  expandedTemperature?: number;
3790
+ phase?: Enums.Phase;
3652
3791
  lflExtent?: number;
3653
3792
  lflArea?: number;
3654
3793
  lflHeight?: number;
3655
- phase?: Enums.Phase;
3656
-
3657
3794
  /**
3658
3795
  * Results for a linked run of vessel leak followed by dispersion and views from the cloud.
3659
3796
  *
3660
3797
  * @param {Object} options - Initialisation options
3661
3798
  * @param {number} options.dischargeRate - Mass flow rate from the leak. [kg/s]
3662
3799
  * @param {number} options.expandedTemperature - Post atmospheric expansion temperature. [K]
3800
+ * @param {Enums.Phase} options.phase - Post atmospheric expansion fluid phase. (default value is Enums.Phase.UNSET)
3663
3801
  * @param {number} options.lflExtent - Maximum downwind distance to LFL. [m]
3664
3802
  * @param {number} options.lflArea - Horizontal area of the LFL envelope. [m2]
3665
3803
  * @param {number} options.lflHeight - Height of the maximum LFL extent. [m]
3666
- * @param {Enums.Phase} options.phase - Post atmospheric expansion fluid phase. (default value is Enums.Phase.UNSET)
3667
3804
  */
3668
3805
  constructor(options?: {
3669
3806
  id?: string;
@@ -3671,18 +3808,18 @@ export class VesselLeakMaxFlammableCloudResults extends EntityBase {
3671
3808
  displayName?: string;
3672
3809
  dischargeRate?: number;
3673
3810
  expandedTemperature?: number;
3811
+ phase?: Enums.Phase;
3674
3812
  lflExtent?: number;
3675
3813
  lflArea?: number;
3676
3814
  lflHeight?: number;
3677
- phase?: Enums.Phase;
3678
3815
  }) {
3679
3816
  super(options?.id, options?.typeId, options?.displayName);
3680
3817
  this.dischargeRate = options?.dischargeRate;
3681
3818
  this.expandedTemperature = options?.expandedTemperature;
3819
+ this.phase = options?.phase ?? Enums.Phase.UNSET;
3682
3820
  this.lflExtent = options?.lflExtent;
3683
3821
  this.lflArea = options?.lflArea;
3684
3822
  this.lflHeight = options?.lflHeight;
3685
- this.phase = options?.phase ?? Enums.Phase.UNSET;
3686
3823
  }
3687
3824
 
3688
3825
  /** Initialise the entity with data from a dictionary. */
@@ -3694,6 +3831,9 @@ export class VesselLeakMaxFlammableCloudResults extends EntityBase {
3694
3831
  if (data.expandedTemperature !== undefined && typeof data.expandedTemperature === 'number') {
3695
3832
  this.expandedTemperature = data.expandedTemperature as number;
3696
3833
  }
3834
+ if (data.phase !== undefined && (typeof data.phase === 'string' || typeof data.phase === 'number')) {
3835
+ this.phase = this.parseEnumValue(data.phase, Enums.Phase);
3836
+ }
3697
3837
  if (data.lflExtent !== undefined && typeof data.lflExtent === 'number') {
3698
3838
  this.lflExtent = data.lflExtent as number;
3699
3839
  }
@@ -3703,12 +3843,9 @@ export class VesselLeakMaxFlammableCloudResults extends EntityBase {
3703
3843
  if (data.lflHeight !== undefined && typeof data.lflHeight === 'number') {
3704
3844
  this.lflHeight = data.lflHeight as number;
3705
3845
  }
3706
- if (data.phase !== undefined && (typeof data.phase === 'string' || typeof data.phase === 'number')) {
3707
- this.phase = this.parseEnumValue(data.phase, Enums.Phase);
3708
- }
3709
3846
  }
3710
3847
 
3711
- private parseEnumValue<T extends object>(value: unknown, enumType: T): T[keyof T] | undefined {
3848
+ protected parseEnumValue<T extends object>(value: unknown, enumType: T): T[keyof T] | undefined {
3712
3849
  if (typeof value === 'string' && value in enumType) {
3713
3850
  return enumType[value as keyof T];
3714
3851
  } else if (typeof value === 'number' && Object.values(enumType).includes(value)) {
@@ -3723,10 +3860,10 @@ export class VesselLeakMaxFlammableCloudResults extends EntityBase {
3723
3860
  '* VesselLeakMaxFlammableCloudResults',
3724
3861
  `dischargeRate: ${this.dischargeRate}`,
3725
3862
  `expandedTemperature: ${this.expandedTemperature}`,
3863
+ `phase: ${this.phase}`,
3726
3864
  `lflExtent: ${this.lflExtent}`,
3727
3865
  `lflArea: ${this.lflArea}`,
3728
3866
  `lflHeight: ${this.lflHeight}`,
3729
- `phase: ${this.phase}`,
3730
3867
  ];
3731
3868
  return parts.join('\n');
3732
3869
  }
@@ -3736,7 +3873,6 @@ export class VesselSphere extends Asset {
3736
3873
  state: State;
3737
3874
  material: Material;
3738
3875
  massInventory?: number;
3739
-
3740
3876
  /**
3741
3877
  * A spherical pressue vessel asset to represent pressurised containment.
3742
3878
  *
@@ -3790,7 +3926,6 @@ export class Weather extends EntityBase {
3790
3926
  mixingLayerHeight: number;
3791
3927
  solarRadiation: number;
3792
3928
  windProfileFlag?: Enums.WindProfileFlag;
3793
-
3794
3929
  /**
3795
3930
  * A set of weather conditions for use in the modelling of a release and its effects.
3796
3931
  *
@@ -3851,7 +3986,7 @@ export class Weather extends EntityBase {
3851
3986
  }
3852
3987
  }
3853
3988
 
3854
- private parseEnumValue<T extends object>(value: unknown, enumType: T): T[keyof T] | undefined {
3989
+ protected parseEnumValue<T extends object>(value: unknown, enumType: T): T[keyof T] | undefined {
3855
3990
  if (typeof value === 'string' && value in enumType) {
3856
3991
  return enumType[value as keyof T];
3857
3992
  } else if (typeof value === 'number' && Object.values(enumType).includes(value)) {