OpenFAST
Wind turbine multiphysics simulator
Functions/Subroutines
fast_solver Module Reference

This module contains the routines used by FAST to solve input-output equations and to advance states. More...

Functions/Subroutines

subroutine bd_inputsolve (p_FAST, BD, y_AD, u_AD, y_ED, MeshMapData, ErrStat, ErrMsg)
 This routine sets the inputs required for BD–using the Option 2 solve method; currently the only inputs solved in this routine are the blade distributed loads from AD15; other inputs are solved in option 1. More...
 
subroutine ed_inputsolve (p_FAST, u_ED, y_ED, p_AD14, y_AD14, y_AD, y_SrvD, u_AD, u_SrvD, MeshMapData, ErrStat, ErrMsg)
 This routine sets the inputs required for ED–using the Option 2 solve method; currently the only input not solved in this routine are the fields on PlatformPtMesh and HubPtLoad, which are solved in option 1. More...
 
subroutine ifw_inputsolve (p_FAST, m_FAST, u_IfW, p_IfW, u_AD14, u_AD, OtherSt_AD, y_ED, ErrStat, ErrMsg)
 This routine determines the points in space where InflowWind needs to compute wind speeds. More...
 
subroutine ifw_setexternalinputs (p_IfW, m_FAST, y_ED, u_IfW)
 This routine sets the inputs required for InflowWind from an external source (Simulink) More...
 
subroutine ad_inputsolve_ifw (p_FAST, u_AD, y_IfW, y_OpFM, ErrStat, ErrMsg)
 This routine sets the AeroDyn wind inflow inputs. More...
 
subroutine ad_inputsolve_noifw (p_FAST, u_AD, y_SrvD, y_ED, BD, MeshMapData, ErrStat, ErrMsg)
 This routine sets all the AeroDyn inputs, except for the wind inflow values. More...
 
subroutine ad14_inputsolve_ifw (p_FAST, u_AD14, y_IfW, y_OpFM, ErrStat, ErrMsg)
 This routine sets the AeroDyn14 wind inflow inputs. More...
 
subroutine ad14_inputsolve_noifw (p_FAST, u_AD14, y_ED, MeshMapData, ErrStat, ErrMsg)
 This routine sets all the AeroDyn14 inputs, except for the wind inflow values. More...
 
subroutine srvd_inputsolve (p_FAST, m_FAST, u_SrvD, y_ED, y_IfW, y_OpFM, y_BD, MeshMapData, ErrStat, ErrMsg)
 This routine sets the inputs required for ServoDyn. More...
 
subroutine srvd_setexternalinputs (p_FAST, m_FAST, u_SrvD)
 This routine sets the inputs required for ServoDyn from an external source (Simulink) More...
 
subroutine transfer_sd_to_hd (y_SD, u_HD_M_LumpedMesh, u_HD_M_DistribMesh, MeshMapData, ErrStat, ErrMsg)
 This routine transfers the SD outputs into inputs required for HD. More...
 
subroutine transfer_platformmotion_to_hd (PlatformMotion, u_HD, MeshMapData, ErrStat, ErrMsg)
 This routine transfers the platform motion output of the structural module (ED) into inputs required for HD. More...
 
subroutine transfer_ed_to_hd_sd_bd_mooring (p_FAST, y_ED, u_HD, u_SD, u_ExtPtfm, u_MAP, u_FEAM, u_MD, u_Orca, u_BD, MeshMapData, ErrStat, ErrMsg)
 This routine transfers the ED outputs into inputs required for HD, SD, ExtPtfm, BD, MAP, and/or FEAM. More...
 
subroutine map_inputsolve (u_MAP, y_ED, MeshMapData, ErrStat, ErrMsg)
 This routine sets the inputs required for MAP. More...
 
subroutine feam_inputsolve (u_FEAM, y_ED, MeshMapData, ErrStat, ErrMsg)
 This routine sets the inputs required for FEAM. More...
 
subroutine md_inputsolve (u_MD, y_ED, MeshMapData, ErrStat, ErrMsg)
 This routine sets the inputs required for MoorDyn. More...
 
subroutine icefloe_inputsolve (u_IceF, y_SD, MeshMapData, ErrStat, ErrMsg)
 This routine sets the inputs required for IceFloe. More...
 
subroutine iced_inputsolve (u_IceD, y_SD, MeshMapData, legNum, ErrStat, ErrMsg)
 This routine sets the inputs required for IceFloe. More...
 
subroutine transfer_ed_to_bd (y_ED, u_BD, MeshMapData, ErrStat, ErrMsg)
 This routine sets the inputs required for IceFloe. More...
 
subroutine transfer_ed_to_bd_tmp (y_ED, MeshMapData, ErrStat, ErrMsg)
 This routine sets the inputs required for IceFloe. More...
 
subroutine transfer_hd_to_sd (u_mapped, u_SD_LMesh, u_mapped_positions, y_HD, u_HD_M_LumpedMesh, u_HD_M_DistribMesh, MeshMapData, ErrStat, ErrMsg)
 This routine transfers the HD outputs into inputs required for ED. More...
 
real(reki) function getperturb (x)
 function to return the size of perturbation in calculating jacobian with finite differences. More...
 
subroutine ed_hd_inputoutputsolve (this_time, p_FAST, calcJacobian, u_ED, p_ED, x_ED, xd_ED, z_ED, OtherSt_ED, y_ED, m_ED, u_HD, p_HD, x_HD, xd_HD, z_HD, OtherSt_HD, y_HD, m_HD, u_MAP, y_MAP, u_FEAM, y_FEAM, u_MD, y_MD, MeshMapData, ErrStat, ErrMsg, WriteThisStep)
 This routine performs the Input-Output solve for ED and HD. More...
 
subroutine fullopt1_inputoutputsolve (this_time, p_FAST, calcJacobian, u_ED, p_ED, x_ED, xd_ED, z_ED, OtherSt_ED, y_ED, m_ED, u_SD, p_SD, x_SD, xd_SD, z_SD, OtherSt_SD, y_SD, m_SD, u_ExtPtfm, p_ExtPtfm, x_ExtPtfm, xd_ExtPtfm, z_ExtPtfm, OtherSt_ExtPtfm, y_ExtPtfm, m_ExtPtfm, u_HD, p_HD, x_HD, xd_HD, z_HD, OtherSt_HD, y_HD, m_HD, u_BD, p_BD, x_BD, xd_BD, z_BD, OtherSt_BD, y_BD, m_BD, u_Orca, p_Orca, x_Orca, xd_Orca, z_Orca, OtherSt_Orca, y_Orca, m_Orca, u_MAP, y_MAP, u_FEAM, y_FEAM, u_MD, y_MD, u_IceF, y_IceF, u_IceD, y_IceD, MeshMapData, ErrStat, ErrMsg, WriteThisStep)
 This routine performs the Input-Output solve for ED, SD, HD, BD, and/or the OrcaFlex Interface. More...
 
subroutine init_fullopt1_jacobian (p_FAST, MeshMapData, ED_PlatformPtMesh, SD_TPMesh, SD_LMesh, HD_M_LumpedMesh, HD_M_DistribMesh, HD_WAMIT_Mesh, ED_HubPtLoad, u_BD, Orca_PtfmMesh, ExtPtfm_PtfmMesh, ErrStat, ErrMsg)
 This routine initializes the array that maps rows/columns of the Jacobian to specific mesh fields. More...
 
subroutine create_fullopt1_uvector (u, ED_PlatformPtMesh, SD_TPMesh, SD_LMesh, HD_M_LumpedMesh, HD_M_DistribMesh, HD_WAMIT_Mesh, ED_HubPtLoad, BD_RootMotion, Orca_PtfmMesh, ExtPtfm_PtfmMesh, p_FAST)
 This routine basically packs the relevant parts of the modules' input meshes for use in this InputOutput solve. More...
 
subroutine add_fullopt1_u_delta (p_FAST, Jac_u_indx, u_delta, u_ED, u_SD, u_HD, u_BD, u_Orca, u_ExtPtfm)
 This routine adds u_delta to the corresponding mesh field and scales it as appropriate. More...
 
subroutine perturb_u_fullopt1 (p_FAST, Jac_u_indx, n, u_perturb, u_ED_perturb, u_SD_perturb, u_HD_perturb, u_BD_perturb, u_Orca_perturb, u_ExtPtfm_perturb, perturb)
 This routine perturbs the nth element of the u array (and mesh/field it corresponds to) More...
 
subroutine resetremapflags (p_FAST, ED, BD, AD14, AD, HD, SD, ExtPtfm, SrvD, MAPp, FEAM, MD, Orca, IceF, IceD)
 This routine resets the remap flags on all of the meshes. More...
 
