Skip to content

Conversation

@boulderdaze
Copy link
Collaborator

@boulderdaze boulderdaze commented Jan 6, 2026

When a species like CO2 exists in multiple modes/sections, the current MICM API cannot handle which instance it needs to react.

This PR:

  • Adds the ability to set an aerosol-phase-specific scope for species during solver construction.
    For example, CO2 can exist in gas phase, or in a mode/section-phase-specific form.
  CO2
  ACCUMULATION.ORGANIC.CO2
  AITKEN.AQUEOUS.CO2

Copy link
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 adds aerosol-phase-specific scoping functionality to the chemical reaction builder, allowing species names to be prefixed with aerosol mode and phase identifiers. This enables the solver to distinguish between the same chemical species in different aerosol phases and modes.

Key Changes:

  • Introduced SetAerosolScope method to enable automatic scoping of reactant and product species names
  • Modified SetReactants and SetProducts methods to apply scoping when enabled
  • Added comprehensive test coverage for the new scoping functionality

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.

File Description
test/unit/process/test_aerosol_scope.cpp New test file with 4 test cases covering various scoping scenarios including single/multiple reactants and products
test/unit/process/CMakeLists.txt Registers the new test file in the build system
include/micm/process/chemical_reaction_builder.hpp Implements the aerosol scoping functionality with new methods and modified builder pattern methods

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

@codecov-commenter
Copy link

codecov-commenter commented Jan 6, 2026

Codecov Report

❌ Patch coverage is 92.68293% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 94.64%. Comparing base (33e7f7a) to head (b8b1f00).

Files with missing lines Patch % Lines
include/micm/process/process_error.hpp 33.33% 2 Missing ⚠️
include/micm/process/chemical_reaction_builder.hpp 97.36% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #891      +/-   ##
==========================================
+ Coverage   94.36%   94.64%   +0.27%     
==========================================
  Files          65       65              
  Lines        3197     3231      +34     
==========================================
+ Hits         3017     3058      +41     
+ Misses        180      173       -7     

☔ 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.

Copy link
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

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


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

@boulderdaze boulderdaze marked this pull request as ready for review January 6, 2026 04:36
Copy link
Collaborator

@K20shores K20shores left a comment

Choose a reason for hiding this comment

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

I don't understand why we need the scope. The issue mentioned in #888 was that a species in a phase couldn't be found and said nothing about a scope. Wouldn't this be fixed only by updating the species name?

species.name_ = phase.name_ + "." + species.name_;

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.

Non-gas-phase Species not found when constructing ProcessSet

4 participants