Gyredocs
Depth Practice
API

Gyre/Examples

Sphere in three dimensions

In one minuteFlow past a sphere on an unstructured mesh of curved hexahedra, inviscid and at Reynolds number 100. The same commands, outputs and derivatives as in two dimensions, with three force and three moment coefficients and a sideslip angle.

Written at L1 Essentials goes to L3 Mechanics 793 words Markdown

Nothing in the workflow changes with the third dimension: a preset, a run, outputs, gradients. What changes is the size of the problem and the list of outputs.

bash
gyre run sphere_euler                 # inviscid, 216 curved hexahedra, p = 2
gyre run sphere_re100 -o runs/sphere  # laminar, Re = 100, 576 hexahedra, p = 2
PassedLaminar flow past a sphere, Re = 100 (3-D)5 of 5 checks passed · 187.8 s · quick suite

Steady three-dimensional Navier–Stokes solve: sphere of diameter 1, Re = 100 on the diameter, M = 0.2, adiabatic no-slip wall, far field at 10 diameters; cubed-sphere mesh of 576 curved hexahedra (geometry degree 3) with mixed block orientations, BR2 viscous fluxes, Newton–Krylov with p-multigrid. At this Reynolds number the flow is steady and axisymmetric with a closed recirculation bubble. References: drag coefficient 1.09 (standard drag curve of Clift, Grace & Weber 1978; Johnson & Patel, JFM 378, 1999, compute 1.08–1.10) and a bubble length of about 0.87 diameters (Johnson & Patel 1999; Taneda 1956). Both references are for incompressible flow in an unbounded domain; at M = 0.2 with the boundary at 10 diameters a difference of the order of one per cent is expected, which the tolerance on the drag covers. Drag is referred to the frontal area π/4.

  • all solves converged to a steady stateyesexpected truepass
  • drag coefficient, highest order: |cd − 1.09| / 1.090.01409expected < 0.03pass
  • wake is axisymmetric: lift, side force and moments (largest |coefficient|)1.77e-15expected < 1e-7pass
  • a closed recirculation bubble exists; length in diameters, highest order0.9501expected within 15 % of 0.87pass
  • adiabatic wall: integrated heat flux0expected < 1e-10pass

Run notes The mesh has the symmetry of the cube, so the vanishing lift and side force show that the solver preserves a symmetric solution; they do not test the stability of the axisymmetric wake (which is stable below Re of about 210). The bubble length is read from the solution nodes on the wake axis by linear interpolation between the two nodes where the velocity changes sign.

gyre 0.4.0 · 39979fcf90 · · gpu · NVIDIA GeForce RTX 3060 Ti · quick suite · record (JSON)Same code as this build

Sphere at Re = 100Laminar flow past a sphere, Re = 100 (3-D)
pelementsDOFNewton stepsresidual reductioncdbubble length / Dfirst cell height / Dlargest |cl, cs, cm|solve time (s)
257677760141.3330e-111.105360.9501290.1856841.7681e-15162.798

gyre 0.4.0 · 39979fcf90 · · gpu · NVIDIA GeForce RTX 3060 Ti · quick suite · record (JSON)Same code as this build

Streamwise velocity on the wake axisLaminar flow past a sphere, Re = 100 (3-D)
Data table
x (diameters, sphere centre at 0)p = 2
0.50.0146961
0.592842-0.0445917
0.685684-0.107759
0.862085-0.138962
1.03848-0.114034
1.37364-0.025023
1.708810.0846301
2.345610.264487
2.982410.396439

gyre 0.4.0 · 39979fcf90 · · gpu · NVIDIA GeForce RTX 3060 Ti · quick suite · record (JSON)Same code as this build

  • The drag coefficient, referred to the frontal area πD2/4\pi D^2/4, against the accepted value of about 1.09 at this Reynolds number.
  • The streamwise velocity on the wake axis is negative behind the sphere and changes sign where the recirculation bubble closes, a little under one diameter downstream.
  • Lift, side force and all three moments vanish to round-off: the flow is axisymmetric and the discretization keeps the symmetry of the mesh.

sphere_shell builds a cubed sphere: six blocks of n × n × n_r curved hexahedra between the body and a spherical far-field boundary, three blocks meeting at each of the eight corners of the cube. The body can be an ellipsoid (axes), and the radial spacing grows geometrically from the wall (ratio):

bash
gyre run sphere_re100 --set mesh.params.n=6 --set mesh.params.n_r=8      # finer
gyre run sphere_euler --set 'mesh.params.axes=[1.0, 0.7, 1.2]' \
     --set flow.alpha_deg=4 --set flow.beta_deg=3                         # ellipsoid at incidence and sideslip

The second command gives a case in which none of the six coefficients vanishes; it is the configuration of the 3-D adjoint study.

Output Meaning
cd, cl, cs drag, lift and side force coefficients in wind axes
cmx, cmy, cmz moment coefficients about reference.moment_center
heat, entropy_error, … as in two dimensions

