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 6The Navier-Stokes problem solves the compressible Navier-Stokes equations in three dimensions using an explicit time integration. 7The state variables are mass density, momentum density, and energy density. 8 9The main Navier-Stokes solver for libCEED is defined in [`navierstokes.c`](navierstokes.c) with different problem definitions according to the application of interest. 10 11## Build instructions 12 13Build by using: 14 15`make` 16 17and run with: 18 19``` 20./navierstokes -ceed [ceed] -problem [problem type] -degree [degree] 21``` 22 23If you want to do *in situ* machine-learning training, specify `SMARTREDIS_DIR` in the make command like: 24 25``` 26make SMARTREDIS_DIR=~/software/smartredis/install 27``` 28 29## Runtime options 30 31% inclusion-fluids-marker 32 33The Navier-Stokes mini-app is controlled via command-line options. 34The following options are common among all problem types: 35 36:::{list-table} Common Runtime Options 37:header-rows: 1 38 39* - Option 40 - Description 41 - Default value 42 43* - `-ceed` 44 - CEED resource specifier 45 - `/cpu/self/opt/blocked` 46 47* - `-test_type` 48 - Run in test mode and specify whether solution (`solver`) or turbulent statistics (`turb_spanstats`) output should be verified 49 - `none` 50 51* - `-compare_final_state_atol` 52 - Test absolute tolerance 53 - `1E-11` 54 55* - `-compare_final_state_filename` 56 - Test filename 57 - 58 59* - `-problem` 60 - Problem to solve (`advection`, `advection2d`, `density_current`, `euler_vortex`, `shocktube`, `blasius`, `channel`, `gaussian_wave`, and `taylor_green`) 61 - `density_current` 62 63* - `-implicit` 64 - Use implicit time integrator formulation 65 - 66 67* - `-degree` 68 - Polynomial degree of tensor product basis (must be >= 1) 69 - `1` 70 71* - `-q_extra` 72 - Number of extra quadrature points 73 - `0` 74 75* - `-ts_monitor_solution` 76 - PETSc output format, such as `cgns:output-%d.cgns` (requires PETSc `--download-cgns`) 77 - 78 79* - `-ts_monitor_solution_interval` 80 - Number of time steps between visualization output frames. 81 - `1` 82 83* - `-viewer_cgns_batch_size` 84 - Number of frames written per CGNS file if the CGNS file name includes a format specifier (`%d`). 85 - `20` 86 87* - `-checkpoint_interval` 88 - Number of steps between writing binary checkpoints. `0` has no output, `-1` outputs final state only 89 - `10` 90 91* - `-checkpoint_vtk` 92 - Checkpoints include VTK (`*.vtu`) files for visualization. Consider `-ts_monitor_solution`instead. 93 - `false` 94 95* - `-viz_refine` 96 - Use regular refinement for VTK visualization 97 - `0` 98 99* - `-output_dir` 100 - Output directory for binary checkpoints and VTK files (if enabled). 101 - `.` 102 103* - `-output_add_stepnum2bin` 104 - Whether to add step numbers to output binary files 105 - `false` 106 107* - `-continue` 108 - Continue from previous solution (input is step number of previous solution) 109 - `0` 110 111* - `-continue_filename` 112 - Path to solution binary file from which to continue from 113 - `[output_dir]/ns-solution.bin` 114 115* - `-continue_time_filename` 116 - Path to time stamp binary file (only for legacy checkpoints) 117 - `[output_dir]/ns-time.bin` 118 119* - `-bc_wall` 120 - Use wall boundary conditions on this list of faces 121 - 122 123* - `-wall_comps` 124 - An array of constrained component numbers for wall BCs 125 - 126 127* - `-bc_slip_x` 128 - Use slip boundary conditions, for the x component, on this list of faces 129 - 130 131* - `-bc_slip_y` 132 - Use slip boundary conditions, for the y component, on this list of faces 133 - 134 135* - `-bc_slip_z` 136 - Use slip 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_slip_x`, `-bc_slip_y`, and `-bc_slip_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$. 304These are available in 2D and 3D. 305 306#### 2D advection 307 308For the 2D advection problem, the following additional command-line options are available: 309 310:::{list-table} Advection2D Runtime Options 311:header-rows: 1 312 313* - Option 314 - Description 315 - Default value 316 - Unit 317 318* - `-rc` 319 - Characteristic radius of thermal bubble 320 - `1000` 321 - `m` 322 323* - `-units_meter` 324 - 1 meter in scaled length units 325 - `1E-2` 326 - 327 328* - `-units_second` 329 - 1 second in scaled time units 330 - `1E-2` 331 - 332 333* - `-units_kilogram` 334 - 1 kilogram in scaled mass units 335 - `1E-6` 336 - 337 338* - `-strong_form` 339 - Strong (1) or weak/integrated by parts (0) residual 340 - `0` 341 - 342 343* - `-stab` 344 - Stabilization method (`none`, `su`, or `supg`) 345 - `none` 346 - 347 348* - `-CtauS` 349 - Scale coefficient for stabilization tau (nondimensional) 350 - `0` 351 - 352 353* - `-wind_type` 354 - Wind type in Advection (`rotation` or `translation`) 355 - `rotation` 356 - 357 358* - `-wind_translation` 359 - Constant wind vector when `-wind_type translation` 360 - `1,0,0` 361 - 362 363* - `-E_wind` 364 - Total energy of inflow wind when `-wind_type translation` 365 - `1E6` 366 - `J` 367::: 368 369An example of the `rotation` mode can be run with: 370 371``` 372./navierstokes -problem advection2d -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 373``` 374 375and the `translation` mode with: 376 377``` 378./navierstokes -problem advection2d -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 379``` 380Note the lengths in `-dm_plex_box_upper` are given in meters, and will be nondimensionalized according to `-units_meter`. 381 382#### 3D advection 383 384For the 3D advection problem, the following additional command-line options are available: 385 386:::{list-table} Advection3D Runtime Options 387:header-rows: 1 388 389* - Option 390 - Description 391 - Default value 392 - Unit 393 394* - `-rc` 395 - Characteristic radius of thermal bubble 396 - `1000` 397 - `m` 398 399* - `-units_meter` 400 - 1 meter in scaled length units 401 - `1E-2` 402 - 403 404* - `-units_second` 405 - 1 second in scaled time units 406 - `1E-2` 407 - 408 409* - `-units_kilogram` 410 - 1 kilogram in scaled mass units 411 - `1E-6` 412 - 413 414* - `-strong_form` 415 - Strong (1) or weak/integrated by parts (0) residual 416 - `0` 417 - 418 419* - `-stab` 420 - Stabilization method (`none`, `su`, or `supg`) 421 - `none` 422 - 423 424* - `-CtauS` 425 - Scale coefficient for stabilization tau (nondimensional) 426 - `0` 427 - 428 429* - `-wind_type` 430 - Wind type in Advection (`rotation` or `translation`) 431 - `rotation` 432 - 433 434* - `-wind_translation` 435 - Constant wind vector when `-wind_type translation` 436 - `1,0,0` 437 - 438 439* - `-E_wind` 440 - Total energy of inflow wind when `-wind_type translation` 441 - `1E6` 442 - `J` 443 444* - `-advection_ic_type` 445 - Initial condition type, from `sphere`, `cylinder`, `cosine_hill`, and `skew` 446 - `sphere` 447 - 448 449* - `-bubble_continuity` 450 - `smooth`, `back_sharp`, or `thick` 451 - `smooth` 452 - 453::: 454 455An example of the `rotation` mode can be run with: 456 457``` 458./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 459``` 460 461and the `translation` mode with: 462 463``` 464./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 465``` 466 467### Inviscid Ideal Gas 468 469#### Isentropic Euler vortex 470 471For the Isentropic Vortex problem, the following additional command-line options are available: 472 473:::{list-table} Isentropic Vortex Runtime Options 474:header-rows: 1 475 476* - Option 477 - Description 478 - Default value 479 - Unit 480 481* - `-center` 482 - Location of vortex center 483 - `(lx,ly,lz)/2` 484 - `(m,m,m)` 485 486* - `-units_meter` 487 - 1 meter in scaled length units 488 - `1E-2` 489 - 490 491* - `-units_second` 492 - 1 second in scaled time units 493 - `1E-2` 494 - 495 496* - `-mean_velocity` 497 - Background velocity vector 498 - `(1,1,0)` 499 - 500 501* - `-vortex_strength` 502 - Strength of vortex < 10 503 - `5` 504 - 505 506* - `-c_tau` 507 - Stabilization constant 508 - `0.5` 509 - 510::: 511 512This problem can be run with: 513 514``` 515./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_slip_z 1,2 -mean_velocity .5,-.8,0. 516``` 517 518#### Sod shock tube 519 520For the Shock Tube problem, the following additional command-line options are available: 521 522:::{list-table} Shock Tube Runtime Options 523:header-rows: 1 524 525* - Option 526 - Description 527 - Default value 528 - Unit 529 530* - `-units_meter` 531 - 1 meter in scaled length units 532 - `1E-2` 533 - 534 535* - `-units_second` 536 - 1 second in scaled time units 537 - `1E-2` 538 - 539 540* - `-yzb` 541 - Use YZB discontinuity capturing 542 - `none` 543 - 544 545* - `-stab` 546 - Stabilization method (`none`, `su`, or `supg`) 547 - `none` 548 - 549::: 550 551This problem can be run with: 552 553``` 554./navierstokes -problem shocktube -yzb -stab su -bc_slip_z 3,4 -bc_slip_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 555``` 556 557### Newtonian viscosity, Ideal Gas 558 559For the Density Current, Channel, and Blasius problems, the following common command-line options are available: 560 561:::{list-table} Newtonian Ideal Gas problems Runtime Options 562:header-rows: 1 563 564* - Option 565 - Description 566 - Default value 567 - Unit 568 569* - `-units_meter` 570 - 1 meter in scaled length units 571 - `1` 572 - 573 574* - `-units_second` 575 - 1 second in scaled time units 576 - `1` 577 - 578 579* - `-units_kilogram` 580 - 1 kilogram in scaled mass units 581 - `1` 582 - 583 584* - `-units_Kelvin` 585 - 1 Kelvin in scaled temperature units 586 - `1` 587 - 588 589* - `-stab` 590 - Stabilization method (`none`, `su`, or `supg`) 591 - `none` 592 - 593 594* - `-c_tau` 595 - Stabilization constant, $c_\tau$ 596 - `0.5` 597 - 598 599* - `-Ctau_t` 600 - Stabilization time constant, $C_t$ 601 - `1.0` 602 - 603 604* - `-Ctau_v` 605 - Stabilization viscous constant, $C_v$ 606 - `36, 60, 128 for degree = 1, 2, 3` 607 - 608 609* - `-Ctau_C` 610 - Stabilization continuity constant, $C_c$ 611 - `1.0` 612 - 613 614* - `-Ctau_M` 615 - Stabilization momentum constant, $C_m$ 616 - `1.0` 617 - 618 619* - `-Ctau_E` 620 - Stabilization energy constant, $C_E$ 621 - `1.0` 622 - 623 624* - `-cv` 625 - Heat capacity at constant volume 626 - `717` 627 - `J/(kg K)` 628 629* - `-cp` 630 - Heat capacity at constant pressure 631 - `1004` 632 - `J/(kg K)` 633 634* - `-gravity` 635 - Gravitational acceleration vector 636 - `0,0,0` 637 - `m/s^2` 638 639* - `-lambda` 640 - Stokes hypothesis second viscosity coefficient 641 - `-2/3` 642 - 643 644* - `-mu` 645 - Shear dynamic viscosity coefficient 646 - `1.8e-5` 647 - `Pa s` 648 649* - `-k` 650 - Thermal conductivity 651 - `0.02638` 652 - `W/(m K)` 653 654* - `-newtonian_unit_tests` 655 - Developer option to test properties 656 - `false` 657 - boolean 658 659* - `-state_var` 660 - State variables to solve solution with. `conservative` ($\rho, \rho \bm{u}, \rho e$) or `primitive` ($P, \bm{u}, T$) 661 - `conservative` 662 - string 663 664* - `-idl_decay_time` 665 - Characteristic timescale of the pressure deviance decay. The timestep is good starting point 666 - `-1` (disabled) 667 - `s` 668 669* - `-idl_start` 670 - Start of IDL in the x direction 671 - `0` 672 - `m` 673 674* - `-idl_length` 675 - Length of IDL in the positive x direction 676 - `0` 677 - `m` 678 679* - `-sgs_model_type` 680 - Type of subgrid stress model to use. Currently only `data_driven` is available 681 - `none` 682 - string 683 684* - `-sgs_model_dd_leakyrelu_alpha` 685 - Slope parameter for Leaky ReLU activation function. `0` corresponds to normal ReLU 686 - 0 687 - 688 689* - `-sgs_model_dd_parameter_dir` 690 - Path to directory with data-driven model parameters (weights, biases, etc.) 691 - `./dd_sgs_parameters` 692 - string 693 694* - `-diff_filter_monitor` 695 - Enable differential filter TSMonitor 696 - `false` 697 - boolean 698 699* - `-diff_filter_grid_based_width` 700 - Use filter width based on the grid size 701 - `false` 702 - boolean 703 704* - `-diff_filter_width_scaling` 705 - Anisotropic scaling for filter width in wall-aligned coordinates (snz) 706 - `1,1,1` 707 - `m` 708 709* - `-diff_filter_kernel_scaling` 710 - Scaling to make differential kernel size equivalent to other filter kernels 711 - `0.1` 712 - `m^2` 713 714* - `-diff_filter_wall_damping_function` 715 - Damping function to use at the wall for anisotropic filtering (`none`, `van_driest`) 716 - `none` 717 - string 718 719* - `-diff_filter_wall_damping_constant` 720 - Constant for the wall-damping function. $A^+$ for `van_driest` damping function. 721 - 25 722 - 723 724* - `-diff_filter_friction_length` 725 - Friction length associated with the flow, $\delta_\nu$. Used in wall-damping functions 726 - 0 727 - `m` 728 729* - `-sgs_train_enable` 730 - Whether to enable *in situ* training of data-driven SGS model. Require building with SmartRedis. 731 - `false` 732 - boolean 733 734* - `-sgs_train_write_data_interval` 735 - Number of timesteps between writing training data into SmartRedis database 736 - `1` 737 - 738 739* - `-sgs_train_overwrite_data` 740 - Whether new training data should overwrite old data on database 741 - `true` 742 - boolean 743 744* - `-smartsim_collocated_num_ranks` 745 - Number of MPI ranks associated with each collocated database (i.e. ranks per node) 746 - `1` 747 - 748::: 749 750#### Gaussian Wave 751 752The Gaussian wave problem has the following command-line options in addition to the Newtonian Ideal Gas options: 753 754:::{list-table} Gaussian Wave Runtime Options 755:header-rows: 1 756 757* - Option 758 - Description 759 - Default value 760 - Unit 761 762* - `-freestream_riemann` 763 - Riemann solver for boundaries (HLL or HLLC) 764 - `hllc` 765 - 766 767* - `-freestream_velocity` 768 - Freestream velocity vector 769 - `0,0,0` 770 - `m/s` 771 772* - `-freestream_temperature` 773 - Freestream temperature 774 - `288` 775 - `K` 776 777* - `-freestream_pressure` 778 - Freestream pressure 779 - `1.01e5` 780 - `Pa` 781 782* - `-epicenter` 783 - Coordinates of center of perturbation 784 - `0,0,0` 785 - `m` 786 787* - `-amplitude` 788 - Amplitude of the perturbation 789 - `0.1` 790 - 791 792* - `-width` 793 - Width parameter of the perturbation 794 - `0.002` 795 - `m` 796 797::: 798 799This problem can be run with the `gaussianwave.yaml` file via: 800 801``` 802./navierstokes -options_file gaussianwave.yaml 803``` 804 805```{literalinclude} ../../../../../examples/fluids/gaussianwave.yaml 806:language: yaml 807``` 808 809#### Vortex Shedding - Flow past Cylinder 810 811The vortex shedding, flow past cylinder problem has the following command-line options in addition to the Newtonian Ideal Gas options: 812 813:::{list-table} Vortex Shedding Runtime Options 814:header-rows: 1 815 816* - Option 817 - Description 818 - Default value 819 - Unit 820 821* - `-freestream_velocity` 822 - Freestream velocity vector 823 - `0,0,0` 824 - `m/s` 825 826* - `-freestream_temperature` 827 - Freestream temperature 828 - `288` 829 - `K` 830 831* - `-freestream_pressure` 832 - Freestream pressure 833 - `1.01e5` 834 - `Pa` 835 836::: 837 838The initial condition is taken from `-reference_temperature` and `-reference_pressure`. 839To run this problem, first generate a mesh: 840 841```console 842$ make -C examples/fluids/meshes 843``` 844 845Then run by building the executable and running: 846 847```console 848$ make build/fluids-navierstokes 849$ mpiexec -n 6 build/fluids-navierstokes -options_file examples/fluids/vortexshedding.yaml -{ts,snes}_monitor_ 850``` 851 852The vortex shedding period is roughly 5.6 and this problem runs until time 100 (2000 time steps). 853The 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. 854 855```console 856$ python examples/fluids/postprocess/vortexshedding.py 857``` 858 859```{literalinclude} ../../../../../examples/fluids/vortexshedding.yaml 860:language: yaml 861``` 862 863#### Density current 864 865The Density Current problem has the following command-line options in addition to the Newtonian Ideal Gas options: 866 867:::{list-table} Density Current Runtime Options 868:header-rows: 1 869 870* - Option 871 - Description 872 - Default value 873 - Unit 874 875* - `-center` 876 - Location of bubble center 877 - `(lx,ly,lz)/2` 878 - `(m,m,m)` 879 880* - `-dc_axis` 881 - Axis of density current cylindrical anomaly, or `(0,0,0)` for spherically symmetric 882 - `(0,0,0)` 883 - 884 885* - `-rc` 886 - Characteristic radius of thermal bubble 887 - `1000` 888 - `m` 889 890* - `-theta0` 891 - Reference potential temperature 892 - `300` 893 - `K` 894 895* - `-thetaC` 896 - Perturbation of potential temperature 897 - `-15` 898 - `K` 899 900* - `-P0` 901 - Atmospheric pressure 902 - `1E5` 903 - `Pa` 904 905* - `-N` 906 - Brunt-Vaisala frequency 907 - `0.01` 908 - `1/s` 909::: 910 911This problem can be run with: 912 913``` 914./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_slip_y 3,4 -mu 75 915``` 916 917#### Channel flow 918 919The Channel problem has the following command-line options in addition to the Newtonian Ideal Gas options: 920 921:::{list-table} Channel Runtime Options 922:header-rows: 1 923 924* - Option 925 - Description 926 - Default value 927 - Unit 928 929* - `-umax` 930 - Maximum/centerline velocity of the flow 931 - `10` 932 - `m/s` 933 934* - `-theta0` 935 - Reference potential temperature 936 - `300` 937 - `K` 938 939* - `-P0` 940 - Atmospheric pressure 941 - `1E5` 942 - `Pa` 943 944* - `-body_force_scale` 945 - Multiplier for body force (`-1` for flow reversal) 946 - 1 947 - 948::: 949 950This problem can be run with the `channel.yaml` file via: 951 952``` 953./navierstokes -options_file channel.yaml 954``` 955```{literalinclude} ../../../../../examples/fluids/channel.yaml 956:language: yaml 957``` 958 959(example-blasius)= 960 961#### Blasius boundary layer 962 963The Blasius problem has the following command-line options in addition to the Newtonian Ideal Gas options: 964 965:::{list-table} Blasius Runtime Options 966:header-rows: 1 967 968* - Option 969 - Description 970 - Default value 971 - Unit 972 973* - `-velocity_infinity` 974 - Freestream velocity 975 - `40` 976 - `m/s` 977 978* - `-temperature_infinity` 979 - Freestream temperature 980 - `288` 981 - `K` 982 983* - `-temperature_wall` 984 - Wall temperature 985 - `288` 986 - `K` 987 988* - `-delta0` 989 - Boundary layer height at the inflow 990 - `4.2e-3` 991 - `m` 992 993* - `-P0` 994 - Atmospheric pressure 995 - `1.01E5` 996 - `Pa` 997 998* - `-platemesh_modify_mesh` 999 - Whether to modify the mesh using the given options below. 1000 - `false` 1001 - 1002 1003* - `-platemesh_refine_height` 1004 - Height at which `-platemesh_Ndelta` number of elements should refined into 1005 - `5.9E-4` 1006 - `m` 1007 1008* - `-platemesh_Ndelta` 1009 - Number of elements to keep below `-platemesh_refine_height` 1010 - `45` 1011 - 1012 1013* - `-platemesh_growth` 1014 - Growth rate of the elements in the refinement region 1015 - `1.08` 1016 - 1017 1018* - `-platemesh_top_angle` 1019 - Downward angle of the top face of the domain. This face serves as an outlet. 1020 - `5` 1021 - `degrees` 1022 1023* - `-platemesh_y_node_locs_path` 1024 - Path to file with y node locations. If empty, will use mesh warping instead. 1025 - `""` 1026 - 1027 1028* - `-stg_use` 1029 - Whether to use STG for the inflow conditions 1030 - `false` 1031 - 1032 1033* - `-n_chebyshev` 1034 - Number of Chebyshev terms 1035 - `20` 1036 - 1037 1038* - `-chebyshev_` 1039 - Prefix for Chebyshev snes solve 1040 - 1041 - 1042 1043::: 1044 1045This problem can be run with the `blasius.yaml` file via: 1046 1047``` 1048./navierstokes -options_file blasius.yaml 1049``` 1050 1051```{literalinclude} ../../../../../examples/fluids/blasius.yaml 1052:language: yaml 1053``` 1054 1055#### STG Inflow for Flat Plate 1056 1057Using the STG Inflow for the blasius problem adds the following command-line options: 1058 1059:::{list-table} Blasius Runtime Options 1060:header-rows: 1 1061 1062* - Option 1063 - Description 1064 - Default value 1065 - Unit 1066 1067* - `-stg_inflow_path` 1068 - Path to the STGInflow file 1069 - `./STGInflow.dat` 1070 - 1071 1072* - `-stg_rand_path` 1073 - Path to the STGRand file 1074 - `./STGRand.dat` 1075 - 1076 1077* - `-stg_alpha` 1078 - Growth rate of the wavemodes 1079 - `1.01` 1080 - 1081 1082* - `-stg_u0` 1083 - Convective velocity, $U_0$ 1084 - `0.0` 1085 - `m/s` 1086 1087* - `-stg_mean_only` 1088 - Only impose the mean velocity (no fluctutations) 1089 - `false` 1090 - 1091 1092* - `-stg_strong` 1093 - Strongly enforce the STG inflow boundary condition 1094 - `false` 1095 - 1096 1097* - `-stg_fluctuating_IC` 1098 - "Extrude" the fluctuations through the domain as an initial condition 1099 - `false` 1100 - 1101 1102::: 1103 1104This problem can be run with the `blasius.yaml` file via: 1105 1106``` 1107./navierstokes -options_file blasius.yaml -stg_use true 1108``` 1109 1110Note the added `-stg_use true` flag 1111This overrides the `stg: use: false` setting in the `blasius.yaml` file, enabling the use of the STG inflow. 1112