Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Loads and response transferring in OpenFAST #282

Closed
Robinjun opened this issue Apr 26, 2019 · 13 comments
Closed

Loads and response transferring in OpenFAST #282

Robinjun opened this issue Apr 26, 2019 · 13 comments

Comments

@Robinjun
Copy link

Hello. I want to ask the question about loads and responses transferring in OpenFAST and I wish your answers or suggestions.
I learn that loads and responses are transferred between different modules via the FAST driver program (glue code) in OpenFAST. I want to know
1.After calculating loads in HydroDyn module, how are the loads transferred to the ElastoDyn module?
2.What exactly loads are they? Three forces and three moments in three different directions?
3.Where can I find these loads and change them so that I can transfer my own loads data to ElastoDyn module?
Actually, I want to repalce the loads in HydroDyn with that in CFD software (e.g. STAR CCM+), and transfer them to ElastoDyn module. Then I want to transfer the responses (e.g. displacement, position) from ElastoDyn to CFD software. I want to couple OpenFAST and STAR CCM+. Are there any documents for guidance?
I wish your answers or suggestions. Thank you very much!

@jjonkman
Copy link
Collaborator

Dear @Robinjun,

When HydroDyn is coupled to OpenFAST, HydroDyn receives the position, orientation, velocities,
and accelerations of the (rigid or flexible) substructure at each coupling time step and then
computes the hydrodynamic loads and returns them back to OpenFAST. At this time, OpenFAST’s
ElastoDyn structural-dynamics module assumes for a floating platform that the substructure
(floating platform) is a six degree-of-freedom (DOF) rigid body. For fixed-bottom offshore wind
turbines, OpenFAST’s SubDyn module allows for structural flexibility of multi-member substructures
and the coupling to HydroDyn includes hydro-elastic effects. We are currently working on extensions to OpenFAST to model substructure flexibility and member-level load calculations for floating substructures.

The data transfer between ElastoDyn or SubDyn and HydroDyn occurs using built-in mesh-to-mesh mapping routines. The theoretical background of this mesh mapping is documented in a couple papers: https://www.nrel.gov/docs/fy14osti/60742.pdf and https://www.nrel.gov/docs/fy16osti/63203.pdf. While the platform in ElastoDyn only has a point mesh with a single point element, the SubDyn module has a point mesh with multiple point elements. HydroDyn has several line and point meshes.

It would be possible to replace HydroDyn with a CFD solver, but this would not be trivial. I'm sure there is much that could be discussed about that, but I'll defer to the CFD experts to comment.

Best regards,

@Robinjun
Copy link
Author

Dear @jjonkman,
Thank you for your answer.
Actually, I am not familiar with OpenFAST. I just want to find the position in which loads and responses are transferred between ElastoDyn and HydroDyn, or the position which control loads and responses between the two modules. Then I can replace the loads data with that from CFD code. Could you tell me where is it? The theoretical background of mesh mapping is a little complicated and maybe it's necessary for me to understand it.
Thank you!

@jjonkman
Copy link
Collaborator

Dear @Robinjun,

Are you asking where in the source code the data transfer between ElastoDyn and HydroDyn happens? The ElastoDyn-HydroDyn transfer involves a rigorous input-output solve due the implicit nature of the coupling. There are several cases for this input-output solve depending on which modules are enabled. Assuming you are not using BeamDyn or SubDyn, the ElastoDyn-HydroDyn input-output solve happens in routine FAST_Solver.f90/ED_HD_InputOutputSolve().

I hope that helps.

Best regards,

@Robinjun
Copy link
Author

Dear @jjonkman,
Hello! I am not familiar with OpenFAST but I am quite familiar with STAR-CCM+, a CFD code. My project is to couple OpenFAST and STAR-CCM+ to analyse hydrodynamic behavior of wind turbine semi-platform under the wave environment. I describe my problem in detail below.

I want to analyse hydrodynamic behavior of wind turbine semi-platform under the wave environment. At the beginning, I use STAR-CCM+ to calculate the loads of wave acting on the platform in the first time step. Then I want to transfer these loads to OpenFAST to calculate the responses (e.g. dispalcement ) of platform in the first time step. Maybe it's the ElatoDyn module to do this calculation. After calculating the responses in OpenFAST, I want to transfer these responses to STAR-CCM+, so that STAR-CCM+ can calculate the loads acting on the platform in the second step by appling the responses data from OpenFAST. Then the loads are transferred to OpenFAST again to calculate the responses of the platform. Loads and responses transferring continues each time step till the maximum modeling time is reached.
For the time being, I can export the loads data, forces and moments acting on the center of mass of the platform in three directions, from STAR-CCM+. I want to find the way to transfer these loads data to OpenFAST so that it can do the calculation of responses.

