Skip to content

Conversation

@bayc
Copy link
Collaborator

@bayc bayc commented Dec 18, 2025

Add HX performance and cost components

This PR adds a simple heat exchanger model, along with a preliminary cost-scaling model.

Section 1: Type of Contribution

  • Feature Enhancement
    • Framework
    • New Model
    • Updated Model
    • Tools/Utilities
    • Other (please describe):
  • Bug Fix
  • Documentation Update
  • CI Changes
  • Other (please describe):

Section 2: Draft PR Checklist

  • Open draft PR
  • Describe the feature that will be added
  • Fill out TODO list steps
  • Describe requested feedback from reviewers on draft PR
  • Complete Section 7: New Model Checklist (if applicable)

TODO:

  • Have TLDRD team review implementation of model.
  • Add documentation.
  • Determine whether an example is needed now or later (once other heat components get added).
  • Re-work the tests to be more streamlined in the checking of asserts.
  • Ask for reviews from H2I team once above are complete.

Type of Reviewer Feedback Requested (on Draft PR)

Structural feedback:

  • Feedback on the addition of a heat folder to the converters directory.

Implementation feedback:

  • Feedback on the testing methods once they are updated (not yet).

Other feedback:

Section 3: General PR Checklist

  • PR description thoroughly describes the new feature, bug fix, etc.
  • Added tests for new functionality or bug fixes
  • Tests pass (If not, and this is expected, please elaborate in the Section 6: Test Results)
  • Documentation
    • Docstrings are up-to-date
    • Related docs/ files are up-to-date, or added when necessary
    • Documentation has been rebuilt successfully
    • Examples have been updated (if applicable)
  • CHANGELOG.md has been updated to describe the changes made in this PR

Section 3: Related Issues

Section 4: Impacted Areas of the Software

Section 4.1: New Files

  • path/to/file.extension
    • method1: What and why something was changed in one sentence or less.

Section 4.2: Modified Files

  • path/to/file.extension
    • method1: What and why something was changed in one sentence or less.

Section 5: Additional Supporting Information

Section 6: Test Results, if applicable

Section 7 (Optional): New Model Checklist

  • Model Structure:
    • Follows established naming conventions outlined in docs/developer_guide/coding_guidelines.md
    • Used attrs class to define the Config to load in attributes for the model
      • If applicable: inherit from BaseConfig or CostModelBaseConfig
    • Added: initialize() method, setup() method, compute() method
      • If applicable: inherit from CostModelBaseClass
  • Integration: Model has been properly integrated into H2Integrate
    • Added to supported_models.py
    • If a new commodity_type is added, update create_financial_model in h2integrate_model.py
  • Tests: Unit tests have been added for the new model
    • Pytest-style unit tests
    • Unit tests are in a "test" folder within the folder a new model was added to
    • If applicable add integration tests
  • Example: If applicable, a working example demonstrating the new model has been created
    • Input file comments
    • Run file comments
    • Example has been tested and runs successfully in test_all_examples.py
  • Documentation:
    • Write docstrings using the Google style
    • Model added to the main models list in docs/user_guide/model_overview.md
      • Model documentation page added to the appropriate docs/ section
      • <model_name>.md is added to the _toc.yml

@bayc bayc self-assigned this Dec 18, 2025
@bayc bayc added enhancement New feature or request in progress labels Dec 18, 2025
@bayc bayc marked this pull request as draft December 18, 2025 19:58
@bayc bayc force-pushed the feature/heat_exchanger branch 5 times, most recently from 5cf34b2 to 8c1bcb7 Compare December 18, 2025 20:50
@bayc bayc force-pushed the feature/heat_exchanger branch from 8c1bcb7 to a693f1c Compare December 18, 2025 20:58


class ShellTubeHXCostModel(CostModelBaseClass):
"""_summary_
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove autodoc string language.

expected_epsilon = 0.5421484468743297
expected_pump_power_kW = 0.28157427036731625

assert Q_total_kW == approx(expected_Q_total_kW, rel=1e-2)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make tolerances uniform.

@elenya-grant elenya-grant self-requested a review January 22, 2026 20:39
"""_summary_
This is a very simple placeholder cost model:

- Reference: 240,000 USD for a 1 MW HX with U ~ 1000 W/m²-K

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know the source for this function, I would rather use something from a chemical plant design handbook.
From Sinott and Towler (2021):
U-tube shell and tube HX:
a+b*S^n
a = 28000
b = 54
n = 1.2
S - heat transfer area in m^2
limits: 10 m^2 <= S <= 1000 m^2

This is in CEPCI index = 532.9 so need to be converted (it's for Jan. 2010)
It also assums simple carbon steel, so we need to account for materials once temperatures are higher
For the OpEx I am not sure we want to include it in a cost function, this should be in the general economic calculation (like ProFAST)

exp_Q = inputs["exp_Q"][0]

scale_Q = (Q_total_W / Q_ref) ** exp_Q if Q_total_W > 0 else 0.0
capex = C_ref * scale_Q

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to add installation factor in here, or are those things usually accounted for elsewhere in H2I analysis?
I think in ther steel paper at least the cost functions are for totat installed costs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request in progress

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants