Get Averaged Forces from a Boundary

Contents

Get Averaged Forces from a Boundary#

This example demonstrates how to retrieve lift and drag coefficients from a specific boundary and average them over the last 10% of iterations.

import flow360 as fl

# Get case from cloud
case = fl.Case.from_cloud(case_id="your-case-id")

# Get surface forces and filter to a specific boundary
surface_forces = case.results.surface_forces
surface_forces.filter(include="wing")  # supports wildcards, e.g., "wing*"

# Average over the last 10% of iterations
averaged_forces = surface_forces.get_averages(0.1)

# Print lift and drag coefficients
print(f"CL: {averaged_forces['totalCL']}")
print(f"CD: {averaged_forces['totalCD']}")

Notes#

  • Use Case.from_cloud(case_id="...") to retrieve a completed case from the cloud.

  • The surface_forces result contains force coefficients broken down by boundary.

  • Use filter(include="...") to select specific boundaries or filter(exclude="...") to exclude them. Both support wildcard patterns (e.g., "*wing*").

  • The get_averages(fraction) method computes the average over the last fraction of pseudo steps (0.1 = last 10%).

  • Available force coefficients include: CL, CD, CFx, CFy, CFz, CMx, CMy, CMz, and their pressure/skin friction components.