ibl.ibl_method.IBLMethod

class ibl.ibl_method.IBLMethod(nu, u_e=None, du_e=None, d2u_e=None, ic=None)

Bases: ABC

Base class for integral boundary layer classes.

This encapsulates the common features and needed parameters for all IBL methods. At the very least it provides the inteface that is expected for all IBL classes.

Integration

The intengral boundary layer method is based on solving one or more ordinary differential equations in the streamwise direction. These ODEs are solved explicitly with the solve_ivp class from SciPy. This class stores the resulting solution as interpolating polynomials of the same degree as the solver (known as a dense output). This allows the querying of the solution at any point between the start of the boundary layer and the end of the boundary layer to return a uniformly accurate result.

Edge Velocity

In order to solve these differential equations, the edge velocity variation is needed. There are a number of different ways to specify the edge velocity (u_e), the first derivative of the edge velocity (du_e), and the second derivative of the edge velocity (d2u_e):

  • u_e can be a 2-tuple of xpoints and velocity values.

    In this case a monotonic cubic spline will be created and the derivative functions will be taken from the cubic spline.

  • u_e can be a scalar and dU_edx is a 2-tuple of xpoints and rates of change of velocity values.

    In this case a monotonic cubic spline will be created for du_e. u_e will be found from the antiderivative and the scalar passed in as u_e will be used as the initial velocity. The other derivative(s) will be taken from the cubic spline.

  • u_e and the derivatives can be callable objects.

    • If the first derivative object is provided but not the second derivative object, then if the first derivative object has a method called derivative then that method will be used to generate the second derivative object. Otherwise the second derivative will be approximated by finite differences of the first derivative.

    • If neither derivative objects are provided, then if u_e has a method called derivative (like the classes from the interpolate module of SciPy) then that method will be used to generate both derivative objects. Otherwise the derivative objects will be created from finite difference approximations.

Initial Conditions

The initial conditions needed to start the integration may depend on the specific method being implemented. By default the flow is assumed to start at a laminar stagnation point. If other initial conditions are needed, then an InitialCondition based class can be provided.

Raises:

ValueError – When configuration parameter is invalid (see message).

Parameters:
  • nu (float)

  • u_e (Any | None)

  • du_e (Any | None)

  • d2u_e (Any | None)

  • ic (InitialCondition | None)

__init__(nu, u_e=None, du_e=None, d2u_e=None, ic=None)
Parameters:
  • nu (float)

  • u_e (Any | None)

  • du_e (Any | None)

  • d2u_e (Any | None)

  • ic (InitialCondition | None)

Methods

__init__(nu[, u_e, du_e, d2u_e, ic])

d2u_e(x)

Streamwise second derivative of inviscid edge velocity at location(s).

delta_d(x)

Calculate the displacement thickness.

delta_k(x)

Calculate the kinetic energy thickness.

delta_m(x)

Calculate the momentum thickness.

dissipation(x, rho)

Calculate the dissipation integral.

du_e(x)

Streamwise derivative of inviscid edge velocity at location(s).

set_initial_condition(ic)

Set the initial conditions for solver.

set_velocity(u_e[, du_e, d2u_e])

Set the edge velocity relations.

shape_d(x)

Calculate the displacement shape factor.

shape_k(x)

Calculate the kinetic energy shape factor.

solve(x0, x_end[, term_event])

Solve the ODE associated with particular IBL method.

tau_w(x, rho)

Calculate the wall shear stress.

u_e(x)

Return the inviscid edge velocity at specified location(s).

v_e(x)

Calculate the transpiration velocity.

Attributes

nu

Kinematic viscosity used for the solution.

property nu: float

Kinematic viscosity used for the solution. Must be greater than zero.

set_initial_condition(ic)

Set the initial conditions for solver.

Parameters:

ic (InitialCondition) – Desired initial condition.

Return type:

None

set_velocity(u_e, du_e=None, d2u_e=None)

Set the edge velocity relations.

