![]() |
OpenFAST
Wind turbine multiphysics simulator
|
SubDyn is a time-domain structural-dynamics module for multi-member fixed-bottom substructures. More...
Functions/Subroutines | |
subroutine | createtpmeshes (TP_RefPoint, inputMesh, outputMesh, ErrStat, ErrMsg) |
subroutine | createy2meshes (NNode, Nodes, NNodes_I, IDI, NNodes_L, IDL, NNodes_C, IDC, inputMesh, outputMesh, ErrStat, ErrMsg) |
subroutine | sd_y2mesh_mapping (p, SDtoMesh) |
Set the index array that maps SD internal nodes to the Y2Mesh nodes. More... | |
subroutine, public | sd_init (InitInput, u, p, x, xd, z, OtherState, y, m, Interval, InitOut, ErrStat, ErrMsg) |
This routine is called at the start of the simulation to perform initialization steps. More... | |
subroutine, public | sd_updatestates (t, n, Inputs, InputTimes, p, x, xd, z, OtherState, m, ErrStat, ErrMsg) |
Loose coupling routine for solving for constraint states, integrating continuous states, and updating discrete and other states. More... | |
subroutine, public | sd_calcoutput (t, u, p, x, xd, z, OtherState, y, m, ErrStat, ErrMsg) |
Routine for computing outputs, used in both loose and tight coupling. More... | |
subroutine, public | sd_calccontstatederiv (t, u, p, x, xd, z, OtherState, m, dxdt, ErrStat, ErrMsg) |
Tight coupling routine for computing derivatives of continuous states note that this also sets mUFL and mudotdot_TP. More... | |
subroutine | sd_input (SDInputFile, Init, p, ErrStat, ErrMsg) |
subroutine | subrotate (Joints, NJoints, SubRotZ) |
Rotate the joint coordinates with respect to global z. | |
subroutine, public | sd_end (u, p, x, xd, z, OtherState, y, m, ErrStat, ErrMsg) |
This routine is called at the end of the simulation. More... | |
subroutine | sd_ab4 (t, n, u, utimes, p, x, xd, z, OtherState, m, ErrStat, ErrMsg) |
This subroutine implements the fourth-order Adams-Bashforth Method (RK4) for numerically integrating ordinary differential equations: More... | |
subroutine | sd_abm4 (t, n, u, utimes, p, x, xd, z, OtherState, m, ErrStat, ErrMsg) |
This subroutine implements the fourth-order Adams-Bashforth-Moulton Method (RK4) for numerically integrating ordinary differential equations: More... | |
subroutine | sd_rk4 (t, n, u, utimes, p, x, xd, z, OtherState, m, ErrStat, ErrMsg) |
This subroutine implements the fourth-order Runge-Kutta Method (RK4) for numerically integrating ordinary differential equations: More... | |
subroutine | sd_am2 (t, n, u, utimes, p, x, xd, z, OtherState, m, ErrStat, ErrMsg) |
This subroutine implements the 2nd-order Adams-Moulton Implicit Method (AM2,Trapezoidal rule) for numerically integrating ordinary differential equations: More... | |
subroutine | craig_bampton (Init, p, CBparams, ErrStat, ErrMsg) |
Perform Craig Bampton reduction. | |
subroutine | breaksysmtrx (Init, p, MRR, MLL, MRL, KRR, KLL, KRL, FGR, FGL) |
subroutine | cbmatrix (MRR, MLL, MRL, KRR, KLL, KRL, DOFM, Init, MBB, MBM, KBB, PhiL, PhiR, OmegaL, ErrStat, ErrMsg, p) |
Sets the CB values, as documented in the SubDyn Theory Guide: | |
subroutine | trnsfti (Init, TI, DOFI, IDI, TI2, DOFR, IDR, ErrStat, ErrMsg) |
subroutine | eigensolve (K, M, nDOF, NOmega, Reduced, Init, p, Phi, Omega, ErrStat, ErrMsg) |
Return eigenvalues, Omega, and eigenvectors, Phi,. | |
subroutine | reducekmdofs (Kred, K, TDOF, Init, p, ErrStat, ErrMsg) |
Calculate Kred from K after removing consstrained node DOFs from the full M and K matrices Note it works for constrained nodes, still to see how to make it work for interface nodes if needed. | |
subroutine | unreducevrdofs (VRred, VR, rDOF, rModes, Init, p, ErrStat, ErrMsg) |
Augments VRred to VR for the constrained DOFs, somehow reversing what ReducedKM did for matrices. | |
subroutine | cbapplyconstr (DOFI, DOFR, DOFM, DOFL, MBB, MBM, KBB, PHiR, FGR, MBBb, MBMb, KBBb, PHiRb, FGRb) |
subroutine | setparameters (Init, p, MBBb, MBmb, KBBb, FGRb, PhiRb, OmegaL, FGL, PhiL, ErrStat, ErrMsg) |
subroutine | allocparameters (p, DOFM, ErrStat, ErrMsg) |
Allocate parameter arrays, based on the dimensions already set in the parameter data type. More... | |
subroutine | allocmiscvars (p, Misc, ErrStat, ErrMsg) |
Allocate parameter arrays, based on the dimensions already set in the parameter data type. More... | |
subroutine | setindexarrays (Init, p, ErrStat, ErrMsg) |
Set the index arrays IDI, IDR, IDL, IDC, and IDY. More... | |
subroutine | test_cb_results (MBBt, MBMt, KBBt, OmegaM, DOFTP, DOFM, ErrStat, ErrMsg, Init, p) |
subroutine | constructufl (u, p, UFL) |
Take the input u LMesh and constructs the appropriate corresponding UFL vector. | |
subroutine | outsummary (Init, p, FEMparams, CBparams, ErrStat, ErrMsg) |
Output the summary file. | |
real(reki) function | memberlength (MemberID, Init, ErrStat, ErrMsg) |
This function calculates the length of a member. More... | |
real(reki) function | membermass (rho1, D1, t1, rho2, D2, t2, L, ctube) |
Calculate member mass, given properties at the ends, keep units consistent For now it works only for circular pipes or for a linearly varying area. | |
subroutine | symmatdebug (M, MAT) |
Check whether MAT IS SYMMETRIC AND RETURNS THE MAXIMUM RELATIVE ERROR. | |
Variables | |
type(progdesc), parameter | sd_progdesc = ProgDesc( 'SubDyn', '', '' ) |
SubDyn is a time-domain structural-dynamics module for multi-member fixed-bottom substructures.
SubDyn relies on two main engineering schematizations: (1) a linear frame finite-element beam model (LFEB), and (2) a dynamics system reduction via Craig-Bampton�s (C-B) method, together with a Static-Improvement method, greatly reducing the number of modes needed to obtain an accurate solution.
|
private |
Allocate parameter arrays, based on the dimensions already set in the parameter data type.
|
private |
Allocate parameter arrays, based on the dimensions already set in the parameter data type.
|
private |
This function calculates the length of a member.
[in] | init | Input data for initialization routine, this structure contains many variables needed for summary file |
[in] | memberid | Member ID # |
[out] | errstat | Error status of the operation |
[out] | errmsg | Error message if ErrStat /= ErrID_None |
|
private |
This subroutine implements the fourth-order Adams-Bashforth Method (RK4) for numerically integrating ordinary differential equations:
Let f(t, x) = xdot denote the time (t) derivative of the continuous states (x).
x(t+dt) = x(t) + (dt / 24.) * ( 55.*f(t,x) - 59.*f(t-dt,x) + 37.*f(t-2.*dt,x) - 9.*f(t-3.*dt,x) )
See, e.g.,
[in] | t | Current simulation time in seconds |
[in] | n | time step number |
[in,out] | u | Inputs at t |
[in] | utimes | times of input |
[in] | p | Parameters |
[in,out] | x | Continuous states at t on input at t + dt on output |
[in] | xd | Discrete states at t |
[in] | z | Constraint states at t (possibly a guess) |
[in,out] | otherstate | Other states at t on input at t + dt on output |
[in,out] | m | Misc/optimization variables |
[out] | errstat | Error status of the operation |
[out] | errmsg | Error message if ErrStat /= ErrID_None |
|
private |
This subroutine implements the fourth-order Adams-Bashforth-Moulton Method (RK4) for numerically integrating ordinary differential equations:
Let f(t, x) = xdot denote the time (t) derivative of the continuous states (x).
Adams-Bashforth Predictor: x^p(t+dt) = x(t) + (dt / 24.) * ( 55.*f(t,x) - 59.*f(t-dt,x) + 37.*f(t-2.*dt,x) - 9.*f(t-3.*dt,x) )
Adams-Moulton Corrector: x(t+dt) = x(t) + (dt / 24.) * ( 9.*f(t+dt,x^p) + 19.*f(t,x) - 5.*f(t-dt,x) + 1.*f(t-2.*dt,x) )
See, e.g.,
[in] | t | Current simulation time in seconds |
[in] | n | time step number |
[in,out] | u | Inputs at t |
[in] | utimes | times of input |
[in] | p | Parameters |
[in,out] | x | Continuous states at t on input at t + dt on output |
[in] | xd | Discrete states at t |
[in] | z | Constraint states at t (possibly a guess) |
[in,out] | otherstate | Other states at t on input at t + dt on output |
[in,out] | m | Misc/optimization variables |
[out] | errstat | Error status of the operation |
[out] | errmsg | Error message if ErrStat /= ErrID_None |
|
private |
This subroutine implements the 2nd-order Adams-Moulton Implicit Method (AM2,Trapezoidal rule) for numerically integrating ordinary differential equations:
Let f(t, x) = xdot denote the time (t) derivative of the continuous states (x). Define constants k1, k2, k3, and k4 as k1 = f(t , x_t ) k2 = f(t + dt , x_t+dt ) Then the continuous states at t = t + dt are x_(t+dt) =x_n+1 = x_t + deltat/2*(k1 + k2) + O(dt^3) Now this can be re-written as: 0=Z(x_n+1) = x_n - x_n+1 +dt/2 *(f_n + f_n+1) = 0 f_n= A*x_n + B*u_n + Fx from Eq. 1.12 of the manual So to solve this linear system, I can just use x(k)=x(k-1) -J^-1 * Z(x(k-1)) (this is a simple root solver of the linear equation) with J=dZ/dx_n+1 = -I +dt/2*A
Thus x_n+1 = x_n - J^-1 dt/2 * (2*A*x_n + B *(u_n + u_n+1) +2*Fx) or J( x_n - x_n+1 ) = dt * ( A*x_n + B *(u_n + u_n+1)/2 + Fx)
[in] | t | Current simulation time in seconds |
[in] | n | time step number |
[in,out] | u | Inputs at t |
[in] | utimes | times of input |
[in] | p | Parameters |
[in,out] | x | Continuous states at t on input at t + dt on output |
[in] | xd | Discrete states at t |
[in] | z | Constraint states at t (possibly a guess) |
[in,out] | otherstate | Other states at t on input at t + dt on output |
[in,out] | m | Misc/optimization variables |
[out] | errstat | Error status of the operation |
[out] | errmsg | Error message if ErrStat /= ErrID_None |
subroutine, public subdyn::sd_calccontstatederiv | ( | real(dbki), intent(in) | t, |
type(sd_inputtype), intent(in) | u, | ||
type(sd_parametertype), intent(in) | p, | ||
type(sd_continuousstatetype), intent(in) | x, | ||
type(sd_discretestatetype), intent(in) | xd, | ||
type(sd_constraintstatetype), intent(in) | z, | ||
type(sd_otherstatetype), intent(in) | OtherState, | ||
type(sd_miscvartype), intent(inout) | m, | ||
type(sd_continuousstatetype), intent(out) | dxdt, | ||
integer(intki), intent(out) | ErrStat, | ||
character(*), intent(out) | ErrMsg | ||
) |
Tight coupling routine for computing derivatives of continuous states note that this also sets mUFL and mudotdot_TP.
[in] | t | Current simulation time in seconds |
[in] | u | Inputs at t |
[in] | p | Parameters |
[in] | x | Continuous states at t -WHY IS THIS INOUT and not JUST IN? RRD, changed to IN on2/19/14 check with Greg |
[in] | xd | Discrete states at t |
[in] | z | Constraint states at t |
[in] | otherstate | Other states at t |
[in,out] | m | Misc/optimization variables |
[out] | dxdt | Continuous state derivatives at t |
[out] | errstat | Error status of the operation |
[out] | errmsg | Error message if ErrStat /= ErrID_None |
subroutine, public subdyn::sd_calcoutput | ( | real(dbki), intent(in) | t, |
type(sd_inputtype), intent(in) | u, | ||
type(sd_parametertype), intent(in) | p, | ||
type(sd_continuousstatetype), intent(in) | x, | ||
type(sd_discretestatetype), intent(in) | xd, | ||
type(sd_constraintstatetype), intent(in) | z, | ||
type(sd_otherstatetype), intent(in) | OtherState, | ||
type(sd_outputtype), intent(inout) | y, | ||
type(sd_miscvartype), intent(inout) | m, | ||
integer(intki), intent(out) | ErrStat, | ||
character(*), intent(out) | ErrMsg | ||
) |
Routine for computing outputs, used in both loose and tight coupling.
[in] | t | Current simulation time in seconds |
[in] | u | Inputs at t |
[in] | p | Parameters |
[in] | x | Continuous states at t |
[in] | xd | Discrete states at t |
[in] | z | Constraint states at t |
[in] | otherstate | Other states at t |
[in,out] | y | Outputs computed at t (Input only so that mesh con- nectivity information does not have to be recalculated) |
[in,out] | m | Misc/optimization variables |
[out] | errstat | Error status of the operation |
[out] | errmsg | Error message if ErrStat /= ErrID_None |
subroutine, public subdyn::sd_end | ( | type(sd_inputtype), intent(inout) | u, |
type(sd_parametertype), intent(inout) | p, | ||
type(sd_continuousstatetype), intent(inout) | x, | ||
type(sd_discretestatetype), intent(inout) | xd, | ||
type(sd_constraintstatetype), intent(inout) | z, | ||
type(sd_otherstatetype), intent(inout) | OtherState, | ||
type(sd_outputtype), intent(inout) | y, | ||
type(sd_miscvartype), intent(inout) | m, | ||
integer(intki), intent(out) | ErrStat, | ||
character(*), intent(out) | ErrMsg | ||
) |
This routine is called at the end of the simulation.
[in,out] | u | System inputs |
[in,out] | p | Parameters |
[in,out] | x | Continuous states |
[in,out] | xd | Discrete states |
[in,out] | z | Constraint states |
[in,out] | otherstate | Other states |
[in,out] | y | System outputs |
[in,out] | m | Misc/optimization variables |
[out] | errstat | Error status of the operation |
[out] | errmsg | Error message if ErrStat /= ErrID_None |
subroutine, public subdyn::sd_init | ( | type(sd_initinputtype), intent(in) | InitInput, |
type(sd_inputtype), intent(out) | u, | ||
type(sd_parametertype), intent(out) | p, | ||
type(sd_continuousstatetype), intent(out) | x, | ||
type(sd_discretestatetype), intent(out) | xd, | ||
type(sd_constraintstatetype), intent(out) | z, | ||
type(sd_otherstatetype), intent(out) | OtherState, | ||
type(sd_outputtype), intent(out) | y, | ||
type(sd_miscvartype), intent(out) | m, | ||
real(dbki), intent(inout) | Interval, | ||
type(sd_initoutputtype), intent(out) | InitOut, | ||
integer(intki), intent(out) | ErrStat, | ||
character(*), intent(out) | ErrMsg | ||
) |
This routine is called at the start of the simulation to perform initialization steps.
The parameters are set here and not changed during the simulation. The initial states and initial guess for the input are defined.
[in] | initinput | Input data for initialization routine |
[out] | u | An initial guess for the input; input mesh must be defined |
[out] | p | Parameters |
[out] | x | Initial continuous states |
[out] | xd | Initial discrete states |
[out] | z | Initial guess of the constraint states |
[out] | otherstate | Initial other states |
[out] | y | Initial system outputs (outputs are not calculated; only the output mesh is initialized) |
[in,out] | interval | Coupling interval in seconds: the rate that (1) Mod1_UpdateStates() is called in loose coupling & (2) Mod1_UpdateDiscState() is called in tight coupling. Input is the suggested time from the glue code; Output is the actual coupling interval that will be used by the glue code. |
[out] | m | Initial misc/optimization variables |
[out] | initout | Output for initialization routine |
[out] | errstat | Error status of the operation |
[out] | errmsg | Error message if ErrStat /= ErrID_None |
|
private |
This subroutine implements the fourth-order Runge-Kutta Method (RK4) for numerically integrating ordinary differential equations:
Let f(t, x) = xdot denote the time (t) derivative of the continuous states (x). Define constants k1, k2, k3, and k4 as k1 = dt * f(t , x_t ) k2 = dt * f(t + dt/2 , x_t + k1/2 ) k3 = dt * f(t + dt/2 , x_t + k2/2 ), and k4 = dt * f(t + dt , x_t + k3 ). Then the continuous states at t = t + dt are x_(t+dt) = x_t + k1/6 + k2/3 + k3/3 + k4/6 + O(dt^5)
For details, see: Press, W. H.; Flannery, B. P.; Teukolsky, S. A.; and Vetterling, W. T. "Runge-Kutta Method" and "Adaptive Step Size Control for Runge-Kutta." sections 16.1 and 16.2 in Numerical Recipes in FORTRAN: The Art of Scientific Computing, 2nd ed. Cambridge, England: Cambridge University Press, pp. 704-716, 1992.
[in] | t | Current simulation time in seconds |
[in] | n | time step number |
[in,out] | u | Inputs at t |
[in] | utimes | times of input |
[in] | p | Parameters |
[in,out] | x | Continuous states at t on input at t + dt on output |
[in] | xd | Discrete states at t |
[in] | z | Constraint states at t (possibly a guess) |
[in,out] | otherstate | Other states at t on input at t + dt on output |
[in,out] | m | Misc/optimization variables |
[out] | errstat | Error status of the operation |
[out] | errmsg | Error message if ErrStat /= ErrID_None |
subroutine, public subdyn::sd_updatestates | ( | real(dbki), intent(in) | t, |
integer(intki), intent(in) | n, | ||
type(sd_inputtype), dimension(:), intent(inout) | Inputs, | ||
real(dbki), dimension(:), intent(in) | InputTimes, | ||
type(sd_parametertype), intent(in) | p, | ||
type(sd_continuousstatetype), intent(inout) | x, | ||
type(sd_discretestatetype), intent(inout) | xd, | ||
type(sd_constraintstatetype), intent(inout) | z, | ||
type(sd_otherstatetype), intent(inout) | OtherState, | ||
type(sd_miscvartype), intent(inout) | m, | ||
integer(intki), intent(out) | ErrStat, | ||
character(*), intent(out) | ErrMsg | ||
) |
Loose coupling routine for solving for constraint states, integrating continuous states, and updating discrete and other states.
Continuous, discrete, constraint, and other states are updated for t + Interval.
[in] | t | Current simulation time in seconds |
[in] | n | Current step of the simulation: t = n*Interval |
[in,out] | inputs | Inputs at Times |
[in] | inputtimes | Times in seconds associated with Inputs |
[in] | p | Parameters |
[in,out] | x | Input: Continuous states at t; Output: Continuous states at t + Interval |
[in,out] | xd | Input: Discrete states at t; Output: Discrete states at t + Interval |
[in,out] | z | Input: Constraint states at t; Output: Constraint states at t + Interval |
[in,out] | otherstate | Input: Other states at t; Output: Other states at t + Interval |
[in,out] | m | Misc/optimization variables |
[out] | errstat | Error status of the operation |
[out] | errmsg | Error message if ErrStat /= ErrID_None |
|
private |
Set the index array that maps SD internal nodes to the Y2Mesh nodes.
NOTE: SDtoMesh is not checked for size, nor are the index array values checked for validity, so this routine could easily have segmentation faults if any errors exist.
[in] | p | Parameters |
[out] | sdtomesh | index/mapping of mesh nodes with SD mesh |
|
private |
Set the index arrays IDI, IDR, IDL, IDC, and IDY.