Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add fluid density parameter for Reynolds number calculation #53

Merged
merged 1 commit into from
Sep 14, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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