measur-tools-suite 1.1.3 → 1.1.4-beta.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 (181) hide show
  1. package/.claude/CLAUDE.md +33 -0
  2. package/.claude/projects/-Users-txr-dev-MEASUR-Tools-Suite/memory/MEMORY.md +3 -0
  3. package/.claude/projects/-Users-txr-dev-MEASUR-Tools-Suite/memory/project_compressedair_refactor.md +27 -0
  4. package/BUILD.md +61 -10
  5. package/README.md +27 -1
  6. package/bin/client.d.ts +198 -0
  7. package/bin/client.js +1 -1
  8. package/bin/client.wasm +0 -0
  9. package/bin/package.json +1 -1
  10. package/bin/ts_def_modules/binding/registered_vectors.d.ts +180 -0
  11. package/bin/ts_def_modules/compressedAir/compressedAir.d.ts +156 -0
  12. package/bin/ts_def_modules/compressedAir/compressed_air_utils.d.ts +28 -0
  13. package/bin/ts_def_modules/compressedAir/compressorsCalc.d.ts +1061 -0
  14. package/bin/ts_def_modules/compressedAir/dryer_operating_cost.d.ts +243 -0
  15. package/bin/ts_def_modules/compressedAir/leak_survey/bag_method.d.ts +51 -0
  16. package/bin/ts_def_modules/compressedAir/leak_survey/compressed_air_leak_survey.d.ts +105 -0
  17. package/bin/ts_def_modules/compressedAir/leak_survey/decibels_method.d.ts +71 -0
  18. package/bin/ts_def_modules/compressedAir/leak_survey/estimate_method.d.ts +47 -0
  19. package/bin/ts_def_modules/compressedAir/leak_survey/orifice_method.d.ts +69 -0
  20. package/bin/ts_def_modules/compressedAir/operating_cost.d.ts +63 -0
  21. package/bin/ts_def_modules/compressedAir/pipe_sizing.d.ts +53 -0
  22. package/bin/ts_def_modules/compressedAir/pneumatic_air_requirement.d.ts +86 -0
  23. package/bin/ts_def_modules/compressedAir/pneumatic_valve.d.ts +87 -0
  24. package/bin/ts_def_modules/compressedAir/receiver_tank.d.ts +217 -0
  25. package/bin/ts_def_modules/databases/default_data.d.ts +239 -0
  26. package/bin/ts_def_modules/motorDriven/fans/fan.d.ts +611 -0
  27. package/bin/ts_def_modules/motorDriven/fans/fanEnum.d.ts +68 -0
  28. package/bin/ts_def_modules/motorDriven/fans/fan_affinity_laws.d.ts +156 -0
  29. package/bin/ts_def_modules/motorDriven/motor/motor.d.ts +380 -0
  30. package/bin/ts_def_modules/motorDriven/motor/motorEnum.d.ts +49 -0
  31. package/bin/ts_def_modules/motorDriven/pump/pump.d.ts +303 -0
  32. package/bin/ts_def_modules/motorDriven/pump/pump_valve_power_loss.d.ts +73 -0
  33. package/bin/ts_def_modules/motorDriven/pumpFan/pumpFan.d.ts +164 -0
  34. package/bin/ts_def_modules/other/chp.d.ts +121 -0
  35. package/bin/ts_def_modules/other/lighting_data.d.ts +117 -0
  36. package/bin/ts_def_modules/other/powerFactor.d.ts +110 -0
  37. package/bin/ts_def_modules/physics/gas_compositions.d.ts +81 -0
  38. package/bin/ts_def_modules/processCooling/chillers.d.ts +365 -0
  39. package/bin/ts_def_modules/processCooling/process_cooling.d.ts +500 -0
  40. package/bin/ts_def_modules/processHeat/air_heating_using_exhaust.d.ts +102 -0
  41. package/bin/ts_def_modules/processHeat/cascade_heat_high_to_low.d.ts +106 -0
  42. package/bin/ts_def_modules/processHeat/energy_equivalency.d.ts +48 -0
  43. package/bin/ts_def_modules/processHeat/flow_calculations_energy_use.d.ts +58 -0
  44. package/bin/ts_def_modules/processHeat/losses/atmosphere_heat_loss.d.ts +28 -0
  45. package/bin/ts_def_modules/processHeat/losses/auxiliary_power_used.d.ts +32 -0
  46. package/bin/ts_def_modules/processHeat/losses/energy_input_electric_arc_furnace.d.ts +50 -0
  47. package/bin/ts_def_modules/processHeat/losses/energy_input_exhaust_gas_heat_loss.d.ts +95 -0
  48. package/bin/ts_def_modules/processHeat/losses/exhaust_gas_heat_loss_electric_arc_furnace.d.ts +35 -0
  49. package/bin/ts_def_modules/processHeat/losses/fixture_heat_loss.d.ts +35 -0
  50. package/bin/ts_def_modules/processHeat/losses/gas_cooling_heat_loss.d.ts +35 -0
  51. package/bin/ts_def_modules/processHeat/losses/gas_flue_gas_material.d.ts +85 -0
  52. package/bin/ts_def_modules/processHeat/losses/gas_load_charge_material_heat_required.d.ts +45 -0
  53. package/bin/ts_def_modules/processHeat/losses/leakage_heat_loss.d.ts +39 -0
  54. package/bin/ts_def_modules/processHeat/losses/liquid_cooling_heat_loss.d.ts +35 -0
  55. package/bin/ts_def_modules/processHeat/losses/liquid_load_charge_material_heat_required.d.ts +50 -0
  56. package/bin/ts_def_modules/processHeat/losses/load_charge_material.d.ts +19 -0
  57. package/bin/ts_def_modules/processHeat/losses/opening_heat_loss.d.ts +84 -0
  58. package/bin/ts_def_modules/processHeat/losses/slag_other_material_heat_loss.d.ts +35 -0
  59. package/bin/ts_def_modules/processHeat/losses/solid_liquid_flue_gas_material.d.ts +152 -0
  60. package/bin/ts_def_modules/processHeat/losses/solid_load_charge_material_heat_required.d.ts +59 -0
  61. package/bin/ts_def_modules/processHeat/losses/wall_heat_loss.d.ts +77 -0
  62. package/bin/ts_def_modules/processHeat/losses/water_cooling_heat_loss.d.ts +31 -0
  63. package/bin/ts_def_modules/processHeat/o2_enrichment.d.ts +99 -0
  64. package/bin/ts_def_modules/processHeat/water_heating_using_exhaust.d.ts +60 -0
  65. package/bin/ts_def_modules/steam/air_water_cooling_using_flue.d.ts +82 -0
  66. package/bin/ts_def_modules/steam/steam_leak_survey.d.ts +222 -0
  67. package/bin/ts_def_modules/steam/water_heating_using_flue.d.ts +126 -0
  68. package/bin/ts_def_modules/steam/water_heating_using_steam.d.ts +87 -0
  69. package/bin/ts_def_modules/steamModeler/ssmt.d.ts +738 -0
  70. package/bin/ts_def_modules/steamModeler/ssmtEnum.d.ts +81 -0
  71. package/bin/ts_def_modules/steamModeler/ssmtModeler.d.ts +700 -0
  72. package/bin/ts_def_modules/treasureHunt/compressed_air_pressure_reduction.d.ts +82 -0
  73. package/bin/ts_def_modules/treasureHunt/compressed_air_reduction.d.ts +304 -0
  74. package/bin/ts_def_modules/treasureHunt/electricity_reduction.d.ts +297 -0
  75. package/bin/ts_def_modules/treasureHunt/insulated_pipe_reduction.d.ts +255 -0
  76. package/bin/ts_def_modules/treasureHunt/insulated_tank_reduction.d.ts +168 -0
  77. package/bin/ts_def_modules/treasureHunt/natural_gas_reduction.d.ts +328 -0
  78. package/bin/ts_def_modules/treasureHunt/steam_reduction.d.ts +259 -0
  79. package/bin/ts_def_modules/treasureHunt/water_reduction.d.ts +259 -0
  80. package/bin/ts_def_modules/wasteWater/svi.d.ts +123 -0
  81. package/bin/ts_def_modules/wasteWater/wasteWater.d.ts +262 -0
  82. package/bin/ts_def_modules/water/waterAssessment.d.ts +220 -0
  83. package/build-wasm/CMakeCache.txt +362 -0
  84. package/build-wasm/Makefile +6959 -0
  85. package/build-wasm/bin/client.js +2 -0
  86. package/build-wasm/bin/client.wasm +0 -0
  87. package/build-wasm/bin/measur_tools_suite.js +2 -0
  88. package/build-wasm/bin/measur_tools_suite.wasm +0 -0
  89. package/build-wasm/cmake_install.cmake +61 -0
  90. package/contributing/documentation.md +2 -0
  91. package/docs/dependencies/mathjax-config.js +11 -0
  92. package/docs/dox-content/calculators/compressedAir/leak_survey/bag_method_calculator.dox +94 -0
  93. package/docs/dox-content/calculators/compressedAir/leak_survey/compressed_air_leak_survey_calculator.dox +244 -0
  94. package/docs/dox-content/calculators/compressedAir/leak_survey/decibels_method_calculator.dox +116 -0
  95. package/docs/dox-content/calculators/compressedAir/leak_survey/estimate_method_calculator.dox +53 -0
  96. package/docs/dox-content/calculators/compressedAir/leak_survey/orifice_method_calculator.dox +309 -0
  97. package/docs/dox-content/calculators/compressedAir/operating_cost_calculator.dox +146 -0
  98. package/docs/dox-content/calculators/compressedAir/pipe_sizing_calculator.dox +95 -0
  99. package/docs/dox-content/calculators/compressedAir/pneumatic_air_requirement_calculator.dox +168 -0
  100. package/docs/dox-content/calculators/compressedAir/pneumatic_valve_calculator.dox +105 -0
  101. package/docs/dox-content/calculators/compressedAir/receiver_tank_calculator.dox +290 -0
  102. package/docs/dox-content/calculators/treasureHunt/compressed_air_nozzle_coefficients.dox +44 -0
  103. package/docs/dox-content/calculators/treasureHunt/compressed_air_pressure_reduction_calculator.dox +26 -6
  104. package/docs/dox-content/calculators/treasureHunt/compressed_air_reduction_calculator.dox +176 -0
  105. package/docs/dox-content/calculators/treasureHunt/insulated_pipe_reduction_calculator.dox +316 -0
  106. package/docs/dox-content/calculators/treasureHunt/insulated_tank_reduction_calculator.dox +272 -0
  107. package/package.json +1 -1
  108. package/ts_def/client.d.ts +198 -0
  109. package/ts_def/ts_def_modules/binding/registered_vectors.d.ts +180 -0
  110. package/ts_def/ts_def_modules/compressedAir/compressedAir.d.ts +156 -0
  111. package/ts_def/ts_def_modules/compressedAir/compressed_air_utils.d.ts +28 -0
  112. package/ts_def/ts_def_modules/compressedAir/compressorsCalc.d.ts +1061 -0
  113. package/ts_def/ts_def_modules/compressedAir/dryer_operating_cost.d.ts +243 -0
  114. package/ts_def/ts_def_modules/compressedAir/leak_survey/bag_method.d.ts +51 -0
  115. package/ts_def/ts_def_modules/compressedAir/leak_survey/compressed_air_leak_survey.d.ts +105 -0
  116. package/ts_def/ts_def_modules/compressedAir/leak_survey/decibels_method.d.ts +71 -0
  117. package/ts_def/ts_def_modules/compressedAir/leak_survey/estimate_method.d.ts +47 -0
  118. package/ts_def/ts_def_modules/compressedAir/leak_survey/orifice_method.d.ts +69 -0
  119. package/ts_def/ts_def_modules/compressedAir/operating_cost.d.ts +63 -0
  120. package/ts_def/ts_def_modules/compressedAir/pipe_sizing.d.ts +53 -0
  121. package/ts_def/ts_def_modules/compressedAir/pneumatic_air_requirement.d.ts +86 -0
  122. package/ts_def/ts_def_modules/compressedAir/pneumatic_valve.d.ts +87 -0
  123. package/ts_def/ts_def_modules/compressedAir/receiver_tank.d.ts +217 -0
  124. package/ts_def/ts_def_modules/databases/default_data.d.ts +239 -0
  125. package/ts_def/ts_def_modules/motorDriven/fans/fan.d.ts +611 -0
  126. package/ts_def/ts_def_modules/motorDriven/fans/fanEnum.d.ts +68 -0
  127. package/ts_def/ts_def_modules/motorDriven/fans/fan_affinity_laws.d.ts +156 -0
  128. package/ts_def/ts_def_modules/motorDriven/motor/motor.d.ts +380 -0
  129. package/ts_def/ts_def_modules/motorDriven/motor/motorEnum.d.ts +49 -0
  130. package/ts_def/ts_def_modules/motorDriven/pump/pump.d.ts +303 -0
  131. package/ts_def/ts_def_modules/motorDriven/pump/pump_valve_power_loss.d.ts +73 -0
  132. package/ts_def/ts_def_modules/motorDriven/pumpFan/pumpFan.d.ts +164 -0
  133. package/ts_def/ts_def_modules/other/chp.d.ts +121 -0
  134. package/ts_def/ts_def_modules/other/lighting_data.d.ts +117 -0
  135. package/ts_def/ts_def_modules/other/powerFactor.d.ts +110 -0
  136. package/ts_def/ts_def_modules/physics/gas_compositions.d.ts +81 -0
  137. package/ts_def/ts_def_modules/processCooling/chillers.d.ts +365 -0
  138. package/ts_def/ts_def_modules/processCooling/process_cooling.d.ts +500 -0
  139. package/ts_def/ts_def_modules/processHeat/air_heating_using_exhaust.d.ts +102 -0
  140. package/ts_def/ts_def_modules/processHeat/cascade_heat_high_to_low.d.ts +106 -0
  141. package/ts_def/ts_def_modules/processHeat/energy_equivalency.d.ts +48 -0
  142. package/ts_def/ts_def_modules/processHeat/flow_calculations_energy_use.d.ts +58 -0
  143. package/ts_def/ts_def_modules/processHeat/losses/atmosphere_heat_loss.d.ts +28 -0
  144. package/ts_def/ts_def_modules/processHeat/losses/auxiliary_power_used.d.ts +32 -0
  145. package/ts_def/ts_def_modules/processHeat/losses/energy_input_electric_arc_furnace.d.ts +50 -0
  146. package/ts_def/ts_def_modules/processHeat/losses/energy_input_exhaust_gas_heat_loss.d.ts +95 -0
  147. package/ts_def/ts_def_modules/processHeat/losses/exhaust_gas_heat_loss_electric_arc_furnace.d.ts +35 -0
  148. package/ts_def/ts_def_modules/processHeat/losses/fixture_heat_loss.d.ts +35 -0
  149. package/ts_def/ts_def_modules/processHeat/losses/gas_cooling_heat_loss.d.ts +35 -0
  150. package/ts_def/ts_def_modules/processHeat/losses/gas_flue_gas_material.d.ts +85 -0
  151. package/ts_def/ts_def_modules/processHeat/losses/gas_load_charge_material_heat_required.d.ts +45 -0
  152. package/ts_def/ts_def_modules/processHeat/losses/leakage_heat_loss.d.ts +39 -0
  153. package/ts_def/ts_def_modules/processHeat/losses/liquid_cooling_heat_loss.d.ts +35 -0
  154. package/ts_def/ts_def_modules/processHeat/losses/liquid_load_charge_material_heat_required.d.ts +50 -0
  155. package/ts_def/ts_def_modules/processHeat/losses/load_charge_material.d.ts +19 -0
  156. package/ts_def/ts_def_modules/processHeat/losses/opening_heat_loss.d.ts +84 -0
  157. package/ts_def/ts_def_modules/processHeat/losses/slag_other_material_heat_loss.d.ts +35 -0
  158. package/ts_def/ts_def_modules/processHeat/losses/solid_liquid_flue_gas_material.d.ts +152 -0
  159. package/ts_def/ts_def_modules/processHeat/losses/solid_load_charge_material_heat_required.d.ts +59 -0
  160. package/ts_def/ts_def_modules/processHeat/losses/wall_heat_loss.d.ts +77 -0
  161. package/ts_def/ts_def_modules/processHeat/losses/water_cooling_heat_loss.d.ts +31 -0
  162. package/ts_def/ts_def_modules/processHeat/o2_enrichment.d.ts +99 -0
  163. package/ts_def/ts_def_modules/processHeat/water_heating_using_exhaust.d.ts +60 -0
  164. package/ts_def/ts_def_modules/steam/air_water_cooling_using_flue.d.ts +82 -0
  165. package/ts_def/ts_def_modules/steam/steam_leak_survey.d.ts +222 -0
  166. package/ts_def/ts_def_modules/steam/water_heating_using_flue.d.ts +126 -0
  167. package/ts_def/ts_def_modules/steam/water_heating_using_steam.d.ts +87 -0
  168. package/ts_def/ts_def_modules/steamModeler/ssmt.d.ts +738 -0
  169. package/ts_def/ts_def_modules/steamModeler/ssmtEnum.d.ts +81 -0
  170. package/ts_def/ts_def_modules/steamModeler/ssmtModeler.d.ts +700 -0
  171. package/ts_def/ts_def_modules/treasureHunt/compressed_air_pressure_reduction.d.ts +82 -0
  172. package/ts_def/ts_def_modules/treasureHunt/compressed_air_reduction.d.ts +304 -0
  173. package/ts_def/ts_def_modules/treasureHunt/electricity_reduction.d.ts +297 -0
  174. package/ts_def/ts_def_modules/treasureHunt/insulated_pipe_reduction.d.ts +255 -0
  175. package/ts_def/ts_def_modules/treasureHunt/insulated_tank_reduction.d.ts +168 -0
  176. package/ts_def/ts_def_modules/treasureHunt/natural_gas_reduction.d.ts +328 -0
  177. package/ts_def/ts_def_modules/treasureHunt/steam_reduction.d.ts +259 -0
  178. package/ts_def/ts_def_modules/treasureHunt/water_reduction.d.ts +259 -0
  179. package/ts_def/ts_def_modules/wasteWater/svi.d.ts +123 -0
  180. package/ts_def/ts_def_modules/wasteWater/wasteWater.d.ts +262 -0
  181. package/ts_def/ts_def_modules/water/waterAssessment.d.ts +220 -0
@@ -0,0 +1,33 @@
1
+ # Project Memory
2
+
3
+ When generating code, always follow the coding standards and conventions in the [Style Guide](../contributing/style-guide.md). When documenting code, always follow the documentation standards in [Documentation](../contributing/documentation.md). If either linked file is not available in context, ask the user to provide it before proceeding.
4
+
5
+ When tasked to refactor code using namespaces, follow these phases in order. In all phases, maintain a **one file per logical module** rule: each .h/.cpp pair produces exactly one corresponding binding file, one C++ test file, and one wasm test file.
6
+
7
+ **Phase 1 — Headers and Source**
8
+ Update the .h and .cpp files to reflect the new structure.
9
+
10
+ **Phase 2 — WebAssembly Bindings**
11
+ For each .h/.cpp pair, create or update exactly one binding file in bindings-wasm/ (one binding file per logical module, matching its .h and .cpp filenames). If no existing binding file exists for a given pair, create one from scratch following the structure used in processHeat/bindings-wasm/.
12
+
13
+ **Phase 3 — C++ Unit Tests**
14
+ Update the .cpp unit tests in tests/cpp to reflect the new structure. Each .cpp file must have its own dedicated test file. If an existing test file covers multiple classes that are being split into separate .cpp files, split the test file accordingly.
15
+
16
+ **Phase 4 — WebAssembly Unit Tests**
17
+ Update or add a unit test in tests/wasm-mocha for each binding file (one test file per binding file). Move old unit tests from tests/wasm to tests/wasm-mocha and update them to reflect the new structure. Once a test has been successfully migrated, delete the original file from tests/wasm.
18
+
19
+ **Phase 5 — Documentation**
20
+ Update the documentation in the docs/dox-content directory. Organize the content logically following the pattern that has already been established.
21
+
22
+ **Reference example:** refer to processHeat/ as the canonical example of how to structure the code, WebAssembly bindings, unit tests, and documentation.
23
+
24
+ **Checklist (verify before finishing):**
25
+ - [ ] Phase 1: All .h and .cpp files updated
26
+ - [ ] Phase 2: One binding file per .h/.cpp pair; new files created where none existed
27
+ - [ ] Phase 3: One C++ test file per .cpp file; split if needed
28
+ - [ ] Phase 4: One wasm test file per binding file; old tests/wasm files migrated and deleted
29
+ - [ ] Phase 5: Documentation updated and organized
30
+
31
+ ## Context
32
+
33
+ The MEASUR Tools Suite is a collection of industrial efficiency calculations written in C++ with WebAssembly bindings for browser and Node.js environments. The suite provides computational engines for the [MEASUR](https://github.com/ORNL-AMO/AMO-Tools-Desktop) (Manufacturing Energy Assessment Suite for Utility Reduction) application ecosystem.
@@ -0,0 +1,3 @@
1
+ # Memory Index
2
+
3
+ - [CompressedAir namespace refactoring progress](project_compressedair_refactor.md) — tracks which compressedAir calculators are refactored; compressed_air_leak_survey done 2026-05-29
@@ -0,0 +1,27 @@
1
+ ---
2
+ name: CompressedAir namespace refactoring progress
3
+ description: Tracks which compressedAir calculators have been refactored to namespace pattern with docs
4
+ type: project
5
+ ---
6
+
7
+ Progress on refactoring compressedAir calculators to the namespace pattern (free functions, snake_case structs, full doxygen docs, value_object wasm bindings, dox documentation).
8
+
9
+ **Completed:**
10
+ - `bag_method` — done 2026-05-27
11
+ - `decibels_method` — done (pre-existing)
12
+ - `estimate_method` — done (pre-existing)
13
+ - `orifice_method` — done (pre-existing)
14
+ - `receiver_tank` — done (pre-existing)
15
+ - `compressed_air_leak_survey` — done 2026-05-29
16
+ - New `include/compressedAir/compressed_air_leak_survey.h` (namespace + enums + full doxygen)
17
+ - New `src/compressedAir/compressed_air_leak_survey.cpp`
18
+ - New `bindings-wasm/compressedAir/compressed_air_leak_survey.cpp` (value_object pattern)
19
+ - Old `bindings-wasm/compressedAir/compressedAirLeakSurvey.cpp` → deleted
20
+ - New `tests/cpp/compressedAir/compressed_air_leak_survey.unit.cpp`
21
+ - Old `tests/cpp/compressedAir/CompressedAirLeakSurvey.unit.cpp` → deleted
22
+ - Updated `tests/wasm-mocha/compressedAir/wasm_compressed_air_leak_survey.test.js`
23
+ - New `docs/dox-content/calculators/compressedAir/compressed_air_leak_survey_calculator.dox`
24
+
25
+ **Why:** Namespace pattern improves readability, enables auto-generated API docs, and makes the codebase consistent for the MEASUR Tools Suite.
26
+
27
+ **How to apply:** When continuing refactoring, check this list to avoid duplicating completed work.
package/BUILD.md CHANGED
@@ -67,11 +67,12 @@ Install only what you need for the scenario you plan to use.
67
67
 
68
68
  ## 4. CMake Options
69
69
 
70
- | Option | Default | Purpose |
71
- | --------------- | ------- | ----------------------------------- |
72
- | `BUILD_TESTING` | ON | Build C++ unit tests (`cpp_tests`) |
73
- | `BUILD_WASM` | OFF | Build WebAssembly module (`client`) |
74
- | `BUILD_PACKAGE` | OFF | Enable install + packaging targets |
70
+ | Option | Default | Purpose |
71
+ | ------------------------ | ------- | -------------------------------------------------------------------- |
72
+ | `BUILD_TESTING` | ON | Build C++ unit tests (`cpp_tests`) |
73
+ | `BUILD_WASM` | OFF | Build WebAssembly module (`client`) |
74
+ | `BUILD_PACKAGE` | OFF | Enable install + packaging targets |
75
+ | `STEAM_MODELER_LOGGING` | 0 | Enable verbose SteamModeler debug output (see [§10](#10-steammodeler-debug-logging)) |
75
76
 
76
77
  Mutually influential behavior:
77
78
  - When `BUILD_WASM=ON` the build disables `BUILD_TESTING` & `BUILD_PACKAGE` internally (see `CMakeLists.txt`). Toggle intentionally—do not expect tests with WASM in a single configure.
@@ -178,17 +179,26 @@ Artifacts appear under `bin/`
178
179
 
179
180
  ### 6.5 WebAssembly Usage Example
180
181
 
181
- ```js
182
- // Initialize module
183
- const moduleFactory = (await import('/path/to/client.js')).default;
184
- const toolsSuiteModule = await moduleFactory({
182
+ ```ts
183
+ import createModule, { type MeasurToolsSuite } from 'measur-tools-suite';
184
+
185
+ const toolsSuiteModule: MeasurToolsSuite = await createModule({
185
186
  locateFile: (filename) => '/path/to/client.wasm'
186
187
  });
187
188
 
188
- // Example call
189
+ // Example 1: wallTotalHeatLoss — returns a number directly
189
190
  const totalHeatLoss = toolsSuiteModule.wallTotalHeatLoss(
190
191
  500, 80, 225, 10, 0.9, 1.394, 1
191
192
  );
193
+ console.log('Wall total heat loss:', totalHeatLoss);
194
+
195
+ // Example 2: DryerOperatingCost — class-based API
196
+ // Always call delete() on class instances and output objects to free WASM memory
197
+ const doc = new toolsSuiteModule.DryerOperatingCost(1752, 50, 100, 24, 7, 52, 0.08, 0.2, 0.25);
198
+ const res = doc.calculate(toolsSuiteModule.DryerType.Heatless);
199
+ console.log('DryerOperatingCost => Water removed:', res.waterRemoved);
200
+ res.delete();
201
+ doc.delete();
192
202
  ```
193
203
 
194
204
  ### 6.6 WebAssembly Tests (Browser)
@@ -437,4 +447,45 @@ docker compose down
437
447
 
438
448
  ---
439
449
 
450
+ ## 10. SteamModeler Debug Logging
451
+
452
+ The SteamModeler and all of its supporting classes include verbose debug logging that is **disabled by default** so it never appears in production or WebAssembly builds.
453
+
454
+ The toggle lives in a single header: `include/steamModeler/util/SteamModelerLogger.h`
455
+
456
+ ```cpp
457
+ #ifndef STEAM_MODELER_LOGGING
458
+ #define STEAM_MODELER_LOGGING 0 // 0 = silent (default), 1 = verbose
459
+ #endif
460
+ ```
461
+
462
+ ### Enabling logging
463
+
464
+ **Option A — Edit the header (local debug session)**
465
+
466
+ Change the define to `1` and rebuild:
467
+
468
+ ```cpp
469
+ #define STEAM_MODELER_LOGGING 1
470
+ ```
471
+
472
+ **Option B — Compiler flag (no source changes required)**
473
+
474
+ Pass the flag at configure time:
475
+
476
+ ```bash
477
+ cmake -S . -B build-cpp -DSTEAM_MODELER_LOGGING=1
478
+ cmake --build build-cpp
479
+ ```
480
+
481
+ Or directly via the compiler (without CMake):
482
+
483
+ ```bash
484
+ make CXXFLAGS="-DSTEAM_MODELER_LOGGING=1"
485
+ ```
486
+
487
+ > **Note:** Always revert to `0` (or remove the flag) before building the WASM module for production. Debug output through `std::cout` is visible in the browser DevTools console when `STEAM_MODELER_LOGGING=1` is set in a WASM build.
488
+
489
+ ---
490
+
440
491
  If any scenario you need is missing here, open an issue or submit a PR to extend this guide.
package/README.md CHANGED
@@ -25,6 +25,8 @@ Check out the [Master List of MEASUR Calculators](https://github.com/ORNL-AMO/AM
25
25
  npm install measur-tools-suite
26
26
  ```
27
27
 
28
+ **JavaScript**
29
+
28
30
  ```js
29
31
  // Initialize module
30
32
  const moduleFactory = (await import('/path/to/client.js')).default;
@@ -32,10 +34,34 @@ const toolsSuiteModule = await moduleFactory({
32
34
  locateFile: (filename) => '/path/to/client.wasm'
33
35
  });
34
36
 
35
- // Example call
37
+ // Plain function call — returns a number directly
36
38
  const totalHeatLoss = toolsSuiteModule.wallTotalHeatLoss(
37
39
  500, 80, 225, 10, 0.9, 1.394, 1
38
40
  );
41
+ console.log('Wall total heat loss:', totalHeatLoss);
42
+
43
+ // Class-based API — always call delete() to free WASM memory
44
+ const doc = new toolsSuiteModule.DryerOperatingCost(1752, 50, 100, 24, 7, 52, 0.08, 0.2, 0.25);
45
+ const res = doc.calculate(toolsSuiteModule.DryerType.Heatless);
46
+ console.log('Water removed:', res.waterRemoved);
47
+ res.delete();
48
+ doc.delete();
49
+ ```
50
+
51
+ **TypeScript** — `MeasurToolsSuite` is the fully-typed module instance; no casts needed.
52
+
53
+ ```ts
54
+ import createModule, { type MeasurToolsSuite } from 'measur-tools-suite';
55
+
56
+ const toolsSuiteModule: MeasurToolsSuite = await createModule({
57
+ locateFile: (filename) => '/path/to/client.wasm'
58
+ });
59
+
60
+ const doc = new toolsSuiteModule.DryerOperatingCost(1752, 50, 100, 24, 7, 52, 0.08, 0.2, 0.25);
61
+ const res = doc.calculate(toolsSuiteModule.DryerType.Heatless);
62
+ console.log('Water removed:', res.waterRemoved);
63
+ res.delete();
64
+ doc.delete();
39
65
  ```
40
66
 
41
67
  ### Building from Source
@@ -0,0 +1,198 @@
1
+ export * from "./ts_def_modules/binding/registered_vectors";
2
+
3
+ export * from "./ts_def_modules/compressedAir/compressedAir";
4
+ export * from "./ts_def_modules/compressedAir/compressed_air_utils";
5
+ export * from "./ts_def_modules/compressedAir/compressorsCalc";
6
+ export * from "./ts_def_modules/compressedAir/dryer_operating_cost";
7
+ export * from "./ts_def_modules/compressedAir/operating_cost";
8
+ export * from "./ts_def_modules/compressedAir/pipe_sizing";
9
+ export * from "./ts_def_modules/compressedAir/pneumatic_air_requirement";
10
+ export * from "./ts_def_modules/compressedAir/pneumatic_valve";
11
+ export * from "./ts_def_modules/compressedAir/receiver_tank";
12
+
13
+ export * from "./ts_def_modules/compressedAir/leak_survey/bag_method";
14
+ export * from "./ts_def_modules/compressedAir/leak_survey/compressed_air_leak_survey";
15
+ export * from "./ts_def_modules/compressedAir/leak_survey/decibels_method";
16
+ export * from "./ts_def_modules/compressedAir/leak_survey/estimate_method";
17
+ export * from "./ts_def_modules/compressedAir/leak_survey/orifice_method";
18
+
19
+ export * from "./ts_def_modules/databases/default_data";
20
+
21
+ export * from "./ts_def_modules/motorDriven/fans/fan";
22
+ export * from "./ts_def_modules/motorDriven/fans/fanEnum";
23
+ export * from "./ts_def_modules/motorDriven/fans/fan_affinity_laws";
24
+
25
+ export * from "./ts_def_modules/motorDriven/motor/motor";
26
+ export * from "./ts_def_modules/motorDriven/motor/motorEnum";
27
+
28
+ export * from "./ts_def_modules/motorDriven/pump/pump";
29
+ export * from "./ts_def_modules/motorDriven/pump/pump_valve_power_loss";
30
+
31
+ export * from "./ts_def_modules/motorDriven/pumpFan/pumpFan";
32
+
33
+ export * from "./ts_def_modules/other/chp";
34
+ export * from "./ts_def_modules/other/lighting_data";
35
+ export * from "./ts_def_modules/other/powerFactor";
36
+
37
+ export * from "./ts_def_modules/physics/gas_compositions";
38
+
39
+ export * from "./ts_def_modules/processCooling/chillers";
40
+ export * from "./ts_def_modules/processCooling/process_cooling";
41
+
42
+ export * from "./ts_def_modules/processHeat/air_heating_using_exhaust";
43
+ export * from "./ts_def_modules/processHeat/cascade_heat_high_to_low";
44
+ export * from "./ts_def_modules/processHeat/energy_equivalency";
45
+ export * from "./ts_def_modules/processHeat/flow_calculations_energy_use";
46
+ export * from "./ts_def_modules/processHeat/o2_enrichment";
47
+ export * from "./ts_def_modules/processHeat/water_heating_using_exhaust";
48
+
49
+ export * from "./ts_def_modules/processHeat/losses/atmosphere_heat_loss";
50
+ export * from "./ts_def_modules/processHeat/losses/auxiliary_power_used";
51
+ export * from "./ts_def_modules/processHeat/losses/energy_input_electric_arc_furnace";
52
+ export * from "./ts_def_modules/processHeat/losses/energy_input_exhaust_gas_heat_loss";
53
+ export * from "./ts_def_modules/processHeat/losses/exhaust_gas_heat_loss_electric_arc_furnace";
54
+ export * from "./ts_def_modules/processHeat/losses/fixture_heat_loss";
55
+ export * from "./ts_def_modules/processHeat/losses/gas_cooling_heat_loss";
56
+ export * from "./ts_def_modules/processHeat/losses/gas_flue_gas_material";
57
+ export * from "./ts_def_modules/processHeat/losses/gas_load_charge_material_heat_required";
58
+ export * from "./ts_def_modules/processHeat/losses/leakage_heat_loss";
59
+ export * from "./ts_def_modules/processHeat/losses/liquid_cooling_heat_loss";
60
+ export * from "./ts_def_modules/processHeat/losses/liquid_load_charge_material_heat_required";
61
+ export * from "./ts_def_modules/processHeat/losses/load_charge_material";
62
+ export * from "./ts_def_modules/processHeat/losses/opening_heat_loss";
63
+ export * from "./ts_def_modules/processHeat/losses/slag_other_material_heat_loss";
64
+ export * from "./ts_def_modules/processHeat/losses/solid_liquid_flue_gas_material";
65
+ export * from "./ts_def_modules/processHeat/losses/solid_load_charge_material_heat_required";
66
+ export * from "./ts_def_modules/processHeat/losses/wall_heat_loss";
67
+ export * from "./ts_def_modules/processHeat/losses/water_cooling_heat_loss";
68
+
69
+ export * from "./ts_def_modules/steam/air_water_cooling_using_flue";
70
+ export * from "./ts_def_modules/steam/steam_leak_survey";
71
+ export * from "./ts_def_modules/steam/water_heating_using_flue";
72
+ export * from "./ts_def_modules/steam/water_heating_using_steam";
73
+
74
+ export * from "./ts_def_modules/steamModeler/ssmt";
75
+ export * from "./ts_def_modules/steamModeler/ssmtEnum";
76
+ export * from "./ts_def_modules/steamModeler/ssmtModeler";
77
+
78
+ export * from "./ts_def_modules/treasureHunt/compressed_air_pressure_reduction";
79
+ export * from "./ts_def_modules/treasureHunt/compressed_air_reduction";
80
+ export * from "./ts_def_modules/treasureHunt/electricity_reduction";
81
+ export * from "./ts_def_modules/treasureHunt/insulated_pipe_reduction";
82
+ export * from "./ts_def_modules/treasureHunt/insulated_tank_reduction";
83
+ export * from "./ts_def_modules/treasureHunt/natural_gas_reduction";
84
+ export * from "./ts_def_modules/treasureHunt/steam_reduction";
85
+ export * from "./ts_def_modules/treasureHunt/water_reduction";
86
+
87
+ export * from "./ts_def_modules/wasteWater/svi";
88
+ export * from "./ts_def_modules/wasteWater/wasteWater";
89
+
90
+ export * from "./ts_def_modules/water/waterAssessment";
91
+
92
+ /**
93
+ * Represents the fully-initialized MEASUR Tools Suite WebAssembly module instance.
94
+ * This is the intersection of all sub-module types, giving full typed access to every
95
+ * calculator, class, and enum exposed by the WASM bindings.
96
+ *
97
+ * Use this type to annotate the result of the module factory without any casting:
98
+ * @example
99
+ * ```ts
100
+ * import createModule, { type MeasurToolsSuite } from 'measur-tools-suite';
101
+ * const m: MeasurToolsSuite = await createModule({ locateFile: (f) => `/wasm/${f}` });
102
+ * ```
103
+ */
104
+ export type MeasurToolsSuite =
105
+ // binding
106
+ import("./ts_def_modules/binding/registered_vectors").RegisteredVectorsModule &
107
+ // compressedAir
108
+ import("./ts_def_modules/compressedAir/compressedAir").CompressedAirModule &
109
+ import("./ts_def_modules/compressedAir/compressed_air_utils").CompressedAirUtilsModule &
110
+ import("./ts_def_modules/compressedAir/compressorsCalc").CompressorsCalcModule &
111
+ import("./ts_def_modules/compressedAir/dryer_operating_cost").DryerOperatingCostModule &
112
+ import("./ts_def_modules/compressedAir/operating_cost").OperatingCostModule &
113
+ import("./ts_def_modules/compressedAir/pipe_sizing").PipeSizingModule &
114
+ import("./ts_def_modules/compressedAir/pneumatic_air_requirement").PneumaticAirRequirementModule &
115
+ import("./ts_def_modules/compressedAir/pneumatic_valve").PneumaticValveModule &
116
+ import("./ts_def_modules/compressedAir/receiver_tank").ReceiverTankModule &
117
+ // compressedAir/leak_survey
118
+ import("./ts_def_modules/compressedAir/leak_survey/bag_method").BagMethodModule &
119
+ import("./ts_def_modules/compressedAir/leak_survey/compressed_air_leak_survey").CompressedAirLeakSurveyModule &
120
+ import("./ts_def_modules/compressedAir/leak_survey/decibels_method").DecibelsMethodModule &
121
+ import("./ts_def_modules/compressedAir/leak_survey/estimate_method").EstimateMethodModule &
122
+ import("./ts_def_modules/compressedAir/leak_survey/orifice_method").OrificeMethodModule &
123
+ // databases
124
+ import("./ts_def_modules/databases/default_data").DefaultDataModule &
125
+ // motorDriven/fans
126
+ import("./ts_def_modules/motorDriven/fans/fan_affinity_laws").FanAffinityLawsModule &
127
+ import("./ts_def_modules/motorDriven/fans/fanEnum").FanEnumModule &
128
+ import("./ts_def_modules/motorDriven/fans/fan").FanModule &
129
+ // motorDriven/motor
130
+ import("./ts_def_modules/motorDriven/motor/motorEnum").MotorEnumModule &
131
+ import("./ts_def_modules/motorDriven/motor/motor").MotorModule &
132
+ // motorDriven/pump
133
+ import("./ts_def_modules/motorDriven/pump/pump").PumpModule &
134
+ import("./ts_def_modules/motorDriven/pump/pump_valve_power_loss").PumpValvePowerLossModule &
135
+ // motorDriven/pumpFan
136
+ import("./ts_def_modules/motorDriven/pumpFan/pumpFan").PumpFanModule &
137
+ // other
138
+ import("./ts_def_modules/other/chp").ChpModule &
139
+ import("./ts_def_modules/other/lighting_data").LightingDataModule &
140
+ import("./ts_def_modules/other/powerFactor").PowerFactorModule &
141
+ // physics
142
+ import("./ts_def_modules/physics/gas_compositions").GasCompositionsModule &
143
+ // processCooling
144
+ import("./ts_def_modules/processCooling/chillers").ChillersModule &
145
+ import("./ts_def_modules/processCooling/process_cooling").ProcessCoolingModule &
146
+ // processHeat
147
+ import("./ts_def_modules/processHeat/air_heating_using_exhaust").AirHeatingUsingExhaustModule &
148
+ import("./ts_def_modules/processHeat/cascade_heat_high_to_low").CascadeHeatHighToLowModule &
149
+ import("./ts_def_modules/processHeat/energy_equivalency").EnergyEquivalencyModule &
150
+ import("./ts_def_modules/processHeat/flow_calculations_energy_use").FlowCalculationsEnergyUseModule &
151
+ import("./ts_def_modules/processHeat/o2_enrichment").O2EnrichmentModule &
152
+ import("./ts_def_modules/processHeat/water_heating_using_exhaust").WaterHeatingUsingExhaustModule &
153
+ // processHeat/losses
154
+ import("./ts_def_modules/processHeat/losses/atmosphere_heat_loss").AtmosphereHeatLossModule &
155
+ import("./ts_def_modules/processHeat/losses/auxiliary_power_used").AuxiliaryPowerUsedModule &
156
+ import("./ts_def_modules/processHeat/losses/energy_input_electric_arc_furnace").EnergyInputElectricArcFurnaceModule &
157
+ import("./ts_def_modules/processHeat/losses/energy_input_exhaust_gas_heat_loss").EnergyInputExhaustGasHeatLossModule &
158
+ import("./ts_def_modules/processHeat/losses/exhaust_gas_heat_loss_electric_arc_furnace").ExhaustGasHeatLossElectricArcFurnaceModule &
159
+ import("./ts_def_modules/processHeat/losses/fixture_heat_loss").FixtureHeatLossModule &
160
+ import("./ts_def_modules/processHeat/losses/gas_cooling_heat_loss").GasCoolingHeatLossModule &
161
+ import("./ts_def_modules/processHeat/losses/gas_flue_gas_material").GasFlueGasMaterialModule &
162
+ import("./ts_def_modules/processHeat/losses/gas_load_charge_material_heat_required").GasLoadChargeMaterialHeatRequiredModule &
163
+ import("./ts_def_modules/processHeat/losses/leakage_heat_loss").LeakageHeatLossModule &
164
+ import("./ts_def_modules/processHeat/losses/liquid_cooling_heat_loss").LiquidCoolingHeatLossModule &
165
+ import("./ts_def_modules/processHeat/losses/liquid_load_charge_material_heat_required").LiquidLoadChargeMaterialHeatRequiredModule &
166
+ import("./ts_def_modules/processHeat/losses/load_charge_material").LoadChargeMaterialModule &
167
+ import("./ts_def_modules/processHeat/losses/opening_heat_loss").OpeningHeatLossModule &
168
+ import("./ts_def_modules/processHeat/losses/slag_other_material_heat_loss").SlagOtherMaterialHeatLossModule &
169
+ import("./ts_def_modules/processHeat/losses/solid_liquid_flue_gas_material").SolidLiquidFlueGasMaterialModule &
170
+ import("./ts_def_modules/processHeat/losses/solid_load_charge_material_heat_required").SolidLoadChargeMaterialHeatRequiredModule &
171
+ import("./ts_def_modules/processHeat/losses/wall_heat_loss").WallHeatLossModule &
172
+ import("./ts_def_modules/processHeat/losses/water_cooling_heat_loss").WaterCoolingHeatLossModule &
173
+ // steam
174
+ import("./ts_def_modules/steam/air_water_cooling_using_flue").AirWaterCoolingUsingFlueModule &
175
+ import("./ts_def_modules/steam/steam_leak_survey").SteamLeakSurveyModule &
176
+ import("./ts_def_modules/steam/water_heating_using_flue").WaterHeatingUsingFlueModule &
177
+ import("./ts_def_modules/steam/water_heating_using_steam").WaterHeatingUsingSteamModule &
178
+ // steamModeler
179
+ import("./ts_def_modules/steamModeler/ssmtEnum").SsmtEnumModule &
180
+ import("./ts_def_modules/steamModeler/ssmt").SsmtModule &
181
+ import("./ts_def_modules/steamModeler/ssmtModeler").SsmtModelerModule &
182
+ // treasureHunt
183
+ import("./ts_def_modules/treasureHunt/compressed_air_pressure_reduction").CompressedAirPressureReductionModule &
184
+ import("./ts_def_modules/treasureHunt/compressed_air_reduction").CompressedAirReductionModule &
185
+ import("./ts_def_modules/treasureHunt/electricity_reduction").ElectricityReductionModule &
186
+ import("./ts_def_modules/treasureHunt/insulated_pipe_reduction").InsulatedPipeReductionModule &
187
+ import("./ts_def_modules/treasureHunt/insulated_tank_reduction").InsulatedTankReductionModule &
188
+ import("./ts_def_modules/treasureHunt/natural_gas_reduction").NaturalGasReductionModule &
189
+ import("./ts_def_modules/treasureHunt/steam_reduction").SteamReductionModule &
190
+ import("./ts_def_modules/treasureHunt/water_reduction").WaterReductionModule &
191
+ // wasteWater
192
+ import("./ts_def_modules/wasteWater/svi").SviModule &
193
+ import("./ts_def_modules/wasteWater/wasteWater").WasteWaterModule &
194
+ // water
195
+ import("./ts_def_modules/water/waterAssessment").WaterAssessmentModule;
196
+
197
+ declare const _default: (moduleArg?: Record<string, unknown>) => Promise<MeasurToolsSuite>;
198
+ export default _default;