pencil.calc.draglift

Contains classes and methods to compute drag, lift and Strouhal number for a cylinder in a cross flow

Classes

Draglift

Grid -- holds pencil code time grid data.

Functions

draglift(simulations[, sortby])

Compute mean drag coefficient, rms lift coefficient, and Strouhal number

find_extrema(series, maxmin)

Input: Data series, extrama of intereset (max or min)

Module Contents

pencil.calc.draglift.draglift(simulations, sortby='dx', **kwargs)

Compute mean drag coefficient, rms lift coefficient, and Strouhal number for flow past a circular cylinder. If the flow is steady, only drag and lift coefficients are computed.

Call signature:
draglift(simulations, d_cylinder=0.1, u_0=1.0, flow_dir=’y’,

t_start=-1, sortby=’dx’):

Keyword arguments:

simulations

array of simulation names to be included in the computations

d_cylinder:

diameter of the cylinder

u_0

velocity at the inlet

flow_dir:

direction of the flow

t_start

time to start the drag computations from should be where the a steady vortex shedding has developed

sortby

property to sort the arrays by typical choices for parametric studies are grid size, length of domain, etc.

Returns

object with information: sim-name, drag (mean), lift (rms), and st (non-dim shedding frequency)

class pencil.calc.draglift.Draglift

Bases: object

Grid – holds pencil code time grid data.

Fill members with default values.

name = ''
drag = 0
lift = 0
st = 0
set_name(simulation)
compute(simulation, d_cylinder=0.1, u_0=1.0, flow_dir='y', t_start=-1)

Compute the drag coefficienc, rms drag, lift coefficient, rms lift and Strouhal number of a given time series Requires time series T as input, on the form given in the pencil code where T.t, T.c_dragx and T.c_dragy are avaliable quantities Cylinder diameter, fluid mean velocity , flow direction and start time of drag computations velocity should also be given as input.

pencil.calc.draglift.find_extrema(series, maxmin)

Input: Data series, extrama of intereset (max or min) Use scipy to find this scipy.signal.argrelextrema(array type of np,comparison operator eg np.greater or np.less)