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

Linearization with AD15 and IfW #2014

Merged
Show file tree
Hide file tree
Changes from 64 commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
f4fdd1a
IfW: first cut at changing linearization
andrew-platt Nov 27, 2023
634f584
AD: compactify some linearization routines
andrew-platt Dec 4, 2023
6b0742e
AD15 lin: update Init_Jacobian_u routine for new input list
andrew-platt Dec 7, 2023
305fd6f
AD15 lin: update Perturb_u routine for new input list
andrew-platt Dec 7, 2023
0bc1e7b
AD15 lin: revise linearization routines to include new inputs / outputs
andrew-platt Dec 7, 2023
5435215
Whitespace adjustment in FAST_Subs.f90 and FAST_Lin.f90
andrew-platt Dec 7, 2023
af97047
Lin: Compactify the FAST_Lin::AllocateOP routine
andrew-platt Dec 7, 2023
34add6f
AD15 lin: remove inputs/outputs from IfW that don't exist anymore
andrew-platt Dec 7, 2023
f4cf2b1
AD15 lin: add index tracking for start of meshes in Jac_u
andrew-platt Dec 8, 2023
8eb11b7
Lin: temp commit
andrew-platt Dec 8, 2023
16722e8
ED: add tailfin to linearization
andrew-platt Dec 20, 2023
e265cb0
Lin: add tailfin indexing routine to linearization
andrew-platt Jan 19, 2024
71bcc5f
AD14: re-enable missing IfW data transfers
andrew-platt Jan 22, 2024
f0e1d89
Lin: add Tailfin to ED and FAST_Lin
andrew-platt Jan 24, 2024
617c39e
Lin: fix indexing in AD15 lin, and add access to IfW OP
andrew-platt Jan 29, 2024
fd168cb
FAST_Subs: reorder initialization
andrew-platt Jan 29, 2024
ea3a2c1
Pass pointer into AD15 during init.
andrew-platt Jan 29, 2024
1a54ccd
AD15 lin: add perturbing the uniform flow field
andrew-platt Jan 30, 2024
aa913d4
Update AeroMaps to use pointers to wind data
andrew-platt Jan 30, 2024
7dda744
Add 5MW_Land_BD_Linear_Aero regression test
andrew-platt Jan 30, 2024
3ece557
Fix IfW y_op -- missing the extended outputs
andrew-platt Jan 30, 2024
0945386
Lin: reorder AD u, correct error on fields
andrew-platt Jan 31, 2024
4288bd5
FAST_Lin: add field codes to Assemble_dUdy_Motions
andrew-platt Jan 31, 2024
7592b51
Lin: correct indexing, add nacelle and hub (broken)
andrew-platt Jan 31, 2024
6aa7e47
Lin: fix segfaults with hub and nacelle in linearization
andrew-platt Feb 5, 2024
20dbba5
Lin: restructure ED ED_Perturb_u for readability
andrew-platt Feb 5, 2024
ecac749
Lin: add indexing to AD15 for y linearization vars
andrew-platt Feb 6, 2024
7388143
RegTest: add output files for linearization frequencies
andrew-platt Feb 6, 2024
9daf987
Merge branch 'dev-unstable-pointers' into f/AD15_IfW_Linearization
andrew-platt Feb 7, 2024
7bf681b
Lin: add MD regression test based on the 5MW_OC4Semi_Linear with MAP
andrew-platt Feb 12, 2024
5a484ad
Merge remote-tracking branch 'OpenFAST/dev-unstable-pointers' into f/…
andrew-platt Feb 20, 2024
f611025
Lin: fix indexing in dUdy if missing mesh field in destination
andrew-platt Feb 21, 2024
8f3a11a
AD Lin: use perturbed extended inputs
andrew-platt Feb 22, 2024
b11358e
Perturb ShrV instead of LinShrV in IfW_UniformWind_Perturb
deslaughter Feb 22, 2024
d8feecc
Uncomment CopyRotInflowType, always call AD_CalcWind_Rotor for when n…
deslaughter Feb 22, 2024
8fec282
Fix MD_perturb_x indexing to get correct dx
deslaughter Feb 23, 2024
7fef8a9
Lin: add input/output indexing to ED linearization parameters
andrew-platt Feb 24, 2024
6f623bf
Lin: update reg. tests for fixes in MD dXdu and ShrV
andrew-platt Feb 26, 2024
2330b46
Lin: fix indexing in Assemble_dUdy_Motions when missing fields in y (…
andrew-platt Feb 27, 2024
3ef2b88
Lin: Fix AD_Out blade start index for BD loads input
andrew-platt Feb 27, 2024
280f192
Lin: BD linearization start index transfer to AD motions was incorrect
andrew-platt Feb 28, 2024
c9c100c
Merge remote-tracking branch 'OpenFAST/rc-3.5.3' into f/AD15_IfW_Line…
andrew-platt Feb 29, 2024
7a74826
Merge remote-tracking branch 'origin/f/AD15_IfW_Linearization' into f…
andrew-platt Mar 4, 2024
1e454db
Merge remote-tracking branch 'OpenFAST/rc-3.5.3' into f/AD15_IfW_Line…
andrew-platt Mar 4, 2024
72fb9fa
Update lin tests after merging BD updates
andrew-platt Mar 4, 2024
80e9994
AD: missing StartNode (for ExtInflow) handling
andrew-platt Mar 4, 2024
ba87c0b
AD: fix recursive error handling
andrew-platt Mar 4, 2024
b91e61e
AD FVW: MHK flag was improperly handled for getting FVW velocities
andrew-platt Mar 4, 2024
d4b3289
Lin reg-tests: change tolerances in comparisons
andrew-platt Mar 5, 2024
4a9286e
SeaState: add params for ConstWaveMod
andrew-platt Mar 11, 2024
570ef71
SeaState: remove dependency of _Output.f90 on VersionInfo
andrew-platt Mar 11, 2024
89d511f
Merge remote-tracking branch 'OpenFAST/dev-unstable-pointers' into f/…
andrew-platt Apr 1, 2024
00791cd
Merge remote-tracking branch 'OpenFAST/dev-unstable-pointers' into f/…
andrew-platt Apr 22, 2024
45397b0
Merge remote-tracking branch 'origin/f/AD15_IfW_dataAccess' into f/AD…
andrew-platt Apr 22, 2024
815d331
Update 5MW BD linear cases for ChangeRefFrame=.false.
andrew-platt Apr 22, 2024
877d206
GH action: set 5MW_OC3Mnpl_DLL_WTurb_WavesIrr sequential
andrew-platt Apr 22, 2024
9c7cc77
IfW: get hub position (used in AD14)
andrew-platt Apr 24, 2024
570f7c2
AD15: typos in AD15 registry comments
andrew-platt Apr 25, 2024
9f1bb14
AD15: registry -- use IntKi instead of Integer
andrew-platt Apr 25, 2024
6af45dc
SeaSt: remove some unnecessary whitespace
andrew-platt Apr 25, 2024
6c37179
Lin: add linearization routines to SeaSt
andrew-platt Apr 26, 2024
2087e77
Lin: update extended inputs to HD
andrew-platt Apr 26, 2024
bd880b0
Lin: add SeaState to linearization (extended in/outs only)
andrew-platt Apr 26, 2024
8d18d2f
SeaSt: update linearization reg tests for extended outs
andrew-platt Apr 29, 2024
3085c7b
Merge remote-tracking branch 'OpenFAST/dev-unstable-pointers' into f/…
andrew-platt May 9, 2024
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
2 changes: 1 addition & 1 deletion .github/workflows/automated-dev-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -774,7 +774,7 @@ jobs:
- name: Run 5MW tests
working-directory: ${{runner.workspace}}/openfast/build
run: |
ctest -VV -L openfast -LE "cpp|linear|python" -R 5MW_OC3Mnpl_DLL_WTurb_WavesIrr
ctest -VV -L openfast -LE "cpp|linear|python" -j1 -R 5MW_OC3Mnpl_DLL_WTurb_WavesIrr
- name: Failing test artifacts
uses: actions/upload-artifact@v4
if: failure()
Expand Down
1,835 changes: 876 additions & 959 deletions modules/aerodyn/src/AeroDyn.f90

Large diffs are not rendered by default.

24 changes: 13 additions & 11 deletions modules/aerodyn/src/AeroDyn_Inflow.f90
Original file line number Diff line number Diff line change
Expand Up @@ -62,30 +62,32 @@ subroutine ADI_Init(InitInp, u, p, x, xd, z, OtherState, y, m, Interval, InitOut
! Display the module information
call DispNVD( ADI_Ver )

! Clear writeoutputs
if (allocated(InitOut%WriteOutputHdr)) deallocate(InitOut%WriteOutputHdr)
if (allocated(InitOut%WriteOutputUnt)) deallocate(InitOut%WriteOutputUnt)

! Set parameters
p%dt = interval
p%storeHHVel = InitInp%storeHHVel
p%WrVTK = InitInp%WrVTK
p%MHK = InitInp%AD%MHK
p%WtrDpth = InitInp%AD%WtrDpth

! --- Initialize Inflow Wind
call ADI_InitInflowWind(InitInp%RootName, InitInp%IW_InitInp, u%AD, OtherState%AD, m%IW, Interval, InitOut_IW, errStat2, errMsg2); if (Failed()) return
! Concatenate AD outputs to IW outputs
call concatOutputHeaders(InitOut%WriteOutputHdr, InitOut%WriteOutputUnt, InitOut_IW%WriteOutputHdr, InitOut_IW%WriteOutputUnt, errStat2, errMsg2); if(Failed()) return

! --- Initialize AeroDyn
if (allocated(InitOut%WriteOutputHdr)) deallocate(InitOut%WriteOutputHdr)
if (allocated(InitOut%WriteOutputUnt)) deallocate(InitOut%WriteOutputUnt)
! Link InflowWind's FlowField to AeroDyn's FlowField
InitInp%AD%FlowField => InitOut_IW%FlowField

call AD_Init(InitInp%AD, u%AD, p%AD, x%AD, xd%AD, z%AD, OtherState%AD, y%AD, m%AD, Interval, InitOut_AD, errStat2, errMsg2); if (Failed()) return
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

! --- Initialize Inflow Wind
call ADI_InitInflowWind(InitInp%RootName, InitInp%IW_InitInp, u%AD, OtherState%AD, m%IW, Interval, InitOut_IW, errStat2, errMsg2); if (Failed()) return
! Concatenate AD outputs to IW outputs
call concatOutputHeaders(InitOut%WriteOutputHdr, InitOut%WriteOutputUnt, InitOut_IW%WriteOutputHdr, InitOut_IW%WriteOutputUnt, errStat2, errMsg2); if(Failed()) return
! Link InflowWind's FlowField to AeroDyn's FlowField
p%AD%FlowField => InitOut_IW%FlowField

! --- Initialize grouped outputs
!TODO: assumes one rotor
p%NumOuts = p%AD%rotors(1)%NumOuts + p%AD%rotors(1)%BldNd_TotNumOuts + m%IW%p%NumOuts
Expand Down Expand Up @@ -235,7 +237,7 @@ subroutine ADI_UpdateStates( t, n, u, utimes, p, x, xd, z, OtherState, m, errSta
subroutine CleanUp()
!call ADI_DestroyConstrState(z_guess, errStat2, errMsg2); if(Failed()) return
do it=1,size(utimes)
call AD_DestroyInput(u_AD(it), errStat2, errMsg2); if(Failed()) return
call AD_DestroyInput(u_AD(it), errStat2, errMsg2) ! ignore errors here
enddo
end subroutine

Expand Down Expand Up @@ -367,7 +369,7 @@ subroutine ADI_InitInflowWind(Root, i_IW, u_AD, o_AD, IW, dt, InitOutData, errSt
call IfW_SteadyWind_Init(Steady_InitInput, 0, IW%p%FlowField%Uniform, &
FileDat, errStat2, errMsg2)
if(Failed()) return
if (i_IW%MHK == 1 .or. i_IW%MHK == 2) then
if (i_IW%MHK == MHK_FixedBottom .or. i_IW%MHK == MHK_FLoating) then
call IfW_UniformField_CalcAccel(IW%p%FlowField%Uniform, errStat2, errMsg2)
if(Failed()) return
IW%p%FlowField%AccFieldValid = .true.
Expand Down
25 changes: 21 additions & 4 deletions modules/aerodyn/src/AeroDyn_Registry.txt
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ typedef ^ InitInputType ReKi defPatm - - - "Default atmospheric
typedef ^ InitInputType ReKi defPvap - - - "Default vapor pressure from the driver; may be overwritten" Pa
typedef ^ InitInputType ReKi WtrDpth - - - "Water depth" m
typedef ^ InitInputType ReKi MSL2SWL - - - "Offset between still-water level and mean sea level" m
typedef ^ InitInputType FlowFieldType *FlowField - - - "Pointer of InflowWinds flow field data type" -

# This is data defined in the Input File for this module (or could otherwise be passed in)
# ..... Blade Input file data .....................................................................................................
Expand Down Expand Up @@ -208,7 +209,7 @@ typedef ^ AD_InputFile ReKi InCol_Cl - - - "The column in the airfoil tables tha
typedef ^ AD_InputFile ReKi InCol_Cd - - - "The column in the airfoil tables that contains the drag coefficient" -
typedef ^ AD_InputFile ReKi InCol_Cm - - - "The column in the airfoil tables that contains the pitching-moment coefficient; use zero if there is no Cm column" -
typedef ^ AD_InputFile ReKi InCol_Cpmin - - - "The column in the airfoil tables that contains the drag coefficient; use zero if there is no Cpmin column" -
typedef ^ AD_InputFile INTEGER AFTabMod - - - "Interpolation method for multiple airfoil tables {1 = 1D on AoA (only first table is used); 2 = 2D on AoA and Re; 3 = 2D on AoA and UserProp}" -
typedef ^ AD_InputFile IntKi AFTabMod - - - "Interpolation method for multiple airfoil tables {1 = 1D on AoA (only first table is used); 2 = 2D on AoA and Re; 3 = 2D on AoA and UserProp}" -
typedef ^ AD_InputFile IntKi NumAFfiles - - - "Number of airfoil files used" -
typedef ^ AD_InputFile CHARACTER(1024) FVWFileName - - - "FVW input filename" "quoted string"
typedef ^ AD_InputFile CHARACTER(1024) AFNames {:} - - "Airfoil file names (NumAF lines)" "quoted strings"
Expand Down Expand Up @@ -359,6 +360,19 @@ typedef ^ MiscVarType AD_InflowType Inflow {:} - - "Inflow storage (size of u fo


# Parameters for each rotor
typedef ^ Jac_u_idxStarts IntKi Nacelle - 1 - "Index to first point in u jacobian for Nacelle" -
typedef ^ Jac_u_idxStarts IntKi Hub - 1 - "Index to first point in u jacobian for Hub" -
typedef ^ Jac_u_idxStarts IntKi TFin - 1 - "Index to first point in u jacobian for TFin" -
typedef ^ Jac_u_idxStarts IntKi Tower - 1 - "Index to first point in u jacobian for Tower" -
typedef ^ Jac_u_idxStarts IntKi BladeRoot - 1 - "Index to first point in u jacobian for BladeRoot" -
typedef ^ Jac_u_idxStarts IntKi Blade - 1 - "Index to first point in u jacobian for Blade" -
typedef ^ Jac_u_idxStarts IntKi UserProp - 1 - "Index to first point in u jacobian for UserProp" -
typedef ^ Jac_u_idxStarts IntKi Extended - 1 - "Index to first point in u jacobian for Extended" -
typedef ^ Jac_y_idxStarts IntKi NacelleLoad - 1 - "Index to first point in y jacobian for NacelleLoad" -
typedef ^ Jac_y_idxStarts IntKi HubLoad - 1 - "Index to first point in y jacobian for HubLoad" -
typedef ^ Jac_y_idxStarts IntKi TFinLoad - 1 - "Index to first point in y jacobian for TFinLoad" -
typedef ^ Jac_y_idxStarts IntKi TowerLoad - 1 - "Index to first point in y jacobian for TowerLoad" -
typedef ^ Jac_y_idxStarts IntKi BladeLoad - 1 - "Index to first point in y jacobian for BladeLoad" -
typedef ^ RotParameterType IntKi NumBlades - - - "Number of blades on the turbine" -
typedef ^ RotParameterType IntKi NumBlNds - - - "Number of nodes on each blade" -
typedef ^ RotParameterType IntKi NumTwrNds - - - "Number of nodes on the tower" -
Expand All @@ -385,11 +399,14 @@ typedef ^ RotParameterType ReKi TwrTaper {:} - - "Array of tower element t
typedef ^ RotParameterType ReKi TwrAxCent {:} - - "Array of tower element axial centroid, used in buoyancy calculation" -
typedef ^ RotParameterType BEMT_ParameterType BEMT - - - "Parameters for BEMT module"
typedef ^ RotParameterType AA_ParameterType AA - - - "Parameters for AA module"
typedef ^ RotParameterType Integer Jac_u_indx {:}{:} - - "matrix to help fill/pack the u vector in computing the jacobian" -
typedef ^ RotParameterType IntKi Jac_u_indx {:}{:} - - "matrix to help fill/pack the u vector in computing the jacobian" -
typedef ^ RotParameterType Jac_u_idxStarts Jac_u_idxStartList - - - "Starting indices for all Jac_u components" -
typedef ^ RotParameterType Jac_y_idxStarts Jac_y_idxStartList - - - "Starting indices for all Jac_y components" -
typedef ^ RotParameterType IntKi NumExtendedInputs - - - "number of extended inputs" -
typedef ^ RotParameterType ReKi du {:} - - "vector that determines size of perturbation for u (inputs)"
typedef ^ RotParameterType ReKi dx {:} - - "vector that determines size of perturbation for x (continuous states)"
typedef ^ RotParameterType Integer Jac_ny - - - "number of outputs in jacobian matrix" -
typedef ^ RotParameterType Integer NumBl_Lin - - - "number of blades in the jacobian" -
typedef ^ RotParameterType IntKi Jac_ny - - - "number of outputs in jacobian matrix" -
typedef ^ RotParameterType IntKi NumBl_Lin - - - "number of blades in the jacobian" -

typedef ^ RotParameterType IntKi TwrPotent - - - "Type of tower influence on wind based on potential flow around the tower {0=none, 1=baseline potential flow, 2=potential flow with Bak correction}" -
typedef ^ RotParameterType IntKi TwrShadow - - - "Type of tower influence on wind based on downstream tower shadow {0=none, 1=Powles model, 2=Eames model}" -
Expand Down
Loading