Writers¶
Module containing functions for writing out the inflow fields in various file formats.
-
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_velocity_to_hdf5
(hdf5File, t, uX, uY, uZ, iteration)¶ 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.
- 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.
- iteration (int) – The position of along the time axis.
-
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_ofnative
(writePath, t, 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.
- 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.