subroutine initmodulemappings (p_FAST, ED, BD, AD14, AD, HD, SD, ExtPtfm, SrvD, MAPp, FEAM, MD, Orca, IceF, IceD, MeshMapData, ErrStat, ErrMsg)
 This routine initializes all of the mapping data structures needed between the various modules. More...
 
subroutine calcoutputs_and_solveforinputs (n_t_global, this_time, this_state, calcJacobian, NextJacCalcTime, p_FAST, m_FAST, WriteThisStep, ED, BD, SrvD, AD14, AD, IfW, OpFM, HD, SD, ExtPtfm, MAPp, FEAM, MD, Orca, IceF, IceD, MeshMapData, ErrStat, ErrMsg)
 This subroutine solves the input-output relations for all of the modules. More...
 
subroutine solveoption1 (this_time, this_state, calcJacobian, p_FAST, ED, BD, HD, SD, ExtPtfm, MAPp, FEAM, MD, Orca, IceF, IceD, MeshMapData, ErrStat, ErrMsg, WriteThisStep)
 This routine implements the "option 1" solve for all inputs with direct links to HD, SD, ExtPtfm, MAP, OrcaFlex interface, and the ED platform reference point. More...
 
subroutine solveoption2a_inp2bd (this_time, this_state, p_FAST, m_FAST, ED, BD, AD14, AD, SrvD, IfW, OpFM, MeshMapData, ErrStat, ErrMsg, WriteThisStep)
 This routine implements the first part of the "option 2" solve for inputs that apply to BeamDyn and AeroDyn. More...
 
subroutine solveoption2b_inp2ifw (this_time, this_state, p_FAST, m_FAST, ED, BD, AD14, AD, SrvD, IfW, OpFM, MeshMapData, ErrStat, ErrMsg, WriteThisStep)
 This routine implements the first part of the "option 2" solve for inputs that apply to AeroDyn & InflowWind. More...
 
subroutine solveoption2c_inp2ad_srvd (this_time, this_state, p_FAST, m_FAST, ED, BD, AD14, AD, SrvD, IfW, OpFM, MeshMapData, ErrStat, ErrMsg, WriteThisStep)
 This routine implements the first part of the "option 2" solve for inputs that apply to AeroDyn and ServoDyn. More...
 
subroutine solveoption2 (this_time, this_state, p_FAST, m_FAST, ED, BD, AD14, AD, SrvD, IfW, OpFM, MeshMapData, ErrStat, ErrMsg, firstCall, WriteThisStep)
 This routine implements the "option 2" solve for all inputs without direct links to HD, SD, MAP, or the ED platform reference point. More...
 
subroutine fast_advancestates (t_initial, n_t_global, p_FAST, m_FAST, ED, BD, SrvD, AD14, AD, IfW, OpFM, HD, SD, ExtPtfm, MAPp, FEAM, MD, Orca, IceF, IceD, MeshMapData, ErrStat, ErrMsg, WriteThisStep)
 This routines advances the states of each module. More...
 
subroutine fast_extrapinterpmods (t_global_next, p_FAST, m_FAST, ED, BD, SrvD, AD14, AD, IfW, HD, SD, ExtPtfm, MAPp, FEAM, MD, Orca, IceF, IceD, ErrStat, ErrMsg)
 This routine extrapolates inputs to modules to give predicted values at t+dt. More...
 

Detailed Description

This module contains the routines used by FAST to solve input-output equations and to advance states.

Function/Subroutine Documentation

◆ ad14_inputsolve_ifw()

subroutine fast_solver::ad14_inputsolve_ifw ( type(fast_parametertype), intent(in)  p_FAST,
type(ad14_inputtype), intent(inout)  u_AD14,
type(inflowwind_outputtype), intent(in)  y_IfW,
type(opfm_outputtype), intent(in)  y_OpFM,
integer(intki)  ErrStat,
character(*)  ErrMsg 
)

This routine sets the AeroDyn14 wind inflow inputs.

Parameters
[in]p_fastparameter FAST data
[in,out]u_ad14The inputs to AeroDyn14
[in]y_ifwThe outputs from InflowWind
[in]y_opfmoutputs from the OpenFOAM integration module
errstatError status of the operation
errmsgError message if ErrStat /= ErrID_None

◆ ad14_inputsolve_noifw()

subroutine fast_solver::ad14_inputsolve_noifw ( type(fast_parametertype), intent(in)  p_FAST,
type(ad14_inputtype), intent(inout)  u_AD14,
type(ed_outputtype), intent(in)  y_ED,
type(fast_modulemaptype), intent(inout)  MeshMapData,
integer(intki)  ErrStat,
character(*)  ErrMsg 
)

This routine sets all the AeroDyn14 inputs, except for the wind inflow values.

THIS ROUTINE IS A HACK TO GET THE OUTPUTS FROM ELASTODYN INTO AERODYN14. DO NOT COPY OR USE IN NEW CODE!

Parameters
[in]p_fastparameter FAST data
[in,out]u_ad14The inputs to AeroDyn14
[in]y_edThe outputs from the structural dynamics module
[in,out]meshmapdataData for mapping between modules
errstatError status of the operation
errmsgError message if ErrStat /= ErrID_None

◆ ad_inputsolve_ifw()

subroutine fast_solver::ad_inputsolve_ifw ( type(fast_parametertype), intent(in)  p_FAST,
type(ad_inputtype), intent(inout)  u_AD,
type(inflowwind_outputtype), intent(in)  y_IfW,
type(opfm_outputtype), intent(in)  y_OpFM,
integer(intki)  ErrStat,
character(*)  ErrMsg 
)

This routine sets the AeroDyn wind inflow inputs.

Parameters
[in]p_fastFAST parameter data
[in,out]u_adThe inputs to AeroDyn
[in]y_ifwThe outputs from InflowWind
[in]y_opfmoutputs from the OpenFOAM integration module
errstatError status of the operation
errmsgError message if ErrStat /= ErrID_None

◆ ad_inputsolve_noifw()

subroutine fast_solver::ad_inputsolve_noifw ( type(fast_parametertype), intent(in)  p_FAST,
type(ad_inputtype), intent(inout)  u_AD,
type(srvd_outputtype), intent(in)  y_SrvD,
type(ed_outputtype), intent(in)  y_ED,
type(beamdyn_data), intent(in)  BD,
type(fast_modulemaptype), intent(inout)  MeshMapData,
integer(intki)  ErrStat,
character(*)  ErrMsg 
)

This routine sets all the AeroDyn inputs, except for the wind inflow values.

