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