Skip to content

Commit

Permalink
Merged dev into f/lidar
Browse files Browse the repository at this point in the history
  • Loading branch information
Russell9798 committed Mar 15, 2023
2 parents 8d701d6 + eec4e49 commit a87e0bb
Show file tree
Hide file tree
Showing 79 changed files with 1,208 additions and 5,730 deletions.
41 changes: 23 additions & 18 deletions cmake/OpenfastFortranOptions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,13 @@ macro(set_fast_fortran)
elseif(${CMAKE_Fortran_COMPILER_ID} MATCHES "^Intel")
set_fast_intel_fortran()
endif()

# If double precision option enabled, set preprocessor define to use
# real64 for ReKi reals
if (DOUBLE_PRECISION)
add_definitions(-DOPENFAST_DOUBLE_PRECISION)
endif()

endmacro(set_fast_fortran)

#
Expand Down Expand Up @@ -113,11 +120,10 @@ macro(set_fast_gfortran)
# and https://github.com/OpenFAST/openfast/pull/595
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fstack-reuse=none")

# Deal with Double/Single precision
# If double precision, make constants double precision
if (DOUBLE_PRECISION)
add_definitions(-DOPENFAST_DOUBLE_PRECISION)
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fdefault-real-8")
endif (DOUBLE_PRECISION)
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fdefault-real-8 -fdefault-double-8")
endif()

# debug flags
if(CMAKE_BUILD_TYPE MATCHES Debug)
Expand Down Expand Up @@ -156,21 +162,21 @@ endmacro(set_fast_intel_fortran)
#
macro(set_fast_intel_fortran_posix)
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fpic -fpp")
# Deal with Double/Single precision
if (DOUBLE_PRECISION)
add_definitions(-DOPENFAST_DOUBLE_PRECISION)
if("${CMAKE_Fortran_COMPILER_VERSION}" VERSION_GREATER "19")
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -r8 -double-size 128")
else()
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -r8 -double_size 128")
endif()
endif (DOUBLE_PRECISION)

# debug flags
if(CMAKE_BUILD_TYPE MATCHES Debug)
set( CMAKE_Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS_DEBUG} -check all,noarg_temp_created -traceback -init=huge,infinity" )
endif()

# If double precision, make real and double constants 64 bits
if (DOUBLE_PRECISION)
if("${CMAKE_Fortran_COMPILER_VERSION}" VERSION_GREATER "19")
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -real-size 64 -double-size 64")
else()
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -real_size 64 -double_size 64")
endif()
endif()

# OPENMP
if (OPENMP)
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -qopenmp")
Expand Down Expand Up @@ -206,15 +212,14 @@ macro(set_fast_intel_fortran_windows)
# - 5268: 132 column limit
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} /Qdiag-disable:5199,5268 /fpp")

# Deal with Double/Single precision
# If double precision, make constants double precision
if (DOUBLE_PRECISION)
add_definitions(-DOPENFAST_DOUBLE_PRECISION)
if("${CMAKE_Fortran_COMPILER_VERSION}" VERSION_GREATER "19")
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} /real-size:64 /double-size:128")
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} /real-size:64 /double-size:64")
else()
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} /real_size:64 /double_size:128")
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} /real_size:64 /double_size:64")
endif()
endif (DOUBLE_PRECISION)
endif()

# increase the default 2MB stack size to 16 MB
MATH(EXPR stack_size "16 * 1024 * 1024")
Expand Down
Binary file modified docs/OtherSupporting/ElastoDyn/FASTLogicFlow.doc
Binary file not shown.
40 changes: 18 additions & 22 deletions docs/source/testing/regression_test.rst
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ The following packages are required for regression testing:
- Python 3.7+
- Numpy
- CMake and CTest (Optional)
- Bokeh 1.4 (Optional)
- Bokeh 2.4+ (Optional)

.. _python_driver:

Expand All @@ -85,17 +85,15 @@ executing with the help option:

>>>$ python manualRegressionTest.py -h
usage: manualRegressionTest.py [-h] [-p [Plotting-Flag]] [-n [No-Execution]]
[-v [Verbose-Flag]] [-case [Case-Name]]
OpenFAST System-Name Compiler-Id Test-Tolerance
[-v [Verbose-Flag]] [-case [Case-Name]] [-module [Module-Name]]
Executable-Name Relative-Tolerance Absolute-Tolerance

Executes OpenFAST and a regression test for a single test case.
Executes OpenFAST or driver and a regression test for a single test case.

