mozithermocalcdb-nasa 0.1.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.
Files changed (63) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +76 -0
  3. package/dist/app.d.ts +165 -0
  4. package/dist/app.d.ts.map +1 -0
  5. package/dist/core/DataExtractor.d.ts +16 -0
  6. package/dist/core/DataExtractor.d.ts.map +1 -0
  7. package/dist/core/HSG.d.ts +37 -0
  8. package/dist/core/HSG.d.ts.map +1 -0
  9. package/dist/core/HSGs.d.ts +23 -0
  10. package/dist/core/HSGs.d.ts.map +1 -0
  11. package/dist/core/Source.d.ts +17 -0
  12. package/dist/core/Source.d.ts.map +1 -0
  13. package/dist/index.browser.mjs +1571 -0
  14. package/dist/index.browser.mjs.map +1 -0
  15. package/dist/index.cjs +1626 -0
  16. package/dist/index.cjs.map +1 -0
  17. package/dist/index.d.ts +659 -0
  18. package/dist/index.d.ts.map +1 -0
  19. package/dist/index.mjs +1571 -0
  20. package/dist/index.mjs.map +1 -0
  21. package/dist/reactions/RXN.d.ts +18 -0
  22. package/dist/reactions/RXN.d.ts.map +1 -0
  23. package/dist/reactions/RXNAdapter.d.ts +38 -0
  24. package/dist/reactions/RXNAdapter.d.ts.map +1 -0
  25. package/dist/reactions/RXNAnalyzer.d.ts +106 -0
  26. package/dist/reactions/RXNAnalyzer.d.ts.map +1 -0
  27. package/dist/reactions/index.d.ts +6 -0
  28. package/dist/reactions/index.d.ts.map +1 -0
  29. package/dist/reactions/reactions.d.ts +27 -0
  30. package/dist/reactions/reactions.d.ts.map +1 -0
  31. package/dist/reactions/source.d.ts +34 -0
  32. package/dist/reactions/source.d.ts.map +1 -0
  33. package/dist/thermo/enthalpy.d.ts +41 -0
  34. package/dist/thermo/enthalpy.d.ts.map +1 -0
  35. package/dist/thermo/entropy.d.ts +41 -0
  36. package/dist/thermo/entropy.d.ts.map +1 -0
  37. package/dist/thermo/gibbs.d.ts +33 -0
  38. package/dist/thermo/gibbs.d.ts.map +1 -0
  39. package/dist/thermo/heatCapacity.d.ts +29 -0
  40. package/dist/thermo/heatCapacity.d.ts.map +1 -0
  41. package/dist/thermo/index.d.ts +5 -0
  42. package/dist/thermo/index.d.ts.map +1 -0
  43. package/dist/types/constants.d.ts +16 -0
  44. package/dist/types/constants.d.ts.map +1 -0
  45. package/dist/types/external.d.ts +52 -0
  46. package/dist/types/external.d.ts.map +1 -0
  47. package/dist/types/index.d.ts +4 -0
  48. package/dist/types/index.d.ts.map +1 -0
  49. package/dist/types/models.d.ts +38 -0
  50. package/dist/types/models.d.ts.map +1 -0
  51. package/dist/utils/component.d.ts +20 -0
  52. package/dist/utils/component.d.ts.map +1 -0
  53. package/dist/utils/conversions.d.ts +10 -0
  54. package/dist/utils/conversions.d.ts.map +1 -0
  55. package/dist/utils/index.d.ts +5 -0
  56. package/dist/utils/index.d.ts.map +1 -0
  57. package/dist/utils/mathMethods.d.ts +2 -0
  58. package/dist/utils/mathMethods.d.ts.map +1 -0
  59. package/dist/utils/tools.d.ts +22 -0
  60. package/dist/utils/tools.d.ts.map +1 -0
  61. package/dist/utils/unitConverter.d.ts +12 -0
  62. package/dist/utils/unitConverter.d.ts.map +1 -0
  63. package/package.json +59 -0
