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

Merge previous PRs into this one #12

Merged

Conversation

bjonkman
Copy link

This merges the current OpenFAST dev branch, PR OpenFAST#213, PR OpenFAST#226, and some code cleanup into this pull request. I didn't touch the regression test baselines.

@rafmudaf I am trying to get a consistent code base to start bringing other linearization code from the NREL-Envision collaboration ready to send in another pull request. I was planning to start with this branch, but I just noticed that OpenFAST#344 also has linearization changes, so I may have to merge that in first, too. Let me know what you think.

alvarogonzalezsalcedo and others added 30 commits March 6, 2018 13:09
- tau_V was reset at n+1 before setting other states that required values at n.
- also removed some comments
this commit should affect spacing and comments only
   factor = (alpha_filt_cur - alpha0) * Kalpha_f     
   if (xd%tau_V(i,j) > T_VL .AND. (factor > 0)) then  
         ! The assertion is the T_V will always equal T_V0/2 when this condition is satisfied 
 
      becomes [note sign change and comment regarding value of sigma3, BUT: Code still needs a fix which is incomplete regarding the 2nd comment.  If you fall into that if block, then  we must continue to eliminate the vortex feed until we begin tracking another vortex, i.e., tau_V is reset to 0.0, this may mean the addition of a new flag.]
 
   if (xd%tau_V(i,j) > T_VL .AND. (Kalpha_f*dalpha0 < 0)) then ! .AND. (.not. LESF) 
         ! We no longer require that T_V will always equal T_V0/2 when this condition is satisfied as was the case in AD v13 GJH 7/20/2017 
         ! If we fall into this condition, we need to require we stay here until the current vortex is shed (i.e., tauV is reset to zero) 
      Cn_v = xd%Cn_v_minus1(i,j)*exp(-ds/T_V)   ! Eqn 1.52     
   else       
      Cn_v = Get_ExpEqn( ds, T_V, xd%Cn_v_minus1(i,j), C_V, xd%C_V_minus1(i,j) )   ! Eqn 1.47
Email dated July 28, 2017: From Greg Hayman/Rick Damiani to Envision Energy:

We changed the definition of VRTX:
 
was:  
    VRTX = (xd%tau_V(i,j) <= 2.0_ReKi*T_VL) .and. (xd%tau_V(i,j) > 0.0_ReKi) 
 now:
      ! Is the vortex over the chord?   
   VRTX = (xd%tau_V(i,j) > 0.0_ReKi) .and. (xd%tau_V(i,j) <= T_VL) 
 
Because of this change in the definition of VRTX all if tests related to VRTX have been changed:
    if ( VRTX .and. (xd%tau_V(i,j) <= T_VL) ) then  ! Still shedding a vortex? 
 becomes
    if ( VRTX ) then  ! Still shedding a vortex, i.e., the current vortex is still over the chord?
 and
    if ( VRTX .and. (xd%tau_V(i,j) <= T_VL) ) then
 becomes  [ NOTE This is part of a logic change in the sigma3 section, see below]
    else if ( VRTX ) then
1. fprimeprime_m wasn't initialized in UAMod 2, but was still used to compue cm_FS. I initialized to 0 until Alvaro can comment as to what it should be.
2. Df_c was changed to use T_fc instead of T_f, but T_fc was static when UAMod/=2 (it is based on a new state variable for UAMod==2). I modified the OtherState%sigma1c variable to be equal to the old %sigma1 to get the same results here.
- added ds to KC parameters so that we don't recalculate it in the update states routine.
-
His fix changes the calculation of DF_c.
This code came from GHayman in Feb 2018; I fixed some merge conflicts and some minor details. It compiles (with the exception of UA driver) and gives same results as before.

I did not add the AFI driver or move the AFI code into a separate source-code directory,
Any airfoils that use "default" interpolation will see different results.
BEMTU_Wind was calculating Re based on dynamic viscosity instead of kinematic viscosity as reported here: OpenFAST#71

