Skip to content

Commit c1d3d5a

Browse files
committed
Add LV circulation example
1 parent b78379d commit c1d3d5a

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

demo/time_dependent_land_circ_lv.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,12 +104,16 @@
104104
)
105105
robin_base = fenicsx_pulse.RobinBC(value=alpha_base, marker=geometry.markers["BASE"][0])
106106

107+
# For the pressure we use a Lagrange multiplier method to enforce a given volume. The resulting Lagrange multiplier will be the pressure in the cavity.
108+
# To do this we create a `Cavity` object with a given volume, and specify which marker to use for the boundary condition.
107109

108110
initial_volume = geometry.volume("ENDO")
109111
volume = dolfinx.fem.Constant(geometry.mesh, dolfinx.default_scalar_type(initial_volume))
110112
cavity = fenicsx_pulse.problem.Cavity(marker="ENDO", volume=volume, pressure_name="p_LV", volume_name="V_LV", scale_volume=1e6, scale_pressure=0.0075)
111113
parameters = {"base_bc": fenicsx_pulse.problem.BaseBC.free, "mesh_unit": "m"}
112114

115+
# Next we set up the problem. We can choose between a static and a dynamic problem by setting the `static` variable to `True` or `False`. Currently the dynamic problem is not working (when coupled to a circulation model), so we will use the static problem for now.
116+
113117
static = True
114118

115119
if static:
@@ -138,6 +142,8 @@
138142
log.set_log_level(log.LogLevel.INFO)
139143
problem.solve()
140144

145+
# Next we will load the 0D cell model and run it to steady state. Here we use `gotranx` to load the ode, remove potential singularities and convert it to Python code. We then run the model for 200 beats and save the state of the model at the end of the simulation. We also plot the results. Note also that we extract the index of the active tension (`Ta`) which will be used to drive the 3D model.
146+
141147
ode = gotranx.load_ode("TorOrdLand.ode")
142148
ode = ode.remove_singularities()
143149
code = gotranx.cli.gotran2py.get_code(

0 commit comments

Comments
 (0)