MACH-Aero Documentation Unknown
Total Page:16
File Type:pdf, Size:1020Kb
MACH-Aero Documentation unknown Sep 21, 2021 OVERVIEW 1 Overview of MACH-Aero 3 2 Cite Us 5 3 Using Docker 7 4 Installing MACH-Aero From Scratch9 5 Third Party Packages 13 6 Introduction 23 7 Aerodynamic Analysis 25 8 Aerodynamic Optimization 61 9 Airfoil Optimization 87 10 Overset Mesh 105 11 Frequently Asked Questions 165 Bibliography 167 i ii MACH-Aero Documentation MACH-Aero is a framework for performing gradient-based aerodynamic shape optimization. It consists of the follow- ing core modules: • baseClasses defines Python classes used by the other packages • pySpline is a B-spline implementation used by the other packages • pyGeo is a module for geometry manipulation and constraint formulation • IDWarp performs mesh warping using an inverse distance method • ADflow is a 2nd-order finite volume CFD solver with an efficient adjoint implementation • pyOptSparse is an optimization framework which provides a unified interface to several popular optimizers And the following optional modules: • pyHyp is a hyperbolic mesh generation tool used as a preprocessing step • multiPoint facilitates distributed multipoint optimization and handles the parallel communication using MPI • cgnsUtilities is a command-line tool that allows carrying out several simple mesh manipulation operations on CGNS grids • DAFoam provides efficient adjoint implementations for OpenFOAM to be used for CFD instead ofADflow More detail for the framework can be found in Overview of MACH-Aero. If you use any of our codes, please cite us. OVERVIEW 1 MACH-Aero Documentation 2 OVERVIEW CHAPTER ONE OVERVIEW OF MACH-AERO This page provides an overview of the aerodynamic shape optimization capability within MACH (framework for MDO of aircraft configurations with high fidelity). MACH-Aero consists of six major modules: • Pre-processing (pyHyp, ANSYS ICEM-CFD) • Geometry parameterization (pyGeo) • Volume mesh deformation (IDWarp) • Flow simulation (ADflow, DAFoam) • Adjoint computation (ADflow, DAFoam) • Optimization (pyOptSparse) Generally, MACH-Aero starts with a baseline design and uses the gradient to find the most promising direction inthe design space for improvement. This process is repeated until the optimality and feasibility conditions are satisfied. More specifically, the process is as follows, using the above figure as a reference. Here we use the extendeddesign structure matrix (XDSM) representation developed by Lambe and Martins (2012). The diagonal nodes represent the modules and the off-diagonal nodes represent the data. The black lines represent the process flow for the adjoint solver, whereas the thick gray lines represent the data flow. The number in each node represents the execution order: • First, we generate a volume mesh for the baseline geometry (pre-processing in process 1). Several mesh gen- eration tools are available including pyHyp and ICEM. Refer to Surface Meshing, Volume Meshing, and Mesh Manipulation for more details. The generated mesh will be used later in process 4. In the pre-processing step, we 3 MACH-Aero Documentation also generate free-form deformation (FFD) points (process 3) that will be used later to morph the design surface. Refer to Geometric Parameterization. • Then, we give a set of baseline design variables to the optimizer (process 2). We usually use SNOPT as the optimizer, which uses the SQP algorithm. We use pyOptSparse to facilitate the optimization problem setup. The optimizer will update the design variables and give them to the geometry parameterization module (pyGeo; process 3). pyGeo receives the updated design variables and the FFD points generated in the pre-processing step, performs the deformation for the design surface, and outputs the deformed design surface to the mesh deformation module (IDWarp) in process 4. pyGeo also computes the values of geometric constraints and their derivatives with respect to the design variables (process 7). • Next, IDWarp deforms the volume mesh based on the updated design surface and outputs the updated volume mesh to the flow simulation module in process 5. • The flow simulation module receives the updated volume mesh and uses high-fidelity CFD tools(i.e., ADflow or DAFoam) to compute the state variables (process 6) or physical fields (pressure, density, velocity, etc.). The flow simulation module also computes the objective and constraint functions (e.g., drag and lift; seeprocess7) and outputs the state variables to the adjoint computation module. • Then, the adjoint computation module (process 6) computes the total derivatives of the objective and constraint functions with respect to the design variables (process 7) and gives them back to the optimizer in process 7. The benefit of using the adjoint method to compute derivatives is that its computational cost is independent ofthe number of design variables, which makes it attractive for handling large-scale, complex design problems such as aircraft design. There are two available adjoint solvers: ADflow, DAFoam. • Finally, the optimizer receives the values and derivatives of the objective and constraint functions in process 7, performs the SQP computation, and outputs a set of updated design variables to pyGeo. The above process is repeated until the optimization converges. Refer to the MACH-Aero tutorials for tutorials. 4 Chapter 1. Overview of MACH-Aero CHAPTER TWO CITE US See the following papers for technical background of the above modules. If you use these modules for publications, please cite the corresponding papers. • pyOptSparse [1] • pyGeo [2] • ADflow [3,4,5] • DAFoam [6] 5 MACH-Aero Documentation 6 Chapter 2. Cite Us CHAPTER THREE USING DOCKER The MACH framework is packaged within Docker images that can be used to run the software without installing it natively on your machine. If you are using MACH for the first time, we encourage you to try Docker to avoid installation issues or other inconveniences caused by natively installing the tools. This guide assumes you are have Docker installed and running on your machine. If you need to install Docker, you can follow the Docker guide for Installing the Docker Engine. The commands used in this guide may differ depending on your operating system, so refer to the Docker documentation for more details for specific use cases. 3.1 Pull MDO Lab Docker Image Pull one of the MDO Lab Docker images. The available images are listed in the table below: Tag Operating System c7-intel-impi-latest CentOS 7 u20-gcc-ompi-latest Ubuntu 20.04 u20-gcc-ompi-stable Ubuntu 20.04 tacc-u18-gcc-impi-stable Ubuntu 18.04 To pull an image, use the docker pull command: $ docker pull mdolab/public:<TAG> Check that the Docker image is pulled successfully by running: $ docker image ls You should see the image you just pulled. 3.2 Initialize Docker Container Navigate to the directory containing the case you would like to run and initialize the Docker image you downloaded into a container, running interactively: $ docker run -it --name <NAME> --mount "type=bind,src=<HOST_DIR>,target=<MOUNT_DIR>" <IMAGE> /bin/bash Replace <NAME> with the name you would like to give the container, set <HOST_DIR> to the absolute path to the current directory, and set <MOUNT_DIR> to /home/mdolabuser/mount/. Then provide the image tag as <IMAGE>, matching the one downloaded previously: mdolab/public:<TAG>. When you run this command, you will enter the container and have access to the MACH framework in your specified case directory. 7 MACH-Aero Documentation Note: If you are running the MACH tutorials included in this guide using Docker, set the <HOST_DIR> parameter to the path to the directory where you have cloned the tutorial files. 3.3 Exiting and Restarting the Container At any point you can exit the container with the command: $ exit You can restart the container by running start: $ docker start <NAME> Run exec to enter the container: $ docker exec -it <NAME> /bin/bash 8 Chapter 3. Using Docker CHAPTER FOUR INSTALLING MACH-AERO FROM SCRATCH This tutorial is intended to be a step-by-step guide on how to set up the software needed to run MACH-Aero. The focus here is on installing common dependencies shared across the various packages. A general description for installing packages within MACH-Aero is also provided, but please refer to the documentation site for each package for specific instructions. This tutorial assumes that you have a working Linux distribution such as Ubuntu 18.04. The following list what steps are needed. The instructions are divided into three parts • Third party packages • MDO Lab packages • Standard MDO Lab Build Procedure Since MDO Lab packages depend heavily on third party tools and packages, it is generally good to start by compiling and testing them. Finally, an example .bashrc file is shown. • Example .bashrc 4.1 Third party packages To install, follow the instructions on this page. 4.2 MDO Lab packages To install the MDO Lab packages clone each repository from GitHub and follow the installation instructions found in the documentation of each package. Below, we give an overview of the general process, which consists of two parts. The building step is required for Fortran/C-based codes, and not needed if the package is purely written in Python. After this optional step, all packages must be installed as a Python package. The packages needed are: 1. baseClasses 2. pySpline 3. pyGeo 4. IDWarp 5. ADflow 6. pyOptSparse Optional packages are: 9 MACH-Aero Documentation 1. pyHyp 2. multipoint 3. cgnsUtilities 4. DAFoam 4.3 Standard MDO Lab Build Procedure The following general instructions apply to all the packages and repos maintained by the MDO Lab. Note that the Compilation step is not required if the package is entirely written in Python. 4.3.1 Compilation To start, find a configuration file close to your current setupin config/defaults and copy it to config/config.mk. For example $ cp config/defaults/config.LINUX_GFORTRAN.mk config/config.mk If you are a beginner user installing the packages on a Linux desktop, you should use the config.LINUX_GFORTRAN.