positional arguments:
OpenFAST path to the OpenFAST executable
System-Name current system's name: [Darwin,Linux,Windows]
Compiler-Id compiler's id: [Intel,GNU]
Test-Tolerance tolerance defining pass or failure in the regression
test
Executable-Name path to the executable
Relative-Tolerance Relative tolerance to allow the solution to deviate; expressed as order of magnitudes less than baseline.
Absolute-Tolerance Absolute tolerance to allow small values to pass; expressed as order of magnitudes less than baseline.

optional arguments:
-h, --help show this help message and exit
Expand All @@ -106,6 +104,8 @@ executing with the help option:
-v [Verbose-Flag], -verbose [Verbose-Flag]
bool to include verbose system output
-case [Case-Name] single case name to execute
-module [Module-Name], -mod [Module-Name]
name of module to execute

.. note::

Expand Down Expand Up @@ -351,17 +351,15 @@ included Python driver.
cd reg_tests
python manualRegressionTest.py -h
# usage: manualRegressionTest.py [-h] [-p [Plotting-Flag]] [-n [No-Execution]]
# [-v [Verbose-Flag]] [-case [Case-Name]]
# OpenFAST System-Name Compiler-Id Test-Tolerance
# [-v [Verbose-Flag]] [-case [Case-Name]] [-module [Module-Name]]
# Executable-Name Relative-Tolerance Absolute-Tolerance
#
# Executes OpenFAST and a regression test for a single test case.
# Executes OpenFAST or driver and a regression test for a single test case.
#
# positional arguments:
# OpenFAST path to the OpenFAST executable
# System-Name current system's name: [Darwin,Linux,Windows]
# Compiler-Id compiler's id: [Intel,GNU]
# Test-Tolerance tolerance defining pass or failure in the regression
# test
# Executable-Name path to the executable
# Relative-Tolerance Relative tolerance to allow the solution to deviate; expressed as order of magnitudes less than baseline.
# Absolute-Tolerance Absolute tolerance to allow small values to pass; expressed as order of magnitudes less than baseline.
#
# optional arguments:
# -h, --help show this help message and exit
Expand All @@ -372,12 +370,10 @@ included Python driver.
# -v [Verbose-Flag], -verbose [Verbose-Flag]
# bool to include verbose system output
# -case [Case-Name] single case name to execute
# -module [Module-Name], -mod [Module-Name]
# name of module to execute
python manualRegressionTest.py \
..\build\bin\openfast_x64_Double.exe \
Windows \
Intel \
1e-5
python manualRegressionTest.py ..\build\bin\openfast_x64_Double.exe 2.0 1.9
.. _reg_test_windows:

Expand Down
2 changes: 1 addition & 1 deletion docs/source/testing/regression_test_windows.rst
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ Windows with Visual Studio regression test

b) Change your working directory to ``openfast\reg_tests``

c) Type: ``python manualRegressionTest.py ..\build\bin\openfast_x64_Double.exe Windows Intel 1e-5``
c) Type: ``python manualRegressionTest.py ..\build\bin\openfast_x64_Double.exe 2.0 1.9``
You should see this: ``executing AWT_YFix_WSt``

d) The tests will continue to execute one-by-one until you finally see something like this:
Expand Down
14 changes: 8 additions & 6 deletions docs/source/user/aerodyn-olaf/OLAFTheory.rst
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ approach using the following steps:

