Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,8 @@ default VTK_fps - Frame rate for VTK output (frames per second) {"all
0 nGridOut - Number of grid outputs
GridName GridType TStart TEnd DTGrid XStart XEnd nX YStart YEnd nY ZStart ZEnd nZ
(-) (-) (s) (s) (s) (m) (m) (-) (m) (m) (-) (m) (m) (-)
------------------------------------------------------------------------------------------------
===============================================================================================
--------------------------- ADVANCED OPTIONS --------------------------------------------------
===============================================================================================
! Advanced options may be placed here in arbitrary order, with the regular format:
! Value Key - Comment
112 changes: 112 additions & 0 deletions docs/source/user/aerodyn-olaf/InputFiles.rst
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,118 @@ of a box of shape 5x20x30 and dimension 1200x300x295. The grid contains both th
The two other grids are vertical and horizontal planes containing only the velocity.


Advanced Options
~~~~~~~~~~~~~~~~


Advanced options (typically used for developers or beta features) can be placed at the end of the OLAF input file:


- These options use the regular format: `Value Key - Comment`.
- They can be placed in arbitrary order.
- They can be commented out with a `!` character at the beginning of the line.
- Blank lines or unsupported options are ignored (display to screen).
- If not provided their default value is being used, but the keyword "default" is not available.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reword this bullet:

  • If not provided, a default value will be used, but the "DEFAULT" keyword is not supported for the advanced options.

- We recall that these are **beta features** and should mostly be used by developers.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggest deleting this bullet or at least delete "we recall that".



The end of the OLAF input file would look as follows:

.. code::

[...]
GridName GridType TStart TEnd DTGrid XStart XEnd nX YStart YEnd nY ZStart ZEnd nZ
(-) (-) (s) (s) (s) (m) (m) (-) (m) (m) (-) (m) (m) (-)
===============================================================================================
--------------------------- ADVANCED OPTIONS --------------------------------------------------
===============================================================================================
! Advanced options may be placed here in arbitrary order, with the regular format:
! Value1 Key1 - Comment1
! Value2 Key2 - Comment2
! Lines starting with `!` are ignored, empty lines are ignored
[...] etc

Currently, the advanced options supported as as follows:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change "as as" to "are as"


.. code::

===============================================================================================
--------------------------- ADVANCED OPTIONS --------------------------------------------------
===============================================================================================
"Panels.vtk" SrcPnlFile - Name of VTK file containing source panels {default: ""}
1 nSrcPnlUpdate - How often do src panel updates (in time steps of OLAF), {default: 1}
True Induction - Compute induction, {default: True}
True InductionAtCP - Compute induced velocities at nodes or CP, {default: True}
True WakeAtTE - Start the wake at the trailing edge, or at the LL, {default: True}
False DStallOnWake - Dynamic stall has influence on wake, {default: False}
0.75 kFrozenNWStart - Fraction of wake induced velocity at start of frozen wake, {default: 0.75}
0.5 kFrozenNWEnd - Fraction of wake induced velocity at end of frozen wake, {default: 0.5}
0.0 zGround - Ground height {default: 0.0}
0.1 zGroundPush - Ground push back {default: 0.1}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure how these options are sorted, but they are not alphabetical or sorted by topic. Suggest sorting in terms of their functionality, e.g., lifting line or source panel or ....




**SrcPanlFile** [string] specifies the name of the VTK file used for the source panel method.
The VTK file should be a legacy ASCII VTK file, with DATASET POLYDATA POINTS and POLYGONS.
A sample VTK file is provided below for two panels forming a regular grid in the XY plane.
The connectivity of the polygons needs to be such that the normal points away from the body and
into the fluid. In the example below, the normals are in the z direction which would be typical
for a bottom wall with fluid above.
When use **WrVTK**, OLAF will write separate VTK files containing various information related to the source panels, such as the pressure coefficient, area, force per area, normals. Looking at the orientation of the normals is extremely important (In Paraview, select 3D Glyph, Arrows, and select the `Normals` output, scaled by the `Normals`).
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change "when use" to "when using".

The BodyID CELL_DATA can be used to separate different patches, which can help the post processing. This is optional, OLAF doesn't use it currently, but it is written back in the output files of OLAF.

Curious readers may look at the unittest `Test_SrcPnl_Sphere` of OLAF that test the pressure coefficient
about a sphere.

.. code::

# vtk DataFile Version 2.0
Comment
ASCII
DATASET POLYDATA
POINTS 6 double
0.0 0.0 0.0
0.0 25.0 0.0
0.0 50.0 0.0
10.0 0.0 0.0
10.0 25.0 0.0
10.0 50.0 0.0

POLYGONS 2 10
4 0 1 4 3
4 1 2 5 4
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These polygons are defined clockwise when viewed from above. Wouldn't that mean (following the right-hand rule) that the normal vector points towards -z?


CELL_DATA 2
SCALARS BodyID int
LOOKUP_TABLE default
0
0



**nSrcPnlUpdate** [int] Define how often the source panel updates (in time steps of OLAF), the default is `1`, at each time step.

**Induction** [switch] Compute induced velocities, otherwise all induced velocity are 0 (no wake, no panels, etc) ! Default is `True`.

**InductionAtCP** [switch] When performing the lifting line calculations, compute induced velocities at nodes (False) or at control points (CP, True). Default is `True`.

**WakeAtTE** [switch] Start the wake at the trailing edge (True), or directly at the LL (False, no chordwise panel). Default is `True`.

**DStallOnWake** [switch] Include the influence of the dynamic stall on the wake (True), i.e. use the dynamic Cl to update the circulation of the lifting line and wake panel. Default is `False`.

**kFrozenNWStart** [float] Fraction of wake induced velocity at start of frozen wake, default is `0.75`. See OLAF theory related to Frozen NW, :numref:`sec:vortconvfrozen`.

**kFrozenNWEnd** [float] Fraction of wake induced velocity at end of frozen wake, default is `0.5`. See OLAF theory related to Frozen NW, :numref:`sec:vortconvfrozen`.

**zGround** [float] Height below which vortex points are not allowed to be and if any are present they will be pushed back above the ground at the height defined by **zGroundPush**. Default is `0.0`.
For MHK, the sea bed location, based on the water depth is added to **zGround**.

**zGroundPush** [float] Ground push back, see **zGround**. Default is `0.1`.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does zGroundPush have the units of meters?






AeroDyn Input File
--------------------
Input file modifications
Expand Down
35 changes: 26 additions & 9 deletions modules/aerodyn/src/AeroDyn.f90
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,12 @@ subroutine AD_Init( InitInp, u, p, x, xd, z, OtherState, y, m, Interval, InitOut


! set the rest of the parameters
p%Skew_Mod = InputFileData%Skew_Mod
! NOTE: some parameters need to be set even if no rotors
p%Skew_Mod = InputFileData%Skew_Mod
p%UA_Flag = InputFileData%UA_Init%UAMod > UA_None
p%CompAeroMaps = InitInp%CompAeroMaps
p%DT = InputFileData%DTAero
p%Wake_Mod = InputFileData%Wake_Mod
do iR = 1, nRotors
p%rotors(iR)%AeroProjMod = AeroProjMod(iR)
call WrScr(' AeroDyn: projMod: '//trim(num2lstr(p%rotors(iR)%AeroProjMod)))
Expand Down Expand Up @@ -1444,9 +1449,8 @@ subroutine SetParameters( InitInp, InputFileData, RotData, p, p_AD, ErrStat, Err

p%MHK = InitInp%MHK

p_AD%DT = InputFileData%DTAero
p_AD%Wake_Mod = InputFileData%Wake_Mod
p%DBEMT_Mod = InputFileData%DBEMT_Mod

p%TwrPotent = InputFileData%TwrPotent
p%TwrShadow = InputFileData%TwrShadow
p%TwrAero = InputFileData%TwrAero
Expand Down Expand Up @@ -1736,9 +1740,11 @@ subroutine AD_End( u, p, x, xd, z, OtherState, y, m, ErrStat, ErrMsg )
if (p%Wake_Mod == WakeMod_FVW ) then

if ( p%UA_Flag ) then
do iW=1,p%FVW%nWings
call UA_End(m%FVW%W(iW)%p_UA)
enddo
if (allocated(m%FVW%W)) then
do iW=1,p%FVW%nWings
call UA_End(m%FVW%W(iW)%p_UA)
enddo
endif
end if

call FVW_End( m%FVW_u, p%FVW, x%FVW, xd%FVW, z%FVW, OtherState%FVW, m%FVW_y, m%FVW, ErrStat, ErrMsg )
Expand Down Expand Up @@ -5096,11 +5102,25 @@ SUBROUTINE Init_OLAF( InputFileData, u_AD, u, p, x, xd, z, OtherState, m, ErrSta
allocate(InitInp%W(nWings) , STAT = ErrStat2); ErrMsg2='Allocate W'; if(Failed()) return
allocate(InitInp%WingsMesh(nWings), STAT = ErrStat2); ErrMsg2='Allocate Wings Mesh'; if(Failed()) return

! --- Default inputs (not per retor)
! UA and inputs that are not per rotor
InitInp%UA_Flag = p%UA_Flag
! Important inputs if no rotors are present!
if (size(p%rotors)==0) then
InitInp%numBladeNodes = 0
InitInp%AirDens = InputFileData%AirDens
InitInp%KinVisc = InputFileData%KinVisc
InitInp%MHK = 0 ! TODO this is an initinp of AeroDyn
InitInp%WtrDpth = 0.0_ReKi ! TODO this is an initinp of AeroDyn
InitInp%RootName = p%RootName(1:len_trim(p%RootName)-2) ! Removing "AD"
endif

! --- Inputs per wings/blades
iW_incr=0
do iR=1, size(p%rotors)

InitInp%numBladeNodes = p%rotors(iR)%numBlNds ! TODO TODO TODO per wing
InitInp%AirDens = p%rotors(iR)%AirDens
InitInp%KinVisc = p%rotors(iR)%KinVisc
InitInp%MHK = p%rotors(iR)%MHK
InitInp%WtrDpth = p%rotors(iR)%WtrDpth
Expand Down Expand Up @@ -5163,9 +5183,6 @@ SUBROUTINE Init_OLAF( InputFileData, u_AD, u, p, x, xd, z, OtherState, m, ErrSta
if(Failed()) return

enddo ! iB, blades

! Unsteady Aero Data
InitInp%UA_Flag = p%UA_Flag
call UA_CopyInitInput(InputFileData%UA_Init, InitInp%UA_Init, MESH_NEWCOPY, ErrStat2, ErrMsg2)

iW_incr = iW_incr+p%rotors(iR)%numBlades
Expand Down
27 changes: 19 additions & 8 deletions modules/aerodyn/src/AeroDyn_Driver_Subs.f90
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,7 @@ subroutine Init_ADI_ForDriver(iCase, ADI, dvr, FED, dt, needInitIW, errStat, err
InitInp%AD%defPvap = dvr%Pvap
InitInp%AD%WtrDpth = dvr%WtrDpth
InitInp%AD%MSL2SWL = dvr%MSL2SWL
InitInp%AD%CompSeaSt = dvr%SS_InitInp%CompSeaSt
InitInp%AD%CompSeaSt = dvr%SS_InitInp%CompSeaSt /=0
! Init data per rotor
allocate(InitInp%AD%rotors(dvr%numTurbines), stat=errStat)
if (errStat/=0) then
Expand Down Expand Up @@ -1037,7 +1037,7 @@ subroutine Dvr_ReadInputFile(fileName, dvr, errStat, errMsg )
call ParseCom(FileInfo_In, CurLine, Line, errStat2, errMsg2, unEc); if (Failed()) return
call ParseVar(FileInfo_In, CurLine, "compInflow", dvr%IW_InitInp%compInflow , errStat2, errMsg2, unEc); if (Failed()) return
call ParseVar(FileInfo_In, CurLine, "InflowFile", dvr%IW_InitInp%InputFile, errStat2, errMsg2, unEc, IsPath=.true.); if (Failed()) return
if (dvr%IW_InitInp%compInflow==0) then
if (dvr%IW_InitInp%compInflow/=1) then
call ParseVar(FileInfo_In, CurLine, "HWindSpeed", dvr%IW_InitInp%HWindSpeed , errStat2, errMsg2, unEc); if (Failed()) return
call ParseVar(FileInfo_In, CurLine, "RefHt" , dvr%IW_InitInp%RefHt , errStat2, errMsg2, unEc); if (Failed()) return
call ParseVar(FileInfo_In, CurLine, "PLExp" , dvr%IW_InitInp%PLExp , errStat2, errMsg2, unEc); if (Failed()) return
Expand Down Expand Up @@ -1543,6 +1543,9 @@ subroutine Dvr_InitializeOutputs(nWT, out, numSteps, errStat, errMsg)
end do ! i
write (out%unOutFile(iWT),'()')
enddo
if (nWT==0) then
! Special case, no turbine, TODO
endif
endif

! --- Binary
Expand Down Expand Up @@ -1744,7 +1747,11 @@ subroutine Dvr_WriteOutputs(nt, t, dvr, out, yADI, SeaSt, errStat, errMsg)
END IF

! Packing all outputs excpet time into one array
nAD = size(yADI%AD%rotors(1)%WriteOutput)
if (size(yADI%AD%rotors)>=1) then
nAD = size(yADI%AD%rotors(1)%WriteOutput)
else
nAD = 0
endif
nIW = size(yADI%IW_WriteOutput)
nSS = size(SeaSt%y%WriteOutput)
nDV = out%nDvrOutputs
Expand Down Expand Up @@ -1872,11 +1879,15 @@ subroutine setVTKParameters(DVR_Outs, dvr, ADI, errStat, errMsg, dirname)
! Get radius for ground (blade length + hub radius):
GroundRad = MaxBladeLength + MaxTwrLength+ DVR_Outs%VTKHubRad
! write the ground or seabed reference polygon:
RefPoint(1:2) = dvr%WT(1)%originInit(1:2)
do iWT=2,dvr%numTurbines
RefPoint(1:2) = RefPoint(1:2) + dvr%WT(iWT)%originInit(1:2)
end do
RefPoint(1:2) = RefPoint(1:2) / dvr%numTurbines
if (dvr%numTurbines>0) then
RefPoint(1:2) = dvr%WT(1)%originInit(1:2)
do iWT=2,dvr%numTurbines
RefPoint(1:2) = RefPoint(1:2) + dvr%WT(iWT)%originInit(1:2)
end do
RefPoint(1:2) = RefPoint(1:2) / dvr%numTurbines
else
RefPoint(1:3) = 0.0_ReKi
endif

RefPoint(3) = 0.0_ReKi
RefLengths = GroundRad + sqrt((WorldBoxMax(1)-WorldBoxMin(1))**2 + (WorldBoxMax(2)-WorldBoxMin(2))**2)
Expand Down
47 changes: 29 additions & 18 deletions modules/aerodyn/src/AeroDyn_Inflow.f90
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,18 @@ subroutine ADI_Init(InitInp, u, p, x, xd, z, OtherState, y, m, Interval, InitOut
InitOut%Ver = InitOut_AD%ver
! Add writeoutput units and headers to driver, same for all cases and rotors!
!TODO: this header is too short if we add more rotors. Should also add a rotor identifier
call concatOutputHeaders(InitOut%WriteOutputHdr, InitOut%WriteOutputUnt, InitOut_AD%rotors(1)%WriteOutputHdr, InitOut_AD%rotors(1)%WriteOutputUnt, errStat2, errMsg2); if(Failed()) return
if (size(InitOut_AD%rotors)>=1) then
call concatOutputHeaders(InitOut%WriteOutputHdr, InitOut%WriteOutputUnt, InitOut_AD%rotors(1)%WriteOutputHdr, InitOut_AD%rotors(1)%WriteOutputUnt, errStat2, errMsg2); if(Failed()) return
endif

! --- Initialize grouped outputs
!TODO: assumes one rotor
p%NumOuts = p%AD%rotors(1)%NumOuts + p%AD%rotors(1)%BldNd_TotNumOuts + m%IW%p%NumOuts
call AllocAry(y%WriteOutput, p%NumOuts, 'WriteOutput', errStat2, errMsg2); if (Failed()) return
if (size(InitOut_AD%rotors)>=1) then
!TODO: assumes one rotor
p%NumOuts = p%AD%rotors(1)%NumOuts + p%AD%rotors(1)%BldNd_TotNumOuts + m%IW%p%NumOuts
call AllocAry(y%WriteOutput, p%NumOuts, 'WriteOutput', errStat2, errMsg2); if (Failed()) return
else
p%NumOuts = m%IW%p%NumOuts
endif

! --- Initialize outputs
call AllocAry(y%IW_WriteOutput, size(m%IW%y%WriteOutput),'IW_WriteOutput', errStat2, errMsg2); if(Failed()) return
Expand Down Expand Up @@ -298,21 +304,26 @@ subroutine ADI_CalcOutput(t, u, p, x, xd, z, OtherState, y, m, errStat, errMsg)
y%PLExp = m%IW%PLExp

! --- Set outputs
!TODO: this assumes one rotor!!!
associate(AD_NumOuts => p%AD%rotors(1)%NumOuts + p%AD%rotors(1)%BldNd_TotNumOuts, &
IW_NumOuts => m%IW%p%NumOuts)
y%WriteOutput(1:IW_NumOuts) = y%IW_WriteOutput(1:IW_NumOuts)
y%WriteOutput(IW_NumOuts+1:p%NumOuts) = y%AD%rotors(1)%WriteOutput(1:AD_NumOuts)
end associate

!----------------------------------------------------------------------------
! Store hub height velocity calculated in CalcOutput
!----------------------------------------------------------------------------
if (size(p%AD%rotors)>=1) then
!TODO: this assumes one rotor!!!
associate(AD_NumOuts => p%AD%rotors(1)%NumOuts + p%AD%rotors(1)%BldNd_TotNumOuts, &
IW_NumOuts => m%IW%p%NumOuts)
y%WriteOutput(1:IW_NumOuts) = y%IW_WriteOutput(1:IW_NumOuts)
y%WriteOutput(IW_NumOuts+1:p%NumOuts) = y%AD%rotors(1)%WriteOutput(1:AD_NumOuts)
end associate

!----------------------------------------------------------------------------
! Store hub height velocity calculated in CalcOutput
!----------------------------------------------------------------------------

if (p%storeHHVel) then
do iWT = 1, size(u%AD%rotors)
y%HHVel(:,iWT) = m%AD%Inflow(1)%RotInflow(iWT)%InflowOnHub(:,1)
end do
endif

if (p%storeHHVel) then
do iWT = 1, size(u%AD%rotors)
y%HHVel(:,iWT) = m%AD%Inflow(1)%RotInflow(iWT)%InflowOnHub(:,1)
end do
else
y%WriteOutput(1:p%NumOuts) = y%IW_WriteOutput(1:m%IW%p%NumOuts)
endif

contains
Expand Down
Loading