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