There are a number of different ways to set the velocity relation and its derivatives. See class definition for details.

Parameters:
  • u_e (2-tuple of array-like, scalar, or function-like) – Representation of the edge velocity to be used in analysis

  • du_e (None, 2-tuple of array-like, or function-like, optional) – Representation of the first derivative of the edge velocity to be used in analysis. The default is None.

  • d2u_e (None or function-like, optional) – Representation of the second derivative of the edge velocity to be used in analysis. The default is None.

Raises:

ValueError – When configuration parameter is invalid (see message).

Return type:

None

solve(x0, x_end, term_event=None)

Solve the ODE associated with particular IBL method.

This sets up the ODE solver using specific information from the child class and then runs the ODE solver to completion or termination because a termination event was triggered.

Parameters:
  • x0 (float) – Location to start integration.

  • x_end (float) – Location to end integration.

  • term_event (List based on TermEvent, optional) – User events that can terminate the integration process before the end location of the integration is reached. The default is None.

Returns:

Information associated with the integration process.

Return type:

IntegrationResult

Raises:

TypeError – When solution parameters have not been set.

u_e(x)

Return the inviscid edge velocity at specified location(s).

Parameters:

x (InputParam) – Streamwise loations to calculate this property.

Returns:

Inviscid edge velocity.

Return type:

numpy.ndarray

Raises:

TypeError – When velocity parameters have not been set.

du_e(x)

Streamwise derivative of inviscid edge velocity at location(s).

Parameters:

x (InputParam) – Streamwise loations to calculate this property.

Returns:

Derivative of inviscid edge velocity.

Return type:

numpy.ndarray

Raises:

TypeError – When velocity parameters have not been set.

d2u_e(x)

Streamwise second derivative of inviscid edge velocity at location(s).

Parameters:

x (InputParam) – Streamwise loations to calculate this property.

Returns:

Second derivative of inviscid edge velocity.

Return type:

numpy.ndarray

Raises:

TypeError – When velocity parameters have not been set.

abstract v_e(x)

Calculate the transpiration velocity.

Parameters:

x (InputParam) – Streamwise loations to calculate this property.

Returns:

Desired transpiration velocity at the specified locations.

Return type:

numpy.ndarray

abstract delta_d(x)

Calculate the displacement thickness.

Parameters:

x (InputParam) – Streamwise loations to calculate this property.

Returns:

Desired displacement thickness at the specified locations.

Return type:

numpy.ndarray

abstract delta_m(x)

Calculate the momentum thickness.

Parameters:

x (InputParam) – Streamwise loations to calculate this property.

Returns:

Desired momentum thickness at the specified locations.

Return type:

numpy.ndarray

abstract delta_k(x)

Calculate the kinetic energy thickness.

Parameters:

x (InputParam) – Streamwise loations to calculate this property.

Returns:

Desired kinetic energy thickness at the specified locations.

Return type:

numpy.ndarray

abstract shape_d(x)

Calculate the displacement shape factor.

Parameters:

x (InputParam) – Streamwise loations to calculate this property.

Returns:

Desired displacement shape factor at the specified locations.

Return type:

numpy.ndarray

abstract shape_k(x)

Calculate the kinetic energy shape factor.

Parameters:

x (InputParam) – Streamwise loations to calculate this property.

Returns:

Desired kinetic energy shape factor at the specified locations.

Return type:

numpy.ndarray

abstract tau_w(x, rho)

Calculate the wall shear stress.

Parameters:
  • x (InputParam) – Streamwise loations to calculate this property.

  • rho (float) – Freestream density.

Returns:

Desired wall shear stress at the specified locations.

Return type:

numpy.ndarray

abstract dissipation(x, rho)

Calculate the dissipation integral.

Parameters:
  • x (InputParam) – Streamwise loations to calculate this property.

  • rho (float) – Freestream density.

Returns:

Desired dissipation integral at the specified locations.

Return type:

numpy.ndarray