compute_forces#

Variables.compute_forces(pobj_list: List[str | int | ENS_PART] | None = None, press_var_obj: str | int | ENS_VAR | None = None, shear_var_obj: str | int | ENS_VAR | None = None, shear_var_type: int | None = None, area_ref: float | None = None, density_ref: float | None = None, velocity_x_ref: float | None = None, velocity_y_ref: float | None = None, velocity_z_ref: float | None = None, up_vector: str | None = None, export_filename: str | None = None, frame_index: int | None = 0) Dict[str, Dict[str, List[float]]] | None#

Compute the force values for the current model. During the force computation process, several intermediate EnSight variables are computed. These can always be retrieved for later use. If area_ref, density_ref, velocity_x_ref, velocity_y_ref and velocity_z_ref are supplied, also the normalized forces will be computed. If velocity_x_ref, velocity_y_ref, velocity_z_ref and up_vector are supplied, also the lift, drag and side components of the force will be computed. Eventually, also the normalized lift, drag and side force components are computed if also area_ref and density_ref are supplied. The forces are returned in a dictionary, which will split the force values in pressure, shear, normalized pressure, normalized shear, lds pressure, lds shear, normalized lds pressure and normalized lds shear components, populated depending on the input (lds stands for lift, drag and side components). They can optionatally be saved into a .csv file, which will also report the total values for each group.

Parameters:
pobj_list: list

The list of part objects to compute the forces on. It can either be a list of names a list of IDs (integers or strings) or directly a list of ENS_PART objects. The list must contain 2D surfaces.

press_var_obj: str, ENS_VAR or int

The variable to use for the pressure force computation. It can be supplied as variable name, variable ID or ENS_VAR object. It must be a scalar.

shear_var_obj: str, ENS_VAR or int

The variable to use for the shear force computation. It can be supplied as variable name, variable ID or ENS_VAR object. It must be a vector.

shear_var_type: int

The kind of shear variable supplied. It can be:

Name

Shear variable type

SHEAR_VAR_TYPE_STRESS

The variable represents the shear stresses distribution

SHEAR_VAR_TYPE_FORCE

The variable represents the shear forces distribution

If not supplied, it will be defaulted to SHEAR_VAR_TYPE_STRESS

area_ref: float

the area reference value for the force coefficients computation

density_ref: float

the area reference value for the force coefficients computation

velocity_x_ref: float

the X velocity reference component. Needed For the coefficients computation and/or the lift/drag/side components computation. The X direction is the X direction for the model.

velocity_y_ref: float

the Y velocity reference component. Needed For the coefficients computation and/or the lift/drag/side components computation. The Y direction is the Y direction for the model.

velocity_z_ref: float

the Z velocity reference component. Needed For the coefficients computation and/or the lift/drag/side components computation. The Z direction is the Z direction for the model.

up_vector: str

Define the “up vector” for the lift/drag/side decomposition. It can be: ================== ================= Name Up vector value ================== ================= UP_VECTOR_PLUS_X +X UP_VECTOR_PLUS_Y +Y UP_VECTOR_PLUS_Z +Z UP_VECTOR_MINUS_X -X UP_VECTOR_MINUS_Y -Y UP_VECTOR_MINUS_Z -Z ================== =================

If not provided, it will default to +Z

export_filename: str

The filename for the export file. If not provided, not file will be exported. The file will be exported relative to the PyEnSight session, not to the EnSight session.

frame_index: int

The eventual frame index on which to compute the cylindrical components of the forces. If not provided, the cylindrical components won’t be computed.

Returns:
dict:

A dictionary containing all the forces computed, split by force kind and part name