boundary_layer module

class IMTreatment.boundary_layer.boundary_layer.BlasiusBL(Uinf, nu, rho)[source]

Bases: object

Class representing a Blasius-like boundary layer.

Parameters:
  • Uinf (number) – Flown velocity away from the wall (m/s).
  • nu (number) – Kinematic viscosity (m²/s).
  • rho (number) – Density (kg/m^3)
get_BL_properties(x, allTurbulent=False, bl_perc='99')[source]

Return the boundary layer properties according to blasius theory.

Parameters:
  • x (number or array of number) – Position where the boundary layer thickness is computed (m)
  • be a list) ((can) –
  • allTurbulent (bool, optional) – if True, the all boundary layer is considered turbulent.
  • bl_perc (string in ['95', '99']) – Percentage of maximum velocity defining the BL thickness
Returns:

  • delta (array of numbers) – Boundary layer thickness profile (m)
  • delta2 (array of numbers) – Boundary layer momentum thickness (m)
  • delta_star (array of numbers) – Boundary layer displacement thickness (m)
  • H (array of numbers) – Shape factor
  • Cf (array of numbers) – Friction coefficient profile
  • Rex (array of numbers) – Reynolds number on the distance from the border.
  • tau_w (array of numbers) – Wall shear stress (Pa)

get_Rex(x)[source]

Return the Reynolds number based on the distance from the beginning of the plate.

get_profile(x, y=None, allTurbulent=False)[source]

Return a Blasius-like (laminar) profile at the given position.

Parameters:
  • x (number) – Position of the profile along x axis
  • y (array of numbers) – Point along y where to compute the profile (if not specified, 200 homogeneously placed points are used)
  • allTurbulent (bool, optional) – if True, the boundary layer is considered turbulent.
Returns:

prof – Wanted Blasius-like profile.

Return type:

Profile Object

get_profile_with_confinement(x, h, y=None, allTurbulent=False)[source]

Return a Blasius-like (laminar) profile at the given position, ajusted for confined BL.

Parameters:
  • x (number) – Position of the profile along x axis
  • h (number) – Pater level.
  • y (array of numbers) – Point along y where to compute the profile (if not specified, 200 homogeneously placed points are used)
  • allTurbulent (bool, optional) – if True, the boundary layer is considered turbulent.
Returns:

prof – Wanted Blasius-like profile.

Return type:

Profile Object

get_thickness_with_confinement(x, h, allTurbulent=False)[source]

Return the boundary layer thickness and the friction coefficient according to blasius theory and adapted for use with low water levels. (Only valid in laminar BL) Fonction ——– delta, Cf = BlasiusBL(allTurbulent=False)

Parameters:
  • x (number or array of number) – Position where the boundary layer thickness is computed (m) (can be a list).
  • h (number) – Water depth (m).
  • allTurbulent (bool, optional) – if True, the all boundary layer is considered turbulent.
Returns:

delta – Boundary layer thickness profile (m)

Return type:

Profile object

get_x_from_delta(delta, allTurbulent=False)[source]

Return a the x value that give the wanted delta.

class IMTreatment.boundary_layer.boundary_layer.FalknerSkanBL(nu, m, c0, L)[source]

Bases: object

get_f_function(relerr=1e-05, max_it=1000, verbose=False)[source]

Return the ‘f’ function appearing in the Falkner-skan equation, and its derivatives.

Notes

  • Falkner-Skan equation :
\[ \begin{align}\begin{aligned}f''' + ff'' + \beta \left( 1 - f'^2 \right) = 0\\f(0) = f'(0) = 0 \: \text{ and } \: f'(\infty) = 1\end{aligned}\end{align} \]
  • Associated constants :
\[ \begin{align}\begin{aligned}\beta = \frac{2m}{m + 1}\\-0.0905 \le m \le 2\end{aligned}\end{align} \]
  • Remark on numerical resolution :

    The Falkner-Skan equation is a ODE system with BVP (boundary value problem). Classical ODE algorithm such as Runge-Kutta or Vode cannot take care of the \(f'(\infty)=0\). This ODE system is so solved with a shooting method.

get_mu(x, y)[source]

return the mu parameter at the position ‘(x, y)’.

get_profile(x, relerr=1e-05, max_it=1000, verbose=False)[source]

return the velocity profile at ‘x’ position.

get_u_e(x)[source]

Return the external velocity at position ‘x’.

get_y(x, mu)[source]

Return the ‘y’ vaue associated with mu parameter.

class IMTreatment.boundary_layer.boundary_layer.ThwaitesBL(u_e, nu=1e-06)[source]

Bases: object

get_BL_properties(x)[source]

Return the boundary layer properties for given values of x

Parameters:x (number or array of numbers) – Position along the flat plan until where we want to solve the momentum equation. (has no influence on the resoluion accuracy)
Returns:
  • lambda (array of numbers) – Dimensionless pressure gradient. (According to Kays and Crawford, a value of -0.082 is caracteristic of the separation phenomenon.)
  • delta2 (array of numbers) – Boundary layer momentum thickness
  • delta_star (array of numbers) – Boundary layer displacement thickness
  • H (array of numbers) – H factor
get_momentum_thikness(x)[source]

Return the evolution of the boundary layer momentum thikness.

Parameters:x (number or array of numbers) – Position along the flat plan until where we want to solve the momentum equation. (has no influence on the resoluion accuracy)
Returns:delta2
Return type:position and value of momentum thicknesses
u_e_pow(x)[source]

Function u_e(x)**4.68 (used int numerical resolution)

class IMTreatment.boundary_layer.boundary_layer.WakeLaw(h, tau, delta, visc_c=1e-06, rho=1000)[source]

Bases: IMTreatment.boundary_layer.boundary_layer.WallLaw

Class representing a law of the wake profile using Coles theory. By default, the used liquid is water.

Parameters:
  • h (number) – Water depth (m)
  • tau (number) – The wall shear stress (Pa)
  • delta (number) – The boundary layer thickness (m)
  • Cc (number, optional) – The Coles parameters (n.u) (0.45 by default)
  • visc_c (number, optional) – Kinematic viscosity (m²/s) (defaul = 1e-6)
  • rho (number, optional) – liquid density (kg/m^3) (default = 1000)
class IMTreatment.boundary_layer.boundary_layer.WallLaw(h, tau, delta, visc_c=1e-06, rho=1000)[source]

Bases: object

Class representing a law of the wall profile. By default, the used liquid is water.

Parameters:
  • h (number) – Water depth (m)
  • tau (number) – The wall shear stress (Pa)
  • visc_c (number, optional) – Kinematic viscosity (m²/s)
  • rho (number, optional) – liquid density (kg/m^3)
display(dy, **plotArgs)[source]

Display the velocity profile.

Parameters:dy (number) – Resolution along the water depth (m).
Returns:fig – Reference to the displayed figure.
Return type:figure reference
get_profile(y)[source]

Return a log-defect profile, according to the given parameters.

Parameters:y (array) – Value of y in which calculate the profile (m).
Returns:prof – the profile for values of ‘y’
Return type:Profile object
integral(x, y)[source]
IMTreatment.boundary_layer.boundary_layer.get_bl_thickness(obj, direction=1, perc=0.95)[source]

Return a boundary layer thickness if ‘obj’ is a Profile. Return a profile of boundary layer thicknesses if ‘obj’ is a ScalarField. WARNING : the wall must be at x=0.

Parameters:
  • obj (Profile or ScalarField object) – Vx field.
  • direction (integer, optional) – If ‘obj’ is a ScalarField, determine the swept axis (1 for x and 2 for y).
  • perc (float, optionnal) – Percentage used in the bl calculation (95% per default).
Returns:

BLT – Boundary layer thickness, in axe x unit.

Return type:

float or profile

IMTreatment.boundary_layer.boundary_layer.get_clauser_thickness(obj, direction=1, rho=1000, nu=1e-06, tau=None)[source]

Return the profile Clauser’s thickness defined in ‘Clauser (1956)’. (Delta_star = integrale_0_h (u_top - u)/u_star dy)

Parameters:
  • obj (Profile or ScalarField object) –
  • direction (integer, optional) – If ‘obj’ is a ScalarField, determine the swept axis (1 for x and 2 for y).
  • rho (number, optional) – Density of the fluid (default fo water : 1000 kg/m^3)
  • nu (number, optional) – Kinematic viscosity for the fluid (default for water : 1e-6 m^2/s)
  • tau (number, optional) – Wall shear stress, if not specified, ‘get_shear_stress’ is used to compute it.
Returns:

Delta_star – Boundary layer Clauser thickness, in axe x unit.

Return type:

float or Profile

IMTreatment.boundary_layer.boundary_layer.get_displ_thickness(obj, direction=1)[source]

Return a displacement thickness if ‘obj’ is a Profile. Return a profile of displacement thicknesses if ‘obj’ is a Scalarfield. WARNING : the wall must be at x=0.

Parameters:
  • obj (Profile or ScalarField object) –
  • direction (integer, optional) – If ‘obj’ is a ScalarField, determine the swept axis (1 for x and 2 for y).
Returns:

delta – Boundary layer displacement thickness, in axe x unit.

Return type:

float or Profile

IMTreatment.boundary_layer.boundary_layer.get_momentum_thickness(obj, direction=1)[source]

Return a momentum thickness if ‘obj’ is a Profile. Return a profile of momentum thicknesses if ‘obj’ is a Scalarfield. WARNING : the wall must be at x=0.

Parameters:
  • obj (Profile or ScalarField object) –
  • direction (integer, optional) – If ‘obj’ is a ScalarField, determine the swept axis (1 for x and 2 for y).
Returns:

delta – Boundary layer momentum thickness, in axe x unit.

Return type:

float or Profile

IMTreatment.boundary_layer.boundary_layer.get_separation_position(obj, wall_direction, wall_position, interval=None, nmb_lines=4)[source]

Compute and return the separation points position. Separation points position is computed by searching zero streamwise velocities on surrounding field lines and by extrapolating at the wanted ‘wall_position’. If specified, ‘interval’ must include separation points on the 4 nearest field line. If multiples changments of streamwise velocity are found, return the mean positions of those points.

Parameters:
  • obj (ScalarField, VectorField, VectorField or TemporalVelocityField) – If ‘VectorField’ or ‘VectorField’, wall_direction is used to determine the interesting velocity component.
  • wall_direction (integer) – 1 for a wall at a given value of x, 2 for a wall at a given value of y.
  • wall_position (number) – Position of the wall.
  • interval (2x1 array of numbers, optional) – Optional interval in which search for the detachment points.
  • nmb_lines (int) – Number of lines to take into account to make the extrapolation. (default is 4)
IMTreatment.boundary_layer.boundary_layer.get_shape_factor(obj, direction=1)[source]

Return a shape factor if ‘obj’ is a Profile. Return a profile of shape factors if ‘obj’ is a Scalarfield. WARNING : the wall must be at x=0.

Parameters:
  • obj (Profile or ScalarField object) –
  • direction (integer, optional) – If ‘obj’ is a ScalarField, determine the swept axis (1 for x and 2 for y).
Returns:

delta – Boundary layer shape factor, in axe x unit.

Return type:

float or Profile

IMTreatment.boundary_layer.boundary_layer.get_shear_stress(obj, direction=1, method='simple', respace=False, tau_w_guess=1e-06, rho=1000.0, nu=1e-06)[source]

Return the wall shear stress. If velocities values are missing near the wall, an extrapolation (bad accuracy) is used. Warning : the wall must be at x=0

Parameters:
  • obj (Profile or ScalarField object) –

    .

  • viscosity (number, optional) – Dynamic viscosity (default to water : 1e-3)
  • direction (integer, optional) – If ‘obj’ is a ScalarField, determine the swept axis (1 for x and 2 for y).
  • method (string, optional) – ‘simple’ (default) : use simple gradient computation ‘wall_law_lin’ : use the linear part of the ‘law of the wall’ model (need some points in the viscous sublayer) ‘wall_law_log’ : use the log part of the ‘law of the wall’ model (only valid in the log layer)
  • respace (bool, optional) – Use linear interpolation to create an evenly spaced profile.
  • tau_w_guess (number, optional) – For ‘Wall_law_log’ method, initial guess for tau_w resolution.
  • rho (number, optional) – Density of the fluid (default fo water : 1000 kg/m^3)
  • nu (number, optional) – Kinematic viscosity for the fluid (default for water : 1e-6 m^2/s)