Writers¶
Module containing functions for writing out the inflow fields in various file formats.
- eddylicious.writers.write_data_to_ram(storage, t, position, uX, uY, uZ)¶
Write the velocity field to an ndarray stored in memory
Useful for studying different generation methods rapidly, avoiding hard disk IO.
- Parameters
storage (ndarray) – The variable that will be stored
t (float) – The value of time associated with the written velocity field. Not used here, included to comply with the writer interface.
position (int) – The position of the data along the time axis.
uX (ndarray) – A 2d ndarray containing the streamwise component of the velocity field.
uY (ndarray) – A 2d ndarray containing the wall-normal component of the velocity field.
uZ (ndarray) – A 2d ndarray containing the spanwise component of the velocity field.
- eddylicious.writers.write_data_to_vtk(writePath, xOrigin, pointsY, pointsZ, t, position, uX, uY, uZ)¶
Write the velocity field in a format used by OpenFOAM’s timeVaryingMappedFixedValue boundary condition.
- Parameters
writePath (str) – The path where to write the time directories containing the U files. Commonly constant/boundaryData/nameOfInletPatch.
xOrigin (float) – The position of the inlet along x.
pointsY (ndarray) – The locations of the inflow patch points along y.
pointsZ (ndarray) – The locations of the inflow patch points along z.
t (float) – The value of time associated with the written velocity field. Not used here, included to comply with the writer interface.
position (int) – The position of the data along the time axis.
uX (ndarray) – A 2d ndarray containing the streamwise component of the velocity field.
uY (ndarray) – A 2d ndarray containing the wall-normal component of the velocity field.
uZ (ndarray) – A 2d ndarray containing the spanwise component of the velocity field.
- eddylicious.writers.write_points_to_hdf5(hdf5File, pointsY, pointsZ, xVal)¶
Write the points into a HDF5 file.
Savs the points into a HDF5 file. The points will be transformed into 1d arrays. The resulting dataset is called points and lies in the root of the file.
- Parameters
hdf5File (h5py.File) – The path of the HDF5 file.
pointsY (ndarray) – A 2d array containing the values of y for the face centres.
pointsZ (ndarray) – A 2d array containing the values of z for the face centres.
xVal (float) – The x-location of the inflow plane.
- eddylicious.writers.write_points_to_ofnative(writePath, pointsY, pointsZ, xVal)¶
Write the points in a format used by OpenFOAM’s timeVaryingMappedFixedValue boundary condition.
- Parameters
writePath (str) – The path where to write the points file. Should commonly be constant/boundaryData/nameOfInletPatch.
pointsY (ndarray) – A 2d array containing the values of y for the face centres.
pointsZ (ndarray) – A 2d array containing the values of z for the face centres.
xVal (float) – The x-location of the inflow plane.
- eddylicious.writers.write_velocity_to_hdf5(hdf5File, t, uX, uY, uZ, position)¶
Write the velocity field into an HDF5 file.
Will also write the corresponding time value.
- Parameters
hdf5File (h5py.File) – The the HDF5 file.
t (float) – The value of time associated with the written velocity field.
position (int) – The position of the data along the time axis.
uX (ndarray) – A 2d ndarray containing the streamwise component of the velocity field.
uY (ndarray) – A 2d ndarray containing the wall-normal component of the velocity field.
uZ (ndarray) – A 2d ndarray containing the spanwise component of the velocity field.
- eddylicious.writers.write_velocity_to_ofnative(writePath, t, position, uX, uY, uZ)¶
Write the velocity field in a format used by OpenFOAM’s timeVaryingMappedFixedValue boundary condition.
- Parameters
writePath (str) – The path where to write the time directories containing the U files. Commonly constant/boundaryData/nameOfInletPatch.
t (float) – The value of time associated with the written velocity field.
position (int) – Not used here, present to comply with common writer interface.
uX (ndarray) – A 2d ndarray containing the streamwise component of the velocity field.
uY (ndarray) – A 2d ndarray containing the wall-normal component of the velocity field.
uZ (ndarray) – A 2d ndarray containing the spanwise component of the velocity field.