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