SimVascular / svZeroDSolver

A C++ lumped-parameter solver for blood flow and pressure in hemodynamic networks
Other
6 stars 18 forks source link

We should test time integration in simple test cases #99

Open menon-karthik opened 7 months ago

menon-karthik commented 7 months ago

Description

The current tests which have pulsatile boundary conditions only compare the first time step with an expected/analytical solution. We should be testing them against analytical/semi-analytical solution at multiple time steps to make sure the integration is being tested.

Reproduction

Example for RCR BC test case: https://github.com/SimVascular/svZeroDSolver/blob/06d2f2485cc7415c8be2e0a75e76719943f66216/tests/test_solver.py#L294-L298

Example for coronary BC test case: https://github.com/SimVascular/svZeroDSolver/blob/06d2f2485cc7415c8be2e0a75e76719943f66216/tests/test_solver.py#L310-L314

In both the tests above, only timestep 0 is compared with the reference solution.

Expected behavior

For simple test cases, such as the RCR and coronary BC blocks, we should compare with semi-analytical solutions. We can write out the governing equations for specific quantities (inlet pressure, for example) and integrate them in time using simple Euler/RK schemes to compute a reference solution to compare against.

Additional context

This is related to #95

Code of Conduct