Gyredocs
Depth Practice
API

Gyre/Mathematics & Numerical Methods

Outputs and functionals

In one minuteThe definition, sign convention, normalisation and units of every output name a result can contain — force and moment coefficients, heat, the volume diagnostics, the surface load field and the surface distributions.

Written at L2 Practice goes to L3 MechanicsMDO integratorsCFD practitioners 1977 words Markdown

Every quantity below is non-dimensional. The reference values are the free stream: ρ∞=∣u∞∣=T∞=1\rho_\infty = |\mathbf u_\infty| = T_\infty = 1, so the free-stream pressure is p∞=1/(γM∞2)p_\infty = 1/(\gamma M_\infty^2) and the free-stream dynamic pressure is 12\tfrac12. Lengths are in the unit of the mesh coordinates. The free-stream direction is (cos⁡α,sin⁡α)(\cos\alpha, \sin\alpha) in the xx–yy plane.

Name Kind Exists for Definition in one line
cx, cy scalar every case with a wall force on the body along the mesh axes xx, yy, divided by 12Sref\tfrac12 S_\text{ref}
cd, cl scalar every case with a wall the same force along and normal to the free stream
cm scalar every case with a wall moment about reference.moment_center, nose-up positive, divided by 12SrefLref\tfrac12 S_\text{ref} L_\text{ref}
cz, cs scalar 3-D cases with a wall force along the mesh axis zz; side force in the wind axes
cmx, cmy, cmz scalar 3-D cases with a wall rolling, yawing and pitching moment about reference.moment_center; cmz is the same output as cm
heat scalar viscous cases heat flow rate from the walls into the fluid (not normalised)
entropy_error scalar every case root-mean-square relative deviation of p/ργp/\rho^\gamma from its free-stream value
kinetic_energy scalar every case volume average of 12ρ∣u∣2\tfrac12\rho|\mathbf u|^2
total_entropy scalar every case volume integral of the mathematical entropy η\eta
f_surface field (n_surface_nodes, dim) every case with a wall consistent nodal loads on the wall geometry nodes

Scalars can be differentiated with totals; the field f_surface through adjoint_product and tangent_product (gradients).

Forces and moments#

Let Γw\Gamma_w be all boundary groups with a wall condition (slip_wall, symmetry, slip_wall_mirror, noslip_adiabatic, noslip_isothermal) and n\mathbf n the unit normal pointing out of the fluid, into the body. The force the fluid exerts on the body is the momentum flux leaving the fluid through the wall,

F=∫Γw(p n−τ n) dS,\mathbf F = \int_{\Gamma_w} \big( p\,\mathbf n - \boldsymbol\tau\,\mathbf n \big)\,\mathrm dS ,

evaluated with the numerical boundary flux of the residual (see below). With SrefS_\text{ref} = reference.area and LrefL_\text{ref} = reference.length:

cx=2FxSref,cy=2FySref,cd=cxcos⁡α+cysin⁡α,cl=−cxsin⁡α+cycos⁡α.c_x = \frac{2F_x}{S_\text{ref}},\qquad c_y = \frac{2F_y}{S_\text{ref}},\qquad c_d = c_x\cos\alpha + c_y\sin\alpha,\qquad c_l = -c_x\sin\alpha + c_y\cos\alpha .

cx, cy are in the body (mesh) axes; cd, cl are in the wind axes given by the input alpha. Drag is positive downstream, lift positive towards +y+y at α=0\alpha = 0. The factor 2 is 1/(12ρ∞u∞2)1/(\tfrac12\rho_\infty u_\infty^2).

The moment is taken about xref\mathbf x_\text{ref} = reference.moment_center:

cm=−2SrefLref∫Γw[(x−xref) dFy−(y−yref) dFx].c_m = -\frac{2}{S_\text{ref} L_\text{ref}} \int_{\Gamma_w} \big[(x - x_\text{ref})\,\mathrm dF_y - (y - y_\text{ref})\,\mathrm dF_x\big] .

The integral is the moment about the zz axis, counter-clockwise positive; the minus sign makes cm positive nose-up for a body whose nose points towards −x-x (flow from left to right).

Because alpha enters cd and cl explicitly, their derivatives with respect to alpha contain the rotation of the axes as well as the change of the flow: ∂cl/∂α∣explicit=−cd\partial c_l/\partial\alpha|_\text{explicit} = -c_d and ∂cd/∂α∣explicit=cl\partial c_d/\partial\alpha|_\text{explicit} = c_l. The totals include both parts.

In 3-D, xx points downstream, yy up and zz along the span (z=x×yz = x \times y). The free stream has an angle of attack α\alpha and a sideslip angle β\beta (input beta, radians; flow.beta_deg in a case), and the wind axes are the right-handed triad

