Skip to content

Commit

Permalink
Use logger object instead of logging module
Browse files Browse the repository at this point in the history
  • Loading branch information
jnettels authored Oct 23, 2023
1 parent bd3d8cb commit a186ee2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions dhnx/optimization/precalc_hydraulic.py
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,7 @@ def v_max_secant(d_i, T_average, k=0.1, p_max=100, p_epsilon=1,
v_0 = v_1
v_1 = v_new

logging.info(
logger.info(
"Maximum flow velocity calculated. Iterations: %d, "
"Flow velocity: %.4f [m/s], Pressure drop: %.4f [Pa/m]"
% (n, v_new, p_new)
Expand Down Expand Up @@ -579,11 +579,11 @@ def v_max_bisection(d_i, T_average, k=0.1, p_max=100,
pressure=pressure, fluid=fluid)

if abs(p_new - p_max) < p_epsilon:
logging.info("Bi-section method: p_epsilon criterion reached.")
logger.info("Bi-section method: p_epsilon criterion reached.")
break

if abs(v_1 - v_0) < v_epsilon: # wieso v_1 und v_0?
logging.info("Bi-section method: v_epsilon criterion reached.")
logger.info("Bi-section method: v_epsilon criterion reached.")
break

else:
Expand All @@ -594,7 +594,7 @@ def v_max_bisection(d_i, T_average, k=0.1, p_max=100,
else:
v_0 = v_new

logging.info(
logger.info(
"Maximum flow velocity calculated. Iterations: %d, "
"Flow velocity: %.4f [m/s], Pressure drop: %.4f [Pa/m]"
% (n, v_new, p_new)
Expand Down

0 comments on commit a186ee2

Please sign in to comment.