Generators

Module containing functions for the generation of inflow fields.

eddylicious.generators.interpolation_generate(readerFunction, writerFunction, dt, t0, tEnd, timePrecision, points, pointsInfl, idxPrec, times)

Generate the the inflow velocity interpolation.

This function will take some precursor data and interpolate it on the grid at the inflow patch.

Parameters
  • readerFunction (function) – The function to use for reading in data, generated by the reader. Should contain the reader’s name in the attribute “reader”.

  • writerFunction (function) – The writer function that will be used to save the values of the velocity field.

  • dt (float) – The time-step to be used in the simulation. This will be used to associate a time-value with the produced velocity fields.

  • t0 (float) – The starting time to be used in the simulation. This will be used to associate a time-value with the produced velocity.

  • timePrecision (int) – Number of points after the decimal to keep for the time value.

  • tEnd (float) – The ending time for the simulation.

  • points (ndarray) – A 2d array containing the values the points of the source geometry or their Delaunay triangulation.

  • pointsInfl (ndarray) – A 2d array containing the values the points of the inlet geometry.

  • idxPrec (ndarray) – Indices for filtering the read-in velocity

  • times (list of floats or strings) – The times for which the velocity field was sampled in the precursor simulation.

eddylicious.generators.lund_generate(readerFunction, writerFunction, dt, t0, tEnd, timePrecision, uMeanXPrec, uMeanXInfl, uMeanYPrec, uMeanYInfl, etaPrec, yPlusPrec, pointsZ, etaInfl, yPlusInfl, pointsZInfl, nInfl, gamma, times, blending)

Generate the the inflow velocity using Lund’s rescaling.

This function will use Lund et al’s rescaling in order to generate velocity fields for the inflow boundary. The rescaling for the mean profile should be done beforehand and is one of the input parameters for this function.

Parameters
  • readerFunction (function) – The function to use for reading in data, generated by the reader. Should contain the reader’s name in the attribute “reader”.

  • writerFunction (function) – The function to use for writing data.

  • dt (float) – The time-step to be used in the simulation. This will be used to associate a time-value with the produced velocity fields.

  • t0 (float) – The starting time to be used in the simulation. This will be used to associate a time-value with the produced velocity.

  • timePrecision (int) – Number of points after the decimal to keep for the time value.

  • tEnd (float) – The ending time for the simulation.

  • uMeanXPrec (ndarray) – The values of the mean streamwise velocity from the precursor.

  • uMeanXInfl (ndarray) – The values of the mean streamwise velocity for the inflow boundary layer.

  • uMeanYPrec (ndarray) – The values of the mean wall-normal velocity from the precursor.

  • uMeanYInfl (ndarray) – The values of the mean wall-normal velocity for the inflow boundary layer.

  • etaPrec (ndarray) – The values of eta for the corresponding values of the mean velocity from the precursor.

  • yPlusPrec (ndarray) – The values of y+ for the corresponding values of the mean velocity from the precursor.

  • pointsZ (ndarray) – A 2d array containing the values of z for the points of the precursor mesh.

  • etaInfl (ndarray) – The values of eta for the mesh points at the inflow boundary.

  • yPlusInfl (ndarray) – The values of y+ for the mesh points at the inflow boundary.

  • pointsZInfl (int) – A 2d array containing the values of z for the points of the inflow boundary.

  • nInfl (int) – The amount of points in the wall-normal direction that contain the boundary layer at the inflow boundary.

  • gamma (float) – The ration of the friction velocities in the inflow boundary layer and the precursor.

  • times (list of floats or strings) – The times for which the velocity field was sampled in the precursor simulation.

  • blending (ndarray) – The weights for blending the inner and outer profiles.

eddylicious.generators.lund_rescale_fluctuations(etaPrec, yPlusPrec, pointsZ, uPrimeX, uPrimeY, uPrimeZ, gamma, etaInfl, yPlusInfl, pointsZInfl, nInfl, blending)

Rescale the fluctuations of velocity using Lund et al’s rescaling.

This function rescales the fluctuations of the three components of the velocity field taken from the precursor simulation using Lund et al’s rescaling.

Parameters
  • etaPrec (ndarray) – The values of eta for the corresponding values of the mean velocity from the precursor.

  • yPlusPrec (ndarray) – The values of y+ for the corresponding values of the mean velocity from the precursor.

  • pointsZ (ndarray) – A 2d array containing the values of z for the points of the precursor mesh.

  • uPrimeX (ndarray) – A 2d array containing the values of the fluctuations of the x component of velocity.

  • uPrimeY (ndarray) – A 2d array containing the values of the fluctuations of the y component of velocity.

  • uPrimeZ (ndarray) – A 2d array containing the values of the fluctuations of the z component of velocity.

  • gamma (float) – The ratio of the friction velocities in the inflow boundary layer and the precursor.

  • etaInfl (ndarray) – The values of eta for the mesh points at the inflow boundary.

  • yPlusInfl (ndarray) – The values of y+ for the mesh points at the inflow boundary.

  • pointsZInfl (ndarray) – A 2d array containing the values of z for the points of the inflow boundary.

  • nInfl (int) – The amount of points in the wall-normal direction that contain the boundary layer at the inflow boundary.

  • blending (ndarray) – The weights for blending the inner and outer profiles.

Returns

The list contains three items, each a 2d ndarray. The first array contains the rescaled fluctuations of the x component of velocity. The second – of the y component of velocity. The third – of the z component of velocity.

Return type

List of ndarrays

eddylicious.generators.lund_rescale_mean_velocity(etaPrec, yPlusPrec, uMeanXPrec, uMeanYPrec, nInfl, etaInfl, yPlusInfl, nPointsZInfl, u0Infl, u0Prec, gamma, blending)

Rescale the mean velocity profile using Lunds rescaling.

This function rescales the mean velocity profile taken from the precursor simulation using Lund et al’s rescaling.

Parameters
  • etaPrec (ndarray) – The values of eta for the corresponding values of the mean velocity from the precursor.

  • yPlusPrec (ndarray) – The values of y+ for the corresponding values of the mean velocity from the precursor.

  • uMeanXPrec (ndarray) – The values of the mean streamwise velocity from the precursor.

  • uMeanYPrec (ndarray) – The values of the mean wall-normal velocity from the precursor.

  • nInfl (int) – The amount of points in the wall-normal direction that contain the boundary layer at the inflow boundary.

  • etaInfl (ndarray) – The values of eta for the mesh points at the inflow boundary.

  • yPlusInfl (ndarray) – The values of y+ for the mesh points at the inflow boundary.

  • nPointsZInfl (int) – The amount of points in the spanwise direction for the inflow boundary.

  • u0Infl (float) – The freestream velocity at the inflow.

  • u0Prec (float) – The freestream velocity for the precursor.

  • gamma (float) – The ratio of the friction velocities in the inflow boundary layer and the precursor.

  • blending (ndarray) – The weights for blending the inner and outer profiles.

Returns

  • uX, ndarray – The values of the mean streamwise velocity.

  • uY, ndarray – The values of the mean wall-normal velocity.

eddylicious.generators.random_fluctuations_generate(writerFunction, inflowPoints, uMean, reynoldsStress, dt, t0, timePrecision, tEnd)

Generate the inflow velocity using Gaussian random variables manipulated to comply to given first- and second-order statistics.

Parameters
  • writerFunction (function) – The function to use for writing the data.

  • inflowPoints (ndarray) – The coordinates of the point of the inflow patch, shape (N, 3)

  • uMean (ndarray) – The mean velocity values at each point of the inflow patch, shape (N, 3), columns corresponding to x, y, and z coordinates.

  • reynoldsStress (ndarray) – The Reynolds stress tensor at each point of the inflow patch, shape (N, 6), columns orderd to correspond to <uu>, <uv>, <uw>, <vv>, <vw>, <ww>. Algorithm will crash if the resulting matrix is not positive-definite.

  • dt (float) – The time-step to be used in the simulation. This will be used to associate a time-value with the produced velocity fields.

  • t0 (float) – The starting time to be used in the simulation. This will be used to associate a time-value with the produced velocity.

  • timePrecision (int) – Number of points after the decimal to keep for the time value.

  • tEnd (float) – The ending time for the simulation.

eddylicious.generators.sem_generate(inflowPoints, sigma, reynoldsStress)

Generate the the inflow velocity using Lund’s rescaling.

This function will use Lund et al’s rescaling in order to generate

Parameters

readerFunction (function) – The function to use for reading in data, generated by the reader. Should contain the reader’s name in the attribute “reader”.