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