d=(cos⁡αcos⁡βsin⁡αcos⁡βsin⁡β),eL=(−sin⁡αcos⁡α0),eS=d×eL=(−cos⁡αsin⁡β−sin⁡αsin⁡βcos⁡β).\mathbf d = \begin{pmatrix}\cos\alpha\cos\beta\\ \sin\alpha\cos\beta\\ \sin\beta\end{pmatrix},\qquad \mathbf e_L = \begin{pmatrix}-\sin\alpha\\ \cos\alpha\\ 0\end{pmatrix},\qquad \mathbf e_S = \mathbf d\times\mathbf e_L = \begin{pmatrix}-\cos\alpha\sin\beta\\ -\sin\alpha\sin\beta\\ \cos\beta\end{pmatrix}.

The force coefficients are the components of 2F/Sref2\mathbf F/S_\text{ref} along them, and along the mesh axes:

Name Component
cd, cl, cs along d\mathbf d (drag), eL\mathbf e_L (lift), eS\mathbf e_S (side force)
cx, cy, cz along the mesh axes xx, yy, zz

so cs equals cz at zero sideslip and the two-dimensional definitions are recovered for β=0\beta = 0. The moment about xref\mathbf x_\text{ref} is the vector M=∫Γw(x−xref)×dF\mathbf M = \int_{\Gamma_w} (\mathbf x - \mathbf x_\text{ref}) \times \mathrm d\mathbf F, and the coefficients follow the aerodynamic sign convention, which in these axes is minus the right-hand-rule moment for all three:

cm,x=−2MxSrefLref (roll),cm,y=−2MySrefLref (yaw),cm,z=−2MzSrefLref (pitch, nose-up positive).c_{m,x} = -\frac{2 M_x}{S_\text{ref} L_\text{ref}}\ \text{(roll)},\qquad c_{m,y} = -\frac{2 M_y}{S_\text{ref} L_\text{ref}}\ \text{(yaw)},\qquad c_{m,z} = -\frac{2 M_z}{S_\text{ref} L_\text{ref}}\ \text{(pitch, nose-up positive)} .

cmz and cm are the same output. For a spanwise-extruded mesh the default reference area is the span, so the coefficients are per unit span; for a sphere_shell mesh it is the frontal area of the body. As with alpha, the totals with respect to beta contain the rotation of the wind axes. The 3-D outputs and their derivatives are verified in Three-dimensional flows.

Field of the case Default Enters
reference.area 1 in 2-D; the span for a spanwise-extruded generator mesh; the frontal area of the body for a sphere_shell mesh all force and moment coefficients
reference.length 1 the moment coefficients only
reference.moment_center [0.25, 0, 0] the moment coefficients only
reference.groups every wall group which walls the force, moment and heat-flux integrals cover
reference.components none named sets of wall groups whose integrals are additional outputs, cd_wing, cmz_tail, …

In 2-D the “area” is a length (the chord): the coefficients are per unit depth. The built-in aerofoil generators produce a unit chord, so the defaults are the usual aerofoil convention with the moment about the quarter-chord point. A mesh from a file has whatever size it was drawn at: set all three (mesh files). By default the coefficients cover all wall groups of the case. reference.groups restricts them to the named walls, which gives the loads of one component of a configuration (and, case by case, of each of them); the integrals of the selected groups add up to the integral over all walls, and their adjoint derivatives and error estimates are those of the restricted integral. The nodal load field and the surface displacement are the coupling interface and are not affected.

reference.components gives the breakdown from one solve: for every named component the same integrals are taken over its groups and returned as <coefficient>_<component>, normalised with the same reference area, length and moment point, so the outputs of components that partition the walls add up to the plain coefficients. Each is a functional of its own, built from the same numerical boundary fluxes, with its own adjoint: a drag constraint on one component, or a bending-moment proxy of another, costs one transposed solve like any other output.

The force is not computed from interpolated pressure. It is the sum over wall face nodes of the momentum components of the numerical boundary flux that the residual itself uses, times the face quadrature weight and surface Jacobian (functionals.SurfaceOps.face_forces). For a slip wall that flux is the wall pressure flux; for a no-slip wall it also contains the BR2 viscous traction. Two consequences: the forces are exactly the momentum the discrete scheme loses through the wall (discrete conservation holds for them), and the functional is adjoint consistent, which is what makes its error converge faster than the solution’s and the error estimate sharp.

Heat#

heat exists when the case has a Reynolds number. It is minus the energy flux that leaves the fluid through the wall faces,

Q=−∫ΓwFE∗⋅n dS,Q = -\int_{\Gamma_w} \mathbf F_E^{*}\cdot\mathbf n\,\mathrm dS ,

again from the numerical boundary flux. On a no-slip wall the velocity is zero, so the energy flux is the conductive heat flux alone and QQ is the heat flow rate from the wall into the fluid (positive when the wall heats the fluid; zero up to discretization error on an adiabatic wall). It is not divided by a reference quantity: its unit is ρ∞u∞3Ld−1\rho_\infty u_\infty^3 L^{d-1}, per unit depth in 2-D. If the case also has slip walls they are part of Γw\Gamma_w, where the flux contributes p u⋅np\,\mathbf u\cdot\mathbf n, which the slip condition makes vanish.

Volume diagnostics#

With V=∫ΩdVV = \int_\Omega \mathrm dV and integrals evaluated by the Gauss–Lobatto quadrature of the scheme:

entropy_error=1V∫Ω(ss∞−1)2dV,s=pργ,\texttt{entropy\_error} = \sqrt{\frac1V\int_\Omega \Big(\frac{s}{s_\infty} - 1\Big)^2 \mathrm dV}, \qquad s = \frac{p}{\rho^\gamma}, kinetic_energy=1V∫Ω12ρ ∣u∣2 dV,total_entropy=∫Ωη dV,η=−ρ (ln⁡p−γln⁡ρ)γ−1.\texttt{kinetic\_energy} = \frac1V\int_\Omega \tfrac12\rho\,|\mathbf u|^2\,\mathrm dV, \qquad \texttt{total\_entropy} = \int_\Omega \eta\,\mathrm dV,\quad \eta = -\frac{\rho\,(\ln p - \gamma\ln\rho)}{\gamma - 1}.
  • entropy_error is zero for an exact solution of a smooth inviscid flow from a uniform free stream (the entropy function ss is then constant), so for such cases it measures the spurious entropy the discretization produces and falls under refinement. With shocks, viscosity or heat transfer it contains physical entropy changes and is not an error.
  • kinetic_energy equals 12\tfrac12 in the undisturbed free stream.
  • total_entropy uses the mathematical entropy η\eta, which has the opposite sign of the physical one and is not normalised by the volume. Its value is dominated by the size of the domain: for the free stream at Mach 0.5, η∞=−ln⁡p∞/(γ−1)≈−2.62\eta_\infty = -\ln p_\infty/(\gamma - 1) \approx -2.62 per unit area, and the O-mesh of the naca0012_euler preset reaches 50 chords, so the first run prints total_entropy ≈−2.06×104\approx -2.06\times10^{4}. It is a diagnostic for unsteady entropy studies, of little use as a design output.

Surface fields#

f_surface has one row per wall geometry node, in the order of surface_coordinates() and of the input x_surface. Row jj is ∫ΓwNj dF\int_{\Gamma_w} N_j\,\mathrm d\mathbf F with NjN_j the geometry shape function of the node: the traction integrated against the basis in which a displacement of the surface is interpolated. The loads are therefore

  • conservative: they sum to the total force, f_surface.sum(axis=0) =F= \mathbf F, i.e. 2 * f_surface.sum(0) / reference.area equals (cx, cy) (of all walls: the load field is not restricted by reference.groups);
  • work-consistent with x_surface: the virtual work of a displacement field is the dot product of the two arrays.

They are forces on the structure (per unit depth in 2-D), not coefficients: no factor 2 and no reference area.

result.json, the session command distributions and SurfaceOps.distributions give, at the wall face nodes, the coordinates x and

cp=2 (tn−p∞),cf=2 t⋅s,c_p = 2\,(t_n - p_\infty), \qquad c_f = 2\,\mathbf t\cdot\mathbf s ,

where t\mathbf t is the traction of the numerical boundary flux (momentum flux per unit area), tn=t⋅nt_n = \mathbf t\cdot\mathbf n its component along the normal that points into the body, and s=(−ny,nx)\mathbf s = (-n_y, n_x) the tangent obtained by rotating that normal by +90°+90°. On a slip wall tnt_n is the wall pressure, so cp is the usual pressure coefficient (p−p∞)/(12ρ∞u∞2)(p - p_\infty)/(\tfrac12\rho_\infty u_\infty^2); on a no-slip wall it also contains the normal viscous stress. cf is signed by the direction of s\mathbf s, exists in 2-D only, and is zero up to discretization error on a slip wall.

Units of derivatives#

Input Unit of the input Note
alpha radian the only angle the in-process discipline knows
alpha_deg degree accepted by the CLI, jobs, sessions, sweeps; the derivative is per degree, i.e. the alpha derivative times π/180\pi/180
mach, re, gamma, pr dimensionless
x_surface mesh length unit displacement of each wall geometry node; the derivative has the shape of the input

A derivative is returned under the name it was requested with, so alpha and alpha_deg cannot be confused in a result — but they differ by a factor of about 57.3.

    ↑ ↓ moveEnter open[ ] change depthResults show section and depth level