.. math::
\begin{aligned}
\Gamma_{ll,j} =\frac{1}{2} C_{l,j}(\alpha_j) \frac{\left[ (\vec{v}_j \cdot \vec{N})^2 + (\vec{v}_j \cdot \vec{T})^2\right]^2\,dA}{
\Gamma_{ll,j} =\frac{1}{2} C_{l,j}(\alpha_j) \frac{\left[ (\vec{v}_j \cdot \vec{N})^2 + (\vec{v}_j \cdot \vec{T})^2\right]\,dA}{
\sqrt{\left[(\vec{v}_j\times \vec{dl})\cdot\vec{N}\right]^2 + \left[(\vec{v}_j\times \vec{dl})\cdot\vec{T}\right]^2}
} %\label{eq:}
,\quad\text{with}
Expand Down Expand Up @@ -278,11 +278,13 @@ approach using the following steps:
No-flow-through Method
^^^^^^^^^^^^^^^^^^^^^^

A Weissinger-L-based representation (:cite:`olaf-Weissinger47_1`)
of the lifting surface is also
available (:cite:`olaf-Bagai94_1,olaf-Gupta06_1,olaf-Ribera07_1`). In this
method, the circulation is solved by satisfying a no-flow through
condition at the 1/4-chord points. It is selected with **CircSolvMethod=[2]**.
A no-flow-through circulation solving method
(sometimes called Weissinger-L-based method)
might be implemented in the future
(:cite:`olaf-Weissinger47_1,olaf-Bagai94_1,olaf-Gupta06_1,olaf-Ribera07_1`).
In this method, the circulation is solved by satisfying a no-flow through
condition at the 1/4-chord points.
It would be selected with **CircSolvMethod=[2]** but is currently no implemented.

Prescribed Circulation
^^^^^^^^^^^^^^^^^^^^^^
Expand Down
14 changes: 13 additions & 1 deletion docs/source/user/api_change.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,18 @@ 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 v3.4.0 to OpenFAST dev
----------------------------------

============================================= ==== ================= ========================================================================================================================================================================================================
Modified in OpenFAST `dev`
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Module Line Flag Name Example Value
============================================= ==== ================= ========================================================================================================================================================================================================
ServoDyn-StructCtrl 6 StC_DOF_MODE 2 StC_DOF_MODE - DOF mode (switch) {0: No StC or TLCD DOF; 1: StC_X_DOF, StC_Y_DOF, and/or StC_Z_DOF (three independent StC DOFs); 2: StC_XY_DOF (Omni-Directional StC); 3: TLCD; 4: Prescribed force/moment time series; 5: Force determined by external DLL}
============================================= ==== ================= ========================================================================================================================================================================================================



OpenFAST v3.4.1 to OpenFAST v3.4.1
----------------------------------
Expand All @@ -22,7 +34,7 @@ OpenFAST v3.3.0 to OpenFAST v3.4.0
----------------------------------

============================================= ==== ================= ========================================================================================================================================================================================================
Added in OpenFAST `dev`
Added in OpenFAST `3.4.0`
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Module Line Flag Name Example Value
============================================= ==== ================= ========================================================================================================================================================================================================
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Input file for tuned mass damper, module by Matt Lackner, Meghan Glade, and Semy
---------------------- SIMULATION CONTROL --------------------------------------
True Echo - Echo input data to <RootName>.ech (flag)
---------------------- StC DEGREES OF FREEDOM ----------------------------------
2 StC_DOF_MODE - DOF mode (switch) {0: No StC or TLCD DOF; 1: StC_X_DOF, StC_Y_DOF, and/or StC_Z_DOF (three independent StC DOFs); 2: StC_XY_DOF (Omni-Directional StC); 3: TLCD; 4: Prescribed force/moment time series}
2 StC_DOF_MODE - DOF mode (switch) {0: No StC or TLCD DOF; 1: StC_X_DOF, StC_Y_DOF, and/or StC_Z_DOF (three independent StC DOFs); 2: StC_XY_DOF (Omni-Directional StC); 3: TLCD; 4: Prescribed force/moment time series; 5: Force determined by external DLL}
true StC_X_DOF - DOF on or off for StC X (flag) [Used only when StC_DOF_MODE=1]
true StC_Y_DOF - DOF on or off for StC Y (flag) [Used only when StC_DOF_MODE=1]
FALSE StC_Z_DOF - DOF on or off for StC Z (flag) [Used only when StC_DOF_MODE=1]
Expand Down
8 changes: 5 additions & 3 deletions docs/source/user/servodyn-stc/StC_input.rst
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ StC Degrees of Freedom

DOF mode {0: No StC or TLCD DOF; 1: StC_X_DOF, StC_Y_DOF, and/or StC_Z_DOF
(three independent StC DOFs); 2: StC_XY_DOF (Omni-Directional StC); 3: TLCD;
4: Prescribed force/moment time series}
4: Prescribed force/moment time series; 5: Force determined by external DLL}


**StC_X_DOF** [flag]
Expand Down Expand Up @@ -310,7 +310,8 @@ StructCtrl Control

**StC_CMODE** [switch]

Control mode {0:none; 1: Semi-Active Control Mode; 2: Active Control Mode}
Control mode {0:none; 1: Semi-Active Control Mode; 2: Active Control Mode}.
When using StC_DOF_MODE==5, StC_CMODE must be 2.

**StC_SA_MODE** [-]

