Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
133 commits
Select commit Hold shift + click to select a range
ea47f53
Update of Unsteady Aero model UAMod=2, corrections and added parameters
alvarogonzalezsalcedo Mar 6, 2018
b65aac8
UA bug fix: xd%tau_V was updated too early
bjonkman Jun 15, 2018
a3f79b1
UA: updated comments
bjonkman Jun 15, 2018
1cf29d4
UA: fix condition around vortex shedding - incomplete?
bjonkman Jun 15, 2018
ea5d2db
UA: Changed definition of VRTX
bjonkman Jun 15, 2018
c711f7d
Draft of Floating Linearization + SS_Excitation module
Jun 18, 2018
78bc818
Merged UA mods from IAT (CENER)
bjonkman Jun 18, 2018
0777da5
UA bug fixes from merge of Alvaro's code
bjonkman Jun 18, 2018
5d445a5
UA: cleaned up some logic and removed non-standard tab formatting
bjonkman Jun 18, 2018
624353f
Merged UA updates from CENER and NREL-Envision meeting
bjonkman Jun 19, 2018
f792f8d
UA: Removed comment that doesn't seem to apply
bjonkman Jun 19, 2018
508957a
UA: removed unused variables
bjonkman Jun 19, 2018
aac9105
UA: reverted some code I had changed from Alvaro
bjonkman Jun 19, 2018
d4e968f
UA: Fixed definition of fprimeprime_m from bad merge
bjonkman Jun 19, 2018
9e257fb
Some proposed corrections to merge the UA model Gonzalez with the Env…
alvarogonzalezsalcedo Jul 25, 2018
c15e93c
Draft additions for Floating Linearization
HaymanConsulting Sep 26, 2018
00bdd74
Merge remote-tracking branch 'NREL/dev' into f/Envision
HaymanConsulting Sep 27, 2018
ffcef0c
Merge remote-tracking branch 'NREL/dev' into f/Airfoil-interp
bjonkman Oct 4, 2018
f582f34
Additional map linearization features
HaymanConsulting Oct 15, 2018
1a44aea
Bug Fixes and DerivOrder feature
HaymanConsulting Oct 15, 2018
1aa3e24
Augmented PackMesh routines for MAP
HaymanConsulting Oct 15, 2018
c967abf
Updates to FASTlib VS settings.
HaymanConsulting Oct 15, 2018
d32f0d4
Merge remote-tracking branch 'NREL/dev' into f/FloatingLin
HaymanConsulting Oct 15, 2018
8446d94
Merge remote-tracking branch 'NREL/dev' into f/Airfoil-interp
bjonkman Oct 18, 2018
c2ab13c
AD: updated AFI module with 2D interp code
bjonkman Oct 18, 2018
1be22b8
AFI: change default interpolation to linear
bjonkman Oct 18, 2018
cbfba9b
AD big fix: calculation of Re
bjonkman Oct 18, 2018
b99abba
Fixed bugs with Continuous States
HaymanConsulting Oct 19, 2018
6b1c488
Added MAP_Fortran_Registry related files to cmake
HaymanConsulting Oct 25, 2018
fdd2826
Updated HydroDyn cmake for floating linearization
HaymanConsulting Oct 25, 2018
e566034
Fixed bug with WaveElev0 datatype in SS_Excitation module
HaymanConsulting Oct 25, 2018
b98ec77
Updated cmake for floating linearization
Oct 26, 2018
fedf818
Build bug fixes for new linearization code
Oct 26, 2018
3472134
Merge remote-tracking branch 'origin/f/FloatingLin' into f/FloatingLin
HaymanConsulting Oct 30, 2018
529671e
Bugs fixes with computation of HD Lin dYdx and dXdx matrices
HaymanConsulting Oct 31, 2018
57d124f
Registry: modified auto-generated ExtrapInterp routines for AFI
bjonkman Nov 1, 2018
af33505
Merge remote-tracking branch 'NREL/dev' into f/Airfoil-interp
bjonkman Nov 2, 2018
7b8e315
AeroDyn updates for 2D airfoil interpolation
bjonkman Nov 2, 2018
102ed07
Merge remote-tracking branch 'NREL/dev' into f/Airfoil-interp
bjonkman Dec 3, 2018
ece7c59
Updated HD state perturbation size for Wave Excitations
HaymanConsulting Dec 4, 2018
371fd44
Implemented missing dU^{ED}/dy^{ED} terms related to HD and MAP
HaymanConsulting Dec 4, 2018
7aea591
Updated example input files in documentation
bjonkman Dec 5, 2018
428f835
updated documentation for AD/Airfoils
bjonkman Dec 6, 2018
fadcfd9
Merge remote-tracking branch 'NREL/dev' into b/Envision-UA
bjonkman Dec 10, 2018
b842a31
Merge remote-tracking branch 'alvarogonzalezsalcedo/b/Envision-UA' in…
bjonkman Dec 11, 2018
a4edbe6
fix typos; replace 1.44 with already-defined parameter
bjonkman Dec 11, 2018
6b133ef
updated comment
bjonkman Dec 18, 2018
317d000
Merge remote-tracking branch 'NREL/dev' into b/Envision-UA
bjonkman Dec 18, 2018
4dbbefa
updated comment in example airfoil file
bjonkman Dec 18, 2018
6af73e3
merge bjonkman/f/Airfoil-interp into b/Envision-UA
bjonkman Dec 19, 2018
52c7b8e
UA: updated calculation of Cn_FS for UAmod = 3
bjonkman Dec 31, 2018
26edbe2
Merge remote-tracking branch 'NREL/dev' into b/Envision-UA
bjonkman Dec 31, 2018
e41df4f
Merge branch 'f/FloatingLin' into f/linear
bjonkman Jan 1, 2019
2740fd1
fixed minor typos/spacing
bjonkman Jan 1, 2019
e8dc734
Replaced some hardcoded strings sizes with already-defined parameters
bjonkman Jan 1, 2019
87ad100
HD linear bug fix: dx not defined
bjonkman Jan 1, 2019
b684f14
fixed minor typos/spacing
bjonkman Jan 1, 2019
5ad5b84
HD linear bug fix: dx not defined
bjonkman Jan 1, 2019
46a62eb
Merge pull request #3 from bjonkman/f/FloatingLin
Jan 2, 2019
5195b97
Modified the HD linearization input translation perturbation to 0.02*D2R
HaymanConsulting Jan 3, 2019
6caa025
MAP Fortran Registry simplification
bjonkman Jan 4, 2019
757709c
MAP Fortran Registry simplification
bjonkman Jan 4, 2019
c22c25d
Updated MAP WriteOutput header string size
bjonkman Jan 4, 2019
39a45fc
Modified the HD linearization input translation perturbation to 0.02*D2R
HaymanConsulting Jan 3, 2019
5b7634f
MAP Fortran Registry updates
bjonkman Jan 4, 2019
9ee189d
MAP Fortran Registry updates
bjonkman Jan 4, 2019
9702448
Added DerivOrder_x for BD linearization + updated template file
bjonkman Jan 4, 2019
0a89305
Added DerivOrder_x for BD linearization + updated template file
bjonkman Jan 4, 2019
d61a4ed
Linear: update Assemble_dUdy_Motions to replace version for MAP++
bjonkman Jan 15, 2019
b6c9df3
Linear: simplified some indices
bjonkman Jan 21, 2019
3db6267
Linear: updated IF statements for HD/MAP; also simplified indices
bjonkman Jan 24, 2019
b688f5a
Merge pull request #4 from bjonkman/f/FloatingLin
Feb 4, 2019
4e9c33a
Fixed bug where dYdU matrix was returning zeros
HaymanConsulting Feb 5, 2019
929e62e
Linear: update perturbations for rotations
bjonkman Feb 11, 2019
0771729
Merge remote-tracking branch 'ghaymanNREL/f/FloatingLin' into f/Float…
bjonkman Feb 11, 2019
f698c57
Merge pull request #5 from bjonkman/f/FloatingLin
Feb 12, 2019
ba55b55
linear: fixed sign error on previous rotation dY calculation
bjonkman Feb 14, 2019
0e4303e
Merge pull request #6 from bjonkman/f/FloatingLin
Feb 14, 2019
f4c4149
Merge remote-tracking branch 'NREL/dev' into f/FloatingLin
bjonkman Mar 20, 2019
929d4eb
HD: fixed typos in echo file
bjonkman Mar 20, 2019
7f9d3a9
Merge remote-tracking branch 'NREL/dev' into f/FloatingLin
bjonkman Mar 22, 2019
d939e62
Merge remote-tracking branch 'NREL/dev' into f/FloatingLin
bjonkman Apr 30, 2019
77db035
renamed a few files missed in merge
bjonkman May 1, 2019
648cd55
vs build: removed debug warnings about _Types.f90 and .f files
bjonkman May 1, 2019
a76c9d1
AD bug fix: node number in linearization error messages was wrong
bjonkman May 15, 2019
7935cea
linearization: make sure lin files are closed if error occurs
bjonkman May 15, 2019
ddb41bc
ED linear: fix issue with OP if blade pitch isn't equal on all blades
bjonkman May 31, 2019
b044af4
Merge branch 'f/linear' into f/FloatingLin
bjonkman May 31, 2019
b14798d
Merge remote-tracking branch 'NREL/dev' into f/FloatingLin
bjonkman Jun 3, 2019
ebd13d4
HD syntax fix
bjonkman Jun 3, 2019
4bd326e
Add openfast floating linear case to reg tests
rafmudaf Jul 9, 2019
1942aff
Merge remote-tracking branch 'origin/f/FloatingLin' into f/FloatingLin
HaymanConsulting Jul 11, 2019
21df950
Bug Fixes: SS_Rdtn linearization channel naming, writing HD Sum File
HaymanConsulting Jul 11, 2019
215591a
Merge remote-tracking branch 'origin/f/FloatingLin' into f/FloatingLin
rafmudaf Jul 11, 2019
8a7d094
fixed format in SysGnuWin.f90
bjonkman Apr 30, 2019
765dd1d
Merge remote-tracking branch 'ghaymanNREL/f/FloatingLin' into f/Float…
bjonkman Jul 19, 2019
e4c19e0
Add baseline solutions for reg test
rafmudaf Jul 23, 2019
85c6752
vs-build: remove override of default C++ library paths
bjonkman Aug 14, 2019
d249761
Merge pull request #7 from rafmudaf/f/FloatingLin
Sep 3, 2019
96b6200
Update r-test commit
rafmudaf Sep 9, 2019
a40f661
Merge remote-tracking branch 'origin/dev' into F/FloatingLin
rafmudaf Sep 9, 2019
3cb7fec
Merge pull request #9 from rafmudaf/F/FloatingLin
Sep 10, 2019
b79532c
Merge remote-tracking branch 'openfast/dev' into f/FloatingLin
rafmudaf Oct 22, 2019
bf7f1f2
Update the types-files for linearization
rafmudaf Oct 22, 2019
953bff5
Update linear reg test baselines
rafmudaf Oct 23, 2019
2fccdbf
Run linearization reg test cases in CI
rafmudaf Oct 23, 2019
5332ba3
Merge pull request #10 from rafmudaf/f/FloatingLin
Oct 24, 2019
d76f7e8
TravisCI: run the linearization cases in serial
rafmudaf Oct 24, 2019
100e92a
Merge pull request #11 from rafmudaf/f/FloatingLin
Oct 24, 2019
6ea940f
Add a print statement in linear reg test driver
rafmudaf Oct 29, 2019
e0b165d
rename files that git thinks were deleted (not renamed) on nrel/dev
bjonkman Oct 31, 2019
36d9a4e
Merge remote-tracking branch 'NREL/dev' into AFI-attempt2
bjonkman Oct 31, 2019
2cf9b88
Update auto-generated types files
bjonkman Oct 31, 2019
3ea7af7
Fix format of write statement in SysGnuWin
bjonkman Nov 1, 2019
2cfae42
Merge branch 'f/Airfoil-interp' into b/Envision-UA
bjonkman Nov 1, 2019
f790002
updated types files
bjonkman Nov 1, 2019
2a753e1
UA: add (unnecessary) initialization to avoid compiler warning
bjonkman Nov 1, 2019
b1240ac
Merge remote-tracking branch 'NREL/dev' into f/Airfoil-interp
bjonkman Nov 11, 2019
1ea2dee
Merge branch 'f/Airfoil-interp' into b/Envision-UA
bjonkman Nov 11, 2019
ad08796
Merge branch 'b/Envision-UA' into f/Linear
bjonkman Nov 12, 2019
275c6a0
Merge branch 'f/FloatingLin' into f/Linear
bjonkman Nov 12, 2019
e2960a3
update auto-generated types files
bjonkman Nov 12, 2019
6f0f70b
Merge remote-tracking branch 'ghaymanNREL/f/FloatingLin' into f/Linear
bjonkman Nov 12, 2019
91a8c78
Remove override of C++ library paths in vs-build build of MAP library
bjonkman Nov 12, 2019
e2ae28c
Cleanup of MAP_dll vs-build project
bjonkman Nov 12, 2019
23bdc25
Merge branch 'f/Linear' into f/FloatingLin
bjonkman Nov 12, 2019
ee74465
fix syntax in UnsteadyAero.vfproj file
bjonkman Nov 12, 2019
eeba9d8
Merge pull request #12 from bjonkman/f/FloatingLin
Dec 1, 2019
1829096
Merge remote-tracking branch 'NREL/dev' into f/FloatingLin
bjonkman Dec 30, 2019
4fbb3f4
Merge pull request #13 from bjonkman/f/FloatingLin
Jan 14, 2020
71e78d2
Add error for linearization with MoorDyn or FEAM
rafmudaf Jun 8, 2020
295bd7d
Merge remote-tracking branch 'openfast/dev' into f/FloatingLin
rafmudaf Jun 12, 2020
c0c499a
Get new test case, update existing offshore cases
rafmudaf Jun 12, 2020
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
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ script:
# beamdyn regression tests
- if [[ "$DOUBLE_PRECISION" == "ON" ]]; then ctest -j4 -VV -R bd_; fi

