Skip to content

Commit d1118af

Browse files
authored
Options refactoring and docs update (#36)
1 parent 855c444 commit d1118af

File tree

19 files changed

+593
-724
lines changed

19 files changed

+593
-724
lines changed

doc/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@
2121
numpydoc_show_class_members = False
2222

2323
# mock import for autodoc
24-
autodoc_mock_imports = ["numpy", "mpi4py"]
24+
autodoc_mock_imports = ["numpy", "mpi4py", "baseclasses"]

doc/cgns.rst renamed to doc/icem.rst

Lines changed: 14 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,21 @@
1-
.. _pyhyp_cgns:
1+
.. _pyhyp_icem:
22

33
.. pyHyp boundary conditions example.
44
Written by: Ney Secco (February 2016)
55
Edited by:
66
7-
Usage with CGNS Files
8-
=====================
7+
Specifying BCs using ICEM
8+
=========================
99

10-
If the initial surface is given in a CGNS file, we can specify boundary conditions
11-
at each open edge of the geometry. The boundary conditions currently supported are:
10+
This section will show how we can use ICEM to specify boundary conditions at each open edge of a CGNS surface geometry.
11+
The boundary conditions currently supported are:
1212

1313
* Constant X, Y, or Z planes;
1414
* Symmetry X, Y, or Z planes;
1515
* Splay (free edge).
1616

17-
This section will show how we can use ICEM to specify boundary conditions in a CGNS file.
18-
19-
.. NOTE::
20-
It is still not possible to specify boundary conditions when plot3d files are
21-
used as inputs. In this case, the surface should be entirely closed or it should
22-
end at a symmetry plane with the 'mirror' option enabled.
23-
2417
Flat square example
25-
-----------------------------------
18+
-------------------
2619

2720
.. NOTE::
2821
If you have a surface geometry, this step is not required, and you
@@ -135,7 +128,7 @@ is the one used as an example of boundary conditions setup.
135128
See if everything looks right in your Pre-mesh.
136129

137130
Preparing to export the mesh
138-
-----------------------------------
131+
----------------------------
139132

140133
Just to recap, we have done the following procedures:
141134

@@ -301,15 +294,14 @@ Running pyHyp with the generated mesh
301294
-------------------------------------
302295

303296
Create another empty folder and copy the CGNS file exported by ICEM to it. We can add the following Python script to
304-
the same folder (This script is also available in `examples/plate/generate_grid.py`, and just the file name was
305-
adjusted for this example)::
297+
the same folder::
306298

307299
from pyhyp import pyHyp
308300

309301
fileName = 'plate.cgns'
310-
fileType = 'CGNS'
302+
fileType = 'cgns'
311303

312-
options= {
304+
options = {
313305
# ---------------------------
314306
# Input File
315307
# ---------------------------
@@ -321,14 +313,14 @@ adjusted for this example)::
321313
# ---------------------------
322314
'N': 65,
323315
's0': 1e-6,
324-
'rMin': 2.5,
316+
'marchDist': 2.5,
325317

326318
# ---------------------------
327319
# Pseudo Grid Parameters
328320
# ---------------------------
329321
'ps0': 1e-6,
330322
'pGridRatio': 1.15,
331-
'cMax': 5,
323+
'cMax': 5.0,
332324

333325
# ---------------------------
334326
# Smoothing parameters
@@ -340,19 +332,12 @@ adjusted for this example)::
340332
'volBlend': 0.001,
341333
'volSmoothIter': 10,
342334

343-
# ---------------------------
344-
# BC parameters
345-
# ---------------------------
346-
'sigmaSplay': 0.4,
347-
'nuSplay': 0.95,
348-
349335
# ---------------------------
350336
# Solution Parameters
351337
# ---------------------------
352338
'kspRelTol': 1e-15,
353339
'kspMaxIts': 1500,
354-
'preConLag': 10,
355-
'kspSubspaceSize':50,
340+
'kspSubspaceSize': 50,
356341
'writeMetrics': False,
357342
}
358343

@@ -376,7 +361,7 @@ You can also run pyHyp in parallel with the following command::
376361
The option '-np 4' indicates that 4 processors will be used. The results may vary slight due to the parallel solution of the linear system.
377362

378363
Visualizing the mesh in TecPlot 360
379-
-------------------------------------
364+
-----------------------------------
380365

