api581-engine 0.1.4__py3-none-any.whl

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 (139) hide show
  1. api581/__init__.py +80 -0
  2. api581/_amine_tables.py +105 -0
  3. api581/_h2sh2_tables.py +161 -0
  4. api581/_slabx_worker.py +174 -0
  5. api581/_sulfidic_tables.py +517 -0
  6. api581/_sulfuric_tables.py +328 -0
  7. api581/acid_sour_water.py +238 -0
  8. api581/acscc_screening.py +88 -0
  9. api581/alkaline_sour_water.py +267 -0
  10. api581/amine_corrosion.py +277 -0
  11. api581/amine_screening.py +103 -0
  12. api581/api/__init__.py +4 -0
  13. api581/api/api520.py +88 -0
  14. api581/api/bundle.py +121 -0
  15. api581/api/consequence.py +102 -0
  16. api581/api/damage.py +1831 -0
  17. api581/api/dispersion.py +121 -0
  18. api581/api/effects.py +318 -0
  19. api581/api/events.py +96 -0
  20. api581/api/financial.py +115 -0
  21. api581/api/frequency.py +40 -0
  22. api581/api/inspection.py +96 -0
  23. api581/api/level1.py +238 -0
  24. api581/api/level2.py +74 -0
  25. api581/api/planning.py +17 -0
  26. api581/api/prd.py +190 -0
  27. api581/api/properties.py +130 -0
  28. api581/api/release.py +252 -0
  29. api581/api/reliability.py +40 -0
  30. api581/api/risk.py +71 -0
  31. api581/api/tank.py +490 -0
  32. api581/api520.py +205 -0
  33. api581/area_contribution.py +72 -0
  34. api581/blast.py +232 -0
  35. api581/brittle.py +205 -0
  36. api581/bundle.py +300 -0
  37. api581/catalog.py +442 -0
  38. api581/caustic_screening.py +103 -0
  39. api581/clad_thinning.py +146 -0
  40. api581/clscc_screening.py +55 -0
  41. api581/co2_corrosion.py +313 -0
  42. api581/co2_screening.py +205 -0
  43. api581/consequences.py +250 -0
  44. api581/contracts.py +1038 -0
  45. api581/cooling_selection.py +204 -0
  46. api581/cooling_water.py +305 -0
  47. api581/core.py +126 -0
  48. api581/corrosion_rate.py +38 -0
  49. api581/cost_tables.py +175 -0
  50. api581/cracking.py +74 -0
  51. api581/data/coverage.json +21361 -0
  52. api581/data/digital-twin.schema.json +538 -0
  53. api581/data/direct-test-queue.json +7 -0
  54. api581/data/native-engine-evidence.json +44 -0
  55. api581/data/python-api.schema.json +92706 -0
  56. api581/data/reference-fixture-evidence.json +2956 -0
  57. api581/data/scope-boundaries.schema.json +58 -0
  58. api581/data/software-test-evidence.json +4278 -0
  59. api581/data/standard-metadata.json +1328 -0
  60. api581/data/standard.schema.json +233 -0
  61. api581/data/supporting-text-review.json +1319 -0
  62. api581/digital_twin.py +491 -0
  63. api581/dispersion.py +45 -0
  64. api581/effects.py +232 -0
  65. api581/evaporation.py +181 -0
  66. api581/evidence.py +81 -0
  67. api581/external_corrosion.py +148 -0
  68. api581/external_cracking.py +63 -0
  69. api581/fatigue.py +56 -0
  70. api581/fireball.py +163 -0
  71. api581/flash_pool.py +111 -0
  72. api581/flash_solver.py +122 -0
  73. api581/groundwater.py +101 -0
  74. api581/h2sh2_corrosion.py +128 -0
  75. api581/hic_screened.py +89 -0
  76. api581/htha.py +45 -0
  77. api581/hydrochloric_acid.py +272 -0
  78. api581/hydrofluoric_acid.py +236 -0
  79. api581/ignition.py +204 -0
  80. api581/inspection_effectiveness.py +601 -0
  81. api581/jet_handoff.py +60 -0
  82. api581/level1.py +311 -0
  83. api581/level1_summary.py +35 -0
  84. api581/level1_toxic.py +313 -0
  85. api581/level1_type1.py +91 -0
  86. api581/level2_summary.py +237 -0
  87. api581/lining.py +173 -0
  88. api581/native_toxic.py +67 -0
  89. api581/outputs.py +5672 -0
  90. api581/oxidation.py +145 -0
  91. api581/pascc_screening.py +78 -0
  92. api581/physical_explosion.py +190 -0
  93. api581/pof.py +207 -0
  94. api581/pool_fire.py +273 -0
  95. api581/portfolio.py +68 -0
  96. api581/prd.py +204 -0
  97. api581/prd_consequences.py +245 -0
  98. api581/prd_history.py +44 -0
  99. api581/py.typed +0 -0
  100. api581/release.py +307 -0
  101. api581/representative_fluids.py +172 -0
  102. api581/result.py +50 -0
  103. api581/risk.py +191 -0
  104. api581/saturation.py +66 -0
  105. api581/scc_mechanisms.py +242 -0
  106. api581/schema.py +45 -0
  107. api581/slabx_adapter.py +261 -0
  108. api581/soil_corrosion.py +191 -0
  109. api581/source_partition.py +169 -0
  110. api581/spatial.py +87 -0
  111. api581/ssc_screening.py +77 -0
  112. api581/standard.py +281 -0
  113. api581/storage.py +42 -0
  114. api581/sulfidic_corrosion.py +197 -0
  115. api581/sulfuric_acid.py +209 -0
  116. api581/tank.py +260 -0
  117. api581/tank_corrosion.py +256 -0
  118. api581/tank_environment.py +186 -0
  119. api581/tank_financial.py +202 -0
  120. api581/tank_integrated.py +51 -0
  121. api581/tank_shell.py +141 -0
  122. api581/tank_source.py +152 -0
  123. api581/tank_thinning.py +204 -0
  124. api581/temper.py +105 -0
  125. api581/thinning.py +172 -0
  126. api581/thinning_conditions.py +212 -0
  127. api581/thinning_history.py +118 -0
  128. api581/thinning_selection.py +81 -0
  129. api581/thinning_type.py +34 -0
  130. api581/toxic_criteria.py +111 -0
  131. api581/toxic_level2.py +233 -0
  132. api581/two_phase_events.py +120 -0
  133. api581/workflow.py +42 -0
  134. api581_engine-0.1.4.dist-info/METADATA +419 -0
  135. api581_engine-0.1.4.dist-info/RECORD +139 -0
  136. api581_engine-0.1.4.dist-info/WHEEL +5 -0
  137. api581_engine-0.1.4.dist-info/licenses/LICENSE +161 -0
  138. api581_engine-0.1.4.dist-info/licenses/NOTICE.md +18 -0
  139. api581_engine-0.1.4.dist-info/top_level.txt +1 -0
