Skip to content

Commit

Permalink
AD: documenting coordinate systems
Browse files Browse the repository at this point in the history
  • Loading branch information
ebranlard committed Jul 18, 2023
1 parent ded7cdc commit b4f872a
Show file tree
Hide file tree
Showing 10 changed files with 1,961 additions and 275 deletions.
29 changes: 12 additions & 17 deletions docs/source/user/aerodyn/appendix.rst
Original file line number Diff line number Diff line change
Expand Up @@ -51,27 +51,22 @@ The blade data input file contains the nodal discretization, geometry, twist, ch
AeroDyn List of Output Channels
-------------------------------

This is a list of output parameters for the AeroDyn module. The names are grouped by meaning, but can be ordered in the OUTPUTS section of the AeroDyn input file as you see fit. :math:`B \alpha N \beta`, refers to output node :math:`\beta` of blade :math:`\alpha`, where :math:`\alpha` is a number in the range [1,3] and :math:`\beta` is a number in the range [1,9], corresponding to entry :math:`\beta` in the :math:`\textit{BlOutNd}` list. :math:`\textit{TwN}\beta` refers to output node :math:`\beta` of the tower and is in the range [1,9], corresponding to entry :math:`\beta` in the :math:`\textit{TwOutNd}` list. A comprehensive, up-to-date list of all possible output parameters is given in the Excel file :download:`OutListParameters.xlsx <../../../OtherSupporting/OutListParameters.xlsx>`.

The local tower coordinate system is shown in :numref:`ad_tower_geom` and the local blade coordinate system is shown in :numref:`ad_blade_local_cs` below. Figure :numref:`ad_blade_local_cs` also shows the direction of the local angles and force components.
AeroDyn has regular outputs (see :numref:`AD-Nodal-Outputs`) and nodal outputs (see :numref:`AD-Outputs`).

.. _ad_blade_local_cs:
A comprehensive, up-to-date list of all possible output parameters is given in the Excel file :download:`OutListParameters.xlsx <../../../OtherSupporting/OutListParameters.xlsx>`, in the tab `AeroDyn` and `AeroDyn_Nodes` for the regular and nodal outputs, respectively.

.. figure:: figs/aerodyn_blade_local_cs.png
:width: 80%
:align: center
:alt: aerodyn_blade_local_cs.png
The names in the Excel file are grouped by meaning, but can be ordered in the OUTPUTS section of the AeroDyn input file as you see fit.

AeroDyn Local Blade Coordinate System (Looking Toward the Tip,
from the Root) – l: Lift, d: Drag, m: Pitching, x: Normal (to Plane),
y: Tangential (to Plane), n: Normal (to Chord),
and t: Tangential (to Chord)
**Regular outputs**
Some examples of regular outputs are given below:

.. _ad-output-channel:

.. figure:: figs/aerodyn_output_channel.pdf
:width: 500px
:align: center
:alt: aerodyn_output_channel.pdf
:math:`B \alpha N \beta`, refers to output node :math:`\beta` of blade :math:`\alpha`, where :math:`\alpha` is a number in the range [1,3] and :math:`\beta` is a number in the range [1,9], corresponding to entry :math:`\beta` in the :math:`\textit{BlOutNd}` list.

:math:`\textit{TwN}\beta` refers to output node :math:`\beta` of the tower and is in the range [1,9], corresponding to entry :math:`\beta` in the :math:`\textit{TwOutNd}` list.


The coordinate systems are provided in :numref:`ad_coordsys`.


AeroDyn Output Channel List
123 changes: 99 additions & 24 deletions docs/source/user/aerodyn/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,43 @@
import subprocess
import re


from sphinx.highlighting import PygmentsBridge
from pygments.formatters.latex import LatexFormatter

#sys.path.append(os.path.abspath('_extensions/'))

readTheDocs = os.environ.get('READTHEDOCS', None) == 'True'
builddir = sys.argv[-1]
sourcedir = sys.argv[-2]

# Use this to turn Doxygen on or off
useDoxygen = False

# This function was adapted from https://gitlab.kitware.com/cmb/smtk
# Only run when on readthedocs
def runDoxygen(sourcfile, doxyfileIn, doxyfileOut):
dx = open(os.path.join(sourcedir, doxyfileIn), 'r')
cfg = dx.read()
srcdir = os.path.abspath(os.path.join(os.getcwd(), '..'))
bindir = srcdir
c2 = re.sub('@CMAKE_SOURCE_DIR@', srcdir, re.sub('@CMAKE_BINARY_DIR@', bindir, cfg))
doxname = os.path.join(sourcedir, doxyfileOut)
dox = open(doxname, 'w')
print(c2, file=dox)
dox.close()
print("Running Doxygen on {}".format(doxyfileOut))
doxproc = subprocess.call(('doxygen', doxname))