# linearization cases
- if [[ "$DOUBLE_PRECISION" == "ON" ]]; then ctest -L linear; fi

# subset of openfast regression tests
# do not run
# - 3, 4, 7, 15, 16, 17 since the free yaw is not well trusted
Expand Down
63 changes: 18 additions & 45 deletions modules/aerodyn/src/AeroDyn.f90
Original file line number Diff line number Diff line change
Expand Up @@ -3677,13 +3677,8 @@ SUBROUTINE Perturb_u( p, n, perturb_sign, u, du )


! local variables
integer(intKi) :: ErrStat2
character(ErrMsgLen) :: ErrMsg2

INTEGER :: fieldIndx
INTEGER :: node
REAL(R8Ki) :: orientation(3,3)
REAL(R8Ki) :: angles(3)

fieldIndx = p%Jac_u_indx(n,2)
node = p%Jac_u_indx(n,3)
Expand All @@ -3693,69 +3688,47 @@ SUBROUTINE Perturb_u( p, n, perturb_sign, u, du )
! determine which mesh we're trying to perturb and perturb the input:
SELECT CASE( p%Jac_u_indx(n,1) )

CASE ( 1) !Module/Mesh/Field: u%TowerMotion%TranslationDisp = 1;
u%TowerMotion%TranslationDisp( fieldIndx,node) = u%TowerMotion%TranslationDisp( fieldIndx,node) + du * perturb_sign
CASE ( 1) !Module/Mesh/Field: u%TowerMotion%TranslationDisp = 1;
u%TowerMotion%TranslationDisp( fieldIndx,node) = u%TowerMotion%TranslationDisp( fieldIndx,node) + du * perturb_sign
CASE ( 2) !Module/Mesh/Field: u%TowerMotion%Orientation = 2;
angles = 0.0_R8Ki
angles(fieldIndx) = du * perturb_sign
call SmllRotTrans( 'linearization perturbation', angles(1), angles(2), angles(3), orientation, ErrStat=ErrStat2, ErrMsg=ErrMsg2 )
u%TowerMotion%Orientation(:,:,node) = matmul(u%TowerMotion%Orientation(:,:,node), orientation)
CALL PerturbOrientationMatrix( u%TowerMotion%Orientation(:,:,node), du * perturb_sign, fieldIndx )
CASE ( 3) !Module/Mesh/Field: u%TowerMotion%TranslationVel = 3;
u%TowerMotion%TranslationVel( fieldIndx,node) = u%TowerMotion%TranslationVel( fieldIndx,node) + du * perturb_sign
u%TowerMotion%TranslationVel( fieldIndx,node ) = u%TowerMotion%TranslationVel( fieldIndx,node) + du * perturb_sign

CASE ( 4) !Module/Mesh/Field: u%HubMotion%TranslationDisp = 4;
u%HubMotion%TranslationDisp(fieldIndx,node) = u%HubMotion%TranslationDisp(fieldIndx,node) + du * perturb_sign
u%HubMotion%TranslationDisp(fieldIndx,node) = u%HubMotion%TranslationDisp(fieldIndx,node) + du * perturb_sign
CASE ( 5) !Module/Mesh/Field: u%HubMotion%Orientation = 5;
angles = 0.0_R8Ki
angles(fieldIndx) = du * perturb_sign
call SmllRotTrans( 'linearization perturbation', angles(1), angles(2), angles(3), orientation, ErrStat=ErrStat2, ErrMsg=ErrMsg2 )
u%HubMotion%Orientation(:,:,node) = matmul(u%HubMotion%Orientation(:,:,node), orientation)
CALL PerturbOrientationMatrix( u%HubMotion%Orientation(:,:,node), du * perturb_sign, fieldIndx )
CASE ( 6) !Module/Mesh/Field: u%HubMotion%RotationVel = 6;
u%HubMotion%RotationVel(fieldIndx,node) = u%HubMotion%RotationVel(fieldIndx,node) + du * perturb_sign

CASE ( 7) !Module/Mesh/Field: u%BladeRootMotion(1)%Orientation = 7;
angles = 0.0_R8Ki
angles(fieldIndx) = du * perturb_sign
call SmllRotTrans( 'linearization perturbation', angles(1), angles(2), angles(3), orientation, ErrStat=ErrStat2, ErrMsg=ErrMsg2 )
u%BladeRootMotion(1)%Orientation(:,:,node) = matmul(u%BladeRootMotion(1)%Orientation(:,:,node), orientation)
CALL PerturbOrientationMatrix( u%BladeRootMotion(1)%Orientation(:,:,node), du * perturb_sign, fieldIndx )

CASE ( 8) !Module/Mesh/Field: u%BladeRootMotion(2)%Orientation = 8;
angles = 0.0_R8Ki
angles(fieldIndx) = du * perturb_sign
call SmllRotTrans( 'linearization perturbation', angles(1), angles(2), angles(3), orientation, ErrStat=ErrStat2, ErrMsg=ErrMsg2 )
u%BladeRootMotion(2)%Orientation(:,:,node) = matmul(u%BladeRootMotion(2)%Orientation(:,:,node), orientation)
CALL PerturbOrientationMatrix( u%BladeRootMotion(2)%Orientation(:,:,node), du * perturb_sign, fieldIndx )

CASE ( 9) !Module/Mesh/Field: u%BladeRootMotion(3)%Orientation = 9;
angles = 0.0_R8Ki
angles(fieldIndx) = du * perturb_sign
call SmllRotTrans( 'linearization perturbation', angles(1), angles(2), angles(3), orientation, ErrStat=ErrStat2, ErrMsg=ErrMsg2 )
u%BladeRootMotion(3)%Orientation(:,:,node) = matmul(u%BladeRootMotion(3)%Orientation(:,:,node), orientation)
CALL PerturbOrientationMatrix( u%BladeRootMotion(3)%Orientation(:,:,node), du * perturb_sign, fieldIndx )

