xref: /libCEED/examples/fluids/README.md (revision ff9b3c0e2ebd8a09dedd1c00be3d2c5b29de65cc)
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* - `-sgs_model_type`
638  - Type of subgrid stress model to use. Currently only `data_driven` is available
639  - `none`
640  - string
641
642* - `-sgs_model_dd_leakyrelu_alpha`
643  - Slope parameter for Leaky ReLU activation function. `0` corresponds to normal ReLU
644  - 0
645  -
646
647* - `-sgs_model_dd_parameter_dir`
648  - Path to directory with data-driven model parameters (weights, biases, etc.)
649  - `./dd_sgs_parameters`
650  - string
651
652* - `-sgs_model_dd_use_fused`
653  - Whether to use "fused" mode for data-driven model evaluation
654  - `true`
655  - boolean
656
657* - `-diff_filter_monitor`
658  - Enable differential filter TSMonitor
659  - `false`
660  - boolean
661
662* - `-diff_filter_grid_based_width`
663  - Use filter width based on the grid size
664  - `false`
665  - boolean
666
667* - `-diff_filter_width_scaling`
668  - Anisotropic scaling for filter width in wall-aligned coordinates (snz)
669  - `1,1,1`
670  - `m`
671
672* - `-diff_filter_kernel_scaling`
673  - Scaling to make differential kernel size equivalent to other filter kernels
674  - `0.1`
675  - `m^2`
676
677* - `-diff_filter_wall_damping_function`
678  - Damping function to use at the wall for anisotropic filtering (`none`, `van_driest`)
679  - `none`
680  - string
681
682* - `-diff_filter_wall_damping_constant`
683  - Constant for the wall-damping function. $A^+$ for `van_driest` damping function.
684  - 25
685  -
686
687* - `-diff_filter_friction_length`
688  - Friction length associated with the flow, $\delta_\nu$. Used in wall-damping functions
689  - 0
690  - `m`
691
692* - `-sgs_train_enable`
693  - Whether to enable *in situ* training of data-driven SGS model. Require building with SmartRedis.
694  - `false`
695  - boolean
696
697* - `-sgs_train_write_data_interval`
698  - Number of timesteps between writing training data into SmartRedis database
699  - `1`
700  -
701
702* - `-sgs_train_overwrite_data`
703  - Whether new training data should overwrite old data on database
704  - `true`
705  - boolean
706
707* - `-sgs_train_filter_widths`
708  - List of scalar values for different filter widths to calculate for training data
709  -
710  - `m`
711
712* - `-smartsim_collocated_num_ranks`
713  - Number of MPI ranks associated with each collocated database (i.e. ranks per node)
714  - `1`
715  -
716:::
717
718#### Gaussian Wave
719
720The Gaussian wave problem has the following command-line options in addition to the Newtonian Ideal Gas options:
721
722:::{list-table} Gaussian Wave Runtime Options
723:header-rows: 1
724
725* - Option
726  - Description
727  - Default value
728  - Unit
729
730* - `-freestream_riemann`
731  - Riemann solver for boundaries (HLL or HLLC)
732  - `hllc`
733  -
734
735* - `-freestream_velocity`
736  - Freestream velocity vector
737  - `0,0,0`
738  - `m/s`
739
740* - `-freestream_temperature`
741  - Freestream temperature
742  - `288`
743  - `K`
744
745* - `-freestream_pressure`
746  - Freestream pressure
747  - `1.01e5`
748  - `Pa`
749
750* - `-epicenter`
751  - Coordinates of center of perturbation
752  - `0,0,0`
753  - `m`
754
755* - `-amplitude`
756  - Amplitude of the perturbation
757  - `0.1`
758  -
759
760* - `-width`
761  - Width parameter of the perturbation
762  - `0.002`
763  - `m`
764
765:::
766
767This problem can be run with the `gaussianwave.yaml` file via:
768
769```
770./navierstokes -options_file gaussianwave.yaml
771```
772
773```{literalinclude} ../../../../../examples/fluids/gaussianwave.yaml
774:language: yaml
775```
776
777#### Vortex Shedding - Flow past Cylinder
778
779The vortex shedding, flow past cylinder problem has the following command-line options in addition to the Newtonian Ideal Gas options:
780
781:::{list-table} Vortex Shedding Runtime Options
782:header-rows: 1
783
784* - Option
785  - Description
786  - Default value
787  - Unit
788
789* - `-freestream_velocity`
790  - Freestream velocity vector
791  - `0,0,0`
792  - `m/s`
793
794* - `-freestream_temperature`
795  - Freestream temperature
796  - `288`
797  - `K`
798
799* - `-freestream_pressure`
800  - Freestream pressure
801  - `1.01e5`
802  - `Pa`
803
804:::
805
806The initial condition is taken from `-reference_temperature` and `-reference_pressure`.
807To run this problem, first generate a mesh:
808
809```console
810$ make -C examples/fluids/meshes
811```
812
813Then run by building the executable and running:
814
815```console
816$ make build/fluids-navierstokes
817$ mpiexec -n 6 build/fluids-navierstokes -options_file examples/fluids/vortexshedding.yaml -{ts,snes}_monitor_
818```
819
820The vortex shedding period is roughly 5.6 and this problem runs until time 100 (2000 time steps).
821The 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.
822
823```console
824$ python examples/fluids/postprocess/vortexshedding.py
825```
826
827```{literalinclude} ../../../../../examples/fluids/vortexshedding.yaml
828:language: yaml
829```
830
831#### Density current
832
833The Density Current problem has the following command-line options in addition to the Newtonian Ideal Gas options:
834
835:::{list-table} Density Current Runtime Options
836:header-rows: 1
837
838* - Option
839  - Description
840  - Default value
841  - Unit
842
843* - `-center`
844  - Location of bubble center
845  - `(lx,ly,lz)/2`
846  - `(m,m,m)`
847
848* - `-dc_axis`
849  - Axis of density current cylindrical anomaly, or `(0,0,0)` for spherically symmetric
850  - `(0,0,0)`
851  -
852
853* - `-rc`
854  - Characteristic radius of thermal bubble
855  - `1000`
856  - `m`
857
858* - `-theta0`
859  - Reference potential temperature
860  - `300`
861  - `K`
862
863* - `-thetaC`
864  - Perturbation of potential temperature
865  - `-15`
866  - `K`
867
868* - `-P0`
869  - Atmospheric pressure
870  - `1E5`
871  - `Pa`
872
873* - `-N`
874  - Brunt-Vaisala frequency
875  - `0.01`
876  - `1/s`
877:::
878
879This problem can be run with:
880
881```
882./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
883```
884
885#### Channel flow
886
887The Channel problem has the following command-line options in addition to the Newtonian Ideal Gas options:
888
889:::{list-table} Channel Runtime Options
890:header-rows: 1
891
892* - Option
893  - Description
894  - Default value
895  - Unit
896
897* - `-umax`
898  - Maximum/centerline velocity of the flow
899  - `10`
900  - `m/s`
901
902* - `-theta0`
903  - Reference potential temperature
904  - `300`
905  - `K`
906
907* - `-P0`
908  - Atmospheric pressure
909  - `1E5`
910  - `Pa`
911
912* - `-body_force_scale`
913  - Multiplier for body force (`-1` for flow reversal)
914  - 1
915  -
916:::
917
918This problem can be run with the `channel.yaml` file via:
919
920```
921./navierstokes -options_file channel.yaml
922```
923```{literalinclude} ../../../../../examples/fluids/channel.yaml
924:language: yaml
925```
926
927(example-blasius)=
928
929#### Blasius boundary layer
930
931The Blasius problem has the following command-line options in addition to the Newtonian Ideal Gas options:
932
933:::{list-table} Blasius Runtime Options
934:header-rows: 1
935
936* - Option
937  - Description
938  - Default value
939  - Unit
940
941* - `-velocity_infinity`
942  - Freestream velocity
943  - `40`
944  - `m/s`
945
946* - `-temperature_infinity`
947  - Freestream temperature
948  - `288`
949  - `K`
950
951* - `-pressure_infinity`
952  - Atmospheric pressure, also sets IDL reference pressure
953  - `1.01E5`
954  - `Pa`
955
956* - `-temperature_wall`
957  - Wall temperature
958  - `288`
959  - `K`
960
961* - `-delta0`
962  - Boundary layer height at the inflow
963  - `4.2e-3`
964  - `m`
965
966* - `-platemesh_modify_mesh`
967  - Whether to modify the mesh using the given options below.
968  - `false`
969  -
970
971* - `-platemesh_refine_height`
972  - Height at which `-platemesh_Ndelta` number of elements should refined into
973  - `5.9E-4`
974  - `m`
975
976* - `-platemesh_Ndelta`
977  - Number of elements to keep below `-platemesh_refine_height`
978  - `45`
979  -
980
981* - `-platemesh_growth`
982  - Growth rate of the elements in the refinement region
983  - `1.08`
984  -
985
986* - `-platemesh_top_angle`
987  - Downward angle of the top face of the domain. This face serves as an outlet.
988  - `5`
989  - `degrees`
990
991* - `-platemesh_y_node_locs_path`
992  - Path to file with y node locations. If empty, will use mesh warping instead.
993  - `""`
994  -
995
996* - `-stg_use`
997  - Whether to use STG for the inflow conditions
998  - `false`
999  -
1000
1001* - `-n_chebyshev`
1002  - Number of Chebyshev terms
1003  - `20`
1004  -
1005
1006* - `-chebyshev_`
1007  - Prefix for Chebyshev snes solve
1008  -
1009  -
1010
1011:::
1012
1013This problem can be run with the `blasius.yaml` file via:
1014
1015```
1016./navierstokes -options_file blasius.yaml
1017```
1018
1019```{literalinclude} ../../../../../examples/fluids/blasius.yaml
1020:language: yaml
1021```
1022
1023#### STG Inflow for Flat Plate
1024
1025Using the STG Inflow for the blasius problem adds the following command-line options:
1026
1027:::{list-table} Blasius Runtime Options
1028:header-rows: 1
1029
1030* - Option
1031  - Description
1032  - Default value
1033  - Unit
1034
1035* - `-stg_inflow_path`
1036  - Path to the STGInflow file
1037  - `./STGInflow.dat`
1038  -
1039
1040* - `-stg_rand_path`
1041  - Path to the STGRand file
1042  - `./STGRand.dat`
1043  -
1044
1045* - `-stg_alpha`
1046  - Growth rate of the wavemodes
1047  - `1.01`
1048  -
1049
1050* - `-stg_u0`
1051  - Convective velocity, $U_0$
1052  - `0.0`
1053  - `m/s`
1054
1055* - `-stg_mean_only`
1056  - Only impose the mean velocity (no fluctutations)
1057  - `false`
1058  -
1059
1060* - `-stg_strong`
1061  - Strongly enforce the STG inflow boundary condition
1062  - `false`
1063  -
1064
1065* - `-stg_fluctuating_IC`
1066  - "Extrude" the fluctuations through the domain as an initial condition
1067  - `false`
1068  -
1069
1070:::
1071
1072This problem can be run with the `blasius.yaml` file via:
1073
1074```
1075./navierstokes -options_file blasius.yaml -stg_use true
1076```
1077
1078Note the added `-stg_use true` flag
1079This overrides the `stg: use: false` setting in the `blasius.yaml` file, enabling the use of the STG inflow.
1080