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`, `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$. 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* - `-CtauS` 346 - Scale coefficient for stabilization tau (nondimensional) 347 - `0` 348 - 349 350* - `-wind_type` 351 - Wind type in Advection (`rotation` or `translation`) 352 - `rotation` 353 - 354 355* - `-wind_translation` 356 - Constant wind vector when `-wind_type translation` 357 - `1,0,0` 358 - 359 360* - `-E_wind` 361 - Total energy of inflow wind when `-wind_type translation` 362 - `1E6` 363 - `J` 364 365* - `-advection_ic_type` 366 - Initial condition type, from `sphere`, `cylinder`, `cosine_hill`, and `skew` 367 - `sphere` 368 - 369 370* - `-bubble_continuity` 371 - Different shapes for `sphere` and `cylinder` initial conditions, from `smooth`, `back_sharp`, `thick`, or `cosine` 372 - `smooth` 373 - 374::: 375 376For 3D advection, an example of the `rotation` mode can be run with: 377 378``` 379./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 380``` 381 382and the `translation` mode with: 383 384``` 385./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 386``` 387 388For 2D advection, an example of the `rotation` mode can be run with: 389 390``` 391./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 392``` 393 394and the `translation` mode with: 395 396``` 397./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 398``` 399Note the lengths in `-dm_plex_box_upper` are given in meters, and will be nondimensionalized according to `-units_meter`. 400 401### Inviscid Ideal Gas 402 403#### Isentropic Euler vortex 404 405For the Isentropic Vortex problem, the following additional command-line options are available: 406 407:::{list-table} Isentropic Vortex Runtime Options 408:header-rows: 1 409 410* - Option 411 - Description 412 - Default value 413 - Unit 414 415* - `-center` 416 - Location of vortex center 417 - `(lx,ly,lz)/2` 418 - `(m,m,m)` 419 420* - `-units_meter` 421 - 1 meter in scaled length units 422 - `1E-2` 423 - 424 425* - `-units_second` 426 - 1 second in scaled time units 427 - `1E-2` 428 - 429 430* - `-mean_velocity` 431 - Background velocity vector 432 - `(1,1,0)` 433 - 434 435* - `-vortex_strength` 436 - Strength of vortex < 10 437 - `5` 438 - 439 440* - `-c_tau` 441 - Stabilization constant 442 - `0.5` 443 - 444::: 445 446This problem can be run with: 447 448``` 449./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. 450``` 451 452#### Sod shock tube 453 454For the Shock Tube problem, the following additional command-line options are available: 455 456:::{list-table} Shock Tube Runtime Options 457:header-rows: 1 458 459* - Option 460 - Description 461 - Default value 462 - Unit 463 464* - `-units_meter` 465 - 1 meter in scaled length units 466 - `1E-2` 467 - 468 469* - `-units_second` 470 - 1 second in scaled time units 471 - `1E-2` 472 - 473 474* - `-yzb` 475 - Use YZB discontinuity capturing 476 - `none` 477 - 478 479* - `-stab` 480 - Stabilization method (`none`, `su`, or `supg`) 481 - `none` 482 - 483::: 484 485This problem can be run with: 486 487``` 488./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 489``` 490 491### Newtonian viscosity, Ideal Gas 492 493For the Density Current, Channel, and Blasius problems, the following common command-line options are available: 494 495:::{list-table} Newtonian Ideal Gas problems Runtime Options 496:header-rows: 1 497 498* - Option 499 - Description 500 - Default value 501 - Unit 502 503* - `-units_meter` 504 - 1 meter in scaled length units 505 - `1` 506 - 507 508* - `-units_second` 509 - 1 second in scaled time units 510 - `1` 511 - 512 513* - `-units_kilogram` 514 - 1 kilogram in scaled mass units 515 - `1` 516 - 517 518* - `-units_Kelvin` 519 - 1 Kelvin in scaled temperature units 520 - `1` 521 - 522 523* - `-stab` 524 - Stabilization method (`none`, `su`, or `supg`) 525 - `none` 526 - 527 528* - `-c_tau` 529 - Stabilization constant, $c_\tau$ 530 - `0.5` 531 - 532 533* - `-Ctau_t` 534 - Stabilization time constant, $C_t$ 535 - `1.0` 536 - 537 538* - `-Ctau_v` 539 - Stabilization viscous constant, $C_v$ 540 - `36, 60, 128 for degree = 1, 2, 3` 541 - 542 543* - `-Ctau_C` 544 - Stabilization continuity constant, $C_c$ 545 - `1.0` 546 - 547 548* - `-Ctau_M` 549 - Stabilization momentum constant, $C_m$ 550 - `1.0` 551 - 552 553* - `-Ctau_E` 554 - Stabilization energy constant, $C_E$ 555 - `1.0` 556 - 557 558* - `-cv` 559 - Heat capacity at constant volume 560 - `717` 561 - `J/(kg K)` 562 563* - `-cp` 564 - Heat capacity at constant pressure 565 - `1004` 566 - `J/(kg K)` 567 568* - `-gravity` 569 - Gravitational acceleration vector 570 - `0,0,0` 571 - `m/s^2` 572 573* - `-lambda` 574 - Stokes hypothesis second viscosity coefficient 575 - `-2/3` 576 - 577 578* - `-mu` 579 - Shear dynamic viscosity coefficient 580 - `1.8e-5` 581 - `Pa s` 582 583* - `-k` 584 - Thermal conductivity 585 - `0.02638` 586 - `W/(m K)` 587 588* - `-newtonian_unit_tests` 589 - Developer option to test properties 590 - `false` 591 - boolean 592 593* - `-state_var` 594 - State variables to solve solution with. `conservative` ($\rho, \rho \bm{u}, \rho e$) or `primitive` ($P, \bm{u}, T$) 595 - `conservative` 596 - string 597 598* - `-idl_decay_time` 599 - Characteristic timescale of the pressure deviance decay. The timestep is good starting point 600 - `-1` (disabled) 601 - `s` 602 603* - `-idl_start` 604 - Start of IDL in the x direction 605 - `0` 606 - `m` 607 608* - `-idl_length` 609 - Length of IDL in the positive x direction 610 - `0` 611 - `m` 612 613* - `-sgs_model_type` 614 - Type of subgrid stress model to use. Currently only `data_driven` is available 615 - `none` 616 - string 617 618* - `-sgs_model_dd_leakyrelu_alpha` 619 - Slope parameter for Leaky ReLU activation function. `0` corresponds to normal ReLU 620 - 0 621 - 622 623* - `-sgs_model_dd_parameter_dir` 624 - Path to directory with data-driven model parameters (weights, biases, etc.) 625 - `./dd_sgs_parameters` 626 - string 627 628* - `-diff_filter_monitor` 629 - Enable differential filter TSMonitor 630 - `false` 631 - boolean 632 633* - `-diff_filter_grid_based_width` 634 - Use filter width based on the grid size 635 - `false` 636 - boolean 637 638* - `-diff_filter_width_scaling` 639 - Anisotropic scaling for filter width in wall-aligned coordinates (snz) 640 - `1,1,1` 641 - `m` 642 643* - `-diff_filter_kernel_scaling` 644 - Scaling to make differential kernel size equivalent to other filter kernels 645 - `0.1` 646 - `m^2` 647 648* - `-diff_filter_wall_damping_function` 649 - Damping function to use at the wall for anisotropic filtering (`none`, `van_driest`) 650 - `none` 651 - string 652 653* - `-diff_filter_wall_damping_constant` 654 - Constant for the wall-damping function. $A^+$ for `van_driest` damping function. 655 - 25 656 - 657 658* - `-diff_filter_friction_length` 659 - Friction length associated with the flow, $\delta_\nu$. Used in wall-damping functions 660 - 0 661 - `m` 662 663* - `-sgs_train_enable` 664 - Whether to enable *in situ* training of data-driven SGS model. Require building with SmartRedis. 665 - `false` 666 - boolean 667 668* - `-sgs_train_write_data_interval` 669 - Number of timesteps between writing training data into SmartRedis database 670 - `1` 671 - 672 673* - `-sgs_train_overwrite_data` 674 - Whether new training data should overwrite old data on database 675 - `true` 676 - boolean 677 678* - `-smartsim_collocated_num_ranks` 679 - Number of MPI ranks associated with each collocated database (i.e. ranks per node) 680 - `1` 681 - 682::: 683 684#### Gaussian Wave 685 686The Gaussian wave problem has the following command-line options in addition to the Newtonian Ideal Gas options: 687 688:::{list-table} Gaussian Wave Runtime Options 689:header-rows: 1 690 691* - Option 692 - Description 693 - Default value 694 - Unit 695 696* - `-freestream_riemann` 697 - Riemann solver for boundaries (HLL or HLLC) 698 - `hllc` 699 - 700 701* - `-freestream_velocity` 702 - Freestream velocity vector 703 - `0,0,0` 704 - `m/s` 705 706* - `-freestream_temperature` 707 - Freestream temperature 708 - `288` 709 - `K` 710 711* - `-freestream_pressure` 712 - Freestream pressure 713 - `1.01e5` 714 - `Pa` 715 716* - `-epicenter` 717 - Coordinates of center of perturbation 718 - `0,0,0` 719 - `m` 720 721* - `-amplitude` 722 - Amplitude of the perturbation 723 - `0.1` 724 - 725 726* - `-width` 727 - Width parameter of the perturbation 728 - `0.002` 729 - `m` 730 731::: 732 733This problem can be run with the `gaussianwave.yaml` file via: 734 735``` 736./navierstokes -options_file gaussianwave.yaml 737``` 738 739```{literalinclude} ../../../../../examples/fluids/gaussianwave.yaml 740:language: yaml 741``` 742 743#### Vortex Shedding - Flow past Cylinder 744 745The vortex shedding, flow past cylinder problem has the following command-line options in addition to the Newtonian Ideal Gas options: 746 747:::{list-table} Vortex Shedding Runtime Options 748:header-rows: 1 749 750* - Option 751 - Description 752 - Default value 753 - Unit 754 755* - `-freestream_velocity` 756 - Freestream velocity vector 757 - `0,0,0` 758 - `m/s` 759 760* - `-freestream_temperature` 761 - Freestream temperature 762 - `288` 763 - `K` 764 765* - `-freestream_pressure` 766 - Freestream pressure 767 - `1.01e5` 768 - `Pa` 769 770::: 771 772The initial condition is taken from `-reference_temperature` and `-reference_pressure`. 773To run this problem, first generate a mesh: 774 775```console 776$ make -C examples/fluids/meshes 777``` 778 779Then run by building the executable and running: 780 781```console 782$ make build/fluids-navierstokes 783$ mpiexec -n 6 build/fluids-navierstokes -options_file examples/fluids/vortexshedding.yaml -{ts,snes}_monitor_ 784``` 785 786The vortex shedding period is roughly 5.6 and this problem runs until time 100 (2000 time steps). 787The 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. 788 789```console 790$ python examples/fluids/postprocess/vortexshedding.py 791``` 792 793```{literalinclude} ../../../../../examples/fluids/vortexshedding.yaml 794:language: yaml 795``` 796 797#### Density current 798 799The Density Current problem has the following command-line options in addition to the Newtonian Ideal Gas options: 800 801:::{list-table} Density Current Runtime Options 802:header-rows: 1 803 804* - Option 805 - Description 806 - Default value 807 - Unit 808 809* - `-center` 810 - Location of bubble center 811 - `(lx,ly,lz)/2` 812 - `(m,m,m)` 813 814* - `-dc_axis` 815 - Axis of density current cylindrical anomaly, or `(0,0,0)` for spherically symmetric 816 - `(0,0,0)` 817 - 818 819* - `-rc` 820 - Characteristic radius of thermal bubble 821 - `1000` 822 - `m` 823 824* - `-theta0` 825 - Reference potential temperature 826 - `300` 827 - `K` 828 829* - `-thetaC` 830 - Perturbation of potential temperature 831 - `-15` 832 - `K` 833 834* - `-P0` 835 - Atmospheric pressure 836 - `1E5` 837 - `Pa` 838 839* - `-N` 840 - Brunt-Vaisala frequency 841 - `0.01` 842 - `1/s` 843::: 844 845This problem can be run with: 846 847``` 848./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 849``` 850 851#### Channel flow 852 853The Channel problem has the following command-line options in addition to the Newtonian Ideal Gas options: 854 855:::{list-table} Channel Runtime Options 856:header-rows: 1 857 858* - Option 859 - Description 860 - Default value 861 - Unit 862 863* - `-umax` 864 - Maximum/centerline velocity of the flow 865 - `10` 866 - `m/s` 867 868* - `-theta0` 869 - Reference potential temperature 870 - `300` 871 - `K` 872 873* - `-P0` 874 - Atmospheric pressure 875 - `1E5` 876 - `Pa` 877 878* - `-body_force_scale` 879 - Multiplier for body force (`-1` for flow reversal) 880 - 1 881 - 882::: 883 884This problem can be run with the `channel.yaml` file via: 885 886``` 887./navierstokes -options_file channel.yaml 888``` 889```{literalinclude} ../../../../../examples/fluids/channel.yaml 890:language: yaml 891``` 892 893(example-blasius)= 894 895#### Blasius boundary layer 896 897The Blasius problem has the following command-line options in addition to the Newtonian Ideal Gas options: 898 899:::{list-table} Blasius Runtime Options 900:header-rows: 1 901 902* - Option 903 - Description 904 - Default value 905 - Unit 906 907* - `-velocity_infinity` 908 - Freestream velocity 909 - `40` 910 - `m/s` 911 912* - `-temperature_infinity` 913 - Freestream temperature 914 - `288` 915 - `K` 916 917* - `-temperature_wall` 918 - Wall temperature 919 - `288` 920 - `K` 921 922* - `-delta0` 923 - Boundary layer height at the inflow 924 - `4.2e-3` 925 - `m` 926 927* - `-P0` 928 - Atmospheric pressure 929 - `1.01E5` 930 - `Pa` 931 932* - `-platemesh_modify_mesh` 933 - Whether to modify the mesh using the given options below. 934 - `false` 935 - 936 937* - `-platemesh_refine_height` 938 - Height at which `-platemesh_Ndelta` number of elements should refined into 939 - `5.9E-4` 940 - `m` 941 942* - `-platemesh_Ndelta` 943 - Number of elements to keep below `-platemesh_refine_height` 944 - `45` 945 - 946 947* - `-platemesh_growth` 948 - Growth rate of the elements in the refinement region 949 - `1.08` 950 - 951 952* - `-platemesh_top_angle` 953 - Downward angle of the top face of the domain. This face serves as an outlet. 954 - `5` 955 - `degrees` 956 957* - `-platemesh_y_node_locs_path` 958 - Path to file with y node locations. If empty, will use mesh warping instead. 959 - `""` 960 - 961 962* - `-stg_use` 963 - Whether to use STG for the inflow conditions 964 - `false` 965 - 966 967* - `-n_chebyshev` 968 - Number of Chebyshev terms 969 - `20` 970 - 971 972* - `-chebyshev_` 973 - Prefix for Chebyshev snes solve 974 - 975 - 976 977::: 978 979This problem can be run with the `blasius.yaml` file via: 980 981``` 982./navierstokes -options_file blasius.yaml 983``` 984 985```{literalinclude} ../../../../../examples/fluids/blasius.yaml 986:language: yaml 987``` 988 989#### STG Inflow for Flat Plate 990 991Using the STG Inflow for the blasius problem adds the following command-line options: 992 993:::{list-table} Blasius Runtime Options 994:header-rows: 1 995 996* - Option 997 - Description 998 - Default value 999 - Unit 1000 1001* - `-stg_inflow_path` 1002 - Path to the STGInflow file 1003 - `./STGInflow.dat` 1004 - 1005 1006* - `-stg_rand_path` 1007 - Path to the STGRand file 1008 - `./STGRand.dat` 1009 - 1010 1011* - `-stg_alpha` 1012 - Growth rate of the wavemodes 1013 - `1.01` 1014 - 1015 1016* - `-stg_u0` 1017 - Convective velocity, $U_0$ 1018 - `0.0` 1019 - `m/s` 1020 1021* - `-stg_mean_only` 1022 - Only impose the mean velocity (no fluctutations) 1023 - `false` 1024 - 1025 1026* - `-stg_strong` 1027 - Strongly enforce the STG inflow boundary condition 1028 - `false` 1029 - 1030 1031* - `-stg_fluctuating_IC` 1032 - "Extrude" the fluctuations through the domain as an initial condition 1033 - `false` 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