iapws-if97 2.1.5 → 2.8.0
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/CHANGELOG.md +32 -1
- package/README.md +78 -215
- package/dist/backward/candidate-resolution.d.ts +8 -0
- package/dist/backward/candidate-resolution.js +40 -0
- package/dist/backward/fixed-temperature-candidates.d.ts +4 -0
- package/dist/backward/fixed-temperature-candidates.js +188 -0
- package/dist/backward/fixed-temperature-solver.d.ts +6 -6
- package/dist/backward/fixed-temperature-solver.js +56 -9
- package/dist/backward/fixed-temperature-stationary.d.ts +4 -0
- package/dist/backward/fixed-temperature-stationary.js +146 -0
- package/dist/backward/hs-region.d.ts +50 -0
- package/dist/backward/hs-region.js +695 -0
- package/dist/backward/hs-state.d.ts +15 -0
- package/dist/backward/hs-state.js +316 -0
- package/dist/backward/hs.d.ts +1 -2
- package/dist/backward/hs.js +28 -232
- package/dist/backward/ph.d.ts +8 -3
- package/dist/backward/ph.js +102 -54
- package/dist/backward/pressure-property-region.d.ts +13 -0
- package/dist/backward/pressure-property-region.js +262 -0
- package/dist/backward/ps.d.ts +6 -1
- package/dist/backward/ps.js +103 -38
- package/dist/backward/solution-validation.d.ts +7 -2
- package/dist/backward/solution-validation.js +162 -37
- package/dist/backward/th.d.ts +3 -6
- package/dist/backward/th.js +10 -73
- package/dist/backward/tolerances.d.ts +3 -1
- package/dist/backward/tolerances.js +9 -4
- package/dist/backward/ts.d.ts +3 -6
- package/dist/backward/ts.js +10 -73
- package/dist/boundaries.d.ts +0 -1
- package/dist/boundaries.js +0 -1
- package/dist/constants.d.ts +11 -24
- package/dist/constants.js +17 -28
- package/dist/core/floating-point.d.ts +2 -0
- package/dist/core/floating-point.js +7 -0
- package/dist/core/formulation-seams.d.ts +27 -0
- package/dist/core/formulation-seams.js +289 -0
- package/dist/core/input-validation.d.ts +1 -1
- package/dist/core/input-validation.js +5 -1
- package/dist/core/region-detector.d.ts +3 -41
- package/dist/core/region-detector.js +39 -597
- package/dist/core/region3-pt.d.ts +12 -1
- package/dist/core/region3-pt.js +68 -13
- package/dist/core/solve-input-normalization.d.ts +0 -1
- package/dist/core/solve-input-normalization.js +4 -2
- package/dist/core/solver.d.ts +7 -11
- package/dist/core/solver.js +26 -18
- package/dist/core/thermodynamic-derivatives.d.ts +17 -0
- package/dist/core/thermodynamic-derivatives.js +27 -0
- package/dist/detect.d.ts +16 -3
- package/dist/detect.js +36 -3
- package/dist/errors.d.ts +11 -0
- package/dist/errors.js +16 -0
- package/dist/gas-constant.d.ts +5 -0
- package/dist/gas-constant.js +5 -0
- package/dist/index.d.ts +4 -6
- package/dist/index.js +10 -22
- package/dist/regions/boundaries.d.ts +0 -1
- package/dist/regions/boundaries.js +0 -1
- package/dist/regions/region1.d.ts +2 -2
- package/dist/regions/region1.js +1 -2
- package/dist/regions/region2.d.ts +2 -2
- package/dist/regions/region2.js +1 -2
- package/dist/regions/region3-data.d.ts +0 -1
- package/dist/regions/region3-data.js +3 -4
- package/dist/regions/region3-eval.d.ts +0 -1
- package/dist/regions/region3-eval.js +0 -1
- package/dist/regions/region3-subregions.d.ts +0 -1
- package/dist/regions/region3-subregions.js +15 -11
- package/dist/regions/region3.d.ts +4 -2
- package/dist/regions/region3.js +32 -3
- package/dist/regions/region4.d.ts +2 -1
- package/dist/regions/region4.js +39 -13
- package/dist/regions/region5.d.ts +2 -2
- package/dist/regions/region5.js +2 -3
- package/dist/regions.d.ts +0 -1
- package/dist/regions.js +0 -1
- package/dist/saturation/common.d.ts +2 -9
- package/dist/saturation/common.js +66 -45
- package/dist/saturation/region4-boundaries.d.ts +0 -5
- package/dist/saturation/region4-boundaries.js +17 -18
- package/dist/saturation/region4-hs.d.ts +2 -1
- package/dist/saturation/region4-hs.js +499 -106
- package/dist/saturation/two-phase.d.ts +2 -3
- package/dist/saturation/two-phase.js +7 -8
- package/dist/saturation.d.ts +0 -1
- package/dist/saturation.js +0 -1
- package/dist/solvers/bracketed-newton.d.ts +10 -6
- package/dist/solvers/bracketed-newton.js +19 -13
- package/dist/solvers/damped-newton-2d.d.ts +12 -0
- package/dist/solvers/damped-newton-2d.js +68 -0
- package/dist/solvers/extended-arithmetic.d.ts +6 -0
- package/dist/solvers/extended-arithmetic.js +38 -0
- package/dist/solvers/newton-raphson.d.ts +0 -1
- package/dist/solvers/newton-raphson.js +0 -1
- package/dist/transport/properties.d.ts +4 -3
- package/dist/transport/properties.js +14 -5
- package/dist/transport.d.ts +0 -1
- package/dist/transport.js +0 -1
- package/dist/types.d.ts +18 -1
- package/dist/types.js +14 -1
- package/package.json +18 -10
- package/dist/backward/objective-normalization.d.ts +0 -7
- package/dist/backward/objective-normalization.js +0 -8
- package/dist/core/public-normalization.d.ts +0 -4
- package/dist/core/public-normalization.js +0 -54
- package/dist/solvers/nelder-mead.d.ts +0 -17
- package/dist/solvers/nelder-mead.js +0 -116
|
@@ -5,21 +5,21 @@
|
|
|
5
5
|
* (enthalpy or entropy) using a bracketed Newton method.
|
|
6
6
|
*/
|
|
7
7
|
import type { BasicProperties } from '../types.js';
|
|
8
|
-
|
|
8
|
+
/** Property being inverted against pressure at fixed temperature. */
|
|
9
|
+
export type FixedTemperatureProperty = 'enthalpy' | 'entropy';
|
|
9
10
|
/**
|
|
10
11
|
* Solve for pressure at fixed temperature by matching a target property value.
|
|
11
12
|
*
|
|
12
13
|
* Evaluates the region equation at the bracket endpoints first (short-circuit
|
|
13
|
-
* if
|
|
14
|
+
* if an included endpoint matches), then runs a bracketed Newton iteration driven by
|
|
15
|
+
* the analytic pressure derivative (density derivative for Region 3).
|
|
14
16
|
*
|
|
15
17
|
* @param evaluator - Region-specific equation returning BasicProperties from (p, T)
|
|
16
18
|
* @param T - Fixed temperature [K]
|
|
17
19
|
* @param target - Target property value (enthalpy or entropy)
|
|
18
20
|
* @param lower - Lower pressure bracket [MPa]
|
|
19
21
|
* @param upper - Upper pressure bracket [MPa]
|
|
20
|
-
* @param
|
|
22
|
+
* @param property - Which property `target` represents
|
|
21
23
|
* @param solverName - Label used in error messages
|
|
22
24
|
*/
|
|
23
|
-
export declare function solveFixedTemperaturePressure(evaluator: (p: number, T: number) => BasicProperties, T: number, target: number, lower: number, upper: number,
|
|
24
|
-
export {};
|
|
25
|
-
//# sourceMappingURL=fixed-temperature-solver.d.ts.map
|
|
25
|
+
export declare function solveFixedTemperaturePressure(evaluator: (p: number, T: number) => BasicProperties, T: number, target: number, lower: number, upper: number, property: FixedTemperatureProperty, solverName: string, includeLower?: boolean, includeUpper?: boolean): BasicProperties;
|
|
@@ -1,31 +1,78 @@
|
|
|
1
|
-
import { IF97Error } from '../types.js';
|
|
1
|
+
import { IF97Error, Region } from '../types.js';
|
|
2
|
+
import { region3ByRhoT } from '../regions/region3.js';
|
|
2
3
|
import { bracketedNewton } from '../solvers/bracketed-newton.js';
|
|
4
|
+
import { gibbsPropertyDerivatives, helmholtzPropertyDerivatives } from '../core/thermodynamic-derivatives.js';
|
|
5
|
+
import { fixedTemperatureRootTolerance } from './tolerances.js';
|
|
6
|
+
function propertyValue(state, property) {
|
|
7
|
+
return property === 'enthalpy' ? state.enthalpy : state.entropy;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* (∂h/∂p)_T = 1000·v(1 − Tα) or (∂s/∂p)_T = −1000·v·α, both per MPa.
|
|
11
|
+
*
|
|
12
|
+
* These are Maxwell-relation identities, so they hold for the Helmholtz-based
|
|
13
|
+
* Region 3 states as well as the Gibbs-based regions. Returns NaN when a state
|
|
14
|
+
* carries no cp/α, which makes the caller fall back to a bisection step.
|
|
15
|
+
*/
|
|
16
|
+
function pressureDerivative(state, property) {
|
|
17
|
+
const derivatives = gibbsPropertyDerivatives(state);
|
|
18
|
+
return property === 'enthalpy' ? derivatives.dhDp : derivatives.dsDp;
|
|
19
|
+
}
|
|
3
20
|
/**
|
|
4
21
|
* Solve for pressure at fixed temperature by matching a target property value.
|
|
5
22
|
*
|
|
6
23
|
* Evaluates the region equation at the bracket endpoints first (short-circuit
|
|
7
|
-
* if
|
|
24
|
+
* if an included endpoint matches), then runs a bracketed Newton iteration driven by
|
|
25
|
+
* the analytic pressure derivative (density derivative for Region 3).
|
|
8
26
|
*
|
|
9
27
|
* @param evaluator - Region-specific equation returning BasicProperties from (p, T)
|
|
10
28
|
* @param T - Fixed temperature [K]
|
|
11
29
|
* @param target - Target property value (enthalpy or entropy)
|
|
12
30
|
* @param lower - Lower pressure bracket [MPa]
|
|
13
31
|
* @param upper - Upper pressure bracket [MPa]
|
|
14
|
-
* @param
|
|
32
|
+
* @param property - Which property `target` represents
|
|
15
33
|
* @param solverName - Label used in error messages
|
|
16
34
|
*/
|
|
17
|
-
export function solveFixedTemperaturePressure(evaluator, T, target, lower, upper,
|
|
35
|
+
export function solveFixedTemperaturePressure(evaluator, T, target, lower, upper, property, solverName, includeLower = true, includeUpper = true) {
|
|
18
36
|
const lowerState = evaluator(lower, T);
|
|
19
37
|
const upperState = evaluator(upper, T);
|
|
20
|
-
|
|
38
|
+
const useDensity = lowerState.region === Region.Region3;
|
|
39
|
+
// Density bounds keep Region 3 iteration on the same saturation branch.
|
|
40
|
+
const lowerBound = useDensity ? 1 / lowerState.specificVolume : lower;
|
|
41
|
+
const upperBound = useDensity ? 1 / upperState.specificVolume : upper;
|
|
42
|
+
// Keyed by p or ρ, so the residual and its derivative at the same point share one
|
|
43
|
+
// equation evaluation regardless of the order the solver calls them in.
|
|
44
|
+
let cachedInput = Number.NaN;
|
|
45
|
+
let cachedState = null;
|
|
46
|
+
const stateAt = (input) => {
|
|
47
|
+
if (input !== cachedInput || cachedState === null) {
|
|
48
|
+
cachedInput = input;
|
|
49
|
+
cachedState = useDensity ? region3ByRhoT(input, T) : evaluator(input, T);
|
|
50
|
+
}
|
|
51
|
+
return cachedState;
|
|
52
|
+
};
|
|
53
|
+
const rootTolerance = fixedTemperatureRootTolerance(property);
|
|
54
|
+
if (includeLower && Math.abs(propertyValue(lowerState, property) - target) <= rootTolerance)
|
|
21
55
|
return lowerState;
|
|
22
|
-
if (Math.abs(
|
|
56
|
+
if (includeUpper && Math.abs(propertyValue(upperState, property) - target) <= rootTolerance)
|
|
23
57
|
return upperState;
|
|
24
|
-
|
|
25
|
-
const
|
|
58
|
+
// Resolve open endpoints below their matching tolerance instead of snapping to them.
|
|
59
|
+
const residualScale = includeLower && includeUpper ? 1 : rootTolerance;
|
|
60
|
+
const root = bracketedNewton((input) => (propertyValue(stateAt(input), property) - target) / residualScale, lowerBound, upperBound, (lowerBound + upperBound) / 2, {
|
|
61
|
+
derivative: (input) => {
|
|
62
|
+
if (useDensity) {
|
|
63
|
+
const derivatives = helmholtzPropertyDerivatives(stateAt(input), input);
|
|
64
|
+
return (property === 'enthalpy' ? derivatives.dhDrho : derivatives.dsDrho) / residualScale;
|
|
65
|
+
}
|
|
66
|
+
return pressureDerivative(stateAt(input), property) / residualScale;
|
|
67
|
+
},
|
|
68
|
+
// Near-critical properties need a tighter bracket before termination.
|
|
69
|
+
tolerance: residualScale === 1 ? 1e-12 : Number.EPSILON,
|
|
70
|
+
// Flat isotherms require convergence in pressure or density.
|
|
71
|
+
residualTolerance: 0,
|
|
72
|
+
});
|
|
73
|
+
const state = stateAt(root);
|
|
26
74
|
if (!Number.isFinite(state.pressure)) {
|
|
27
75
|
throw new IF97Error(`${solverName} failed to recover a valid pressure`);
|
|
28
76
|
}
|
|
29
77
|
return state;
|
|
30
78
|
}
|
|
31
|
-
//# sourceMappingURL=fixed-temperature-solver.js.map
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type BasicProperties } from '../types.js';
|
|
2
|
+
import type { FixedTemperatureProperty } from './fixed-temperature-solver.js';
|
|
3
|
+
/** Share one isotherm's coefficients while keeping each pressure interval separate. */
|
|
4
|
+
export declare function createFixedTemperatureStationaryPressureFinder(T: number, property: FixedTemperatureProperty): (lowerState: BasicProperties, upperState: BasicProperties) => number[];
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import { RHOc, Tc } from '../constants.js';
|
|
2
|
+
import { COEFFICIENTS as R1_COEFFICIENTS } from '../regions/region1.js';
|
|
3
|
+
import { RESIDUAL_COEFFICIENTS as R2_COEFFICIENTS } from '../regions/region2.js';
|
|
4
|
+
import { COEFFICIENTS as R3_COEFFICIENTS, region3ByRhoT } from '../regions/region3.js';
|
|
5
|
+
import { RESIDUAL_COEFFICIENTS as R5_COEFFICIENTS } from '../regions/region5.js';
|
|
6
|
+
import { Region } from '../types.js';
|
|
7
|
+
function evaluate(coefficients, x) {
|
|
8
|
+
let value = 0;
|
|
9
|
+
for (let i = coefficients.length - 1; i >= 0; i--)
|
|
10
|
+
value = value * x + coefficients[i];
|
|
11
|
+
return value;
|
|
12
|
+
}
|
|
13
|
+
// Derivative roots partition a polynomial into monotone intervals (Rolle's theorem).
|
|
14
|
+
function polynomialRoots(coefficients, lower, upper) {
|
|
15
|
+
while (coefficients.length > 1 && coefficients[coefficients.length - 1] === 0)
|
|
16
|
+
coefficients.pop();
|
|
17
|
+
if (coefficients.length < 2)
|
|
18
|
+
return [];
|
|
19
|
+
const scale = Math.max(...coefficients.map(Math.abs));
|
|
20
|
+
const normalized = coefficients.map((value) => value / scale);
|
|
21
|
+
// Interval Horner bounds can exclude zero before constructing derivative roots.
|
|
22
|
+
let minimum = 0;
|
|
23
|
+
let maximum = 0;
|
|
24
|
+
let magnitude = 0;
|
|
25
|
+
for (let i = normalized.length - 1; i >= 0; i--) {
|
|
26
|
+
minimum = normalized[i] + minimum * (minimum < 0 ? upper : lower);
|
|
27
|
+
maximum = normalized[i] + maximum * (maximum < 0 ? lower : upper);
|
|
28
|
+
magnitude += Math.abs(normalized[i]);
|
|
29
|
+
}
|
|
30
|
+
// With x in [0, 1], allow roundoff before excluding endpoint or tangent zeros.
|
|
31
|
+
const roundingMargin = 4 * Number.EPSILON * normalized.length * magnitude;
|
|
32
|
+
if (minimum > roundingMargin || maximum < -roundingMargin)
|
|
33
|
+
return [];
|
|
34
|
+
const derivative = normalized.slice(1).map((value, i) => value * (i + 1));
|
|
35
|
+
const points = [lower, ...polynomialRoots(derivative, lower, upper), upper];
|
|
36
|
+
const roots = [];
|
|
37
|
+
for (let i = 0; i < points.length; i++) {
|
|
38
|
+
let a = points[i];
|
|
39
|
+
let fa = evaluate(normalized, a);
|
|
40
|
+
if (fa === 0)
|
|
41
|
+
roots.push(a);
|
|
42
|
+
if (i === points.length - 1)
|
|
43
|
+
break;
|
|
44
|
+
let b = points[i + 1];
|
|
45
|
+
const fb = evaluate(normalized, b);
|
|
46
|
+
if (fa === 0 || fb === 0 || Math.sign(fa) === Math.sign(fb))
|
|
47
|
+
continue;
|
|
48
|
+
for (let step = 0; step < 64; step++) {
|
|
49
|
+
const midpoint = (a + b) / 2;
|
|
50
|
+
if (midpoint === a || midpoint === b)
|
|
51
|
+
break;
|
|
52
|
+
const fm = evaluate(normalized, midpoint);
|
|
53
|
+
if (fm === 0) {
|
|
54
|
+
a = midpoint;
|
|
55
|
+
b = midpoint;
|
|
56
|
+
break;
|
|
57
|
+
}
|
|
58
|
+
if (Math.sign(fa) === Math.sign(fm)) {
|
|
59
|
+
a = midpoint;
|
|
60
|
+
fa = fm;
|
|
61
|
+
}
|
|
62
|
+
else
|
|
63
|
+
b = midpoint;
|
|
64
|
+
}
|
|
65
|
+
roots.push((a + b) / 2);
|
|
66
|
+
}
|
|
67
|
+
return roots.filter((root, i) => i === 0 || root !== roots[i - 1]);
|
|
68
|
+
}
|
|
69
|
+
function stationaryCoefficients(T, region, property) {
|
|
70
|
+
let table;
|
|
71
|
+
let tau;
|
|
72
|
+
switch (region) {
|
|
73
|
+
case Region.Region1:
|
|
74
|
+
table = R1_COEFFICIENTS;
|
|
75
|
+
tau = 1386 / T - 1.222;
|
|
76
|
+
break;
|
|
77
|
+
case Region.Region2:
|
|
78
|
+
table = R2_COEFFICIENTS;
|
|
79
|
+
tau = 540 / T - 0.5;
|
|
80
|
+
break;
|
|
81
|
+
case Region.Region3:
|
|
82
|
+
table = R3_COEFFICIENTS;
|
|
83
|
+
tau = Tc / T;
|
|
84
|
+
break;
|
|
85
|
+
case Region.Region5:
|
|
86
|
+
table = R5_COEFFICIENTS;
|
|
87
|
+
tau = 1000 / T;
|
|
88
|
+
break;
|
|
89
|
+
case Region.Region4: return [];
|
|
90
|
+
}
|
|
91
|
+
const logarithmicEntropy = property === 'entropy' && region !== Region.Region1;
|
|
92
|
+
const coefficients = Array(Math.max(...table.map(([I]) => I)) +
|
|
93
|
+
(logarithmicEntropy ? 1 : 0)).fill(0);
|
|
94
|
+
if (logarithmicEntropy) {
|
|
95
|
+
// Multiplying ds/dp (or ds/dδ) by its positive native variable clears 1/p (1/δ).
|
|
96
|
+
coefficients[0] = region === Region.Region3 ? -R3_COEFFICIENTS[0][2] : -1;
|
|
97
|
+
}
|
|
98
|
+
for (const [I, J, N] of table) {
|
|
99
|
+
if (I === 0)
|
|
100
|
+
continue;
|
|
101
|
+
// Constant nonzero factors do not affect the derivative's zeros.
|
|
102
|
+
let coefficient;
|
|
103
|
+
if (region === Region.Region3) {
|
|
104
|
+
coefficient = N * I * (property === 'enthalpy' ? I + J : J - 1) * Math.pow(tau, J);
|
|
105
|
+
}
|
|
106
|
+
else {
|
|
107
|
+
const tauDerivative = J === 0 ? 0 : J * Math.pow(tau, J - 1);
|
|
108
|
+
const physicalTau = tau + (region === Region.Region1 ? 1.222 : region === Region.Region2 ? 0.5 : 0);
|
|
109
|
+
coefficient = property === 'enthalpy'
|
|
110
|
+
? N * I * tauDerivative
|
|
111
|
+
: N * I * (physicalTau * tauDerivative - Math.pow(tau, J));
|
|
112
|
+
}
|
|
113
|
+
coefficients[I - (logarithmicEntropy ? 0 : 1)] += coefficient;
|
|
114
|
+
}
|
|
115
|
+
return coefficients;
|
|
116
|
+
}
|
|
117
|
+
/** Share one isotherm's coefficients while keeping each pressure interval separate. */
|
|
118
|
+
export function createFixedTemperatureStationaryPressureFinder(T, property) {
|
|
119
|
+
const coefficientsByRegion = new Map();
|
|
120
|
+
return (lowerState, upperState) => {
|
|
121
|
+
const region = lowerState.region;
|
|
122
|
+
let coefficients = coefficientsByRegion.get(region);
|
|
123
|
+
if (coefficients === undefined) {
|
|
124
|
+
coefficients = stationaryCoefficients(T, region, property);
|
|
125
|
+
coefficientsByRegion.set(region, coefficients);
|
|
126
|
+
}
|
|
127
|
+
if (coefficients.length === 0)
|
|
128
|
+
return [];
|
|
129
|
+
const nativeValue = (state) => region === Region.Region1
|
|
130
|
+
? 7.1 - state.pressure / 16.53
|
|
131
|
+
: region === Region.Region3 ? 1 / (state.specificVolume * RHOc) : state.pressure;
|
|
132
|
+
const lower = Math.min(nativeValue(lowerState), nativeValue(upperState));
|
|
133
|
+
const upper = Math.max(nativeValue(lowerState), nativeValue(upperState));
|
|
134
|
+
// Scaling the native variable to [0, 1] avoids powers of pressures up to 100 MPa.
|
|
135
|
+
const scaled = coefficients.map((value, i) => value * Math.pow(upper, i));
|
|
136
|
+
return polynomialRoots(scaled, lower / upper, 1).map((root) => {
|
|
137
|
+
const native = root * upper;
|
|
138
|
+
if (region === Region.Region1)
|
|
139
|
+
return (7.1 - native) * 16.53;
|
|
140
|
+
if (region === Region.Region3)
|
|
141
|
+
return region3ByRhoT(native * RHOc, T).pressure;
|
|
142
|
+
return native;
|
|
143
|
+
}).filter((pressure) => pressure > lowerState.pressure && pressure < upperState.pressure)
|
|
144
|
+
.sort((a, b) => a - b);
|
|
145
|
+
};
|
|
146
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { BasicProperties } from '../types.js';
|
|
2
|
+
import { Region } from '../types.js';
|
|
3
|
+
export interface HSClassificationCandidate {
|
|
4
|
+
state?: BasicProperties;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Saturated liquid enthalpy boundary for Region 1 (Eq. 3).
|
|
8
|
+
* h'_1(s)
|
|
9
|
+
*/
|
|
10
|
+
export declare function h1Sat(s: number): number;
|
|
11
|
+
/**
|
|
12
|
+
* Region 1 / Region 3 boundary enthalpy (Eq. 1, B13).
|
|
13
|
+
* h_13(s)
|
|
14
|
+
*/
|
|
15
|
+
export declare function h13Boundary(s: number): number;
|
|
16
|
+
/**
|
|
17
|
+
* Region 3a / Region 4 saturation boundary (Eq. 4).
|
|
18
|
+
* h'_3a(s)
|
|
19
|
+
*/
|
|
20
|
+
export declare function h3aSat(s: number): number;
|
|
21
|
+
/**
|
|
22
|
+
* Region 2ab / Region 4 saturation boundary (Eq. 5).
|
|
23
|
+
* h"_2ab(s)
|
|
24
|
+
*/
|
|
25
|
+
export declare function h2abSat(s: number): number;
|
|
26
|
+
/**
|
|
27
|
+
* Region 2c / Region 3b saturation boundary (Eq. 6).
|
|
28
|
+
* h"_2c3b(s)
|
|
29
|
+
*/
|
|
30
|
+
export declare function h2c3bSat(s: number): number;
|
|
31
|
+
/**
|
|
32
|
+
* Region 2/3 boundary temperature from h,s (Eq. 8).
|
|
33
|
+
* T_B23(h,s)
|
|
34
|
+
*/
|
|
35
|
+
export declare function tB23hs(h: number, s: number): number;
|
|
36
|
+
/**
|
|
37
|
+
* Backward equation P(h,s) for Region 2c (used for R2/R3 discrimination).
|
|
38
|
+
*/
|
|
39
|
+
export declare function backward2cPhs(h: number, s: number): number;
|
|
40
|
+
/** Share HS classification, throwing range errors only for proven envelope violations. */
|
|
41
|
+
export declare function classifyRegionHS(h: number, s: number, solved?: HSClassificationCandidate): Region | -1;
|
|
42
|
+
/**
|
|
43
|
+
* Detect the IAPWS-IF97 region for given H and S.
|
|
44
|
+
* Implements the zone-based detection from the IAPWS supplementary release.
|
|
45
|
+
*
|
|
46
|
+
* @param h - Specific enthalpy [kJ/kg]
|
|
47
|
+
* @param s - Specific entropy [kJ/(kg·K)]
|
|
48
|
+
* @returns Region number (1–5) or -1 if out of range
|
|
49
|
+
*/
|
|
50
|
+
export declare function detectRegionHS(h: number, s: number): Region | -1;
|