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