CASE (10) !Module/Mesh/Field: u%BladeMotion(1)%TranslationDisp = 10;
u%BladeMotion(1)%TranslationDisp(fieldIndx,node) = u%BladeMotion(1)%TranslationDisp(fieldIndx,node) + du * perturb_sign
u%BladeMotion(1)%TranslationDisp(fieldIndx,node) = u%BladeMotion(1)%TranslationDisp(fieldIndx,node) + du * perturb_sign
CASE (11) !Module/Mesh/Field: u%BladeMotion(1)%Orientation = 11;
angles = 0.0_R8Ki
angles(fieldIndx) = du * perturb_sign
call SmllRotTrans( 'linearization perturbation', angles(1), angles(2), angles(3), orientation, ErrStat=ErrStat2, ErrMsg=ErrMsg2 )
u%BladeMotion(1)%Orientation(:,:,node) = matmul(u%BladeMotion(1)%Orientation(:,:,node), orientation)
CALL PerturbOrientationMatrix( u%BladeMotion(1)%Orientation(:,:,node), du * perturb_sign, fieldIndx )
CASE (12) !Module/Mesh/Field: u%BladeMotion(1)%TranslationVel = 12;
u%BladeMotion(1)%TranslationVel(fieldIndx,node) = u%BladeMotion(1)%TranslationVel(fieldIndx,node) + du * perturb_sign
u%BladeMotion(1)%TranslationVel(fieldIndx,node) = u%BladeMotion(1)%TranslationVel(fieldIndx,node) + du * perturb_sign

CASE (13) !Module/Mesh/Field: u%BladeMotion(2)%TranslationDisp = 13;
u%BladeMotion(2)%TranslationDisp( fieldIndx,node) = u%BladeMotion(2)%TranslationDisp( fieldIndx,node) + du * perturb_sign
u%BladeMotion(2)%TranslationDisp( fieldIndx,node) = u%BladeMotion(2)%TranslationDisp( fieldIndx,node) + du * perturb_sign
CASE (14) !Module/Mesh/Field: u%BladeMotion(2)%Orientation = 14;
angles = 0.0_R8Ki
angles(fieldIndx) = du * perturb_sign
call SmllRotTrans( 'linearization perturbation', angles(1), angles(2), angles(3), orientation, ErrStat=ErrStat2, ErrMsg=ErrMsg2 )
u%BladeMotion(2)%Orientation(:,:,node) = matmul(u%BladeMotion(2)%Orientation(:,:,node), orientation)
CALL PerturbOrientationMatrix( u%BladeMotion(2)%Orientation(:,:,node), du * perturb_sign, fieldIndx )
CASE (15) !Module/Mesh/Field: u%BladeMotion(2)%TranslationVel = 15;
u%BladeMotion(2)%TranslationVel(fieldIndx,node) = u%BladeMotion(2)%TranslationVel(fieldIndx,node) + du * perturb_sign

CASE (16) !Module/Mesh/Field: u%BladeMotion(3)%TranslationDisp = 16;
u%BladeMotion(3)%TranslationDisp( fieldIndx,node) = u%BladeMotion(3)%TranslationDisp( fieldIndx,node) + du * perturb_sign
u%BladeMotion(3)%TranslationDisp( fieldIndx,node) = u%BladeMotion(3)%TranslationDisp( fieldIndx,node) + du * perturb_sign
CASE (17) !Module/Mesh/Field: u%BladeMotion(3)%Orientation = 17;
angles = 0.0_R8Ki
angles(fieldIndx) = du * perturb_sign
call SmllRotTrans( 'linearization perturbation', angles(1), angles(2), angles(3), orientation, ErrStat=ErrStat2, ErrMsg=ErrMsg2 )
u%BladeMotion(3)%Orientation(:,:,node) = matmul(u%BladeMotion(3)%Orientation(:,:,node), orientation)
CALL PerturbOrientationMatrix( u%BladeMotion(3)%Orientation(:,:,node), du * perturb_sign, fieldIndx )
CASE (18) !Module/Mesh/Field: u%BladeMotion(3)%TranslationVel = 18;
u%BladeMotion(3)%TranslationVel(fieldIndx,node) = u%BladeMotion(3)%TranslationVel(fieldIndx,node) + du * perturb_sign

