Skip to content

Rework temperature-dependent Henry's Law constant#903

Merged
boulderdaze merged 6 commits into
mainfrom
892-temperature-dependent-henrys-law-constant
Jan 27, 2026
Merged

Rework temperature-dependent Henry's Law constant#903
boulderdaze merged 6 commits into
mainfrom
892-temperature-dependent-henrys-law-constant

Conversation

@boulderdaze
Copy link
Copy Markdown
Collaborator

@boulderdaze boulderdaze commented Jan 27, 2026

This PR:

Note: The struct uses more descriptive parameter names than other places. If consistency is preferred, I can change this to the generic A, B, C parameter form.

  /// @brief Henry's Law constant parameters
  struct HenrysLawConstantParameters
  {
    /// @brief Henry's Law constant for the species at the reference temperature [mol L-1 atm-1]
    double H_ref_{ 1.3e-3 };
    /// @brief Enthalpy of dissolution for the species in solution [J/mol)]
    double enthalpy_{ -12000.0 };
    /// @brief The standard reference tempearture [K]
    double temperature_ref_ { 298.15 };
  };

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR modernizes the Henry's Law constant implementation to support temperature-dependent gas-particle partitioning equilibrium based on issue #892. The changes simplify the API by removing pH estimation and switching from multiple dissociation products (Yield) to a single condensed species (Species).

Changes:

  • Replaces HenrysLawCoefficient with HenrysLawConstant using van 't Hoff temperature dependence
  • Removes the placeholder PhaseTransferCoefficient class
  • Updates PhaseTransferProcess API to use Species instead of std::vector<Yield> for condensed species

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
include/micm/process/transfer_coefficient/henrys_law_constant.hpp New implementation of temperature-dependent Henry's Law constant using van 't Hoff equation
include/micm/process/transfer_coefficient/henrys_law_coefficient.hpp Removed old pH-dependent coefficient implementation
include/micm/process/transfer_coefficient/phase_transfer_coefficient.hpp Removed placeholder class
include/micm/process/phase_transfer_process.hpp Updated to use single Species instead of vector of Yield for condensed species
include/micm/process/phase_transfer_process_builder.hpp Updated builder API to accept Species instead of Yield for condensed species
include/micm/Process.hpp Updated includes to reference new HenrysLawConstant instead of removed classes
test/unit/process/transfer_coefficient/test_henrys_law_constant.cpp New comprehensive tests for temperature-dependent Henry's Law constant
test/unit/process/transfer_coefficient/test_henrys_law_coefficient.cpp Removed tests for old pH-dependent implementation
test/unit/process/test_process.cpp Updated tests to use new API with Species instead of Yield
test/unit/process/transfer_coefficient/CMakeLists.txt Updated test configuration to build new test file

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread include/micm/process/phase_transfer_process_builder.hpp Outdated
Comment thread include/micm/process/transfer_coefficient/henrys_law_constant.hpp Outdated
Comment thread include/micm/process/phase_transfer_process_builder.hpp Outdated
Comment thread include/micm/process/transfer_coefficient/henrys_law_constant.hpp Outdated
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Jan 27, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.75%. Comparing base (7f51575) to head (24d6a9c).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #903      +/-   ##
==========================================
+ Coverage   94.66%   94.75%   +0.09%     
==========================================
  Files          66       65       -1     
  Lines        3245     3225      -20     
==========================================
- Hits         3072     3056      -16     
+ Misses        173      169       -4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@boulderdaze boulderdaze added this to the Cloud Chemistry milestone Jan 27, 2026
@boulderdaze boulderdaze marked this pull request as ready for review January 27, 2026 04:11
@boulderdaze boulderdaze merged commit 39951e6 into main Jan 27, 2026
26 checks passed
@boulderdaze boulderdaze deleted the 892-temperature-dependent-henrys-law-constant branch January 27, 2026 21:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants