case_file#
Reader for Fluent case files.
Example#
>>> from ansys.fluent.core import examples
>>> from ansys.fluent.core.filereader.case_file import CaseFile
>>> case_file_name = examples.download_file("Static_Mixer_Parameters.cas.h5", "pyfluent/static_mixer", return_without_path=False)
>>> reader = CaseFile(case_file_name=case_file_name) # Instantiate a CaseFile class
>>> input_parameters = reader.input_parameters() # Get lists of input parameters
>>> output_parameters = reader.output_parameters() # Get lists of output parameters
Classes:
|
Class to read a Fluent case file. |
|
Provides access to variables defined in the case. |
Empty Container. |
|
|
Represents an input parameter. |
|
Represents an input parameter (old format). |
|
Class to provide mesh data. |
|
Types of Mesh. |
|
Represents an output parameter. |
|
Class to process RP Vars string to expose required outputs. |
|
Class to read a Fluent Settings file. |
- class ansys.fluent.core.filereader.case_file.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.
- get_mesh()#
Get the mesh data.
- class ansys.fluent.core.filereader.case_file.CaseVariable(variables, path='')#
Bases:
object
Provides access to variables defined in the case.
Methods:
__init__
(variables[, path])Initialize CaseVariable.
- class ansys.fluent.core.filereader.case_file.InputParameter(raw_data)#
Bases:
object
Represents an input parameter.
- Attributes:
- name
str
- value
The value of this input parameter, usually a string, qualified by units
- name
Methods:
__init__
(raw_data)Initialize InputParameter.
Attributes:
Get the numeric value of a Fluent input parameter.
Get the unit label of a Fluent input parameter.
- __init__(raw_data)#
Initialize InputParameter.
- class ansys.fluent.core.filereader.case_file.InputParameterOld(raw_data)#
Bases:
object
Represents an input parameter (old format).
- Attributes:
- name
str
- value
The value of this input parameter, usually a string, qualified by units
- name
Methods:
__init__
(raw_data)Initialize InputParameter.
Attributes:
Get the numeric value of a Fluent input parameter.
Get the unit label of a Fluent input parameter.
- __init__(raw_data)#
Initialize InputParameter.
- Parameters:
- raw_data
List
Input parameter data as a list.
- raw_data
- class ansys.fluent.core.filereader.case_file.Mesh(file_handle)#
Bases:
object
Class to provide mesh data.
Methods
Returns list of ids of all available surfaces.
Returns list of names of all available surfaces.
get_surface_locs
(surface_id)Returns range of surface locations for a particular surface.
get_connectivity
(surface_id)Returns numpy array of face connectivity data for a particular surface.
get_vertices
(surface_id)Returns numpy array of vertices data for a particular surface.
Methods:
__init__
(file_handle)Initialize the object.
get_connectivity
(surface_id)Returns numpy array of face connectivity data for a particular surface.
Returns the type of the mesh.
Returns list of ids of all available surfaces.
get_surface_locs
(surface_id)Returns range of surface locations for a particular surface.
Returns list of names of all available surfaces.
get_vertices
(surface_id)Returns numpy array of vertices data for a particular surface.
- __init__(file_handle)#
Initialize the object.
- get_connectivity(surface_id)#
Returns numpy array of face connectivity data for a particular surface.
- get_mesh_type()#
Returns the type of the mesh.
- get_surface_ids()#
Returns list of ids of all available surfaces.
- get_surface_locs(surface_id)#
Returns range of surface locations for a particular surface.
- get_surface_names()#
Returns list of names of all available surfaces.
- get_vertices(surface_id)#
Returns numpy array of vertices data for a particular surface.
- class ansys.fluent.core.filereader.case_file.MeshType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)#
Bases:
Enum
Types of Mesh.
Attributes:
- SURFACE = 'surface'#
- UNKNOWN = 'unknown'#
- VOLUME = 'volume'#
- class ansys.fluent.core.filereader.case_file.OutputParameter(raw_data)#
Bases:
object
Represents an output parameter.
- Attributes:
- name
str
- name
Methods:
__init__
(raw_data)Initialize OutputParameter.
- class ansys.fluent.core.filereader.case_file.RPVarProcessor(rp_vars_str)#
Bases:
object
Class to process RP Vars string to expose required outputs.
Methods
Get the input parameters.
Get the output parameters.
Get the dimensionality associated with this case.
Get the precision associated with this case (single or double).
Get the number of iterations associated with this case.
rp_vars
()Get the rpvars associated with this case.
Access the rpvars associated with this case.
has_rp_var
(name)Find if this case has the given rpvar.
Get the config variables associated with this case.
Access the config variables associated with this case.
has_config_var
(name)Get whether the case has a given variable.
Methods:
__init__
(rp_vars_str)Initialize a RPVarProcessor object.
Get the config variables associated with this case.
has_config_var
(name)Get whether the case has a given variable.
has_rp_var
(name)Find if this case has the given rpvar.
Get the input parameters.
Get the number of iterations associated with this case.
Get the dimensionality associated with this case.
Get the output parameters.
Get the precision associated with this case (single or double).
rp_vars
()Get the rpvars associated with this case.
Attributes:
Access the config variables associated with this case.
Access the rpvars associated with this case.
- __init__(rp_vars_str)#
Initialize a RPVarProcessor object.
- Parameters:
- rp_vars_str :str
RP Vars string.
- property config_var: CaseVariable#
Access the config variables associated with this case.
- Returns:
CaseVariable
The config variables associated with this case.
- config_vars()#
Get the config variables associated with this case.
- Returns:
dict
The config variables associated with this case.
- has_config_var(name)#
Get whether the case has a given variable.
- has_rp_var(name)#
Find if this case has the given rpvar.
- input_parameters()#
Get the input parameters.
- Returns:
List
[InputParameter
] |List
[InputParameterOld
]The list of input parameters.
- iter_count()#
Get the number of iterations associated with this case.
- Returns:
int
The number of iterations associated with this case.
- num_dimensions()#
Get the dimensionality associated with this case.
- Returns:
int
The number of dimensions.
- output_parameters()#
Get the output parameters.
- Returns:
List
[OutputParameter
]The list of output parameters.
- precision()#
Get the precision associated with this case (single or double).
- Returns:
int
Either 1 or 2 to indicate single or double precision respectively.
- property rp_var: CaseVariable#
Access the rpvars associated with this case.
- Returns:
CaseVariable
The rpvars associated with this case.
- class ansys.fluent.core.filereader.case_file.SettingsFile(settings_file_name=None)#
Bases:
RPVarProcessor
Class to read a Fluent Settings file.
Methods:
__init__
([settings_file_name])Initialize a SettingsFile object.