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