381366
If you have TecPlot 360 installed in your computer you can visualize the volume mesh. Open a terminal and navigate to the folder
382367
than contains the newly generated CGNS file with the volume mesh. Then type the following command::

doc/index.rst

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ line) corresponding to the geometry of interest and then *grow* or
2020
distance from the original surface. In the process, the entire space
2121
surrounding the geometry is meshed.
2222

23-
Most the theory for `pyHyp` was taken from `Chan and Steger <https://www.sciencedirect.com/science/article/pii/009630039290073A>`_.
23+
.. _pyhyp_theory:
24+
25+
Most of the theory for `pyHyp` was taken from `Chan and Steger <https://www.sciencedirect.com/science/article/pii/009630039290073A>`_.
2426

2527

2628

@@ -30,8 +32,8 @@ Contents:
3032
:maxdepth: 2
3133

3234
install
33-
plot3d
34-
cgns
35+
tutorial
36+
icem
3537
BC
3638
options
3739
API

doc/install.rst

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,6 @@ Finally, install the Python interface with::
4949

5050
pip install .
5151

52-
53-
.. _pyhyp_theory:
54-
5552
Testing Your Installation
5653
-------------------------
5754

doc/options.rst

Lines changed: 1 addition & 161 deletions
Original file line numberDiff line numberDiff line change
@@ -3,164 +3,4 @@
33
Options
44
=======
55

