Skip to content

Commit

Permalink
Remove compute_flow_rate function and use the one in VaMPy instead
Browse files Browse the repository at this point in the history
  • Loading branch information
johannesring committed Aug 31, 2023
1 parent a662a42 commit a997ce5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 32 deletions.
4 changes: 2 additions & 2 deletions src/fsipy/automatedPreprocessing/automated_preprocessing.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@
from vampy.automatedPreprocessing import ToolRepairSTL
from vampy.automatedPreprocessing.preprocessing_common import read_polydata, get_centers_for_meshing, \
dist_sphere_diam, dist_sphere_curvature, dist_sphere_constant, get_regions_to_refine, add_flow_extension, \
write_mesh, mesh_alternative, find_boundaries, setup_model_network, \
write_mesh, mesh_alternative, find_boundaries, compute_flow_rate, setup_model_network, \
radiusArrayName, scale_surface, get_furtest_surface_point, check_if_closed_surface
from vampy.automatedPreprocessing.simulate import run_simulation
from vampy.automatedPreprocessing.visualize import visualize_model

from fsipy.automatedPreprocessing.preprocessing_common import generate_mesh, distance_to_spheres_solid_thickness, \
dist_sphere_spheres, convert_xml_mesh_to_hdf5, convert_vtu_mesh_to_xdmf, compute_flow_rate
dist_sphere_spheres, convert_xml_mesh_to_hdf5, convert_vtu_mesh_to_xdmf


def run_pre_processing(input_model, verbose_print, smoothing_method, smoothing_factor, smoothing_iterations,
Expand Down
30 changes: 0 additions & 30 deletions src/fsipy/automatedPreprocessing/preprocessing_common.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from typing import List, Dict
from pathlib import Path

import meshio
Expand Down Expand Up @@ -251,32 +250,3 @@ def convert_vtu_mesh_to_xdmf(file_name_vtu_mesh: str, file_name_xdmf_mesh: str)

print(f"Tetra mesh XDMF file written to: {tetra_xdmf_path}")
print(f"Triangle mesh XDMF file written to: {triangle_xdmf_path}\n")


def compute_flow_rate(is_atrium: bool, inlet: List[float], parameters: Dict[str, float],
flow_rate_factor: float) -> float:
"""
Computes mean flow rate used as a boundary condition for pulsatile flow condition
Args:
is_atrium (bool): Determines if model is atrium or artery
inlet (list): List of points representing midpoint of boundaries
parameters (dict): Dictionary containing model parameters
flow_rate_factor (float): Factor to adjust flow rate calculation
Returns:
mean_inflow_rate (float): Mean inflow rate
"""
if is_atrium:
# Calculate total inlet area for atrium case
total_inlet_area = 0.0
num_inlets = len(inlet)
for i in range(num_inlets):
inlet_area_key = "inlet{}_area".format(i)
total_inlet_area += parameters.get(inlet_area_key, 0)
mean_inflow_rate = flow_rate_factor * total_inlet_area
else:
# Use single inlet area for artery case
mean_inflow_rate = flow_rate_factor * parameters.get("inlet_area", 0)

return mean_inflow_rate

0 comments on commit a997ce5

Please sign in to comment.