Fixed the calculation and cleaned up calling routines that don't need the airDens variable anymore.
- These shouldn't cause errors if there are no input or output types in a module any more (-noextrap command isn't as critical now)
- AirfoilInfo module will have extrap-interp routines generated for Output Type and UA_BL_Type data structures.
- added `UserProp` input to AeroDyn for 2D airfoil interpolation (currently not implemented in OpenFAST driver)
- changed Registry so that it generates extrap-interp routines for AFI output type and UA_BL (parameter) types
- removed fitpack from build (was used only in previous code for 2D cubic splines, which are not used now)\
- fixed a bug that could cause a seg fault if the first airfoil contained coordinates, but other airfoil files did not contain the same number of coordinates.
- moved the small amount of code in `fmin_fcn.f90` to `mod_root1dim.f90` and deleted it.
- removed some unused variables
- moved checks on AirfoilInfo init input data from AeroDyn to AirfoilInfo (so other drivers can perform the same checks)
- moved checks on AirfoilInfo Unsteady Aero data to the UnsteadyAero module (so other drivers can perform the same checks)
- moved checks on UnsteadyAero input data to the UnsteadyAero module (so other drivers can perform the same checks)
- added `AFTabMod` to the AeroDyn input files
- fixed spelling of "Gonzalez" in a few places
- replaced `GetSteadyOutputs` with `AFI_ComputeAirfoilCoefs`, which basically does the same thing.
- replaced `ComputeSteadyAirfoilCoefs` with `AFI_ComputeAirfoilCoefs`, which basically does the same thing.
- modified arguments to `BEMTU_Wind`, and moved call to it inside `BEMTU_InductionWithResidual` (This routine computes `Re` with inductions set to zero.
  this assumption is now contained in one place, so we may be able to include that in the solve with Re-interpolated airfoil tables)
- Made inductions an optional output of the `BEMTU_InductionWithResidual` routine, then 
  replaced calls to `UncoupledErrFn` with it.
- replaced `AFI_GetAirfoilParams` with `AFI_ComputeAirfoilCoefs`
- removed condition that all airfoil tables must have the same number of alphas
- airfoilInfo interpolates on log of Reynolds number if 2D Reynolds number interpolation is requested
- changed some of the interpolation in AirfoilInfo, including required subroutine arguements. AFI takes care of calling appropriate subroutine for 
  desired interpolation method.
- removed compiler warnings of unused variables in auto-generated types files using vs-build debug mode
- removed unused variables
bjonkman and others added 26 commits July 19, 2019 09:46
Since there is a read and write in the same line, these do-loops shouldnt be optimization by the compiler. However, GNU Fortran version 8+ does optimize anyway leading to a seg fault.

This change removes the read-write operation in the same line by replacing the loops with a more explicit summation.
…n_segfault

AD14: Restructure loop to fix optimization bug
* Add cmake option to compile for simulink

* Changes to create_FAST_SFunc.m, FAST_SFunc.c, FAST_Library.f90, and FAST_Library.h to allow simulink integration

* Removing old code from FAST_Library.f90, and FAST_Library.h

* Fixed passing a bool to FAST_End in FAST_SFunc.c, and associated changes

* Changes in FAST_Library.f90 to revert StopTheProgram to a bool

* Some primary steps towards getting SysMatlab_Unix.f90 integrated for openfast printing to Matlab console

* More steps towards printing openfast output to simulink. Added FindMatlab.cmake

* Final changes to get openfast to print to matlab command window

* Make SysMatlab consistent with other Sys*.f90

* Rename SysMatlab_Unix -> SysMatlabLinux

This is consistent with the other Sys files like SysGnuLinux and allow for more clear and concise addons … like SysMatlabLinuxIntel and SysMatlabLinuxGnu

* Remove unecessary null char ending

* Add explicit support for Intel, error for GNU

* vs-build: add Simulink build + cleanup existing project configurations

- FAST_Registry has only release and debug versions (no need for double-precision or matlab versions of this)
- Registry always builds release win32 version (if you need to debug the registry, use its own solution file)
- MAP++ does not have double-precision versions anymore (is always compiled in double anyway)
- upgraded to C/C++ projects to use VS 2015 tools

