Plot Sectional Force Distribution#
This example demonstrates how to extract the sectional force distribution from a completed case and report it as a dimensional quantity: the cumulative drag build-up along the X axis and the spanwise load distribution along the Y axis. The solver writes these distributions as coefficients, which are scaled by the dynamic pressure and reference area (q * A) to recover dimensional values.
import flow360 as fl
case = fl.Case.from_cloud(case_id="your-case-id")
# reference values to dimensionalize the coefficients (F = C * q * A)
density = case.params.operating_condition.thermal_state.density
reference_velocity = case.params.reference_velocity
reference_area = case.params.reference_geometry.area
force_scale = (0.5 * density * reference_velocity**2 * reference_area).to(fl.u.N)
# cumulative drag force (N) along X: the cumulative curve is an integrated
# coefficient, so C * q * A is a force.
x_dist = case.results.x_slicing_force_distribution
x_dist.wait() # sectional post-processing can finish after the case
df_x = x_dist.as_dataframe()
df_x["Drag [N]"] = df_x["totalCumulative_CD_Curve"] * force_scale.value
df_x.plot(x="X", y="Drag [N]", title="Cumulative drag along X")
# spanwise lift loading (N/m) along Y: CFz_per_span is a per-span coefficient,
# so C * q * A is a force per unit span, not a total force.
y_dist = case.results.y_slicing_force_distribution
y_dist.wait()
df_y = y_dist.as_dataframe()
df_y["Lift [N/m]"] = df_y["totalCFz_per_span"] * force_scale.value
df_y.plot(x="Y", y="Lift [N/m]", title="Spanwise lift loading along Y")
Example output: the dimensional cumulative drag along X and the spanwise lift loading along Y.#
Notes#
Use
Case.from_cloud(case_id="...")to retrieve a completed case from the cloud.x_slicing_force_distributiongives the cumulative drag coefficient along X;y_slicing_force_distributiongives the per-span force and moment coefficients along Y.The raw distributions are non-dimensional. Multiply by
q * A(withq = 0.5 * density * reference_velocity**2andA = reference_geometry.area) to dimensionalize, following the same scaling as Calculate Dimensional Forces.Mind the difference in what each distribution represents.
totalCumulative_CD_Curveis an integrated (cumulative) drag coefficient, so scaling it gives a force in Newtons.totalCFz_per_spanis a per-span coefficient, so scaling it gives a sectional loading (force per unit span, N/m), not a total force.Sectional distributions are produced by post-processing, which can finish after the case has converged. Call
wait()before reading the data.filter(include="...")andfilter(exclude="...")restrict the distribution to a subset of surfaces (both support wildcard patterns such as"*Wing*"and explicit surface names).The X distribution column is
totalCumulative_CD_Curve; the Y distribution columns aretotalCFx_per_span,totalCFz_per_spanandtotalCMy_per_span.