Expand Down Expand Up @@ -425,7 +426,8 @@ when* **StC_DOF_MODE==4**.

**PrescribedForcesCoord** [switch]

Prescribed forces are in global or local coordinates {1: global; 2: local}
Prescribed forces are in global or local coordinates {1: global; 2: local}.
When using StC_DOF_MODE==5, PrescribedForcesCoord must be 1.

**PrescribedForcesFile** [-]

Expand Down
2 changes: 1 addition & 1 deletion docs/source/user/subdyn/input_files.rst
Original file line number Diff line number Diff line change
Expand Up @@ -602,7 +602,7 @@ Output: Summary and Outfile
In this section of the input file, the user sets flags and switches for
the desired output behavior.

Specifying **SDSum** = TRUE causes SubDyn to generate a summary file
Specifying **SumPrint** = TRUE causes SubDyn to generate a summary file
with name **OutRootName**.SD.sum*. **OutRootName** is either
specified in the SUBDYN section of the driver input file when running
SubDyn in stand-alone mode, or in the FAST input file when running a
Expand Down
2 changes: 1 addition & 1 deletion docs/source/user/subdyn/output_files.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Summary File
------------

SubDyn generates a summary file with the naming convention,
**OutRootName.SD.sum** if the **SDSum** parameter is set to TRUE.
**OutRootName.SD.sum** if the **SumPrint** parameter is set to TRUE.
This file summarizes key information about the substructure model,
including:

Expand Down
12 changes: 9 additions & 3 deletions docs/source/user/subdyn/theory.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2572,7 +2572,7 @@ Output: nodal motions

**Fixed-bottom case**

.. math:: :label:
.. math:: :label: nodalMotionFixed

