Skip to content

Commit

Permalink
Add fluid density parameter for Reynolds number calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
johannesring committed Sep 14, 2023
1 parent 60f344f commit 3dd7f28
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/fsipy/simulations/simulation_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ def local_project(f: Function, V: FunctionSpace, local_rhs: bool = False) -> Fun


def calculate_and_print_flow_properties(dt: float, mesh: Mesh, v: Function, inlet_area: float, mu_f: float,
n: Expression, dsi: Measure, local_rhs: bool = False) -> None:
rho_f: float, n: Expression, dsi: Measure, local_rhs: bool = False) -> None:
"""
Calculate and print flow properties.
Expand All @@ -250,6 +250,7 @@ def calculate_and_print_flow_properties(dt: float, mesh: Mesh, v: Function, inle
v (dolfin.Function): Velocity field.
inlet_area (float): Inlet area.
mu_f (float): Fluid dynamic viscosity.
rho_f (float): Fluid density.
n (dolfin.Expression): FacetNormal expression.
dsi (dolfin.Measure): Measure for inlet boundary.
local_rhs (bool, optional): If True, solve using a local right-hand side assembly.
Expand Down Expand Up @@ -285,9 +286,9 @@ def calculate_and_print_flow_properties(dt: float, mesh: Mesh, v: Function, inle

# Calculate diameter at the inlet and Reynolds numbers
diam_inlet = np.sqrt(4 * inlet_area / np.pi)
Re_mean = v_mean * diam_inlet / mu_f
Re_min = v_min * diam_inlet / mu_f
Re_max = v_max * diam_inlet / mu_f
Re_mean = rho_f * v_mean * diam_inlet / mu_f
Re_min = rho_f * v_min * diam_inlet / mu_f
Re_max = rho_f * v_max * diam_inlet / mu_f

# Calculate CFL numbers
CFL_mean = v_mean * dt / h
Expand Down

0 comments on commit 3dd7f28

Please sign in to comment.