flow.beta_deg is the sideslip angle; as a differentiable input of the discipline it is beta (radians). The definitions are under Outputs and functionals.

bash
gyre run sphere_euler --set 'mesh.params.axes=[1.0, 0.7, 1.2]' --set flow.alpha_deg=4 \
     --set flow.beta_deg=3 --gradients --of cl,cs,cmz --wrt alpha,beta,mach
Surface pressure coefficientInviscid flow past a sphere (3-D)
Data table
seriespolar angle from the front stagnation point (degrees)cp
216 elements, p = 120.75360.160173
216 elements, p = 120.75360.160173
216 elements, p = 120.75360.512597
216 elements, p = 120.75360.451849
216 elements, p = 120.75360.160173
216 elements, p = 120.75360.160173
216 elements, p = 145.993-0.108021
216 elements, p = 145.9930.366706
216 elements, p = 145.9930.177826
216 elements, p = 145.993-0.0490417
216 elements, p = 145.9930.307355
216 elements, p = 145.993-0.0490417
216 elements, p = 145.993-0.126705
216 elements, p = 145.993-0.0490417
216 elements, p = 145.993-0.108021
216 elements, p = 145.993-0.130971
216 elements, p = 154.73560.176901
216 elements, p = 154.7356-0.0258992
216 elements, p = 154.7356-0.0258992
216 elements, p = 154.73560.176901
216 elements, p = 175.4892-0.33682
216 elements, p = 175.4892-0.377742
216 elements, p = 175.4892-0.240606
216 elements, p = 175.4892-0.24047
216 elements, p = 175.4892-0.240606
216 elements, p = 175.4892-0.377742
216 elements, p = 175.4892-0.333883
216 elements, p = 175.4892-0.436903
216 elements, p = 175.4892-0.419095
216 elements, p = 175.4892-0.436903
216 elements, p = 175.4892-0.24047
216 elements, p = 179.2714-0.452329
216 elements, p = 179.2714-0.412708
216 elements, p = 179.2714-0.412708
216 elements, p = 179.2714-0.224486
216 elements, p = 179.2714-0.324408
216 elements, p = 1100.729-0.409164
216 elements, p = 1100.729-0.416741
216 elements, p = 1100.729-0.399977
216 elements, p = 1100.729-0.331837
216 elements, p = 1100.729-0.399977
216 elements, p = 1100.729-0.331837
216 elements, p = 1104.511-0.439554
216 elements, p = 1104.511-0.439554
216 elements, p = 1104.511-0.292011
216 elements, p = 1104.511-0.439554
216 elements, p = 1104.511-0.432061
216 elements, p = 1104.511-0.439554
216 elements, p = 1104.511-0.373116
216 elements, p = 1104.511-0.373116
216 elements, p = 1104.511-0.349712
216 elements, p = 1104.511-0.309794
216 elements, p = 1125.264-0.263292
216 elements, p = 1125.264-0.263292
216 elements, p = 1125.264-0.205508
216 elements, p = 1125.264-0.205508
216 elements, p = 1134.007-0.191101
216 elements, p = 1134.007-0.185956
216 elements, p = 1134.0070.0423674
216 elements, p = 1134.0070.119944
216 elements, p = 1134.0070.0423674
216 elements, p = 1134.007-0.185956
216 elements, p = 1134.0070.0423674
216 elements, p = 1134.007-0.0838601
216 elements, p = 1134.007-0.144087
216 elements, p = 1134.007-0.0838601
216 elements, p = 1134.007-0.0838601
216 elements, p = 1159.2460.163967
216 elements, p = 1159.2460.163967
216 elements, p = 1159.2460.187782
216 elements, p = 1159.2460.187782
216 elements, p = 1159.2460.198649
216 elements, p = 200.820326
216 elements, p = 2150.609407
216 elements, p = 2150.609407
216 elements, p = 220.75360.563879
216 elements, p = 220.75360.563879
216 elements, p = 220.75360.631756
216 elements, p = 220.75360.614907
216 elements, p = 220.75360.631756
216 elements, p = 220.75360.584709
216 elements, p = 2300.353581
216 elements, p = 232.47670.420371
216 elements, p = 232.47670.214507
216 elements, p = 232.47670.393891
216 elements, p = 232.47670.214507
216 elements, p = 232.47670.420371
216 elements, p = 239.23150.0808225
216 elements, p = 239.23150.0808225
216 elements, p = 245-0.00724636
216 elements, p = 245-0.269144
216 elements, p = 245.993-0.0817129
216 elements, p = 245.993-0.189428
216 elements, p = 245.993-0.103884
216 elements, p = 245.993-0.058147
216 elements, p = 245.993-0.063614
216 elements, p = 245.993-0.128417
216 elements, p = 245.993-0.063614
216 elements, p = 245.993-0.058147
216 elements, p = 245.993-0.125177
216 elements, p = 245.993-0.103884
216 elements, p = 245.993-0.218752
216 elements, p = 249.1066-0.244009
216 elements, p = 249.1066-0.29067
216 elements, p = 249.1066-0.29067
216 elements, p = 249.1066-0.29067
216 elements, p = 249.1066-0.244009
216 elements, p = 254.7356-0.374845
216 elements, p = 254.7356-0.374845
216 elements, p = 254.7356-0.437705
216 elements, p = 254.7356-0.437705
216 elements, p = 260-0.607262
216 elements, p = 260-0.628451
216 elements, p = 260.8526-0.529438
216 elements, p = 260.8526-0.529438
216 elements, p = 260.8526-0.696705
216 elements, p = 260.8526-0.696705
216 elements, p = 260.8526-0.628424
216 elements, p = 263.4349-0.680998
216 elements, p = 263.4349-0.680998
216 elements, p = 263.4349-0.680998
216 elements, p = 267.7923-0.791392
216 elements, p = 267.7923-0.791392
216 elements, p = 275-0.958512
216 elements, p = 275-0.846831
216 elements, p = 275-0.958512
216 elements, p = 275.4892-0.979732
216 elements, p = 275.4892-0.992878
216 elements, p = 275.4892-0.991058
216 elements, p = 275.4892-0.979732
216 elements, p = 275.4892-1.00543
216 elements, p = 275.4892-0.992878
216 elements, p = 275.4892-0.854683
216 elements, p = 275.4892-0.952146
216 elements, p = 275.4892-0.952146
216 elements, p = 275.4892-1.00543
216 elements, p = 275.4892-0.854683
216 elements, p = 276.9357-0.965279
216 elements, p = 276.9357-0.986213
216 elements, p = 276.9357-0.986213
216 elements, p = 276.9357-0.965279
216 elements, p = 276.9357-0.991234
216 elements, p = 279.2714-1.00873
216 elements, p = 279.2714-1.00308
216 elements, p = 279.2714-1.01714
216 elements, p = 279.2714-1.01714
216 elements, p = 279.2714-1.00873
216 elements, p = 290-1.03661
216 elements, p = 290-1.07586
216 elements, p = 290-1.03661
216 elements, p = 290-1.12637
216 elements, p = 290-1.05828
216 elements, p = 290-1.12637
216 elements, p = 290-1.03738
216 elements, p = 290-1.06982
216 elements, p = 290-1.03661
216 elements, p = 290-1.12637
216 elements, p = 290-1.05828
216 elements, p = 290-1.03738
216 elements, p = 2100.729-1.04958
216 elements, p = 2100.729-1.01026
216 elements, p = 2100.729-1.04958
216 elements, p = 2100.729-0.998486
216 elements, p = 2100.729-0.990356
216 elements, p = 2100.729-0.990356
216 elements, p = 2103.064-1.01573
216 elements, p = 2103.064-0.957973
216 elements, p = 2103.064-0.970614
216 elements, p = 2103.064-0.957973
216 elements, p = 2103.064-1.01573
216 elements, p = 2104.511-0.948757
216 elements, p = 2104.511-0.991527
216 elements, p = 2104.511-0.991527
216 elements, p = 2104.511-0.948757
216 elements, p = 2104.511-0.991527
216 elements, p = 2104.511-1.06135
216 elements, p = 2104.511-0.990936
216 elements, p = 2104.511-0.990936
216 elements, p = 2104.511-0.94629
216 elements, p = 2104.511-0.990936
216 elements, p = 2104.511-0.95083
216 elements, p = 2105-0.860174
216 elements, p = 2105-0.91046
216 elements, p = 2112.208-0.666276
216 elements, p = 2112.208-0.744746
216 elements, p = 2112.208-0.744746
216 elements, p = 2116.565-0.629712
216 elements, p = 2116.565-0.609181
216 elements, p = 2116.565-0.629712
216 elements, p = 2119.147-0.470296
216 elements, p = 2119.147-0.565484
216 elements, p = 2119.147-0.565484
216 elements, p = 2119.147-0.621522
216 elements, p = 2119.147-0.565484
216 elements, p = 2120-0.505544
216 elements, p = 2125.264-0.334741
216 elements, p = 2125.264-0.292487
216 elements, p = 2125.264-0.428347
216 elements, p = 2125.264-0.428347
216 elements, p = 2130.893-0.202003

First 200 of 1154 rows; the study JSON holds all of them.

gyre 0.4.0 · 39979fcf90 · · gpu · NVIDIA GeForce RTX 3060 Ti · quick suite · record (JSON)Same code as this build

The chart shows the surface pressure of the inviscid preset at polynomial degrees one to four against the compressible potential-flow solution. The exact flow has no drag and no entropy rise, so both are error measures; the verification page tabulates them.

Element blocks in three dimensions are large: 5(p+1)35(p+1)^3 unknowns per element, 135 at p=2p = 2 and 625 at p=4p = 4, and the preconditioner stores their inverses. The largest solve recorded on the development machine, with its memory and wall times, is under Largest solve on one device. The service sends cases above 60 000 unknowns to the GPU when one is present.

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