Turbulent Velocity Field Generator
TurbVelocitityFieldis a class inherited from
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 the
velocity_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.
in_dict (dict) – Input data in the form of dictionary. See acceptable entries below:
The settings that this solver accepts are given by a dictionary, with the following key-value pairs:
Output solver-specific information in runtime.
XDMF file path of the velocity field
Spatial offset in the 3 dimensions
Flat for changing the domain to [
Axes in which periodicity is enforced
True, the turbulent field will not be updated in time
True, the xdmf snapshots are stored in memory. Only two at a time for the linear interpolation
Legacy function, not using the custom format based on HDF5 anymore.
This function returns an interpolator list of size 3 made of scipy.interpolate.RegularGridInterpolator objects.
Reads the xml file <case_name>.xdmf. Writes the self.grid_data data structure with all the information necessary.
Note: this function does not load any turbulence data (such as ux000, …), it only reads the header information contained in the xdmf file.