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

The Renolds number not calculated correctly in BEMTUncoupled.f90 #71

Closed
gerwangcy opened this issue Nov 22, 2017 · 1 comment
Closed

Comments

@gerwangcy
Copy link

Dear developers,

I find an error regarding the Renolds number calculation in the file:
modules-local/aerodyn/src/BEMTUncoupled.f90, line 96, which is:
Re = airDens * W * chord / mu
It seems to be problematic, because the variable 'mu' here is actually the kinematic viscosity, rather than the dynamic viscosity. This line is within the subroutine:
subroutine BEMTU_Wind( axInduction, tanInduction, Vx, Vy, chord, airDens, mu, W, Re )
which is called by many other functions, an example is in the file:
modules-local/aerodyn/src/BEMT.f90, line 977, which is:
call BEMTU_Wind( 0.0_ReKi, 0.0_ReKi, u1%Vx(i,j), u1%Vy(i,j), p%chord(i,j), p%airDens, p%kinVisc, Vrel, Re )
The seventh argument is kinematic viscosity instead of dynamic viscosity! It is true for other calls of the function. The easiest way to correct may be just to replace the line 96 of BEMTUncoupled.f90 with:
Re = W * chord / mu

It is also the case for fastv8 repository. I hope this could help. Thanks.

Best,
Chengyu Wang

bjonkman added a commit to bjonkman/openfast that referenced this issue Oct 18, 2018
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.
bjonkman added a commit to bjonkman/openfast that referenced this issue Oct 18, 2018
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.
@rafmudaf
Copy link
Collaborator

rafmudaf commented Nov 1, 2018

Fixed by #195

@rafmudaf rafmudaf closed this as completed Nov 1, 2018
ashesh2512 pushed a commit to ashesh2512/openfast that referenced this issue Mar 21, 2019
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.
rafmudaf pushed a commit that referenced this issue Dec 3, 2019
* AD: updated AFI module with 2D interp code

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,

* AFI: change default interpolation to linear

Any airfoils that use "default" interpolation will see different results.

* AD big fix: calculation of Re

BEMTU_Wind was calculating Re based on dynamic viscosity instead of kinematic viscosity as reported here: #71

Fixed the calculation and cleaned up calling routines that don't need the airDens variable anymore.

* Registry: modified auto-generated ExtrapInterp routines for AFI

- 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.

* AeroDyn updates for 2D airfoil interpolation

- 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

* Updated example input files in documentation

* updated documentation for AD/Airfoils

* updated comment in example airfoil file

default interpolation order is now 1

* fixed format in SysGnuWin.f90

* rename files that git thinks were deleted (not renamed) on nrel/dev

* Update auto-generated types files

- 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

* fix syntax in UnsteadyAero.vfproj file

* Update pointer to r-test for updated comments on InterpOrd

* Airfoil-interp PR: Update r-test for new baseline

Also removed precompilier directive for SPLINE_INTERP now that we are satisfied with r-test baseline results using linear interp of airfoils in AD15

* Update Git hash for r-test

* Bug fixes in Dockerfiles
rafmudaf added a commit that referenced this issue Dec 29, 2019
* Update of Unsteady Aero model UAMod=2, corrections and added parameters

* UA bug fix: xd%tau_V was updated too early

- tau_V was reset at n+1 before setting other states that required values at n.
- also removed some comments

* UA: updated comments

this commit should affect spacing and comments only

* UA: fix condition around vortex shedding - incomplete?

   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

* UA: Changed definition of VRTX

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

* UA bug fixes from merge of Alvaro's code

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.

* UA: cleaned up some logic and removed non-standard tab formatting

* UA: Removed comment that doesn't seem to apply

* UA: removed unused variables

* UA: reverted some code I had changed from Alvaro

His fix changes the calculation of DF_c.

* UA: Fixed definition of fprimeprime_m from bad merge

* Some proposed corrections to merge the UA model Gonzalez with the Envision changes

* AD: updated AFI module with 2D interp code

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,

* AFI: change default interpolation to linear

Any airfoils that use "default" interpolation will see different results.

* AD big fix: calculation of Re

BEMTU_Wind was calculating Re based on dynamic viscosity instead of kinematic viscosity as reported here: #71

Fixed the calculation and cleaned up calling routines that don't need the airDens variable anymore.

* Registry: modified auto-generated ExtrapInterp routines for AFI

- 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.

* AeroDyn updates for 2D airfoil interpolation

- 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

* Updated example input files in documentation

* updated documentation for AD/Airfoils

* fix typos; replace 1.44 with already-defined parameter

* updated comment in example airfoil file

default interpolation order is now 1

* UA: updated calculation of Cn_FS for UAmod = 3

also updated some numerics to account for periodicity in differences of angles

* fixed format in SysGnuWin.f90

* rename files that git thinks were deleted (not renamed) on nrel/dev

* Update auto-generated types files

- 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

* updated types files

* UA: add (unnecessary) initialization to avoid compiler warning

* Update baselines

Co-authored-by: alvarogonzalezsalcedo <35765400+alvarogonzalezsalcedo@users.noreply.github.com>
Co-authored-by: Rafael M Mudafort <rafmudaf@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants