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