package/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2026 Sina Gilassi
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
package/README.md ADDED
@@ -0,0 +1,76 @@
1
+ # MoziThermoCalcDB-NASA
2
+
3
+ [![npm version](https://badge.fury.io/js/mozithermocalcdb-nasa.svg)](https://www.npmjs.com/package/mozithermocalcdb-nasa)
4
+ [![npm downloads](https://img.shields.io/npm/dm/mozithermocalcdb-nasa?color=brightgreen)](https://www.npmjs.com/package/mozithermocalcdb-nasa)
5
+ [![License: Apache-2.0](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
6
+
7
+ Performance-oriented notes for working with the NASA polynomial toolchain in `src/`.
8
+
9
+ ## 📥 Data ingestion
10
+
11
+ - Use the standalone `DataLoader`/`loadModelSource` script in `scripts/` to parse CSVs once into an in-memory `ModelSource`; invalid or incomplete rows are skipped early via `transformRow` validation.
12
+ - Each row is indexed under multiple ids (`Name-State`, `Formula-State`, `Name-Formula`) so lookups avoid string recomputation in hot paths.
13
+ - CSV parsing is synchronous and per-file; feed an array of `{ path, range }` objects to batch all ranges in a single pass.
14
+
15
+ ## 🔎 Lookup pipeline
16
+
17
+ - `Source` resolves a component's equation set by id and validates required coefficients before returning data.
18
+ - Range selection prefers the requested NASA window but falls back to adjacent ranges (`buildRangePreference`) to keep calculations moving when partial data exists.
19
+ - `validateRangeData` filters out records with missing or non-finite coefficients to prevent downstream math errors.
20
+
21
+ ## ♻️ Coefficient access and reuse
22
+
23
+ - `HSG` lazily extracts and caches NASA7/NASA9 coefficients on construction, avoiding repeated `Source` lookups per call.
24
+ - Required coefficients are asserted once (`requireCoeffs`); failures return `null` instead of throwing inside the compute path to keep execution cheap.
25
+ - Molecular weight is cached (`props`) so mass-basis conversions reuse the same value instead of re-reading coefficient blobs.
26
+
27
+ ## 🚀 Batch computation path
28
+
29
+ - `HSGs` builds and caches per-component `HSG` instances up front and reuses them for all property calculations.
30
+ - A single NASA range decision (`selectNasaType`) is shared across the batch in `calc_components_hsg`, reducing branching inside per-component loops.
31
+ - Reaction helpers (`RXNAdapter`) consume these batch results directly, so reaction properties reuse the already-computed component thermodynamics.
32
+
33
+ ## 🧮 Thermo kernels
34
+
35
+ - Polynomial evaluators in `src/thermo` are pure functions: they convert to Kelvin once, operate on numbers, and return `CustomProp` structs with units intact.
36
+ - Mass-basis conversions (`toMassBasis`) are applied only when explicitly requested via `basis: 'mass'`; default is molar to avoid extra work.
37
+
38
+ ## ⚙️ Usage tips for better throughput
39
+
40
+ - Load all CSVs once into a `modelSource`, then reuse a single `Source`/`HSG` or `HSGs` instance for repeated queries.
41
+ - Prefer the batch API when possible:
42
+ - Component: `H_T`, `S_T`, `G_T`, `Cp_T` for single values.
43
+ - Reaction: `dH_rxn_STD`, `dS_rxn_STD`, `dG_rxn_STD`, `Keq`, `Keq_vh_shortcut` for multi-component calculations in one pass.
44
+ - Stick to `'nasa9'` unless you need NASA7 data; NASA9 has fuller validation (b1/b2) and better range coverage in the fallback order.
45
+
46
+ ## 🧪 Examples
47
+
48
+ - Run `examples/appUsage.ts` end-to-end with `npx ts-node --esm --experimental-specifier-resolution=node examples/appUsage.ts` to load the bundled NASA9 CSVs and print species/reaction properties.
49
+ - If you adjust CSV paths or ranges, tweak the `loadExampleModelSource` call inside `examples/appUsage.ts` to match your files.
50
+
51
+ ## 📘 Minimal snippet
52
+
53
+ ```ts
54
+ import { loadModelSource } from './scripts/DataLoader';
55
+ import { H_T, dG_rxn_STD } from './src/app';
56
+
57
+ const modelSource = await loadModelSource([
58
+ { path: 'data/nasa9_range1.csv', range: 'nasa9_200_1000_K' },
59
+ { path: 'data/nasa9_range2.csv', range: 'nasa9_1000_6000_K' }
60
+ ]);
61
+
62
+ const water = { name: 'Water', formula: 'H2O', state: 'g' } as const;
63
+ const H = H_T({ component: water, temperature: { value: 900, unit: 'K' }, model_source: modelSource });
64
+
65
+ const reaction = {
66
+ name: 'water-formation-gas',
67
+ reaction: '2 H2(g) + O2(g) => 2 H2O(g)',
68
+ components: [
69
+ { name: 'Hydrogen', formula: 'H2', state: 'g' },
70
+ { name: 'Oxygen', formula: 'O2', state: 'g' },
71
+ water
72
+ ]
73
+ } as const;
74
+
75
+ const dG = dG_rxn_STD({ reaction, temperature: { value: 900, unit: 'K' }, model_source: modelSource });
76
+ ```
package/dist/app.d.ts ADDED
@@ -0,0 +1,165 @@
1
+ import { NASAType, ComponentKey, BasisType } from './types/constants';
2
+ import { Component, CustomProp, Temperature } from './types/models';
3
+ import { ModelSource, Reaction } from './types/external';
4
+ /**
5
+ * SECTION: Calculate enthalpy at given temperature for a component
6
+ * @param opts - Options object
7
+ * @param opts.component - The component to calculate enthalpy for
8
+ * @param opts.temperature - The temperature at which to calculate
9
+ * @param opts.model_source - The NASA model source data
10
+ * @param opts.component_key - Component identifier key (default: 'Name-Formula')
11
+ * @param opts.nasa_type - NASA data type to use, 'nasa7' or 'nasa9' (default: 'nasa9')
12
+ * @param opts.basis - Calculation basis, 'molar' or 'mass' (default: 'molar')
13
+ * @returns CustomProp | null - The calculated absolute enthalpy value or null if calculation fails
14
+ */
15
+ export declare function H_T(opts: {
16
+ component: Component;
17
+ temperature: Temperature;
18
+ model_source: ModelSource;
19
+ component_key?: ComponentKey;
20
+ nasa_type?: NASAType;
21
+ basis?: BasisType;
22
+ }): CustomProp | null;
23
+ /**
24
+ * SECTION: Calculate absolute entropy at given temperature for a component
25
+ * @param opts - Options object
26
+ * @param opts.component - The component to calculate entropy for
27
+ * @param opts.temperature - The temperature at which to calculate
28
+ * @param opts.model_source - The NASA model source data
29
+ * @param opts.component_key - Component identifier key (default: 'Name-Formula')
30
+ * @param opts.nasa_type - NASA data type to use, 'nasa7' or 'nasa9' (default: 'nasa9')
31
+ * @param opts.basis - Calculation basis, 'molar' or 'mass' (default: 'molar')
32
+ * @returns CustomProp | null - The calculated absolute entropy value or null if calculation fails
33
+ */
34
+ export declare function S_T(opts: {
35
+ component: Component;
36
+ temperature: Temperature;
37
+ model_source: ModelSource;
38
+ component_key?: ComponentKey;
39
+ nasa_type?: NASAType;
40
+ basis?: BasisType;
41
+ }): CustomProp | null;
42
+ /**
43
+ * SECTION: Calculate Gibbs free energy at given temperature for a component
44
+ * @param opts - Options object
45
+ * @param opts.component - The component to calculate Gibbs free energy for
46
+ * @param opts.temperature - The temperature at which to calculate
47
+ * @param opts.model_source - The NASA model source data
48
+ * @param opts.component_key - Component identifier key (default: 'Name-Formula')
49
+ * @param opts.nasa_type - NASA data type to use, 'nasa7' or 'nasa9' (default: 'nasa9')
50
+ * @param opts.basis - Calculation basis, 'molar' or 'mass' (default: 'molar')
51
+ * @returns CustomProp | null - The calculated Gibbs free energy value or null if calculation fails
52
+ */
53
+ export declare function G_T(opts: {
54
+ component: Component;
55
+ temperature: Temperature;
56
+ model_source: ModelSource;
57
+ component_key?: ComponentKey;
58
+ nasa_type?: NASAType;
59
+ basis?: BasisType;
60
+ }): CustomProp | null;
61
+ /**
62
+ * SECTION: Calculate heat capacity at constant pressure at given temperature for a component
63
+ * @param opts - Options object
64
+ * @param opts.component - The component to calculate heat capacity for
65
+ * @param opts.temperature - The temperature at which to calculate
66
+ * @param opts.model_source - The NASA model source data
67
+ * @param opts.component_key - Component identifier key (default: 'Name-Formula')
68
+ * @param opts.nasa_type - NASA data type to use, 'nasa7' or 'nasa9' (default: 'nasa9')
69
+ * @param opts.basis - Calculation basis, 'molar' or 'mass' (default: 'molar')
70
+ * @returns CustomProp | null - The calculated heat capacity value or null if calculation fails
71
+ */
72
+ export declare function Cp_T(opts: {
73
+ component: Component;
74
+ temperature: Temperature;
75
+ model_source: ModelSource;
76
+ component_key?: ComponentKey;
77
+ nasa_type?: NASAType;
78
+ basis?: BasisType;
79
+ }): CustomProp | null;
80
+ /**
81
+ * SECTION: Calculate standard Gibbs free energy of reaction at given temperature
82
+ * @param opts - Options object
83
+ * @param opts.reaction - The reaction to calculate for
84
+ * @param opts.temperature - The temperature at which to calculate
85
+ * @param opts.model_source - The NASA model source data
86
+ * @param opts.component_key - Component identifier key (default: 'Name-Formula')
87
+ * @param opts.nasa_type - NASA data type to use, 'nasa7' or 'nasa9' (default: 'nasa9')
88
+ * @returns CustomProp | null - The calculated standard Gibbs free energy of reaction or null if calculation fails
89
+ */
90
+ export declare function dG_rxn_STD(opts: {
91
+ reaction: Reaction;
92
+ temperature: Temperature;
93
+ model_source: ModelSource;
94
+ component_key?: ComponentKey;
95
+ nasa_type?: NASAType;
96
+ }): CustomProp | null;
97
+ /**
98
+ * SECTION: Calculate standard entropy of reaction at given temperature
99
+ * @param opts - Options object
100
+ * @param opts.reaction - The reaction to calculate for
101
+ * @param opts.temperature - The temperature at which to calculate
102
+ * @param opts.model_source - The NASA model source data
103
+ * @param opts.component_key - Component identifier key (default: 'Name-Formula')
104
+ * @param opts.nasa_type - NASA data type to use, 'nasa7' or 'nasa9' (default: 'nasa9')
105
+ * @returns CustomProp | null - The calculated standard entropy of reaction or null if calculation fails
106
+ */
107
+ export declare function dS_rxn_STD(opts: {
108
+ reaction: Reaction;
109
+ temperature: Temperature;
110
+ model_source: ModelSource;
111
+ component_key?: ComponentKey;
112
+ nasa_type?: NASAType;
113
+ }): CustomProp | null;
114
+ /**
115
+ * SECTION: Calculate standard enthalpy of reaction at given temperature
116
+ * @param opts - Options object
117
+ * @param opts.reaction - The reaction to calculate for
118
+ * @param opts.temperature - The temperature at which to calculate
119
+ * @param opts.model_source - The NASA model source data
120
+ * @param opts.component_key - Component identifier key (default: 'Name-Formula')
121
+ * @param opts.nasa_type - NASA data type to use, 'nasa7' or 'nasa9' (default: 'nasa9')
122
+ * @returns CustomProp | null - The calculated standard enthalpy of reaction or null if calculation fails
123
+ */
124
+ export declare function dH_rxn_STD(opts: {
125
+ reaction: Reaction;
126
+ temperature: Temperature;
127
+ model_source: ModelSource;
128
+ component_key?: ComponentKey;
129
+ nasa_type?: NASAType;
130
+ }): CustomProp | null;
131
+ /**
132
+ * SECTION: Calculate equilibrium constant at given temperature
133
+ * @param opts - Options object
134
+ * @param opts.reaction - The reaction to calculate for
135
+ * @param opts.temperature - The temperature at which to calculate
136
+ * @param opts.model_source - The NASA model source data
137
+ * @param opts.component_key - Component identifier key (default: 'Name-Formula')
138
+ * @param opts.nasa_type - NASA data type to use, 'nasa7' or 'nasa9' (default: 'nasa9')
139
+ * @returns CustomProp | null - The calculated equilibrium constant or null if calculation fails
140
+ */
141
+ export declare function Keq(opts: {
142
+ reaction: Reaction;
143
+ temperature: Temperature;
144
+ model_source: ModelSource;
145
+ component_key?: ComponentKey;
146
+ nasa_type?: NASAType;
147
+ }): CustomProp | null;
148
+ /**
149
+ * SECTION: Calculate equilibrium constant at given temperature using Van't Hoff shortcut method
150
+ * @param opts - Options object
151
+ * @param opts.reaction - The reaction to calculate for
152
+ * @param opts.temperature - The temperature at which to calculate
153
+ * @param opts.model_source - The NASA model source data
154
+ * @param opts.component_key - Component identifier key (default: 'Name-Formula')
155
+ * @param opts.nasa_type - NASA data type to use, 'nasa7' or 'nasa9' (default: 'nasa9')
156
+ * @returns CustomProp | null - The calculated equilibrium constant using Van't Hoff approximation or null if calculation fails
157
+ */
158
+ export declare function Keq_vh_shortcut(opts: {
159
+ reaction: Reaction;
160
+ temperature: Temperature;
161
+ model_source: ModelSource;
162
+ component_key?: ComponentKey;
163
+ nasa_type?: NASAType;
164
+ }): CustomProp | null;
165
+ //# sourceMappingURL=app.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../src/app.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,16 @@
1
+ import { ComponentKey } from '@/types/constants';
2
+ import { ComponentEquationSource, Source } from '@/types/external';
3
+ import { Component } from '@/types/models';
4
+ /**
5
+ * Minimal data extractor that defers to an injected Source implementation.
6
+ */
7
+ export declare class DataExtractor {
8
+ protected readonly source: Source;
9
+ constructor(source: Source);
10
+ protected _get_equation_source(opts: {
11
+ component: Component;
12
+ component_key: ComponentKey;
13
+ prop_name: string;
14
+ }): ComponentEquationSource | null;
15
+ }
16
+ //# sourceMappingURL=DataExtractor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DataExtractor.d.ts","sourceRoot":"","sources":["../../src/core/DataExtractor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,uBAAuB,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AACnE,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C;;GAEG;AACH,qBAAa,aAAa;IACZ,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,MAAM;gBAAd,MAAM,EAAE,MAAM;IAE7C,SAAS,CAAC,oBAAoB,CAAC,IAAI,EAAE;QACnC,SAAS,EAAE,SAAS,CAAC;QACrB,aAAa,EAAE,YAAY,CAAC;QAC5B,SAAS,EAAE,MAAM,CAAC;KACnB,GAAG,uBAAuB,GAAG,IAAI;CASnC"}
@@ -0,0 +1,37 @@
1
+ import { DataExtractor } from './DataExtractor';
2
+ import { BasisType, ComponentKey, NASARangeType, NASAType } from '@/types/constants';
3
+ import { Source, TemperatureRangeData } from '@/types/external';
4
+ import { Component, CustomProp, Temperature } from '@/types/models';
5
+ export declare class HSG extends DataExtractor {
6
+ componentId: string;
7
+ basis: BasisType;
8
+ component: Component;
9
+ component_key: ComponentKey;
10
+ nasa9_200_1000_coefficients?: TemperatureRangeData | null;
11
+ nasa9_1000_6000_coefficients?: TemperatureRangeData | null;
12
+ nasa9_6000_20000_coefficients?: TemperatureRangeData | null;
13
+ nasa7_200_1000_coefficients?: TemperatureRangeData | null;
14
+ nasa7_1000_6000_coefficients?: TemperatureRangeData | null;
15
+ nasa7_6000_20000_coefficients?: TemperatureRangeData | null;
16
+ private _props?;
17
+ constructor(opts: {
18
+ source: Source;
19
+ component: Component;
20
+ component_key: ComponentKey;
21
+ nasa_type: NASAType;
22
+ basis?: BasisType;
23
+ });
24
+ get props(): Record<string, number> | null | undefined;
25
+ set props(value: Record<string, number> | null | undefined);
26
+ private _extract_nasa_coefficients;
27
+ private _set_props;
28
+ private _set_nasa_coefficients;
29
+ calc_absolute_enthalpy(temperature: Temperature, nasa_type: NASARangeType): CustomProp | null;
30
+ calc_absolute_entropy(temperature: Temperature, nasa_type: NASARangeType): CustomProp | null;
31
+ calc_gibbs_free_energy(temperature: Temperature, nasa_type: NASARangeType): CustomProp | null;
32
+ calc_heat_capacity(temperature: Temperature, nasa_type: NASARangeType): CustomProp | null;
33
+ calc_absolute_enthalpy_range(temperatures: Temperature[], nasa_type: NASARangeType): CustomProp[] | null;
34
+ calc_absolute_entropy_range(temperatures: Temperature[], nasa_type: NASARangeType): CustomProp[] | null;
35
+ calc_gibbs_free_energy_range(temperatures: Temperature[], nasa_type: NASARangeType): CustomProp[] | null;
36
+ }
37
+ //# sourceMappingURL=HSG.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HSG.d.ts","sourceRoot":"","sources":["../../src/core/HSG.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAiBhD,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AACrF,OAAO,EAA2B,MAAM,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AACzF,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAMpE,qBAAa,GAAI,SAAQ,aAAa;IACpC,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,SAAS,CAAC;IACjB,SAAS,EAAE,SAAS,CAAC;IACrB,aAAa,EAAE,YAAY,CAAC;IAE5B,2BAA2B,CAAC,EAAE,oBAAoB,GAAG,IAAI,CAAC;IAC1D,4BAA4B,CAAC,EAAE,oBAAoB,GAAG,IAAI,CAAC;IAC3D,6BAA6B,CAAC,EAAE,oBAAoB,GAAG,IAAI,CAAC;IAC5D,2BAA2B,CAAC,EAAE,oBAAoB,GAAG,IAAI,CAAC;IAC1D,4BAA4B,CAAC,EAAE,oBAAoB,GAAG,IAAI,CAAC;IAC3D,6BAA6B,CAAC,EAAE,oBAAoB,GAAG,IAAI,CAAC;IAE5D,OAAO,CAAC,MAAM,CAAC,CAAgC;gBAGnC,IAAI,EAAE;QAChB,MAAM,EAAE,MAAM,CAAC;QACf,SAAS,EAAE,SAAS,CAAC;QACrB,aAAa,EAAE,YAAY,CAAC;QAC5B,SAAS,EAAE,QAAQ,CAAC;QACpB,KAAK,CAAC,EAAE,SAAS,CAAC;KACnB;IA0BD,IAAI,KAAK,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,GAAG,SAAS,CAErD;IAED,IAAI,KAAK,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,GAAG,SAAS,EAEzD;IAED,OAAO,CAAC,0BAA0B;IAYlC,OAAO,CAAC,UAAU;IASlB,OAAO,CAAC,sBAAsB;IA8C9B,sBAAsB,CAAC,WAAW,EAAE,WAAW,EAAE,SAAS,EAAE,aAAa,GAAG,UAAU,GAAG,IAAI;IAiB7F,qBAAqB,CAAC,WAAW,EAAE,WAAW,EAAE,SAAS,EAAE,aAAa,GAAG,UAAU,GAAG,IAAI;IAiB5F,sBAAsB,CAAC,WAAW,EAAE,WAAW,EAAE,SAAS,EAAE,aAAa,GAAG,UAAU,GAAG,IAAI;IAkB7F,kBAAkB,CAAC,WAAW,EAAE,WAAW,EAAE,SAAS,EAAE,aAAa,GAAG,UAAU,GAAG,IAAI;IAiBzF,4BAA4B,CAAC,YAAY,EAAE,WAAW,EAAE,EAAE,SAAS,EAAE,aAAa;IAalF,2BAA2B,CAAC,YAAY,EAAE,WAAW,EAAE,EAAE,SAAS,EAAE,aAAa;IAajF,4BAA4B,CAAC,YAAY,EAAE,WAAW,EAAE,EAAE,SAAS,EAAE,aAAa;CAQnF"}
@@ -0,0 +1,23 @@
1
+ import { HSG } from './HSG';
2
+ import { NASAType, ComponentKey } from '@/types/constants';
3
+ import { Component, CustomProp, Temperature } from '@/types/models';
4
+ import { Source } from '@/types/external';
5
+ type PropName = 'enthalpy' | 'entropy' | 'gibbs' | 'heat_capacity';
6
+ export declare class HSGs {
7
+ private readonly source;
8
+ private readonly components;
9
+ private readonly component_key;
10
+ private readonly nasa_type;
11
+ private readonly component_ids;
12
+ private readonly reaction_component_ids;
13
+ private readonly nasa_temperature_break_min;
14
+ private readonly nasa_temperature_break_max;
15
+ components_hsg: Record<string, HSG>;
16
+ constructor(source: Source, components: Component[], component_key: ComponentKey, nasa_type: NASAType);
17
+ build_components_hsg(): Record<string, HSG>;
18
+ calc_components_hsg(temperature: Temperature, prop_name: PropName, opts?: {
19
+ reaction_ids?: boolean;
20
+ }): Record<string, CustomProp> | null;
21
+ }
22
+ export {};
23
+ //# sourceMappingURL=HSGs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HSGs.d.ts","sourceRoot":"","sources":["../../src/core/HSGs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAC5B,OAAO,EAEL,QAAQ,EACR,YAAY,EAKb,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AACpE,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAK1C,KAAK,QAAQ,GAAG,UAAU,GAAG,SAAS,GAAG,OAAO,GAAG,eAAe,CAAC;AAEnE,qBAAa,IAAI;IAUb,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,UAAU;IAC3B,OAAO,CAAC,QAAQ,CAAC,aAAa;IAC9B,OAAO,CAAC,QAAQ,CAAC,SAAS;IAZ5B,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAW;IACzC,OAAO,CAAC,QAAQ,CAAC,sBAAsB,CAAyB;IAChE,OAAO,CAAC,QAAQ,CAAC,0BAA0B,CAAc;IACzD,OAAO,CAAC,QAAQ,CAAC,0BAA0B,CAAc;IAEzD,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;gBAIjB,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,SAAS,EAAE,EACvB,aAAa,EAAE,YAAY,EAC3B,SAAS,EAAE,QAAQ;IAgCtC,oBAAoB,IAAI,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IAc3C,mBAAmB,CACjB,WAAW,EAAE,WAAW,EACxB,SAAS,EAAE,QAAQ,EACnB,IAAI,CAAC,EAAE;QAAE,YAAY,CAAC,EAAE,OAAO,CAAA;KAAE,GAChC,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,GAAG,IAAI;CAuCrC"}
@@ -0,0 +1,17 @@
1
+ import { ComponentKey, NASARangeType } from '@/types/constants';
2
+ import { Component } from '@/types/models';
3
+ import { ComponentEquationSource, ModelSource, Source as SourceType } from '@/types/external';
4
+ export declare class Source implements SourceType {
5
+ readonly model_source: ModelSource;
6
+ readonly component_key: ComponentKey;
7
+ constructor(model_source: ModelSource, component_key: ComponentKey);
8
+ getDataSource(args: {
9
+ component: Component;
10
+ componentKey: ComponentKey | string;
11
+ propName: NASARangeType;
12
+ }): ComponentEquationSource | null;
13
+ private pickRange;
14
+ private buildRangePreference;
15
+ private validateRangeData;
16
+ }
17
+ //# sourceMappingURL=Source.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Source.d.ts","sourceRoot":"","sources":["../../src/core/Source.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAChE,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EACL,uBAAuB,EAEvB,WAAW,EAEX,MAAM,IAAI,UAAU,EACrB,MAAM,kBAAkB,CAAC;AAM1B,qBAAa,MAAO,YAAW,UAAU;aAEX,YAAY,EAAE,WAAW;aAAkB,aAAa,EAAE,YAAY;gBAAtE,YAAY,EAAE,WAAW,EAAkB,aAAa,EAAE,YAAY;IAGlG,aAAa,CAAC,IAAI,EAAE;QAClB,SAAS,EAAE,SAAS,CAAC;QACrB,YAAY,EAAE,YAAY,GAAG,MAAM,CAAC;QACpC,QAAQ,EAAE,aAAa,CAAC;KACzB,GAAG,uBAAuB,GAAG,IAAI;IAiClC,OAAO,CAAC,SAAS;IAejB,OAAO,CAAC,oBAAoB;IAQ5B,OAAO,CAAC,iBAAiB;CAyB1B"}