It seems that my coupling of OpenFAST and STAR-CCM+ is to replace the HydroDyn module in OpenFAST. May I should find the place where loads are transferred between HydroDyn and ElastoDyn.

My questions are:

  1. Is it possible to couple OpenFAST and STAR-CCM+ in the way I mention above? How difficut is it?
  2. If possible, where is the position, in which loads and responses are transferred between ElastoDyn and HydroDyn, or the position which control loads and responses between the two modules. Then I can replace the loads data with that from CFD code?
  3. Are there any documents about OpenFAST that can help me do this coupling?
  4. I am a master of civil engineering and it's my second years in school. I know little about programming language. Is it possible for me to couple OpenFAST and STAR-CCM+ in the way I mention above? Is there enough time for me because I have only another one year before my graduation?

I wish your answer! Thank you very much!

@jjonkman
Copy link
Collaborator

Dear @Robinjun,

Here are my answers to your questions:

  1. Actually, this coupling will likely be quite challenging. The density of water is similar to the density of the floating platform, so, the hydrodynamic added-mass effect will be quite important. This means that there will be a strong, implicit coupling between the structural and fluid calculations i.e. the structural module of OpenFAST (ElastoDyn) needs the hydrodynamic force (F) in order to solve its equations of motion (F=ma) for the structural accelerations (a), but the hydrodynamic loads will depend on the structural acceleration via the hydrodynamic added mass (a mass term included in m, comparable to the structural mass). This is the implicit nature of the coupling I mentioned in my prior comment, which in OpenFAST requires a rigorous input-output solve. A similar algorithm would have to be implemented for a potential OpenFAST-STAR-CCM+ coupling. I understand how OpenFAST works, but I don't know enough about STAR-CCM+ to know if this is possible.

  2. In my prior response I showed you where in the OpenFAST source code the existing ElastoDyn-HydroDyn coupling occurs. But I guess you are asking about a physical location on the structure? For a floating platform in OpenFAST, ElastoDyn expects to receive the lumped hydrodynamic loads (3 forces, 3 moments) at the platform reference point.

  3. I'm not sure these are directly applicable to a potential OpenFAST-STAR-CCM+ coupling because STAR-CCM+ likely doesn't follow the requirements of the FAST modularization framework, but the papers I referenced in my response above are the key papers that explain how module-to-module coupling works in OpenFAST.

  4. As I said above, I suspect this coupling will be quite challenging.

I'll let others who are more experienced with CFD and/or STAR-CCM+ comment further.

Best regards,

@Robinjun
Copy link
Author

Robinjun commented May 5, 2019

Dear @jjonkman,
Thank you for your answers!
Now I'm trying to understand the sentences in routine FAST_Solver.f90/ED_HD_InputOutputSolve(). However, I meet some problems.

  1. What are the meanings of these varialbes, u_ED, p_ED, x_ED, xd_ED, z_ED, OtherSt_ED, y_ED and m_ED? Are there any sentences talking about these variables?
  2. Is it possible for me only change some sentences in routine FAST_Solver.f90/ED_HD_InputOutputSolve(), and then my forces and moments data in three directions are inputed in the routine? Also, the routine must work well to output the data (e.g. position, displacement). Is it possible or difficult?
    I wish your reply, thanks!

@jjonkman
Copy link
Collaborator

jjonkman commented May 6, 2019

Dear @Robinjun,

