solution_variables#
Wrappers over SVAR gRPC service of Fluent.
Classes:
|
Provides access to Fluent SVAR data on zones. |
|
Provide access to Fluent SVARs and Zones information. |
|
SVAR service of Fluent. |
Exceptions:
|
Exception class for errors in solution variable name. |
|
Exception class for errors in Zone name. |
Functions:
|
Extracts SVAR data via a server call. |
- class ansys.fluent.core.services.solution_variables.SolutionVariableData(service, solution_variable_info)#
Bases:
object
Provides access to Fluent SVAR data on zones.
Examples
>>> solution_variable_data = solver_session.fields.solution_variable_data >>> sv_t_wall_fluid=solver_session.fields.solution_variable_data.get_data(solution_variable_name="SV_T", domain_name="mixture", zone_names=["fluid", "wall"]) >>> print(sv_t_wall_fluid.domain) >>> 'mixture' >>> print(sv_t_wall_fluid.zones) >>> ['fluid', 'wall'] >>> fluid_temp = sv_t_wall_fluid['fluid'] >>> print(fluid_temp.size) >>> 13852 >>> print(fluid_temp.dtype) >>> float64 >>> print(fluid_temp) >>> array([600., 600., 600., ..., 600., 600., 600.]) >>> wall_temp_array = solution_variable_data.create_empty_array("SV_T", "wall") >>> fluid_temp_array =solution_variable_data.create_empty_array("SV_T", "fluid") >>> wall_temp_array[:]= 500 >>> fluid_temp_array[:]= 600 >>> zone_names_to_solution_variable_data = {'wall':wall_temp_array, 'fluid':fluid_temp_array} >>> solution_variable_data.set_data(solution_variable_name="SV_T", domain_name="mixture", zone_names_to_solution_variable_data=zone_names_to_solution_variable_data)
Classes:
Data
(domain_name, zone_id_name_map, ...)Solution variable data.
Methods:
__init__
(service, solution_variable_info)Initialize SolutionVariableData.
create_empty_array
(solution_variable_name, ...)Get numpy zeros array for the SVAR on a zone.
get_data
(solution_variable_name, zone_names)Get SVAR data on zones.
get_svar_data
(svar_name, zone_names[, ...])Get solution variable data.
set_data
(solution_variable_name, ...[, ...])Set SVAR data on zones.
set_svar_data
(svar_name, zone_names_to_svar_data)Set solution variable data.
- class Data(domain_name, zone_id_name_map, solution_variable_data)#
Bases:
object
Solution variable data.
Methods:
__init__
(domain_name, zone_id_name_map, ...)Initialize Data.
Attributes:
- __init__(domain_name, zone_id_name_map, solution_variable_data)#
Initialize Data.
- property data#
Solution variable data.
- property domain#
Domain name.
- property zones#
Zone name.
- __init__(service, solution_variable_info)#
Initialize SolutionVariableData.
- create_empty_array(solution_variable_name, zone_name, domain_name='mixture')#
Get numpy zeros array for the SVAR on a zone.
This array can be populated with values to set SVAR data.
- get_data(solution_variable_name, zone_names, domain_name='mixture')#
Get SVAR data on zones.
- Parameters:
- Returns:
SolutionVariableData.Data
Object containing SVAR data.
- get_svar_data(svar_name, zone_names, domain_name='mixture')#
Get solution variable data.
- set_data(solution_variable_name, zone_names_to_solution_variable_data, domain_name='mixture')#
Set SVAR data on zones.
- set_svar_data(svar_name, zone_names_to_svar_data, domain_name='mixture')#
Set solution variable data.
- class ansys.fluent.core.services.solution_variables.SolutionVariableInfo(service)#
Bases:
object
Provide access to Fluent SVARs and Zones information.
Examples
>>> solution_variable_info = solver_session.fields.solution_variable_info >>> wall_fluid_info = solution_variable_info.get_variables_info(zone_names=['wall' , "fluid"], domain_name="mixture") >>> print(wall_fluid_info.solution_variables) >>> ['SV_CENTROID', 'SV_D', 'SV_H', 'SV_K', 'SV_P', 'SV_T', 'SV_U', 'SV_V', 'SV_W'] >>> solution_variable_info_centroid = wall_fluid_info['SV_CENTROID'] >>> print(solution_variable_info_centroid) >>> name:SV_CENTROID dimension:3 field_type:<class 'numpy.float64'> >>> zones_info = solution_variable_info.get_zones_info() >>> print(zones_info.zones) >>> ['fluid', 'wall', 'symmetry', 'pressure-outlet-7', 'velocity-inlet-6', 'velocity-inlet-5', 'default-interior'] >>> zone_info = zones_info['wall'] >>> print(zone_info) >>> name:wall count: 3630 zone_id:3 zone_type:wall thread_type:Face
Classes:
SolutionVariables
(solution_variables_info)Class containing information for multiple solution variables.
ZonesInfo
(zones_info, domains_info)Class containing information for multiple zones.
Methods:
__init__
(service)Initialize SolutionVariableInfo.
get_svars_info
(zone_names[, domain_name])Get solution variables info.
get_variables_info
(zone_names[, domain_name])Get SVARs info for zones in the domain.
Get Zones info.
- class SolutionVariables(solution_variables_info)#
Bases:
object
Class containing information for multiple solution variables.
Classes:
SolutionVariable
(solution_variable_info)Class containing information for single solution variable.
Methods:
__init__
(solution_variables_info)Initialize SolutionVariables.
Attributes:
Solution variables.
Solution variables.
- class SolutionVariable(solution_variable_info)#
Bases:
object
Class containing information for single solution variable.
Methods:
__init__
(solution_variable_info)Initialize SolutionVariable.
- __init__(solution_variable_info)#
Initialize SolutionVariable.
- __init__(solution_variables_info)#
Initialize SolutionVariables.
- class ZonesInfo(zones_info, domains_info)#
Bases:
object
Class containing information for multiple zones.
Classes:
ZoneInfo
(zone_info)Class containing information for single zone.
Methods:
Attributes:
- class ZoneInfo(zone_info)#
Bases:
object
Class containing information for single zone.
Classes:
PartitionsInfo
(partition_info)Class containing information for partitions.
Methods:
__init__
(zone_info)Initialize ZoneInfo.
Attributes:
Get zone count.
- class PartitionsInfo(partition_info)#
Bases:
object
Class containing information for partitions.
Methods:
__init__
(partition_info)Initialize PartitionsInfo.
- __init__(partition_info)#
Initialize PartitionsInfo.
- __init__(zone_info)#
Initialize ZoneInfo.
- __init__(zones_info, domains_info)#
Initialize ZonesInfo.
- domain_id(domain_name)#
Get domain id.
- __init__(service)#
Initialize SolutionVariableInfo.
- get_svars_info(zone_names, domain_name='mixture')#
Get solution variables info.
- get_variables_info(zone_names, domain_name='mixture')#
Get SVARs info for zones in the domain.
- Parameters:
- zone_names
List
[str
] List of zone names.
- domain_name: str, optional
Domain name.The default is
mixture
.
- zone_names
- Returns:
SolutionVariableInfo.SolutionVariables
Object containing information for SVARs which are common for list of zone names.
- get_zones_info()#
Get Zones info.
- Parameters:
- None
- Returns:
SolutionVariableInfo.ZonesInfo
Object containing information for all zones.
- class ansys.fluent.core.services.solution_variables.SolutionVariableService(channel, metadata)#
Bases:
object
SVAR service of Fluent.
Methods:
__init__
(channel, metadata)__init__ method of SVAR service class.
get_data
(request)GetSvarData RPC of SVAR service.
get_variables_info
(request)GetSvarsInfo RPC of SVAR service.
get_zones_info
(request)GetZonesInfo RPC of SVAR service.
set_data
(request)SetSvarData RPC of SVAR service.
- __init__(channel, metadata)#
__init__ method of SVAR service class.
- get_data(request)#
GetSvarData RPC of SVAR service.
- get_variables_info(request)#
GetSvarsInfo RPC of SVAR service.
- get_zones_info(request)#
GetZonesInfo RPC of SVAR service.
- set_data(request)#
SetSvarData RPC of SVAR service.
- exception ansys.fluent.core.services.solution_variables.SvarError(solution_variable_name, allowed_values)#
Bases:
ValueError
Exception class for errors in solution variable name.
Methods:
__init__
(solution_variable_name, allowed_values)Initialize SvarError.
- __init__(solution_variable_name, allowed_values)#
Initialize SvarError.
- exception ansys.fluent.core.services.solution_variables.ZoneError(zone_name, allowed_values)#
Bases:
ValueError
Exception class for errors in Zone name.
Methods:
__init__
(zone_name, allowed_values)Initialize ZoneError.
- __init__(zone_name, allowed_values)#
Initialize ZoneError.
- ansys.fluent.core.services.solution_variables.extract_svars(solution_variables_data)#
Extracts SVAR data via a server call.