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