{"id": "rans_extruded_3d", "title": "Three-dimensional consistency with the Spalart-Allmaras model", "description": "The turbulent flat plate of the preset flat_plate_sa (M = 0.2, Re = 5e6, degree 2, first cell 5e-5 high) is solved on its 2-D section and on a spanwise-periodic extrusion of that section into hexahedra (3 across a span of 3), both from the free stream with line Jacobi as the smoother of the p-multigrid levels 2-1-0. A correct 3-D implementation of the RANS equations (viscous and turbulent fluxes, the source terms of the model, the wall distance, the boundary conditions, the line smoother, force integration and the discrete adjoint) must give the drag of the section per unit span, its skin friction and the adjoint derivative of the drag. Section and extrusion have the same in-plane equations only at the same BR2 penalty, whose default is the number of faces of an element (4 for quadrilaterals, 6 for hexahedra): the section is therefore solved with 6, the default of the extrusion, and once more with its own default, which is reported without a check. Three kinds of statement are checked. Before the 3-D solve, the solution of the section is extruded and put into the 3-D residual: the equations the section has must be satisfied as well as the section satisfies them (below 1e-8 of the free-stream residual; the flow solves stop at a drop of 1e-9), which tests the 3-D operator without the 3-D solver. The spanwise momentum equation is not satisfied by the extruded solution, for the reason given in the notes, so that the 3-D solution has a small spanwise velocity that alternates within each element: it must leave the layers identical and mirror-symmetric and exert no net spanwise force (round-off only: below 1e-8). Being odd across the mid-plane of an element, it cannot change the mean over the span at first order: drag, mean skin friction and the derivative must agree with the section to 1e-6. The size of the spanwise velocity itself is reported, not checked.", "passed": true, "checks": [{"name": "the three flow solves converged from the free stream", "value": true, "expected": "true", "passed": true}, {"name": "the solution of the section, extruded, in the 3-D discretization: residual of the equations of the section, relative to the residual of the free stream", "value": 6.840613852355606e-10, "expected": "< 1e-8", "passed": true}, {"name": "drag coefficient per unit span: |3-D - 2-D| / |2-D|", "value": 5.22707081826725e-09, "expected": "< 1e-6", "passed": true}, {"name": "skin friction at x = 0.97008, mean over the span: |3-D - 2-D| / |2-D|", "value": 3.864006562403763e-09, "expected": "< 1e-6", "passed": true}, {"name": "transposed solves reached their tolerance of 1e-10 (section and extrusion)", "value": true, "expected": "true", "passed": true}, {"name": "adjoint derivative of the drag with respect to the Mach number: |3-D - 2-D| / |2-D|", "value": 2.4160988504474636e-11, "expected": "< 1e-6", "passed": true}, {"name": "the spanwise layers repeat each other: largest difference of the state between a layer and the first", "value": 7.69363491929644e-12, "expected": "< 1e-8", "passed": true}, {"name": "every layer is symmetric about its mid-plane (spanwise momentum odd, the other variables even): largest defect", "value": 1.081943018759472e-11, "expected": "< 1e-8", "passed": true}, {"name": "no net spanwise force: |cs|", "value": 3.0839407110572535e-19, "expected": "< 1e-8", "passed": true}, {"name": "lines of the extrusion: those of the section in each spanwise layer (elements in lines)", "value": 393, "expected": "= 3 x 131, in 3 x 18 lines", "passed": true}], "charts": [], "tables": [{"id": "comparison", "title": "2-D section versus 3-D extrusion", "columns": ["quantity", "2-D section, penalty 6", "3-D extrusion (per unit span)", "relative difference", "2-D section, default penalty", "relative difference of the extrusion to it"], "rows": [["drag coefficient cd", 0.0057687097486405, 0.005768709718487045, 5.22707081826725e-09, 0.0057536474793876274, 0.0026178592194565655], ["skin friction cf at x = 0.97008 (mean over the span)", 0.002705430900586399, 0.002705430890132596, 3.864006562403763e-09, 0.002701031477071151, 0.0016287900007058616], ["d cd / d Mach (adjoint)", -0.049967182292802725, -0.04996718229400998, 2.4160988504474636e-11, -0.049873584211535205, 0.00187670655627612]]}, {"id": "span", "title": "The 3-D solution along the span (reported, not checked)", "columns": ["quantity", "value"], "rows": [["residual of the extruded solution of the section: its own equations / free stream", 6.840613852355606e-10], ["residual of the extruded solution of the section: spanwise momentum / free stream", 2.0126613910813616e-08], ["largest spanwise momentum |rho w| of the 3-D solution (free stream: rho u = 1)", 6.947625132748649e-07], ["largest difference between spanwise nodes, in-plane variables", 7.429859081765859e-07], ["skin friction at x = 0.97008: largest |cf / mean - 1| over the spanwise node lines", 2.4339834592268517e-09], ["3-D state, mean over the span, against the section (in-plane variables)", 1.6714897115763114e-08], ["3-D state against the section, node for node (in-plane variables)", 4.977411673303843e-07], ["side-force coefficient cs", 3.0839407110572535e-19]]}, {"id": "runs", "title": "Problem sizes and solver statistics", "columns": ["case", "dim", "elements", "unknowns", "BR2 penalty", "reference area", "Newton steps", "Krylov iterations", "residual drop", "Krylov iterations of the adjoint solve", "residual reduction of the adjoint solve"], "rows": [["2-D section", 2, 150, 6750, 6.0, 1.0, 32, 248, 7.471554657976537e-10, 57, 6.808996144873149e-11], ["3-D extrusion", 3, 450, 72900, 6.0, 3.0, 32, 249, 5.354624569600992e-10, 70, 8.656151020615463e-11], ["2-D section, default penalty", 2, 150, 6750, 4.0, 1.0, 34, 267, 1.521834306387462e-11, 58, 6.188957006872341e-11]]}, {"id": "lines", "title": "Lines of the meshes", "columns": ["case", "lines", "elements in lines", "elements", "longest line", "colours"], "rows": [["2-D section", 18, 131, 150, 12, 3], ["3-D extrusion", 54, 393, 450, 12, 3], ["2-D section, default penalty", 18, 131, 150, 12, 3]]}], "provenance": {"version": "0.4.0", "commit": "39979fcf902ad6116eb550b881b4278d4599c8e2", "dirty": false, "describe": "39979fcf90", "device": {"platform": "gpu", "device": "cuda:0", "device_kind": "NVIDIA GeForce RTX 3060 Ti", "jax": "0.11.2", "x64": true}, "timestamp": "2026-11-12T11:33:26-0500"}, "wall_time": 675.08, "notes": "The 3-D solution is not exactly uniform along the span: its spanwise momentum reaches 6.9e-07 and the in-plane variables differ by up to 7.4e-07 between spanwise nodes (table 'span'). This is a property of the BR2 scheme, not of the extrusion: the viscous flux inside an element is evaluated with the gradient lifted from all its faces, the flux through a face with the local gradient and the lifting of that face alone. Where the in-plane velocity jumps across in-plane faces, the two differ in the normal stress on the spanwise faces, which leaves a residual in the spanwise momentum equation of every element (table 'span': the extruded solution of the section). It changes sign across the mid-plane of the element, which is why the layers repeat each other and there is no net spanwise force; how little the mean over the span is affected is what the comparison with the section shows. With the default penalty of quadrilaterals (4) the section gives cd = 5.753647e-03 and cf = 2.701031e-03 at the station; the extrusion, whose default is 6, differs from these by 0.26 % and 0.16 %. That is a difference between two discretizations on a mesh of 150 elements, not an error of the 3-D implementation, and it is why the comparison is made at equal penalty. The extruded mesh has 54 lines holding 393 of its 450 elements (the longest 12 elements, 3 colours); 72900 unknowns in blocks of 162. An extrusion has only faces whose two sides use the same local axes, and the flow has no spanwise component to speak of: the study does not exercise the face-orientation tables, the two further components of the vorticity in the model or a flow that varies along the span.", "level": "quick"}