Parameters
[in]p_fastFAST parameter data
[in,out]u_adThe inputs to AeroDyn14
[in]y_srvdServoDyn outputs
[in]y_edThe outputs from the structural dynamics module
[in]bdThe data from BeamDyn (want the outputs only, but it's in an array)
[in,out]meshmapdataData for mapping between modules
errstatError status of the operation
errmsgError message if ErrStat /= ErrID_None

◆ add_fullopt1_u_delta()

subroutine fast_solver::add_fullopt1_u_delta ( type(fast_parametertype), intent(in)  p_FAST,
integer( intki ), dimension(:,:), intent(in)  Jac_u_indx,
real( reki ), dimension(:), intent(in)  u_delta,
type(ed_inputtype), intent(inout)  u_ED,
type(sd_inputtype), intent(inout)  u_SD,
type(hydrodyn_inputtype), intent(inout)  u_HD,
type(bd_inputtype), dimension(:), intent(inout)  u_BD,
type(orca_inputtype), intent(inout)  u_Orca,
type(extptfm_inputtype), intent(inout)  u_ExtPtfm 
)

This routine adds u_delta to the corresponding mesh field and scales it as appropriate.

Parameters
[in]p_fastGlue-code simulation parameters
[in]jac_u_indxIndex to map Jacobian u-vector into mesh fields
[in]u_deltaThe delta amount to add to the appropriate mesh fields
[in,out]u_edED System inputs
[in,out]u_sdSD System inputs
[in,out]u_hdSD System inputs
[in,out]u_bdBD System inputs
[in,out]u_orcaOrca System inputs
[in,out]u_extptfmExtPtfm System inputs

◆ bd_inputsolve()

subroutine fast_solver::bd_inputsolve ( type(fast_parametertype), intent(in)  p_FAST,
type(beamdyn_data), intent(inout)  BD,
type(ad_outputtype), intent(in)  y_AD,
type(ad_inputtype), intent(in)  u_AD,
type(ed_outputtype), intent(in)  y_ED,
type(fast_modulemaptype), intent(inout)  MeshMapData,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)

This routine sets the inputs required for BD–using the Option 2 solve method; currently the only inputs solved in this routine are the blade distributed loads from AD15; other inputs are solved in option 1.

Parameters
[in]p_fastGlue-code simulation parameters
[in,out]bdBD Inputs at t
[in]y_adAeroDyn outputs
[in]u_adAD inputs (for AD-BD load transfer)
[in]y_edElastoDyn outputs
[in,out]meshmapdataData for mapping between modules
[out]errstatError status
[out]errmsgError message

◆ calcoutputs_and_solveforinputs()

subroutine fast_solver::calcoutputs_and_solveforinputs ( integer(intki), intent(in)  n_t_global,
real(dbki), intent(in)  this_time,
integer(intki), intent(in)  this_state,
logical, intent(inout)  calcJacobian,
real(dbki), intent(in)  NextJacCalcTime,
type(fast_parametertype), intent(in)  p_FAST,
type(fast_miscvartype), intent(in)  m_FAST,
logical, intent(in)  WriteThisStep,
type(elastodyn_data), intent(inout)  ED,
type(beamdyn_data), intent(inout)  BD,
type(servodyn_data), intent(inout)  SrvD,
type(aerodyn14_data), intent(inout)  AD14,
type(aerodyn_data), intent(inout)  AD,
type(inflowwind_data), intent(inout)  IfW,
type(openfoam_data), intent(inout)  OpFM,
type(hydrodyn_data), intent(inout)  HD,
type(subdyn_data), intent(inout)  SD,
type(extptfm_data), intent(inout)  ExtPtfm,
type(map_data), intent(inout)  MAPp,
type(feamooring_data), intent(inout)  FEAM,
type(moordyn_data), intent(inout)  MD,
type(orcaflex_data), intent(inout)  Orca,
type(icefloe_data), intent(inout)  IceF,
type(icedyn_data), intent(inout)  IceD,
type(fast_modulemaptype), intent(inout)  MeshMapData,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)

This subroutine solves the input-output relations for all of the modules.

It is a subroutine because it gets done twice– once at the start of the n_t_global loop and once in the j_pc loop, using different states. *** Note that modules that do not have direct feedthrough should be called first. ***

Parameters
[in]this_timeThe current simulation time (actual or time of prediction)
[in]this_stateIndex into the state array (current or predicted states)
[in]n_t_globalcurrent time step (used only for SrvD hack)
[in,out]calcjacobianShould we calculate Jacobians in Option 1?
[in]nextjaccalctimeTime between calculating Jacobians in the HD-ED and SD-ED simulations
[in]p_fastParameters for the glue code
[in]m_fastMisc variables (including external inputs) for the glue code
[in]writethisstepWill we print the WriteOutput values this step?
[in,out]edElastoDyn data
[in,out]bdBeamDyn data
[in,out]srvdServoDyn data
[in,out]ad14AeroDyn14 data
[in,out]adAeroDyn data
[in,out]ifwInflowWind data
[in,out]opfmOpenFOAM data
[in,out]hdHydroDyn data
[in,out]sdSubDyn data
[in,out]extptfmExtPtfm data
[in,out]mappMAP data
[in,out]feamFEAMooring data
[in,out]mdData for the MoorDyn module
[in,out]orcaOrcaFlex interface data
[in,out]icefIceFloe data
[in,out]icedAll the IceDyn data used in time-step loop
[in,out]meshmapdataData for mapping between modules
[out]errstatError status of the operation
[out]errmsgError message if ErrStat /= ErrID_None

For cases with HydroDyn, BeamDyn, OrcaFlex interface, and/or SubDyn, it calls ED_CalcOuts (a time-sink) 3 times per step/correction (plus the 6 calls when calculating the Jacobian). In cases without HydroDyn or SubDyn, it is the same as Option 1 before 2 (with 1 call to ED_CalcOuts either way).

Option 1 before 2 usually requires a correction step, whereas Option 2 before Option 1 often does not. Thus we are using this option, calling ED_CalcOuts 3 times (option 2 before 1 with no correction step) instead of 4 times (option1 before 2 with one correction step). Note that this analysis may change if/when AeroDyn14 (and ServoDyn?) generate different outputs on correction steps. (Currently, AeroDyn (v14) returns old values until time advances.) Also note that AD15's DBEMT module (and UA?) is heavily time-dependent without calling the structural code first (DBEMT's filters do not deal well with the extrapolated inputs).

Solve option 2 (modules without direct feedthrough):

transfer ED outputs to other modules used in option 1:

Solve option 1 (rigorous solve on loads/accelerations)

Now use the ElastoDyn and BD outputs from option1 to update the inputs for InflowWind, AeroDyn, and ServoDyn (necessary only if they have states)

◆ create_fullopt1_uvector()

subroutine fast_solver::create_fullopt1_uvector ( real(reki), dimension(:), intent(inout)  u,
type(meshtype), intent(in)  ED_PlatformPtMesh,
type(meshtype), intent(in)  SD_TPMesh,
type(meshtype), intent(in)  SD_LMesh,
type(meshtype), intent(in)  HD_M_LumpedMesh,
type(meshtype), intent(in)  HD_M_DistribMesh,
type(meshtype), intent(in)  HD_WAMIT_Mesh,
type(meshtype), intent(in)  ED_HubPtLoad,
type(meshtype), dimension(:), intent(in)  BD_RootMotion,
type(meshtype), intent(in)  Orca_PtfmMesh,
type(meshtype), intent(in)  ExtPtfm_PtfmMesh,
type(fast_parametertype), intent(in)  p_FAST 
)

This routine basically packs the relevant parts of the modules' input meshes for use in this InputOutput solve.

Do not change the order of this packing without changing subroutine Init_FullOpt1_Jacobian()!

Parameters
[in,out]uoutput u vector
[in]ed_platformptmeshElastoDyn PlatformPt mesh
[in]sd_tpmeshSubDyn TP mesh
[in]sd_lmeshSubDyn Lmesh
[in]hd_m_lumpedmeshHydroDyn Morison Lumped mesh
[in]hd_m_distribmeshHydroDyn Morison distributed mesh
[in]hd_wamit_meshHydroDyn WAMIT mesh
[in]ed_hubptloadElastoDyn HubPt mesh
[in]bd_rootmotionBeamDyn RootMotion meshes
[in]orca_ptfmmeshOrcaFlex interface PtfmMesh
[in]extptfm_ptfmmeshExtPtfm interface PtfmMesh
[in]p_fastFAST parameters

◆ ed_hd_inputoutputsolve()

subroutine fast_solver::ed_hd_inputoutputsolve ( real(dbki), intent(in)  this_time,
type(fast_parametertype), intent(in)  p_FAST,
logical, intent(in)  calcJacobian,
type(ed_inputtype), intent(inout)  u_ED,
type(ed_parametertype), intent(in)  p_ED,
type(ed_continuousstatetype), intent(in)  x_ED,
type(ed_discretestatetype), intent(in)  xd_ED,
type(ed_constraintstatetype), intent(in)  z_ED,
type(ed_otherstatetype), intent(inout)  OtherSt_ED,
type(ed_outputtype), intent(inout)  y_ED,
type(ed_miscvartype), intent(inout)  m_ED,
type(hydrodyn_inputtype), intent(inout)  u_HD,
type(hydrodyn_parametertype), intent(in)  p_HD,
type(hydrodyn_continuousstatetype), intent(in)  x_HD,
type(hydrodyn_discretestatetype), intent(in)  xd_HD,
type(hydrodyn_constraintstatetype), intent(in)  z_HD,
type(hydrodyn_otherstatetype), intent(inout)  OtherSt_HD,
type(hydrodyn_outputtype), intent(inout)  y_HD,
type(hydrodyn_miscvartype), intent(inout)  m_HD,
type(map_inputtype), intent(inout)  u_MAP,
type(map_outputtype), intent(in)  y_MAP,
type(feam_inputtype), intent(inout)  u_FEAM,
type(feam_outputtype), intent(in)  y_FEAM,
type(md_inputtype), intent(inout)  u_MD,
type(md_outputtype), intent(in)  y_MD,
type(fast_modulemaptype), intent(inout)  MeshMapData,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg,
logical, intent(in)  WriteThisStep 
)

This routine performs the Input-Output solve for ED and HD.

Note that this has been customized for the physics in the problems and is not a general solution.

Parameters
[in]this_timeThe current simulation time (actual or time of prediction)
[in]p_fastGlue-code simulation parameters
[in]calcjacobianShould we calculate Jacobians this time? (should be TRUE on initialization, then can be false [significantly reducing computational time])
[in]x_edContinuous states
[in]xd_edDiscrete states
[in]z_edConstraint states
[in,out]otherst_edOther states
[in]p_edParameters
[in,out]u_edSystem inputs
[in,out]y_edSystem outputs
[in,out]m_edmisc/optimization variables
[in]x_hdContinuous states
[in]xd_hdDiscrete states
[in]z_hdConstraint states
[in,out]otherst_hdOther states
[in]p_hdParameters
[in,out]u_hdSystem inputs
[in,out]y_hdSystem outputs
[in,out]m_hdmisc/optimization variables
[in]y_mapMAP outputs
[in,out]u_mapMAP inputs (INOUT just because I don't want to use another tempoarary mesh and we'll overwrite this later)
[in]y_feamFEAM outputs
[in,out]u_feamFEAM inputs (INOUT just because I don't want to use another tempoarary mesh and we'll overwrite this later)
[in]y_mdMoorDyn outputs
[in,out]u_mdMoorDyn inputs (INOUT just because I don't want to use another tempoarary mesh and we'll overwrite this later)
[in,out]meshmapdatadata for mapping meshes between modules
[out]errstatError status of the operation
[out]errmsgError message if ErrStat /= ErrID_None
[in]writethisstepWill we print the WriteOutput values this step?

◆ ed_inputsolve()

subroutine fast_solver::ed_inputsolve ( type(fast_parametertype), intent(in)  p_FAST,
type(ed_inputtype), intent(inout)  u_ED,
type(ed_outputtype), intent(in)  y_ED,
type(ad14_parametertype), intent(in)  p_AD14,
type(ad14_outputtype), intent(in)  y_AD14,
type(ad_outputtype), intent(in)  y_AD,
type(srvd_outputtype), intent(in)  y_SrvD,
type(ad_inputtype), intent(in)  u_AD,
type(srvd_inputtype), intent(in)  u_SrvD,
type(fast_modulemaptype), intent(inout)  MeshMapData,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)

This routine sets the inputs required for ED–using the Option 2 solve method; currently the only input not solved in this routine are the fields on PlatformPtMesh and HubPtLoad, which are solved in option 1.