u_ED, p_ED, x_ED, xd_ED, z_ED, OtherSt_ED, y_ED and m_ED are the inputs to, parameters of, continuous states of, discrete states of, constraint states of, other states of, outputs from, and miscellaneous variables of the ElastoDyn module. All modules of FAST / OpenFAST have a similar set of variables (inputs, parameters, states, outputs) -- see the FAST modularization framework overview paper (http://www.nrel.gov/docs/fy13osti/57228.pdf) and NWTC Programmer's Handbook (https://nwtc.nrel.gov/system/files/ProgrammingHandbook_Mod20130717.pdf) for more information.

The forces and moments applied to the platform are inputs to ElastoDyn (stored in u_ED) and outputs from HydroDyn (stored in y_HD). The platform motions (position/orientation, velocities, accelerations) are outputs from ElastoDyn (stored in y_ED) and inputs to HydroDyn (stored in u_HD). But the routine FAST_Solver.f90/ED_HD_InputOutputSolve() establishes a rigorous input-output solve between ElastoDyn and HydroDyn by solving an implicit set algebraic equation using Jacobians. Unless your hydrodynamic solver functions in a similar way to HydroDyn (whereby the Jacobian of its outputs with respect to inputs) can be calculated, my guess is it will not be trivial to modify this routine for compatibility with your own hydrodynamic solver.

Best regards,

@armin-zbf
Copy link

Hi @jjonkman
Thanks for such clear and helpful answers on this thread
I want to ask you about the possibility of coupling a stabilizing force and/or momentum within a Simulink block.

And I'd like to know about the possibility of connecting to different modules of OpenFAST through the S-Function and maybe even change their inputs during a simulation.

@jjonkman
Copy link
Collaborator

Hi @armin-zbf,

The OpenFAST-Simulink interface is currently set up to support the implementation of user-specified controls in Simulink, with inputs to the S-Function from Simulink including generator torque and power, yaw position and rate, blade-pitch angles, and high-speed shaft braking fraction. I'm not sure what kind of inputs you are referring to, but including other inputs would require changes to the OpenFAST S-Function and OpenFAST dynamic library source code. And depending on the type of inputs added, the numerical stability of the coupled solution could be challenging because the OpenFAST S-Function is treated as a discrete-time block (so, e.g., implicit coupling where a force input depends on an acceleration output could be problematic).

Best regards,

@armin-zbf
Copy link

Thanks for your answer, since I got your reply I've been trying to understand the codes in ElastoDyn.f90, FAST_SFunc.c, and HydroDyn.f90.
What I want to do is read some values that fortunately the S-Function is providing, then based on them calculate a set of 6DoF stabilizing forces and feed these to OpenFAST. So what approach do you think is better? Trying to add another input to S-Func and then changing ElastoDyn(?) to implement these forces? or do you have any better suggestions?

@jjonkman
Copy link
Collaborator

jjonkman commented Jan 4, 2021

Dear @armin-zbf,

By "6 DoF stabilizing forces", I presume you mean three forces and three moments applied to the platform reference point in ElastoDyn; is that correct? These loads are not currently considered in the OpenFAST S-Function. So--similar to the discussion in the following issue: #548 --you'll need to change the Simulink interface and the OpenFAST glue code to pass these loads from Simulink to ElastoDyn. In the case of loads applied to the platform reference point, you'd need to set the module-level input to ElastoDyn PlatformPtMesh.

You haven't stated how this stabilizing force is being calculated. But as I said earlier, because the OpenFAST S-Function is treated as a discrete-time block, implicit coupling where the load input depends on an acceleration output (e.g., to consider hydrodynamic added mass) could be problematic.

Best regards,

@armin-zbf
Copy link

Dear @jjonkman
Thanks for the suggestion to follow issue: #548 -- It helped me a great deal and I added 9 inputs to S-Function and to test if they are getting passed okay to ED I put them as output parameters and I could read the same input value as output in Simulink after in passed through the S-Function.
Now as I mentioned earlier these stabilizing forces and moments are being calculated using another model and some outputs of S-Function (namely platform pitch, roll, and yaw).
I've been trying to find the right place to insert these 6 inputs in ED and the best place I found seems to be the last line in CalculateForcesMoments. There are RtHSdat%FrcZAllt and RtHSdat%MomXAllt which are "Portion of the force at platform reference (point Z) due to everything associated with everything but the QD2T()'s" and "Portion of the moment at the platform (body X) / platform reference (point Z) due to everything associated with everything but the QD2T()'s".
So I tried and added my pitch, roll, yaw moments that are on the platform(passed from extra terms of Simulink) to this term before the end of the subroutine for example as:
RtHSdat%MomXAllt(1) = RtHSdat%MomXAllt(1) + u%SimulinkMroll
I can see the effects and results in my model but I'm not sure if this is the right place to do so, I'd appreciate it if you can let me know this is the right place to add these terms. thanks in advance.

I also would like to ask where can I find some detailed information about the frames and axis used for the calculations? Because as I was testing I understood a change in FrcZAllt(2) would cause a change in heave and to sway. So just to make sure, FrcZAllt(1), FrcZAllt(2), and FrcZAllt(3) correspond to surge, heave, and sway? and MomXAllt(1), MomXAllt(2), and MomXAllt(3) correspond to roll, yaw, and pitch?

@jjonkman
Copy link
Collaborator

Dear @armin-zbf,

As I mentioned in my prior post, you should set the module-level input to ElastoDyn PlatformPtMesh in the OpenFAST glue code. You should not need to change ElastoDyn in any way because PlatformPtMesh is already applied to the platform appropriately within ElastoDyn. PlatformPtMesh is a point mesh with a single point element and contains a force field with three elements (the three applied forces in the OpenFAST global inertial frame coordinate system) and a moment field with three elements (the three applied moments in the OpenFAST global inertial frame coordinate system).

The change to the OpenFAST glue code should be very similar to what is discussed in #548, with PlatformPtMesh set instead of HubPtLoad. Normally PlatformPtMesh is set from the outputs of HydroDyn, SubDyn, a user-defined external platform, or a mooring module, but you want it set from the inputs to the S-Function from Simulink.

Best regards,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants