windtunnel.windtunnel_outputs module
Handles loading force coefficients, generating streamlines, and interpolating pressure fields over simulation meshes.
- class windtunnel.windtunnel_outputs.WindTunnelOutputs(simulation_path: str)[source]
Bases:
objectManages WindTunnel simulation outputs.
Provides methods to load results, including force coefficients, streamlines, and pressure fields, from a WindTunnel simulation output directory.
- simulation_path
Path to simulation output directory.
- Type:
str
- time_steps
Number of time steps in the simulation.
- Type:
int
- domain_mesh
Domain mesh from the simulation.
- Type:
pv.PolyData
- object_mesh
Object mesh from the simulation.
- Type:
pv.PolyData
- get_force_coefficients()[source]
Loads force coefficients from the simulation output.
- Returns:
Force coefficients including ‘Moment’, ‘Drag’, ‘Lift’, ‘Front Lift’, and ‘Rear Lift’.
- Return type:
dict
- get_interpolated_pressure_field()[source]
Interpolates pressure field over the object mesh points.
- Returns:
Object mesh with interpolated pressure field.
- Return type:
pv.PolyData
- get_openfoam_object_mesh()[source]
Retrieves the pressure field over the domain mesh.
- Returns:
Object mesh with pressure field data.
- Return type:
pv.PolyData
- get_streamlines(n_points=100, initial_step_length=1, source_radius=1.1, source_center=(0, 0, 0), streamline_radius=0.005)[source]
Generates streamlines from the domain mesh.
- Parameters:
n_points (int, optional) – Number of streamlines. Defaults to 100.
initial_step_length (float, optional) – Initial step length. Defaults to 1.
source_radius (float, optional) – Radius of seeding sphere. Defaults to 1.1.
source_center (tuple, optional) – Center of seeding sphere. Defaults to (0, 0, 0).
streamline_radius (float, optional) – Radius of streamlines. Defaults to 0.005.
- Returns:
Streamlines as tube-shaped meshes.
- Return type:
pv.PolyData