xref: /libCEED/examples/fluids/README.md (revision 8e6aa226c2c84e58dd7feb551fd506c4f25986db) !
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* - `-diff_filter_monitor`
682  - Enable differential filter TSMonitor
683  - `false`
684  - boolean
685
686* - `-diff_filter_grid_based_width`
687  - Use filter width based on the grid size
688  - `false`
689  - boolean
690
691* - `-diff_filter_width_scaling`
692  - Anisotropic scaling for filter width in wall-aligned coordinates (snz)
693  - `1,1,1`
694  - `m`
695
696* - `-diff_filter_kernel_scaling`
697  - Scaling to make differential kernel size equivalent to other filter kernels
698  - `0.1`
699  - `m^2`
700
701* - `-diff_filter_wall_damping_function`
702  - Damping function to use at the wall for anisotropic filtering (`none`, `van_driest`)
703  - `none`
704  - string
705
706* - `-diff_filter_wall_damping_constant`
707  - Constant for the wall-damping function. $A^+$ for `van_driest` damping function.
708  - 25
709  -
710
711* - `-diff_filter_friction_length`
712  - Friction length associated with the flow, $\delta_\nu$. Used in wall-damping functions
713  - 0
714  - `m`
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_slip_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* - `-temperature_wall`
952  - Wall temperature
953  - `288`
954  - `K`
955
956* - `-delta0`
957  - Boundary layer height at the inflow
958  - `4.2e-3`
959  - `m`
960
961* - `-P0`
962  - Atmospheric pressure
963  - `1.01E5`
964  - `Pa`
965
966* - `-platemesh_refine_height`
967  - Height at which `-platemesh_Ndelta` number of elements should refined into
968  - `5.9E-4`
969  - `m`
970
971* - `-platemesh_Ndelta`
972  - Number of elements to keep below `-platemesh_refine_height`
973  - `45`
974  -
975
976* - `-platemesh_growth`
977  - Growth rate of the elements in the refinement region
978  - `1.08`
979  -
980
981* - `-platemesh_top_angle`
982  - Downward angle of the top face of the domain. This face serves as an outlet.
983  - `5`
984  - `degrees`
985
986* - `-stg_use`
987  - Whether to use stg for the inflow conditions
988  - `false`
989  -
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* - `-n_chebyshev`
997  - Number of Chebyshev terms
998  - `20`
999  -
1000
1001* - `-chebyshev_`
1002  - Prefix for Chebyshev snes solve
1003  -
1004  -
1005
1006:::
1007
1008This problem can be run with the `blasius.yaml` file via:
1009
1010```
1011./navierstokes -options_file blasius.yaml
1012```
1013
1014```{literalinclude} ../../../../../examples/fluids/blasius.yaml
1015:language: yaml
1016```
1017
1018#### STG Inflow for Flat Plate
1019
1020Using the STG Inflow for the blasius problem adds the following command-line options:
1021
1022:::{list-table} Blasius Runtime Options
1023:header-rows: 1
1024
1025* - Option
1026  - Description
1027  - Default value
1028  - Unit
1029
1030* - `-stg_inflow_path`
1031  - Path to the STGInflow file
1032  - `./STGInflow.dat`
1033  -
1034
1035* - `-stg_rand_path`
1036  - Path to the STGRand file
1037  - `./STGRand.dat`
1038  -
1039
1040* - `-stg_alpha`
1041  - Growth rate of the wavemodes
1042  - `1.01`
1043  -
1044
1045* - `-stg_u0`
1046  - Convective velocity, $U_0$
1047  - `0.0`
1048  - `m/s`
1049
1050* - `-stg_mean_only`
1051  - Only impose the mean velocity (no fluctutations)
1052  - `false`
1053  -
1054
1055* - `-stg_strong`
1056  - Strongly enforce the STG inflow boundary condition
1057  - `false`
1058  -
1059
1060* - `-stg_fluctuating_IC`
1061  - "Extrude" the fluctuations through the domain as an initial condition
1062  - `false`
1063  -
1064
1065:::
1066
1067This problem can be run with the `blasius.yaml` file via:
1068
1069```
1070./navierstokes -options_file blasius.yaml -stg_use true
1071```
1072
1073Note the added `-stg_use true` flag
1074This overrides the `stg: use: false` setting in the `blasius.yaml` file, enabling the use of the STG inflow.
1075