SimVascular / svZeroDSolver

A C++ lumped-parameter solver for blood flow and pressure in hemodynamic networks
https://simvascular.github.io/documentation/rom_simulation.html#0d-solver
Other
7 stars 18 forks source link

Add hyperbolic tangent valve #76

Closed menon-karthik closed 11 months ago

menon-karthik commented 11 months ago

@kharold23, @aabrown100-git and I are working on implementing a valve block. This will be modeled as a non-linear hyperbolic tangent resistor, similar to equations 16 and 22 in this paper by our illustrious @mrp089: https://link.springer.com/article/10.1007/s10237-018-1098-4

The parameters will be the minimum resistance, maximum resistance, and steepness of the tanh function. The required inputs from the json file will be these three parameters and the names of the upstream and downstream blocks it is connected to, which could generally be vessels, junctions, BCs, etc.

mrp089 commented 11 months ago

Haha, I'd be highly vigilant in implementing methods from these authors.

Very cool! The idea would be that I can piece together circuits with valves in the input file? Or would a Block (like ClosedLoopHeartPulmonary) use this internally?

mrp089 commented 11 months ago

I'm still working on #71/#70 (in this branch), which will change how new blocks are added. But please go ahead with your new block and we'll deal with any conflicts at the merge!

menon-karthik commented 11 months ago

Haha, I'd be highly vigilant in implementing methods from these authors.

Very cool! The idea would be that I can piece together circuits with valves in the input file? Or would a Block (like ClosedLoopHeartPulmonary) use this internally?

Way to throw your co-authors user the bus!

The idea would be to piece together circuits with valves and other things to achieve something like ClosedLoopHeartPulmonary, but in a more modular fashion. Currently, ClosedLoopHeartPulmonary has a many features that could have been useful for other people who want similar closed-loop models but not exactly the same model. Unfortunately, I implemented it as a monolithic block so users cannot easily rearrange it to get similar models (which I regret). So when @kharold23 and @aabrown100-git said they wanted to implement another closed-loop model, we decided it would be good to do it as an arrangement of separate blocks. In their case, the valve is the only new block required and the rest of it is RCR/vessel blocks (I think?), so it wasn't extra work.

I'm still working on #71/#70 (in this branch), which will change how new blocks are added. But please go ahead with your new block and we'll deal with any conflicts at the merge!

Yup I realized #70 / #71 might conflict, but I figured this is an easy enough block that it should be easy to resolve.