offline#

Offline tools for PyFluent.

This module provides standalone utilities that work without a running Fluent session, including an in-house case file reader (CaseFile) and data file reader (DataFile), as well as a local parametric study (LocalParametricStudy).

Classes:

CaseFile([case_file_name, project_file_name])

Class to read a Fluent case file.

DataFile([data_file_name, ...])

Class to read a Fluent case file.

LocalParametricStudy(case_filepath[, ...])

Local version of a parametric study that manages design points to parametrize a Fluent solver setup.

class ansys.fluent.core.offline.CaseFile(case_file_name=None, project_file_name=None)#

Bases: RPVarProcessor

Class to read a Fluent case file.

Methods

get_mesh()

Get the mesh data.

Methods:

__init__([case_file_name, project_file_name])

Initialize a CaseFile object.

get_mesh()

Get the mesh data.

__init__(case_file_name=None, project_file_name=None)#

Initialize a CaseFile object. Exactly one file path argument must be specified.

Parameters:
case_file_nameos.PathLike | str | None

The path of a case file.

project_file_nameos.PathLike | str | None

The path of a project file from which the case file is selected.

get_mesh()#

Get the mesh data.

class ansys.fluent.core.offline.DataFile(data_file_name=None, project_file_name=None, case_file_handle=None)#

Bases: object

Class to read a Fluent case file.

Methods

case_file()

Get the name of case file.

get_phases()

Get the list of phases.

get_face_variables(phase_name)

Get the variables list available at face.

get_cell_variables(phase_name)

Get the variables list available at cell.

get_face_scalar_field_data(phase_name, field_name, surface_id)

Get the scalar field data for face.

get_face_vector_field_data(phase_name, surface_id)

Get the vector field data for face.

Methods:

__init__([data_file_name, ...])

__init__ method of CaseFile class.

get_cell_variables(phase_name)

Extracts cell variables available for a particular phase.

get_face_scalar_field_data(phase_name, ...)

Gets scalar field data for face.

get_face_variables(phase_name)

Extracts face variables available for a particular phase.

get_face_vector_field_data(phase_name, ...)

Gets vector field data for face.

get_phases()

Returns list of phases available.

variables()

Returns all associated data variables in form of a dictionary.

Attributes:

case_file

Returns the name of the associated case file in string format.

__init__(data_file_name=None, project_file_name=None, case_file_handle=None)#

__init__ method of CaseFile class.

property case_file: str#

Returns the name of the associated case file in string format.

get_cell_variables(phase_name)#

Extracts cell variables available for a particular phase.

Parameters:
phase_namestr

Name of the phase.

Returns:
List of cell variables.
get_face_scalar_field_data(phase_name, field_name, surface_id)#

Gets scalar field data for face.

Parameters:
phase_namestr

Name of the phase.

field_name: str

Name of the field

surface_idList[int]

List of surface IDs for scalar field data.

Returns:
Numpy array containing scalar field data for a particular phase, field and surface.
get_face_variables(phase_name)#

Extracts face variables available for a particular phase.

Parameters:
phase_namestr

Name of the phase.

Returns:
List of face variables.
get_face_vector_field_data(phase_name, surface_id)#

Gets vector field data for face.

Parameters:
phase_namestr

Name of the phase.

surface_idList[int]

List of surface IDs for vector field data.

Returns:
Numpy array containing scalar field data for a particular phase, field and surface.
get_phases()#

Returns list of phases available.

variables()#

Returns all associated data variables in form of a dictionary.

class ansys.fluent.core.offline.LocalParametricStudy(case_filepath, base_design_point_name='Base DP')#

Bases: object

Local version of a parametric study that manages design points to parametrize a Fluent solver setup.

Methods

add_design_point(design_point_name)

Add a design point.

design_point(idx_or_name)

Get a design point, either by name (str) or an index indicating the position in the table (by order of insertion).

run_in_fluent()

Run the study in Fluent

Raises:
RuntimeError

If the design point is not found.

Methods:

__init__(case_filepath[, base_design_point_name])

Initialize LocalParametricStudy.

add_design_point(design_point_name)

Add the design point.

design_point(idx_or_name)

Get the design point.

run_in_fluent(num_servers[, launcher, ...])

Run the local study in fluent.

__init__(case_filepath, base_design_point_name='Base DP')#

Initialize LocalParametricStudy.

add_design_point(design_point_name)#

Add the design point.

design_point(idx_or_name)#

Get the design point.

run_in_fluent(num_servers, launcher=None, start_transcript=False, capture_report_data=False)#

Run the local study in fluent.