pencil.calc.draglift ==================== .. py:module:: pencil.calc.draglift .. autoapi-nested-parse:: Contains classes and methods to compute drag, lift and Strouhal number for a cylinder in a cross flow Classes ------- .. autoapisummary:: pencil.calc.draglift.Draglift Functions --------- .. autoapisummary:: pencil.calc.draglift.draglift pencil.calc.draglift.find_extrema Module Contents --------------- .. py:function:: 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) .. py:class:: Draglift Bases: :py:obj:`object` Grid -- holds pencil code time grid data. Fill members with default values. .. py:attribute:: name :value: '' .. py:attribute:: drag :value: 0 .. py:attribute:: lift :value: 0 .. py:attribute:: st :value: 0 .. py:method:: set_name(simulation) .. py:method:: 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. .. py:function:: 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)