if readTheDocs and useDoxygen:
runDoxygen(sourcedir, 'Doxyfile.in', 'Doxyfile')

class CustomLatexFormatter(LatexFormatter):
def __init__(self, **options):
super(CustomLatexFormatter, self).__init__(**options)
self.verboptions = r"formatcom=\footnotesize"

PygmentsBridge.latex_formatter = CustomLatexFormatter

#sys.path.append(os.path.abspath('_extensions/'))

readTheDocs = os.environ.get('READTHEDOCS', None) == 'True'
sourcedir = sys.argv[-2]
builddir = sys.argv[-1]

# -- General configuration ------------------------------------------------

# If your documentation needs a minimal Sphinx version, state it here.
Expand All @@ -56,13 +76,32 @@ def __init__(self, **options):
'sphinxcontrib.bibtex',
]

autodoc_default_flags = ['members','show-inheritance','undoc-members']
autodoc_default_flags = [
'members',
'show-inheritance',
'undoc-members'
]

autoclass_content = 'both'

mathjax_path = 'https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML'

# FIXME: Naively assuming build directory one level up locally, and two up on readthedocs
if useDoxygen:
if readTheDocs:
doxylink = {
'openfast': (
os.path.join(builddir, '..', '..', 'openfast.tag'),
os.path.join('html')
)
}
else:
doxylink = {
'openfast': (
os.path.join(builddir, '..', 'openfast.tag'),
os.path.join('html')
)
}

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
Expand All @@ -79,7 +118,7 @@ def __init__(self, **options):
# General information about the project.
project = u'AeroDyn'
filename = project.replace(' ','_')
copyright = u'2017, National Renewable Energy Laboratory'
copyright = u'2023, National Renewable Energy Laboratory'
author = u'OpenFAST Team'

# The version info for the project you're documenting, acts as replacement for
Expand All @@ -96,7 +135,7 @@ def __init__(self, **options):
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = None
# language = None # Default is English and None is not a valid option

#If true, figures, tables and code-blocks are automatically numbered if they
#have a caption. At same time, the numref role is enabled. For now, it works
Expand All @@ -108,6 +147,13 @@ def __init__(self, **options):
# This patterns also effect to html_static_path and html_extra_path
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']

# FIXME: Naively assuming build directory one level up locally, and two up on readthedocs
if useDoxygen:
if readTheDocs:
html_extra_path = [os.path.join(builddir, '..', '..', 'doxygen')]
else:
html_extra_path = [os.path.join(builddir, '..', 'doxygen')]

# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'

Expand Down Expand Up @@ -147,12 +193,15 @@ def __init__(self, **options):
# The paper size ('letterpaper' or 'a4paper').
#
# 'papersize': 'letterpaper',

# The font size ('10pt', '11pt' or '12pt').
#
# 'pointsize': '10pt',

# Additional stuff for the LaTeX preamble.
#
# 'preamble': '',

# Latex figure (float) alignment
#
# 'figure_align': 'htbp',
Expand All @@ -162,8 +211,13 @@ def __init__(self, **options):
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, '{}.tex'.format(filename), u'{} Documentation'.format(project),
u'National Renewable Energy Laboratory', 'manual'),
(
master_doc,
'{}.tex'.format(filename),
u'{} Documentation'.format(project),
u'National Renewable Energy Laboratory',
'manual'
),
]


Expand All @@ -172,8 +226,13 @@ def __init__(self, **options):
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(master_doc, project, u'{} Documentation'.format(project),
[author], 1)
(
master_doc,
project,
u'{} Documentation'.format(project),
[author],
1
)
]


Expand All @@ -183,19 +242,34 @@ def __init__(self, **options):
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(master_doc, filename, u'{} Documentation'.format(project),
author, project, 'One line description of project.',
'Miscellaneous'),
(
master_doc,
filename,
u'{} Documentation'.format(project),
author,
project,
'One line description of project.',
'Miscellaneous'
),
]

def setup(app):
app.add_object_type("confval", "confval",
objname="input file parameter",
indextemplate="pair: %s; input file parameter")
app.add_object_type("cmakeval", "cmakeval",
objname="CMake configuration value",
indextemplate="pair: %s; CMake configuration")

try:
app.add_css_file('css/math_eq.css')
except:
pass
app.add_object_type(
"confval",
"confval",
objname="input file parameter",
indextemplate="pair: %s; input file parameter"
)
app.add_object_type(
"cmakeval",
"cmakeval",
objname="CMake configuration value",
indextemplate="pair: %s; CMake configuration"
)
# --- Prolog that will be included at the top of every rst file
# Here: defining the role :red: for html and latex
rst_prolog = r"""
Expand All @@ -216,3 +290,4 @@ def setup(app):
.. role:: red
"""

Loading

0 comments on commit b4f872a

Please sign in to comment.