majordome.fluent#
Handling of exported data files#
- class majordome.fluent.FluentFvParticlesParser(fname: str | Path, encoding: str = 'utf-8', max_tracks: int = 100000)#
Provides parsing of exported Fluent FVPARTICLES files.
- Parameters:
- fname: str | Path
Path to .<fvp> file to be parsed; file must be stored in plain text format, by default in UTF-8 encoding.
- encoding: str = “utf-8”
Encoding type for reading the file.
- max_tracks: int = 100_000
Maximum number of tracks to be parsed from file.
- property data: list[ndarray[tuple[Any, ...], dtype[float64]]]#
Provides access to list of tracks data.
- property n_tracks: int#
Provides access to number of tracks parsed.
- property variable_names: list[str]#
Provides access to list of variables names.
- class majordome.fluent.FluentInterpolationParser(fname: str | ~pathlib.Path, float_type: type = <class 'float'>, encoding: str = 'utf-8')#
Provides parsing of exported Fluent interpolation files.
- Parameters:
- fname: str | Path
Path to .ip file to be parsed; file must be stored in plain text format, by default in UTF-8 encoding.
- float_type: type = float
Floatting point type; using built-in is faster, but you may also use some NumPy type at your convenience (much slower).
- encoding: str = “utf-8”
Encoding type for reading the file.
- property data: ndarray[tuple[Any, ...], dtype[float64]]#
Return access to the whole data table.
- get_data(name) ndarray[tuple[Any, ...], dtype[float64]]#
Retrieve data for selected variable name.
- property n_dimensions: int#
Provides access to number of dimensions.
- property n_points: int#
Provides access to number of points.
- property n_variables: int#
Provides access to number of variables.
- property variable_names: list[str]#
Provides access to list of variables names.
Generation of TSV files#
- class majordome.fluent.FluentInputRow(name: str, value: str, unit: str = '', kind: str = '', inpar: bool = False, outpar: bool = False, descr: str = '')#
Fluent TSV file data entry for automated parameter generation.
- Parameters:
- name: str
Name of parameter, no spaces allowed.
- value: str
String representation of the value, if required with units.
- unit: str = “”
Units of parameter.
- kind: str = “”
Unit family of parameter.
- inpar: bool = False
Whether to use parameter as a design input parameter.
- outpar: bool = False
Whether to use parameter as a design output parameter.
- descr: str = “”
A short description of the parameter.
- property name#
Provides access to entry name.
- class majordome.fluent.FluentInputFile(rows: list[FluentInputRow], sort_list: bool = False)#
Representation of an Ansys Fluent expressions input file.
- Attributes:
- HEADtuple[str]
Tuple containing TSV file headers.
- append(row: FluentInputRow)#
Append a single row to the inputs file.
- to_file(saveas: str, overwrite: bool = False)#
Generate Fluent input file.
Parsing Scheme data#
- class majordome.fluent.FluentSchemePatch(row: str)#
Parse patch name from a Scheme file.
- property index: int#
Provides access to patch index.
- property name: str#
Provides access to patch name.
- class majordome.fluent.FluentSchemeHeader(row: str)#
Parse header row from a Scheme table file.
- property names: list[str]#
Provides access to column names.
Others#
- majordome.fluent.convert_xy_to_dict(fname: str | Path) dict[int, dict[str, list[float]]]#
Convert Ansys XY format to a dictionary structure.
- Parameters:
- fname: str | Path
Path to “.xy” file to be converted by function.
- Returns:
- dict[int, dict[str, list[float]]]
A dictionary with each particle from pathlines transformed into a dictionary of coordinates X and Y.
- majordome.fluent.load_dpm_table(fname: str) DataFrame#
Wrapper for simple loading of data table.