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