\bar{U}_R &= T_I U_{TP}
,\qquad
Expand All @@ -2597,7 +2597,7 @@ The meshes :math:`y_2` and :math:`y_3` are identical (Guyan displacements comput

**Floating case**

.. math:: :label:
.. math:: :label: nodalMotionFloating

\bar{U}_R &= U_{R,\text{rigid}}
,\qquad
Expand Down Expand Up @@ -2646,7 +2646,13 @@ where :math:`P` is a point belonging to the R- or L-set of nodes.
Outputs to file:
~~~~~~~~~~~~~~~~

**Motions**: nodal motions written to file are in global coordinates, and for the floating case they contain the elastic motion :math:`\bar{U}_L = U_{L,\text{rigid}} + \Phi_m q_m + U_{L,\text{SIM}}` (whereas these elastic motions are not returned to the glue code)
**Motions**: nodal motions written to file are in global coordinates.
For the fixed-bottom case, they are :math:`\bar{U}_L = \bar{\Phi}_R \bar{U}_R + \Phi_m q_m + U_{L,\text{SIM}}`
(see Eq. :eq:`nodalMotionFixed`).
For the floating case, they are :math:`\bar{U}_L = U_{L,\text{rigid}} + R_{b2g}(\Phi_m q_m + U_{L,\text{SIM}})`.
Note that the outputs for the floating case contains the elastic motions (similar to what is returned to MoorDyn), whereas these motions are not returned to the glue code for HydroDyn (see the "0" present in Eq. :eq:`nodalMotionFloating`).




**Loads**: Nodal loads are written to file in the element coordinate system. The procedure are the same for fixed-bottom and floating cases.
Expand Down
29 changes: 24 additions & 5 deletions glue-codes/fast-farm/src/FAST_Farm_Subs.f90
Original file line number Diff line number Diff line change
Expand Up @@ -1112,7 +1112,19 @@ SUBROUTINE Farm_ReadPrimaryFile( InputFile, p, WD_InitInp, AWAE_InitInp, SC_Init
AWAE_InitInp%Mod_Projection=1
endif
endif

!----------------------- WAKE-ADDED TURBULENCE ------------------------------------------
! Read WAT variables
WD_InitInp%WAT_k_Def =1.0_ReKi
WD_InitInp%WAT_k_Grad =1.0_ReKi
WD_InitInp%WAT = .false. ! initialize to false to avoid segfault
!CALL ReadCom( UnIn, InputFile, 'Section Header: Wake-added turbulence', ErrStat2, ErrMsg2, UnEc )
!CALL ReadVar( UnIn, InputFile, WD_InitInp%WAT, "WAT", "Switch for turning on and off wake-added turbulence", ErrStat2, ErrMsg2, UnEc); if(failed()) return
!CALL ReadCom( UnIn, InputFile, 'dummy predef', ErrStat2, ErrMsg2, UnEc )
!CALL ReadCom( UnIn, InputFile, 'dummy user', ErrStat2, ErrMsg2, UnEc )
!CALL ReadCom( UnIn, InputFile, 'dummy userdx', ErrStat2, ErrMsg2, UnEc )
!CALL ReadVarWDefault( UnIn, InputFile, WD_InitInp%WAT_k_Def, "WAT_k_Def, "Calibrated parameter for the influence of the wake deficit in the wake-added Turbulence (-) [>=0.0] or DEFAULT [DEFAULT=1.44]", 1.44_ReKi, ErrStat2, ErrMsg2, UnEc); if(failed()) return
!CALL ReadVarWDefault( UnIn, InputFile, WD_InitInp%WAT_k_Grad, "WAT_k_Grad", "Calibrated parameter for the influence of the radial velocity gradient of the wake deficit in the wake-added Turbulence (-) [>=0.0] or DEFAULT [DEFAULT=0.84]", 0.84_ReKi, ErrStat2, ErrMsg2, UnEc); if(failed()) return
!IF ( PathIsRelative( p%File ) )p%File = TRIM(PriPath)//TRIM(p%File)

!---------------------- VISUALIZATION --------------------------------------------------
CALL ReadCom( UnIn, InputFile, 'Section Header: Visualization', ErrStat2, ErrMsg2, UnEc )
Expand Down Expand Up @@ -1500,16 +1512,23 @@ SUBROUTINE Farm_ValidateInput( p, WD_InitInp, AWAE_InitInp, SC_InitInp, ErrStat,
END IF
END IF

IF (WD_InitInp%FilterInit < 0 ) CALL SetErrStat(ErrID_Fatal,'FilterInit needs to >= 0',ErrStat,ErrMsg,RoutineName)
IF (AWAE_InitInp%Mod_Meander < MeanderMod_Uniform .or. AWAE_InitInp%Mod_Meander > MeanderMod_WndwdJinc) THEN
call SetErrStat(ErrID_Fatal,'Spatial filter model for wake meandering, Mod_Meander, must be 1 (uniform), 2 (truncated jinc), 3 (windowed jinc) or DEFAULT.',ErrStat,ErrMsg,RoutineName)
END IF


IF (AWAE_InitInp%C_Meander < 1.0_Reki) THEN
CALL SetErrStat(ErrID_Fatal,'C_Meander parameter must not be less than 1.',ErrStat,ErrMsg,RoutineName)
END IF

! --- CURL
IF (WD_InitInp%FilterInit < 0 ) CALL SetErrStat(ErrID_Fatal,'FilterInit needs to >= 0',ErrStat,ErrMsg,RoutineName)
IF (AWAE_InitInp%Mod_Meander < MeanderMod_Uniform .or. AWAE_InitInp%Mod_Meander > MeanderMod_WndwdJinc) THEN
call SetErrStat(ErrID_Fatal,'Spatial filter model for wake meandering, Mod_Meander, must be 1 (uniform), 2 (truncated jinc), 3 (windowed jinc) or DEFAULT.',ErrStat,ErrMsg,RoutineName)
END IF
IF (.not.(ANY((/1,2/)==AWAE_InitInp%Mod_Projection))) CALL SetErrStat(ErrID_Fatal,'Mod_Projection needs to be 1 or 2',ErrStat,ErrMsg,RoutineName)

! --- WAT
IF (WD_InitInp%WAT_k_Def <= 0.0_Reki) CALL SetErrStat(ErrID_Fatal,'WAT_k_Def parameter must be positive.',ErrStat,ErrMsg,RoutineName)
IF (WD_InitInp%WAT_k_Grad <= 0.0_Reki) CALL SetErrStat(ErrID_Fatal,'WAT_k_Grad parameter must be positive.',ErrStat,ErrMsg,RoutineName)

!--- OUTPUT ---
IF ( p%n_ChkptTime < 1_IntKi ) CALL SetErrStat( ErrID_Fatal, 'ChkptTime must be greater than 0 seconds.', ErrStat, ErrMsg, RoutineName )
IF (p%TStart < 0.0_ReKi) CALL SetErrStat(ErrID_Fatal,'TStart must not be negative.',ErrStat,ErrMsg,RoutineName)
Expand Down
Loading

0 comments on commit a87e0bb

Please sign in to comment.