Expand Down
4 changes: 2 additions & 2 deletions modules/aerodyn/src/UnsteadyAero_Driver.f90
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ program UnsteadyAero_Driver
type(UA_ParameterType) :: p ! Parameters
type(UA_InputType) :: u(NumInp) ! System inputs
type(UA_OutputType) :: y ! System outputs
integer(IntKi) :: ErrStat ! Status of error message
character(1024) :: ErrMsg ! Error message if ErrStat /= ErrID_None
integer(IntKi) :: ErrStat, errStat2 ! Status of error message
character(ErrMsgLen) :: ErrMsg, errMsg2 ! Error message if ErrStat /= ErrID_None

integer, parameter :: NumAFfiles = 1
character(1024) :: afNames(NumAFfiles)
Expand Down
31 changes: 10 additions & 21 deletions modules/beamdyn/src/BeamDyn_IO.f90
Original file line number Diff line number Diff line change
Expand Up @@ -2312,6 +2312,7 @@ SUBROUTINE Init_Jacobian_x_z( p, InitOut, ErrStat, ErrMsg)
!call allocAry(p%dx, p%dof_node*(p%node_total-1), 'p%dx', ErrStat2, ErrMsg2); call SetErrStat(ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName)
CALL AllocAry(InitOut%LinNames_x, p%Jac_nx*2, 'LinNames_x', ErrStat2, ErrMsg2); CALL SetErrStat(ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName)
CALL AllocAry(InitOut%RotFrame_x, p%Jac_nx*2, 'RotFrame_x', ErrStat2, ErrMsg2); CALL SetErrStat(ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName)
CALL AllocAry(InitOut%DerivOrder_x, p%Jac_nx*2, 'DerivOrder_x', ErrStat2, ErrMsg2); CALL SetErrStat(ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName)
!CALL AllocAry(InitOut%LinNames_z, p%dof_node*2, 'LinNames_z', ErrStat2, ErrMsg2); CALL SetErrStat(ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName)
!CALL AllocAry(InitOut%RotFrame_z, p%dof_node*2, 'RotFrame_z', ErrStat2, ErrMsg2); CALL SetErrStat(ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName)
if (ErrStat >= AbortErrLev) return
Expand All @@ -2324,6 +2325,7 @@ SUBROUTINE Init_Jacobian_x_z( p, InitOut, ErrStat, ErrMsg)
p%dx(4:6) = 0.2_BDKi*D2R_D ! deflection states in rad and rad/s

InitOut%RotFrame_x = p%RotStates
InitOut%DerivOrder_x = 2

!......................................
! set linearization output names:
Expand Down Expand Up @@ -2378,13 +2380,8 @@ SUBROUTINE Perturb_u( p, n, perturb_sign, u, du )


! local variables
integer(intKi) :: ErrStat2
character(ErrMsgLen) :: ErrMsg2

INTEGER :: fieldIndx
INTEGER :: node
REAL(R8Ki) :: orientation(3,3)
REAL(R8Ki) :: angles(3)

fieldIndx = p%Jac_u_indx(n,2)
node = p%Jac_u_indx(n,3)
Expand All @@ -2397,10 +2394,7 @@ SUBROUTINE Perturb_u( p, n, perturb_sign, u, du )
CASE ( 1) !Module/Mesh/Field: u%RootMotion%TranslationDisp = 1;
u%RootMotion%TranslationDisp( fieldIndx,node) = u%RootMotion%TranslationDisp( fieldIndx,node) + du * perturb_sign
CASE ( 2) !Module/Mesh/Field: u%RootMotion%Orientation = 2;
angles = 0.0_R8Ki
angles(fieldIndx) = du * perturb_sign
call SmllRotTrans( 'linearization perturbation', angles(1), angles(2), angles(3), orientation, ErrStat=ErrStat2, ErrMsg=ErrMsg2 )
u%RootMotion%Orientation(:,:,node) = matmul(u%RootMotion%Orientation(:,:,node), orientation)
CALL PerturbOrientationMatrix( u%RootMotion%Orientation(:,:,node), du * perturb_sign, fieldIndx )
CASE ( 3) !Module/Mesh/Field: u%RootMotion%TranslationVel = 3;
u%RootMotion%TranslationVel( fieldIndx,node) = u%RootMotion%TranslationVel( fieldIndx,node) + du * perturb_sign
CASE ( 4) !Module/Mesh/Field: u%RootMotion%RotationVel = 4;
Expand Down Expand Up @@ -2469,26 +2463,21 @@ SUBROUTINE Perturb_x( p, fieldIndx, node, dof, perturb_sign, x, dx )
character(ErrMsgLen) :: ErrMsg2

REAL(R8Ki) :: orientation(3,3)
REAL(R8Ki) :: oldRotation(3,3)
REAL(R8Ki) :: newRotation(3,3)
REAL(R8Ki) :: angles(3)
REAL(R8Ki) :: rotation(3,3)

dx = p%dx(dof)

if (fieldIndx==1) then
if (dof < 4) then ! translational displacement
x%q( dof, node ) = x%q( dof, node ) + dx * perturb_sign
else ! w-m parameters
angles = 0.0_R8Ki
angles(dof-3) = dx * perturb_sign
call SmllRotTrans( 'linearization perturbation', angles(1), angles(2), angles(3), orientation, ErrStat=ErrStat2, ErrMsg=ErrMsg2 )

