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