Parameters
[in]p_fastGlue-code simulation parameters
[in,out]u_edED Inputs at t
[in]y_edElastoDyn outputs (need translation displacement on meshes for loads mapping)
[in]p_ad14AeroDyn14 parameters (a hack because the AD14 meshes aren't set up properly)
[in]y_ad14AeroDyn14 outputs
[in]y_adAeroDyn outputs
[in]u_adAD inputs (for AD-ED load transfer)
[in]y_srvdServoDyn outputs
[in]u_srvdServoDyn inputs
[in,out]meshmapdataData for mapping between modules
[out]errstatError status
[out]errmsgError message

◆ fast_advancestates()

subroutine fast_solver::fast_advancestates ( real(dbki), intent(in)  t_initial,
integer(intki), intent(in)  n_t_global,
type(fast_parametertype), intent(in)  p_FAST,
type(fast_miscvartype), intent(in)  m_FAST,
type(elastodyn_data), intent(inout)  ED,
type(beamdyn_data), intent(inout)  BD,
type(servodyn_data), intent(inout)  SrvD,
type(aerodyn14_data), intent(inout)  AD14,
type(aerodyn_data), intent(inout)  AD,
type(inflowwind_data), intent(inout)  IfW,
type(openfoam_data), intent(inout)  OpFM,
type(hydrodyn_data), intent(inout)  HD,
type(subdyn_data), intent(inout)  SD,
type(extptfm_data), intent(inout)  ExtPtfm,
type(map_data), intent(inout)  MAPp,
type(feamooring_data), intent(inout)  FEAM,
type(moordyn_data), intent(inout)  MD,
type(orcaflex_data), intent(inout)  Orca,
type(icefloe_data), intent(inout)  IceF,
type(icedyn_data), intent(inout)  IceD,
type(fast_modulemaptype), intent(inout)  MeshMapData,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg,
logical, intent(in)  WriteThisStep 
)

This routines advances the states of each module.

Parameters
[in]t_initialinitial simulation time (almost always 0)
[in]n_t_globalinteger time step
[in]p_fastParameters for the glue code
[in]m_fastMiscellaneous variables
[in,out]edElastoDyn data
[in,out]bdBeamDyn data
[in,out]srvdServoDyn data
[in,out]ad14AeroDyn v14 data
[in,out]adAeroDyn data
[in,out]ifwInflowWind data
[in,out]opfmOpenFOAM data
[in,out]hdHydroDyn data
[in,out]sdSubDyn data
[in,out]extptfmExtPtfm data
[in,out]mappMAP data
[in,out]feamFEAMooring data
[in,out]mdData for the MoorDyn module
[in,out]orcaOrcaFlex interface data
[in,out]icefIceFloe data
[in,out]icedAll the IceDyn data used in time-step loop
[in,out]meshmapdataData for mapping between modules (added to help BD get better root motion inputs)
[out]errstatError status of the operation
[out]errmsgError message if ErrStat /= ErrID_None
[in]writethisstepWill we print the WriteOutput values this step (for optimizations with SolveOption2)?

◆ fast_extrapinterpmods()

subroutine fast_solver::fast_extrapinterpmods ( real(dbki), intent(in)  t_global_next,
type(fast_parametertype), intent(in)  p_FAST,
type(fast_miscvartype), intent(in)  m_FAST,
type(elastodyn_data), intent(inout)  ED,
type(beamdyn_data), intent(inout)  BD,
type(servodyn_data), intent(inout)  SrvD,
type(aerodyn14_data), intent(inout)  AD14,
type(aerodyn_data), intent(inout)  AD,
type(inflowwind_data), intent(inout)  IfW,
type(hydrodyn_data), intent(inout)  HD,
type(subdyn_data), intent(inout)  SD,
type(extptfm_data), intent(inout)  ExtPtfm,
type(map_data), intent(inout)  MAPp,
type(feamooring_data), intent(inout)  FEAM,
type(moordyn_data), intent(inout)  MD,
type(orcaflex_data), intent(inout)  Orca,
type(icefloe_data), intent(inout)  IceF,
type(icedyn_data), intent(inout)  IceD,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)

This routine extrapolates inputs to modules to give predicted values at t+dt.

Parameters
[in]t_global_nextnext global time step (t + dt), at which we're extrapolating inputs (and ED outputs)
[in]p_fastParameters for the glue code
[in]m_fastMiscellaneous variables
[in,out]edElastoDyn data
[in,out]bdBeamDyn data
[in,out]srvdServoDyn data
[in,out]ad14AeroDyn14 data
[in,out]adAeroDyn data
[in,out]ifwInflowWind data
[in,out]hdHydroDyn data
[in,out]sdSubDyn data
[in,out]extptfmExtPtfm data
[in,out]mappMAP data
[in,out]feamFEAMooring data
[in,out]mdData for the MoorDyn module
[in,out]orcaOrcaFlex interface data
[in,out]icefIceFloe data
[in,out]icedAll the IceDyn data used in time-step loop
[out]errstatError status of the operation
[out]errmsgError message if ErrStat /= ErrID_None

◆ feam_inputsolve()

subroutine fast_solver::feam_inputsolve ( type(feam_inputtype), intent(inout)  u_FEAM,
type(ed_outputtype), intent(in)  y_ED,
type(fast_modulemaptype), intent(inout)  MeshMapData,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)

This routine sets the inputs required for FEAM.

Parameters
[in,out]u_feamFEAM input
[in]y_edThe outputs of the structural dynamics module
[in,out]meshmapdatadata for mapping meshes between modules
[out]errstatError status of the operation
[out]errmsgError message if ErrStat /= ErrID_None

◆ fullopt1_inputoutputsolve()

subroutine fast_solver::fullopt1_inputoutputsolve ( real(dbki), intent(in)  this_time,
type(fast_parametertype), intent(in)  p_FAST,
logical, intent(in)  calcJacobian,
type(ed_inputtype), intent(inout)  u_ED,
type(ed_parametertype), intent(in)  p_ED,
type(ed_continuousstatetype), intent(in)  x_ED,
type(ed_discretestatetype), intent(in)  xd_ED,
type(ed_constraintstatetype), intent(in)  z_ED,
type(ed_otherstatetype), intent(in)  OtherSt_ED,
type(ed_outputtype), intent(inout), target  y_ED,
type(ed_miscvartype), intent(inout)  m_ED,
type(sd_inputtype), intent(inout)  u_SD,
type(sd_parametertype), intent(in)  p_SD,
type(sd_continuousstatetype), intent(in)  x_SD,
type(sd_discretestatetype), intent(in)  xd_SD,
type(sd_constraintstatetype), intent(in)  z_SD,
type(sd_otherstatetype), intent(in)  OtherSt_SD,
type(sd_outputtype), intent(inout)  y_SD,
type(sd_miscvartype), intent(inout)  m_SD,
type(extptfm_inputtype), intent(inout)  u_ExtPtfm,
type(extptfm_parametertype), intent(in)  p_ExtPtfm,
type(extptfm_continuousstatetype), intent(in)  x_ExtPtfm,
type(extptfm_discretestatetype), intent(in)  xd_ExtPtfm,
type(extptfm_constraintstatetype), intent(in)  z_ExtPtfm,
type(extptfm_otherstatetype), intent(in)  OtherSt_ExtPtfm,
type(extptfm_outputtype), intent(inout)  y_ExtPtfm,
type(extptfm_miscvartype), intent(inout)  m_ExtPtfm,
type(hydrodyn_inputtype), intent(inout)  u_HD,
type(hydrodyn_parametertype), intent(in)  p_HD,
type(hydrodyn_continuousstatetype), intent(in)  x_HD,
type(hydrodyn_discretestatetype), intent(in)  xd_HD,
type(hydrodyn_constraintstatetype), intent(in)  z_HD,
type(hydrodyn_otherstatetype), intent(inout)  OtherSt_HD,
type(hydrodyn_outputtype), intent(inout)  y_HD,
type(hydrodyn_miscvartype), intent(inout)  m_HD,
type(bd_inputtype), dimension(:), intent(inout)  u_BD,
type(bd_parametertype), dimension(:), intent(in)  p_BD,
type(bd_continuousstatetype), dimension(:), intent(in)  x_BD,
type(bd_discretestatetype), dimension(:), intent(in)  xd_BD,
type(bd_constraintstatetype), dimension(:), intent(in)  z_BD,
type(bd_otherstatetype), dimension(:), intent(in)  OtherSt_BD,
type(bd_outputtype), dimension(:), intent(inout)  y_BD,
type(bd_miscvartype), dimension(:), intent(inout)  m_BD,
type(orca_inputtype), intent(inout)  u_Orca,
type(orca_parametertype), intent(in)  p_Orca,
type(orca_continuousstatetype), intent(in)  x_Orca,
type(orca_discretestatetype), intent(in)  xd_Orca,
type(orca_constraintstatetype), intent(in)  z_Orca,
type(orca_otherstatetype), intent(in)  OtherSt_Orca,
type(orca_outputtype), intent(inout)  y_Orca,
type(orca_miscvartype), intent(inout)  m_Orca,
type(map_inputtype), intent(inout)  u_MAP,
type(map_outputtype), intent(in)  y_MAP,
type(feam_inputtype), intent(inout)  u_FEAM,
type(feam_outputtype), intent(in)  y_FEAM,
type(md_inputtype), intent(inout)  u_MD,
type(md_outputtype), intent(in)  y_MD,
type(icefloe_inputtype), intent(inout)  u_IceF,
type(icefloe_outputtype), intent(in)  y_IceF,
type(iced_inputtype), dimension(:), intent(inout)  u_IceD,
type(iced_outputtype), dimension(:), intent(in)  y_IceD,
type(fast_modulemaptype), intent(inout)  MeshMapData,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg,
logical, intent(in)  WriteThisStep 
)

This routine performs the Input-Output solve for ED, SD, HD, BD, and/or the OrcaFlex Interface.

Note that this has been customized for the physics in the problems and is not a general solution.

Parameters
[in]this_timeThe current simulation time (actual or time of prediction)
[in]p_fastGlue-code simulation parameters
[in]calcjacobianShould we calculate Jacobians this time?
[in]x_edContinuous states
[in]xd_edDiscrete states
[in]z_edConstraint states
[in]otherst_edOther states
[in]p_edParameters
[in,out]u_edSystem inputs
[in,out]y_edSystem outputs
[in,out]m_edmisc/optimization variables
[in]x_bdContinuous states
[in]xd_bdDiscrete states
[in]z_bdConstraint states
[in]otherst_bdOther/optimization states
[in]p_bdParameters
[in,out]u_bdSystem inputs
[in,out]y_bdSystem outputs
[in,out]m_bdmisc/optimization variables
[in]x_sdContinuous states
[in]xd_sdDiscrete states
[in]z_sdConstraint states
[in]otherst_sdOther states
[in]p_sdParameters
[in,out]u_sdSystem inputs
[in,out]y_sdSystem outputs
[in,out]m_sdmisc/optimization variables
[in]x_extptfmContinuous states
[in]xd_extptfmDiscrete states
[in]z_extptfmConstraint states
[in]otherst_extptfmOther states
[in]p_extptfmParameters
[in,out]u_extptfmSystem inputs
[in,out]y_extptfmSystem outputs
[in,out]m_extptfmmisc/optimization variables
[in]x_hdContinuous states
[in]xd_hdDiscrete states
[in]z_hdConstraint states
[in,out]otherst_hdOther states
[in]p_hdParameters
[in,out]u_hdSystem inputs
[in,out]y_hdSystem outputs
[in,out]m_hdmisc/optimization variables
[in]x_orcaContinuous states
[in]xd_orcaDiscrete states
[in]z_orcaConstraint states
[in]otherst_orcaOther states
[in]p_orcaParameters
[in,out]u_orcaSystem inputs
[in,out]y_orcaSystem outputs
[in,out]m_orcamisc/optimization variables
[in]y_mapMAP outputs
[in,out]u_mapMAP inputs (INOUT just because I don't want to use another tempoarary mesh and we'll overwrite this later)
[in]y_feamFEAM outputs
[in,out]u_feamFEAM inputs (INOUT just because I don't want to use another tempoarary mesh and we'll overwrite this later)
[in]y_mdMoorDyn outputs
[in,out]u_mdMoorDyn inputs (INOUT just because I don't want to use another tempoarary mesh and we'll overwrite this later)
[in]y_icefIceFloe outputs
[in,out]u_icefIceFloe inputs (INOUT just because I don't want to use another tempoarary mesh and we'll overwrite this later)
[in]y_icedIceDyn outputs
[in,out]u_icedIceDyn inputs (INOUT just because I don't want to use another tempoarary mesh and we'll overwrite this later)
[in,out]meshmapdatadata for mapping meshes between modules
[out]errstatError status of the operation
[out]errmsgError message if ErrStat /= ErrID_None
[in]writethisstepWill we print the WriteOutput values this step?

◆ getperturb()

real(reki) function fast_solver::getperturb ( real(reki), intent(in)  x)

function to return the size of perturbation in calculating jacobian with finite differences.

Currently hard-coded to return 1.

Parameters
[in]xvalue that we want to perturb

◆ iced_inputsolve()

subroutine fast_solver::iced_inputsolve ( type(iced_inputtype), intent(inout)  u_IceD,
type(sd_outputtype), intent(in)  y_SD,
type(fast_modulemaptype), intent(inout)  MeshMapData,
integer(intki), intent(in)  legNum,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)

This routine sets the inputs required for IceFloe.

Parameters
[in,out]u_icedIceDyn input
[in]y_sdSubDyn outputs
[in,out]meshmapdatadata for mapping meshes between modules
[in]legnumwhich instance of IceDyn we're using
[out]errstatError status of the operation
[out]errmsgError message if ErrStat /= ErrID_None

◆ icefloe_inputsolve()

subroutine fast_solver::icefloe_inputsolve ( type(icefloe_inputtype), intent(inout)  u_IceF,
type(sd_outputtype), intent(in)  y_SD,
type(fast_modulemaptype), intent(inout)  MeshMapData,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)

This routine sets the inputs required for IceFloe.

Parameters
[in,out]u_icefIceFloe input
[in]y_sdSubDyn outputs
[in,out]meshmapdatadata for mapping meshes between modules
[out]errstatError status of the operation
[out]errmsgError message if ErrStat /= ErrID_None

◆ ifw_inputsolve()

subroutine fast_solver::ifw_inputsolve ( type(fast_parametertype), intent(in)  p_FAST,
type(fast_miscvartype), intent(in)  m_FAST,
type(inflowwind_inputtype), dimension(:), intent(inout)  u_IfW,
type(inflowwind_parametertype), intent(in)  p_IfW,
type(ad14_inputtype), intent(in)  u_AD14,
type(ad_inputtype), intent(in)  u_AD,
type(ad_otherstatetype), intent(in)  OtherSt_AD,
type(ed_outputtype), intent(in)  y_ED,
integer(intki)  ErrStat,
character(*)  ErrMsg 
)

This routine determines the points in space where InflowWind needs to compute wind speeds.

Parameters
[in,out]u_ifwThe inputs to InflowWind
[in]p_ifwThe parameters to InflowWind
[in]u_ad14The input meshes (already calculated) from AeroDyn14
[in]u_adThe input meshes (already calculated) from AeroDyn
[in]otherst_adThe wake points from AeroDyn are in here (Free Vortex Wake)
[in]y_edThe outputs of the structural dynamics module (for IfW Lidar)
[in]p_fastFAST parameter data
[in]m_fastmisc FAST data, including inputs from external codes like Simulink
errstatError status of the operation
errmsgError message if ErrStat /= ErrID_None

◆ ifw_setexternalinputs()

subroutine fast_solver::ifw_setexternalinputs ( type(inflowwind_parametertype), intent(in)  p_IfW,
type(fast_miscvartype), intent(in)  m_FAST,
type(ed_outputtype), intent(in)  y_ED,
type(inflowwind_inputtype), intent(inout)  u_IfW 
)

This routine sets the inputs required for InflowWind from an external source (Simulink)

Parameters
[in]p_ifwInflowWind parameters
[in]m_fastGlue-code misc variables (including inputs from external sources like Simulink)
[in]y_edThe outputs of the structural dynamics module
[in,out]u_ifwInflowWind Inputs at t

◆ init_fullopt1_jacobian()

subroutine fast_solver::init_fullopt1_jacobian ( type(fast_parametertype), intent(inout)  p_FAST,
type(fast_modulemaptype), intent(inout)  MeshMapData,
type(meshtype), intent(in)  ED_PlatformPtMesh,
type(meshtype), intent(in)  SD_TPMesh,
type(meshtype), intent(in)  SD_LMesh,
type(meshtype), intent(in)  HD_M_LumpedMesh,
type(meshtype), intent(in)  HD_M_DistribMesh,
type(meshtype), intent(in)  HD_WAMIT_Mesh,
type(meshtype), intent(in)  ED_HubPtLoad,
type(bd_inputtype), dimension(:), intent(in)  u_BD,
type(meshtype), intent(in)  Orca_PtfmMesh,
type(meshtype), intent(in)  ExtPtfm_PtfmMesh,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)

This routine initializes the array that maps rows/columns of the Jacobian to specific mesh fields.

Do not change the order of this packing without changing subroutine Create_FullOpt1_UVector()!

Parameters
[in,out]p_fastFAST parameters
[in,out]meshmapdatadata that maps meshes together
[in]ed_platformptmeshElastoDyn's PlatformPtMesh
[in]ed_hubptloadElastoDyn's HubPtLoad mesh
[in]sd_tpmeshSubDyn's TP (transition piece) mesh
[in]sd_lmeshSubDyn's LMesh
[in]hd_m_lumpedmeshHydroDyn's Morison Lumped Mesh
[in]hd_m_distribmeshHydroDyn's Morison Distributed Mesh
[in]hd_wamit_meshHydroDyn's WAMIT mesh
[in]u_bdinputs for each instance of the BeamDyn module (for the RootMotion meshes)
[in]orca_ptfmmeshOrcaFlex interface PtfmMesh
[in]extptfm_ptfmmeshExtPtfm_MCKF interface PtfmMesh
[out]errstatError status of the operation
[out]errmsgError message if ErrStat /= ErrID_None

◆ initmodulemappings()

subroutine fast_solver::initmodulemappings ( type(fast_parametertype), intent(inout)  p_FAST,
type(elastodyn_data), intent(inout), target  ED,
type(beamdyn_data), intent(inout)  BD,
type(aerodyn14_data), intent(inout)  AD14,
type(aerodyn_data), intent(inout)  AD,
type(hydrodyn_data), intent(inout)  HD,
type(subdyn_data), intent(inout)  SD,
type(extptfm_data), intent(inout)  ExtPtfm,
type(servodyn_data), intent(inout)  SrvD,
type(map_data), intent(inout)  MAPp,
type(feamooring_data), intent(inout)  FEAM,
type(moordyn_data), intent(inout)  MD,
type(orcaflex_data), intent(inout)  Orca,
type(icefloe_data), intent(inout)  IceF,
type(icedyn_data), intent(inout)  IceD,
type(fast_modulemaptype), intent(inout)  MeshMapData,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)

This routine initializes all of the mapping data structures needed between the various modules.

Parameters
[in,out]p_fastParameters for the glue code
[in,out]edElastoDyn data
[in,out]bdBeamDyn data
[in,out]srvdServoDyn data
[in,out]adAeroDyn data
[in,out]ad14AeroDyn14 data
[in,out]hdHydroDyn data
[in,out]sdSubDyn data
[in,out]extptfmExtPtfm data
[in,out]mappMAP data
[in,out]feamFEAMooring data
[in,out]mdMoorDyn data
[in,out]orcaOrcaFlex interface data
[in,out]icefIceFloe data
[in,out]icedAll the IceDyn data used in time-step loop
[in,out]meshmapdataData for mapping between modules
[out]errstatError status of the operation
[out]errmsgError message if ErrStat /= ErrID_None

◆ map_inputsolve()

subroutine fast_solver::map_inputsolve ( type(map_inputtype), intent(inout)  u_MAP,
type(ed_outputtype), intent(in)  y_ED,
type(fast_modulemaptype), intent(inout)  MeshMapData,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)

This routine sets the inputs required for MAP.

Parameters
[in,out]u_mapMAP input
[in]y_edThe outputs of the structural dynamics module
[in,out]meshmapdatadata for mapping meshes between modules
[out]errstatError status of the operation
[out]errmsgError message if ErrStat /= ErrID_None

◆ md_inputsolve()

subroutine fast_solver::md_inputsolve ( type(md_inputtype), intent(inout)  u_MD,
type(ed_outputtype), intent(in)  y_ED,
type(fast_modulemaptype), intent(inout)  MeshMapData,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)

This routine sets the inputs required for MoorDyn.

Parameters
[in,out]u_mdMoorDyn input
[in]y_edThe outputs of the structural dynamics module
[in,out]meshmapdatadata for mapping meshes between modules
[out]errstatError status of the operation
[out]errmsgError message if ErrStat /= ErrID_None

◆ perturb_u_fullopt1()

subroutine fast_solver::perturb_u_fullopt1 ( type(fast_parametertype), intent(in)  p_FAST,
integer( intki ), dimension(:,:), intent(in)  Jac_u_indx,
integer( intki ), intent(in)  n,
real( reki ), dimension(:), intent(inout)  u_perturb,
type(ed_inputtype), intent(inout), optional  u_ED_perturb,
type(sd_inputtype), intent(inout), optional  u_SD_perturb,
type(hydrodyn_inputtype), intent(inout), optional  u_HD_perturb,
type(bd_inputtype), intent(inout), optional  u_BD_perturb,
type(orca_inputtype), intent(inout), optional  u_Orca_perturb,
type(extptfm_inputtype), intent(inout), optional  u_ExtPtfm_perturb,
real( reki ), intent(out)  perturb 
)

This routine perturbs the nth element of the u array (and mesh/field it corresponds to)

Parameters
[in]p_fastGlue-code simulation parameters
[in]jac_u_indxIndex to map Jacobian u-vector into mesh fields
[in]nnumber of array element to use
[in,out]u_perturbarray to be perturbed
[in,out]u_ed_perturbED System inputs (needed only when 1 <= n <= NumEDNodes=NumEDNodes)
[in,out]u_sd_perturbSD System inputs (needed only when NumEDNodes +1 <= n <= NumEDNodes+NumSDNodes) [if SD is used]
[in,out]u_hd_perturbHD System inputs (needed only when NumEDNodes+NumSDNodes +1 <= n <= NumEDNodes+NumSDNodes+NumHDNodes) [if HD is used and SD is used. if SD not used,
[in,out]u_bd_perturbBD System inputs (needed only when NumEDNodes+NumSDNodes+NumHDNodes+1 <= n <= inf) [if BD is used]
[in,out]u_orca_perturbOrca System inputs (needed only when NumEDNodes+NumSDNodes+NumHDNodes+NumBDNodes+1 <= n <= inf) [if Orca is used]
[in,out]u_extptfm_perturbExtPtfm System inputs (needed only when NumEDNodes+NumSDNodes+NumHDNodes+NumBDNodes+NumOcraNodes+1 <= n <= inf) [if ExtPtfm is used]
[out]perturbamount that u_perturb(n) was perturbed

◆ resetremapflags()

subroutine fast_solver::resetremapflags ( type(fast_parametertype), intent(in)  p_FAST,
type(elastodyn_data), intent(inout)  ED,
type(beamdyn_data), intent(inout)  BD,
type(aerodyn14_data), intent(inout)  AD14,
type(aerodyn_data), intent(inout)  AD,
type(hydrodyn_data), intent(inout)  HD,
type(subdyn_data), intent(inout)  SD,
type(extptfm_data), intent(inout)  ExtPtfm,
type(servodyn_data), intent(inout)  SrvD,
type(map_data), intent(inout)  MAPp,
type(feamooring_data), intent(inout)  FEAM,
type(moordyn_data), intent(inout)  MD,
type(orcaflex_data), intent(inout)  Orca,
type(icefloe_data), intent(inout)  IceF,
type(icedyn_data), intent(inout)  IceD 
)

This routine resets the remap flags on all of the meshes.

Parameters
[in]p_fastParameters for the glue code
[in,out]edElastoDyn data
[in,out]bdBeamDyn data
[in,out]srvdServoDyn data
[in,out]adAeroDyn data
[in,out]ad14AeroDyn14 data
[in,out]hdHydroDyn data
[in,out]sdSubDyn data
[in,out]extptfmExtPtfm data
[in,out]mappMAP data
[in,out]feamFEAMooring data
[in,out]mdMoorDyn data
[in,out]orcaOrcaFlex interface data
[in,out]icefIceFloe data
[in,out]icedAll the IceDyn data used in time-step loop

◆ solveoption1()

subroutine fast_solver::solveoption1 ( real(dbki), intent(in)  this_time,
integer(intki), intent(in)  this_state,
logical, intent(in)  calcJacobian,
type(fast_parametertype), intent(in)  p_FAST,
type(elastodyn_data), intent(inout)  ED,
type(beamdyn_data), intent(inout)  BD,
type(hydrodyn_data), intent(inout)  HD,
type(subdyn_data), intent(inout)  SD,
type(extptfm_data), intent(inout)  ExtPtfm,
type(map_data), intent(inout)  MAPp,
type(feamooring_data), intent(inout)  FEAM,
type(moordyn_data), intent(inout)  MD,
type(orcaflex_data), intent(inout)  Orca,
type(icefloe_data), intent(inout)  IceF,
type(icedyn_data), intent(inout)  IceD,
type(fast_modulemaptype), intent(inout)  MeshMapData,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg,
logical, intent(in)  WriteThisStep 
)

This routine implements the "option 1" solve for all inputs with direct links to HD, SD, ExtPtfm, MAP, OrcaFlex interface, and the ED platform reference point.

Also in solve option 1 are the BD-ED blade root coupling.

Parameters
[in]this_timeThe current simulation time (actual or time of prediction)
[in]this_stateIndex into the state array (current or predicted states)
[in]calcjacobianShould we calculate Jacobians in Option 1?
[in]p_fastParameters for the glue code
[in,out]edElastoDyn data
[in,out]bdBeamDyn data
[in,out]hdHydroDyn data
[in,out]sdSubDyn data
[in,out]extptfmExtPtfm data
[in,out]mappMAP data
[in,out]feamFEAMooring data
[in,out]mdMoorDyn data
[in,out]orcaOrcaFlex interface data
[in,out]icefIceFloe data
[in,out]icedAll the IceDyn data used in time-step loop
[in,out]meshmapdataData for mapping between modules
[out]errstatError status of the operation
[out]errmsgError message if ErrStat /= ErrID_None
[in]writethisstepWill we print the WriteOutput values this step?

Option 1: solve for consistent inputs and outputs, which is required when Y has direct feedthrough in modules coupled together

◆ solveoption2()

subroutine fast_solver::solveoption2 ( real(dbki), intent(in)  this_time,
integer(intki), intent(in)  this_state,
type(fast_parametertype), intent(in)  p_FAST,
type(fast_miscvartype), intent(in)  m_FAST,
type(elastodyn_data), intent(inout)  ED,
type(beamdyn_data), intent(inout)  BD,
type(aerodyn14_data), intent(inout)  AD14,
type(aerodyn_data), intent(inout)  AD,
type(servodyn_data), intent(inout)  SrvD,
type(inflowwind_data), intent(inout)  IfW,
type(openfoam_data), intent(inout)  OpFM,
type(fast_modulemaptype), intent(inout)  MeshMapData,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg,
logical, intent(in)  firstCall,
logical, intent(in)  WriteThisStep 
)

This routine implements the "option 2" solve for all inputs without direct links to HD, SD, MAP, or the ED platform reference point.

Parameters
[in]firstcallflag to determine how to call ServoDyn (a hack)
[in]this_timeThe current simulation time (actual or time of prediction)
[in]this_stateIndex into the state array (current or predicted states)
[in]p_fastParameters for the glue code
[in]m_fastMisc variables for the glue code (including external inputs)
[in,out]edElastoDyn data
[in,out]bdBeamDyn data
[in,out]srvdServoDyn data
[in,out]ad14AeroDyn14 data
[in,out]adAeroDyn data
[in,out]ifwInflowWind data
[in,out]opfmOpenFOAM data
[in,out]meshmapdataData for mapping between modules
[out]errstatError status of the operation
[out]errmsgError message if ErrStat /= ErrID_None
[in]writethisstepWill we print the WriteOutput values this step?

++ Option 2: Solve for inputs based only on the current outputs. This is much faster than option 1 when the coupled modules do not have direct feedthrough.

◆ solveoption2a_inp2bd()

subroutine fast_solver::solveoption2a_inp2bd ( real(dbki), intent(in)  this_time,
integer(intki), intent(in)  this_state,
type(fast_parametertype), intent(in)  p_FAST,
type(fast_miscvartype), intent(in)  m_FAST,
type(elastodyn_data), intent(inout)  ED,
type(beamdyn_data), intent(inout)  BD,
type(aerodyn14_data), intent(inout)  AD14,
type(aerodyn_data), intent(inout)  AD,
type(servodyn_data), intent(inout)  SrvD,
type(inflowwind_data), intent(inout)  IfW,
type(openfoam_data), intent(inout)  OpFM,
type(fast_modulemaptype), intent(inout)  MeshMapData,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg,
logical, intent(in)  WriteThisStep 
)

This routine implements the first part of the "option 2" solve for inputs that apply to BeamDyn and AeroDyn.

Parameters
[in]this_timeThe current simulation time (actual or time of prediction)
[in]this_stateIndex into the state array (current or predicted states)
[in]p_fastParameters for the glue code
[in]m_fastMisc variables for the glue code (including external inputs)
[in,out]edElastoDyn data
[in,out]bdBeamDyn data
[in,out]srvdServoDyn data
[in,out]ad14AeroDyn14 data
[in,out]adAeroDyn data
[in,out]ifwInflowWind data
[in,out]opfmOpenFOAM data
[in,out]meshmapdataData for mapping between modules
[out]errstatError status of the operation
[out]errmsgError message if ErrStat /= ErrID_None
[in]writethisstepWill we print the WriteOutput values this step?

++ Option 2: Solve for inputs based only on the current outputs. This is much faster than option 1 when the coupled modules do not have direct feedthrough.

◆ solveoption2b_inp2ifw()

subroutine fast_solver::solveoption2b_inp2ifw ( real(dbki), intent(in)  this_time,
integer(intki), intent(in)  this_state,
type(fast_parametertype), intent(in)  p_FAST,
type(fast_miscvartype), intent(in)  m_FAST,
type(elastodyn_data), intent(inout)  ED,
type(beamdyn_data), intent(inout)  BD,
type(aerodyn14_data), intent(inout)  AD14,
type(aerodyn_data), intent(inout)  AD,
type(servodyn_data), intent(inout)  SrvD,
type(inflowwind_data), intent(inout)  IfW,
type(openfoam_data), intent(inout)  OpFM,
type(fast_modulemaptype), intent(inout)  MeshMapData,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg,
logical, intent(in)  WriteThisStep 
)

This routine implements the first part of the "option 2" solve for inputs that apply to AeroDyn & InflowWind.

Parameters
[in]this_timeThe current simulation time (actual or time of prediction)
[in]this_stateIndex into the state array (current or predicted states)
[in]p_fastParameters for the glue code
[in]m_fastMisc variables for the glue code (including external inputs)
[in,out]edElastoDyn data
[in,out]bdBeamDyn data
[in,out]srvdServoDyn data
[in,out]ad14AeroDyn14 data
[in,out]adAeroDyn data
[in,out]ifwInflowWind data
[in,out]opfmOpenFOAM data
[in,out]meshmapdataData for mapping between modules
[out]errstatError status of the operation
[out]errmsgError message if ErrStat /= ErrID_None
[in]writethisstepWill we print the WriteOutput values this step?

++ Option 2: Solve for inputs based only on the current outputs. This is much faster than option 1 when the coupled modules do not have direct feedthrough.

◆ solveoption2c_inp2ad_srvd()

subroutine fast_solver::solveoption2c_inp2ad_srvd ( real(dbki), intent(in)  this_time,
integer(intki), intent(in)  this_state,
type(fast_parametertype), intent(in)  p_FAST,
type(fast_miscvartype), intent(in)  m_FAST,
type(elastodyn_data), intent(inout)  ED,
type(beamdyn_data), intent(inout)  BD,
type(aerodyn14_data), intent(inout)  AD14,
type(aerodyn_data), intent(inout)  AD,
type(servodyn_data), intent(inout)  SrvD,
type(inflowwind_data), intent(inout)  IfW,
type(openfoam_data), intent(inout)  OpFM,
type(fast_modulemaptype), intent(inout)  MeshMapData,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg,
logical, intent(in)  WriteThisStep 
)

This routine implements the first part of the "option 2" solve for inputs that apply to AeroDyn and ServoDyn.

Parameters
[in]this_timeThe current simulation time (actual or time of prediction)
[in]this_stateIndex into the state array (current or predicted states)
[in]p_fastParameters for the glue code
[in]m_fastMisc variables for the glue code (including external inputs)
[in,out]edElastoDyn data
[in,out]bdBeamDyn data
[in,out]srvdServoDyn data
[in,out]ad14AeroDyn14 data
[in,out]adAeroDyn data
[in,out]ifwInflowWind data
[in,out]opfmOpenFOAM data
[in,out]meshmapdataData for mapping between modules
[out]errstatError status of the operation
[out]errmsgError message if ErrStat /= ErrID_None
[in]writethisstepWill we print the WriteOutput values this step?

++ Option 2: Solve for inputs based only on the current outputs. This is much faster than option 1 when the coupled modules do not have direct feedthrough.

◆ srvd_inputsolve()

subroutine fast_solver::srvd_inputsolve ( type(fast_parametertype), intent(in)  p_FAST,
type(fast_miscvartype), intent(in)  m_FAST,
type(srvd_inputtype), intent(inout)  u_SrvD,
type(ed_outputtype), intent(in)  y_ED,
type(inflowwind_outputtype), intent(in)  y_IfW,
type(opfm_outputtype), intent(in)  y_OpFM,
type(bd_outputtype), dimension(:), intent(in)  y_BD,
type(fast_modulemaptype), intent(inout)  MeshMapData,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)

This routine sets the inputs required for ServoDyn.

Parameters
[in]p_fastGlue-code simulation parameters
[in]m_fastGlue-code misc variables (including inputs from external sources like Simulink)
[in,out]u_srvdServoDyn Inputs at t
[in]y_edElastoDyn outputs
[in]y_ifwInflowWind outputs
[in]y_opfmOpenFOAM outputs
[in]y_bdBD Outputs
[in,out]meshmapdataData for mapping between modules
[out]errstatError status
[out]errmsgError message

◆ srvd_setexternalinputs()

subroutine fast_solver::srvd_setexternalinputs ( type(fast_parametertype), intent(in)  p_FAST,
type(fast_miscvartype), intent(in)  m_FAST,
type(srvd_inputtype), intent(inout)  u_SrvD 
)

This routine sets the inputs required for ServoDyn from an external source (Simulink)

Parameters
[in]p_fastGlue-code simulation parameters
[in]m_fastGlue-code misc variables (including inputs from external sources like Simulink)
[in,out]u_srvdServoDyn Inputs at t

◆ transfer_ed_to_bd()

subroutine fast_solver::transfer_ed_to_bd ( type(ed_outputtype), intent(in)  y_ED,
type(bd_inputtype), dimension(:), intent(inout)  u_BD,
type(fast_modulemaptype), intent(inout)  MeshMapData,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)

This routine sets the inputs required for IceFloe.

Parameters
[in,out]u_bdBeamDyn inputs
[in]y_edElastoDyn outputs
[in,out]meshmapdatadata for mapping meshes between modules
[out]errstatError status of the operation
[out]errmsgError message if ErrStat /= ErrID_None

◆ transfer_ed_to_bd_tmp()

subroutine fast_solver::transfer_ed_to_bd_tmp ( type(ed_outputtype), intent(in)  y_ED,
type(fast_modulemaptype), intent(inout)  MeshMapData,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)

This routine sets the inputs required for IceFloe.

Parameters
[in]y_edElastoDyn outputs
[in,out]meshmapdatadata for mapping meshes between modules
[out]errstatError status of the operation
[out]errmsgError message if ErrStat /= ErrID_None

◆ transfer_ed_to_hd_sd_bd_mooring()

subroutine fast_solver::transfer_ed_to_hd_sd_bd_mooring ( type(fast_parametertype), intent(in)  p_FAST,
type(ed_outputtype), intent(in)  y_ED,
type(hydrodyn_inputtype), intent(inout)  u_HD,
type(sd_inputtype), intent(inout)  u_SD,
type(extptfm_inputtype), intent(inout)  u_ExtPtfm,
type(map_inputtype), intent(inout)  u_MAP,
type(feam_inputtype), intent(inout)  u_FEAM,
type(md_inputtype), intent(inout)  u_MD,
type(orca_inputtype), intent(inout)  u_Orca,
type(bd_inputtype), dimension(:), intent(inout)  u_BD,
type(fast_modulemaptype), intent(inout)  MeshMapData,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)

This routine transfers the ED outputs into inputs required for HD, SD, ExtPtfm, BD, MAP, and/or FEAM.

Parameters
[in]p_fastGlue-code simulation parameters
[in]y_edThe outputs of the structural dynamics module
[in,out]u_hdHydroDyn input
[in,out]u_sdSubDyn input
[in,out]u_extptfmExtPtfm_MCKF input
[in,out]u_mapMAP input
[in,out]u_feamFEAM input
[in,out]u_mdMoorDyn input
[in,out]u_orcaOrcaFlex input
[in,out]u_bdBeamDyn inputs
[in,out]meshmapdatadata for mapping meshes between modules
[out]errstatError status of the operation
[out]errmsgError message if ErrStat /= ErrID_None

◆ transfer_hd_to_sd()

subroutine fast_solver::transfer_hd_to_sd ( type(meshtype), intent(inout)  u_mapped,
type(meshtype), intent(inout)  u_SD_LMesh,
type(meshtype), intent(in)  u_mapped_positions,
type(hydrodyn_outputtype), intent(in)  y_HD,
type(meshtype), intent(in)  u_HD_M_LumpedMesh,
type(meshtype), intent(in)  u_HD_M_DistribMesh,
type(fast_modulemaptype), intent(inout)  MeshMapData,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)

This routine transfers the HD outputs into inputs required for ED.

Note that this adds to the values already in u_SD_LMesh (so initialize it before calling this routine).

Parameters
[in,out]u_mappedtemporary copy of SD mesh (an argument to avoid another temporary mesh copy)
[in,out]u_sd_lmeshSD Inputs on LMesh at t (separate so we can call from FullOpt1_InputOutputSolve with temp meshes)
[in]u_mapped_positionsMesh sibling of u_mapped, with displaced positions
[in]y_hdHydroDyn outputs
[in]u_hd_m_lumpedmeshHydroDyn input mesh (separate so we can call from FullOpt1_InputOutputSolve with temp meshes)
[in]u_hd_m_distribmeshHydroDyn input mesh (separate so we can call from FullOpt1_InputOutputSolve with temp meshes)
[in,out]meshmapdataData for mapping between modules
[out]errstatError status
[out]errmsgError message

◆ transfer_platformmotion_to_hd()

subroutine fast_solver::transfer_platformmotion_to_hd ( type(meshtype), intent(in)  PlatformMotion,
type(hydrodyn_inputtype), intent(inout)  u_HD,
type(fast_modulemaptype), intent(inout)  MeshMapData,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)

This routine transfers the platform motion output of the structural module (ED) into inputs required for HD.

Parameters
[in]platformmotionThe platform motion outputs of the structural dynamics module
[in,out]u_hdHydroDyn input
[in,out]meshmapdatadata for mapping meshes between modules
[out]errstatError status of the operation
[out]errmsgError message if ErrStat /= ErrID_None

◆ transfer_sd_to_hd()

subroutine fast_solver::transfer_sd_to_hd ( type(sd_outputtype), intent(in)  y_SD,
type(meshtype), intent(inout)  u_HD_M_LumpedMesh,
type(meshtype), intent(inout)  u_HD_M_DistribMesh,
type(fast_modulemaptype), intent(inout)  MeshMapData,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)

This routine transfers the SD outputs into inputs required for HD.

Parameters
[in]y_sdThe outputs of the structural dynamics module
[in,out]u_hd_m_lumpedmeshHydroDyn input mesh (separated here so that we can use temp meshes in ED_SD_HD_InputSolve)
[in,out]u_hd_m_distribmeshHydroDyn input mesh (separated here so that we can use temp meshes in ED_SD_HD_InputSolve)
[in,out]meshmapdatadata for mapping meshes
[out]errstatError status of the operation
[out]errmsgError message if ErrStat /= ErrID_None