Skip to content

feat: validation with error breakdown (numerical, Mach, viscosity) - #10

Open
PSamuele wants to merge 1 commit into
feat/xfoil-objectivefrom
feat/validation-error-breakdown
Open

PSamuele wants to merge 1 commit into
feat/xfoil-objectivefrom
feat/validation-error-breakdown

Conversation

@PSamuele

Copy link
Copy Markdown
Contributor

What

The validation now explains why the in-house Cl differs from XFOIL.
Reference: XFOIL viscous at the real Mach number. For every angle XFOIL runs four times:

Run Viscous Mach
A In-house (panel method) no 0
B XFOIL no 0
C XFOIL no real
E XFOIL yes 0
D XFOIL (reference) yes real

dCl total = A - D = num + Mach + visc

  • num = A - B: numerical error of the panel method (same physics)
  • Mach = ((B - C) + (E - D)) / 2: compressibility, ignored by the in-house solver
  • visc = ((C - D) + (B - E)) / 2: boundary layer, ignored by the in-house solver

Mach and viscosity interact, so their parts are the average of the two orders (Mach first, viscosity first). The split between them can change by up to 0.006 of Cl depending on the order. The sum is exact by construction.
Positive dCl = the in-house solver overestimates Cl.

Other changes:

  • XFoilAnalysis(viscous=False) for inviscid runs. The default stays viscous, so the optimizers are unchanged.
  • Terminal: one line per angle with total and parts. A failed XFOIL run is named (FAILED viscous M0, TIMEOUT ...) instead of always "XFOIL TIMEOUT".
  • CSV: all Cl values, viscous Cd and the four error columns. The relative error in % is removed (it blew up near Cl = 0).
  • Plots: validation_plot_cl.svg (Cl vs alpha, in-house / XFOIL inviscid / XFOIL viscous) and validation_plot_error.svg (error parts vs alpha), one column per airfoil.
  • README updated.

Results (Re 3.42e6, Mach 0.147, 160 panels, Windows), alpha = 8 deg

Airfoil Total Numerical Mach Viscosity
NACA 0012 +0.054 -0.008 -0.015 +0.077
NACA 2412 +0.083 -0.012 -0.018 +0.112
NACA 4412 +0.127 -0.016 -0.020 +0.162
  • The boundary layer explains most of the difference and grows with camber and angle.
  • Numerical error of the panel method: about 1% of Cl.
  • Mach part (about -0.02 at 10 deg): this is what a Prandtl-Glauert correction in the in-house solver would remove. To be discussed together.

Known limitation

If one of the intermediate XFOIL runs fails, only the total is shown ("breakdown N/A"). On Windows this happened once in 24 cases (NACA 2412, 6 deg, viscous at Mach 0).

Verified

  • Baseline 24/24.
  • Windows and Linux: viscous Cl identical to the previous validation; in all complete cases total = num + Mach + visc exactly.

Depends on

#9 (base branch: feat/xfoil-objective).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant