Skip to content

Fix nonisothermal pressure-temperature rate coupling - #3

Open
mtap-research wants to merge 1 commit into
mainfrom
agent/nonisothermal-solver-correctness
Open

Fix nonisothermal pressure-temperature rate coupling#3
mtap-research wants to merge 1 commit into
mainfrom
agent/nonisothermal-solver-correctness

Conversation

@mtap-research

@mtap-research mtap-research commented Jul 17, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • solve the nonisothermal pressure and temperature rates simultaneously instead of evaluating the pressure-work energy term against the zero-initialized pressure derivative
  • share the algebraic coupling kernel between the IAST and EDSL nonisothermal solvers
  • add regression tests for both governing balances, the uncoupled limit, and invalid input shapes
  • include the new kernel in MATLAB coverage and repository hygiene checks

Why

The energy balance contains dT/dtau = A - c*dP/dtau, while the pressure balance contains dP/dtau = B + (P/T)*dT/dtau. Previously dTdt5 was evaluated before dPdt was assembled, so the pressure-work term always used the zero-initialized derivative. The new helper solves the two local algebraic equations together:

dT/dtau = (A - c*B) / (1 + c*P/T)

dP/dtau = B + (P/T)*dT/dtau

Validation

  • git diff --check
  • python ci/check_repository.py
  • 3 new MATLAB unit tests
  • MATLAB execution is delegated to this PR's Linux/Windows CI because MATLAB/Octave is not installed in the local work environment

Scope

This PR intentionally isolates the solver-correctness fix. Removing the remaining global IAST warm-start cache, formalizing input units, and adding full-run golden breakthrough baselines should be separate follow-ups so their numerical/performance effects can be reviewed independently.

Summary by CodeRabbit

  • New Features

    • Added coupled pressure–temperature rate calculations for improved numerical consistency.
    • Added validation for invalid values, dimensions, and calculation results.
  • Bug Fixes

    • Updated non-isothermal adsorption calculations to use the coupled pressure and temperature rates.
  • Tests

    • Added regression coverage for coupling accuracy, uncoupled behavior, and invalid input shapes.

@coderabbitai

coderabbitai Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: fdfa56e4-d7f1-44db-ab3b-f6beba5e4034

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)

✅ Unit Test PR creation complete.

  • Create PR with unit tests
  • Commit unit tests in branch agent/nonisothermal-solver-correctness

Comment @coderabbitai help to get the list of available commands.

@coderabbitai

coderabbitai Bot commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

Note

Unit test generation is a beta feature. Expect some limitations and changes as we gather feedback and continue to improve it.


Generating unit tests... This may take up to 20 minutes.

@coderabbitai

coderabbitai Bot commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

✅ Created PR with unit tests: #7

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.

1 participant