1## libCEED: Navier-Stokes Example 2 3This page provides a description of the Navier-Stokes example for the libCEED library, based on PETSc. 4PETSc v3.17 or a development version of PETSc at commit 0e95d842 or later is required. 5 6HONEE, a more fully featured fluid dynamics solver, can be found on [GitLab](https://gitlab.com/phypid/honee). 7 8The Navier-Stokes problem solves the compressible Navier-Stokes equations in three dimensions using an explicit time integration. 9The state variables are mass density, momentum density, and energy density. 10 11The main Navier-Stokes solver for libCEED is defined in [`navierstokes.c`](navierstokes.c) with different problem definitions according to the application of interest. 12 13## Build instructions 14 15Build by using: 16 17`make` 18 19and run with: 20 21``` 22./navierstokes -ceed [ceed] -problem [problem type] -degree [degree] 23``` 24 25## Runtime options 26 27% inclusion-fluids-marker 28 29The Navier-Stokes mini-app is controlled via command-line options. 30The following options are common among all problem types: 31 32:::{list-table} Common Runtime Options 33:header-rows: 1 34 35* - Option 36 - Description 37 - Default value 38 39* - `-ceed` 40 - CEED resource specifier 41 - `/cpu/self/opt/blocked` 42 43* - `-test_type` 44 - Run in test mode and specify whether solution (`solver`) or turbulent statistics (`turb_spanstats`) output should be verified 45 - `none` 46 47* - `-compare_final_state_atol` 48 - Test absolute tolerance 49 - `1E-11` 50 51* - `-compare_final_state_filename` 52 - Test filename 53 - 54 55* - `-problem` 56 - Problem to solve (`advection`, `density_current`, `euler_vortex`, `shocktube`, `blasius`, `channel`, `gaussian_wave`, and `taylor_green`) 57 - `density_current` 58 59* - `-implicit` 60 - Use implicit time integrator formulation 61 - 62 63* - `-degree` 64 - Polynomial degree of tensor product basis (must be >= 1) 65 - `1` 66 67* - `-q_extra` 68 - Number of extra quadrature points 69 - `0` 70 71* - `-ts_monitor_solution` 72 - PETSc output format, such as `cgns:output-%d.cgns` (requires PETSc `--download-cgns`) 73 - 74 75* - `-ts_monitor_solution_interval` 76 - Number of time steps between visualization output frames. 77 - `1` 78 79* - `-viewer_cgns_batch_size` 80 - Number of frames written per CGNS file if the CGNS file name includes a format specifier (`%d`). 81 - `20` 82 83* - `-checkpoint_interval` 84 - Number of steps between writing binary checkpoints. `0` has no output, `-1` outputs final state only 85 - `10` 86 87* - `-checkpoint_vtk` 88 - Checkpoints include VTK (`*.vtu`) files for visualization. Consider `-ts_monitor_solution`instead. 89 - `false` 90 91* - `-viz_refine` 92 - Use regular refinement for VTK visualization 93 - `0` 94 95* - `-output_dir` 96 - Output directory for binary checkpoints and VTK files (if enabled). 97 - `.` 98 99* - `-output_add_stepnum2bin` 100 - Whether to add step numbers to output binary files 101 - `false` 102 103* - `-continue` 104 - Continue from previous solution (input is step number of previous solution) 105 - `0` 106 107* - `-continue_filename` 108 - Path to solution binary file from which to continue from 109 - `[output_dir]/ns-solution.bin` 110 111* - `-continue_time_filename` 112 - Path to time stamp binary file (only for legacy checkpoints) 113 - `[output_dir]/ns-time.bin` 114 115* - `-bc_wall` 116 - Use wall boundary conditions on this list of faces 117 - 118 119* - `-wall_comps` 120 - An array of constrained component numbers for wall BCs 121 - 122 123* - `-bc_slip` 124 - Use weak slip boundary condition on this list of faces 125 - 126 127* - `-bc_symmetry_x` 128 - Use symmetry boundary conditions, for the x component, on this list of faces 129 - 130 131* - `-bc_symmetry_y` 132 - Use symmetry boundary conditions, for the y component, on this list of faces 133 - 134 135* - `-bc_symmetry_z` 136 - Use symmetry boundary conditions, for the z component, on this list of faces 137 - 138 139* - `-bc_inflow` 140 - Use inflow boundary conditions on this list of faces 141 - 142 143* - `-bc_outflow` 144 - Use outflow boundary conditions on this list of faces 145 - 146 147* - `-bc_freestream` 148 - Use freestream boundary conditions on this list of faces 149 - 150 151* - `-ts_monitor_turbulence_spanstats_collect_interval` 152 - Number of timesteps between statistics collection 153 - `1` 154 155* - `-ts_monitor_turbulence_spanstats_viewer` 156 - Sets the PetscViewer for the statistics file writing, such as `cgns:output-%d.cgns` (requires PETSc `--download-cgns`). Also turns the statistics collection on. 157 - 158 159* - `-ts_monitor_turbulence_spanstats_viewer_interval` 160 - Number of timesteps between statistics file writing (`-1` means only at end of run) 161 - `-1` 162 163* - `-ts_monitor_turbulence_spanstats_viewer_cgns_batch_size` 164 - Number of frames written per CGNS file if the CGNS file name includes a format specifier (`%d`). 165 - `20` 166 167* - `-ts_monitor_wall_force` 168 - Viewer for the force on each no-slip wall, e.g., `ascii:force.csv:ascii_csv` to write a CSV file. 169 - 170 171* - `-mesh_transform` 172 - Transform the mesh, usually for an initial box mesh. 173 - `none` 174 175* - `-snes_view` 176 - View PETSc `SNES` nonlinear solver configuration 177 - 178 179* - `-log_view` 180 - View PETSc performance log 181 - 182 183* - `-help` 184 - View comprehensive information about run-time options 185 - 186::: 187 188For the case of a square/cubic mesh, the list of face indices to be used with `-bc_wall`, `bc_inflow`, `bc_outflow`, `bc_freestream` and/or `-bc_symmetry_x`, `-bc_symmetry_y`, and `-bc_symmetry_z` are: 189 190:::{list-table} 2D Face ID Labels 191:header-rows: 1 192* - PETSc Face Name 193 - Cartesian direction 194 - Face ID 195 196* - faceMarkerBottom 197 - -z 198 - 1 199 200* - faceMarkerRight 201 - +x 202 - 2 203 204* - faceMarkerTop 205 - +z 206 - 3 207 208* - faceMarkerLeft 209 - -x 210 - 4 211::: 212 213:::{list-table} 3D Face ID Labels 214:header-rows: 1 215* - PETSc Face Name 216 - Cartesian direction 217 - Face ID 218 219* - faceMarkerBottom 220 - -z 221 - 1 222 223* - faceMarkerTop 224 - +z 225 - 2 226 227* - faceMarkerFront 228 - -y 229 - 3 230 231* - faceMarkerBack 232 - +y 233 - 4 234 235* - faceMarkerRight 236 - +x 237 - 5 238 239* - faceMarkerLeft 240 - -x 241 - 6 242::: 243 244### Boundary conditions 245 246Boundary conditions for compressible viscous flows are notoriously tricky. 247Here we offer some recommendations. 248 249#### Inflow 250 251If in a region where the flow velocity is known (e.g., away from viscous walls), use `bc_freestream`, which solves a Riemann problem and can handle inflow and outflow (simultaneously and dynamically). 252It is stable and the least reflective boundary condition for acoustics. 253 254If near a viscous wall, you may want a specified inflow profile. 255Use `bc_inflow` and see {ref}`example-blasius` and discussion of synthetic turbulence generation for ways to analytically generate developed inflow profiles. 256These conditions may be either weak or strong, with the latter specifying velocity and temperature as essential boundary conditions and evaluating a boundary integral for the mass flux. 257The strong approach gives sharper resolution of velocity structures. 258We have described the primitive variable formulation here; the conservative variants are similar, but not equivalent. 259 260#### Outflow 261 262If you know the complete exterior state, `bc_freestream` is the least reflective boundary condition, but is disruptive to viscous flow structures. 263If thermal anomalies must exit the domain, the Riemann solver must resolve the contact wave to avoid reflections. 264The default Riemann solver, HLLC, is sufficient in this regard while the simpler HLL converts thermal structures exiting the domain into grid-scale reflecting acoustics. 265 266If acoustic reflections are not a concern and/or the flow is impacted by walls or interior structures that you wish to resolve to near the boundary, choose `bc_outflow`. This condition (with default `outflow_type: riemann`) is stable for both inflow and outflow, so can be used in areas that have recirculation and lateral boundaries in which the flow fluctuates. 267 268The simpler `bc_outflow` variant, `outflow_type: pressure`, requires that the flow be a strict outflow (or the problem becomes ill-posed and the solver will diverge). 269In our experience, `riemann` is slightly less reflective but produces similar flows in cases of strict outflow. 270The `pressure` variant is retained to facilitate comparison with other codes, such as PHASTA-C, but we recommend `riemann` for general use. 271 272#### Periodicity 273 274PETSc provides two ways to specify periodicity: 275 2761. Topological periodicity, in which the donor and receiver dofs are the same, obtained using: 277 278```yaml 279dm_plex: 280 shape: box 281 box_faces: 10,12,4 282 box_bd: none,none,periodic 283``` 284 285The coordinates for such cases are stored as a new field with special cell-based indexing to enable wrapping through the boundary. 286This choice of coordinates prevents evaluating boundary integrals that cross the periodicity, such as for the outflow Riemann problem in the presence of spanwise periodicity. 287 2882. Isoperiodicity, in which the donor and receiver dofs are distinct in local vectors. This is obtained using `zbox`, as in: 289 290```yaml 291dm_plex: 292 shape: zbox 293 box_faces: 10,12,4 294 box_bd: none,none,periodic 295``` 296 297Isoperiodicity enables standard boundary integrals, and is recommended for general use. 298At the time of this writing, it only supports one direction of periodicity. 299The `zbox` method uses [Z-ordering](https://en.wikipedia.org/wiki/Z-order_curve) to construct the mesh in parallel and provide an adequate initial partition, which makes it higher performance and avoids needing a partitioning package. 300 301### Advection 302 303For testing purposes, there is a reduced mode for pure advection, which holds density $\rho$ and momentum density $\rho \bm u$ constant while advecting "total energy density" $E$. 304The advection problems can be run in both 2D and 3D, based on the DM defined for the problem. 305The following additional command-line options are available: 306 307:::{list-table} Advection Runtime Options 308:header-rows: 1 309 310* - Option 311 - Description 312 - Default value 313 - Unit 314 315* - `-rc` 316 - Characteristic radius of thermal bubble 317 - `1000` 318 - `m` 319 320* - `-units_meter` 321 - 1 meter in scaled length units 322 - `1E-2` 323 - 324 325* - `-units_second` 326 - 1 second in scaled time units 327 - `1E-2` 328 - 329 330* - `-units_kilogram` 331 - 1 kilogram in scaled mass units 332 - `1E-6` 333 - 334 335* - `-strong_form` 336 - Strong (1) or weak/integrated by parts (0) residual 337 - `0` 338 - 339 340* - `-stab` 341 - Stabilization method (`none`, `su`, or `supg`) 342 - `none` 343 - 344 345* - `-stab_tau` 346 - Formulation for $\tau$ in stabilization (`ctau`, `advdiff_shakib`) 347 - `ctau` 348 - 349 350* - `-Ctau_t` 351 - Scaling factor on the temporal portion of the $\tau$ formulation 352 - 0. 353 - 354 355* - `-Ctau_a` 356 - Scaling factor on the advection portion of the $\tau$ formulation 357 - $P^2$ 358 - 359 360* - `-CtauS` 361 - Scale coefficient for stabilization tau (nondimensional) 362 - `0` 363 - 364 365* - `-wind_type` 366 - Wind type in Advection (`rotation` or `translation`) 367 - `rotation` 368 - 369 370* - `-wind_translation` 371 - Constant wind vector when `-wind_type translation` 372 - `1,0,0` 373 - 374 375* - `-diffusion_coeff` 376 - Diffusion coefficient 377 - `0` 378 - 379 380* - `-E_wind` 381 - Total energy of inflow wind when `-wind_type translation` 382 - `1E6` 383 - `J` 384 385* - `-advection_ic_type` 386 - Initial condition type, from `sphere`, `cylinder`, `cosine_hill`, and `skew` 387 - `sphere` 388 - 389 390* - `-bubble_continuity` 391 - Different shapes for `sphere` and `cylinder` initial conditions, from `smooth`, `back_sharp`, `thick`, or `cosine` 392 - `smooth` 393 - 394::: 395 396For 3D advection, an example of the `rotation` mode can be run with: 397 398``` 399./navierstokes -problem advection -dm_plex_box_faces 10,10,10 -dm_plex_dim 3 -dm_plex_box_lower 0,0,0 -dm_plex_box_upper 8000,8000,8000 -bc_wall 1,2,3,4,5,6 -wall_comps 4 -wind_type rotation -implicit -stab su 400``` 401 402and the `translation` mode with: 403 404``` 405./navierstokes -problem advection -dm_plex_box_faces 10,10,10 -dm_plex_dim 3 -dm_plex_box_lower 0,0,0 -dm_plex_box_upper 8000,8000,8000 -wind_type translation -wind_translation .5,-1,0 -bc_inflow 1,2,3,4,5,6 406``` 407 408For 2D advection, an example of the `rotation` mode can be run with: 409 410``` 411./navierstokes -problem advection -dm_plex_box_faces 20,20 -dm_plex_box_lower 0,0 -dm_plex_box_upper 1000,1000 -bc_wall 1,2,3,4 -wall_comps 4 -wind_type rotation -implicit -stab supg 412``` 413 414and the `translation` mode with: 415 416``` 417./navierstokes -problem advection -dm_plex_box_faces 20,20 -dm_plex_box_lower 0,0 -dm_plex_box_upper 1000,1000 -units_meter 1e-4 -wind_type translation -wind_translation 1,-.5 -bc_inflow 1,2,3,4 418``` 419Note the lengths in `-dm_plex_box_upper` are given in meters, and will be nondimensionalized according to `-units_meter`. 420 421### Inviscid Ideal Gas 422 423#### Isentropic Euler vortex 424 425For the Isentropic Vortex problem, the following additional command-line options are available: 426 427:::{list-table} Isentropic Vortex Runtime Options 428:header-rows: 1 429 430* - Option 431 - Description 432 - Default value 433 - Unit 434 435* - `-center` 436 - Location of vortex center 437 - `(lx,ly,lz)/2` 438 - `(m,m,m)` 439 440* - `-units_meter` 441 - 1 meter in scaled length units 442 - `1E-2` 443 - 444 445* - `-units_second` 446 - 1 second in scaled time units 447 - `1E-2` 448 - 449 450* - `-mean_velocity` 451 - Background velocity vector 452 - `(1,1,0)` 453 - 454 455* - `-vortex_strength` 456 - Strength of vortex < 10 457 - `5` 458 - 459 460* - `-c_tau` 461 - Stabilization constant 462 - `0.5` 463 - 464::: 465 466This problem can be run with: 467 468``` 469./navierstokes -problem euler_vortex -dm_plex_box_faces 20,20,1 -dm_plex_box_lower 0,0,0 -dm_plex_box_upper 1000,1000,50 -dm_plex_dim 3 -bc_inflow 4,6 -bc_outflow 3,5 -bc_symmetry_z 1,2 -mean_velocity .5,-.8,0. 470``` 471 472#### Sod shock tube 473 474For the Shock Tube problem, the following additional command-line options are available: 475 476:::{list-table} Shock Tube Runtime Options 477:header-rows: 1 478 479* - Option 480 - Description 481 - Default value 482 - Unit 483 484* - `-units_meter` 485 - 1 meter in scaled length units 486 - `1E-2` 487 - 488 489* - `-units_second` 490 - 1 second in scaled time units 491 - `1E-2` 492 - 493 494* - `-yzb` 495 - Use YZB discontinuity capturing 496 - `none` 497 - 498 499* - `-stab` 500 - Stabilization method (`none`, `su`, or `supg`) 501 - `none` 502 - 503::: 504 505This problem can be run with: 506 507``` 508./navierstokes -problem shocktube -yzb -stab su -bc_symmetry_z 3,4 -bc_symmetry_y 1,2 -bc_wall 5,6 -dm_plex_dim 3 -dm_plex_box_lower 0,0,0 -dm_plex_box_upper 1000,100,100 -dm_plex_box_faces 200,1,1 -units_second 0.1 509``` 510 511### Newtonian viscosity, Ideal Gas 512 513For the Density Current, Channel, and Blasius problems, the following common command-line options are available: 514 515:::{list-table} Newtonian Ideal Gas problems Runtime Options 516:header-rows: 1 517 518* - Option 519 - Description 520 - Default value 521 - Unit 522 523* - `-units_meter` 524 - 1 meter in scaled length units 525 - `1` 526 - 527 528* - `-units_second` 529 - 1 second in scaled time units 530 - `1` 531 - 532 533* - `-units_kilogram` 534 - 1 kilogram in scaled mass units 535 - `1` 536 - 537 538* - `-units_Kelvin` 539 - 1 Kelvin in scaled temperature units 540 - `1` 541 - 542 543* - `-stab` 544 - Stabilization method (`none`, `su`, or `supg`) 545 - `none` 546 - 547 548* - `-c_tau` 549 - Stabilization constant, $c_\tau$ 550 - `0.5` 551 - 552 553* - `-Ctau_t` 554 - Stabilization time constant, $C_t$ 555 - `1.0` 556 - 557 558* - `-Ctau_v` 559 - Stabilization viscous constant, $C_v$ 560 - `36, 60, 128 for degree = 1, 2, 3` 561 - 562 563* - `-Ctau_C` 564 - Stabilization continuity constant, $C_c$ 565 - `1.0` 566 - 567 568* - `-Ctau_M` 569 - Stabilization momentum constant, $C_m$ 570 - `1.0` 571 - 572 573* - `-Ctau_E` 574 - Stabilization energy constant, $C_E$ 575 - `1.0` 576 - 577 578* - `-cv` 579 - Heat capacity at constant volume 580 - `717` 581 - `J/(kg K)` 582 583* - `-cp` 584 - Heat capacity at constant pressure 585 - `1004` 586 - `J/(kg K)` 587 588* - `-gravity` 589 - Gravitational acceleration vector 590 - `0,0,0` 591 - `m/s^2` 592 593* - `-lambda` 594 - Stokes hypothesis second viscosity coefficient 595 - `-2/3` 596 - 597 598* - `-mu` 599 - Shear dynamic viscosity coefficient 600 - `1.8e-5` 601 - `Pa s` 602 603* - `-k` 604 - Thermal conductivity 605 - `0.02638` 606 - `W/(m K)` 607 608* - `-newtonian_unit_tests` 609 - Developer option to test properties 610 - `false` 611 - boolean 612 613* - `-state_var` 614 - State variables to solve solution with. `conservative` ($\rho, \rho \bm{u}, \rho e$), `primitive` ($P, \bm{u}, T$), or `entropy` ($\frac{\gamma - s}{\gamma - 1} - \frac{\rho}{P} (e - c_v T),\ \frac{\rho}{P} \bm{u},\ -\frac{\rho}{P}$) where $s = \ln(P\rho^{-\gamma})$ 615 - `conservative` 616 - string 617 618* - `-idl_decay_time` 619 - Characteristic timescale of the pressure deviance decay. The timestep is good starting point 620 - `-1` (disabled) 621 - `s` 622 623* - `-idl_start` 624 - Start of IDL in the x direction 625 - `0` 626 - `m` 627 628* - `-idl_length` 629 - Length of IDL in the positive x direction 630 - `0` 631 - `m` 632 633* - `-idl_pressure` 634 - Pressure used for IDL reference pressure 635 - `-reference_pressure` 636 - `Pa` 637 638* - `-diff_filter_monitor` 639 - Enable differential filter TSMonitor 640 - `false` 641 - boolean 642 643* - `-diff_filter_grid_based_width` 644 - Use filter width based on the grid size 645 - `false` 646 - boolean 647 648* - `-diff_filter_width_scaling` 649 - Anisotropic scaling for filter width in wall-aligned coordinates (snz) 650 - `1,1,1` 651 - `m` 652 653* - `-diff_filter_kernel_scaling` 654 - Scaling to make differential kernel size equivalent to other filter kernels 655 - `0.1` 656 - `m^2` 657 658* - `-diff_filter_wall_damping_function` 659 - Damping function to use at the wall for anisotropic filtering (`none`, `van_driest`) 660 - `none` 661 - string 662 663* - `-diff_filter_wall_damping_constant` 664 - Constant for the wall-damping function. $A^+$ for `van_driest` damping function. 665 - 25 666 - 667 668* - `-diff_filter_friction_length` 669 - Friction length associated with the flow, $\delta_\nu$. Used in wall-damping functions 670 - 0 671 - `m` 672::: 673 674#### Gaussian Wave 675 676The Gaussian wave problem has the following command-line options in addition to the Newtonian Ideal Gas options: 677 678:::{list-table} Gaussian Wave Runtime Options 679:header-rows: 1 680 681* - Option 682 - Description 683 - Default value 684 - Unit 685 686* - `-freestream_riemann` 687 - Riemann solver for boundaries (HLL or HLLC) 688 - `hllc` 689 - 690 691* - `-freestream_velocity` 692 - Freestream velocity vector 693 - `0,0,0` 694 - `m/s` 695 696* - `-freestream_temperature` 697 - Freestream temperature 698 - `288` 699 - `K` 700 701* - `-freestream_pressure` 702 - Freestream pressure 703 - `1.01e5` 704 - `Pa` 705 706* - `-epicenter` 707 - Coordinates of center of perturbation 708 - `0,0,0` 709 - `m` 710 711* - `-amplitude` 712 - Amplitude of the perturbation 713 - `0.1` 714 - 715 716* - `-width` 717 - Width parameter of the perturbation 718 - `0.002` 719 - `m` 720 721::: 722 723This problem can be run with the `gaussianwave.yaml` file via: 724 725``` 726./navierstokes -options_file gaussianwave.yaml 727``` 728 729```{literalinclude} ../../../../../examples/fluids/gaussianwave.yaml 730:language: yaml 731``` 732 733#### Vortex Shedding - Flow past Cylinder 734 735The vortex shedding, flow past cylinder problem has the following command-line options in addition to the Newtonian Ideal Gas options: 736 737:::{list-table} Vortex Shedding Runtime Options 738:header-rows: 1 739 740* - Option 741 - Description 742 - Default value 743 - Unit 744 745* - `-freestream_velocity` 746 - Freestream velocity vector 747 - `0,0,0` 748 - `m/s` 749 750* - `-freestream_temperature` 751 - Freestream temperature 752 - `288` 753 - `K` 754 755* - `-freestream_pressure` 756 - Freestream pressure 757 - `1.01e5` 758 - `Pa` 759 760::: 761 762The initial condition is taken from `-reference_temperature` and `-reference_pressure`. 763To run this problem, first generate a mesh: 764 765```console 766$ make -C examples/fluids/meshes 767``` 768 769Then run by building the executable and running: 770 771```console 772$ make build/fluids-navierstokes 773$ mpiexec -n 6 build/fluids-navierstokes -options_file examples/fluids/vortexshedding.yaml -{ts,snes}_monitor_ 774``` 775 776The vortex shedding period is roughly 5.6 and this problem runs until time 100 (2000 time steps). 777The above run writes a file named `force.csv` (see `ts_monitor_wall_force` in `vortexshedding.yaml`), which can be postprocessed by running to create a figure showing lift and drag coefficients over time. 778 779```console 780$ python examples/fluids/postprocess/vortexshedding.py 781``` 782 783```{literalinclude} ../../../../../examples/fluids/vortexshedding.yaml 784:language: yaml 785``` 786 787#### Density current 788 789The Density Current problem has the following command-line options in addition to the Newtonian Ideal Gas options: 790 791:::{list-table} Density Current Runtime Options 792:header-rows: 1 793 794* - Option 795 - Description 796 - Default value 797 - Unit 798 799* - `-center` 800 - Location of bubble center 801 - `(lx,ly,lz)/2` 802 - `(m,m,m)` 803 804* - `-dc_axis` 805 - Axis of density current cylindrical anomaly, or `(0,0,0)` for spherically symmetric 806 - `(0,0,0)` 807 - 808 809* - `-rc` 810 - Characteristic radius of thermal bubble 811 - `1000` 812 - `m` 813 814* - `-theta0` 815 - Reference potential temperature 816 - `300` 817 - `K` 818 819* - `-thetaC` 820 - Perturbation of potential temperature 821 - `-15` 822 - `K` 823 824* - `-P0` 825 - Atmospheric pressure 826 - `1E5` 827 - `Pa` 828 829* - `-N` 830 - Brunt-Vaisala frequency 831 - `0.01` 832 - `1/s` 833::: 834 835This problem can be run with: 836 837``` 838./navierstokes -problem density_current -dm_plex_box_faces 16,1,8 -degree 1 -dm_plex_box_lower 0,0,0 -dm_plex_box_upper 2000,125,1000 -dm_plex_dim 3 -rc 400. -bc_wall 1,2,5,6 -wall_comps 1,2,3 -bc_symmetry_y 3,4 -mu 75 839``` 840 841#### Channel flow 842 843The Channel problem has the following command-line options in addition to the Newtonian Ideal Gas options: 844 845:::{list-table} Channel Runtime Options 846:header-rows: 1 847 848* - Option 849 - Description 850 - Default value 851 - Unit 852 853* - `-umax` 854 - Maximum/centerline velocity of the flow 855 - `10` 856 - `m/s` 857 858* - `-theta0` 859 - Reference potential temperature 860 - `300` 861 - `K` 862 863* - `-P0` 864 - Atmospheric pressure 865 - `1E5` 866 - `Pa` 867 868* - `-body_force_scale` 869 - Multiplier for body force (`-1` for flow reversal) 870 - 1 871 - 872::: 873 874This problem can be run with the `channel.yaml` file via: 875 876``` 877./navierstokes -options_file channel.yaml 878``` 879```{literalinclude} ../../../../../examples/fluids/channel.yaml 880:language: yaml 881``` 882 883(example-blasius)= 884 885#### Blasius boundary layer 886 887The Blasius problem has the following command-line options in addition to the Newtonian Ideal Gas options: 888 889:::{list-table} Blasius Runtime Options 890:header-rows: 1 891 892* - Option 893 - Description 894 - Default value 895 - Unit 896 897* - `-velocity_infinity` 898 - Freestream velocity 899 - `40` 900 - `m/s` 901 902* - `-temperature_infinity` 903 - Freestream temperature 904 - `288` 905 - `K` 906 907* - `-pressure_infinity` 908 - Atmospheric pressure, also sets IDL reference pressure 909 - `1.01E5` 910 - `Pa` 911 912* - `-temperature_wall` 913 - Wall temperature 914 - `288` 915 - `K` 916 917* - `-delta0` 918 - Boundary layer height at the inflow 919 - `4.2e-3` 920 - `m` 921 922* - `-platemesh_modify_mesh` 923 - Whether to modify the mesh using the given options below. 924 - `false` 925 - 926 927* - `-platemesh_refine_height` 928 - Height at which `-platemesh_Ndelta` number of elements should refined into 929 - `5.9E-4` 930 - `m` 931 932* - `-platemesh_Ndelta` 933 - Number of elements to keep below `-platemesh_refine_height` 934 - `45` 935 - 936 937* - `-platemesh_growth` 938 - Growth rate of the elements in the refinement region 939 - `1.08` 940 - 941 942* - `-platemesh_top_angle` 943 - Downward angle of the top face of the domain. This face serves as an outlet. 944 - `5` 945 - `degrees` 946 947* - `-platemesh_y_node_locs_path` 948 - Path to file with y node locations. If empty, will use mesh warping instead. 949 - `""` 950 - 951 952* - `-stg_use` 953 - Whether to use STG for the inflow conditions 954 - `false` 955 - 956 957* - `-n_chebyshev` 958 - Number of Chebyshev terms 959 - `20` 960 - 961 962* - `-chebyshev_` 963 - Prefix for Chebyshev snes solve 964 - 965 - 966 967::: 968 969This problem can be run with the `blasius.yaml` file via: 970 971``` 972./navierstokes -options_file blasius.yaml 973``` 974 975```{literalinclude} ../../../../../examples/fluids/blasius.yaml 976:language: yaml 977``` 978 979#### STG Inflow for Flat Plate 980 981Using the STG Inflow for the blasius problem adds the following command-line options: 982 983:::{list-table} Blasius Runtime Options 984:header-rows: 1 985 986* - Option 987 - Description 988 - Default value 989 - Unit 990 991* - `-stg_inflow_path` 992 - Path to the STGInflow file 993 - `./STGInflow.dat` 994 - 995 996* - `-stg_rand_path` 997 - Path to the STGRand file 998 - `./STGRand.dat` 999 - 1000 1001* - `-stg_alpha` 1002 - Growth rate of the wavemodes 1003 - `1.01` 1004 - 1005 1006* - `-stg_u0` 1007 - Convective velocity, $U_0$ 1008 - `0.0` 1009 - `m/s` 1010 1011* - `-stg_mean_only` 1012 - Only impose the mean velocity (no fluctutations) 1013 - `false` 1014 - 1015 1016* - `-stg_strong` 1017 - Strongly enforce the STG inflow boundary condition 1018 - `false` 1019 - 1020 1021* - `-stg_fluctuating_IC` 1022 - "Extrude" the fluctuations through the domain as an initial condition 1023 - `false` 1024 - 1025 1026* - `-stg_dx` 1027 - Set the element size in the x direction. Default is calculated for box meshes, assuming equispaced elements. 1028 - 1029 - `m` 1030 1031* - `-stg_h_scale_factor` 1032 - Scale element size for cutoff frequency calculation 1033 - $1/p$ 1034 - 1035 1036::: 1037 1038This problem can be run with the `blasius.yaml` file via: 1039 1040``` 1041./navierstokes -options_file blasius.yaml -stg_use true 1042``` 1043 1044Note the added `-stg_use true` flag 1045This overrides the `stg: use: false` setting in the `blasius.yaml` file, enabling the use of the STG inflow. 1046