Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Overset tut #23

Merged
merged 39 commits into from
Mar 22, 2021
Merged
Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
0d0bbd3
moved OversetTut from MACH-Aero-tuts
DavidAnderegg Nov 25, 2020
4370283
created new branch
DavidAnderegg Nov 25, 2020
10c5b22
created VSP tut
DavidAnderegg Nov 26, 2020
13bd810
WIP Pointwise tut
DavidAnderegg Nov 27, 2020
78fc814
WIP pointwise part
DavidAnderegg Nov 27, 2020
6f0ecf7
finished 'near_wing' mesh
DavidAnderegg Nov 30, 2020
b58258a
WIP
DavidAnderegg Nov 30, 2020
292d560
WIP
DavidAnderegg Dec 1, 2020
9999fc4
WIP
DavidAnderegg Dec 2, 2020
c4a937a
WIP
DavidAnderegg Dec 2, 2020
03ee8a7
WIP
DavidAnderegg Dec 2, 2020
3ca7888
Started working on CFD Analysis
DavidAnderegg Dec 3, 2020
01efaf0
Started working on the ADflow part
DavidAnderegg Dec 11, 2020
7a4941e
Finished surface mesh tut
DavidAnderegg Dec 11, 2020
6a99e9a
Finished analysis part
DavidAnderegg Dec 11, 2020
8706250
Clean up
DavidAnderegg Dec 18, 2020
eeb5c58
Merge remote-tracking branch 'mdolab/master' into overset_tut
ewu63 Dec 21, 2020
efc9390
Fixed Ref Error and some minor misc stuff
DavidAnderegg Jan 4, 2021
1698586
Merge branch 'overset_tut' of https://github.com/DavidAnderegg/MACH-A…
DavidAnderegg Jan 4, 2021
d0cab43
Incorpurated the changes @marcomangano suggested
DavidAnderegg Jan 6, 2021
2a17dc9
fixed some typos
DavidAnderegg Jan 6, 2021
f3dc3f3
renamed overset overview file
anilyil Feb 14, 2021
c726651
edits to the overview file
anilyil Feb 14, 2021
c89c526
changes to gitignore
anilyil Feb 14, 2021
af9bbaa
compressed figure. working on overset theory
anilyil Feb 14, 2021
533bfab
added neys tips and edited overset theory
anilyil Feb 14, 2021
1d16a02
spell check
anilyil Feb 14, 2021
c4812f7
final few edits
anilyil Feb 14, 2021
bbe4e89
compressed overset zipper figure
anilyil Feb 14, 2021
f714ac6
updated the overset theory to include all of the material from Ney's …
anilyil Mar 17, 2021
b32d1c4
addressing comments
anilyil Mar 19, 2021
69a1bda
fixed 'iblank' statement and
DavidAnderegg Mar 19, 2021
a9d29ad
updated the stencil figure and its caption
anilyil Mar 19, 2021
575a37a
formatting
anilyil Mar 19, 2021
d2ed360
formatting take 2
anilyil Mar 19, 2021
b933500
why doesnt my formatter work?
anilyil Mar 19, 2021
36516e4
added ihc_check script and some explanation of it
anilyil Mar 19, 2021
bf89caf
tip.cgns without missing TE-part
DavidAnderegg Mar 19, 2021
a43d4b7
updated options.
anilyil Mar 19, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
_build
.DS_Store
*.cgns
.vscode/*
make.bat


*.gitignore
Binary file added machAeroTutorials/images/overset_IHC.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added machAeroTutorials/images/overset_Overview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added machAeroTutorials/images/overset_bad_IHC.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added machAeroTutorials/images/overset_tip1.png
Binary file added machAeroTutorials/images/overset_tip2.png
Binary file added machAeroTutorials/images/overset_vsp_export.png
Binary file added machAeroTutorials/images/overset_vsp_overview.png
Binary file added machAeroTutorials/images/overset_zipper.png
1 change: 1 addition & 0 deletions machAeroTutorials/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@
aero_overview
opt_overview
airfoilopt_overview
overset_zoverview
19 changes: 19 additions & 0 deletions machAeroTutorials/overset.bib
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
@misc{nasaM6sim,
title={3D ONERA M6 Wing Validation for Turbulence Model Numerical Analysis},
url={https://turbmodels.larc.nasa.gov/onerawingnumerics_val.html},
journal={NASA},
publisher={NASA}
}

@misc{nasaM6real,
title={ONERA M6 Wing},
url={https://www.grc.nasa.gov/WWW/wind/valid/m6wing/m6wing.html},
journal={NASA},
publisher={NASA}
}

@misc{nasaM6SA,
title = {{3D} {ONERA} {M6} {Wing} {Validation} for {Turbulence} {Model} {Numerical} {Analysis} - {SA}-neg {Model} {Results}},
url = {https://turbmodels.larc.nasa.gov/onerawingnumerics_val_sa.html},
urldate = {2020-12-11},
}
207 changes: 207 additions & 0 deletions machAeroTutorials/overset_analysis.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,207 @@
.. _overset_analysis:

*******************************************************
CFD Analysis
*******************************************************

Introduction
============

This part will help guide you through the analysis part. We will setup the run script and let ADflow compute the
solution. From :cite:`nasaM6real` and :cite:`nasaM6SA`
we know the flow conditions:

+--------------------+---------+
| AoA | 3.06° |
+--------------------+---------+
| Mach | 0.8395 |
+--------------------+---------+
| Reynolds Number | 11.71e6 |
+--------------------+---------+
| Reynols Ref Lenght | 0.646m |
+--------------------+---------+
| Temperature | 300° K |
+--------------------+---------+

I developed a convenience package for ADflow called
`adflow_util <https://github.com/DavidAnderegg/adflow_util>`_\. It allows to plot the ADflow state variables live in the console and
handles some annoying stuff like creating the ``output`` folder for ADflow automatically. It also makes it easy
to sweep a variable, for example ``alpha``. I will use this utility here, but the regular python API,
that is detailed in other tutorials, would work aswell.

For simplicity, I will only cover the Calculation on the ``L3`` mesh.


Files
=====
Navigate to the directory ``overset/analysis`` in your tutorial folder and create an empty file called
``run_adflow_L3.py``. If you did not create the volume mesh on the previous page, you will also have to
copy the meshfile:
::

$ cp tutorial/overset/analysis/ONERA_M6_L3.cgns .

If you want to use ``adflow_util`` download and install it:
::

$ pip install git+https://github.com/DavidAnderegg/adflow_util.git


ADflow
======

Setup the Script
----------------

First we have to import ``adflow_util``:

.. literalinclude:: ../tutorial/overset/analysis/run_adflow_L3.py
:start-after: # rst Imports (beg)
:end-before: # rst Imports (end)

Then we define a variable for the level we want to use. This makes it easier to switch, if we want to:

.. literalinclude:: ../tutorial/overset/analysis/run_adflow_L3.py
:start-after: # rst Level (beg)
:end-before: # rst Level (end)

``adflow_util`` takes 3 different dictionaries as input. One sets some ``adflow_util``-specific options,
one sets the boundary conditions, as ``AeroProblem`` would and the last one is the regular ``Adflow`` options dict.
Lets set the ``adflow_util`` options first:

.. literalinclude:: ../tutorial/overset/analysis/run_adflow_L3.py
:start-after: # rst Options (beg)
:end-before: # rst Options (end)

name
This sets the name for the analysis. It defines how the various output files are named.

surfaceFamilyGroups
This defines how the various surface families should be assembled. The ``key`` sets the family name and
the ``array`` defines the various surfaces the family is made off.

All adflow_util options can be found `here <https://github.com/DavidAnderegg/adflow_util/blob/master/adflow_util/adflow_util.py#L52>`_\.

Now we define the ``AeroProblem`` options:

.. literalinclude:: ../tutorial/overset/analysis/run_adflow_L3.py
:start-after: # rst AeroOptions (beg)
:end-before: # rst AeroOptions (end)

Here we set the various flow parameters. It is exactly the same as you would set in ``baseclasses.AeroProblem``.
But we could, for example, set alpha as an array of variables. In that case, ``adflow_util`` would handle everything else
for us.

Now, let's set the ``ADflow`` options:

.. literalinclude:: ../tutorial/overset/analysis/run_adflow_L3.py
:start-after: # rst SolverOptions (beg)
:end-before: # rst SolverOptions (end)

I want to point out a few things:

outputsurfacefamily
We choose ``wall`` which we defined earlier as consisting of ``near_wing`` and ``near_tip``. This will
write out only the wing as our surface solution.

zippersurfacefamily
This tells ADflow which surfaces it should use to construct the geometry on which the forces are integrated.

surfacevariables & volumevariables
Here it is very important to add ``blank``. This way we know which cells we can hide in the postprocessor as
the 'blanked' cells still show up in the solution.

.. note:: To only view computed cells, add a filter to your post-processor in a way, that only cells where
``blank`` is bigger than 0 are shown.

And lastly, we plug everything into ``adflow_util``:

.. literalinclude:: ../tutorial/overset/analysis/run_adflow_L3.py
:start-after: # rst Run (beg)
:end-before: # rst Run (end)


Simply Run the Script
---------------------
To run the script, proceed as usual:
::

$ python run_adflow_L3.py

If you want to run in parallel, start it with mpi
::

$ mpirun -np 4 python run_adflow_L3.py


Plot the Iterations in realtime
-------------------------------
If you want to have a graphical representation of all the ADflow variables, ``adflow_util`` comes in handy aswell.
It has an additional package called ``adflow_plot``. If you installed it using pip, you can simply start it this way:
::

$ adflow_plot -i run_adflow_L3.py

If you want to run in parallel:
::

$ adflow_plot -i run_adflow_L3.py -np 4

This is simply an overlay, which starts the adflow script in the background and parses it's ``stdout``. At startup
you will see the regular adflow-ouput. But as soon as the calculation starts, you'll see a plot of ``resRho``:

.. figure:: images/overset_analysis_adflow_plot.png
:width: 600
:align: center

``adflow_plot`` output.

At the bottom is a console where you can define which variables you want to see. As terminals usually have a low
number of 'pixels', it is also possible to show only a limited number of iterations. Simply type ``help`` or ``h``
and hit ``Enter``. You will get a list of all available commands. To quit, simply type ``q`` and confirm with ``y``.

Outputfiles
anilyil marked this conversation as resolved.
Show resolved Hide resolved
-----------
In addition to the expected volume and surface files from adflow, there will also be a file called ``ONERA_M6_L3.out``.
It is from ``adflow_util`` and looks like this:
::

ONERA_M6_L3

Aero Options
-------------- ---------------------
alpha 3.06
mach 0.8395
reynolds 11720000.0
reynoldsLength 0.646
T 300
xRef 0.0
areaRef 0.7575
chordRef 0.646
evalFuncs cl, cd, cmy, cdp, cdv
-------------- ---------------------


RESULTS
cd cdp cdv cl cmy totalRes iterTot
---------- ---------- ---------- ---------- ----------- ---------- ---------
0.01879813 0.01326940 0.00552873 0.26064807 -0.18639411 0.00011945 82

It gives us a nice summary of the input and output values. If we had a sweep variable defined, the multiple
points would be listed here too.


Results
=======

I ran ADflow with all meshes and plotted the results combined with results from :cite:`nasaM6SA`. As you can see,
ADflow lies right in the middle:

.. figure:: images/overset_grid_convergence.png
:width: 800
:align: center

Grid Convergence of ADflow in comparision to various other solvers.
anilyil marked this conversation as resolved.
Show resolved Hide resolved



Loading