* vs-build: fix link to file that was renamed somewhere upstream

* NWTC Library: SysMatlab

modified Windows version based on diff with SysIVF.f90
should just put compiler directives in SysIVF.f90 for simulink options

* NWTC Library: SysMatlab

modified Windows version based on diff with SysIVF.f90
should just put compiler directives in SysIVF.f90 for simulink options

* Cleaned up linking of Simulink interface

* vs build: added FAST_SFunc.c as a non-compiled file in the project

This allows us to view the file and search it, even though it gets compiled in Matlab separately.

* windows vs-build bug fix: git version number on shallow clones

* vs-build: removed target SDK version

* Simulink build: added some comments

* vs-build: added COMPILE_SIMULINK preprocessor directive to FASTlib

* Fixed some uninitialized variables in FAST_Library

They aren't used (yet?), but still shouldn't be uninitialized.

* Clean up the sfunc creation function

* Correct a function call typo

* Call SimStatus with Simulink

* Attempt to make create_FAST_SFunc.m work for both cmake and vs-build

The previous version from NREL didn't work with any Windows builds

* update path names for s-func to work with last merge
* FlexSub: starting clean up

* FlexSub: starting clean up of main

* FlexSub: additional clean up of main

* FlexSub: done cleanup of main

* FlexSub: Replacing Abort with Fatal to avoid clash with Intel extension

* FlexSub: Added error message for unfinished routine

* FlexSub: Changed all format comparisons (le lt ge gt)
- intent on extrap/interp routines is IN instead of INOUT where there are no meshes in the data type (from Registry change)
- changes to aerodyn data structures
* removed SOLVE_OPTION_1_BEFORE_2 preprocessor directive

* Reworked AdvanceStates and SolveOption2 algorithm

Parts of the SolveOption2 algorithm have been moved to the the AdvanceStates routine so that BeamDyn, InflowWInd, AeroDyn, and ServoDyn use calculated inputs instead of extrapolations for inputs at t+dt. 

This change allows BeamDyn to use calculate rotations and AeroDyn/DBEMT to use calculated velocities, which otherwise would require a correction step. In DBEMT this was a problem with high turbulence and low wind speeds.

* fixed issue for outputting ED mass matrix with preprocessor directive

* HD: remove non-standard tab formatting

* Remove linearization case files from mamual reg test

* Increase the default stack size on Windows

* Update reg test baselines
* Add a github actions workflow

* Enable Actions on all branches
…ST#341)

* Formatting and content updates

* Improve the git workflow description

* Restructure the developer docs sections

* Consolidate and improve the installation docs

* Cleanup acknowledgements

* Improve the testing documentation

* Update the README and add GA tracking

* Add rtfd config file

And bug fixes when warnings are treated as failures

* Enable Doxygen for readthedocs

* Update link to download the latest binaries

* Minor bug fixes

* Improve the regression testing docs

* TravisCI: update macos image to 10.14

* Add CygWin installation instructions as appendix

* Move bolded nonsections to subsections

* Describe some CMake options

* Remove redundancies and update the intro

* Clean up and updates to the testing docs

* Update CMake flags and minor formatting fixes

Mostly converts lists to tables

* Clean up in the developer docs

* Change references to Mac to macOS
- Remove override of default C++ include paths. Source-file directories are included by default, so they don't need to be explicitly specified
- Remove link to (non-existent) WinSock2.h file in the vs-build directory; this should be found in the Windows SDK instead
@HaymanConsulting HaymanConsulting merged commit eeba9d8 into HaymanConsulting:f/FloatingLin Dec 1, 2019
HaymanConsulting pushed a commit that referenced this pull request Aug 3, 2020
HaymanConsulting pushed a commit that referenced this pull request Aug 3, 2020
f/Linear -- documentation updates for nodal outputs
HaymanConsulting pushed a commit that referenced this pull request Jun 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants