ibl.thwaites_method.ThwaitesMethod

class ibl.thwaites_method.ThwaitesMethod(nu=1.0, U_e=None, dU_edx=None, d2U_edx2=None, data_fits='Spline')

Bases: IBLMethod

Base class for Thwaites’ Method.

This class models a laminar boundary layer using Thwaites’ Method from, “Approximate Calculation of the Laminar Boundary Layer.” The Aeronautical Journal, Vol. 1, No. 3, 1949, pp. 245–280. It is the base class for the linear (ThwaitesMethodLinear)and nonlinear (ThwaitesMethodNonlinear) versions of Thwaites method.

In addition to the IBLMethod configuration information, the initial momentum thickness is needed along with the kinematic viscosity. Thwaites’ original algorithm relied upon tabulated data for the analysis, and there are few different ways of modeling that data in this class.

Note that modern references uses values different from the original tabular data in Thwaites original paper, including White (1991, 2005) and Drela (2014) without explanation. This implementation uses the modern values since that is the data that the associated models fit to.

Parameters:
  • nu (float)

  • U_e (Any | None)

  • dU_edx (Any | None)

  • d2U_edx2 (Any | None)

  • data_fits (str | Tuple[Callable, Callable] | Tuple[Callable, Callable, Callable])

__init__(nu=1.0, U_e=None, dU_edx=None, d2U_edx2=None, data_fits='Spline')
Parameters:
  • nu (float)

  • U_e (Any | None)

  • dU_edx (Any | None)

  • d2U_edx2 (Any | None)

  • data_fits (str | Tuple[Callable, Callable] | Tuple[Callable, Callable, Callable])

Return type:

None

Methods

__init__([nu, U_e, dU_edx, d2U_edx2, data_fits])

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_data_fits(data_fits)

Set the data fit functions.

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

initial_delta_m

Momentum thickness at start of integration.

nu

Kinematic viscosity used for the solution.

property initial_delta_m: float

Momentum thickness at start of integration. Must be greater than zero.

set_data_fits(data_fits)

Set the data fit functions.

This method sets the functions used for the data fits of the shear function, shape function, and the slope of the shape function.

Parameters:

data_fits (2-tuple, 3-tuple, or string) –

The data fits can be set via one of the following methods:
  • 3-tuple of callable objects taking one parameter that represent the shear function, the shape function, and the derivative of the shape function;

  • 2-tuple of callable objects taking one parameter that represent the shear function and the shape function. The derivative of the shear function is then approximated using finite differences; or

  • String for representing one of the three internal implementations:

    • ”Spline” for spline fits of Thwaites original data (Edland 2022)

    • ”White” for the curve fits from White (2011)

    • ”Cebeci-Bradshaw” for curve fits from Cebeci-Bradshaw (1977)

Raises:

ValueError – When an invalid fit name or unusable 2-tuple or 3-tuple provided

Return type:

None

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

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

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

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

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

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

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

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

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.

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.

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.