Skip to content

Add utility for initializing RCR boundary conditions - #613

Open
taeoukkim wants to merge 1 commit into
SimVascular:mainfrom
taeoukkim:add-rcr-initialization-utility
Open

Add utility for initializing RCR boundary conditions#613
taeoukkim wants to merge 1 commit into
SimVascular:mainfrom
taeoukkim:add-rcr-initialization-utility

Conversation

@taeoukkim

Copy link
Copy Markdown
Contributor

Current situation

This PR adds the Python utility requested for initializing RCR boundary
conditions in svMultiPhysics simulations.

The utility calculates a common phase-aware RCR initial capacitor pressure
using an inflow waveform and the RCR parameters defined in solver.xml.
It then updates the Initial_pressure value for all detected RCR outlets.

Release Notes

  • Add a Python utility for calculating phase-aware RCR initial pressure.
  • Automatically detect a single .flow file in the working directory.
  • Automatically identify RCR boundary conditions in solver.xml.
  • Create a backup before updating solver.xml.
  • Write a CSV summary of the calculated outlet pressures.

Documentation

A README is included with requirements, usage instructions, and output files.

@taeoukkim
taeoukkim requested review from aabrown100-git and ktbolt and a lite review from Copilot August 21, 2026 22:46

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 introduces a new Python utility under utilities/initialize_rcr_boundary_conditions/ to compute a phase-aware initial capacitor pressure for RCR boundary conditions from an inflow .flow waveform and an svMultiPhysics solver.xml, then optionally update all detected RCR outlets’ <Initial_pressure> values.

Changes:

  • Add calculate_rcr_initial_pressure.py to detect a single .flow, parse RCR outlets from solver.xml, compute periodic Pc*(0), and update <Initial_pressure> (with backup + CSV summary).
  • Add a README with usage, expected inputs, and output artifacts.

Reviewed changes

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

File Description
utilities/initialize_rcr_boundary_conditions/calculate_rcr_initial_pressure.py Implements flow detection, RCR parsing, Pc*(0) calculation, CSV summary, and solver.xml update/backup logic.
utilities/initialize_rcr_boundary_conditions/README.md Documents requirements, CLI usage, and generated outputs for the new utility.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +522 to +524
old_initial_pressure=float(
initial_pressure_element.text.strip()
),
Comment on lines +863 to +864
if output_path is None:

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.

2 participants