Mathematical modelling of flow through shunts: application to patent ductus arteriosus and side-to-side anastomosis