Decompose ClosedLoopHeartPulmonary#219
Open
mrp089 wants to merge 21 commits intoSimVascular:masterfrom
Open
Conversation
…ps in the first cardiac cycle
Replace ClosedLoopHeartPulmonary references in new files with citations to the original papers (Sankaran 2012, Menon 2023). Add comparison test script with plots for aortic pressure/flow, PV loops, valve flows, dQ/dt, and chamber volumes. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add closedLoopHeart_singleVessel_decomposed.json to pytest test suite with stored reference results. Remove standalone comparison script. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add parameter mapping comments referencing Sankaran 2012 and Menon 2023. Document correspondence between monolithic and decomposed parameters for chambers, valves, pulmonary vasculature, and systemic circulation. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Extract the exponential passive P-V relation (for atrial chambers) into a separate ChamberElastanceInductorExponential class that inherits from ChamberElastanceInductor. This removes if/else branching on Kxp==0 and makes the two physical models (linear vs exponential passive P-V) explicit through the type system. - ChamberElastanceInductor: linear E(t)*(V-Vrest) model - ChamberElastanceInductorExponential: adds Kxp, Kxv, Vaso parameters for exponential passive pressure (Sankaran 2012, Menon 2023) Base class provides a protected constructor for derived classes and virtual get_elastance_values() for the elastance computation. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Remove Emin, Vrd, Vrs, Vrest from ChamberElastanceInductorExponential since the exponential P-V relation only uses Emax, Kxp, Kxv, Vaso. Override update_constant to use own parameter indices for Impedance. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Member
Author
menon-karthik
requested changes
Mar 28, 2026
1 task
src/model/BlockType.h
Outdated
| open_loop_coronary_var_res_bc = 19, | ||
| open_loop_coronary_detailed_bc = 20, | ||
| blood_vessel_rc = 21, | ||
| closed_loop_heart_pulmonary_smooth = 22, |
Member
There was a problem hiding this comment.
Is this required since there is not going to be a combined block?
Member
Author
There was a problem hiding this comment.
I used those blocks during debugging and accidentally left them in here. There's now blood_vessel_rc and chamber_elastance_inductor_exponential remaining, since these are the parts of closed_loop_heart_pulmonary that were not available individually.
menon-karthik
requested changes
Apr 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Current situation
Addresses #218. The monolithic
ClosedLoopHeartAndPulmonaryblock combines four chambers, four valves, and the pulmonary vasculature into a single block with hard-coded internal wiring. This makes it difficult to modify individual components and duplicates physics already available in standalone blocks.The
ClosedLoopHeartAndPulmonaryis still present, as removing it will affect more parts of the code, and will be part of a future PR.Release Notes
ChamberElastanceInductorExponentialblock for atrial chambers with exponential passive pressure-volume relation (Sankaran 2012, Menon 2023)BloodVesselRCblock for flow-through RC windkessel (pulmonary vasculature)ChamberElastanceInductor,ValveTanh,BloodVessel, andBloodVesselRCblocksDocumentation
ChamberElastanceInductorExponentialheader documents the exponential P-V governing equations and parameter listBloodVesselRCheader documents the flow-through windkessel equations with reference to Sankaran 2012Testing
closedLoopHeart_singleVessel_decomposed.jsonadded to the pytest suite with stored reference solutionchamber_elastance_inductor.jsontest passes (linear model unchanged)Code of Conduct & Contributing Guidelines