call BD_CrvMatrixR( x%q( 4:6, node ), oldRotation ) ! returns the rotation matrix (transpose of DCM) that was stored in the state as a w-m parameter

!newRotation = transpose( matmul(transpose(oldRotation), orientation) )
newRotation = matmul( transpose(orientation), oldRotation)
call BD_CrvExtractCrv( newRotation, x%q( 4:6, node ), ErrStat2, ErrMsg2 ) ! return the w-m parameters of the new orientation
call BD_CrvMatrixR( x%q( 4:6, node ), rotation ) ! returns the rotation matrix (transpose of DCM) that was stored in the state as a w-m parameter
orientation = transpose(rotation)

CALL PerturbOrientationMatrix( orientation, dx * perturb_sign, dof-3 )

rotation = transpose(orientation)
call BD_CrvExtractCrv( rotation, x%q( 4:6, node ), ErrStat2, ErrMsg2 ) ! return the w-m parameters of the new orientation
end if
else
x%dqdt( dof, node ) = x%dqdt( dof, node ) + dx * perturb_sign
Expand Down
57 changes: 57 additions & 0 deletions modules/beamdyn/src/BeamDyn_Types.f90
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ MODULE BeamDyn_Types
LOGICAL , DIMENSION(:), ALLOCATABLE :: RotFrame_x !< Flag that tells FAST/MBC3 if the continuous states used in linearization are in the rotating frame (not used for glue) [-]
LOGICAL , DIMENSION(:), ALLOCATABLE :: RotFrame_u !< Flag that tells FAST/MBC3 if the inputs used in linearization are in the rotating frame [-]
LOGICAL , DIMENSION(:), ALLOCATABLE :: IsLoad_u !< Flag that tells FAST if the inputs used in linearization are loads (for preconditioning matrix) [-]
INTEGER(IntKi) , DIMENSION(:), ALLOCATABLE :: DerivOrder_x !< Integer that tells FAST/MBC3 the maximum derivative order of continuous states used in linearization [-]
END TYPE BD_InitOutputType
! =======================
! ========= BladeInputData =======
Expand Down Expand Up @@ -757,6 +758,18 @@ SUBROUTINE BD_CopyInitOutput( SrcInitOutputData, DstInitOutputData, CtrlCode, Er
END IF
END IF
DstInitOutputData%IsLoad_u = SrcInitOutputData%IsLoad_u
ENDIF
IF (ALLOCATED(SrcInitOutputData%DerivOrder_x)) THEN
i1_l = LBOUND(SrcInitOutputData%DerivOrder_x,1)
i1_u = UBOUND(SrcInitOutputData%DerivOrder_x,1)
IF (.NOT. ALLOCATED(DstInitOutputData%DerivOrder_x)) THEN
ALLOCATE(DstInitOutputData%DerivOrder_x(i1_l:i1_u),STAT=ErrStat2)
IF (ErrStat2 /= 0) THEN
CALL SetErrStat(ErrID_Fatal, 'Error allocating DstInitOutputData%DerivOrder_x.', ErrStat, ErrMsg,RoutineName)
RETURN
END IF
END IF
DstInitOutputData%DerivOrder_x = SrcInitOutputData%DerivOrder_x
ENDIF
END SUBROUTINE BD_CopyInitOutput

Expand Down Expand Up @@ -799,6 +812,9 @@ SUBROUTINE BD_DestroyInitOutput( InitOutputData, ErrStat, ErrMsg )
ENDIF
IF (ALLOCATED(InitOutputData%IsLoad_u)) THEN
DEALLOCATE(InitOutputData%IsLoad_u)
ENDIF
IF (ALLOCATED(InitOutputData%DerivOrder_x)) THEN
DEALLOCATE(InitOutputData%DerivOrder_x)
ENDIF
END SUBROUTINE BD_DestroyInitOutput

Expand Down Expand Up @@ -906,6 +922,11 @@ SUBROUTINE BD_PackInitOutput( ReKiBuf, DbKiBuf, IntKiBuf, Indata, ErrStat, ErrMs
Int_BufSz = Int_BufSz + 2*1 ! IsLoad_u upper/lower bounds for each dimension
Int_BufSz = Int_BufSz + SIZE(InData%IsLoad_u) ! IsLoad_u
END IF
Int_BufSz = Int_BufSz + 1 ! DerivOrder_x allocated yes/no
IF ( ALLOCATED(InData%DerivOrder_x) ) THEN
Int_BufSz = Int_BufSz + 2*1 ! DerivOrder_x upper/lower bounds for each dimension
Int_BufSz = Int_BufSz + SIZE(InData%DerivOrder_x) ! DerivOrder_x
END IF
IF ( Re_BufSz .GT. 0 ) THEN
ALLOCATE( ReKiBuf( Re_BufSz ), STAT=ErrStat2 )
IF (ErrStat2 /= 0) THEN
Expand Down Expand Up @@ -1116,6 +1137,19 @@ SUBROUTINE BD_PackInitOutput( ReKiBuf, DbKiBuf, IntKiBuf, Indata, ErrStat, ErrMs
IF (SIZE(InData%IsLoad_u)>0) IntKiBuf ( Int_Xferred:Int_Xferred+SIZE(InData%IsLoad_u)-1 ) = TRANSFER(PACK( InData%IsLoad_u ,.TRUE.), IntKiBuf(1), SIZE(InData%IsLoad_u))
Int_Xferred = Int_Xferred + SIZE(InData%IsLoad_u)
END IF
IF ( .NOT. ALLOCATED(InData%DerivOrder_x) ) THEN
IntKiBuf( Int_Xferred ) = 0
Int_Xferred = Int_Xferred + 1
ELSE
IntKiBuf( Int_Xferred ) = 1
Int_Xferred = Int_Xferred + 1
IntKiBuf( Int_Xferred ) = LBOUND(InData%DerivOrder_x,1)
IntKiBuf( Int_Xferred + 1) = UBOUND(InData%DerivOrder_x,1)
Int_Xferred = Int_Xferred + 2

IF (SIZE(InData%DerivOrder_x)>0) IntKiBuf ( Int_Xferred:Int_Xferred+(SIZE(InData%DerivOrder_x))-1 ) = PACK(InData%DerivOrder_x,.TRUE.)
Int_Xferred = Int_Xferred + SIZE(InData%DerivOrder_x)
END IF
END SUBROUTINE BD_PackInitOutput

SUBROUTINE BD_UnPackInitOutput( ReKiBuf, DbKiBuf, IntKiBuf, Outdata, ErrStat, ErrMsg )
Expand Down Expand Up @@ -1447,6 +1481,29 @@ SUBROUTINE BD_UnPackInitOutput( ReKiBuf, DbKiBuf, IntKiBuf, Outdata, ErrStat, Er
Int_Xferred = Int_Xferred + SIZE(OutData%IsLoad_u)
DEALLOCATE(mask1)
END IF
IF ( IntKiBuf( Int_Xferred ) == 0 ) THEN ! DerivOrder_x not allocated
Int_Xferred = Int_Xferred + 1
ELSE
Int_Xferred = Int_Xferred + 1
i1_l = IntKiBuf( Int_Xferred )
i1_u = IntKiBuf( Int_Xferred + 1)
Int_Xferred = Int_Xferred + 2
IF (ALLOCATED(OutData%DerivOrder_x)) DEALLOCATE(OutData%DerivOrder_x)
ALLOCATE(OutData%DerivOrder_x(i1_l:i1_u),STAT=ErrStat2)
IF (ErrStat2 /= 0) THEN
CALL SetErrStat(ErrID_Fatal, 'Error allocating OutData%DerivOrder_x.', ErrStat, ErrMsg,RoutineName)
RETURN
END IF
ALLOCATE(mask1(i1_l:i1_u),STAT=ErrStat2)
IF (ErrStat2 /= 0) THEN
CALL SetErrStat(ErrID_Fatal, 'Error allocating mask1.', ErrStat, ErrMsg,RoutineName)
RETURN
END IF
mask1 = .TRUE.
IF (SIZE(OutData%DerivOrder_x)>0) OutData%DerivOrder_x = UNPACK( IntKiBuf ( Int_Xferred:Int_Xferred+(SIZE(OutData%DerivOrder_x))-1 ), mask1, 0_IntKi )
Int_Xferred = Int_Xferred + SIZE(OutData%DerivOrder_x)
DEALLOCATE(mask1)
END IF
END SUBROUTINE BD_UnPackInitOutput

SUBROUTINE BD_CopyBladeInputData( SrcBladeInputDataData, DstBladeInputDataData, CtrlCode, ErrStat, ErrMsg )
Expand Down
1 change: 1 addition & 0 deletions modules/beamdyn/src/Registry_BeamDyn.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ typedef ^ InitOutputType LOGICAL RotFrame_y {:} - -
typedef ^ InitOutputType LOGICAL RotFrame_x {:} - - "Flag that tells FAST/MBC3 if the continuous states used in linearization are in the rotating frame (not used for glue)" -
typedef ^ InitOutputType LOGICAL RotFrame_u {:} - - "Flag that tells FAST/MBC3 if the inputs used in linearization are in the rotating frame" -
typedef ^ InitOutputType LOGICAL IsLoad_u {:} - - "Flag that tells FAST if the inputs used in linearization are loads (for preconditioning matrix)" -
typedef ^ InitOutputType IntKi DerivOrder_x {:} - - "Integer that tells FAST/MBC3 the maximum derivative order of continuous states used in linearization" -

# ..... Blade Input file data........................................................................
typedef ^ BladeInputData IntKi station_total - - - "Number of blade input stations"
Expand Down
Loading