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