Skip to content

Commit 99ddcaa

Browse files
authored
Merge pull request #3113 from deslaughter/add_ice_tests
Add IceDyn and IceFloe Regression Tests
2 parents 6d3ba82 + 367e3a7 commit 99ddcaa

File tree

5 files changed

+37
-6
lines changed

5 files changed

+37
-6
lines changed

modules/icedyn/src/IceDyn.f90

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -339,14 +339,28 @@ subroutine IceD_InitVars(u, p, x, y, m, Vars, InputFileData, Linearize, ErrStat,
339339
! Continuous State Variables
340340
!----------------------------------------------------------------------------
341341

342+
call MV_AddVar(Vars%x, "q", FieldTransDisp, DatLoc(IceD_x_q), &
343+
LinNames=["ice mass displacement, m"])
344+
call MV_AddVar(Vars%x, "q", FieldTransVel, DatLoc(IceD_x_dqdt), &
345+
LinNames=["first time derivative of ice mass displacement, m/s"])
346+
342347
!----------------------------------------------------------------------------
343348
! Input variables
344349
!----------------------------------------------------------------------------
345350

351+
call MV_AddMeshVar(Vars%u, "PointMesh", MotionFields, DatLoc(IceD_u_PointMesh), u%PointMesh)
352+
346353
!----------------------------------------------------------------------------
347354
! Output variables
348355
!----------------------------------------------------------------------------
349356

357+
call MV_AddMeshVar(Vars%y, "PointMesh", LoadFields, DatLoc(IceD_y_PointMesh), y%PointMesh)
358+
call MV_AddVar(Vars%y, "WriteOutput", FieldScalar, DatLoc(IceD_y_WriteOutput), &
359+
Flags=VF_WriteOut, &
360+
Num=p%NumOuts, &
361+
LinNames=["IceDisp, m ", "IceForce, N"])
362+
363+
350364
!----------------------------------------------------------------------------
351365
! Initialization dependent on linearization
352366
!----------------------------------------------------------------------------

modules/icefloe/src/icefloe/IceFloeBase.F90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ module IceFloeBase
3535
public
3636

3737
! This is compared to gravity in FAST, warning if different
38-
real(ReKi), parameter :: grav = 9.81
38+
real(ReKi), parameter :: grav = 9.80665
3939

4040
! ice type parameters
4141
integer(IntKi), parameter :: randomCrush = 1

modules/icefloe/src/interfaces/FAST/IceFloe.f90

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ SUBROUTINE IceFloe_Init( InitInp, u, p, x, xd, z, OtherState, y, m, Interval, In
321321

322322

323323
! set up outputs to write to FAST
324-
! need to know how many legs and whethter loads applied to all or just one set of effective loads
324+
! need to know how many legs and whether loads applied to all or just one set of effective loads
325325
numOuts = 4*p%numLegs ! 2 velocities and 2 forces
326326
if (p%singleLoad .and. p%numLegs > 1) numOuts = 5
327327
CALL AllocAry( InitOut%WriteOutputHdr, numOuts, 'WriteOutputHdr', ErrStat, ErrMsg )
@@ -350,7 +350,7 @@ SUBROUTINE IceFloe_Init( InitInp, u, p, x, xd, z, OtherState, y, m, Interval, In
350350
endif
351351

352352
! Initialize module variables
353-
CALL IceFloe_InitVars(u, p, x, y, m, InitOut%Vars, .false., ErrStat, ErrMsg)
353+
CALL IceFloe_InitVars(u, p, x, y, m, InitOut, InitOut%Vars, .false., ErrStat, ErrMsg)
354354
call iceErrorHndlr (iceLog, ErrStat, 'Error in allocation of output memory', 1)
355355
if (ErrStat >= AbortErrLev) return
356356

@@ -371,12 +371,13 @@ SUBROUTINE IceFloe_Init( InitInp, u, p, x, xd, z, OtherState, y, m, Interval, In
371371
END SUBROUTINE IceFloe_Init
372372

373373

374-
subroutine IceFloe_InitVars(u, p, x, y, m, Vars, Linearize, ErrStat, ErrMsg)
374+
subroutine IceFloe_InitVars(u, p, x, y, m, InitOut, Vars, Linearize, ErrStat, ErrMsg)
375375
type(IceFloe_InputType), intent(inout) :: u !< An initial guess for the input; input mesh must be defined
376376
type(IceFloe_ParameterType), intent(inout) :: p !< Parameters
377377
type(IceFloe_ContinuousStateType), intent(inout) :: x !< Continuous state
378378
type(IceFloe_OutputType), intent(inout) :: y !< Initial system outputs (outputs are not calculated;
379379
type(IceFloe_MiscVarType), intent(inout) :: m !< Misc variables for optimization (not copied in glue code)
380+
type(IceFloe_InitOutputType), intent(in) :: InitOut ! Output for initialization routine
380381
type(ModVarsType), intent(inout) :: Vars !< Module variables
381382
logical, intent(in) :: Linearize !< Flag to initialize linearization variables
382383
integer(IntKi), intent(out) :: ErrStat !< Error status of the operation
@@ -385,22 +386,31 @@ subroutine IceFloe_InitVars(u, p, x, y, m, Vars, Linearize, ErrStat, ErrMsg)
385386
character(*), parameter :: RoutineName = 'IceFloe_InitVars'
386387
integer(IntKi) :: ErrStat2
387388
character(ErrMsgLen) :: ErrMsg2
389+
integer(IntKi) :: i
388390

389391
ErrStat = ErrID_None
390392
ErrMsg = ""
391393

392394
!----------------------------------------------------------------------------
393395
! Continuous State Variables
394396
!----------------------------------------------------------------------------
395-
397+
396398
!----------------------------------------------------------------------------
397399
! Input variables
398400
!----------------------------------------------------------------------------
399401

402+
call MV_AddMeshVar(Vars%u, 'iceMesh', MotionFields, DatLoc(IceFloe_u_iceMesh), u%iceMesh)
403+
400404
!----------------------------------------------------------------------------
401405
! Output variables
402406
!----------------------------------------------------------------------------
403407

408+
call MV_AddMeshVar(Vars%y, 'iceMesh', MotionFields, DatLoc(IceFloe_y_iceMesh), y%iceMesh)
409+
call MV_AddVar(Vars%y, "WriteOutput", FieldScalar, DatLoc(IceFloe_y_WriteOutput), &
410+
Flags=VF_WriteOut, &
411+
Num=size(y%WriteOutput), &
412+
LinNames=[(WriteOutputLinName(i), i=1,size(y%WriteOutput))])
413+
404414
!----------------------------------------------------------------------------
405415
! Initialization dependent on linearization
406416
!----------------------------------------------------------------------------
@@ -417,6 +427,11 @@ logical function Failed()
417427
call SetErrStat(ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName)
418428
Failed = ErrStat >= AbortErrLev
419429
end function Failed
430+
function WriteOutputLinName(index) result(name)
431+
integer(IntKi), intent(in) :: index
432+
character(LinChanLen) :: name
433+
name = InitOut%WriteOutputHdr(index)//', '//trim(InitOut%WriteOutputUnt(index))
434+
end function WriteOutputLinName
420435
end subroutine
421436

422437
!----------------------------------------------------------------------------------------------------------------------------------

reg_tests/CTestList.cmake

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,8 @@ of_regression("SWRT_YFree_VS_WTurb" "openfast;elastodyn;aerod
331331
of_regression("5MW_Land_DLL_WTurb" "openfast;elastodyn;aerodyn;servodyn")
332332
of_regression("5MW_Land_DLL_WTurb_wNacDrag" "openfast;elastodyn;aerodyn;servodyn")
333333
of_regression("5MW_OC3Mnpl_DLL_WTurb_WavesIrr" "openfast;elastodyn;aerodyn;servodyn;hydrodyn;subdyn;offshore")
334+
of_regression("5MW_OC3Mnpl_DLL_WTurb_WavesIrr_IceDyn" "openfast;elastodyn;aerodyn;servodyn;hydrodyn;subdyn;icedyn;offshore")
335+
of_regression("5MW_OC3Mnpl_DLL_WTurb_WavesIrr_IceFloe" "openfast;elastodyn;aerodyn;servodyn;hydrodyn;subdyn;icefloe;offshore")
334336
of_regression("5MW_OC3Mnpl_DLL_WTurb_WavesIrr_Restart" "openfast;elastodyn;aerodyn;servodyn;hydrodyn;subdyn;offshore;restart")
335337
of_regression("5MW_OC3Trpd_DLL_WSt_WavesReg" "openfast;elastodyn;aerodyn;servodyn;hydrodyn;subdyn;offshore")
336338
# of_regression("5MW_OC4Jckt_DLL_WTurb_WavesIrr_MGrowth" "openfast;elastodyn;aerodyn;servodyn;hydrodyn;subdyn;offshore")

reg_tests/r-test

Submodule r-test updated 20 files

0 commit comments

Comments
 (0)