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