utils module

This module declares two miscellaneous functions.

read_flow_elements_file() function

utils.read_flow_elements_file(path, log)

This function reads a formatted file declaring the flow elements. It parses the file and instantiates a flow_element.Flow object containing the flow elements

Parameters
  • path (str) – Path to the file containing the elements parameters.

  • log (bool) – Prints the flow elements’ parameters to console if set to true.

Returns

Instance of flow_element.Flow containing the flow elements.

Return type

class:flow_element.Flow

solve_velocity_ode() function

utils.solve_velocity_ode(flow, t_span=(0.0, 10.0), video_folder='')

This function calls scipy.integrate.solve_ivp to solve the system of ODEs of the flow. The ODEs are given by the derivative of the complex potential of the flow.

Parameters
  • flow (class:flow_element.Flow) – instance of flow_element.Flow containing the flow elements

  • log (bool) – Prints to console if set to true

  • t_span (tuple, optional) – Initial and final time limits, defaults to (0, 10)

  • video_folder (str, optional) – If a folder path is given, the plot.velocity_stream_lines() function will be called and a plot will be saved at each iteration, defaults to “”

Returns

Object returned by scipy.integrate.solve_ivp

Return type

Bunch object