wolfhece.bernoulli.losses_jax

Author: HECE - University of Liege, Pierre Archambeau Date: 2024

Copyright (c) 2024 University of Liege. All rights reserved.

This script and its content are protected by copyright law. Unauthorized copying or distribution of this file, via any medium, is strictly prohibited.

Module Contents

wolfhece.bernoulli.losses_jax.dichotomy(f, abi: jax.numpy.array, args: jax.numpy.array, tol: jax.numpy.array = jnp.array([1e-08]), max_iter: jax.numpy.array = jnp.array([1000]))[source]

Dichotomy algorithm to find the root of a function

wolfhece.bernoulli.losses_jax._colebrook_white(f: jax.numpy.array, args: jax.numpy.array) jax.numpy.array[source]

Colebrook-White equation for friction factor

@param args: array containing, k = roughness of the pipe [m], diameter of the pipe [m], Reynolds number [-]

wolfhece.bernoulli.losses_jax._square_colebrook_white(f: jax.numpy.array, args: jax.numpy.array) jax.numpy.array[source]

Square of Colebrook-White equation for friction factor to be minimized

@param f: float, friction factor [-] @param args: array containing, k = roughness of the pipe [m], diameter of the pipe [m], Reynolds number [-]

wolfhece.bernoulli.losses_jax._scalar_exp_square_colebrook_white(g: jax.numpy.array, args: jax.numpy.array) jax.numpy.array[source]

Square of Colebrook-White equation for friction factor to be minimized.

Apply a transformation to the friction factor to avoid negative values. Exponential transformation is used.

@param g: float, friction factor [-] @param args: array containing, k = roughness of the pipe [m], diameter of the pipe [m], Reynolds number [-]

wolfhece.bernoulli.losses_jax._grad_scalar_colebrook_white[source]
wolfhece.bernoulli.losses_jax.grad_colebrook_white(f: jax.numpy.array, args: jax.numpy.array) jax.numpy.array[source]

Gradient of the Colebrook-White equation for friction factor

@param f: float, friction factor [-] @param args: array containing, k = roughness of the pipe [m], diameter of the pipe [m], Reynolds number [-]

wolfhece.bernoulli.losses_jax._min_colebrook_white(f: jax.numpy.array, args: jax.numpy.array) jax.numpy.array[source]

Minimize the Colebrook-White equation using BFGS

@param f: float, initial guess for the friction factor [-] @param args: array containing, k = roughness of the pipe [m], diameter of the pipe [m], Reynolds number [-]

wolfhece.bernoulli.losses_jax.args[source]