Skip to main content
Version: 0.2.0

Solver parameters

Every field of the Param struct (data/param.h). Set them through foil.GetState().param before solving.

foil.GetState().param.verb = 1;
foil.GetState().param.ncrit = 11.0;
foil.GetState().param.use_ptc = false;

The defaults work for most cases. These fields aren't available on the Philote server.

Newton solver​

FieldDefaultNotes
verb00 silent, 1 summary per iter, 2 very verbose. Set to 1 when convergence trouble starts.
rtol1e-11Newton residual tolerance. Below 1e-12, round-off gets in the way.
rtol_floor1e-8Also converged once the residual is below this and a step no longer halves it: the round-off floor, which on some cases sits above rtol
niglob200Maximum iterations for a coupled solve
bl_marchtrueBefore each Newton step, re-solve the boundary layer by a march at the current ue, as XFOIL does. false gives mfoil's iteration
step_limiterStepLimiter::AbsoluteUnder-relaxation rule: Absolute (mfoil) caps the amplification change at 2, the shear-stress change at 0.05 and the ue change at 0.2; Relative (XFOIL) scales the step so no change exceeds +150% or −50% of its value
warm_starttrueStart a viscous Solve() from the last converged boundary layer of the same object; cold start if that fails
scale_coupled_systemtrueEquilibrate the assembled system of the trust-region step
use_continuationtrueRetry failed cold starts along an angle/lift path
continuation_max_attempts24Maximum continuation attempts
continuation_max_iterations800Total extra coupled iterations
use_trust_regionfalseExperimental dogleg step control

Pseudo-transient continuation​

See PTC concepts for the algorithm.

FieldDefaultNotes
use_ptctrueMaster switch
tau_init1e6Start nearly Newton
tau_min1e-2Maximum damping floor
tau_max1e8Effectively "PTC off" ceiling
tau_grow_clamp4.0Per-iter growth cap
tau_shrink_clamp0.1Per-iter shrink cap

Adjoint​

There's nothing to tune. The adjoint uses the plain converged Jacobian, and reports a failed or inaccurate solve as an error. (An older adjoint_ridge option was removed: regularizing the Jacobian gives the wrong derivatives.)

Boundary-layer closures​

Constants of the Drela/mfoil closure relations. Leave them alone unless you mean to change the model.

FieldDefaultRole
ncrit9.0 transition threshold (see Transition)
transitionTransitionModel::CutCellTransitionModel::Captured blends laminar and turbulent closures smoothly, for smooth gradients; experimental, prescribed angle of attack only (see Captured transition)
capt_L, capt_ws, capt_wc, capt_b60, 1, 1, 0Captured model: transition length in momentum thicknesses, onset and blend widths in amplification factor, blend offset
onsetOnsetModel::CubicAmplification onset ramp; OnsetModel::Envelope is fitted to stability theory (see Onset of amplification)
Cuq1.0Scales the term in the shear lag equation
Dlr0.9Wall/wake dissipation length ratio
SlagK5.6Shear lag constant
CtauC1.8Transition shear-state multiplier
CtauE3.3Transition shear-state exponent
GA, GB, GC6.7, 0.75, 18.0G– locus constants

Thermodynamics​

Most of these are computed from the operating point during the solve, so treat them as outputs.

FieldDefaultNotes
Minf0.0Freestream Mach
Vinf0.0Freestream speed (the wrapper uses normalized speed 1)
muinf0.0Freestream dynamic viscosity (derived)
mu00.0Stagnation dynamic viscosity (derived)
rho01.0Stagnation density
H00.0Stagnation enthalpy (derived)
Tsrat0.35Sutherland
gam1.4Ratio of specific heats — air
KTb, KTl, cpsderivedKármán–Tsien constants and sonic , initialized during solving

Speed and density are normalized, so these fields aren't a way to describe a different fluid. Changing gam or Tsrat departs from the validated model.

Station flags​

Internal flags for the station being evaluated. Don't set them.

FieldMeaning
simiTrue at a similarity (stagnation-region) station
turbTrue at a turbulent station
wakeTrue at a wake station