TurbVelocityField¶
- class sharpy.generators.turbvelocityfield.TurbVelocityField[source]¶
Turbulent Velocity Field Generator
TurbVelocitityFieldis a class inherited fromBaseGeneratorThe
TurbVelocitityFieldclass generates a velocity field based on the input from an [XDMF](http://www.xdmf.org) file. It supports time-dependant fields as well as frozen turbulence.To call this generator, the
generator_id = TurbVelocityFieldshall be used. This is parsed as the value for thevelocity_field_generatorkey in the desired aerodynamic solver’s settings.- Supported files:
field_id.xdmf: Steady or Unsteady XDMF file
This generator also performs time interpolation between two different time steps. For now, only linear interpolation is possible.
Space interpolation is done through scipy.interpolate trilinear interpolation. However, turbulent fields are read directly from the binary file and not copied into memory. This is performed using np.memmap. The overhead of this procedure is ~18% for the interpolation stage, however, initially reading the binary velocity field (which will be much more common with time-domain simulations) is faster by a factor of 1e4. Also, memory savings are quite substantial: from 6Gb for a typical field to a handful of megabytes for the whole program.
- Parameters
in_dict (dict) – Input data in the form of dictionary. See acceptable entries below:
Attributes:
See also
- class sharpy.utils.generator_interface.BaseGenerator¶
The settings that this solver accepts are given by a dictionary, with the following key-value pairs:
Name
Type
Description
Default
print_infoboolOutput solver-specific information in runtime.
Trueturbulent_fieldstrXDMF file path of the velocity field
Noneoffsetlist(float)Spatial offset in the 3 dimensions
numpy.zeroscentre_yboolFlat for changing the domain to [
-y_max/2,y_max/2]TrueperiodicitystrAxes in which periodicity is enforced
xyfrozenboolIf
True, the turbulent field will not be updated in timeTruestore_fieldboolIf
True, the xdmf snapshots are stored in memory. Only two at a time for the linear interpolationFalse