functional#
Module providing reductions functions that can be applied to Fluent data from one or across multiple remote Fluent sessions.
The following parameters are relevant for the reduction functions. The expr parameter is not relevant to all reductions functions.
Parameters#
- expressionAny
Expression that can be either a string or an instance of a specific settings API named_expressions object. The expression can be a field variable or a a valid Fluent expression. A specified named expression can be handled for multiple solvers as long as the expression’s definition is valid in each solver (it does not need to be created in each solver)
- locationsAny
A list of location strings, or an API object that can be resolved to a list of location strings (for example, setup.boundary_conditions, or results.surfaces.plane_surface), or a list of such objects. If location strings are included in the list, then only string must be included
- ctxtAny, optional
An optional API object (for example, the root solver session object but any solver API object will suffice) to set the context of the call’s execution. If the location objects are strings, then such a context is required
Returns#
- float or List[float]
The result of the reduction
Examples#
>>> from ansys.fluent.core.fields.reduction import functional as reduction
>>> # Compute the area average of absolute pressure across all boundary
>>> # condition surfaces of the given solver
>>> reduction.area_average(
... expr = "AbsolutePressure",
... locations = solver.settings.setup.boundary_conditions.velocity_inlet
... )
10623.0
>>> from ansys.fluent.core.fields.reduction import functional as reduction
>>> # Compute the minimum of the square of velocity magnitude
>>> # for all pressure outlets across two solvers
>>> named_exprs = solver1.settings.setup.named_expressions
>>> vsquared = named_exprs["vsquared"] = {}
>>> vsquared.definition = "VelocityMagnitude ** 2"
>>> reduction.minimum(
... expr = vsquared,
... locations = solver1.settings.setup.boundary_conditions.pressure_outlet
... + solver2.settings.setup.boundary_conditions.pressure_outlet
... )
19.28151
Exceptions:
|
Raised on an attempt to make a bad reduction request. |
Classes:
|
Enum of available weighting options for |
alias of |
Functions:
|
Compute the total area of the specified locations. |
|
Compute the area averaged value of the specified expression over the specified locations. |
|
Compute the area integrated averaged of the specified expression over the specified locations. |
|
Compute the geometric centroid of the specified location(s) as a vector. |
|
Compute the total number of cells included in the specified locations. |
|
Compute the force acting on the location(s) specified (should be walls) as a vector. |
|
Compute the mass-weighted average value of the specified expression over the specified locations. |
|
Compute the total mass flow rate of the specified locations. |
|
Compute the mass-flow-weighted average value of the specified expression over the specified locations. |
|
Compute the total mass flow over the specified locations. |
|
Compute the total mass-weighted value of the specified expression over the specified locations. |
|
Compute the maximum of the specified expression over the specified locations. |
|
Compute the minimum of the specified expression over the specified locations. |
|
Compute the moment vector about the specified point (which can be single-valued expression) for the specified location(s). |
|
Compute the pressure force acting on the location(s) specified (should be walls) as a vector. |
|
Compute the sum of the specified expression over the specified locations. |
|
Compute the sum of the specified expression over the specified locations if a condition is satisfied. |
|
Compute the viscous force acting on the location(s) specified (should be walls) as a vector. |
|
Compute the total volume of the specified locations. |
|
Compute the volume-weighted average value of the specified expression over the specified locations. |
|
Compute the volume-weighted total of the specified expression over the specified locations. |
- exception ansys.fluent.core.fields.reduction.functional.BadReductionRequest(err)#
Bases:
ExceptionRaised on an attempt to make a bad reduction request.
Methods:
__init__(err)__init__ method of BadReductionRequest class.
- __init__(err)#
__init__ method of BadReductionRequest class.
- class ansys.fluent.core.fields.reduction.functional.Weight(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)#
Bases:
EnumEnum of available weighting options for
sumandsum_if.Attributes:
- ABS_MASS_FLOW_RATE = 'AbsMassFlowRate'#
- AREA = 'Area'#
- MASS = 'Mass'#
- MASS_FLOW_RATE = 'MassFlowRate'#
- VOLUME = 'Volume'#
- ansys.fluent.core.fields.reduction.functional.area(locations, ctxt=None)#
Compute the total area of the specified locations.
- Parameters:
- locations
Any - ctxt
Any,optional - Returns
- ——-
- float
- locations
- ansys.fluent.core.fields.reduction.functional.area_average(expression, locations, ctxt=None)#
Compute the area averaged value of the specified expression over the specified locations.
- Parameters:
- expression
Any - locations
Any - ctxt
Any,optional - Returns
- ——-
- float
- expression
- ansys.fluent.core.fields.reduction.functional.area_integral(expression, locations, ctxt=None)#
Compute the area integrated averaged of the specified expression over the specified locations.
- Parameters:
- expression
Any - locations
Any - ctxt
Any,optional - Returns
- ——-
- float
- expression
- ansys.fluent.core.fields.reduction.functional.centroid(locations, ctxt=None)#
Compute the geometric centroid of the specified location(s) as a vector.
- Parameters:
- locations
Any - ctxt
Any,optional - Returns
- ——-
- tuple
- locations
- ansys.fluent.core.fields.reduction.functional.count(locations, ctxt=None)#
Compute the total number of cells included in the specified locations.
- Parameters:
- locations
Any - ctxt
Any,optional - Returns
- ——-
- float
- locations
- ansys.fluent.core.fields.reduction.functional.force(locations, ctxt=None)#
Compute the force acting on the location(s) specified (should be walls) as a vector.
- Parameters:
- locations
Any - ctxt
Any,optional - Returns
- ——-
- tuple
- locations
- ansys.fluent.core.fields.reduction.functional.mass_average(expression, locations, ctxt=None)#
Compute the mass-weighted average value of the specified expression over the specified locations.
- Parameters:
- expression
Any - locations
Any - ctxt
Any,optional - Returns
- ——-
- float
- expression
- ansys.fluent.core.fields.reduction.functional.mass_flow(locations, ctxt=None)#
Compute the total mass flow rate of the specified locations.
- Parameters:
- locations
Any - ctxt
Any,optional - Returns
- ——-
- float
- locations
- ansys.fluent.core.fields.reduction.functional.mass_flow_average(expression, locations, ctxt=None)#
Compute the mass-flow-weighted average value of the specified expression over the specified locations.
- Parameters:
- expression
Any - locations
Any - ctxt
Any,optional - Returns
- ——-
- float
- expression
- ansys.fluent.core.fields.reduction.functional.mass_flow_integral(expression, locations, ctxt=None)#
Compute the total mass flow over the specified locations.
- Parameters:
- expression
Any - locations
Any - ctxt
Any,optional - Returns
- ——-
- float
- expression
- ansys.fluent.core.fields.reduction.functional.mass_integral(expression, locations, ctxt=None)#
Compute the total mass-weighted value of the specified expression over the specified locations.
- Parameters:
- expression
Any - locations
Any - ctxt
Any,optional - Returns
- ——-
- float
- expression
- ansys.fluent.core.fields.reduction.functional.maximum(expression, locations, ctxt=None)#
Compute the maximum of the specified expression over the specified locations.
- Parameters:
- expression
Any - locations
Any - ctxt
Any,optional - Returns
- ——-
- float
- expression
- ansys.fluent.core.fields.reduction.functional.minimum(expression, locations, ctxt=None)#
Compute the minimum of the specified expression over the specified locations.
- Parameters:
- expression
Any - locations
Any - ctxt
Any,optional - Returns
- ——-
- float
- expression
- ansys.fluent.core.fields.reduction.functional.moment(expression, locations, ctxt=None)#
Compute the moment vector about the specified point (which can be single-valued expression) for the specified location(s).
- Parameters:
- expression
Any - locations
Any - ctxt
Any,optional - Returns
- ——-
- tuple
- expression
- ansys.fluent.core.fields.reduction.functional.pressure_force(locations, ctxt=None)#
Compute the pressure force acting on the location(s) specified (should be walls) as a vector.
- Parameters:
- locations
Any - ctxt
Any,optional - Returns
- ——-
- tuple
- locations
- ansys.fluent.core.fields.reduction.functional.sum(expression, locations, weight, ctxt=None)#
Compute the sum of the specified expression over the specified locations.
- Parameters:
- expression
Any - locations
Any - weight: str | Weight
- ctxt
Any,optional - Returns
- ——-
- float
- expression
- ansys.fluent.core.fields.reduction.functional.sum_if(expression, condition, locations, weight, ctxt=None)#
Compute the sum of the specified expression over the specified locations if a condition is satisfied.
- Parameters:
- expression
Any - condition: str
- locations
Any - weight: str | Weight
- ctxt
Any,optional - Returns
- ——-
- float
- expression
- ansys.fluent.core.fields.reduction.functional.viscous_force(locations, ctxt=None)#
Compute the viscous force acting on the location(s) specified (should be walls) as a vector.
- Parameters:
- locations
Any - ctxt
Any,optional - Returns
- ——-
- tuple
- locations
- ansys.fluent.core.fields.reduction.functional.volume(locations, ctxt=None)#
Compute the total volume of the specified locations.
- Parameters:
- locations
Any - ctxt
Any,optional - Returns
- ——-
- float
- locations
- ansys.fluent.core.fields.reduction.functional.volume_average(expression, locations, ctxt=None)#
Compute the volume-weighted average value of the specified expression over the specified locations.
- Parameters:
- expression
Any - locations
Any - ctxt
Any,optional - Returns
- ——-
- float
- expression
- ansys.fluent.core.fields.reduction.functional.volume_integral(expression, locations, ctxt=None)#
Compute the volume-weighted total of the specified expression over the specified locations.
- Parameters:
- expression
Any - locations
Any - ctxt
Any,optional - Returns
- ——-
- float
- expression