Skip to content

Commit 36516e4

Browse files
committed
added ihc_check script and some explanation of it
1 parent b933500 commit 36516e4

File tree

3 files changed

+72
-3
lines changed

3 files changed

+72
-3
lines changed

machAeroTutorials/overset_theory.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -239,8 +239,8 @@ For this, we need to check leaks in the flooding process:
239239

240240
#. Set the ADflow option: ``'nrefine`:1``. This stops the IHC algorithm after one iteartion. You will get error warnings but this is fine, we just want to get an intermediate output for debugging. The ``nrefine`` option controls how many iterations of the IHC algorithm is performed. You can also modify the ``nFloodIter`` option to control how many *flooding* iterations are performed. For example, if ADflow seg-faults in the first overset iteration because the whole mesh floods, then you can stop the flooding iterations early by setting ``nFloodIter`` to 1 or 2. A value of 1 will just determine the flood-seeds, a value of 2 will do a first pass of the flooding process.
241241
#. Set ADflow option: ``‘usezippermesh’:False`` This skips the zipper mesh generation, which may crash if the hole cutting does not work.
242-
#. Run the overset check file: ihc_check.py (Note from Anil: I copied Ney's notes as is, I am not aware where this file is now.)
243-
#. Open the ``fc_-001_vol.cgns`` file in Tecplot
242+
#. Run the overset check file: ihc_check.py (This can be found under the tutorial/overset/mesh directory in this repo)
243+
#. Open the output volume file file in Tecplot
244244
#. Use the blanking option to hide cells with iblank ≥ -1. This will show just the flood seeds (iblank=-3) and flooded cells (iblank=-2).
245245
#. Check which CGNS blocks are fully flooded and then find the cells that are connecting the side of the mesh that is inside the body to the exterior side of the mesh.
246246

machAeroTutorials/overset_volume_mesh.rst

+11-1
Original file line numberDiff line numberDiff line change
@@ -184,4 +184,14 @@ If you have MPI installed and enough processors available, you can also run it i
184184
$ mpirun -np 4 python run_pyhyp.py --level L1
185185

186186
Since we want 3 meshes of different size, you will have to run this script 3 times with the appropriate
187-
``--level`` argument.
187+
``--level`` argument.
188+
189+
Check the Final Mesh
190+
====================
191+
192+
Finally, we can use the ``ihc_check.py`` script to check the result of the implicit hole cutting process in ADflow:
193+
194+
.. literalinclude:: ../tutorial/overset/mesh/ihc_check.py
195+
:start-after: # rst start
196+
:end-before: # rst end
197+

tutorial/overset/mesh/ihc_check.py

+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# rst start
2+
from baseclasses import AeroProblem
3+
from adflow import ADFLOW
4+
import argparse
5+
6+
# ======================================================================
7+
# Init stuff
8+
# ======================================================================
9+
# rst Init (beg)
10+
parser = argparse.ArgumentParser()
11+
parser.add_argument("--input_dir", default=".")
12+
parser.add_argument("--output_dir", default=".")
13+
parser.add_argument("--level", default="L1")
14+
args = parser.parse_args()
15+
# rst Init (end)
16+
17+
# ======================================================================
18+
# Input Information
19+
# ======================================================================
20+
21+
# File name of the mesh
22+
gridFile = "%s/ONERA_M6_%s.cgns" % (args.output_dir, args.level)
23+
24+
# Common aerodynamic problem description and design variables
25+
ap = AeroProblem(name="ihc_check", mach=0.3, altitude=1000, areaRef=0.24 * 0.64 * 2, chordRef=0.24)
26+
27+
# dictionary with name of the zone as a key and a factor to multiply it with.
28+
oversetpriority = {}
29+
30+
aeroOptions = {
31+
# Common Parameters
32+
"gridFile": gridFile,
33+
"outputDirectory": "./",
34+
"MGCycle": "sg",
35+
"volumeVariables": ["blank"],
36+
"surfaceVariables": ["blank"],
37+
# Physics Parameters
38+
"equationType": "RANS",
39+
# Debugging parameters
40+
"debugZipper": False,
41+
"useZipperMesh": False,
42+
# number of times to run IHC cycle
43+
"nRefine": 10,
44+
# number of flooding iterations per IHC cycle.
45+
# the default value of -1 just lets the algorithm run until flooded cells stop changing
46+
"nFloodIter": -1,
47+
"nearWallDist": 0.1,
48+
"oversetPriority": oversetpriority,
49+
}
50+
51+
# Create solver
52+
CFDSolver = ADFLOW(options=aeroOptions, debug=False)
53+
54+
# Uncoment this if just want to check flooding
55+
CFDSolver.setAeroProblem(ap)
56+
57+
name = ".".join(gridFile.split(".")[0:-1])
58+
CFDSolver.writeVolumeSolutionFile(name + "_IHC.cgns", writeGrid=True)
59+
# rst end

0 commit comments

Comments
 (0)