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