TurbVelocityField¶
- class sharpy.generators.turbvelocityfield.TurbVelocityField[source]¶
Turbulent Velocity Field Generator
TurbVelocitityField
is a class inherited fromBaseGenerator
The
TurbVelocitityField
class 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 = TurbVelocityField
shall be used. This is parsed as the value for thevelocity_field_generator
key 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_info
bool
Output solver-specific information in runtime.
True
turbulent_field
str
XDMF file path of the velocity field
None
offset
list(float)
Spatial offset in the 3 dimensions
numpy.zeros
centre_y
bool
Flat for changing the domain to [
-y_max/2
,y_max/2
]True
periodicity
str
Axes in which periodicity is enforced
xy
frozen
bool
If
True
, the turbulent field will not be updated in timeTrue
store_field
bool
If
True
, the xdmf snapshots are stored in memory. Only two at a time for the linear interpolationFalse