Skip to content

Commit

Permalink
Merge pull request #73 from WISDEM/update_openfast
Browse files Browse the repository at this point in the history
Update openfast
  • Loading branch information
johnjasa authored Jan 27, 2021
2 parents e278441 + eb71d3d commit 3182352
Show file tree
Hide file tree
Showing 57 changed files with 1,749 additions and 1,550 deletions.
2 changes: 1 addition & 1 deletion OpenFAST/cmake/OpenfastFortranOptions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ macro(set_fast_gfortran)
# Disable stack reuse within routines: issues seen with gfortran 9.x, but others may also exhibit
# see section 3.16 of https://gcc.gnu.org/onlinedocs/gcc-9.2.0/gcc.pdf
# and https://github.com/OpenFAST/openfast/pull/595
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fstack-reuse='none'")
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fstack-reuse=none")

# Deal with Double/Single precision
if (DOUBLE_PRECISION)
Expand Down
38 changes: 19 additions & 19 deletions OpenFAST/docs/source/user/aerodyn/examples/ad_primary_example.inp
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ Description line that will be printed in the output file and written to the scre
====== General Options ============================================================================
True Echo - Echo the input to "<rootname>.AD.ech"? (flag)
"default" DTAero - Time interval for aerodynamic calculations {or "default"} (s)
1 WakeMod - Type of wake/induction model (switch) {0=none, 1=BEMT, 2=DBEMT} [WakeMod cannot be 2 when linearizing]
1 WakeMod - Type of wake/induction model (switch) {0=none, 1=BEMT, 2=DBEMT, 3=OLAF} [WakeMod cannot be 2 or 3 when linearizing]
1 AFAeroMod - Type of blade airfoil aerodynamics model (switch) {1=steady model, 2=Beddoes-Leishman unsteady model} [AFAeroMod must be 1 when linearizing]
0 TwrPotent - Type tower influence on wind based on potential flow around the tower (switch) {0=none, 1=baseline potential flow, 2=potential flow with Bak correction}
False TwrShadow - Calculate tower influence on wind based on downstream tower shadow? (flag)
0 TwrShadow - Calculate tower influence on wind based on downstream tower shadow (switch) {0=none, 1=Powles model, 2=Eames model}
False TwrAero - Calculate tower aerodynamic loads? (flag)
False FrozenWake - Assume frozen wake during linearization? (flag) [used only when WakeMod=1 and when linearizing]
False CavitCheck - Perform cavitation check? (flag) [AFAeroMod must be 1 when CavitCheck=true]
Expand All @@ -19,15 +19,15 @@ False CompAA - Flag to compute AeroAcoustics calculation [on
101325 Patm - Atmospheric pressure (Pa) [used only when CavitCheck=True]
2000 Pvap - Vapour pressure of fluid (Pa) [used only when CavitCheck=True]
0.6 FluidDepth - Water depth above mid-hub height (m) [used only when CavitCheck=True]
====== Blade-Element/Momentum Theory Options ====================================================== [unused when WakeMod=0]
1 SkewMod - Type of skewed-wake correction model (switch) {1=uncoupled, 2=Pitt/Peters, 3=coupled} [unused when WakeMod=0]
"default" SkewModFactor - Constant used in Pitt/Peters skewed wake model {or "default" is 15/32*pi} (-) [used only when SkewMod=2; unused when WakeMod=0]
f TipLoss - Use the Prandtl tip-loss model? (flag) [unused when WakeMod=0]
f HubLoss - Use the Prandtl hub-loss model? (flag) [unused when WakeMod=0]
True TanInd - Include tangential induction in BEMT calculations? (flag) [unused when WakeMod=0]
True AIDrag - Include the drag term in the axial-induction calculation? (flag) [unused when WakeMod=0]
True TIDrag - Include the drag term in the tangential-induction calculation? (flag) [unused when WakeMod=0 or TanInd=FALSE]
1E-05 IndToler - Convergence tolerance for BEMT nonlinear solve residual equation {or "default"} (-) [unused when WakeMod=0]
====== Blade-Element/Momentum Theory Options ====================================================== [unused when WakeMod=0 or 3]
1 SkewMod - Type of skewed-wake correction model (switch) {1=uncoupled, 2=Pitt/Peters, 3=coupled} [unused when WakeMod=0 or 3]
"default" SkewModFactor - Constant used in Pitt/Peters skewed wake model {or "default" is 15/32*pi} (-) [used only when SkewMod=2; unused when WakeMod=0 or 3]
f TipLoss - Use the Prandtl tip-loss model? (flag) [unused when WakeMod=0 or 3]
f HubLoss - Use the Prandtl hub-loss model? (flag) [unused when WakeMod=0 or 3]
True TanInd - Include tangential induction in BEMT calculations? (flag) [unused when WakeMod=0 or 3]
True AIDrag - Include the drag term in the axial-induction calculation? (flag) [unused when WakeMod=0 or 3]
True TIDrag - Include the drag term in the tangential-induction calculation? (flag) [unused when WakeMod=0,3 or TanInd=FALSE]
1E-05 IndToler - Convergence tolerance for BEMT nonlinear solve residual equation {or "default"} (-) [unused when WakeMod=0 or 3]
100 MaxIter - Maximum number of iteration steps (-) [unused when WakeMod=0]
====== Dynamic Blade-Element/Momentum Theory Options ============================================== [used only when WakeMod=2]
2 DBEMT_Mod - Type of dynamic BEMT (DBEMT) model {1=constant tau1, 2=time-dependent tau1} (-) [used only when WakeMod=2]
Expand Down Expand Up @@ -60,15 +60,15 @@ True UseBlCm - Include aerodynamic pitching moment in calcul
"Test01_UAE_AeroDyn_blade.dat" ADBlFile(1) - Name of file containing distributed aerodynamic properties for Blade #1 (-)
"Test01_UAE_AeroDyn_blade.dat" ADBlFile(2) - Name of file containing distributed aerodynamic properties for Blade #2 (-) [unused if NumBl < 2]
"Test01_UAE_AeroDyn_blade.dat" ADBlFile(3) - Name of file containing distributed aerodynamic properties for Blade #3 (-) [unused if NumBl < 3]
====== Tower Influence and Aerodynamics ============================================================= [used only when TwrPotent/=0, TwrShadow=True, or TwrAero=True]
====== Tower Influence and Aerodynamics ============================================================= [used only when TwrPotent/=0, TwrShadow/=0, or TwrAero=True]
5 NumTwrNds - Number of tower nodes used in the analysis (-) [used only when TwrPotent/=0, TwrShadow=True, or TwrAero=True]
TwrElev TwrDiam TwrCd
(m) (m) (-)
0.0000000E+00 6.0000000E+00 0.0000000E+00
2.0000000E+01 5.5000000E+00 0.0000000E+00
4.0000000E+01 5.0000000E+00 0.0000000E+00
6.0000000E+01 4.5000000E+00 0.0000000E+00
8.0000000E+01 4.0000000E+00 0.0000000E+00
TwrElev TwrDiam TwrCd TwrTI (used only with TwrShadow=2)
(m) (m) (-) (-)
0.0000000E+00 6.0000000E+00 0.0000000E+00 1.0000000E-01
2.0000000E+01 5.5000000E+00 0.0000000E+00 1.0000000E-01
4.0000000E+01 5.0000000E+00 0.0000000E+00 1.0000000E-01
6.0000000E+01 4.5000000E+00 0.0000000E+00 1.0000000E-01
8.0000000E+01 4.0000000E+00 0.0000000E+00 1.0000000E-01
====== Outputs ====================================================================================
True SumPrint - Generate a summary file listing input options and interpolated properties to "<rootname>.AD.sum"? (flag)
4 NBlOuts - Number of blade node outputs [0 - 9] (-)
Expand Down
1 change: 1 addition & 0 deletions OpenFAST/docs/source/user/aerodyn/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,6 @@ AeroDyn Users Guide and Theory Manual
input.rst
output.rst
modeling.rst
theory.rst
appendix.rst

31 changes: 20 additions & 11 deletions OpenFAST/docs/source/user/aerodyn/input.rst
Original file line number Diff line number Diff line change
Expand Up @@ -180,11 +180,12 @@ potential-flow influence of the tower on the fluid flow local to the
blade, 1 to enable the standard potential-flow model, or 2 to include
the Bak correction in the potential-flow model.

Set the ``TwrShadow``
flag to TRUE to include the influence of the tower on the flow local to
the blade based on the downstream tower shadow model or FALSE to disable
these effects. If the tower influence from potential flow and tower
shadow are both enabled, the two influences will be superimposed.
Set the ``TwrShadow`` to 0 to disable to the tower shadow model,
1 to enable the Powles tower shadow model, or 2 to use the Eames tower
shadow model. These models calculate the influence of the tower on the
flow local to the blade based on the downstream tower shadow model. If
the tower influence from potential flow and tower shadow are both
enabled, the two influences will be superimposed.

Set the ``TwrAero`` flag to TRUE to calculate fluid drag loads on the
tower or FALSE to disable these effects.
Expand Down Expand Up @@ -379,7 +380,7 @@ Tower Influence and Aerodynamics

The input parameters in this section pertain to the tower influence
and/or tower drag calculations and are only used when ``TwrPotent`` >
0, ``TwrShadow = TRUE``, or ``TwrAero = TRUE``.
0, ``TwrShadow`` > 0, or ``TwrAero = TRUE``.

``NumTwrNds`` is the user-specified number of tower analysis nodes and
determines the number of rows in the subsequent table (after two table
Expand All @@ -389,10 +390,17 @@ time; we recommend that ``NumTwrNds`` be between 10 and 20 to balance
accuracy with computational expense. For each node, ``TwrElev``
specifies the local elevation of the tower node above ground (or above
MSL for offshore wind turbines or above the seabed for MHK turbines),
``TwrDiam`` specifies the local tower diameter, and ``TwrCd``
specifies the local tower drag-force coefficient. ``TwrElev`` must be
entered in monotonically increasing order—from the lowest (tower-base)
to the highest (tower-top) elevation. See Figure 2.
``TwrDiam`` specifies the local tower diameter, ``TwrCd`` specifies the
local tower drag-force coefficient, and ``TwrTI`` specifiest the
turbulence intensity used in the Eames tower shadow model
(``TwrShadow`` = 2). ``TwrElev`` must be entered in monotonically
increasing order—from the lowest (tower-base) to the highest
(tower-top) elevation. Values of ``TwrTI`` between 0.05 and 0.4 are
recommended. Values larger than 0.4 up to 1 will trigger a warning
that the results will need to be interpretted carefully, but the code
will allow such values for scientific investigation purposes.
See :numref:`fig:TwrGeom`.


.. _AD-Outputs:

Expand All @@ -403,7 +411,7 @@ Specifying ``SumPrint`` to TRUE causes AeroDyn to generate a summary
file with name ``OutFileRoot**.AD.sum*. ``OutFileRoot`` is either
specified in the I/O SETTINGS section of the driver input file when
running AeroDyn standalone, or by the OpenFAST program when running a
coupled simulation. See section 5.2 for summary file details.
coupled simulation. See :numref:`sec:ad_SumFile` for summary file details.

AeroDyn can output aerodynamic and kinematic quantities at up to nine
nodes specified along the tower and up to nine nodes along each blade.
Expand All @@ -427,6 +435,7 @@ quantities are actually output at these nodes.

.. figure:: figs/ad_tower_geom.png
:width: 60%
:name: fig:TwrGeom
:align: center

AeroDyn Tower Geometry
Expand Down
26 changes: 16 additions & 10 deletions OpenFAST/docs/source/user/aerodyn/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,23 @@
Introduction
============

AeroDyn is a time-domain wind turbine aerodynamics module that is coupled in the OpenFAST multi-physics engineering tool to enable aero-elastic simulation of horizontal-axis turbines.
AeroDyn can also be driven as a standalone code to compute wind turbine aerodynamic response uncoupled from OpenFAST.
When coupled to OpenFAST, AeroDyn can also be linearized as part of the linearization of the full coupled solution (linearization is not available in standalone mode).
AeroDyn was originally developed for modeling wind turbine aerodynamics.
AeroDyn is a time-domain wind turbine aerodynamics module that is coupled in the
OpenFAST multi-physics engineering tool to enable aero-elastic simulation of
horizontal-axis turbines. AeroDyn can also be driven as a standalone code to
compute wind turbine aerodynamic response uncoupled from OpenFAST. When coupled
to OpenFAST, AeroDyn can also be linearized as part of the linearization of the
full coupled solution (linearization is not available in standalone mode).
AeroDyn was originally developed for modeling wind turbine aerodynamics.
However, the module equally applies to the hydrodynamics of marine hydrokinetic
(MHK) turbines (the terms “wind turbine”, “tower”, “aerodynamics” etc. in this document imply “MHK turbine”, “MHK support structure”, “hydrodynamics” etc. for MHK turbines).
Additional physics important for MHK turbines, not applicable to wind turbines, computed by AeroDyn include a cavitation check.
This documentation pertains version of AeroDyn in the OpenFAST github repository.
The AeroDyn version released of OpenFAST 1.0.0 is most closely related to AeroDyn version 15 in the legacy version numbering.
AeroDyn version 15 was a complete overhaul from earlier version of AeroDyn.
AeroDyn version 15 and newer follows the requirements of the FAST modularization framework.
(MHK) turbines (the terms “wind turbine”, “tower”, “aerodynamics” etc. in this
document imply “MHK turbine”, “MHK support structure”, “hydrodynamics” etc. for
MHK turbines). Additional physics important for MHK turbines, not applicable to
wind turbines, computed by AeroDyn include a cavitation check. This
documentation pertains version of AeroDyn in the OpenFAST github repository.
The AeroDyn version released of OpenFAST 1.0.0 is most closely related to
AeroDyn version 15 in the legacy version numbering. AeroDyn version 15 was a
complete overhaul from earlier version of AeroDyn. AeroDyn version 15 and newer
follows the requirements of the FAST modularization framework.

AeroDyn calculates aerodynamic loads on both the blades and tower.
Aerodynamic calculations within AeroDyn are based on the principles of
Expand Down
4 changes: 2 additions & 2 deletions OpenFAST/docs/source/user/aerodyn/modeling.rst
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ the blade tip. Aerodynamic imbalances are possible through the use of
geometrical differences between each blade.

When the tower potential-flow (``TwrPotent > 0``), tower shadow
(``TwrShadow = TRUE``), and/or the tower aerodynamic load
(``TwrShadow > 0``), and/or the tower aerodynamic load
(``TwrAero = TRUE``) models are enabled, we also recommend that
``NumTwrNds`` be between 10 and 20 to balance accuracy with
computational expense. Normally the local elevation of the tower node
Expand Down Expand Up @@ -117,7 +117,7 @@ speed, in which case we recommend that ``TwrAero = TRUE``. Otherwise,
We recommend to include the influence of the tower on the fluid local to
the blade for both operational and parked/idling rotors. We recommend
that ``TwrPotent > 0`` for upwind rotors and that ``TwrPotent = 2``
or ``TwrShadow = TRUE`` for downwind rotors.
or ``TwrShadow > 0`` for downwind rotors.

Linearization
-------------
Expand Down
2 changes: 2 additions & 0 deletions OpenFAST/docs/source/user/aerodyn/output.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ will be truncated if AeroDyn encounters an error while parsing an input
file. The error usually corresponds to the line after the last
successfully echoed line.

.. _sec:ad_SumFile:

Summary File
------------

Expand Down
30 changes: 30 additions & 0 deletions OpenFAST/docs/source/user/aerodyn/theory.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@

.. _AD_theory:

AeroDynTheory
=============

This theory manual is work in progress, please refer to the AeroDyn manual for more details.


.. _AD_twr_shadow:

Tower shadow models
~~~~~~~~~~~~~~~~~~~

Powles tower shadow model (**TwrShadow=1**) is given by:

.. math::
u_{TwrShadow} = - \frac{C_d}{ \sqrt{\overline{r}} }
\cos\left( \frac{\pi/2 \overline{y}}{\sqrt{\overline{r}}}\right)^2
where :math:`\overline{r} = \sqrt{ \overline{x}^2 + \overline{y}^2 }`.


Eames tower shadow model (**TwrShadow=2**) is given by:

.. math::
u_{TwrShadow} = -\frac{C_d}{ TI \: \overline{x} \, \sqrt{2 \pi } }
\exp{\left( -\frac{1}{2} \left(\frac{ \overline{y}}{ TI \: \overline{x} } \right)^2 \right) }
where :math:`TI` is the turbulence intensity at the tower node.
22 changes: 22 additions & 0 deletions OpenFAST/docs/source/user/api_change.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,28 @@ The changes are tabulated according to the module input file, line number, and f
The line number corresponds to the resulting line number after all changes are implemented.
Thus, be sure to implement each in order so that subsequent line numbers are correct.

OpenFAST v2.5.0 to OpenFAST dev
-------------------------------

============== ==== ================== =============================================================================================================================================================================
Added in OpenFAST dev
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Module Line Flag Name Example Value
============== ==== ================== =============================================================================================================================================================================
AD15 TwrTi 0.0000000E+00 6.0000000E+00 1.0000000E+00 1.0000000E-01 [additional column in *Tower Influence and Aerodynamics* table]
============== ==== ================== =============================================================================================================================================================================



============== ==== ================== =============================================================================================================================================================================
Changed in OpenFAST dev
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Module Line Flag Name Example Value
============== ==== ================== =============================================================================================================================================================================
AD15 9 TwrShadow 0 TwrShadow - Calculate tower influence on wind based on downstream tower shadow (switch) {0=none, 1=Powles model, 2=Eames model}
============== ==== ================== =============================================================================================================================================================================


OpenFAST v2.4.0 to OpenFAST v2.5.0
----------------------------------

Expand Down
4 changes: 3 additions & 1 deletion OpenFAST/glue-codes/openfast/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ add_executable(openfast src/FAST_Prog.f90)
target_link_libraries(openfast openfast_postlib foamfastlib)
set_property(TARGET openfast PROPERTY LINKER_LANGUAGE Fortran)

if (${CMAKE_Fortran_COMPILER_ID} STREQUAL "GNU" AND ${CMAKE_Fortran_COMPILER_ID} STREQUAL "RELEASE")
string(TOUPPER ${CMAKE_Fortran_COMPILER_ID} _compiler_id)
string(TOUPPER ${CMAKE_BUILD_TYPE} _build_type)
if (${_compiler_id} STREQUAL "GNU" AND ${_build_type} STREQUAL "RELEASE")
# With variable tracking enabled, the compile step frequently aborts on large modules and
# restarts with this option off. Disabling in Release mode avoids this problem when compiling with
# full optimizations, but leaves it enabled for RelWithDebInfo which adds both -O2 and -g flags.
Expand Down
8 changes: 6 additions & 2 deletions OpenFAST/glue-codes/simulink/src/FAST_SFunc.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ static int NumAddInputs = 0; // number of additional inputs
static int NumOutputs = 1;
static int ErrStat = 0;
static char ErrMsg[INTERFACE_STRING_LENGTH]; // make sure this is the same size as IntfStrLen in FAST_Library.f90
static int ErrStat2 = 0;
static char ErrMsg2[INTERFACE_STRING_LENGTH]; // make sure this is the same size as IntfStrLen in FAST_Library.f90
static char InputFileName[INTERFACE_STRING_LENGTH]; // make sure this is the same size as IntfStrLen in FAST_Library.f90
static int n_t_global = -2; // counter to determine which fixed-step simulation time we are at currently (start at -2 for initialization)
static int AbortErrLev = ErrID_Fatal; // abort error level; compare with NWTC Library
Expand Down Expand Up @@ -448,8 +450,10 @@ static void mdlTerminate(SimStruct *S)
FAST_End(&iTurb, &tr);
n_t_global = -2;
}
FAST_DeallocateTurbines(&ErrStat, ErrMsg);

FAST_DeallocateTurbines(&ErrStat2, ErrMsg2);
if (ErrStat2 != ErrID_None){
ssPrintf("\n%s\n", ErrMsg2);
}
}


Expand Down
Loading

0 comments on commit 3182352

Please sign in to comment.