|
| 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