@dnv-plant/typescriptpws 1.0.63 → 1.0.64
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.ts +2 -2
- package/package.json +1 -1
- package/src/calculations/applicationTools.ts +4 -4
- package/src/calculations/discharge.ts +45 -45
- package/src/calculations/dispersion.ts +16 -16
- package/src/calculations/dispersionView.ts +113 -113
- package/src/calculations/fireball.ts +14 -14
- package/src/calculations/jetFire.ts +13 -13
- package/src/calculations/lateExplosion.ts +48 -48
- package/src/calculations/linkedRunners.ts +245 -245
- package/src/calculations/poolFire.ts +15 -15
- package/src/calculations/properties.ts +6 -6
- package/src/calculations/radiation.ts +124 -124
- package/src/calculations/standalones.ts +11 -11
- package/src/calculations/toxics.ts +17 -17
- package/src/calculations/utilities.ts +36 -36
- package/src/constants.ts +26 -5
- package/src/entities.ts +212 -82
- package/src/entity-schemas.ts +160 -64
- package/src/enums.ts +25 -14
- package/src/materials.ts +2 -2
- package/src/utilities.ts +4 -2
package/src/entities.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/***********************************************************************
|
|
2
2
|
* This file has been auto-generated by a code generation tool.
|
|
3
|
-
* Version: 1.0.
|
|
4
|
-
* Date/time:
|
|
3
|
+
* Version: 1.0.64
|
|
4
|
+
* Date/time: 04 Apr 2025 15:02:04
|
|
5
5
|
* Template: templates/typescriptpws/entities.razor.
|
|
6
6
|
***********************************************************************/
|
|
7
7
|
|
|
@@ -401,6 +401,208 @@ export class AtmosphericStorageTank extends Asset {
|
|
|
401
401
|
}
|
|
402
402
|
}
|
|
403
403
|
|
|
404
|
+
export class Scenario extends EntityBase {
|
|
405
|
+
/**
|
|
406
|
+
* Base struct/class for all scenario types.
|
|
407
|
+
*
|
|
408
|
+
*/
|
|
409
|
+
constructor(options?: {
|
|
410
|
+
id?: string;
|
|
411
|
+
typeId?: string;
|
|
412
|
+
displayName?: string;
|
|
413
|
+
}) {
|
|
414
|
+
super(options?.id, options?.typeId, options?.displayName);
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
/** Initialise the entity with data from a dictionary. */
|
|
418
|
+
initialiseFromDictionary(data: { [key: string]: unknown }) {
|
|
419
|
+
super.initialiseFromDictionary(data);
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
toString() {
|
|
423
|
+
const parts = [
|
|
424
|
+
super.toString(),
|
|
425
|
+
"* Scenario",
|
|
426
|
+
];
|
|
427
|
+
return parts.join("\n");
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
export class ReleaseOverTime extends Scenario {
|
|
432
|
+
releaseAngle: number;
|
|
433
|
+
timeVaryingOption?: Enums.TimeVaryingOption;
|
|
434
|
+
|
|
435
|
+
/**
|
|
436
|
+
* Scenario representing a release over time.
|
|
437
|
+
*
|
|
438
|
+
* @param {number} releaseAngle - Angle of release above a horizontal plane. (default value is 0.0)
|
|
439
|
+
* @param {Enums.TimeVaryingOption} 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)
|
|
440
|
+
*/
|
|
441
|
+
constructor(options?: {
|
|
442
|
+
id?: string;
|
|
443
|
+
typeId?: string;
|
|
444
|
+
displayName?: string;
|
|
445
|
+
releaseAngle?: number;
|
|
446
|
+
timeVaryingOption?: Enums.TimeVaryingOption;
|
|
447
|
+
}) {
|
|
448
|
+
super(options);
|
|
449
|
+
this.releaseAngle = options?.releaseAngle ?? 0.0;
|
|
450
|
+
this.timeVaryingOption = options?.timeVaryingOption ?? Enums.TimeVaryingOption.INITIAL_RATE;
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
/** Initialise the entity with data from a dictionary. */
|
|
454
|
+
initialiseFromDictionary(data: { [key: string]: unknown }) {
|
|
455
|
+
super.initialiseFromDictionary(data);
|
|
456
|
+
if (data.releaseAngle !== undefined && typeof data.releaseAngle === "number") {
|
|
457
|
+
this.releaseAngle = data.releaseAngle as number;
|
|
458
|
+
}
|
|
459
|
+
if (data.timeVaryingOption !== undefined && (typeof data.timeVaryingOption === "string" || typeof data.timeVaryingOption === "number")) {
|
|
460
|
+
this.timeVaryingOption = this.parseEnumValue(data.timeVaryingOption, Enums.TimeVaryingOption);
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
private parseEnumValue<T extends object>(value: unknown, enumType: T): T[keyof T] | undefined {
|
|
465
|
+
if (typeof value === "string" && value in enumType) {
|
|
466
|
+
return enumType[value as keyof T];
|
|
467
|
+
} else if (typeof value === "number" && Object.values(enumType).includes(value)) {
|
|
468
|
+
return value as T[keyof T];
|
|
469
|
+
}
|
|
470
|
+
return undefined; // Return undefined if the value does not match the enum
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
toString() {
|
|
474
|
+
const parts = [
|
|
475
|
+
super.toString(),
|
|
476
|
+
"* ReleaseOverTime",
|
|
477
|
+
`releaseAngle: ${this.releaseAngle}`,
|
|
478
|
+
`timeVaryingOption: ${this.timeVaryingOption}`,
|
|
479
|
+
];
|
|
480
|
+
return parts.join("\n");
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
export class BESSRelease extends ReleaseOverTime {
|
|
485
|
+
height?: number;
|
|
486
|
+
area?: number;
|
|
487
|
+
temperature?: number;
|
|
488
|
+
duration?: number;
|
|
489
|
+
|
|
490
|
+
/**
|
|
491
|
+
* A release from a BESS unit in thermal runaway.
|
|
492
|
+
*
|
|
493
|
+
* @param {number} height - The height from which the release occurs.
|
|
494
|
+
* @param {number} area - The area over which the release occurs.
|
|
495
|
+
* @param {number} temperature - The exit temperature of the release (from the BESS unit).
|
|
496
|
+
* @param {number} duration - The duration of the release.
|
|
497
|
+
* @param {number} releaseAngle - Angle of release above a horizontal plane. (default value is 0.0)
|
|
498
|
+
* @param {Enums.TimeVaryingOption} 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)
|
|
499
|
+
*/
|
|
500
|
+
constructor(options?: {
|
|
501
|
+
id?: string;
|
|
502
|
+
typeId?: string;
|
|
503
|
+
displayName?: string;
|
|
504
|
+
height?: number;
|
|
505
|
+
area?: number;
|
|
506
|
+
temperature?: number;
|
|
507
|
+
duration?: number;
|
|
508
|
+
releaseAngle?: number;
|
|
509
|
+
timeVaryingOption?: Enums.TimeVaryingOption;
|
|
510
|
+
}) {
|
|
511
|
+
super(options);
|
|
512
|
+
this.height = options?.height;
|
|
513
|
+
this.area = options?.area;
|
|
514
|
+
this.temperature = options?.temperature;
|
|
515
|
+
this.duration = options?.duration;
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
/** Initialise the entity with data from a dictionary. */
|
|
519
|
+
initialiseFromDictionary(data: { [key: string]: unknown }) {
|
|
520
|
+
super.initialiseFromDictionary(data);
|
|
521
|
+
if (data.height !== undefined && typeof data.height === "number") {
|
|
522
|
+
this.height = data.height as number;
|
|
523
|
+
}
|
|
524
|
+
if (data.area !== undefined && typeof data.area === "number") {
|
|
525
|
+
this.area = data.area as number;
|
|
526
|
+
}
|
|
527
|
+
if (data.temperature !== undefined && typeof data.temperature === "number") {
|
|
528
|
+
this.temperature = data.temperature as number;
|
|
529
|
+
}
|
|
530
|
+
if (data.duration !== undefined && typeof data.duration === "number") {
|
|
531
|
+
this.duration = data.duration as number;
|
|
532
|
+
}
|
|
533
|
+
}
|
|
534
|
+
|
|
535
|
+
toString() {
|
|
536
|
+
const parts = [
|
|
537
|
+
super.toString(),
|
|
538
|
+
"* BESSRelease",
|
|
539
|
+
`height: ${this.height}`,
|
|
540
|
+
`area: ${this.area}`,
|
|
541
|
+
`temperature: ${this.temperature}`,
|
|
542
|
+
`duration: ${this.duration}`,
|
|
543
|
+
`releaseAngle: ${this.releaseAngle}`,
|
|
544
|
+
`timeVaryingOption: ${this.timeVaryingOption}`,
|
|
545
|
+
];
|
|
546
|
+
return parts.join("\n");
|
|
547
|
+
}
|
|
548
|
+
}
|
|
549
|
+
|
|
550
|
+
export class BESSUnit extends Asset {
|
|
551
|
+
energyCapacity?: number;
|
|
552
|
+
chemistry?: Enums.BESSChemistry;
|
|
553
|
+
|
|
554
|
+
/**
|
|
555
|
+
* A BESS unit, containing Li-ion betteries.
|
|
556
|
+
*
|
|
557
|
+
* @param {LocalPosition} location - Location of the asset.
|
|
558
|
+
* @param {number} energyCapacity - The energy capacity of the installation.
|
|
559
|
+
* @param {Enums.BESSChemistry} chemistry - The chemistry type of the BESS unit. (default value is Enums.BESSChemistry.LFP)
|
|
560
|
+
*/
|
|
561
|
+
constructor(options?: {
|
|
562
|
+
id?: string;
|
|
563
|
+
typeId?: string;
|
|
564
|
+
displayName?: string;
|
|
565
|
+
location?: LocalPosition;
|
|
566
|
+
energyCapacity?: number;
|
|
567
|
+
chemistry?: Enums.BESSChemistry;
|
|
568
|
+
}) {
|
|
569
|
+
super(options);
|
|
570
|
+
this.energyCapacity = options?.energyCapacity;
|
|
571
|
+
this.chemistry = options?.chemistry ?? Enums.BESSChemistry.LFP;
|
|
572
|
+
}
|
|
573
|
+
|
|
574
|
+
/** Initialise the entity with data from a dictionary. */
|
|
575
|
+
initialiseFromDictionary(data: { [key: string]: unknown }) {
|
|
576
|
+
super.initialiseFromDictionary(data);
|
|
577
|
+
if (data.energyCapacity !== undefined && typeof data.energyCapacity === "number") {
|
|
578
|
+
this.energyCapacity = data.energyCapacity as number;
|
|
579
|
+
}
|
|
580
|
+
if (data.chemistry !== undefined && (typeof data.chemistry === "string" || typeof data.chemistry === "number")) {
|
|
581
|
+
this.chemistry = this.parseEnumValue(data.chemistry, Enums.BESSChemistry);
|
|
582
|
+
}
|
|
583
|
+
}
|
|
584
|
+
|
|
585
|
+
private parseEnumValue<T extends object>(value: unknown, enumType: T): T[keyof T] | undefined {
|
|
586
|
+
if (typeof value === "string" && value in enumType) {
|
|
587
|
+
return enumType[value as keyof T];
|
|
588
|
+
} else if (typeof value === "number" && Object.values(enumType).includes(value)) {
|
|
589
|
+
return value as T[keyof T];
|
|
590
|
+
}
|
|
591
|
+
return undefined; // Return undefined if the value does not match the enum
|
|
592
|
+
}
|
|
593
|
+
|
|
594
|
+
toString() {
|
|
595
|
+
const parts = [
|
|
596
|
+
super.toString(),
|
|
597
|
+
"* BESSUnit",
|
|
598
|
+
`location: ${this.location?.toString()}`,
|
|
599
|
+
`energyCapacity: ${this.energyCapacity}`,
|
|
600
|
+
`chemistry: ${this.chemistry}`,
|
|
601
|
+
];
|
|
602
|
+
return parts.join("\n");
|
|
603
|
+
}
|
|
604
|
+
}
|
|
605
|
+
|
|
404
606
|
export class Bund extends EntityBase {
|
|
405
607
|
bundHeight: number;
|
|
406
608
|
bundDiameter: number;
|
|
@@ -453,33 +655,6 @@ export class Bund extends EntityBase {
|
|
|
453
655
|
}
|
|
454
656
|
}
|
|
455
657
|
|
|
456
|
-
export class Scenario extends EntityBase {
|
|
457
|
-
/**
|
|
458
|
-
* Base struct/class for all scenario types.
|
|
459
|
-
*
|
|
460
|
-
*/
|
|
461
|
-
constructor(options?: {
|
|
462
|
-
id?: string;
|
|
463
|
-
typeId?: string;
|
|
464
|
-
displayName?: string;
|
|
465
|
-
}) {
|
|
466
|
-
super(options?.id, options?.typeId, options?.displayName);
|
|
467
|
-
}
|
|
468
|
-
|
|
469
|
-
/** Initialise the entity with data from a dictionary. */
|
|
470
|
-
initialiseFromDictionary(data: { [key: string]: unknown }) {
|
|
471
|
-
super.initialiseFromDictionary(data);
|
|
472
|
-
}
|
|
473
|
-
|
|
474
|
-
toString() {
|
|
475
|
-
const parts = [
|
|
476
|
-
super.toString(),
|
|
477
|
-
"* Scenario",
|
|
478
|
-
];
|
|
479
|
-
return parts.join("\n");
|
|
480
|
-
}
|
|
481
|
-
}
|
|
482
|
-
|
|
483
658
|
export class Instantaneous extends Scenario {
|
|
484
659
|
/**
|
|
485
660
|
* Base struct/class for instantaneous release scenarios.
|
|
@@ -2144,59 +2319,6 @@ export class FlashResult extends EntityBase {
|
|
|
2144
2319
|
}
|
|
2145
2320
|
}
|
|
2146
2321
|
|
|
2147
|
-
export class ReleaseOverTime extends Scenario {
|
|
2148
|
-
releaseAngle: number;
|
|
2149
|
-
timeVaryingOption?: Enums.TimeVaryingOption;
|
|
2150
|
-
|
|
2151
|
-
/**
|
|
2152
|
-
* Scenario representing a release over time.
|
|
2153
|
-
*
|
|
2154
|
-
* @param {number} releaseAngle - Angle of release above a horizontal plane. (default value is 0.0)
|
|
2155
|
-
* @param {Enums.TimeVaryingOption} 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)
|
|
2156
|
-
*/
|
|
2157
|
-
constructor(options?: {
|
|
2158
|
-
id?: string;
|
|
2159
|
-
typeId?: string;
|
|
2160
|
-
displayName?: string;
|
|
2161
|
-
releaseAngle?: number;
|
|
2162
|
-
timeVaryingOption?: Enums.TimeVaryingOption;
|
|
2163
|
-
}) {
|
|
2164
|
-
super(options);
|
|
2165
|
-
this.releaseAngle = options?.releaseAngle ?? 0.0;
|
|
2166
|
-
this.timeVaryingOption = options?.timeVaryingOption ?? Enums.TimeVaryingOption.INITIAL_RATE;
|
|
2167
|
-
}
|
|
2168
|
-
|
|
2169
|
-
/** Initialise the entity with data from a dictionary. */
|
|
2170
|
-
initialiseFromDictionary(data: { [key: string]: unknown }) {
|
|
2171
|
-
super.initialiseFromDictionary(data);
|
|
2172
|
-
if (data.releaseAngle !== undefined && typeof data.releaseAngle === "number") {
|
|
2173
|
-
this.releaseAngle = data.releaseAngle as number;
|
|
2174
|
-
}
|
|
2175
|
-
if (data.timeVaryingOption !== undefined && (typeof data.timeVaryingOption === "string" || typeof data.timeVaryingOption === "number")) {
|
|
2176
|
-
this.timeVaryingOption = this.parseEnumValue(data.timeVaryingOption, Enums.TimeVaryingOption);
|
|
2177
|
-
}
|
|
2178
|
-
}
|
|
2179
|
-
|
|
2180
|
-
private parseEnumValue<T extends object>(value: unknown, enumType: T): T[keyof T] | undefined {
|
|
2181
|
-
if (typeof value === "string" && value in enumType) {
|
|
2182
|
-
return enumType[value as keyof T];
|
|
2183
|
-
} else if (typeof value === "number" && Object.values(enumType).includes(value)) {
|
|
2184
|
-
return value as T[keyof T];
|
|
2185
|
-
}
|
|
2186
|
-
return undefined; // Return undefined if the value does not match the enum
|
|
2187
|
-
}
|
|
2188
|
-
|
|
2189
|
-
toString() {
|
|
2190
|
-
const parts = [
|
|
2191
|
-
super.toString(),
|
|
2192
|
-
"* ReleaseOverTime",
|
|
2193
|
-
`releaseAngle: ${this.releaseAngle}`,
|
|
2194
|
-
`timeVaryingOption: ${this.timeVaryingOption}`,
|
|
2195
|
-
];
|
|
2196
|
-
return parts.join("\n");
|
|
2197
|
-
}
|
|
2198
|
-
}
|
|
2199
|
-
|
|
2200
2322
|
export class Leak extends ReleaseOverTime {
|
|
2201
2323
|
holeDiameter?: number;
|
|
2202
2324
|
holeHeightFraction: number;
|
|
@@ -3845,6 +3967,7 @@ export class Weather extends EntityBase {
|
|
|
3845
3967
|
relativeHumidity: number;
|
|
3846
3968
|
mixingLayerHeight: number;
|
|
3847
3969
|
solarRadiation: number;
|
|
3970
|
+
windProfileFlag?: Enums.WindProfileFlag;
|
|
3848
3971
|
|
|
3849
3972
|
/**
|
|
3850
3973
|
* A set of weather conditions for use in the modelling of a release and its effects.
|
|
@@ -3855,6 +3978,7 @@ export class Weather extends EntityBase {
|
|
|
3855
3978
|
* @param {number} relativeHumidity - The amount of water vapour present in the air compared to the maximum amount the air can hold at a given temperature. (default value is 0.7)
|
|
3856
3979
|
* @param {number} mixingLayerHeight - The height of the atmospheric boundary layer which caps the centreline of the plume. (default value is 800)
|
|
3857
3980
|
* @param {number} solarRadiation - The radiation received from the sun, which contributes to pool evaporation. (default value is 500)
|
|
3981
|
+
* @param {Enums.WindProfileFlag} windProfileFlag - Wind profile flag. (default value is Enums.WindProfileFlag.LOGARITHMIC_PROFILE)
|
|
3858
3982
|
*/
|
|
3859
3983
|
constructor(options?: {
|
|
3860
3984
|
id?: string;
|
|
@@ -3866,6 +3990,7 @@ export class Weather extends EntityBase {
|
|
|
3866
3990
|
relativeHumidity?: number;
|
|
3867
3991
|
mixingLayerHeight?: number;
|
|
3868
3992
|
solarRadiation?: number;
|
|
3993
|
+
windProfileFlag?: Enums.WindProfileFlag;
|
|
3869
3994
|
}) {
|
|
3870
3995
|
super(options?.id, options?.typeId, options?.displayName);
|
|
3871
3996
|
this.windSpeed = options?.windSpeed ?? 5;
|
|
@@ -3874,6 +3999,7 @@ export class Weather extends EntityBase {
|
|
|
3874
3999
|
this.relativeHumidity = options?.relativeHumidity ?? 0.7;
|
|
3875
4000
|
this.mixingLayerHeight = options?.mixingLayerHeight ?? 800;
|
|
3876
4001
|
this.solarRadiation = options?.solarRadiation ?? 500;
|
|
4002
|
+
this.windProfileFlag = options?.windProfileFlag ?? Enums.WindProfileFlag.LOGARITHMIC_PROFILE;
|
|
3877
4003
|
}
|
|
3878
4004
|
|
|
3879
4005
|
/** Initialise the entity with data from a dictionary. */
|
|
@@ -3897,6 +4023,9 @@ export class Weather extends EntityBase {
|
|
|
3897
4023
|
if (data.solarRadiation !== undefined && typeof data.solarRadiation === "number") {
|
|
3898
4024
|
this.solarRadiation = data.solarRadiation as number;
|
|
3899
4025
|
}
|
|
4026
|
+
if (data.windProfileFlag !== undefined && (typeof data.windProfileFlag === "string" || typeof data.windProfileFlag === "number")) {
|
|
4027
|
+
this.windProfileFlag = this.parseEnumValue(data.windProfileFlag, Enums.WindProfileFlag);
|
|
4028
|
+
}
|
|
3900
4029
|
}
|
|
3901
4030
|
|
|
3902
4031
|
private parseEnumValue<T extends object>(value: unknown, enumType: T): T[keyof T] | undefined {
|
|
@@ -3918,6 +4047,7 @@ export class Weather extends EntityBase {
|
|
|
3918
4047
|
`relativeHumidity: ${this.relativeHumidity}`,
|
|
3919
4048
|
`mixingLayerHeight: ${this.mixingLayerHeight}`,
|
|
3920
4049
|
`solarRadiation: ${this.solarRadiation}`,
|
|
4050
|
+
`windProfileFlag: ${this.windProfileFlag}`,
|
|
3921
4051
|
];
|
|
3922
4052
|
return parts.join("\n");
|
|
3923
4053
|
}
|
package/src/entity-schemas.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/***********************************************************************
|
|
2
2
|
* This file has been auto-generated by a code generation tool.
|
|
3
|
-
* Version: 1.0.
|
|
4
|
-
* Date/time:
|
|
3
|
+
* Version: 1.0.64
|
|
4
|
+
* Date/time: 04 Apr 2025 15:02:05
|
|
5
5
|
* Template: templates/typescriptpws/entityschemas.razor.
|
|
6
6
|
***********************************************************************/
|
|
7
7
|
|
|
@@ -336,26 +336,54 @@ export class AtmosphericStorageTankSchema extends SchemaBase<AtmosphericStorageT
|
|
|
336
336
|
}
|
|
337
337
|
}
|
|
338
338
|
|
|
339
|
-
export interface
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
339
|
+
export interface ScenarioSchemaData extends SchemaBaseData {}
|
|
340
|
+
|
|
341
|
+
/**
|
|
342
|
+
* ================================================================================
|
|
343
|
+
* Class: ScenarioSchema
|
|
344
|
+
* Description: Base struct/class for all scenario types.
|
|
345
|
+
* ================================================================================
|
|
346
|
+
*/
|
|
347
|
+
export class ScenarioSchema extends SchemaBase<ScenarioSchemaData> {
|
|
348
|
+
constructor() {
|
|
349
|
+
super();
|
|
350
|
+
this.schema = this.schema.concat(
|
|
351
|
+
Joi.object()
|
|
352
|
+
)
|
|
353
|
+
.pattern(
|
|
354
|
+
ignoredPropertiesRegex,
|
|
355
|
+
Joi.alternatives().try(Joi.string(), Joi.number(), Joi.date(), Joi.any())
|
|
356
|
+
)
|
|
357
|
+
.unknown(false);
|
|
358
|
+
|
|
359
|
+
this.propertyTypes = {
|
|
360
|
+
...this.propertyTypes,};
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
makeEntity(data: ScenarioSchemaData): Entities.Scenario {
|
|
364
|
+
return new Entities.Scenario(
|
|
365
|
+
data);
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
export interface ReleaseOverTimeSchemaData extends SchemaBaseData {
|
|
370
|
+
releaseAngle: number;
|
|
371
|
+
timeVaryingOption: Enums.TimeVaryingOption;
|
|
343
372
|
}
|
|
344
373
|
|
|
345
374
|
/**
|
|
346
375
|
* ================================================================================
|
|
347
|
-
* Class:
|
|
348
|
-
* Description:
|
|
376
|
+
* Class: ReleaseOverTimeSchema
|
|
377
|
+
* Description: Scenario representing a release over time.
|
|
349
378
|
* ================================================================================
|
|
350
379
|
*/
|
|
351
|
-
export class
|
|
380
|
+
export class ReleaseOverTimeSchema extends SchemaBase<ReleaseOverTimeSchemaData> {
|
|
352
381
|
constructor() {
|
|
353
382
|
super();
|
|
354
383
|
this.schema = this.schema.concat(
|
|
355
384
|
Joi.object({
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
specifyBund: Joi.boolean(),
|
|
385
|
+
releaseAngle: Joi.number().unsafe(),
|
|
386
|
+
timeVaryingOption: Joi.string().valid(...Object.values(Enums.TimeVaryingOption)),
|
|
359
387
|
})
|
|
360
388
|
)
|
|
361
389
|
.pattern(
|
|
@@ -366,31 +394,44 @@ export class BundSchema extends SchemaBase<BundSchemaData> {
|
|
|
366
394
|
|
|
367
395
|
this.propertyTypes = {
|
|
368
396
|
...this.propertyTypes,
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
specifyBund: "boolean",
|
|
397
|
+
releaseAngle: "number",
|
|
398
|
+
timeVaryingOption: "Enums.TimeVaryingOption",
|
|
372
399
|
};
|
|
373
400
|
}
|
|
374
401
|
|
|
375
|
-
makeEntity(data:
|
|
376
|
-
return new Entities.
|
|
402
|
+
makeEntity(data: ReleaseOverTimeSchemaData): Entities.ReleaseOverTime {
|
|
403
|
+
return new Entities.ReleaseOverTime(
|
|
377
404
|
data);
|
|
378
405
|
}
|
|
379
406
|
}
|
|
380
407
|
|
|
381
|
-
export interface
|
|
408
|
+
export interface BESSReleaseSchemaData extends SchemaBaseData {
|
|
409
|
+
height: number;
|
|
410
|
+
area: number;
|
|
411
|
+
temperature: number;
|
|
412
|
+
duration: number;
|
|
413
|
+
releaseAngle: number;
|
|
414
|
+
timeVaryingOption: Enums.TimeVaryingOption;
|
|
415
|
+
}
|
|
382
416
|
|
|
383
417
|
/**
|
|
384
418
|
* ================================================================================
|
|
385
|
-
* Class:
|
|
386
|
-
* Description:
|
|
419
|
+
* Class: BESSReleaseSchema
|
|
420
|
+
* Description: A release from a BESS unit in thermal runaway
|
|
387
421
|
* ================================================================================
|
|
388
422
|
*/
|
|
389
|
-
export class
|
|
423
|
+
export class BESSReleaseSchema extends SchemaBase<BESSReleaseSchemaData> {
|
|
390
424
|
constructor() {
|
|
391
425
|
super();
|
|
392
426
|
this.schema = this.schema.concat(
|
|
393
|
-
Joi.object(
|
|
427
|
+
Joi.object({
|
|
428
|
+
height: Joi.number().unsafe(),
|
|
429
|
+
area: Joi.number().unsafe(),
|
|
430
|
+
temperature: Joi.number().unsafe(),
|
|
431
|
+
duration: Joi.number().unsafe(),
|
|
432
|
+
releaseAngle: Joi.number().unsafe(),
|
|
433
|
+
timeVaryingOption: Joi.string().valid(...Object.values(Enums.TimeVaryingOption)),
|
|
434
|
+
})
|
|
394
435
|
)
|
|
395
436
|
.pattern(
|
|
396
437
|
ignoredPropertiesRegex,
|
|
@@ -399,11 +440,102 @@ export class ScenarioSchema extends SchemaBase<ScenarioSchemaData> {
|
|
|
399
440
|
.unknown(false);
|
|
400
441
|
|
|
401
442
|
this.propertyTypes = {
|
|
402
|
-
...this.propertyTypes,
|
|
443
|
+
...this.propertyTypes,
|
|
444
|
+
height: "number",
|
|
445
|
+
area: "number",
|
|
446
|
+
temperature: "number",
|
|
447
|
+
duration: "number",
|
|
448
|
+
releaseAngle: "number",
|
|
449
|
+
timeVaryingOption: "Enums.TimeVaryingOption",
|
|
450
|
+
};
|
|
403
451
|
}
|
|
404
452
|
|
|
405
|
-
makeEntity(data:
|
|
406
|
-
return new Entities.
|
|
453
|
+
makeEntity(data: BESSReleaseSchemaData): Entities.BESSRelease {
|
|
454
|
+
return new Entities.BESSRelease(
|
|
455
|
+
data);
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
export interface BESSUnitSchemaData extends SchemaBaseData {
|
|
460
|
+
location: Entities.LocalPosition;
|
|
461
|
+
energyCapacity: number;
|
|
462
|
+
chemistry: Enums.BESSChemistry;
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
/**
|
|
466
|
+
* ================================================================================
|
|
467
|
+
* Class: BESSUnitSchema
|
|
468
|
+
* Description: A BESS unit, containing Li-ion betteries
|
|
469
|
+
* ================================================================================
|
|
470
|
+
*/
|
|
471
|
+
export class BESSUnitSchema extends SchemaBase<BESSUnitSchemaData> {
|
|
472
|
+
constructor() {
|
|
473
|
+
super();
|
|
474
|
+
this.schema = this.schema.concat(
|
|
475
|
+
Joi.object({
|
|
476
|
+
location: new LocalPositionSchema().schema,
|
|
477
|
+
energyCapacity: Joi.number().unsafe(),
|
|
478
|
+
chemistry: Joi.string().valid(...Object.values(Enums.BESSChemistry)),
|
|
479
|
+
})
|
|
480
|
+
)
|
|
481
|
+
.pattern(
|
|
482
|
+
ignoredPropertiesRegex,
|
|
483
|
+
Joi.alternatives().try(Joi.string(), Joi.number(), Joi.date(), Joi.any())
|
|
484
|
+
)
|
|
485
|
+
.unknown(false);
|
|
486
|
+
|
|
487
|
+
this.propertyTypes = {
|
|
488
|
+
...this.propertyTypes,
|
|
489
|
+
location: "LocalPosition",
|
|
490
|
+
energyCapacity: "number",
|
|
491
|
+
chemistry: "Enums.BESSChemistry",
|
|
492
|
+
};
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
makeEntity(data: BESSUnitSchemaData): Entities.BESSUnit {
|
|
496
|
+
return new Entities.BESSUnit(
|
|
497
|
+
data);
|
|
498
|
+
}
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
export interface BundSchemaData extends SchemaBaseData {
|
|
502
|
+
bundHeight: number;
|
|
503
|
+
bundDiameter: number;
|
|
504
|
+
specifyBund: boolean;
|
|
505
|
+
}
|
|
506
|
+
|
|
507
|
+
/**
|
|
508
|
+
* ================================================================================
|
|
509
|
+
* Class: BundSchema
|
|
510
|
+
* Description: A bund entity used in the modelling of pool spreading and vaporisation.
|
|
511
|
+
* ================================================================================
|
|
512
|
+
*/
|
|
513
|
+
export class BundSchema extends SchemaBase<BundSchemaData> {
|
|
514
|
+
constructor() {
|
|
515
|
+
super();
|
|
516
|
+
this.schema = this.schema.concat(
|
|
517
|
+
Joi.object({
|
|
518
|
+
bundHeight: Joi.number().unsafe(),
|
|
519
|
+
bundDiameter: Joi.number().unsafe(),
|
|
520
|
+
specifyBund: Joi.boolean(),
|
|
521
|
+
})
|
|
522
|
+
)
|
|
523
|
+
.pattern(
|
|
524
|
+
ignoredPropertiesRegex,
|
|
525
|
+
Joi.alternatives().try(Joi.string(), Joi.number(), Joi.date(), Joi.any())
|
|
526
|
+
)
|
|
527
|
+
.unknown(false);
|
|
528
|
+
|
|
529
|
+
this.propertyTypes = {
|
|
530
|
+
...this.propertyTypes,
|
|
531
|
+
bundHeight: "number",
|
|
532
|
+
bundDiameter: "number",
|
|
533
|
+
specifyBund: "boolean",
|
|
534
|
+
};
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
makeEntity(data: BundSchemaData): Entities.Bund {
|
|
538
|
+
return new Entities.Bund(
|
|
407
539
|
data);
|
|
408
540
|
}
|
|
409
541
|
}
|
|
@@ -1440,45 +1572,6 @@ export class FlashResultSchema extends SchemaBase<FlashResultSchemaData> {
|
|
|
1440
1572
|
}
|
|
1441
1573
|
}
|
|
1442
1574
|
|
|
1443
|
-
export interface ReleaseOverTimeSchemaData extends SchemaBaseData {
|
|
1444
|
-
releaseAngle: number;
|
|
1445
|
-
timeVaryingOption: Enums.TimeVaryingOption;
|
|
1446
|
-
}
|
|
1447
|
-
|
|
1448
|
-
/**
|
|
1449
|
-
* ================================================================================
|
|
1450
|
-
* Class: ReleaseOverTimeSchema
|
|
1451
|
-
* Description: Scenario representing a release over time.
|
|
1452
|
-
* ================================================================================
|
|
1453
|
-
*/
|
|
1454
|
-
export class ReleaseOverTimeSchema extends SchemaBase<ReleaseOverTimeSchemaData> {
|
|
1455
|
-
constructor() {
|
|
1456
|
-
super();
|
|
1457
|
-
this.schema = this.schema.concat(
|
|
1458
|
-
Joi.object({
|
|
1459
|
-
releaseAngle: Joi.number().unsafe(),
|
|
1460
|
-
timeVaryingOption: Joi.string().valid(...Object.values(Enums.TimeVaryingOption)),
|
|
1461
|
-
})
|
|
1462
|
-
)
|
|
1463
|
-
.pattern(
|
|
1464
|
-
ignoredPropertiesRegex,
|
|
1465
|
-
Joi.alternatives().try(Joi.string(), Joi.number(), Joi.date(), Joi.any())
|
|
1466
|
-
)
|
|
1467
|
-
.unknown(false);
|
|
1468
|
-
|
|
1469
|
-
this.propertyTypes = {
|
|
1470
|
-
...this.propertyTypes,
|
|
1471
|
-
releaseAngle: "number",
|
|
1472
|
-
timeVaryingOption: "Enums.TimeVaryingOption",
|
|
1473
|
-
};
|
|
1474
|
-
}
|
|
1475
|
-
|
|
1476
|
-
makeEntity(data: ReleaseOverTimeSchemaData): Entities.ReleaseOverTime {
|
|
1477
|
-
return new Entities.ReleaseOverTime(
|
|
1478
|
-
data);
|
|
1479
|
-
}
|
|
1480
|
-
}
|
|
1481
|
-
|
|
1482
1575
|
export interface LeakSchemaData extends SchemaBaseData {
|
|
1483
1576
|
holeDiameter: number;
|
|
1484
1577
|
releaseAngle: number;
|
|
@@ -2575,6 +2668,7 @@ export interface WeatherSchemaData extends SchemaBaseData {
|
|
|
2575
2668
|
relativeHumidity: number;
|
|
2576
2669
|
mixingLayerHeight: number;
|
|
2577
2670
|
solarRadiation: number;
|
|
2671
|
+
windProfileFlag: Enums.WindProfileFlag;
|
|
2578
2672
|
}
|
|
2579
2673
|
|
|
2580
2674
|
/**
|
|
@@ -2594,6 +2688,7 @@ export class WeatherSchema extends SchemaBase<WeatherSchemaData> {
|
|
|
2594
2688
|
relativeHumidity: Joi.number().unsafe(),
|
|
2595
2689
|
mixingLayerHeight: Joi.number().unsafe(),
|
|
2596
2690
|
solarRadiation: Joi.number().unsafe(),
|
|
2691
|
+
windProfileFlag: Joi.string().valid(...Object.values(Enums.WindProfileFlag)),
|
|
2597
2692
|
})
|
|
2598
2693
|
)
|
|
2599
2694
|
.pattern(
|
|
@@ -2610,6 +2705,7 @@ export class WeatherSchema extends SchemaBase<WeatherSchemaData> {
|
|
|
2610
2705
|
relativeHumidity: "number",
|
|
2611
2706
|
mixingLayerHeight: "number",
|
|
2612
2707
|
solarRadiation: "number",
|
|
2708
|
+
windProfileFlag: "Enums.WindProfileFlag",
|
|
2613
2709
|
};
|
|
2614
2710
|
}
|
|
2615
2711
|
|