6-
Here are the options currently available in pyHyp.
7-
8-
.. list-table::
9-
:widths: 5 5 90
10-
:header-rows: 1
11-
12-
* - Parameter
13-
- Type
14-
- Description
15-
16-
* - ``inputFile``
17-
- ``str``
18-
- Name of the file that contains the surface mesh.
19-
This is a file that has been generated in an external meshing program, typically ICEMCFD.
20-
21-
* - ``fileType``
22-
- ``str``
23-
- Type of the input file.
24-
Use either ``Plot3d`` or ``CGNS``.
25-
26-
* - ``unattachedEdgesAreSymmetry``
27-
- ``bool``
28-
- Automatically applies symmetry boundary conditions to any edges that do not interface with another block.
29-
This option works in many cases but does not work for all surface meshes.
30-
If you encounter negative volumes near the symmetry plane, try explicitly setting the symmetry boundary conditions using the ``BC`` option.
31-
32-
* - ``outerFaceBC``
33-
- ``str``
34-
- Specifies the boundary condition at the outermost face of the extruded mesh.
35-
Use either ``farfield`` or ``overset``.
36-
37-
* - ``BC``
38-
- ``dict``
39-
- Specifies boundary condition information for specific block edges. See :ref:`here<pyhyp_BC>` for details.
40-
41-
* - ``families``
42-
- ``str`` / ``dict``
43-
- Name given to wall surfaces.
44-
If a dictionary is submitted, each wall patch can be named separately.
45-
This can help with applying operations to specific wall patches.
46-
47-
* - ``N``
48-
- ``int``
49-
- Number of grid levels to march.
50-
This determines the grid dimension in the off-wall direction.
51-
Typically this should be a "multi-grid" friendly number.
52-
53-
* - ``s0``
54-
- ``float``
55-
- Initial off-wall (normal) spacing of grid.
56-
This is taken to be constant across the entire geometry.
57-
The units are consistent with the rest of the geometry.
58-
59-
* - ``rMin``
60-
- ``float``
61-
- Relative distance in the normal direction to march.
62-
It is specified as a multiple of the radius of the sphere enclosing the initial surface geometry.
63-
If symmetry is specified, the full mirrored geometry is used to compute the sphere's radius.
64-
Most wing geometries will have ``rMin`` between 10 and 20, that is the farfield boundary is 20 spans away from the geometry.
65-
66-
* - ``cMax``
67-
- ``float``
68-
- The maximum permissible ratio of marching direction length to the any other in-plane edge.
69-
This parameter effectively operates as a CFL-type limit.
70-
If a step would require a step which would result in a ratio ``c`` greater than ``cMax``, the step is automatically split internally to respect this user-supplied limit.
71-
Typical values of ``cMax`` are around 6-8.
72-
Increased robustness can be achieved at the expense of computational cost by lowering ``cMax``.
73-
74-
* - ``nonLinear``
75-
- ``float``
76-
- Use the nonlinear formulation.
77-
This is experimental and not currently recommended and may not work at all.
78-
79-
* - ``slExp``
80-
- ``float``
81-
- Exponent for the :math:`S_l` computation.
82-
The :math:`S_l` value serves the same purpose as found in Chan et al. but the computation is different.
83-
The :math:`S_l` computation in Chan is given as :math:`\sqrt{\frac{N-1}{l-1}}` for :math:`l > 2`.
84-
85-
* - ``ps0``
86-
- ``float``
87-
- Initial pseudo offwall spacing.
88-
This spacing **must** be less than or equal to ``s0``.
89-
This is actual spacing the hyperbolic scheme uses.
90-
The solver may take many pseudo steps before the first real grid level at ``s0``.
91-
92-
* - ``pGridRatio``
93-
- ``float``
94-
- The ratio between successive levels in the pseudo grid.
95-
This will be typically somewhere between ~1.05 for large grids to 1.2 for small grids.
96-
This number is **not** the actual grid spacing of the final grid; that spacing ratio is computed and displayed at the beginning of a calculation.
97-
The ``pGridRatio`` **must** be smaller than that number.
98-
99-
* - ``epsE``
100-
- ``float``
101-
- The explict smoothing parameter.
102-
See the :ref:`Theory<pyhyp_theory>` section for more information.
103-
Typical values are approximately 1.0. Increasing the explicit smoothing may result in a smoother grid, at the expense of orhtogonality.
104-
If the geometry is very sharp corners, too much explicit smoothing will cause the solver to rapidly "soften" the corner and the grid will fold back on itself.
105-
In concave corners, additional smoothing will prevent lines from crossing (avoiding negative cells).
106-
107-
* - ``epsI``
108-
- ``float``
109-
- Implicit smoothing parameter.
110-
See the :ref:`Theory<pyhyp_theory>` section for more information.
111-
Typical values are from 2.0 to 6.0.
112-
Generally increasing the implicit coefficient results in a more stable solution procedure.
113-
Usually this value should be twice the explicit smoothing parameter.
114-
115-
* - ``theta``
116-
- ``float``
117-
- Kinsley-Barth coefficient See the :ref:`Theory<pyhyp_theory>` section for more information.
118-
Only a single theta value is used for both directions.
119-
Typical values are ~2.0 to ~4.0.
120-
121-
* - ``volCoef``
122-
- ``float``
123-
- Coefficient used in point-Jacobi local volume smoothing algorithm.
124-
Typically this value is 0.16 and need not be modified.
125-
Use more ``volSmoothIter`` for stronger local smoothing.
126-
127-
* - ``volBlend``
128-
- ``float``
129-
- The global volume blending coefficient.
130-
See the :ref:`Theory<pyhyp_theory>` section for more information.
131-
This value will typically be very small, especially if you widely varying cell sizes.
132-
Typically values are from ~0 to 0.001.
133-
Default is 0.0001.
134-
135-
* - ``volSmoothIter``
136-
- ``int``
137-
- The number of point-Jacobi local volume smoothing iterations to perform.
138-
Typical values are ~5 to ~25.
139-
Default is 10.
140-
141-
* - ``kspRelTol``
142-
- ``float``
143-
- Tolerance for the solution of the linear system at each iteration.
144-
Typically :math:`1\times 10^{-8}` is sufficient.
145-
Very difficult cases may benefit from a tighter convergence tolerance.
146-
147-
* - ``kspMaxIts``
148-
- ``int``
149-
- Maximum number of iterations to perform for each step.
150-
Default is 500 which should be sufficient for most cases.
151-
152-
* - ``preConLag``
153-
- ``int``
154-
- Lag the update of the preconditioner by this number of iterations.
155-
The default value of 10 will typically not need to be changed.
156-
157-
* - ``kspSubspaceSize``
158-
- ``int``
159-
- Size of the ksp subspace.
160-
Default is 50.
161-
Very large and difficult problems may befefit from a larger subspace size.
162-
163-
* - ``writeMetrics``
164-
- ``bool``
165-
- Flag to write the mesh gradients to the solution file.
166-
This option should only be used for debugging purposes.
6+
.. optionstable:: pyhyp.pyHyp

0 commit comments

Comments
 (0)