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

Tight-Coupling Algorithm for OpenFAST 5.0 #2439

Open
wants to merge 334 commits into
base: dev-tc
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
334 commits
Select commit Hold shift + click to select a range
3d477df
Remove indexing for linearization, handle it inline
deslaughter Mar 5, 2024
f96090a
Merge remote-tracking branch 'andy/f/AD15_IfW_Linearization' into f/t…
deslaughter Mar 5, 2024
df1bc2a
Change FAST_ModLin to FAST_ModGlue in Simulink CMakeLists.txt
deslaughter Mar 5, 2024
878ee64
Update r-test pointer
deslaughter Mar 5, 2024
98801a4
Update r-test pointer for reg_test changes
deslaughter Mar 6, 2024
e7dc2a7
Started re-adding AeroMap
deslaughter May 17, 2024
e299b6a
Merge remote-tracking branch 'upstream/dev' into f/tight-coupling
deslaughter May 17, 2024
31f68dd
Switch to dev r-test branch
deslaughter May 17, 2024
a5dd7b3
Add FAST_Idx.f90 to simulink/CMakeLists.txt
deslaughter May 17, 2024
da4e4d8
Disable 5MW_Land_AeroMap test temporarily
deslaughter May 17, 2024
8cf4a36
Switch to quaternions from WM params in ModVar
deslaughter May 21, 2024
bc3da89
Attempt to get linearization test cases to work again
deslaughter May 21, 2024
f906d9b
Add missing flag on SubDyn WriteOutput variable
deslaughter May 23, 2024
d20489e
Added SeaState to module system
deslaughter May 23, 2024
ecc8605
Revised quaternion handling in BeamDyn
deslaughter May 23, 2024
c232ec4
Fix bug where SeaState variables weren't being initialized
deslaughter May 23, 2024
48d7df1
Variable Perturb was wrong type in SeaState
deslaughter May 23, 2024
c32d196
Attempt to remove uninitialized variables from FAST_Mapping and FAST_…
deslaughter May 23, 2024
76a0bba
Fix extending WaveElev0 input/output name in SeaState
deslaughter May 24, 2024
ab1ad26
Fix indexing in dXdu in HydroDyn for new extended inputs
deslaughter May 24, 2024
b8f2c6b
Reduce memory usage in fast_linearization_file.py when reading matrices
deslaughter May 24, 2024
f9d9241
Add Glue_Registry.txt to store new glue code structures, change FAST …
deslaughter May 28, 2024
a0c46c7
Add ModGlue_CalcSteady
deslaughter May 31, 2024
c603aef
Add MV_ExtrapInterp function to ModVar
deslaughter Jun 3, 2024
1e4bc9a
Rename ModVar variables fields to better differentiate from Flags. Ad…
deslaughter Jun 3, 2024
1621b8a
Add proper angle interpolation on [0,2PI] to MV_ExtrapInterp
deslaughter Jun 3, 2024
25a7742
Add FEAM and Orca to Module System
deslaughter Jun 3, 2024
5c1d034
Update r-test pointer
deslaughter Jun 3, 2024
e347f85
Add OrcaFlex, ExtInfw, ExtLd to module system. Fix spelling in InitVa…
deslaughter Jun 3, 2024
b5fe903
Update r-test pointer
deslaughter Jun 3, 2024
0cb0072
Remove unused linearization routines in MAP, BeamDyn, SubDyn
deslaughter Jun 3, 2024
7ac2d84
Merge remote-tracking branch 'upstream/dev' into f/tight-coupling
deslaughter Jun 3, 2024
9917249
Update r-test pointer
deslaughter Jun 6, 2024
b543b77
Making progress on AeroMap, update indexing
deslaughter Jun 15, 2024
7182ff8
Change FAST_Idx.f90 to FAST_ModData.90 in simulink CMakeLists.txt
deslaughter Jun 15, 2024
c465160
AeroMap working for ElastoDyn
deslaughter Jun 18, 2024
ffa7098
Get AeroMap reset working, re-enable AeroMap test for ED
deslaughter Jun 18, 2024
d0d19f4
Minor cleanup in AeroMap
deslaughter Jun 20, 2024
98b0e9a
Add parsing of J matrix to FASTLinearizationFile
deslaughter Jun 20, 2024
f2996f7
Partially working revision of module vars
deslaughter Jul 8, 2024
49fec4e
Refactoring module variables again
deslaughter Jul 22, 2024
ceda2b5
Merge remote-tracking branch 'upstream/dev' into f/tight-coupling
deslaughter Jul 22, 2024
35c64b2
Fix merge issues
deslaughter Jul 22, 2024
8dc5ebb
Linearization changes
deslaughter Jul 24, 2024
a59fa0a
Majority of linearization regression tests working
deslaughter Jul 25, 2024
6c3eabc
Merge remote-tracking branch 'upstream/dev' into f/tight-coupling
deslaughter Jul 25, 2024
14cf9e6
Remove Glue_ModData from simulink CMakeLists.txt
deslaughter Jul 26, 2024
f0b3a77
Regenerate Types files
deslaughter Jul 26, 2024
653b976
fix typo in fast_linearization_file.py
deslaughter Jul 26, 2024
7ab1028
Change dxdt_jac to dxdt_lin
deslaughter Jul 26, 2024
5f0d9a0
Reenable AeroMap
deslaughter Jul 26, 2024
72017b5
Restore iSrcMaps and iDstMaps zero allocation
deslaughter Jul 27, 2024
2695d5f
Fix 5MW_OC4Semi_MD_Linear test case, generate field name functions
deslaughter Jul 29, 2024
fe88291
Tight coupling appears to be working for at least some regression tes…
deslaughter Aug 9, 2024
0111789
Don't clear load mesh if mapping isn't ready
deslaughter Aug 9, 2024
819d504
BeamDyn, ModMesh, NWTC_Num performance improvements
deslaughter Aug 16, 2024
b57c17e
Tight coupling appears to be working for the IEA15
deslaughter Aug 16, 2024
0f67063
Fix bug in BeamDyn performance commit
deslaughter Aug 19, 2024
d18c96d
Set SrvD hub wind speed from IfW hub speed
deslaughter Aug 19, 2024
f664cc5
Add commented option for performance profiling in OpenfastFortranOpti…
deslaughter Aug 19, 2024
dd7e4f4
Use small rotation angles in ModVar
deslaughter Aug 20, 2024
56d830b
Make SolverTC work with no states
deslaughter Aug 20, 2024
427af96
Add error in SrvD to exit if HSSBrMode is not 0. The brake doesn't cu…
deslaughter Aug 20, 2024
e36a35c
Change errorPlotting.py and pass_fail.py to ignore TC channels (ConvE…
deslaughter Aug 20, 2024
12b0d8d
Set mapping from SeaSt_y_WaveElev0 to HydroDyn_u_WaveElev0 to only be…
deslaughter Aug 20, 2024
e460460
Remove duplicate array allocation in AeroMap
deslaughter Aug 20, 2024
625ba1e
Change Vars used in Option 1 in SolverTC
deslaughter Aug 20, 2024
0b4894f
Fix beamdyn_utest incorrect size of m%qp%upp
deslaughter Aug 20, 2024
37b6f34
Fix more bugs in BeamDyn performance improvements
deslaughter Aug 22, 2024
4c93cf7
Update executePythonRegressionCase.py for TC outputs
deslaughter Aug 22, 2024
699bcb0
Reworked TC Solver initialization method
deslaughter Aug 22, 2024
07ae8bb
FAST_Func: Add SeaSt CalcOutput, fix MAP_UpdateStates
deslaughter Aug 22, 2024
04f488a
Specify name in Glue_CombineModules
deslaughter Aug 22, 2024
3e171d4
Rename some vars in Glue_Registry.txt
deslaughter Aug 22, 2024
ab1ce23
Merge remote-tracking branch 'upstream/dev' into f/tight-coupling
deslaughter Aug 22, 2024
b34e327
Fix simulink CMakeLists.txt
deslaughter Aug 22, 2024
0f5a5a9
Point to r-test-5 in submodule
deslaughter Aug 23, 2024
f9f31c2
Update r-test pointer
deslaughter Aug 23, 2024
9fc8246
Allow reg_tests to use .out or .outb files
deslaughter Aug 26, 2024
f8a952f
Fix step0 system initialization in FAST_SolverTC
deslaughter Aug 26, 2024
d1d3f61
Disable use of small rotation angles in ModVar
deslaughter Aug 26, 2024
33ca6dc
Align SolverTC with FAST_Subs
deslaughter Aug 26, 2024
cd6b4fc
Fix bug in Calculate_C_alpha (AirfoilInfo.f90)
deslaughter Aug 27, 2024
d4e7c7c
Rename functions in FAST_SolverTC
deslaughter Aug 27, 2024
f49fc9a
Allow .out and .outb files in regression test scripts
deslaughter Aug 27, 2024
4b703bc
Update r-test pointer
deslaughter Aug 27, 2024
c06f0bb
Remove GetOP from IfW and ExtPtfm
deslaughter Aug 27, 2024
724593f
Reduce linearization size by keeping only necessary variables
deslaughter Aug 27, 2024
5912006
Add name argument to Glue_CombineModules
deslaughter Aug 27, 2024
c624cb4
Update r-test pointer, disable 5MW_OC4Jckt_DLL_WTurb_WavesIrr_MGrowth
deslaughter Aug 27, 2024
1a128c4
Read solver parameters from input file
deslaughter Aug 27, 2024
fe73405
Update FAST_Types.f90
deslaughter Aug 28, 2024
b67fb62
Update r-test pointer
deslaughter Aug 28, 2024
2f7b2f8
Update r-test pointer
deslaughter Aug 28, 2024
467bb85
Update r-test pointer
deslaughter Aug 28, 2024
4040fba
Update r-test pointer
deslaughter Aug 28, 2024
435d084
Add checks in linearization for when dUdu and dUdy aren't allocated
deslaughter Aug 28, 2024
25a5dcd
Update r-test pointer
deslaughter Aug 29, 2024
4c139fd
Rework initialization again
deslaughter Aug 29, 2024
1cf4f63
Rework initialization, attempt 3
deslaughter Aug 29, 2024
4013962
Update r-test pointer
deslaughter Aug 29, 2024
45be70a
Skip Solver_Step0 convergence if no inputs
deslaughter Aug 29, 2024
ff50e97
Update r-test pointer
deslaughter Aug 29, 2024
ef0e277
Move NacelleDrag and BuoyantLoads calc into RotCalcOutput to be inclu…
deslaughter Aug 29, 2024
78c1282
Update r-test pointer
deslaughter Aug 29, 2024
75f46da
Add MHK_RM1_Floating_Linear regression test
deslaughter Aug 29, 2024
a644cad
Disable MHK_RM1_Floating_Linear, reset flag in ModGlue
deslaughter Aug 29, 2024
0c05514
Get AeroMap working again
deslaughter Aug 29, 2024
17818c2
Integrate ExtLoads
deslaughter Aug 31, 2024
8f512df
Fix blade structural control in FAST_Mapping
deslaughter Aug 31, 2024
639b0a5
Update r-test pointer
deslaughter Aug 31, 2024
410d516
Fix FAST_Mapping again
deslaughter Aug 31, 2024
36c73bc
Update remap flat reset function to use mesh pointers
deslaughter Sep 4, 2024
bc551ce
improve flag usage in elastodyn
deslaughter Sep 4, 2024
1bef93f
Improve method for select vars used in TC solve
deslaughter Sep 4, 2024
8669b9a
Update r-test pointer
deslaughter Sep 4, 2024
3023d8e
Update r-test pointer
deslaughter Sep 4, 2024
711df68
Change field strings in ModVar.f90
deslaughter Sep 7, 2024
ffc4cdb
Fix SD->HD mapping with Y2Mesh in FAST_Mapping
deslaughter Sep 7, 2024
373a523
Cleanup in FAST_Mapping
deslaughter Sep 7, 2024
2634482
Add solve debug output in FAST_SolverTC
deslaughter Sep 7, 2024
0b59134
Perf improvements to Conv_Radiation and SeaSt_WaveField
deslaughter Sep 9, 2024
7bff0dc
Mark several NWTC Lib functions as PURE
deslaughter Sep 10, 2024
cf89895
Minor performance improvements in SeaState (reorganize indexing to mi…
deslaughter Sep 10, 2024
208db9d
Small performance improvements in Morison.f90
deslaughter Sep 10, 2024
640acba
Minor performance improvements in SubDyn
deslaughter Sep 10, 2024
74f77e6
Use LAPACK_GEMV in SubDyn
deslaughter Sep 10, 2024
2ebd615
Fully initialize Mesh%ElemTable in MeshCreate
deslaughter Sep 11, 2024
89238f4
SubDyn: fix single precision compile
deslaughter Sep 11, 2024
41649b2
SeaSt_WaveField: remove unused WaveElev functions
deslaughter Sep 11, 2024
ea17262
Fix crashes with Intel compiler
deslaughter Sep 11, 2024
deaff44
Merge remote-tracking branch 'upstream/dev' into f/tight-coupling
deslaughter Sep 11, 2024
622b60b
Everything builds after merge
deslaughter Sep 11, 2024
e611250
FAST_Subs: Fix duplicate array allocation
deslaughter Sep 12, 2024
bc3ebe5
Add IceDyn and IceFloe to modules system
deslaughter Sep 12, 2024
5a17a69
Integrate SED and AeroDisk into new glue code
deslaughter Sep 12, 2024
10fecd5
Get SED working, missing mappings
deslaughter Sep 13, 2024
6156ee1
Copy .outb file when doing linear regression test
deslaughter Sep 13, 2024
345db2e
Update r-test pointer
deslaughter Sep 13, 2024
8205fce
SubDyn: fix single precision build
deslaughter Sep 13, 2024
7257fd4
FAST_SolverTC: Disable AD in Option 1
deslaughter Sep 13, 2024
99390be
Update r-test pointer
deslaughter Sep 13, 2024
f68f85f
FAST_SolverTC: disable Jacobian debug output
deslaughter Sep 13, 2024
6d50fd4
Add MHK floating test case
deslaughter Sep 13, 2024
4460bef
FAST_Subs: fix bug in InputAryLB calc
deslaughter Sep 13, 2024
796423c
Update r-test pointer
deslaughter Sep 13, 2024
7f85499
HydroDyn: fix output of WAMIT%Conv_Rdtn%RdtnKrnl
deslaughter Sep 13, 2024
b5394f4
FAST_SolverTC: Enable switching of AeroDyn between Opt1 and Opt2 if M…
deslaughter Sep 13, 2024
94c6bcf
AeroDyn: disable first tower node depth check in RotCalcBuoyantLoads …
deslaughter Sep 13, 2024
d977fb7
CTestList: Add highpass filter for MHK_RM1_Floating_Linear case
deslaughter Sep 13, 2024
c55c291
Print more failed errors for linearization regression tests
deslaughter Sep 13, 2024
348921d
CTestList: Disable MHK_RM1_Floating_Linear and update r-test pointer
deslaughter Sep 13, 2024
500f0d8
Merge remote-tracking branch 'upstream/dev' into f/tight-coupling
deslaughter Sep 13, 2024
1d5b0d1
ExtLoads: update to match dev behavior
deslaughter Sep 14, 2024
83bed31
Update r-test pointer
deslaughter Sep 14, 2024
58f5aad
FAST_Subs: fix bad merge
deslaughter Sep 14, 2024
e9d007d
openfast_io: update reader & writer for tight-coupling inputs
deslaughter Sep 14, 2024
c68d693
Update r-test pointer
deslaughter Sep 14, 2024
7c5633f
Allow NLinTimes=1 when using CalcSteady
deslaughter Sep 17, 2024
ae12bdc
Allow DBEMT_Mod=-1 (frozen wake) for linearization
deslaughter Sep 17, 2024
e1a28e1
FAST_ModGlue: better way to prevent CalcSteady from converging premat…
deslaughter Sep 17, 2024
2723c20
FAST_Mapping: remove ExtLd -> SrvD
deslaughter Sep 18, 2024
0845870
Use at least 2 azimuth positions for CalcSteady
deslaughter Sep 18, 2024
09cc223
Merge remote-tracking branch 'upstream/dev' into f/tight-coupling
deslaughter Sep 18, 2024
efc9d5a
FAST_Mapping: reimplement tower and blade damping for CalcSteady
deslaughter Sep 19, 2024
b3541f5
ExtLoads: fix bad merge from dev
deslaughter Sep 20, 2024
fdffbe4
Update r-test pointer
deslaughter Sep 20, 2024
3f0e899
Fix MV_ExtrapInterp and its use in FAST_ModGlue
deslaughter Sep 26, 2024
0bd39f9
Update convergence failure message
deslaughter Oct 22, 2024
5ee4ac1
Merge %Input_Saved into %Input for modules
deslaughter Nov 5, 2024
eb179da
Remove unused LinStateSave
deslaughter Nov 5, 2024
bdf9b8b
Remove unnecessary u input in FAST_Types
deslaughter Nov 5, 2024
c45661f
Remove unused members of module data structures
deslaughter Nov 5, 2024
a96dbbe
Add Visual Studio Solution which uses IFX
deslaughter Nov 14, 2024
74d6f66
Remvoe Visual Studio temporary files from repo
deslaughter Nov 15, 2024
6b3c85e
Adding missing features and modules to vs-build-ifx
deslaughter Nov 15, 2024
4adeb57
Updating VS projects
deslaughter Nov 18, 2024
7ae7a45
Update all the projects
deslaughter Nov 19, 2024
c6fc177
Moved driver projects, fixed SuperController
deslaughter Nov 19, 2024
f4ef8ab
Fix build in VS2019
deslaughter Nov 20, 2024
1217146
Resolve stack overflow in using ifx
deslaughter Nov 25, 2024
ff98846
More work on Visual Studio projects
deslaughter Nov 25, 2024
429b01a
Merge 'dev' into f/tight-coupling
deslaughter Dec 10, 2024
a866b34
Fix single precision compile
deslaughter Dec 10, 2024
8e79b8f
Fix duplicated allocation in BeamDyn
deslaughter Dec 10, 2024
aa3fa50
Allow multiple ElastoDyn instances
deslaughter Dec 30, 2024
05c3e4d
Fix FAST.Farm, revert BD changes
deslaughter Dec 30, 2024
9d002e5
Merge remote-tracking branch 'upstream/dev' into f/tight-coupling
deslaughter Dec 31, 2024
41d408c
Fix incorrect indexing for RdtnKrnl in HydroDyn
deslaughter Dec 31, 2024
4c15dbd
Add check for OutData_ED being allocated in FAST_Subs
deslaughter Dec 31, 2024
3802b16
Update r-test pointer
deslaughter Dec 31, 2024
20aae9a
Disable AWT_WSt_StartUp_HighSpShutDown in test_of_io_pytest.py
deslaughter Jan 2, 2025
47264e3
Update r-test pointer
deslaughter Jan 2, 2025
8712da3
Fix some segfaults when using a controller shared library.
deslaughter Jan 7, 2025
8c36748
Get FAST.Farm MD_Shared regression test working
deslaughter Feb 3, 2025
289512a
Merge remote-tracking branch 'upstream/dev' into f/tight-coupling
deslaughter Feb 3, 2025
d33fb27
Update r-test pointer
deslaughter Feb 3, 2025
0f4fb1f
Use PI controller form CalcSteady Trim
deslaughter Feb 4, 2025
694d782
Fix missing allocation for AD FrozenWake when doing linearization.
deslaughter Feb 6, 2025
0c261b4
Merge remote-tracking branch 'origin/f/tight-coupling' into f/tc-calc…
deslaughter Feb 6, 2025
b3c13d2
MD: RK4 in MoorDyn. Tested by hardcoding default to RK4 and running r…
RyanDavies19 Feb 11, 2025
147f636
Revert "Update r-test pointer to v4.0.2"
deslaughter Feb 11, 2025
8173d59
Fix CalcOutputs_SolveForInputs in FAST_SolverTC.f90 and use in FAST_S…
deslaughter Feb 12, 2025
dac11fa
adding LICENSE to openfast_io folder for conda builds
mayankchetan Feb 12, 2025
1f5936a
MD: cleaned up spacing, commented out timestep function, added dynami…
RyanDavies19 Feb 13, 2025
96fd04a
MD: removed forgotten print statement
RyanDavies19 Feb 13, 2025
6f3f416
Merge remote-tracking branch 'upstream/dev' into f/tight-coupling
deslaughter Feb 17, 2025
323e3e4
Update r-test pointer
deslaughter Feb 17, 2025
af47e72
[BugFix] Calc_RR0mEta_rho routine argument consistency
andrew-platt Feb 18, 2025
44d8ff8
typo in af47e72
andrew-platt Feb 18, 2025
2a3f53e
BD: pass mEta into Calc_RR0mEta_rho
andrew-platt Feb 18, 2025
84d20cc
handing python 0-indexing and OpenFAST 1-indexing correctly
mayankchetan Feb 19, 2025
1cd64ad
removing LICENSE file from openfast_io
mayankchetan Feb 19, 2025
4b3ef0e
point to correct LICENSE files
mayankchetan Feb 19, 2025
341fef8
Merge pull request #2644 from mayankchetan/of_io_update
andrew-platt Feb 19, 2025
7252a5b
Add CalcSteady error to output file
deslaughter Feb 20, 2025
656afdb
Merge pull request #2642 from andrew-platt/b/BD_Calc_RR0mEta_rho
andrew-platt Feb 20, 2025
2eed69d
Merge branch 'f/tight-coupling', remote-tracking branch 'origin' into…
deslaughter Feb 20, 2025
3201d74
MD: VIV attempt 1, broken
RyanDavies19 Feb 24, 2025
fd0b36b
MD: VIV working, verified against MD-C
RyanDavies19 Feb 24, 2025
fdd47fc
MD: VIV for internal nodes only, removing print statements
RyanDavies19 Feb 25, 2025
20bbb03
MD: update OpenfAST_io for VIV
RyanDavies19 Feb 25, 2025
1c883b5
MD: Code clean up
RyanDavies19 Feb 25, 2025
83c7add
Reduced size of Jacobian in TC Solver
deslaughter Feb 26, 2025
77ee4d3
Fixed some bugs in ordering of SolverTC variables
deslaughter Feb 27, 2025
df78329
Merge remote-tracking branch 'upstream/dev' into MD_RK4
RyanDavies19 Feb 27, 2025
1f3e89a
MD: Error check to prevent viv or visco with linearized MD
RyanDavies19 Feb 27, 2025
df31d9e
Update r-test pointer
deslaughter Feb 27, 2025
02f07ec
MD: initialize unused VIV things to zero
RyanDavies19 Feb 27, 2025
2d6af1e
Reduce fields in solver jacobian
deslaughter Feb 28, 2025
7883476
Update r-test pointer
deslaughter Feb 28, 2025
9223652
Update r-test pointer
deslaughter Feb 28, 2025
38b2c6f
IO: Updated OpenFAST_io for MoorDyn input files
RyanDavies19 Feb 26, 2025
f98c8fd
IO: clean up openfast_io for MD after testing, fix *** error in MD ou…
RyanDavies19 Feb 26, 2025
5671964
MD: update version
RyanDavies19 Feb 27, 2025
39783ec
MD: IO output format fix
RyanDavies19 Feb 28, 2025
80cfcbc
Merge pull request #2650 from RyanDavies19/MD_RK4
andrew-platt Feb 28, 2025
25706a9
Merge remote-tracking branch 'upstream/dev' into MD_IO_fix
RyanDavies19 Feb 28, 2025
608c924
IO: Fix MoorDyn outlist handling, remove MoorDyn echo file reading
RyanDavies19 Mar 3, 2025
84eff56
Merge pull request #2658 from RyanDavies19/MD_IO_fix
andrew-platt Mar 7, 2025
263c263
Merge remote-tracking branch 'upstream/dev' into f/tc-calcsteady-trim
deslaughter Mar 10, 2025
0a52d60
Fix ExtInfw module
deslaughter Mar 11, 2025
1f7bdbe
Update r-test pointer
deslaughter Mar 11, 2025
d37ed33
Remove constraint states from ModVar system
deslaughter Mar 11, 2025
1738062
Address review comments
deslaughter Mar 11, 2025
78ebb7b
Remove unused variables and add mappings to sum file
deslaughter Mar 11, 2025
3cb9260
Remove MeshMapType and FAST_LinType as they're no longer used
deslaughter Mar 12, 2025
7b61706
Remove debugging code
deslaughter Mar 13, 2025
058c603
Fix bug in WM parameter linearization variable description output
deslaughter Mar 19, 2025
5fbd380
Remove RotStates Jacobian modification from BD
deslaughter Mar 21, 2025
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
Prev Previous commit
Next Next commit
Merge remote-tracking branch 'upstream/dev' into f/tight-coupling
deslaughter committed Sep 18, 2024
commit 09cc22338b1df52514a81ca68c1e1f79484ae4be
12 changes: 0 additions & 12 deletions glue-codes/openfast-cpp/src/OpenFAST.cpp
Original file line number Diff line number Diff line change
@@ -774,10 +774,6 @@ void fast::OpenFAST::init() {
&turbineData[iTurb].numBlades,
&turbineData[iTurb].azBlendMean,
&turbineData[iTurb].azBlendDelta,
&turbineData[iTurb].velMean,
&turbineData[iTurb].windDir,
&turbineData[iTurb].zRef,
&turbineData[iTurb].shearExp,
&extld_i_f_FAST[iTurb],
&extld_p_f_FAST[iTurb],
&extld_o_t_FAST[iTurb],
@@ -1664,10 +1660,6 @@ void fast::OpenFAST::get_turbineParams(int iTurbGlob, turbineDataType & turbData
turbData.nBRfsiPtsTwr = turbineData[iTurbLoc].nBRfsiPtsTwr;
turbData.azBlendMean = turbineData[iTurbLoc].azBlendMean;
turbData.azBlendDelta = turbineData[iTurbLoc].azBlendDelta;
turbData.velMean = turbineData[iTurbLoc].velMean;
turbData.windDir = turbineData[iTurbLoc].windDir;
turbData.zRef = turbineData[iTurbLoc].zRef;
turbData.shearExp = turbineData[iTurbLoc].shearExp;

}

@@ -2075,10 +2067,6 @@ void fast::OpenFAST::allocateMemory_preInit() {
turbineData[iTurb].numForcePtsTwr = globTurbineData[iTurbGlob].numForcePtsTwr;
turbineData[iTurb].azBlendMean = globTurbineData[iTurbGlob].azBlendMean;
turbineData[iTurb].azBlendDelta = globTurbineData[iTurbGlob].azBlendDelta;
turbineData[iTurb].velMean = globTurbineData[iTurbGlob].velMean;
turbineData[iTurb].windDir = globTurbineData[iTurbGlob].windDir;
turbineData[iTurb].zRef = globTurbineData[iTurbGlob].zRef;
turbineData[iTurb].shearExp = globTurbineData[iTurbGlob].shearExp;

velForceNodeData[iTurb].resize(4); // To hold data for 4 time steps
brFSIData[iTurb].resize(4);
2 changes: 1 addition & 1 deletion modules/aerodisk/src/AeroDisk_Registry.txt
Original file line number Diff line number Diff line change
@@ -78,7 +78,7 @@ typedef ^ InputType ReKi BlPitch - -

# ..... Outputs ...................................................................................................................
# outputs on meshes:
typedef ^ OutputType MeshType AeroLoads - - - "Mesh containing the forces and moments from the aero loading" -
typedef ^ OutputType MeshType AeroLoads - - - "Mesh containing the forces and moments from the aero loading (at HubMotion mesh)" -
#TODO: any mesh for visualization of blades/rotor disk?
# outputs not on meshes:
typedef ^ OutputType ReKi YawErr - - - "Nacelle-yaw error, i.e., the angle about positive Z from the rotor centerline to the rotor-disk-averaged relative wind velocity (ambient + rotor motion), both projected onto the horizontal plane" rad
2 changes: 1 addition & 1 deletion modules/aerodisk/src/AeroDisk_Types.f90
Original file line number Diff line number Diff line change
@@ -98,7 +98,7 @@ MODULE AeroDisk_Types
! =======================
! ========= ADsk_OutputType =======
TYPE, PUBLIC :: ADsk_OutputType
TYPE(MeshType) :: AeroLoads !< Mesh containing the forces and moments from the aero loading [-]
TYPE(MeshType) :: AeroLoads !< Mesh containing the forces and moments from the aero loading (at HubMotion mesh) [-]
REAL(ReKi) :: YawErr = 0.0_ReKi !< Nacelle-yaw error, i.e., the angle about positive Z from the rotor centerline to the rotor-disk-averaged relative wind velocity (ambient + rotor motion), both projected onto the horizontal plane [rad]
REAL(ReKi) :: PsiSkew = 0.0_ReKi !< Azimuth angle (from the nominally vertical axis in the disk plane, Z_disk ) to the vector about which the inflow skew angle is defined, i.e., the angle about positive X_disk from Z_disk to the vector about which the positive inflow skew angle is defined [rad]
REAL(ReKi) :: ChiSkew = 0.0_ReKi !< Inflow skew angle [rad]
6 changes: 3 additions & 3 deletions modules/aerodyn/src/AeroDyn.f90
Original file line number Diff line number Diff line change
@@ -3188,7 +3188,7 @@ subroutine SetInputsForBEMT(p, p_AD, u, RotInflow, m, indx, errStat, errMsg)
! Determine current azimuth angle and pitch axis vector of blade k, element j
call Calculate_MeshOrientation_Rel2Hub(u%BladeMotion(k), u%HubMotion, x_hat_disk, m%orientationAnnulus(:,:,:,k), elemPosRelToHub_save=elemPosRelToHub, elemPosRotorProj_save=elemPosRotorProj)
! Twist (aero+elastic), Toe, Cant (instantaneous and local), include elastic deformation
call TwistToeCant_FromLocalPolar(u%BladeMotion(k), m%orientationAnnulus(:,:,:,k), thetaBladeNds, m%Toe(:,k), m%Cant(:,k))
call TwistToeCant_FromLocalPolar(u%BladeMotion(k), m%orientationAnnulus(:,:,:,k), thetaBladeNds(:,k), m%Toe(:,k), m%Cant(:,k))

!..........................
! Compute local radius
@@ -3621,7 +3621,7 @@ subroutine SetInputsForFVW(p, u, m, errStat, errMsg)
elseif (p%rotors(iR)%AeroProjMod==APM_BEM_Polar) then
do k=1,p%rotors(iR)%numBlades
call Calculate_MeshOrientation_Rel2Hub(u(tIndx)%rotors(iR)%BladeMotion(k), u(tIndx)%rotors(iR)%HubMotion, x_hat_disk, m%rotors(iR)%orientationAnnulus(:,:,:,k))
call TwistToeCant_FromLocalPolar(u(tIndx)%rotors(iR)%BladeMotion(k), m%rotors(iR)%orientationAnnulus(:,:,:,k), thetaBladeNds, m%rotors(iR)%Toe(:,k), m%rotors(iR)%Cant(:,k))
call TwistToeCant_FromLocalPolar(u(tIndx)%rotors(iR)%BladeMotion(k), m%rotors(iR)%orientationAnnulus(:,:,:,k), thetaBladeNds(:,k), m%rotors(iR)%Toe(:,k), m%rotors(iR)%Cant(:,k))
enddo

else if (p%rotors(iR)%AeroProjMod==APM_LiftingLine) then
@@ -4294,7 +4294,7 @@ SUBROUTINE ValidateInputData( InitInp, InputFileData, NumBl, calcCrvAngle, ErrSt
select case(InputFileData%DBEMT_Mod)
case (DBEMT_None, DBEMT_frozen, DBEMT_cont_tauConst)
case default
call SetErrStat( ErrID_Fatal, 'DBEMT Mod must be 0 or 3 (continuous formulation with constant tau1) for linearization. Set DBEMT_Mod=0,3.', ErrStat, ErrMsg, RoutineName )
call SetErrStat( ErrID_Fatal, 'DBEMT_Mod must be -1 (frozen), 0 (none), or 3 (continuous formulation with constant tau1) for linearization. Set DBEMT_Mod=-1,0,3.', ErrStat, ErrMsg, RoutineName )
end select

if (InputFileData%NacelleDrag) then
2 changes: 1 addition & 1 deletion modules/aerodyn/src/BEMT.f90
Original file line number Diff line number Diff line change
@@ -636,7 +636,7 @@ subroutine BEMT_Init( InitInp, u, p, x, xd, z, OtherState, AFInfo, y, misc, Inte
if (errStat >= AbortErrLev) return

InitInp_DBEMT%DBEMT_Mod = p%DBEMT_Mod
if ( p%DBEMT_Mod > DBEMT_none ) then
if ( p%DBEMT_Mod > DBEMT_none .or. p%DBEMT_Mod == DBEMT_Frozen ) then
InitInp_DBEMT%DBEMT_Mod = p%DBEMT_Mod
InitInp_DBEMT%numBlades = p%numBlades
InitInp_DBEMT%numNodes = p%numBladeNodes
10 changes: 6 additions & 4 deletions modules/aerodyn/src/DBEMT.f90
Original file line number Diff line number Diff line change
@@ -64,9 +64,11 @@ subroutine DBEMT_ValidateInitInp(interval, InitInp, errStat, errMsg)
errMsg = ""

if ( interval <= sqrt(epsilon(1.0_ReKi)) ) call SetErrStat( ErrID_Fatal, " The timestep size for DBEMT (interval) must be larger than sqrt(epsilon).", ErrStat, ErrMsg, RoutineName)
if ( (InitInp%DBEMT_Mod .ne. DBEMT_tauConst) .and. (InitInp%DBEMT_Mod .ne. DBEMT_tauVaries) .and. (InitInp%DBEMT_Mod .ne. DBEMT_cont_tauConst)) then
call SetErrStat( ErrID_Fatal, " DBEMT_Mod must be set to 1, 2, or 3.", ErrStat, ErrMsg, RoutineName)
end if
select case(InitInp%DBEMT_Mod)
case (DBEMT_frozen, DBEMT_tauConst, DBEMT_tauVaries, DBEMT_cont_tauConst)
case default
call SetErrStat( ErrID_Fatal, " DBEMT_Mod must be set to -1, 1, 2, or 3.", ErrStat, ErrMsg, RoutineName)
end select

if (InitInp%numBlades < 1) call SetErrStat( ErrID_Fatal, " InitInp%numBlades must set to 1 or more.", ErrStat, ErrMsg, RoutineName)
if (InitInp%numNodes < 2) call SetErrStat( ErrID_Fatal, " InitInp%numNodes must set to 2 or more.", ErrStat, ErrMsg, RoutineName)
@@ -922,4 +924,4 @@ subroutine DBEMT_End( u, p, x, OtherState, m, ErrStat, ErrMsg )

END SUBROUTINE DBEMT_End

end module DBEMT
end module DBEMT
2 changes: 1 addition & 1 deletion modules/extloads/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -27,7 +27,7 @@ add_library(extloadslib STATIC
target_include_directories(extloadslib PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src>
)
target_link_libraries(extloadslib beamdynlib nwtclibs versioninfolib ifwlib)
target_link_libraries(extloadslib beamdynlib nwtclibs versioninfolib)
set_target_properties(extloadslib PROPERTIES PUBLIC_HEADER "src/ExtLoadsDX_Types.h")

install(TARGETS extloadslib
150 changes: 53 additions & 97 deletions modules/extloads/src/ExtLoads.f90
Original file line number Diff line number Diff line change
@@ -42,6 +42,36 @@ module ExtLoads
public :: ExtLd_ConvertInpDataForExtProg ! Routine to convert Input data for external programs

contains
!----------------------------------------------------------------------------------------------------------------------------------
!> This subroutine sets the initialization output data structure, which contains data to be returned to the calling program (e.g.,
!! FAST)
subroutine ExtLd_SetInitOut(p, InitOut, errStat, errMsg)

type(ExtLd_InitOutputType), intent(inout) :: InitOut ! output data
type(ExtLd_ParameterType), intent(in ) :: p ! Parameters
integer(IntKi), intent( out) :: errStat ! Error status of the operation
character(*), intent( out) :: errMsg ! Error message if ErrStat /= ErrID_None


! Local variables
integer(intKi) :: ErrStat2 ! temporary Error status
character(ErrMsgLen) :: ErrMsg2 ! temporary Error message
character(*), parameter :: RoutineName = 'ExtLd_SetInitOut'



integer(IntKi) :: i, j, k, f
integer(IntKi) :: NumCoords
#ifdef DBG_OUTS
integer(IntKi) :: m
character(5) ::chanPrefix
#endif
! Initialize variables for this routine

errStat = ErrID_None
errMsg = ""

end subroutine ExtLd_SetInitOut

!----------------------------------------------------------------------------------------------------------------------------------
!> This routine is called at the start of the simulation to perform initialization steps.
@@ -90,114 +120,40 @@ subroutine ExtLd_Init( InitInp, u, xd, p, y, m, interval, InitOut, ErrStat, ErrM

p%az_blend_mean = InitInp%az_blend_mean
p%az_blend_delta = InitInp%az_blend_delta
p%vel_mean = InitInp%vel_mean
p%wind_dir = InitInp%wind_dir
p%z_ref = InitInp%z_ref
p%shear_exp = InitInp%shear_exp

!----------------------------------------------------------------------------
! Define and initialize inputs
!----------------------------------------------------------------------------
!............................................................................................
! Define and initialize inputs here
!............................................................................................

call Init_u( u, p, InitInp, ErrStat2, ErrMsg2 )
if (Failed()) return
write(*,*) 'Initializing U '

call Init_u( u, p, InitInp, errStat2, errMsg2 )
call SetErrStat( ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName )
if (ErrStat >= AbortErrLev) return

!----------------------------------------------------------------------------
! Initialize misc vars states
!----------------------------------------------------------------------------

m%az = 0.0
m%phi_cfd = 0.0

!----------------------------------------------------------------------------
! Initialize outputs
!----------------------------------------------------------------------------

! Initialize outputs after input meshes have been initialized
call Init_y(y, u, m, p, ErrStat2, ErrMsg2)
if (Failed()) return

!----------------------------------------------------------------------------
! Initialize Module Variables
!----------------------------------------------------------------------------

call ExtLd_InitVars(u, p, y, m, InitOut, .false., ErrStat2, ErrMsg2)
if (Failed()) return

contains
logical function Failed()
CALL SetErrStat( ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName )
Failed = ErrStat >= AbortErrLev
end function Failed
end subroutine ExtLd_Init

!----------------------------------------------------------------------------------------------------------------------------------
subroutine ExtLd_InitVars(u, p, y, m, InitOut, Linearize, ErrStat, ErrMsg)
type(ExtLd_InputType), intent(inout) :: u !< An initial guess for the input; input mesh must be defined
type(ExtLd_ParameterType), intent(inout) :: p !< Parameters
type(ExtLd_OutputType), intent(inout) :: y !< Initial system outputs (outputs are not calculated;
type(ExtLd_MiscVarType), intent(inout) :: m !< Misc variables for optimization (not copied in glue code)
type(ExtLd_InitOutputType), intent(inout) :: InitOut !< Output for initialization routine
logical, intent(in ) :: Linearize !< Flag to initialize linearization variables
integer(IntKi), intent( out) :: ErrStat !< Error status of the operation
character(*), intent( out) :: ErrMsg !< Error message if ErrStat /= ErrID_None

character(*), parameter :: RoutineName = 'ExtLd_InitVars'
INTEGER(IntKi) :: ErrStat2
CHARACTER(ErrMsgLen) :: ErrMsg2

integer(IntKi) :: i

ErrStat = ErrID_None
ErrMsg = ""

! Allocate space for variables (deallocate if already allocated)
if (associated(p%Vars)) deallocate(p%Vars)
allocate(p%Vars, stat=ErrStat2)
if (ErrStat2 /= 0) then
call SetErrStat(ErrID_Fatal, "Error allocating p%Vars", ErrStat, ErrMsg, RoutineName)
return
end if

! Add pointers to vars to initialization output
InitOut%Vars => p%Vars

!----------------------------------------------------------------------------
! Continuous State Variables
!----------------------------------------------------------------------------

!----------------------------------------------------------------------------
! Input variables
!----------------------------------------------------------------------------

call MV_AddMeshVar(p%Vars%u, "TowerMotion", MotionFields, DatLoc(ExtLd_u_TowerMotion), Mesh=u%TowerMotion)
call MV_AddMeshVar(p%Vars%u, "HubMotion", MotionFields, DatLoc(ExtLd_u_HubMotion), Mesh=u%HubMotion)
call MV_AddMeshVar(p%Vars%u, "NacelleMotion", MotionFields, DatLoc(ExtLd_u_NacelleMotion), Mesh=u%NacelleMotion)
do i = 1, size(u%BladeRootMotion)
call MV_AddMeshVar(p%Vars%u, "BladeRootMotion"//IdxStr(i), MotionFields, DatLoc(ExtLd_u_BladeRootMotion, i), Mesh=u%BladeRootMotion(i))
end do
do i = 1, size(u%BladeRootMotion)
call MV_AddMeshVar(p%Vars%u, "BladeMotion"//IdxStr(i), MotionFields, DatLoc(ExtLd_u_BladeMotion, i), Mesh=u%BladeMotion(i))
end do
call MV_AddMeshVar(p%Vars%u, 'TowerLoadAD', LoadFields, DatLoc(ExtLd_u_TowerLoadAD), Mesh=u%TowerLoadAD)
do i = 1, size(u%BladeLoadAD)
call MV_AddMeshVar(p%Vars%u, 'BladeLoadAD'//IdxStr(i), LoadFields, DatLoc(ExtLd_u_BladeLoadAD, i), Mesh=u%BladeLoadAD(i))
end do

!----------------------------------------------------------------------------
! Output variables
!----------------------------------------------------------------------------

call MV_AddMeshVar(p%Vars%y, 'TowerLoad', LoadFields, DatLoc(ExtLd_y_TowerLoad), Mesh=y%TowerLoad)
do i = 1, size(y%BladeLoad)
call MV_AddMeshVar(p%Vars%y, 'BladeLoad'//IdxStr(i), LoadFields, DatLoc(ExtLd_y_BladeLoad, i), Mesh=y%BladeLoad(i))
end do
write(*,*) 'Initializing y '

!----------------------------------------------------------------------------
! Initialize Variables and Values
!----------------------------------------------------------------------------

CALL MV_InitVarsJac(p%Vars, m%Jac, Linearize, ErrStat2, ErrMsg2); if (Failed()) return
!............................................................................................
! Define outputs here
!............................................................................................
call Init_y(y, u, m, p, errStat2, errMsg2) ! do this after input meshes have been initialized
call SetErrStat( ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName )
if (ErrStat >= AbortErrLev) return


!............................................................................................
! Define initialization output here
!............................................................................................
call ExtLd_SetInitOut(p, InitOut, errStat2, errMsg2)
call SetErrStat( ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName )


contains
logical function Failed()
8 changes: 0 additions & 8 deletions modules/extloads/src/ExtLoads_Registry.txt
Original file line number Diff line number Diff line change
@@ -35,10 +35,6 @@ typedef ^ InitInputType ReKi TwrPos {:}{:} - - "X-Y-Z reference
typedef ^ InitInputType R8Ki TwrOrient {:}{:}{:} - - "DCM reference orientation of tower (3x3 x NumTowerNodes)" -
typedef ^ InitInputType ReKi az_blend_mean - - - "Mean azimuth at which to blend the external and aerodyn loads" -
typedef ^ InitInputType ReKi az_blend_delta - - - "The width of the tanh function over which to blend the external and aerodyn loads" -
typedef ^ InitInputType ReKi vel_mean - - - "Mean velocity at reference height" m/s
typedef ^ InitInputType ReKi wind_dir - - - "Wind direction" degrees
typedef ^ InitInputType ReKi z_ref - - - "Reference height for velocity profile" m
typedef ^ InitInputType ReKi shear_exp - - - "Shear exponent" -
typedef ^ InitInputType ReKi BldChord {:}{:} - - "Blade chord (NumBladeNodesMax x NumBlades)" m
typedef ^ InitInputType ReKi BldRloc {:}{:} - - "Radial location of each node along the blade" m
typedef ^ InitInputType ReKi TwrDia {:} - - "Tower diameter (NumTwrNodes)" m
@@ -84,10 +80,6 @@ typedef ^ ParameterType Logical TwrAero - .FALSE. - "Flag that tells thi
typedef ^ ParameterType IntKi NumTwrNds - - - "Number of tower nodes" -
typedef ^ ParameterType ReKi az_blend_mean - - - "Mean azimuth at which to blend the external and aerodyn loads" -
typedef ^ ParameterType ReKi az_blend_delta - - - "The width of the tanh function over which to blend the external and aerodyn loads" -
typedef ^ ParameterType ReKi vel_mean - - - "Mean velocity at reference height" m/s
typedef ^ ParameterType ReKi wind_dir - - - "Wind direction" m
typedef ^ ParameterType ReKi z_ref - - - "Reference height for velocity profile" degrees
typedef ^ ParameterType ReKi shear_exp - - - "Shear exponent" -

# ..... Inputs ....................................................................................................................
# Define inputs that are contained on the mesh here:
32 changes: 0 additions & 32 deletions modules/extloads/src/ExtLoads_Types.f90
Original file line number Diff line number Diff line change
@@ -52,10 +52,6 @@ MODULE ExtLoads_Types
REAL(R8Ki) , DIMENSION(:,:,:), ALLOCATABLE :: TwrOrient !< DCM reference orientation of tower (3x3 x NumTowerNodes) [-]
REAL(ReKi) :: az_blend_mean = 0.0_ReKi !< Mean azimuth at which to blend the external and aerodyn loads [-]
REAL(ReKi) :: az_blend_delta = 0.0_ReKi !< The width of the tanh function over which to blend the external and aerodyn loads [-]
REAL(ReKi) :: vel_mean = 0.0_ReKi !< Mean velocity at reference height [m/s]
REAL(ReKi) :: wind_dir = 0.0_ReKi !< Wind direction [degrees]
REAL(ReKi) :: z_ref = 0.0_ReKi !< Reference height for velocity profile [m]
REAL(ReKi) :: shear_exp = 0.0_ReKi !< Shear exponent [-]
REAL(ReKi) , DIMENSION(:,:), ALLOCATABLE :: BldChord !< Blade chord (NumBladeNodesMax x NumBlades) [m]
REAL(ReKi) , DIMENSION(:,:), ALLOCATABLE :: BldRloc !< Radial location of each node along the blade [m]
REAL(ReKi) , DIMENSION(:), ALLOCATABLE :: TwrDia !< Tower diameter (NumTwrNodes) [m]
@@ -110,10 +106,6 @@ MODULE ExtLoads_Types
INTEGER(IntKi) :: NumTwrNds = 0_IntKi !< Number of tower nodes [-]
REAL(ReKi) :: az_blend_mean = 0.0_ReKi !< Mean azimuth at which to blend the external and aerodyn loads [-]
REAL(ReKi) :: az_blend_delta = 0.0_ReKi !< The width of the tanh function over which to blend the external and aerodyn loads [-]
REAL(ReKi) :: vel_mean = 0.0_ReKi !< Mean velocity at reference height [m/s]
REAL(ReKi) :: wind_dir = 0.0_ReKi !< Wind direction [m]
REAL(ReKi) :: z_ref = 0.0_ReKi !< Reference height for velocity profile [degrees]
REAL(ReKi) :: shear_exp = 0.0_ReKi !< Shear exponent [-]
END TYPE ExtLd_ParameterType
! =======================
! ========= ExtLd_InputType =======
@@ -263,10 +255,6 @@ subroutine ExtLd_CopyInitInput(SrcInitInputData, DstInitInputData, CtrlCode, Err
end if
DstInitInputData%az_blend_mean = SrcInitInputData%az_blend_mean
DstInitInputData%az_blend_delta = SrcInitInputData%az_blend_delta
DstInitInputData%vel_mean = SrcInitInputData%vel_mean
DstInitInputData%wind_dir = SrcInitInputData%wind_dir
DstInitInputData%z_ref = SrcInitInputData%z_ref
DstInitInputData%shear_exp = SrcInitInputData%shear_exp
if (allocated(SrcInitInputData%BldChord)) then
LB(1:2) = lbound(SrcInitInputData%BldChord, kind=B8Ki)
UB(1:2) = ubound(SrcInitInputData%BldChord, kind=B8Ki)
@@ -381,10 +369,6 @@ subroutine ExtLd_PackInitInput(RF, Indata)
call RegPackAlloc(RF, InData%TwrOrient)
call RegPack(RF, InData%az_blend_mean)
call RegPack(RF, InData%az_blend_delta)
call RegPack(RF, InData%vel_mean)
call RegPack(RF, InData%wind_dir)
call RegPack(RF, InData%z_ref)
call RegPack(RF, InData%shear_exp)
call RegPackAlloc(RF, InData%BldChord)
call RegPackAlloc(RF, InData%BldRloc)
call RegPackAlloc(RF, InData%TwrDia)
@@ -417,10 +401,6 @@ subroutine ExtLd_UnPackInitInput(RF, OutData)
call RegUnpackAlloc(RF, OutData%TwrOrient); if (RegCheckErr(RF, RoutineName)) return
call RegUnpack(RF, OutData%az_blend_mean); if (RegCheckErr(RF, RoutineName)) return
call RegUnpack(RF, OutData%az_blend_delta); if (RegCheckErr(RF, RoutineName)) return
call RegUnpack(RF, OutData%vel_mean); if (RegCheckErr(RF, RoutineName)) return
call RegUnpack(RF, OutData%wind_dir); if (RegCheckErr(RF, RoutineName)) return
call RegUnpack(RF, OutData%z_ref); if (RegCheckErr(RF, RoutineName)) return
call RegUnpack(RF, OutData%shear_exp); if (RegCheckErr(RF, RoutineName)) return
call RegUnpackAlloc(RF, OutData%BldChord); if (RegCheckErr(RF, RoutineName)) return
call RegUnpackAlloc(RF, OutData%BldRloc); if (RegCheckErr(RF, RoutineName)) return
call RegUnpackAlloc(RF, OutData%TwrDia); if (RegCheckErr(RF, RoutineName)) return
@@ -794,10 +774,6 @@ subroutine ExtLd_CopyParam(SrcParamData, DstParamData, CtrlCode, ErrStat, ErrMsg
DstParamData%NumTwrNds = SrcParamData%NumTwrNds
DstParamData%az_blend_mean = SrcParamData%az_blend_mean
DstParamData%az_blend_delta = SrcParamData%az_blend_delta
DstParamData%vel_mean = SrcParamData%vel_mean
DstParamData%wind_dir = SrcParamData%wind_dir
DstParamData%z_ref = SrcParamData%z_ref
DstParamData%shear_exp = SrcParamData%shear_exp
end subroutine

subroutine ExtLd_DestroyParam(ParamData, ErrStat, ErrMsg)
@@ -843,10 +819,6 @@ subroutine ExtLd_PackParam(RF, Indata)
call RegPack(RF, InData%NumTwrNds)
call RegPack(RF, InData%az_blend_mean)
call RegPack(RF, InData%az_blend_delta)
call RegPack(RF, InData%vel_mean)
call RegPack(RF, InData%wind_dir)
call RegPack(RF, InData%z_ref)
call RegPack(RF, InData%shear_exp)
if (RegCheckErr(RF, RoutineName)) return
end subroutine

@@ -886,10 +858,6 @@ subroutine ExtLd_UnPackParam(RF, OutData)
call RegUnpack(RF, OutData%NumTwrNds); if (RegCheckErr(RF, RoutineName)) return
call RegUnpack(RF, OutData%az_blend_mean); if (RegCheckErr(RF, RoutineName)) return
call RegUnpack(RF, OutData%az_blend_delta); if (RegCheckErr(RF, RoutineName)) return
call RegUnpack(RF, OutData%vel_mean); if (RegCheckErr(RF, RoutineName)) return
call RegUnpack(RF, OutData%wind_dir); if (RegCheckErr(RF, RoutineName)) return
call RegUnpack(RF, OutData%z_ref); if (RegCheckErr(RF, RoutineName)) return
call RegUnpack(RF, OutData%shear_exp); if (RegCheckErr(RF, RoutineName)) return
end subroutine

subroutine ExtLd_CopyInput(SrcInputData, DstInputData, CtrlCode, ErrStat, ErrMsg)
2 changes: 1 addition & 1 deletion modules/map/src/mapapi.c
Original file line number Diff line number Diff line change
@@ -1164,7 +1164,7 @@ MAP_EXTERNCALL void map_set_gravity(MAP_ParameterType_t* p_type, const double gr

MAP_EXTERNCALL void map_set_input_text(MAP_InitInputType_t* init_type, const char* input_txt_line)
{
strncpy(init_type->library_input_str, input_txt_line, 254);
MAP_STRNCPY(init_type->library_input_str, input_txt_line, 254);
init_type->library_input_str[254] = '\0';
}

2 changes: 2 additions & 0 deletions modules/map/src/mapsys.h
Original file line number Diff line number Diff line change
@@ -69,11 +69,13 @@
# define map_snprintf _snprintf
# define map_strcat(a,b,c) strcat_s(a,b,c)
# define MAP_STRCPY(a,b,c) strcpy_s(a,b,c)
# define MAP_STRNCPY(a,b,c) strncpy_s(a,c,b,c)
#else
# include <stdbool.h>
# define map_snprintf snprintf
# define map_strcat(a,b,c) strncat(a,c,b)
# define MAP_STRCPY(a,b,c) strcpy(a,c)
# define MAP_STRNCPY(a,b,c) strncpy(a,b,c)
#endif


10 changes: 1 addition & 9 deletions modules/openfast-library/src/FAST_Library.f90
Original file line number Diff line number Diff line change
@@ -529,7 +529,7 @@ end subroutine FAST_Restart

!==================================================================================================================================
subroutine FAST_ExtLoads_Init(iTurb_c, TMax, InputFileName_c, TurbIDforName, OutFileRoot_c, TurbPosn, AbortErrLev_c, dtDriver_c, dt_c, NumBl_c, &
az_blend_mean_c, az_blend_delta_c, vel_mean_c, wind_dir_c, z_ref_c, shear_exp_c, &
az_blend_mean_c, az_blend_delta_c, &
ExtLd_Input_from_FAST, ExtLd_Parameter_from_FAST, ExtLd_Output_to_FAST, SC_DX_Input_from_FAST, SC_DX_Output_to_FAST, ErrStat_c, ErrMsg_c) BIND (C, NAME='FAST_ExtLoads_Init')
IMPLICIT NONE
#ifndef IMPLICIT_DLLEXPORT
@@ -545,10 +545,6 @@ subroutine FAST_ExtLoads_Init(iTurb_c, TMax, InputFileName_c, TurbIDforName, Out
REAL(C_DOUBLE), INTENT(IN ) :: dtDriver_c
REAL(C_DOUBLE), INTENT(IN ) :: az_blend_mean_c
REAL(C_DOUBLE), INTENT(IN ) :: az_blend_delta_c
REAL(C_DOUBLE), INTENT(IN ) :: vel_mean_c
REAL(C_DOUBLE), INTENT(IN ) :: wind_dir_c
REAL(C_DOUBLE), INTENT(IN ) :: z_ref_c
REAL(C_DOUBLE), INTENT(IN ) :: shear_exp_c
REAL(C_DOUBLE), INTENT( OUT) :: dt_c
INTEGER(C_INT), INTENT( OUT) :: AbortErrLev_c
INTEGER(C_INT), INTENT( OUT) :: NumBl_c
@@ -590,10 +586,6 @@ subroutine FAST_ExtLoads_Init(iTurb_c, TMax, InputFileName_c, TurbIDforName, Out
ExternInitData%DTdriver = dtDriver_c
ExternInitData%az_blend_mean = az_blend_mean_c
ExternInitData%az_blend_delta = az_blend_delta_c
ExternInitData%vel_mean = vel_mean_c
ExternInitData%wind_dir = wind_dir_c
ExternInitData%z_ref = z_ref_c
ExternInitData%shear_exp = shear_exp_c

CALL FAST_InitializeAll_T( t_initial, 1_IntKi, Turbine(iTurb), ErrStat, ErrMsg, InputFileName, ExternInitData )

2 changes: 1 addition & 1 deletion modules/openfast-library/src/FAST_Library.h
Original file line number Diff line number Diff line change
@@ -28,7 +28,7 @@ EXTERNAL_ROUTINE void FAST_ExtInfw_Init(int * iTurb, double *TMax, const char *I
int *ErrStat, char *ErrMsg);

EXTERNAL_ROUTINE void FAST_ExtLoads_Restart(int * iTurb, const char *CheckpointRootName, int *AbortErrLev, double * dt, int * NumBl, int * n_t_global, ExtLdDX_InputType_t* ExtLdDX_Input, ExtLdDX_ParameterType_t* ExtLdDX_Parameter, ExtLdDX_OutputType_t* ExtLdDX_Output, SC_DX_InputType_t* SC_DX_Input, SC_DX_OutputType_t* SC_DX_Output, int *ErrStat, char *ErrMsg);
EXTERNAL_ROUTINE void FAST_ExtLoads_Init(int * iTurb, double *TMax, const char *InputFileName, int * TurbineID, char *OutFileRoot, float * TurbinePosition, int *AbortErrLev, double * dtDriver, double * dt, int * NumBl, double * az_blend_mean, double * az_blend_delta, double * vel_mean, double * wind_dir, double * z_ref, double * shear_exp, ExtLdDX_InputType_t* ExtLdDX_Input, ExtLdDX_ParameterType_t* ExtLdDX_Parameter, ExtLdDX_OutputType_t* ExtLdDX_Output, SC_DX_InputType_t* SC_DX_Input, SC_DX_OutputType_t* SC_DX_Output, int *ErrStat, char *ErrMsg);
EXTERNAL_ROUTINE void FAST_ExtLoads_Init(int * iTurb, double *TMax, const char *InputFileName, int * TurbineID, char *OutFileRoot, float * TurbinePosition, int *AbortErrLev, double * dtDriver, double * dt, int * NumBl, double * az_blend_mean, double * az_blend_delta, ExtLdDX_InputType_t* ExtLdDX_Input, ExtLdDX_ParameterType_t* ExtLdDX_Parameter, ExtLdDX_OutputType_t* ExtLdDX_Output, SC_DX_InputType_t* SC_DX_Input, SC_DX_OutputType_t* SC_DX_Output, int *ErrStat, char *ErrMsg);
EXTERNAL_ROUTINE void FAST_CFD_Solution0(int * iTurb, int *ErrStat, char *ErrMsg);
EXTERNAL_ROUTINE void FAST_CFD_InitIOarrays_SubStep(int * iTurb, int *ErrStat, char *ErrMsg);
EXTERNAL_ROUTINE void FAST_CFD_Prework(int * iTurb, int *ErrStat, char *ErrMsg);
4 changes: 0 additions & 4 deletions modules/openfast-library/src/FAST_Registry.txt
Original file line number Diff line number Diff line change
@@ -885,10 +885,6 @@ typedef ^ FAST_ExternInitType DbKi DTdriver - -1 - "Externa
typedef ^ FAST_ExternInitType Logical TwrAero - .false. - "Is Tower aerodynamics enabled for ExtLoads module?"
typedef ^ FAST_ExternInitType ReKi az_blend_mean - - - "Mean azimuth at which to blend the external and aerodyn loads" -
typedef ^ FAST_ExternInitType ReKi az_blend_delta - - - "Mean azimuth at which to blend the external and aerodyn loads" -
typedef ^ FAST_ExternInitType ReKi vel_mean - - - "Mean velocity at reference height" m/s
typedef ^ FAST_ExternInitType ReKi wind_dir - - - "Wind direction in compass angle" degrees
typedef ^ FAST_ExternInitType ReKi z_ref - - - "Reference height for velocity profile" m
typedef ^ FAST_ExternInitType ReKi shear_exp - - - "Shear exponent" -

# ..... FAST Turbine Data (one realization) .......................................................................................................
typedef ^ FAST_TurbineType IntKi TurbID - 1 - "Turbine ID Number" -
119 changes: 2 additions & 117 deletions modules/openfast-library/src/FAST_Solver.f90
Original file line number Diff line number Diff line change
@@ -587,88 +587,6 @@ SUBROUTINE IfW_InputSolve( p_FAST, m_FAST, u_IfW, p_IfW, u_AD, OtherSt_AD, y_ED,

END SUBROUTINE IfW_InputSolve

!----------------------------------------------------------------------------------------------------------------------------------
SUBROUTINE ExtLd_UpdateFlowField( p_FAST, u_AD, m_AD, ExtLd, ErrStat, ErrMsg )
type(FAST_ParameterType), intent(in) :: p_FAST !< FAST parameter data
type(AD_InputType), intent(in ) :: u_AD !< The inputs to AeroDyn
type(AD_MiscvarType), intent(in ) :: m_AD !< AeroDyn MiscVars
type(ExtLoads_Data), intent(in ) :: ExtLd !< ExtLoads data
integer(IntKi) :: ErrStat !< Error status of the operation
character(*) :: ErrMsg !< Error message if ErrStat /= ErrID_None

!local variables
real(ReKi) :: z !< Local 'z' coordinate
real(ReKi) :: pi !< Our favorite number
integer(IntKi) :: j,k !< Local counter variables
integer(IntKi) :: NumBl !< Number of blades
integer(IntKi) :: iPt !< Point in the flow field array. Make sure this order corresponds to what AD15 uses!!!!!!


ErrStat = ErrID_None
ErrMsg = ''

NumBl = size(u_AD%rotors(1)%BladeMotion)

iPt=1

! Hub
if (u_AD%rotors(1)%HubMotion%committed) then
! height
z = u_AD%rotors(1)%HubMotion%Position(3,1) + u_AD%rotors(1)%HubMotion%TranslationDisp(3,1)
call SetWind(iPt,z); iPt = iPt + 1
endif

! Blades
do k=1,NumBl
do j=1,u_AD%rotors(1)%BladeMotion(k)%nNodes
! height
z = u_AD%rotors(1)%BladeMotion(k)%Position(3,j) + u_AD%rotors(1)%BladeMotion(k)%TranslationDisp(3,j)
call SetWind(iPt,z); iPt = iPt + 1
end do
end do

!FIXME this should probably be checked against a parameter instead of digging into miscvars of AD
! Tower
if ( allocated(m_AD%Inflow(1)%RotInflow(1)%Tower%InflowVel) ) then
do j=1,u_AD%rotors(1)%TowerMotion%nNodes
! height
z = u_AD%rotors(1)%TowerMotion%Position(3,j) + u_AD%rotors(1)%TowerMotion%TranslationDisp(3,j)
call SetWind(iPt,z); iPt = iPt + 1
end do
end if

! Nacelle
if (u_AD%rotors(1)%NacelleMotion%committed) then
! height
z = u_AD%rotors(1)%NacelleMotion%Position(3,1) + u_AD%rotors(1)%NacelleMotion%TranslationDisp(3,1)
call SetWind(iPt,z); iPt = iPt + 1
endif

! Tailfin
if (u_AD%rotors(1)%TFinMotion%committed) then
! height
z = u_AD%rotors(1)%TFinMotion%Position(3,1) + u_AD%rotors(1)%TFinMotion%TranslationDisp(3,1)
call SetWind(iPt,z); iPt = iPt + 1
endif

contains
function mean_vel(z_h)
real(ReKi) :: z_h !< height
real(ReKi) :: mean_vel !< mean velocity at height z_h
mean_vel = ExtLd%p%vel_mean * ( (z_h/ExtLd%p%z_ref) ** ExtLd%p%shear_exp)
end function
subroutine SetWind(i,z_h)
integer(IntKi) :: i ! point num
real(ReKi) :: z_h !< height
ExtLd%m%FlowField%Points%Vel(1,iPt) = -mean_vel(z_h) * sin(ExtLd%p%wind_dir * pi / 180.0)
ExtLd%m%FlowField%Points%Vel(2,iPt) = -mean_vel(z_h) * cos(ExtLd%p%wind_dir * pi / 180.0)
ExtLd%m%FlowField%Points%Vel(3,iPt) = 0.0
end subroutine
END SUBROUTINE ExtLd_UpdateFlowField




!----------------------------------------------------------------------------------------------------------------------------------
!> This routine sets all the AeroDyn inputs, except for the wind inflow values.
SUBROUTINE AD_InputSolve_NoIfW( p_FAST, u_AD, y_SrvD, y_ED, y_SED, BD, MeshMapData, ErrStat, ErrMsg )
@@ -961,20 +879,6 @@ SUBROUTINE SrvD_InputSolve( p_FAST, m_FAST, u_SrvD, y_ED, y_SED, y_IfW, y_ExtInf
if (allocated(u_SrvD%MsrPositionsY)) u_SrvD%MsrPositionsY = 0.0
if (allocated(u_SrvD%MsrPositionsz)) u_SrvD%MsrPositionsz = 0.0

ELSE IF (p_FAST%CompAero == Module_ExtLd ) THEN

pi = acos(-1.0)
z = y_ED%HubPtMotion%Position(3,1)
mean_vel = p_ExtLd%vel_mean * ( (z/p_ExtLd%z_ref) ** p_ExtLd%shear_exp)
u = -mean_vel * sin(p_ExtLd%wind_dir * pi / 180.0)
v = -mean_vel * cos(p_ExtLd%wind_dir * pi / 180.0)
u_SrvD%HorWindV = mean_vel
u_SrvD%WindDir = atan2( v, u)
if (allocated(u_SrvD%LidSpeed )) u_SrvD%LidSpeed = 0.0
if (allocated(u_SrvD%MsrPositionsX)) u_SrvD%MsrPositionsX = 0.0
if (allocated(u_SrvD%MsrPositionsY)) u_SrvD%MsrPositionsY = 0.0
if (allocated(u_SrvD%MsrPositionsz)) u_SrvD%MsrPositionsz = 0.0

ELSE ! No wind inflow

u_SrvD%WindDir = 0.0
@@ -5199,15 +5103,9 @@ SUBROUTINE CalcOutputs_And_SolveForInputs( n_t_global, this_time, this_state, ca
CALL AD_InputSolve_NoIfW( p_FAST, AD%Input(1), SrvD%y, ED%y, SED%y, BD, MeshMapData, ErrStat2, ErrMsg2 )
CALL SetErrStat( ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName )

CALL ExtLd_UpdateFlowField( p_FAST, AD%Input(1), AD%m, ExtLd, ErrStat2, ErrMsg2 )
CALL SetErrStat( ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName )

CALL ExtLd_InputSolve_NoIfW( p_FAST, ExtLd%u, ExtLd%p, ED%y, BD, MeshMapData, ErrStat2, ErrMsg2 )
CALL SetErrStat( ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName )

IF ( p_FAST%CompInflow == MODULE_IfW .OR. p_FAST%CompInflow == MODULE_ExtInfw ) THEN
CALL SetErrStat(ErrID_Fatal,'p_FAST%CompInflow option not setup to work with ExtLoads module.',ErrStat,ErrMsg,RoutineName)
ENDIF
END IF

IF ( p_FAST%CompInflow == Module_IfW ) THEN
@@ -5632,14 +5530,8 @@ SUBROUTINE SolveOption2c_Inp2AD_SrvD(this_time, this_state, p_FAST, m_FAST, ED,
! CALL SetErrStat( ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName )
! CALL ExtInfw_SetWriteOutput(OpFM)
END IF

IF (p_FAST%CompAero == Module_ExtLd ) THEN
! The outputs from ExternalInflow need to be transfered to the FlowField for use by AeroDyn, this seems like the right place
call ExtLd_UpdateFlowField( p_FAST, AD%Input(1), AD%m, ExtLd, ErrStat2, ErrMsg2 )
call SetErrStat( ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName )
END IF




IF ( p_FAST%CompServo == Module_SrvD ) THEN
CALL SrvD_InputSolve( p_FAST, m_FAST, SrvD%Input(1), ED%y, SED%y, IfW%y, ExtInfw%y, ExtLd%p, BD%y, SD%y, MeshMapData, ErrStat2, ErrMsg2 )
CALL SetErrStat( ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName )
@@ -5716,13 +5608,6 @@ SUBROUTINE SolveOption2(this_time, this_state, p_FAST, m_FAST, ED, SED, BD, AD,

ELSE IF (p_FAST%CompAero == Module_ExtLd ) THEN

IF ( p_FAST%CompInflow == MODULE_IfW .OR. p_FAST%CompInflow == MODULE_ExtInfw ) THEN
CALL SetErrStat(ErrID_Fatal,'p_FAST%CompInflow option not setup to work with ExtLoads module.',ErrStat,ErrMsg,RoutineName)
ENDIF

CALL ExtLd_UpdateFlowField( p_FAST, AD%Input(1), AD%m, ExtLd, ErrStat2, ErrMsg2 )
CALL SetErrStat( ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName )

CALL AD_CalcOutput( this_time, AD%Input(1), AD%p, AD%x(this_state), AD%xd(this_state), AD%z(this_state), &
AD%OtherSt(this_state), AD%y, AD%m, ErrStat2, ErrMsg2, WriteThisStep )
CALL SetErrStat( ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName )
16 changes: 7 additions & 9 deletions modules/openfast-library/src/FAST_Subs.f90
Original file line number Diff line number Diff line change
@@ -1954,6 +1954,8 @@ SUBROUTINE ValidateInputData(p, m_FAST, ErrStat, ErrMsg)
! No method at the moment for getting disk average velocity from ExtInfw
if (p%CompAero == Module_ADsk .and. p%CompInflow == MODULE_ExtInfw) call SetErrStat( ErrID_Fatal, 'AeroDisk cannot be used with ExtInflow or the library interface', ErrStat, ErrMsg, RoutineName )

if ((p%CompAero == Module_ExtLd) .and. (p%CompInflow /= Module_IfW) ) call SetErrStat(ErrID_Fatal, 'Inflow module must be used when ExtLoads is used. Change CompAero or CompInflow in the OpenFAST input file.', ErrStat, ErrMsg, RoutineName)

IF (p%CompAero == Module_ADsk .and. p%MHK /= MHK_None) CALL SetErrStat( ErrID_Fatal, 'AeroDisk cannot be used with an MHK turbine. Change CompAero or MHK in the FAST input file.', ErrStat, ErrMsg, RoutineName )

IF (p%MHK /= MHK_None .and. p%MHK /= MHK_FixedBottom .and. p%MHK /= MHK_Floating) CALL SetErrStat( ErrID_Fatal, 'MHK switch is invalid. Set MHK to 0, 1, or 2 in the FAST input file.', ErrStat, ErrMsg, RoutineName )
@@ -4449,18 +4451,14 @@ SUBROUTINE ExtLd_SetInitInput(InitInData_ExtLd, InitOutData_ED, y_ED, InitOutDat

end if

InitInData_ExtLd%HubPos = y_ED%HubPtMotion%Position(:,1)
InitInData_ExtLd%HubOrient = y_ED%HubPtMotion%RefOrientation(:,:,1)
InitInData_ExtLd%HubPos = y_ED%HubPtMotion%Position(:,1)
InitInData_ExtLd%HubOrient = y_ED%HubPtMotion%RefOrientation(:,:,1)

InitInData_ExtLd%NacellePos = y_ED%NacelleMotion%Position(:,1)
InitInData_ExtLd%NacelleOrient = y_ED%NacelleMotion%RefOrientation(:,:,1)
InitInData_ExtLd%NacellePos = y_ED%NacelleMotion%Position(:,1)
InitInData_ExtLd%NacelleOrient = y_ED%NacelleMotion%RefOrientation(:,:,1)

InitInData_ExtLd%az_blend_mean = ExternInitData%az_blend_mean
InitInData_ExtLd%az_blend_mean = ExternInitData%az_blend_mean
InitInData_ExtLd%az_blend_delta = ExternInitData%az_blend_delta
InitInData_ExtLd%vel_mean = ExternInitData%vel_mean
InitInData_ExtLd%wind_dir = ExternInitData%wind_dir
InitInData_ExtLd%z_ref = ExternInitData%z_ref
InitInData_ExtLd%shear_exp = ExternInitData%shear_exp

!Interpolate chord from AeroDyn to nodes of the ExtLoads module
IF (.NOT. ALLOCATED( InitInData_ExtLd%BldChord) ) THEN
16 changes: 0 additions & 16 deletions modules/openfast-library/src/FAST_Types.f90
Original file line number Diff line number Diff line change
@@ -895,10 +895,6 @@ MODULE FAST_Types
LOGICAL :: TwrAero = .false. !< Is Tower aerodynamics enabled for ExtLoads module? [-]
REAL(ReKi) :: az_blend_mean = 0.0_ReKi !< Mean azimuth at which to blend the external and aerodyn loads [-]
REAL(ReKi) :: az_blend_delta = 0.0_ReKi !< Mean azimuth at which to blend the external and aerodyn loads [-]
REAL(ReKi) :: vel_mean = 0.0_ReKi !< Mean velocity at reference height [m/s]
REAL(ReKi) :: wind_dir = 0.0_ReKi !< Wind direction in compass angle [degrees]
REAL(ReKi) :: z_ref = 0.0_ReKi !< Reference height for velocity profile [m]
REAL(ReKi) :: shear_exp = 0.0_ReKi !< Shear exponent [-]
END TYPE FAST_ExternInitType
! =======================
! ========= FAST_TurbineType =======
@@ -16556,10 +16552,6 @@ subroutine FAST_CopyExternInitType(SrcExternInitTypeData, DstExternInitTypeData,
DstExternInitTypeData%TwrAero = SrcExternInitTypeData%TwrAero
DstExternInitTypeData%az_blend_mean = SrcExternInitTypeData%az_blend_mean
DstExternInitTypeData%az_blend_delta = SrcExternInitTypeData%az_blend_delta
DstExternInitTypeData%vel_mean = SrcExternInitTypeData%vel_mean
DstExternInitTypeData%wind_dir = SrcExternInitTypeData%wind_dir
DstExternInitTypeData%z_ref = SrcExternInitTypeData%z_ref
DstExternInitTypeData%shear_exp = SrcExternInitTypeData%shear_exp
end subroutine

subroutine FAST_DestroyExternInitType(ExternInitTypeData, ErrStat, ErrMsg)
@@ -16606,10 +16598,6 @@ subroutine FAST_PackExternInitType(RF, Indata)
call RegPack(RF, InData%TwrAero)
call RegPack(RF, InData%az_blend_mean)
call RegPack(RF, InData%az_blend_delta)
call RegPack(RF, InData%vel_mean)
call RegPack(RF, InData%wind_dir)
call RegPack(RF, InData%z_ref)
call RegPack(RF, InData%shear_exp)
if (RegCheckErr(RF, RoutineName)) return
end subroutine

@@ -16645,10 +16633,6 @@ subroutine FAST_UnPackExternInitType(RF, OutData)
call RegUnpack(RF, OutData%TwrAero); if (RegCheckErr(RF, RoutineName)) return
call RegUnpack(RF, OutData%az_blend_mean); if (RegCheckErr(RF, RoutineName)) return
call RegUnpack(RF, OutData%az_blend_delta); if (RegCheckErr(RF, RoutineName)) return
call RegUnpack(RF, OutData%vel_mean); if (RegCheckErr(RF, RoutineName)) return
call RegUnpack(RF, OutData%wind_dir); if (RegCheckErr(RF, RoutineName)) return
call RegUnpack(RF, OutData%z_ref); if (RegCheckErr(RF, RoutineName)) return
call RegUnpack(RF, OutData%shear_exp); if (RegCheckErr(RF, RoutineName)) return
end subroutine

subroutine FAST_CopyTurbineType(SrcTurbineTypeData, DstTurbineTypeData, CtrlCode, ErrStat, ErrMsg)
24 changes: 11 additions & 13 deletions modules/simple-elastodyn/src/SED_Registry.txt
Original file line number Diff line number Diff line change
@@ -57,7 +57,7 @@ typedef ^ InitOutputType CHARACTER(ChanLen) WriteOutputUnt {:} -
typedef ^ InitOutputType ProgDesc Ver - - - "This module's name, version, and date" -
typedef ^ InitOutputType IntKi NumBl - - - "Number of blades on the turbine" -
typedef ^ InitOutputType ReKi BlPitch {:} - - "Initial blade pitch angles" radians
typedef ^ InitOutputType ReKi BladeLength - - - "Blade length (for AeroDyn)" meters
typedef ^ InitOutputType ReKi BladeLength - - - "Blade length (for AeroDsk)" meters
typedef ^ InitOutputType ReKi TowerHt - - - "Tower Height" meters
typedef ^ InitOutputType ReKi HubHt - - - "Height of the hub" meters
typedef ^ InitOutputType ReKi PlatformPos {6} - - "Initial platform position (6 DOFs)"
@@ -68,7 +68,7 @@ typedef ^ InitOutputType ModVarsType Vars - -

# ..... Inputs ....................................................................................................................
# inputs on meshes:
typedef ^ InputType MeshType HubPtLoad - - - "AeroDisk maps load to hub" -
typedef ^ InputType MeshType HubPtLoad - - - "AeroDyn/AeroDisk maps load to hub" -
# inputs not on meshes:
typedef ^ InputType ReKi HSSBrTrqC - - - "Commanded HSS brake torque" N-m
typedef ^ InputType ReKi GenTrq - - - "Electrical generator torque" N-m
@@ -79,11 +79,11 @@ typedef ^ InputType ReKi YawRateCom - -

# ..... Outputs ...................................................................................................................
# outputs on meshes:
typedef ^ OutputType MeshType BladeRootMotion {:} - - "For AeroDyn/BeamDyn: motions at the blade roots" -
typedef ^ OutputType MeshType HubPtMotion - - - "For AeroDyn and Lidar(InflowWind): motions of the hub" -
typedef ^ OutputType MeshType NacelleMotion - - - "For AeroDyn14 & ServoDyn/TMD: motions of the nacelle." -
typedef ^ OutputType MeshType TowerLn2Mesh - - - "Tower line2 mesh with positions/orientations/velocities/accelerations" -
typedef ^ OutputType MeshType PlatformPtMesh - - - "Platform reference point positions/orientations/velocities/accelerations" -
typedef ^ OutputType MeshType BladeRootMotion {:} - - "For AeroDyn: motions at the blade roots" -
typedef ^ OutputType MeshType HubPtMotion - - - "For AeroDyn/AeroDisk: motions of the hub" -
typedef ^ OutputType MeshType NacelleMotion - - - "For AeroDyn: for aero effects in AD (aero nacelle loads ignored)" -
typedef ^ OutputType MeshType TowerLn2Mesh - - - "Tower line2 mesh for visualization / Aero tower effects" -
typedef ^ OutputType MeshType PlatformPtMesh - - - "Platform reference point for visualization" -
#TODO: any mesh for visualization of blades/rotor disk?
# outputs not on meshes:
typedef ^ OutputType ReKi LSSTipPxa - - 2pi "Rotor azimuth angle (position)" radians
@@ -104,7 +104,7 @@ typedef ^ ContinuousStateType R8Ki QT {:} -
typedef ^ ContinuousStateType ^ QDT {:} - - "Current estimate of QD (velocity matrix) for each degree of freedom"

# Define discrete (nondifferentiable) states here:
typedef ^ DiscreteStateType ReKi DummyDiscreteState - - - "" -
typedef ^ DiscreteStateType ReKi DummyDiscreteState - - - "" -

# Define constraint states here:
typedef ^ ConstraintStateType ReKi DummyConstrState - - - "" -
@@ -116,7 +116,7 @@ typedef ^ OtherStateType IntKi IC {SED_NMX} -
typedef ^ OtherStateType ReKi HSSBrTrq - - - "HSSBrTrq from update states; a hack to get this working with a single integrator" -
typedef ^ OtherStateType ReKi HSSBrTrqC - - - "Commanded HSS brake torque (adjusted for sign)" N-m
typedef ^ OtherStateType IntKi SgnPrvLSTQ - - - "The sign of the low-speed shaft torque from the previous call to RtHS(). NOTE: The low-speed shaft torque is assumed to be positive at the beginning of the run!" -
typedef ^ OtherStateType IntKi SgnLSTQ {SED_NMX} - - "history of sign of LSTQ"
typedef ^ OtherStateType IntKi SgnLSTQ {SED_NMX} - - "history of sign of LSTQ (for HSS brake)"



@@ -150,10 +150,8 @@ typedef ^ ParameterType OutParmType OutParam {:} -

# ..... Misc/Optimization variables.................................................................................................
typedef ^ MiscVarType ReKi AllOuts {:} - - "Array of all outputs" -
#typedef ^ MiscVarType MeshMapType mapPtf2Twr - - - "Mesh mapping from Ptfm to Tower line" -
#typedef ^ MiscVarType MeshMapType mapTwr2Nac - - - "Mesh mapping from Tower to Nacelle" -
typedef ^ MiscVarType MeshMapType mapNac2Hub - - - "Mesh mapping from Nacelle to Hub" -
typedef ^ MiscVarType MeshMapType mapHub2Root {:} - - "Mesh mapping from Hub to BladeRootMotion" -
typedef ^ MiscVarType MeshMapType mapNac2Hub - - - "Mesh mapping from Nacelle to Hub (hub rotation overwritten in calc)" -
typedef ^ MiscVarType MeshMapType mapHub2Root {:} - - "Mesh mapping from Hub to BladeRootMotion (blade pitch overwritten in calc)" -
typedef ^ MiscVarType R8Ki QD2T {:} - - "Current estimate of first derivative of QD (acceleration matrix) for each degree of freedom"
typedef ^ MiscVarType ReKi HubPt_X {3} - - "X orientation of hub calculated in CalcOutput -- saving so we don't recalculate a bunch of things to get it in UpdateStates"
typedef ^ MiscVarType ModJacType Jac - - - "Values corresponding to module variables"
20 changes: 10 additions & 10 deletions modules/simple-elastodyn/src/SED_Types.f90
Original file line number Diff line number Diff line change
@@ -78,7 +78,7 @@ MODULE SED_Types
TYPE(ProgDesc) :: Ver !< This module's name, version, and date [-]
INTEGER(IntKi) :: NumBl = 0_IntKi !< Number of blades on the turbine [-]
REAL(ReKi) , DIMENSION(:), ALLOCATABLE :: BlPitch !< Initial blade pitch angles [radians]
REAL(ReKi) :: BladeLength = 0.0_ReKi !< Blade length (for AeroDyn) [meters]
REAL(ReKi) :: BladeLength = 0.0_ReKi !< Blade length (for AeroDsk) [meters]
REAL(ReKi) :: TowerHt = 0.0_ReKi !< Tower Height [meters]
REAL(ReKi) :: HubHt = 0.0_ReKi !< Height of the hub [meters]
REAL(ReKi) , DIMENSION(1:6) :: PlatformPos = 0.0_ReKi !< Initial platform position (6 DOFs) [-]
@@ -90,7 +90,7 @@ MODULE SED_Types
! =======================
! ========= SED_InputType =======
TYPE, PUBLIC :: SED_InputType
TYPE(MeshType) :: HubPtLoad !< AeroDisk maps load to hub [-]
TYPE(MeshType) :: HubPtLoad !< AeroDyn/AeroDisk maps load to hub [-]
REAL(ReKi) :: HSSBrTrqC = 0.0_ReKi !< Commanded HSS brake torque [N-m]
REAL(ReKi) :: GenTrq = 0.0_ReKi !< Electrical generator torque [N-m]
REAL(ReKi) , DIMENSION(:), ALLOCATABLE :: BlPitchCom !< Commanded blade pitch angles [radians]
@@ -100,11 +100,11 @@ MODULE SED_Types
! =======================
! ========= SED_OutputType =======
TYPE, PUBLIC :: SED_OutputType
TYPE(MeshType) , DIMENSION(:), ALLOCATABLE :: BladeRootMotion !< For AeroDyn/BeamDyn: motions at the blade roots [-]
TYPE(MeshType) :: HubPtMotion !< For AeroDyn and Lidar(InflowWind): motions of the hub [-]
TYPE(MeshType) :: NacelleMotion !< For AeroDyn14 & ServoDyn/TMD: motions of the nacelle. [-]
TYPE(MeshType) :: TowerLn2Mesh !< Tower line2 mesh with positions/orientations/velocities/accelerations [-]
TYPE(MeshType) :: PlatformPtMesh !< Platform reference point positions/orientations/velocities/accelerations [-]
TYPE(MeshType) , DIMENSION(:), ALLOCATABLE :: BladeRootMotion !< For AeroDyn: motions at the blade roots [-]
TYPE(MeshType) :: HubPtMotion !< For AeroDyn/AeroDisk: motions of the hub [-]
TYPE(MeshType) :: NacelleMotion !< For AeroDyn: for aero effects in AD (aero nacelle loads ignored) [-]
TYPE(MeshType) :: TowerLn2Mesh !< Tower line2 mesh for visualization / Aero tower effects [-]
TYPE(MeshType) :: PlatformPtMesh !< Platform reference point for visualization [-]
REAL(ReKi) :: LSSTipPxa = 0.0_ReKi !< Rotor azimuth angle (position) [radians]
REAL(ReKi) :: RotSpeed = 0.0_ReKi !< Rotor azimuth angular speed [rad/s]
REAL(ReKi) :: RotPwr = 0.0_ReKi !< Rotor power [W]
@@ -140,7 +140,7 @@ MODULE SED_Types
REAL(ReKi) :: HSSBrTrq = 0.0_ReKi !< HSSBrTrq from update states; a hack to get this working with a single integrator [-]
REAL(ReKi) :: HSSBrTrqC = 0.0_ReKi !< Commanded HSS brake torque (adjusted for sign) [N-m]
INTEGER(IntKi) :: SgnPrvLSTQ = 0_IntKi !< The sign of the low-speed shaft torque from the previous call to RtHS(). NOTE: The low-speed shaft torque is assumed to be positive at the beginning of the run! [-]
INTEGER(IntKi) , DIMENSION(1:SED_NMX) :: SgnLSTQ = 0_IntKi !< history of sign of LSTQ [-]
INTEGER(IntKi) , DIMENSION(1:SED_NMX) :: SgnLSTQ = 0_IntKi !< history of sign of LSTQ (for HSS brake) [-]
END TYPE SED_OtherStateType
! =======================
! ========= SED_ParameterType =======
@@ -175,8 +175,8 @@ MODULE SED_Types
! ========= SED_MiscVarType =======
TYPE, PUBLIC :: SED_MiscVarType
REAL(ReKi) , DIMENSION(:), ALLOCATABLE :: AllOuts !< Array of all outputs [-]
TYPE(MeshMapType) :: mapNac2Hub !< Mesh mapping from Nacelle to Hub [-]
TYPE(MeshMapType) , DIMENSION(:), ALLOCATABLE :: mapHub2Root !< Mesh mapping from Hub to BladeRootMotion [-]
TYPE(MeshMapType) :: mapNac2Hub !< Mesh mapping from Nacelle to Hub (hub rotation overwritten in calc) [-]
TYPE(MeshMapType) , DIMENSION(:), ALLOCATABLE :: mapHub2Root !< Mesh mapping from Hub to BladeRootMotion (blade pitch overwritten in calc) [-]
REAL(R8Ki) , DIMENSION(:), ALLOCATABLE :: QD2T !< Current estimate of first derivative of QD (acceleration matrix) for each degree of freedom [-]
REAL(ReKi) , DIMENSION(1:3) :: HubPt_X = 0.0_ReKi !< X orientation of hub calculated in CalcOutput -- saving so we don't recalculate a bunch of things to get it in UpdateStates [-]
TYPE(ModJacType) :: Jac !< Values corresponding to module variables [-]
4 changes: 2 additions & 2 deletions openfast_python/openfast_io/FAST_writer.py
Original file line number Diff line number Diff line change
@@ -215,8 +215,8 @@ def write_MainInput(self):
f.write('{:<22} {:<11} {:}'.format(self.fst_vt['Fst']['UJacSclFact'], 'UJacSclFact', '- Scaling factor used in Jacobians (-)\n'))
f.write('---------------------- FEATURE SWITCHES AND FLAGS ------------------------------\n')
f.write('{:<22} {:<11} {:}'.format(self.fst_vt['Fst']['CompElast'], 'CompElast', '- Compute structural dynamics (switch) {1=ElastoDyn; 2=ElastoDyn + BeamDyn for blades}\n'))
f.write('{:<22} {:<11} {:}'.format(self.fst_vt['Fst']['CompInflow'], 'CompInflow', '- Compute inflow wind velocities (switch) {0=still air; 1=InflowWind; 2=external from OpenFOAM}\n'))
f.write('{:<22} {:<11} {:}'.format(self.fst_vt['Fst']['CompAero'], 'CompAero', '- Compute aerodynamic loads (switch) {0=None; 1=AeroDyn v14; 2=AeroDyn v15}\n'))
f.write('{:<22} {:<11} {:}'.format(self.fst_vt['Fst']['CompInflow'], 'CompInflow', '- Compute inflow wind velocities (switch) {0=still air; 1=InflowWind; 2=external from ExtInflow}\n'))
f.write('{:<22} {:<11} {:}'.format(self.fst_vt['Fst']['CompAero'], 'CompAero', '- Compute aerodynamic loads (switch) {0=None; 1=AeroDisk; 2=AeroDyn v15; 3=ExtLoads}\n'))
f.write('{:<22} {:<11} {:}'.format(self.fst_vt['Fst']['CompServo'], 'CompServo', '- Compute control and electrical-drive dynamics (switch) {0=None; 1=ServoDyn}\n'))
f.write('{:<22} {:<11} {:}'.format(self.fst_vt['Fst']['CompHydro'], 'CompHydro', '- Compute hydrodynamic loads (switch) {0=None; 1=HydroDyn}\n'))
f.write('{:<22} {:<11} {:}'.format(self.fst_vt['Fst']['CompSub'], 'CompSub', '- Compute sub-structural dynamics (switch) {0=None; 1=SubDyn; 2=External Platform MCKF}\n'))
You are viewing a condensed version of this merge commit. You can view the full changes here.