api581/__init__.py ADDED
@@ -0,0 +1,80 @@
1
+ """API 581 calculation engine. No implicit standard-compliance certification."""
2
+
3
+ from .core import VERSION as __version__, Context, DomainError, REGISTRY, evaluate
4
+ from . import pof, release, effects, risk, thinning, cracking, level1, consequences, level1_summary, cost_tables, scc_mechanisms, external_corrosion, external_cracking, fatigue, htha, brittle, temper, bundle, prd, prd_consequences, prd_history, level1_type1, level1_toxic, pool_fire, inspection_effectiveness
5
+ from .result import CalculationResult
6
+ from . import fireball
7
+ from . import blast
8
+ from . import physical_explosion
9
+ from . import toxic_level2
10
+ from . import level2_summary
11
+ from . import evaporation
12
+ from . import source_partition
13
+ from . import ignition
14
+ from . import two_phase_events
15
+ from . import tank
16
+ from . import tank_environment
17
+ from . import tank_financial
18
+ from . import tank_source
19
+ from . import tank_integrated
20
+ from . import tank_shell
21
+ from . import slabx_adapter
22
+ from . import spatial
23
+ from . import jet_handoff
24
+ from . import toxic_criteria
25
+ from . import native_toxic
26
+ from . import soil_corrosion
27
+ from . import tank_corrosion
28
+ from . import tank_thinning
29
+ from . import clad_thinning
30
+ from . import thinning_conditions
31
+ from . import lining
32
+ from . import cooling_water
33
+ from . import cooling_selection
34
+ from . import co2_corrosion
35
+ from . import co2_screening
36
+ from . import oxidation
37
+ from . import acid_sour_water
38
+ from . import alkaline_sour_water
39
+ from . import hydrochloric_acid
40
+ from . import hydrofluoric_acid
41
+ from . import amine_corrosion
42
+ from . import sulfuric_acid
43
+ from . import h2sh2_corrosion
44
+ from . import sulfidic_corrosion
45
+ from . import flash_solver
46
+ from . import saturation
47
+ from . import flash_pool
48
+ from . import area_contribution
49
+ from . import groundwater
50
+ from . import thinning_selection
51
+ from . import thinning_history
52
+ from . import caustic_screening
53
+ from . import amine_screening
54
+ from . import ssc_screening
55
+ from . import hic_screened
56
+ from . import acscc_screening
57
+ from . import pascc_screening
58
+ from . import clscc_screening
59
+ from .workflow import Step, Workflow, run_workflow
60
+ from . import digital_twin
61
+ from . import api520
62
+ from . import schema
63
+ from . import evidence
64
+ from .evidence import ValidationEvidence
65
+ from . import standard
66
+ from . import portfolio
67
+ from . import representative_fluids
68
+ from . import corrosion_rate
69
+ from . import thinning_type
70
+ from .catalog import describe, list_calculations, coverage, coverage_summary, clause_evidence, review_queue, calculation_evidence, validation_queue, ScopeBoundary, scope_boundaries, audit_coverage
71
+
72
+ __all__ = ["api", "Context", "DomainError", "CalculationResult", "evaluate",
73
+ "Step", "Workflow", "run_workflow", "describe", "list_calculations", "coverage", "coverage_summary", "clause_evidence", "review_queue", "calculation_evidence", "validation_queue", "ScopeBoundary", "scope_boundaries", "audit_coverage", "digital_twin", "schema", "evidence", "ValidationEvidence", "standard", "__version__"]
74
+
75
+
76
+ def __getattr__(name):
77
+ if name == "api":
78
+ from importlib import import_module
79
+ return import_module(".api", __name__)
80
+ raise AttributeError(name)
@@ -0,0 +1,105 @@
1
+ """Checked 2016 amine source rows; generated by scripts/extract_amine_source_fixture.py."""
2
+ TABLES = {'mea_dea_us': [[1.0, 3.0, 1.0, 3.0, 3.0, 10.0, 5.0, 15.0, 10.0, 25.0, 15.0, 40.0],
3
+ [2.0, 6.0, 2.0, 6.0, 6.0, 20.0, 15.0, 40.0, 20.0, 45.0, 30.0, 80.0],
4
+ [5.0, 10.0, 5.0, 15.0, 15.0, 40.0, 30.0, 60.0, 40.0, 90.0, 60.0, 120.0],
5
+ [1.0, 3.0, 2.0, 6.0, 5.0, 15.0, 10.0, 30.0, 15.0, 45.0, 20.0, 60.0],
6
+ [2.0, 6.0, 4.0, 12.0, 10.0, 30.0, 20.0, 60.0, 30.0, 90.0, 40.0, 80.0],
7
+ [5.0, 15.0, 8.0, 25.0, 20.0, 60.0, 40.0, 80.0, 60.0, 120.0, 120.0, 150.0],
8
+ [2.0, 6.0, 3.0, 9.0, 7.0, 20.0, 10.0, 30.0, 20.0, 60.0, 25.0, 75.0],
9
+ [4.0, 10.0, 6.0, 20.0, 15.0, 40.0, 20.0, 50.0, 40.0, 80.0, 50.0, 100.0],
10
+ [8.0, 25.0, 15.0, 45.0, 30.0, 60.0, 40.0, 80.0, 80.0, 120.0, 100.0, 150.0],
11
+ [2.0, 6.0, 4.0, 10.0, 7.0, 20.0, 15.0, 40.0, 25.0, 70.0, 30.0, 80.0],
12
+ [4.0, 10.0, 8.0, 25.0, 15.0, 45.0, 30.0, 60.0, 50.0, 100.0, 100.0, 150.0],
13
+ [8.0, 25.0, 15.0, 40.0, 35.0, 70.0, 60.0, 100.0, 100.0, 140.0, 150.0, 180.0],
14
+ [3.0, 9.0, 5.0, 15.0, 10.0, 30.0, 15.0, 45.0, 35.0, 70.0, 45.0, 100.0],
15
+ [6.0, 15.0, 10.0, 30.0, 20.0, 60.0, 45.0, 90.0, 70.0, 130.0, 90.0, 150.0],
16
+ [10.0, 30.0, 20.0, 40.0, 40.0, 80.0, 90.0, 120.0, 120.0, 150.0, 150.0, 180.0],
17
+ [3.0, 9.0, 7.0, 20.0, 10.0, 30.0, 25.0, 75.0, 40.0, 100.0, 50.0, 120.0],
18
+ [6.0, 20.0, 15.0, 45.0, 20.0, 60.0, 50.0, 100.0, 80.0, 140.0, 100.0, 150.0],
19
+ [10.0, 30.0, 30.0, 60.0, 45.0, 90.0, 100.0, 150.0, 140.0, 180.0, 160.0, 200.0],
20
+ [4.0, 10.0, 9.0, 30.0, 15.0, 40.0, 30.0, 100.0, 50.0, 120.0, 60.0, 150.0],
21
+ [8.0, 15.0, 20.0, 40.0, 30.0, 60.0, 60.0, 100.0, 90.0, 140.0, 100.0, 150.0],
22
+ [15.0, 35.0, 40.0, 80.0, 60.0, 100.0, 100.0, 150.0, 140.0, 180.0, 160.0, 200.0],
23
+ [5.0, 15.0, 10.0, 30.0, 20.0, 60.0, 40.0, 100.0, 60.0, 120.0, 70.0, 150.0],
24
+ [10.0, 30.0, 20.0, 60.0, 40.0, 80.0, 70.0, 120.0, 100.0, 150.0, 120.0, 150.0],
25
+ [20.0, 45.0, 40.0, 80.0, 60.0, 100.0, 100.0, 150.0, 150.0, 180.0, 170.0, 220.0]],
26
+ 'mea_dea_si': [[0.03, 0.08, 0.03, 0.08, 0.08, 0.25, 0.13, 0.38, 0.25, 0.64, 0.38, 1.02],
27
+ [0.05, 0.15, 0.05, 0.15, 0.15, 0.51, 0.38, 1.02, 0.51, 1.14, 0.76, 2.03],
28
+ [0.13, 0.25, 0.13, 0.38, 0.38, 1.02, 0.76, 1.52, 1.02, 2.29, 1.52, 3.05],
29
+ [0.03, 0.08, 0.05, 0.15, 0.13, 0.38, 0.25, 0.76, 0.38, 1.14, 0.51, 1.52],
30
+ [0.05, 0.15, 0.1, 0.3, 0.25, 0.76, 0.51, 1.52, 0.76, 2.29, 1.02, 2.03],
31
+ [0.13, 0.38, 0.2, 0.64, 0.51, 1.52, 1.02, 2.03, 1.52, 3.05, 3.05, 3.81],
32
+ [0.05, 0.15, 0.08, 0.23, 0.18, 0.51, 0.25, 0.76, 0.51, 1.52, 0.64, 1.91],
33
+ [0.1, 0.25, 0.15, 0.51, 0.38, 1.02, 0.51, 1.27, 1.02, 2.03, 1.27, 2.54],
34
+ [0.2, 0.64, 0.38, 1.14, 0.76, 1.52, 1.02, 2.03, 2.03, 3.05, 2.54, 3.81],
35
+ [0.05, 0.15, 0.1, 0.25, 0.18, 0.51, 0.38, 1.02, 0.64, 1.78, 0.76, 2.03],
36
+ [0.1, 0.25, 0.2, 0.64, 0.38, 1.14, 0.76, 1.52, 1.27, 2.54, 2.54, 3.81],
37
+ [0.2, 0.64, 0.38, 1.02, 0.89, 1.78, 1.52, 2.54, 2.54, 3.56, 3.81, 4.57],
38
+ [0.08, 0.23, 0.13, 0.38, 0.25, 0.76, 0.38, 1.14, 0.89, 1.78, 1.14, 2.54],
39
+ [0.15, 0.38, 0.25, 0.76, 0.51, 1.52, 1.14, 2.29, 1.78, 3.3, 2.29, 3.81],
40
+ [0.25, 0.76, 0.51, 1.02, 1.02, 2.03, 2.29, 3.05, 3.05, 3.81, 3.81, 4.57],
41
+ [0.08, 0.23, 0.18, 0.51, 0.25, 0.76, 0.64, 1.91, 1.02, 2.54, 1.27, 3.05],
42
+ [0.15, 0.51, 0.38, 1.14, 0.51, 1.52, 1.27, 2.54, 2.03, 3.56, 2.54, 3.81],
43
+ [0.25, 0.76, 0.76, 1.52, 1.14, 2.29, 2.54, 3.81, 3.56, 4.57, 4.06, 5.08],
44
+ [0.1, 0.25, 0.23, 0.76, 0.38, 1.02, 0.76, 2.54, 1.27, 3.05, 1.52, 3.81],
45
+ [0.2, 0.38, 0.51, 1.02, 0.76, 1.52, 1.52, 2.54, 2.29, 3.56, 2.54, 3.81],
46
+ [0.38, 0.89, 1.02, 2.03, 1.52, 2.54, 2.54, 3.81, 3.56, 4.57, 4.06, 5.08],
47
+ [0.13, 0.38, 0.25, 0.76, 0.51, 1.52, 1.02, 2.54, 1.52, 3.05, 1.78, 3.81],
48
+ [0.25, 0.76, 0.51, 1.52, 1.02, 2.03, 1.78, 3.05, 2.54, 3.81, 3.05, 3.81],
49
+ [0.51, 1.14, 1.02, 2.03, 1.52, 2.54, 2.54, 3.81, 3.81, 4.57, 4.32, 5.59]],
50
+ 'mdea_us': [[1.0, 3.0, 1.0, 3.0, 3.0, 10.0, 5.0, 15.0, 10.0, 25.0, 15.0, 40.0],
51
+ [2.0, 6.0, 2.0, 6.0, 6.0, 20.0, 15.0, 40.0, 20.0, 45.0, 30.0, 80.0],
52
+ [5.0, 10.0, 5.0, 15.0, 15.0, 40.0, 30.0, 60.0, 40.0, 90.0, 60.0, 120.0],
53
+ [1.0, 3.0, 2.0, 6.0, 5.0, 15.0, 10.0, 30.0, 15.0, 45.0, 20.0, 60.0],
54
+ [2.0, 6.0, 4.0, 12.0, 10.0, 30.0, 20.0, 60.0, 30.0, 90.0, 40.0, 80.0],
55
+ [5.0, 15.0, 8.0, 25.0, 20.0, 60.0, 40.0, 80.0, 60.0, 120.0, 120.0, 150.0],
56
+ [2.0, 6.0, 3.0, 9.0, 7.0, 20.0, 10.0, 30.0, 20.0, 60.0, 25.0, 75.0],
57
+ [4.0, 10.0, 6.0, 20.0, 15.0, 40.0, 20.0, 50.0, 40.0, 80.0, 50.0, 100.0],
58
+ [8.0, 25.0, 15.0, 45.0, 30.0, 60.0, 40.0, 80.0, 80.0, 120.0, 100.0, 150.0],
59
+ [2.0, 6.0, 4.0, 10.0, 7.0, 20.0, 15.0, 40.0, 25.0, 70.0, 30.0, 80.0],
60
+ [4.0, 10.0, 8.0, 25.0, 15.0, 45.0, 30.0, 60.0, 50.0, 100.0, 100.0, 150.0],
61
+ [8.0, 25.0, 15.0, 40.0, 35.0, 70.0, 60.0, 100.0, 100.0, 140.0, 150.0, 180.0],
62
+ [3.0, 9.0, 5.0, 15.0, 10.0, 30.0, 15.0, 45.0, 35.0, 70.0, 45.0, 100.0],
63
+ [6.0, 15.0, 10.0, 30.0, 20.0, 60.0, 45.0, 90.0, 70.0, 130.0, 90.0, 150.0],
64
+ [10.0, 30.0, 20.0, 40.0, 40.0, 80.0, 90.0, 120.0, 120.0, 150.0, 150.0, 180.0],
65
+ [3.0, 9.0, 7.0, 20.0, 10.0, 30.0, 25.0, 75.0, 40.0, 100.0, 50.0, 120.0],
66
+ [6.0, 20.0, 15.0, 45.0, 20.0, 60.0, 50.0, 100.0, 80.0, 140.0, 100.0, 150.0],
67
+ [10.0, 30.0, 30.0, 60.0, 45.0, 90.0, 100.0, 150.0, 140.0, 180.0, 160.0, 200.0],
68
+ [4.0, 10.0, 9.0, 30.0, 15.0, 40.0, 30.0, 100.0, 50.0, 120.0, 60.0, 150.0],
69
+ [8.0, 15.0, 20.0, 40.0, 30.0, 60.0, 60.0, 100.0, 90.0, 140.0, 100.0, 150.0],
70
+ [15.0, 35.0, 40.0, 80.0, 60.0, 100.0, 100.0, 150.0, 140.0, 180.0, 160.0, 200.0],
71
+ [5.0, 15.0, 10.0, 30.0, 20.0, 60.0, 40.0, 100.0, 60.0, 120.0, 70.0, 150.0],
72
+ [10.0, 30.0, 20.0, 60.0, 40.0, 80.0, 70.0, 120.0, 100.0, 150.0, 120.0, 150.0],
73
+ [20.0, 45.0, 40.0, 80.0, 60.0, 100.0, 100.0, 150.0, 150.0, 180.0, 170.0, 220.0]],
74
+ 'mdea_si': [[0.03, 0.08, 0.03, 0.08, 0.08, 0.25, 0.13, 0.38, 0.25, 0.64, 0.38, 1.02],
75
+ [0.05, 0.15, 0.05, 0.15, 0.15, 0.51, 0.38, 1.02, 0.51, 1.14, 0.76, 2.03],
76
+ [0.13, 0.25, 0.13, 0.38, 0.38, 1.02, 0.76, 1.52, 1.02, 2.29, 1.52, 3.05],
77
+ [0.03, 0.08, 0.05, 0.15, 0.13, 0.38, 0.25, 0.76, 0.38, 1.14, 0.51, 1.52],
78
+ [0.05, 0.15, 0.1, 0.3, 0.25, 0.76, 0.51, 1.52, 0.76, 2.29, 1.02, 2.03],
79
+ [0.13, 0.38, 0.2, 0.64, 0.51, 1.52, 1.02, 2.03, 1.52, 3.05, 3.05, 3.81],
80
+ [0.05, 0.15, 0.08, 0.23, 0.18, 0.51, 0.25, 0.76, 0.51, 1.52, 0.64, 1.91],
81
+ [0.1, 0.25, 0.15, 0.51, 0.38, 1.02, 0.51, 1.27, 1.02, 2.03, 1.27, 2.54],
82
+ [0.2, 0.64, 0.38, 1.14, 0.76, 1.52, 1.02, 2.03, 2.03, 3.05, 2.54, 3.81],
83
+ [0.05, 0.15, 0.1, 0.25, 0.18, 0.51, 0.38, 1.02, 0.64, 1.78, 0.76, 2.03],
84
+ [0.1, 0.25, 0.2, 0.64, 0.38, 1.14, 0.76, 1.52, 1.27, 2.54, 2.54, 3.81],
85
+ [0.2, 0.64, 0.38, 1.02, 0.89, 1.78, 1.52, 2.54, 2.54, 3.56, 3.81, 4.57],
86
+ [0.08, 0.23, 0.13, 0.38, 0.25, 0.76, 0.38, 1.14, 0.89, 1.78, 1.14, 2.54],
87
+ [0.15, 0.38, 0.25, 0.76, 0.51, 1.52, 1.14, 2.29, 1.78, 3.3, 2.29, 3.81],
88
+ [0.25, 0.76, 0.51, 1.02, 1.02, 2.03, 2.29, 3.05, 3.05, 3.81, 3.81, 4.57],
89
+ [0.08, 0.23, 0.18, 0.51, 0.25, 0.76, 0.64, 1.91, 1.02, 2.54, 1.27, 3.05],
90
+ [0.15, 0.51, 0.38, 1.14, 0.51, 1.52, 1.27, 2.54, 2.03, 3.56, 2.54, 3.81],
91
+ [0.25, 0.76, 0.76, 1.52, 1.14, 2.29, 2.54, 3.81, 3.56, 4.57, 4.06, 5.08],
92
+ [0.1, 0.25, 0.23, 0.76, 0.38, 1.02, 0.76, 2.54, 1.27, 3.05, 1.52, 3.81],
93
+ [0.2, 0.38, 0.51, 1.02, 0.76, 1.52, 1.52, 2.54, 2.29, 3.56, 2.54, 3.81],
94
+ [0.38, 0.89, 1.02, 2.03, 1.52, 2.54, 2.54, 3.81, 3.56, 4.57, 4.06, 5.08],
95
+ [0.13, 0.38, 0.25, 0.76, 0.51, 1.52, 1.02, 2.54, 1.52, 3.05, 1.78, 3.81],
96
+ [0.25, 0.76, 0.51, 1.52, 1.02, 2.03, 1.78, 3.05, 2.54, 3.81, 3.05, 3.81],
97
+ [0.51, 1.14, 1.02, 2.03, 1.52, 2.54, 2.54, 3.81, 3.81, 4.57, 4.32, 5.59]],
98
+ 'stainless': [[0.1, 0.03, 1.0],
99
+ [0.15, 0.03, 1.0],
100
+ [0.25, 0.03, 1.0],
101
+ [0.35, 0.05, 2.0],
102
+ [0.45, 0.05, 2.0],
103
+ [0.55, 0.08, 3.0],
104
+ [0.65, 0.1, 4.0],
105
+ [0.7, 0.13, 5.0]]}
@@ -0,0 +1,161 @@
1
+ """2016 H2S/H2 source rates; generated by scripts/extract_h2sh2_source_fixture.py."""
2
+ TABLES = {'carbon_low_alloy_printed_us_converted': [[1.0, 1.0, 1.0, 1.0, 2.0, 3.0, 4.0, 6.0, 8.0, 10.0, 14.0, 18.0],
3
+ [1.0, 1.0, 1.0, 2.0, 3.0, 5.0, 7.0, 10.0, 14.0, 20.0, 26.0, 34.0],
4
+ [1.0, 1.0, 1.0, 2.0, 4.0, 6.0, 8.0, 12.0, 16.0, 22.0, 29.0, 37.0],
5
+ [1.0, 2.0, 3.0, 4.0, 7.0, 11.0, 16.0, 22.0, 31.0, 41.0, 55.0, 71.0],
6
+ [1.0, 1.0, 2.0, 3.0, 5.0, 7.0, 11.0, 15.0, 21.0, 29.0, 38.0, 50.0],
7
+ [1.0, 2.0, 4.0, 6.0, 9.0, 14.0, 21.0, 29.0, 41.0, 55.0, 73.0, 94.0],
8
+ [1.0, 2.0, 3.0, 5.0, 9.0, 13.0, 19.0, 27.0, 38.0, 51.0, 67.0, 87.0],
9
+ [2.0, 4.0, 6.0, 10.0, 16.0, 25.0, 36.0, 51.0, 71.0, 96.0, 130.0, 170.0],
10
+ [1.0, 2.0, 4.0, 7.0, 10.0, 16.0, 23.0, 33.0, 46.0, 62.0, 82.0, 110.0],
11
+ [2.0, 4.0, 8.0, 13.0, 20.0, 30.0, 44.0, 63.0, 87.0, 120.0, 160.0, 200.0],
12
+ [2.0, 3.0, 6.0, 10.0, 15.0, 23.0, 34.0, 48.0, 66.0, 90.0, 120.0, 150.0],
13
+ [3.0, 6.0, 11.0, 18.0, 29.0, 44.0, 64.0, 91.0, 130.0, 170.0, 230.0, 300.0],
14
+ [2.0, 4.0, 7.0, 11.0, 17.0, 26.0, 38.0, 54.0, 75.0, 100.0, 130.0, 170.0],
15
+ [4.0, 7.0, 12.0, 21.0, 32.0, 49.0, 72.0, 100.0, 140.0, 190.0, 250.0, 330.0],
16
+ [3.0, 5.0, 8.0, 13.0, 21.0, 32.0, 47.0, 67.0, 93.0, 130.0, 170.0, 220.0],
17
+ [5.0, 9.0, 15.0, 26.0, 40.0, 61.0, 89.0, 130.0, 180.0, 240.0, 310.0, 410.0]],
18
+ 'carbon_low_alloy_printed_si': [[0.03, 0.03, 0.03, 0.03, 0.05, 0.08, 0.1, 0.15, 0.2, 0.25, 0.36, 0.46],
19
+ [0.03, 0.03, 0.03, 0.05, 0.08, 0.13, 0.18, 0.25, 0.36, 0.51, 0.66, 0.86],
20
+ [0.03, 0.03, 0.03, 0.05, 0.1, 0.15, 0.2, 0.3, 0.41, 0.56, 0.74, 0.94],
21
+ [0.03, 0.05, 0.08, 0.1, 0.18, 0.28, 0.41, 0.56, 0.79, 1.04, 1.4, 1.8],
22
+ [0.03, 0.03, 0.05, 0.08, 0.13, 0.18, 0.28, 0.38, 0.53, 0.74, 0.97, 1.27],
23
+ [0.03, 0.05, 0.1, 0.15, 0.23, 0.36, 0.53, 0.74, 1.04, 1.4, 1.85, 2.39],
24
+ [0.03, 0.05, 0.08, 0.13, 0.23, 0.33, 0.48, 0.69, 0.97, 1.3, 1.7, 2.21],
25
+ [0.05, 0.1, 0.15, 0.25, 0.41, 0.64, 0.91, 1.3, 1.8, 2.44, 3.3, 4.32],
26
+ [0.03, 0.05, 0.1, 0.18, 0.25, 0.41, 0.58, 0.84, 1.17, 1.57, 2.08, 2.79],
27
+ [0.05, 0.1, 0.2, 0.33, 0.51, 0.76, 1.12, 1.6, 2.21, 3.05, 4.06, 5.08],
28
+ [0.05, 0.08, 0.15, 0.25, 0.38, 0.58, 0.86, 1.22, 1.68, 2.29, 3.05, 3.81],
29
+ [0.08, 0.15, 0.28, 0.46, 0.74, 1.12, 1.63, 2.31, 3.3, 4.32, 5.84, 7.62],
30
+ [0.05, 0.1, 0.18, 0.28, 0.43, 0.66, 0.97, 1.37, 1.91, 2.54, 3.3, 4.32],
31
+ [0.1, 0.18, 0.3, 0.53, 0.81, 1.24, 1.83, 2.54, 3.56, 4.83, 6.35, 8.38],
32
+ [0.08, 0.13, 0.2, 0.33, 0.53, 0.81, 1.19, 1.7, 2.36, 3.3, 4.32, 5.59],
33
+ [0.13, 0.23, 0.38, 0.66, 1.02, 1.55, 2.26, 3.3, 4.57, 6.1, 7.87, 10.41]],
34
+ 'cr5_printed_us_converted': [[1.0, 1.0, 1.0, 1.0, 1.0, 2.0, 3.0, 4.0, 6.0, 8.0, 11.0, 14.0],
35
+ [1.0, 1.0, 1.0, 2.0, 3.0, 4.0, 6.0, 8.0, 12.0, 16.0, 21.0, 27.0],
36
+ [1.0, 1.0, 1.0, 2.0, 3.0, 5.0, 7.0, 9.0, 13.0, 18.0, 23.0, 30.0],
37
+ [1.0, 1.0, 2.0, 4.0, 6.0, 9.0, 13.0, 18.0, 25.0, 33.0, 44.0, 57.0],
38
+ [1.0, 1.0, 2.0, 2.0, 4.0, 6.0, 9.0, 12.0, 17.0, 23.0, 31.0, 40.0],
39
+ [1.0, 2.0, 3.0, 5.0, 7.0, 11.0, 17.0, 24.0, 33.0, 44.0, 58.0, 76.0],
40
+ [1.0, 2.0, 3.0, 4.0, 7.0, 10.0, 15.0, 22.0, 30.0, 41.0, 54.0, 70.0],
41
+ [2.0, 3.0, 5.0, 8.0, 13.0, 20.0, 29.0, 41.0, 57.0, 77.0, 100.0, 130.0],
42
+ [1.0, 2.0, 3.0, 5.0, 8.0, 13.0, 19.0, 27.0, 37.0, 50.0, 66.0, 85.0],
43
+ [2.0, 4.0, 6.0, 10.0, 16.0, 24.0, 36.0, 51.0, 70.0, 94.0, 130.0, 160.0],
44
+ [1.0, 3.0, 5.0, 8.0, 12.0, 19.0, 27.0, 39.0, 53.0, 72.0, 95.0, 120.0],
45
+ [3.0, 5.0, 9.0, 15.0, 23.0, 35.0, 52.0, 73.0, 100.0, 140.0, 180.0, 240.0],
46
+ [2.0, 3.0, 5.0, 9.0, 14.0, 21.0, 31.0, 44.0, 60.0, 81.0, 110.0, 140.0],
47
+ [3.0, 6.0, 10.0, 17.0, 26.0, 40.0, 58.0, 82.0, 110.0, 150.0, 200.0, 270.0],
48
+ [2.0, 4.0, 7.0, 11.0, 17.0, 26.0, 38.0, 54.0, 75.0, 100.0, 130.0, 170.0],
49
+ [4.0, 7.0, 12.0, 21.0, 32.0, 49.0, 72.0, 100.0, 140.0, 190.0, 250.0, 330.0]],
50
+ 'cr5_printed_si': [[0.03, 0.03, 0.03, 0.03, 0.03, 0.05, 0.08, 0.1, 0.15, 0.2, 0.28, 0.36],
51
+ [0.03, 0.03, 0.03, 0.05, 0.08, 0.1, 0.15, 0.2, 0.3, 0.41, 0.53, 0.69],
52
+ [0.03, 0.03, 0.03, 0.05, 0.08, 0.13, 0.18, 0.23, 0.33, 0.46, 0.58, 0.76],
53
+ [0.03, 0.03, 0.05, 0.1, 0.15, 0.23, 0.33, 0.46, 0.64, 0.84, 1.12, 1.45],
54
+ [0.03, 0.03, 0.05, 0.05, 0.1, 0.15, 0.23, 0.3, 0.43, 0.58, 0.79, 1.02],
55
+ [0.03, 0.05, 0.08, 0.13, 0.18, 0.28, 0.43, 0.61, 0.84, 1.12, 1.47, 1.93],
56
+ [0.03, 0.05, 0.08, 0.1, 0.18, 0.25, 0.38, 0.56, 0.76, 1.04, 1.37, 1.78],
57
+ [0.05, 0.08, 0.13, 0.2, 0.33, 0.51, 0.74, 1.04, 1.45, 1.96, 2.54, 3.3],
58
+ [0.03, 0.05, 0.08, 0.13, 0.2, 0.33, 0.48, 0.69, 0.94, 1.27, 1.68, 2.16],
59
+ [0.05, 0.1, 0.15, 0.25, 0.41, 0.61, 0.91, 1.3, 1.78, 2.39, 3.3, 4.06],
60
+ [0.03, 0.08, 0.13, 0.2, 0.3, 0.48, 0.69, 0.99, 1.35, 1.83, 2.41, 3.05],
61
+ [0.08, 0.13, 0.23, 0.38, 0.58, 0.89, 1.32, 1.85, 2.54, 3.56, 4.57, 6.1],
62
+ [0.05, 0.08, 0.13, 0.23, 0.36, 0.53, 0.79, 1.12, 1.52, 2.06, 2.79, 3.56],
63
+ [0.08, 0.15, 0.25, 0.43, 0.66, 1.02, 1.47, 2.08, 2.79, 3.81, 5.08, 6.86],
64
+ [0.05, 0.1, 0.18, 0.28, 0.43, 0.66, 0.97, 1.37, 1.91, 2.54, 3.3, 4.32],
65
+ [0.1, 0.18, 0.3, 0.53, 0.81, 1.24, 1.83, 2.54, 3.56, 4.83, 6.35, 8.38]],
66
+ 'cr7_printed_us_converted': [[1.0, 1.0, 1.0, 1.0, 1.0, 2.0, 3.0, 4.0, 6.0, 8.0, 10.0, 13.0],
67
+ [1.0, 1.0, 1.0, 2.0, 2.0, 4.0, 5.0, 8.0, 11.0, 14.0, 19.0, 25.0],
68
+ [1.0, 1.0, 1.0, 2.0, 3.0, 4.0, 6.0, 9.0, 12.0, 16.0, 21.0, 28.0],
69
+ [1.0, 1.0, 2.0, 3.0, 5.0, 8.0, 11.0, 16.0, 23.0, 30.0, 40.0, 52.0],
70
+ [1.0, 1.0, 1.0, 2.0, 4.0, 5.0, 8.0, 11.0, 16.0, 21.0, 28.0, 37.0],
71
+ [1.0, 2.0, 3.0, 4.0, 7.0, 10.0, 15.0, 22.0, 30.0, 40.0, 53.0, 69.0],
72
+ [1.0, 1.0, 2.0, 4.0, 6.0, 10.0, 14.0, 20.0, 28.0, 37.0, 49.0, 64.0],
73
+ [1.0, 3.0, 5.0, 8.0, 12.0, 18.0, 27.0, 38.0, 52.0, 71.0, 94.0, 120.0],
74
+ [1.0, 2.0, 3.0, 5.0, 8.0, 12.0, 17.0, 24.0, 34.0, 46.0, 60.0, 78.0],
75
+ [2.0, 3.0, 6.0, 9.0, 15.0, 22.0, 33.0, 46.0, 64.0, 86.0, 110.0, 150.0],
76
+ [1.0, 2.0, 4.0, 7.0, 11.0, 17.0, 25.0, 35.0, 49.0, 66.0, 87.0, 110.0],
77
+ [3.0, 5.0, 8.0, 13.0, 21.0, 32.0, 47.0, 67.0, 93.0, 130.0, 170.0, 220.0],
78
+ [2.0, 3.0, 5.0, 8.0, 13.0, 19.0, 28.0, 40.0, 55.0, 74.0, 98.0, 130.0],
79
+ [3.0, 5.0, 9.0, 15.0, 24.0, 36.0, 53.0, 76.0, 100.0, 140.0, 190.0, 240.0],
80
+ [2.0, 3.0, 6.0, 10.0, 16.0, 24.0, 35.0, 49.0, 68.0, 92.0, 120.0, 160.0],
81
+ [4.0, 7.0, 11.0, 19.0, 30.0, 45.0, 66.0, 94.0, 130.0, 180.0, 230.0, 300.0]],
82
+ 'cr7_printed_si': [[0.03, 0.03, 0.03, 0.03, 0.03, 0.05, 0.08, 0.1, 0.15, 0.2, 0.25, 0.33],
83
+ [0.03, 0.03, 0.03, 0.05, 0.05, 0.1, 0.13, 0.2, 0.28, 0.36, 0.48, 0.64],
84
+ [0.03, 0.03, 0.03, 0.05, 0.08, 0.1, 0.15, 0.23, 0.3, 0.41, 0.53, 0.71],
85
+ [0.03, 0.03, 0.05, 0.08, 0.13, 0.2, 0.28, 0.41, 0.58, 0.76, 1.02, 1.32],
86
+ [0.03, 0.03, 0.03, 0.05, 0.1, 0.13, 0.2, 0.28, 0.41, 0.53, 0.71, 0.94],
87
+ [0.03, 0.05, 0.08, 0.1, 0.18, 0.25, 0.38, 0.56, 0.76, 1.02, 1.35, 1.75],
88
+ [0.03, 0.03, 0.05, 0.1, 0.15, 0.25, 0.36, 0.51, 0.71, 0.94, 1.24, 1.63],
89
+ [0.03, 0.08, 0.13, 0.2, 0.3, 0.46, 0.69, 0.97, 1.32, 1.8, 2.39, 3.05],
90
+ [0.03, 0.05, 0.08, 0.13, 0.2, 0.3, 0.43, 0.61, 0.86, 1.17, 1.52, 1.98],
91
+ [0.05, 0.08, 0.15, 0.23, 0.38, 0.56, 0.84, 1.17, 1.63, 2.18, 2.79, 3.81],
92
+ [0.03, 0.05, 0.1, 0.18, 0.28, 0.43, 0.64, 0.89, 1.24, 1.68, 2.21, 2.79],
93
+ [0.08, 0.13, 0.2, 0.33, 0.53, 0.81, 1.19, 1.7, 2.36, 3.3, 4.32, 5.59],
94
+ [0.05, 0.08, 0.13, 0.2, 0.33, 0.48, 0.71, 1.02, 1.4, 1.88, 2.49, 3.3],
95
+ [0.08, 0.13, 0.23, 0.38, 0.61, 0.91, 1.35, 1.93, 2.54, 3.56, 4.83, 6.1],
96
+ [0.05, 0.08, 0.15, 0.25, 0.41, 0.61, 0.89, 1.24, 1.73, 2.34, 3.05, 4.06],
97
+ [0.1, 0.18, 0.28, 0.48, 0.76, 1.14, 1.68, 2.39, 3.3, 4.57, 5.84, 7.62]],
98
+ 'cr9_printed_us_converted': [[1.0, 1.0, 1.0, 1.0, 1.0, 2.0, 3.0, 4.0, 5.0, 7.0, 9.0, 12.0],
99
+ [1.0, 1.0, 1.0, 1.0, 2.0, 3.0, 5.0, 7.0, 10.0, 13.0, 17.0, 23.0],
100
+ [1.0, 1.0, 1.0, 2.0, 2.0, 4.0, 6.0, 8.0, 11.0, 15.0, 19.0, 25.0],
101
+ [1.0, 1.0, 2.0, 3.0, 5.0, 7.0, 11.0, 15.0, 21.0, 28.0, 37.0, 48.0],
102
+ [1.0, 1.0, 1.0, 2.0, 3.0, 5.0, 7.0, 10.0, 14.0, 20.0, 26.0, 34.0],
103
+ [1.0, 1.0, 2.0, 4.0, 6.0, 10.0, 14.0, 20.0, 27.0, 37.0, 49.0, 64.0],
104
+ [1.0, 1.0, 2.0, 4.0, 6.0, 9.0, 13.0, 18.0, 25.0, 34.0, 45.0, 59.0],
105
+ [1.0, 2.0, 4.0, 7.0, 11.0, 17.0, 24.0, 35.0, 48.0, 65.0, 86.0, 110.0],
106
+ [1.0, 2.0, 3.0, 4.0, 7.0, 11.0, 16.0, 22.0, 31.0, 42.0, 55.0, 72.0],
107
+ [2.0, 3.0, 5.0, 9.0, 13.0, 20.0, 30.0, 42.0, 59.0, 79.0, 110.0, 140.0],
108
+ [1.0, 2.0, 4.0, 7.0, 10.0, 16.0, 23.0, 32.0, 45.0, 61.0, 80.0, 100.0],
109
+ [2.0, 4.0, 7.0, 12.0, 19.0, 30.0, 43.0, 61.0, 85.0, 120.0, 150.0, 200.0],
110
+ [1.0, 3.0, 4.0, 7.0, 12.0, 18.0, 26.0, 37.0, 51.0, 68.0, 90.0, 120.0],
111
+ [3.0, 5.0, 8.0, 14.0, 22.0, 33.0, 49.0, 69.0, 96.0, 130.0, 170.0, 220.0],
112
+ [2.0, 3.0, 6.0, 9.0, 14.0, 22.0, 32.0, 45.0, 63.0, 85.0, 110.0, 150.0],
113
+ [3.0, 6.0, 10.0, 17.0, 27.0, 41.0, 60.0, 86.0, 120.0, 160.0, 210.0, 280.0]],
114
+ 'cr9_printed_si': [[0.03, 0.03, 0.03, 0.03, 0.03, 0.05, 0.08, 0.1, 0.13, 0.18, 0.23, 0.3],
115
+ [0.03, 0.03, 0.03, 0.03, 0.05, 0.08, 0.13, 0.18, 0.25, 0.33, 0.43, 0.58],
116
+ [0.03, 0.03, 0.03, 0.05, 0.05, 0.1, 0.15, 0.2, 0.28, 0.38, 0.48, 0.64],
117
+ [0.03, 0.03, 0.05, 0.08, 0.13, 0.18, 0.28, 0.38, 0.53, 0.71, 0.94, 1.22],
118
+ [0.03, 0.03, 0.03, 0.05, 0.08, 0.13, 0.18, 0.25, 0.36, 0.51, 0.66, 0.86],
119
+ [0.03, 0.03, 0.05, 0.1, 0.15, 0.25, 0.36, 0.51, 0.69, 0.94, 1.24, 1.63],
120
+ [0.03, 0.03, 0.05, 0.1, 0.15, 0.23, 0.33, 0.46, 0.64, 0.86, 1.14, 1.5],
121
+ [0.03, 0.05, 0.1, 0.18, 0.28, 0.43, 0.61, 0.89, 1.22, 1.65, 2.18, 2.79],
122
+ [0.03, 0.05, 0.08, 0.1, 0.18, 0.28, 0.41, 0.56, 0.79, 1.07, 1.4, 1.83],
123
+ [0.05, 0.08, 0.13, 0.23, 0.33, 0.51, 0.76, 1.07, 1.5, 2.01, 2.79, 3.56],
124
+ [0.03, 0.05, 0.1, 0.18, 0.25, 0.41, 0.58, 0.81, 1.14, 1.55, 2.03, 2.54],
125
+ [0.05, 0.1, 0.18, 0.3, 0.48, 0.76, 1.09, 1.55, 2.16, 3.05, 3.81, 5.08],
126
+ [0.03, 0.08, 0.1, 0.18, 0.3, 0.46, 0.66, 0.94, 1.3, 1.73, 2.29, 3.05],
127
+ [0.08, 0.13, 0.2, 0.36, 0.56, 0.84, 1.24, 1.75, 2.44, 3.3, 4.32, 5.59],
128
+ [0.05, 0.08, 0.15, 0.23, 0.36, 0.56, 0.81, 1.14, 1.6, 2.16, 2.79, 3.81],
129
+ [0.08, 0.15, 0.25, 0.43, 0.69, 1.04, 1.52, 2.18, 3.05, 4.06, 5.33, 7.11]],
130
+ 'cr12_printed_us_converted': [[1.0, 1.0, 1.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 9.0, 11.0, 14.0],
131
+ [1.0, 1.0, 1.0, 1.0, 2.0, 3.0, 4.0, 6.0, 8.0, 11.0, 14.0, 18.0],
132
+ [1.0, 1.0, 1.0, 2.0, 2.0, 4.0, 5.0, 7.0, 9.0, 12.0, 15.0, 19.0],
133
+ [1.0, 1.0, 1.0, 2.0, 3.0, 4.0, 6.0, 9.0, 12.0, 15.0, 19.0, 25.0],
134
+ [1.0, 1.0, 1.0, 2.0, 3.0, 5.0, 7.0, 10.0, 13.0, 17.0, 22.0, 27.0],
135
+ [1.0, 1.0, 2.0, 3.0, 4.0, 6.0, 9.0, 12.0, 16.0, 21.0, 27.0, 34.0],
136
+ [1.0, 1.0, 2.0, 3.0, 5.0, 7.0, 10.0, 13.0, 18.0, 23.0, 30.0, 38.0],
137
+ [1.0, 2.0, 3.0, 4.0, 7.0, 10.0, 13.0, 18.0, 25.0, 32.0, 42.0, 53.0]],
138
+ 'cr12_printed_si': [[0.03, 0.03, 0.03, 0.03, 0.05, 0.08, 0.1, 0.13, 0.15, 0.23, 0.28, 0.36],
139
+ [0.03, 0.03, 0.03, 0.03, 0.05, 0.08, 0.1, 0.15, 0.2, 0.28, 0.36, 0.46],
140
+ [0.03, 0.03, 0.03, 0.05, 0.05, 0.1, 0.13, 0.18, 0.23, 0.3, 0.38, 0.48],
141
+ [0.03, 0.03, 0.03, 0.05, 0.08, 0.1, 0.15, 0.23, 0.3, 0.38, 0.48, 0.64],
142
+ [0.03, 0.03, 0.03, 0.05, 0.08, 0.13, 0.18, 0.25, 0.33, 0.43, 0.56, 0.69],
143
+ [0.03, 0.03, 0.05, 0.08, 0.1, 0.15, 0.23, 0.3, 0.41, 0.53, 0.69, 0.86],
144
+ [0.03, 0.03, 0.05, 0.08, 0.13, 0.18, 0.25, 0.33, 0.46, 0.58, 0.76, 0.97],
145
+ [0.03, 0.05, 0.08, 0.1, 0.18, 0.25, 0.33, 0.46, 0.64, 0.81, 1.07, 1.35]],
146
+ 'stainless_printed_us_converted': [[1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 2.0, 2.0],
147
+ [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 2.0, 2.0, 3.0],
148
+ [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 2.0, 2.0, 3.0, 3.0],
149
+ [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 2.0, 3.0, 3.0, 4.0],
150
+ [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 2.0, 3.0, 4.0, 5.0],
151
+ [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 3.0, 4.0, 5.0, 6.0],
152
+ [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0],
153
+ [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 2.0, 2.0, 4.0, 5.0, 7.0, 9.0]],
154
+ 'stainless_printed_si': [[0.03, 0.03, 0.03, 0.03, 0.03, 0.03, 0.03, 0.03, 0.03, 0.03, 0.05, 0.05],
155
+ [0.03, 0.03, 0.03, 0.03, 0.03, 0.03, 0.03, 0.03, 0.03, 0.05, 0.05, 0.08],
156
+ [0.03, 0.03, 0.03, 0.03, 0.03, 0.03, 0.03, 0.03, 0.05, 0.05, 0.08, 0.08],
157
+ [0.03, 0.03, 0.03, 0.03, 0.03, 0.03, 0.03, 0.03, 0.05, 0.08, 0.08, 0.1],
158
+ [0.03, 0.03, 0.03, 0.03, 0.03, 0.03, 0.03, 0.03, 0.05, 0.08, 0.1, 0.13],
159
+ [0.03, 0.03, 0.03, 0.03, 0.03, 0.03, 0.03, 0.03, 0.08, 0.1, 0.13, 0.15],
160
+ [0.03, 0.03, 0.03, 0.03, 0.03, 0.03, 0.03, 0.05, 0.08, 0.1, 0.13, 0.15],
161
+ [0.03, 0.03, 0.03, 0.03, 0.03, 0.03, 0.05, 0.05, 0.1, 0.13, 0.18, 0.23]]}
@@ -0,0 +1,174 @@
1
+ """Internal JSON worker for process-isolated optional native engines."""
2
+ import contextlib
3
+ from decimal import Decimal
4
+ import hashlib
5
+ import importlib
6
+ import importlib.metadata
7
+ import io
8
+ import json
9
+ import math
10
+ from pathlib import Path
11
+ import sys
12
+ from .core import DomainError, ensure, finite_tree
13
+ from .slabx_adapter import NativePool, NativePoolFootprint, NativeJet, NativeJetFootprint
14
+
15
+
16
+ def _fingerprint(package):
17
+ root = Path(importlib.import_module(package).__file__).parent
18
+ digest = hashlib.sha256()
19
+ for path in sorted(root.rglob("*.py")):
20
+ digest.update(path.relative_to(root).as_posix().encode())
21
+ digest.update(path.read_bytes())
22
+ return digest.hexdigest()
23
+
24
+
25
+ def run_native(x):
26
+ required = {"slabx":"1.0.8"}
27
+ if x.engine == "slabx-lh2":
28
+ required["slabx-lh2"] = "0.2.0"
29
+ versions = {}
30
+ for name,expected in required.items():
31
+ try:
32
+ versions[name] = importlib.metadata.version(name)
33
+ except importlib.metadata.PackageNotFoundError as exc:
34
+ raise DomainError("engine_not_configured",f"Optional package {name} not installed") from exc
35
+ ensure(versions[name] == expected,f"Native mapping requires {name}=={expected}; installed {versions[name]}","unsupported_engine_version")
36
+ from slabx.core.plume import run_dispersion
37
+ from slabx.core.source import EvaporatingPool, HorizontalJet
38
+ from slabx.post.concentration import concentration_field
39
+ from slabx.submodels.atmosphere import Atmosphere
40
+ from slabx.thermo.base import Substance, LegacyThermo, water_backend
41
+ s,a = x.substance,x.atmosphere
42
+ # Canonical decimal SI-prefix conversion avoids a one-ULP difference from
43
+ # a native kg/mol decimal literal changing the adaptive integration grid.
44
+ molecular_weight = float(Decimal(str(s.molecular_weight_kg_kmol))/Decimal(1000))
45
+ substance = Substance(name=s.fluid_id,mw=molecular_weight,
46
+ cp_vapour=s.vapor_heat_capacity_j_kg_k,cp_liquid=s.liquid_heat_capacity_j_kg_k,
47
+ dh_vap=s.latent_heat_j_kg,T_boil=s.normal_boiling_point_k,rho_liquid=s.liquid_density_kg_m3)
48
+ atmosphere = Atmosphere(u_ref=a.wind_speed_m_s,z_ref=a.wind_reference_height_m,T=a.temperature_k,
49
+ rh=a.relative_humidity_fraction*100,z0=a.roughness_length_m,stability=a.stability,p=a.pressure_pa_abs)
50
+ jet = isinstance(x,NativeJet)
51
+ buoyant_vertical = False
52
+ native_exit_velocity = None
53
+ if jet:
54
+ from slabx.core.vertical_jet import VerticalJet
55
+ source_type = HorizontalJet if x.orientation == "horizontal_downwind" else VerticalJet
56
+ source = source_type(substance=substance,rate=x.mass_source_rate_kg_s,area=x.jet_exit_area_m2,
57
+ duration=x.release_duration_s,liquid_fraction=x.jet_liquid_mass_fraction,T_source=x.source_temperature_k,height=x.release_height_m)
58
+ native_exit_velocity = source.exit_velocity(atmosphere)
59
+ if x.orientation == "vertical_up" and source.rho_source(atmosphere) <= atmosphere.rho:
60
+ # SLAB User's Guide Eq. 46a-46d: use an effective horizontal
61
+ # source at the Briggs buoyant rise height and neutralize source
62
+ # temperature/cp for downstream dispersion.
63
+ g = 9.80665
64
+ rho_s = source.rho_source(atmosphere)
65
+ ws = source.w_source(atmosphere)
66
+ bs = source.half_width_geometric
67
+ ua = atmosphere.wind_speed(max(x.release_height_m, 1.0))
68
+ ustar = max(atmosphere.u_star, 1e-9)
69
+ fb = (4.0 / math.pi) * g * (atmosphere.rho - rho_s) * ws * bs * bs / atmosphere.rho
70
+ h_rise = 0.0
71
+ for _ in range(30):
72
+ next_h = 1.2 * (fb / (ua * ustar * ustar)) ** (3.0 / 5.0) * (x.release_height_m + h_rise) ** (2.0 / 5.0)
73
+ h_rise = next_h
74
+ neutral_temperature = (molecular_weight / atmosphere.mw_moist) * atmosphere.T
75
+ neutral_cp = (atmosphere.mw_moist / molecular_weight) * atmosphere.cp_moist
76
+ neutral = Substance(name=f"{s.fluid_id}-neutralized", mw=molecular_weight,
77
+ cp_vapour=neutral_cp,cp_liquid=neutral_cp,dh_vap=s.latent_heat_j_kg,
78
+ T_boil=s.normal_boiling_point_k,rho_liquid=s.liquid_density_kg_m3)
79
+ source = HorizontalJet(substance=neutral,rate=x.mass_source_rate_kg_s,area=x.jet_exit_area_m2,
80
+ duration=x.release_duration_s,liquid_fraction=0.0,T_source=neutral_temperature,
81
+ height=x.release_height_m + h_rise)
82
+ buoyant_vertical = True
83
+ else:
84
+ source = EvaporatingPool(substance=substance,rate=x.vapor_source_rate_kg_s,area=x.source_area_m2,duration=x.release_duration_s)
85
+ water = water_backend()
86
+ correction = contextlib.nullcontext()
87
+ if x.engine == "slabx-lh2":
88
+ from slabx_lh2.water_ice import with_sublimation
89
+ from slabx_lh2.plume_width import plume_width_coupling
90
+ water = with_sublimation(water,p_ambient=a.pressure_pa_abs)
91
+ correction = plume_width_coupling(active=x.lh2_plume_width_coupling)
92
+ with correction:
93
+ trajectory,used = run_dispersion(source,atmosphere,LegacyThermo(source.substance),water,
94
+ x_max=x.plume_distance_limit_m,t_max=x.puff_time_limit_s,n_puff_steps=x.puff_steps)
95
+ field = concentration_field(trajectory,atmosphere,z=x.receptor_height_m,t_avg=x.averaging_time_s,
96
+ t_release=x.release_duration_s,meander_closure=x.meander_closure)
97
+ distance = [float(v) for v in field.x]
98
+ concentration = [float(v) for v in field.peak]
99
+ ensure(len(distance) == len(concentration) and 1 < len(distance) <= 100000,"Invalid native grid","engine_result_invalid")
100
+ ensure(all(math.isfinite(v) for v in distance) and all(math.isfinite(v) and 0 <= v <= 1 for v in concentration),
101
+ "Nonphysical native concentration/grid","engine_result_invalid")
102
+ ensure(all(b >= a for a,b in zip(distance,distance[1:])),"Nonmonotonic native grid","engine_result_invalid")
103
+ endpoint = float(field.distance_to(x.threshold_volume_fraction))
104
+ reached = any(v >= x.threshold_volume_fraction for v in concentration)
105
+ endpoint = endpoint if reached and math.isfinite(endpoint) else None
106
+ censored = concentration[-1] >= x.threshold_volume_fraction
107
+ premise,ratio = "not_evaluated",None
108
+ if x.engine == "slabx-lh2":
109
+ from slabx_lh2.diagnostics import premise_summary
110
+ diagnostic = premise_summary(trajectory)
111
+ ratio = diagnostic["max"]
112
+ ensure(math.isfinite(ratio),"LH2 premise diagnostic not finite","engine_result_invalid")
113
+ premise = "violated" if diagnostic["violated"] else "within_premise"
114
+ status = "premise_violated" if premise == "violated" else "boundary_censored" if censored else "interpolated" if reached else "not_reached"
115
+ output = {"engine":x.engine,"engine_versions":versions,"engine_source_fingerprints":{
116
+ name:_fingerprint(name.replace("-","_")) for name in versions},
117
+ "downwind_distance_m":distance,"centreline_volume_fraction":concentration,
118
+ "native_grid_maximum_downwind_distance_m":max(distance),
119
+ "native_threshold_distance_m":endpoint,"threshold_distance_m":endpoint if status == "interpolated" else None,
120
+ "threshold_status":status,"premise_status":premise,"maximum_vertical_to_horizontal_velocity_ratio":ratio,
121
+ "used_source_area_m2":float(used.area),"effective_source_half_width_m":float(used.half_width),
122
+ "averaging_time_s":x.averaging_time_s,"receptor_height_m":x.receptor_height_m,
123
+ "spatial_output_scope":"centreline_only_no_footprint_area"}
124
+ finite_tree(output)
125
+ if jet:
126
+ output.pop("effective_source_half_width_m")
127
+ output.update(orientation=x.orientation,jet_exit_area_m2=float(x.jet_exit_area_m2),
128
+ geometric_exit_half_width_m=float(x.jet_exit_area_m2 ** 0.5 / 2.0),native_exit_velocity_m_s=float(native_exit_velocity if buoyant_vertical else used.exit_velocity(atmosphere)),
129
+ requested_source_temperature_k=x.source_temperature_k,used_source_temperature_k=float(used.T),
130
+ source_temperature_clamped=float(used.T) != x.source_temperature_k,
131
+ native_jet_liquid_mass_fraction=float(used.liquid_fraction),native_initial_downwind_distance_m=distance[0],
132
+ native_near_field_status="briggs_buoyant_effective_horizontal_source" if buoyant_vertical else "not_reconstructed_before_native_handoff")
133
+ if isinstance(x,(NativePoolFootprint,NativeJetFootprint)):
134
+ import numpy as np
135
+ from .spatial import ConcentrationGrid, threshold_grid_area
136
+ ny = 2*x.crosswind_points_per_side-1
137
+ ensure(ny*len(distance) <= 1000000,"Native planar grid exceeds1000000 nodes","engine_result_invalid")
138
+ y = np.linspace(-x.crosswind_half_span_m,x.crosswind_half_span_m,ny)
139
+ values = np.asarray(field.at_y(y),dtype=float)
140
+ ensure(values.shape == (ny,len(distance)),"Native crosswind field shape mismatch","engine_result_invalid")
141
+ ensure(np.all(np.isfinite(values)) and np.all((values >= 0)&(values <= 1)),"Nonphysical native spatial concentrations","engine_result_invalid")
142
+ grid = ConcentrationGrid(downwind_coordinates_m=distance,crosswind_coordinates_m=y.tolist(),
143
+ volume_fraction_by_crosswind_then_downwind=values.tolist(),threshold_volume_fraction=x.threshold_volume_fraction,
144
+ sampling_basis="Native ConcentrationField.at_y at common z/t_avg and source; main-diagonal triangular interpolation")
145
+ footprint = threshold_grid_area(grid)
146
+ if premise == "violated":
147
+ footprint["threshold_area_m2"] = None
148
+ footprint["footprint_status"] = "premise_violated"
149
+ output.update(footprint)
150
+ output.update(crosswind_distance_m=y.tolist(),volume_fraction_by_crosswind_then_downwind=values.tolist(),
151
+ spatial_output_scope="planar_sampled_threshold_field")
152
+ return output
153
+
154
+
155
+ def main():
156
+ try:
157
+ payload = json.loads(sys.stdin.read())
158
+ operation = payload.pop("_operation","centreline")
159
+ models = {"centreline":NativePool,"footprint":NativePoolFootprint,"jet_centreline":NativeJet,"jet_footprint":NativeJetFootprint}
160
+ ensure(operation in models,"Unknown native worker operation","engine_protocol_failure")
161
+ request = models[operation].model_validate(payload)
162
+ diagnostics = io.StringIO()
163
+ with contextlib.redirect_stdout(diagnostics), contextlib.redirect_stderr(diagnostics):
164
+ result = run_native(request)
165
+ result["native_messages"] = diagnostics.getvalue()
166
+ print(json.dumps(result,allow_nan=False))
167
+ except Exception as exc:
168
+ code = exc.code if isinstance(exc,DomainError) else "engine_execution_failed"
169
+ print(json.dumps({"code":code,"error":str(exc)},ensure_ascii=True))
170
+ raise SystemExit(1)
171
+
172
+
173
+ if __name__ == "__main__":
174
+ main()