Making fault

Discuss acquisition, use, and manipulation of airfoil data.

Moderator: Bonnie.Jonkman

Yichau.Liu
Posts: 18
Joined: Sun Nov 27, 2016 6:07 pm
Organization: Tsinghua University
Location: China

Re: Making fault

Postby Yichau.Liu » Sat Feb 16, 2019 6:03 am

Dear Jason,

It's very kind of you. Thank you for helping check the results. In my case, the OWT starts to generate wind power only after 50s since the rotor speed and generator speed have a set-up process and increase from 0 at the beginning (0s) and reach rated value at around 50s. I think this is the reason that the tower side-to-side don't deflect until ~50s. Anyway, good to know that such a steady tower top acceleration seems reasonable and I will try to include some turbulence if large tower acceleration is expected. Thanks again.

Best

Yichau.Liu
Posts: 18
Joined: Sun Nov 27, 2016 6:07 pm
Organization: Tsinghua University
Location: China

Re: Making fault

Postby Yichau.Liu » Wed Mar 13, 2019 4:36 pm

Dear Matt.Hall,

Thank you for your help last time and I also hope to realize the same mooring line failure (fairlead and anchor failures) in the MoorDyn C, namely the C lib. that I downloaded on your website (http://www.matt-hall.ca/moordyn.html). It also would be connect to the MATLAB in my case. The fairlead failure is zeroing the tension at the fairlead while the anchor failure is realized by a large length of the line segment attached to the seabed, as you suggested. But it seems that the source code in MoorDyn C is a much different with the MoorDyn in FASY v8 that I asked before. I have no idea which source code (Connection.cpp, Line.cpp, NoorDyn.cpp), which variable and which sub-function I can revise. Can you give me some clues? Many thanks to you and look forward to hearing from you.

Best

Matt.Hall wrote:Hi Yichau.Liu,

Simulating mooring line failures would be an interesting capability. I've thought of the idea itself, but never how to go about realizing it in MoorDyn. Here are a few initial thoughts in case they are of help.

Most of MoorDyn's information about the mooring system is stored in "m" (the MiscVar structure), so you would probably want to add variables within it to specify the details of the failure, unless you chose to hardcode in the specifics of each failure.

I can think of two general approaches for implementing the failure:
(1) Modifying the data in m once the failure occurs to represent the disconnection without changing MoorDyn's calculation process, or
(2) Modifying the calculations within MD_CalcContStateDeriv (specifically within DoLineRHS) to get the same effect as a failed line.

Your ideas are in the second category, which is I think a good place to start. For the fairlead failure, I agree that zeroing the tension seems reasonable. You could simply set FairFtot to zero in DoLineRHS for the failed line. For the anchor failure, you could change the anchor node position (Line%r(J,0) in DoLineRHS), but abrupt position changes might cause some problematic damping forces. An option that I think would be just as effective and potentially simpler would be to set the length of the line segment that attaches to the anchor to be very large (i.e. set Line%l(1) in DoLinesRHS to a large number).

Hope that helps, and I look forward to hearing how it goes!

Best,
Matt

Sebastian.Hippel
Posts: 14
Joined: Mon Nov 16, 2015 10:00 am
Organization: Flensburg University of Applied Sciences
Location: Germany

Re: Making fault

Postby Sebastian.Hippel » Fri May 10, 2019 1:42 am

Dear Jason,

I'm intending to do similar thing what Yichau.Li already tried to do. I'm trying to change the blade mass properties dynamically within a given simulation. I know such changes is not possible without changing the source code. But I'm just wondering which source code must be changed, to consider such changes, is that the ElstoDyn.f90 or the BeamDyn.f90. Because both of this modules are dealing with blade input file to calculate blade motion and reaction loads. I started to read the BeamDyn.f90 source code to understand where and how the mass matrix are calculated, but till now I did not make any progress. Do you have any advice how this should be implemented

Best regards,
Sebastian

Jason.Jonkman
Posts: 4277
Joined: Thu Nov 03, 2005 4:38 pm
Location: Boulder, CO
Contact:

Re: Making fault

Postby Jason.Jonkman » Fri May 10, 2019 7:09 am

Dear Sebastian,

While both ElastoDyn and BeamDyn can be used in FAST / OpenFAST to model blade structural dynamics, the choice of which module is used is selected in the primary input file (CompElast = 1 is for ElastoDyn; CompElast = 2 is for BeamDyn).

I provided some guidance above about how to go about implementing this feature in ElastoDyn in the forum posts in this topic above.

Best regards,
Jason Jonkman, Ph.D.
Senior Engineer | National Wind Technology Center (NWTC)

National Renewable Energy Laboratory (NREL)
15013 Denver West Parkway | Golden, CO 80401
+1 (303) 384 – 7026 | Fax: +1 (303) 384 – 6901
nwtc.nrel.gov

Sebastian.Hippel
Posts: 14
Joined: Mon Nov 16, 2015 10:00 am
Organization: Flensburg University of Applied Sciences
Location: Germany

Re: Making fault

Postby Sebastian.Hippel » Fri May 24, 2019 3:33 am

Dear Jason,

I tried to modify the Blade element mass during the simulation by adding a time condition in the SOUBROUTINE Coeff() as below:

Code: Select all

IF (t > 5) THEN ! Add mass to blade Element at simulation time 5 [s]
               p%BElmntMass(J,K) = 1.5*p%MassB(K,J)*p%DRNodes(J)                    ! Mass of blade element J Multiples by 1.5
         ELSE
            ! Calculate the mass of the current element
               p%BElmntMass(J,K) = p%MassB(K,J)*p%DRNodes(J)                        ! Mass of blade element J
         ENDIF   

Therefore I added a time variable (t) to the SUBROUTINE Coeff() and to all Subroutines, where this Subroutine is called.
But the compiling of OpenFAST after this modification didn’t succeed. I think the problem is that by adding the time variable (t) to the Subroutines, which are only one time called at the beginning of the simulation.
I’m trying now to add a separate Subroutine, where I can add some mass to blade element, but I think I’ll have same problem as above, because I need this parameters to be displayed in the SUBROUTINE SetOtherParameters ()
Do you any advice how this should be implemented? Any help will be really appreciated!

Best regards
Sebastian

Jason.Jonkman
Posts: 4277
Joined: Thu Nov 03, 2005 4:38 pm
Location: Boulder, CO
Contact:

Re: Making fault

Postby Jason.Jonkman » Fri May 24, 2019 8:05 am

Dear Sebastian,

SUBROUTINE ElastoDyn.f90/COEFF() is only called once by ElastoDyn at initialization. Moreover, FAST does not allow parameter data types (p) to be changed after initialization.

Instead of changing p%BElmntMass(J,K) directly, I would search where this parameter is used in the time-domain part of the simulation and multiply it by a time-dependent scaling factor (e.g., 1.5).

Best regards,
Jason Jonkman, Ph.D.
Senior Engineer | National Wind Technology Center (NWTC)

National Renewable Energy Laboratory (NREL)
15013 Denver West Parkway | Golden, CO 80401
+1 (303) 384 – 7026 | Fax: +1 (303) 384 – 6901
nwtc.nrel.gov

Sebastian.Hippel
Posts: 14
Joined: Mon Nov 16, 2015 10:00 am
Organization: Flensburg University of Applied Sciences
Location: Germany

Re: Making fault

Postby Sebastian.Hippel » Wed Jun 05, 2019 8:46 am

Dear Jason,

I add a routine to ElastoDyn.f90 to perform the mass addition to blade elements as follows:

Code: Select all

!**********************************************************************************************************************************
!> This routine is used to add mass to blade elements at a given simulation time
SUBROUTINE AddMass(p, InputFileData, ErrStat, ErrMsg)
!..................................................................................................................................

      ! Passed variables

   TYPE(ED_ParameterType),        INTENT(INOUT)    :: p                             !< Parameters of the structural dynamics module
   TYPE(ED_InputFile),            INTENT(IN)       :: InputFileData                 !< all the data in the ElastoDyn input file
   INTEGER(IntKi),                INTENT(OUT)      :: ErrStat                       !< Error status
   CHARACTER(*),                  INTENT(OUT)      :: ErrMsg                        !< Error message when ErrStat =/ ErrID_None


      ! Local variables.


   INTEGER(IntKi)               :: J                                               ! Loops through nodes / elements.
   INTEGER(IntKi)               :: K                                               ! Loops through blades.

         ! Initialize some output values
      ErrStat = ErrID_None
      ErrMsg  = ""

   !...............................................................................................................................
   ! Calculate the new blade element mass
   !...............................................................................................................................

   DO K = 1,p%NumBl          ! Loop through the blades


      DO J = 1,p%BldNodes    ! Loop through the blade nodes / elements


      ! Calculate the mass of the current element

         p%BElmntMass(J,K) = 1.5*p%MassB(K,J)*p%DRNodes(J)                        ! Mass of blade element J


      ENDDO ! J - Blade nodes / elements

   ENDDO    ! K - Blades

END SUBROUTINE AddMass
!----------------------------------------------------------------------------------------------------------------------------------


and I call this Subroutine in FAST_Prog.f90 as follows:

Code: Select all

! Time Stepping:
   !...............................................................................................................................         
   
   DO n_t_global = Restart_step, Turbine(1)%p_FAST%n_TMax_m1
   
      ! call AddMass routine at given simulation time
    
     IF (n_t_global == 5) THEN
         CALL AddMass(p_ED, InputFileData, ErrStat, ErrMsg)
     END IF
    
      ! bjj: we have to make sure the n_TMax_m1 and n_ChkptTime are the same for all turbines or have some different logic here


now I'm trying to compile FAST.sln with VS but I'v got this error:

    Error error #11023: Not all components required for linking are present on command line ipo
    Severity Code Description Project File Line Suppression State
    Error error LNK2019: unresolved external symbol ADDMASS referenced in function MAIN__ ipo_144887obj3.obj
    Severity Code Description Project File Line Suppression State
    Error fatal error LNK1120: 1 unresolved externals ..\..\build\bin\\openfast_x64.exe

do you have any idea how to solve this error?

Best regards
Sebastian

Jason.Jonkman
Posts: 4277
Joined: Thu Nov 03, 2005 4:38 pm
Location: Boulder, CO
Contact:

Re: Making fault

Postby Jason.Jonkman » Wed Jun 05, 2019 8:37 pm

Dear Sebastian,

All SUBROUTINES in ElastoDyn.f90 are PRIVATE by default (see the top section of MODULE ElastoDyn near the top of ElastoDyn.f90). You must make SUBROUTINE AddMass() PUBLIC if you wish to call it from FAST_Prog.f90, i.e., type the following before the CONTAINS statement:

PUBLIC :: AddMass

Best regards,
Jason Jonkman, Ph.D.
Senior Engineer | National Wind Technology Center (NWTC)

National Renewable Energy Laboratory (NREL)
15013 Denver West Parkway | Golden, CO 80401
+1 (303) 384 – 7026 | Fax: +1 (303) 384 – 6901
nwtc.nrel.gov

Sebastian.Hippel
Posts: 14
Joined: Mon Nov 16, 2015 10:00 am
Organization: Flensburg University of Applied Sciences
Location: Germany

Re: Making fault

Postby Sebastian.Hippel » Fri Sep 20, 2019 5:59 am

Dear Jason,

First of all thank you very much for your help. After changing the AddMass Subroutine to Public, I could compile FAST with VS without errors.
To check if the compiled .exe recognise the changes that I’ve done in ElastoDyn. I performed TEST 18 (5MW_Land_DLL_WTurb) for 10 s as TMax and with 0.01 as DT. But the results were not as expected. I couldn’t see any changes in the results at the given time (t=5 s).
untitled1.pdf
(7.63 KiB) Downloaded 6 times

I couldn’t know if the problem comes from that all the parameters, which are related to Blade-Element-Mass (p%BElmntMass(J,K)), are only one time at the beginning of the simulation calculated and saved in Subroutine Coeff. So when I change the Blade-Element-Mass (p%BElmntMass(J,K)) at the middle of the simulation (at t=5 s) it does do the change but all other parameters will not change?
For this reason I modify the Subroutine AddMass, so it looks like Subroutine Coeff, but only p%BElmntMass(J,K) multiplied by 1.5 as below:

Code: Select all

      ! Calculate the mass of the current element

         p%BElmntMass(J,K) = 1.5*p%MassB(K,J)*p%DRNodes(J)                        ! Mass of blade element J


After that I could compile FAST but Test 18 end with this error:
Unbenannt.JPG
Unbenannt.JPG (227.63 KiB) Viewed 132 times


Can you tell me how to solve this error? Any help would be really appreciated.
Best regards,
Sebastian

Jason.Jonkman
Posts: 4277
Joined: Thu Nov 03, 2005 4:38 pm
Location: Boulder, CO
Contact:

Re: Making fault

Postby Jason.Jonkman » Fri Sep 20, 2019 7:01 am

Dear Sebastian,

I'm not sure I'm understand enough about what you are doing to comment why you are not getting the result you expect in one case and why the OpenFAST crashes in another case.

I did noticed from your earlier post that you call your new AddMass SUBROUTINE at n_t_global == 5. Please note that n_t_global is the time-step counter (an integer), not the actual simulation time (in seconds). So, you appear to be changing the ElastoDyn p%BElmntMass parameter soon after model initialization (5 time steps in).

Regarding your code change, it looks like your change to p%BElmntMass in AddMass is identical to the original change to p%BElmntMass in AddMass that you had posted on Jun 05.

Best regards,
Jason Jonkman, Ph.D.
Senior Engineer | National Wind Technology Center (NWTC)

National Renewable Energy Laboratory (NREL)
15013 Denver West Parkway | Golden, CO 80401
+1 (303) 384 – 7026 | Fax: +1 (303) 384 – 6901
nwtc.nrel.gov

Sebastian.Hippel
Posts: 14
Joined: Mon Nov 16, 2015 10:00 am
Organization: Flensburg University of Applied Sciences
Location: Germany

Re: Making fault

Postby Sebastian.Hippel » Mon Sep 23, 2019 3:19 am

Dear Jason,

Thank you for your quick response.
Regarding to the first part of my question: after the modifications in open FAST and ElstoDyn (see my post in Jun 05, 2019) I can’t see any changes in the results of TEST 18, the results were identical
Now I changed the time of calling of Suroutine AddMass to n_t_global == 500. In this case I expect a change in the results in actual simulation time of t = 5 s when TMax and DT in .fst file are set to 10 and 0.01 respectively. But the results still identical (see figure below).
untitled2.pdf
(7.66 KiB) Downloaded 6 times

Regarding to the second part of my question: I tried to understand why the results are still the same. I expected that the parameters which are calculated in Subroutine Coeff are not changing at the given time (n_t_global == 500), because they are time-independent. For this reason I modified my AddMass Subrutine to recalculate all the parameters in Subroutine Coeff. So at the end my AddMass Subroutine looks like Subroutine Coeff with only one difference by calculation of blade-element-mass
p%BElmntMass(J,K) = 1.5*p%MassB(K,J)*p%DRNodes(J)

After that OpenFAST compiled without errors. But test 18 crashed as below:
Unbenannt.JPG
Unbenannt.JPG (227.63 KiB) Viewed 118 times

Best regards
Sebastian

Jason.Jonkman
Posts: 4277
Joined: Thu Nov 03, 2005 4:38 pm
Location: Boulder, CO
Contact:

Re: Making fault

Postby Jason.Jonkman » Mon Sep 23, 2019 8:42 pm

Dear Sebastian,

I think I understand what you are doing now.

I would guess OpenFAST is crashing in your second case because many calculations in SUBROUTINE Coeff() depend on data stored in the ElastoDyn input file, but that data is not known by the OpenFAST glue code (and the data does not exist after initialization anyway). You should not have InputFileData as an argument to your AddMass() SUBROUTINE.

I'm not sure why only changing p%BElmntMass(J,K) in SUBROUTINE AddMass() doesn't affect your results, but it could be because the blade mass is stored in different ways (both as a mass per unit length, p%MassB(K,J), and as a mass per element, p%ElmntMass(J,K)). You'll need to change both consistently for the result to be physical.

So, I would change your AddMass() SUBROUTINE to:

Code: Select all

!**********************************************************************************************************************************
!> This routine is used to add mass to blade elements at a given simulation time
SUBROUTINE AddMass(p)
!..................................................................................................................................

      ! Passed variables

   TYPE(ED_ParameterType),        INTENT(INOUT)    :: p                             !< Parameters of the structural dynamics module

      ! Local variables.


   INTEGER(IntKi)               :: J                                               ! Loops through nodes / elements.
   INTEGER(IntKi)               :: K                                               ! Loops through blades.

   !...............................................................................................................................
   ! Calculate the new blade element mass
   !...............................................................................................................................

   DO K = 1,p%NumBl          ! Loop through the blades


      DO J = 1,p%BldNodes    ! Loop through the blade nodes / elements


      ! Calculate the mass of the current element

         p%MassB(K,J) = 1.5*p%MassB(K,J)
         p%BElmntMass(J,K) = p%MassB(K,J)*p%DRNodes(J)                        ! Mass of blade element J


      ENDDO ! J - Blade nodes / elements

   ENDDO    ! K - Blades

END SUBROUTINE AddMass
!----------------------------------------------------------------------------------------------------------------------------------

Does that give you the result that you expect?

Best regards,
Jason Jonkman, Ph.D.
Senior Engineer | National Wind Technology Center (NWTC)

National Renewable Energy Laboratory (NREL)
15013 Denver West Parkway | Golden, CO 80401
+1 (303) 384 – 7026 | Fax: +1 (303) 384 – 6901
nwtc.nrel.gov

Sebastian.Hippel
Posts: 14
Joined: Mon Nov 16, 2015 10:00 am
Organization: Flensburg University of Applied Sciences
Location: Germany

Re: Making fault

Postby Sebastian.Hippel » Tue Sep 24, 2019 8:09 am

Dear Jason,

Unfortunately, the change of both parameters (mass per unit length, p%MassB(K,J), and mass per element, p%ElmntMass(J,K)) doesn’t mad any changes in the result. The result still identical even when I used your cod in the previous post.
Actually I’ve two comprehension questions about the points that you described in the previous post:
First question: how does SUBROUTINE ED_CalcOutput calculate the outputs signals, when the data from SUBROUTINE Coeff does not exist after initialization?
Second question: Why OpenFAST glue code didn’t give me any error massage when I call p%BElmntMass during the simulation, although this parameter already doesn’t excite?

Thank you for your help
Best regards
Sebastian

Jason.Jonkman
Posts: 4277
Joined: Thu Nov 03, 2005 4:38 pm
Location: Boulder, CO
Contact:

Re: Making fault

Postby Jason.Jonkman » Tue Sep 24, 2019 8:46 am

Dear Sebastian,

The data in the ElastoDyn parameters type (p) is defined at initialization and remains stored throughout the entire simulation. It is the data from the input file (InputFileData) that does not exist after ElastoDyn initialization.

I would expect changing p%BElmntMass(J,K) and p%MassB(K,J) mid simulation would change the output. I would suggest stepping through the solution with the debugger that your AddMass() SUBROUTINE is being called properly and to ensure that the values of p%BElmntMass(J,K) and p%MassB(K,J) are indeed changed when they are used in ElastoDyn.

Best regards,
Jason Jonkman, Ph.D.
Senior Engineer | National Wind Technology Center (NWTC)

National Renewable Energy Laboratory (NREL)
15013 Denver West Parkway | Golden, CO 80401
+1 (303) 384 – 7026 | Fax: +1 (303) 384 – 6901
nwtc.nrel.gov

Sebastian.Hippel
Posts: 14
Joined: Mon Nov 16, 2015 10:00 am
Organization: Flensburg University of Applied Sciences
Location: Germany

Re: Making fault

Postby Sebastian.Hippel » Thu Sep 26, 2019 6:39 am

Dear Jason,

Actually I’m very new with VS. Can you provide me with more information about how to stepping through the solation with the debugger. I already generate an OpenFAST_Debug.exe file and I read the instructions for debugging with Visual Studio. But I still don’t know how to navigate the debug.exe to the 5MW_Land_DLL_WTurb.fst (test file) in VS. I used to run OpenFAST as explaned in issue #268 https://github.com/OpenFAST/openfast/issues/268 . The problem is when I run openfast_x64_Debug.exe in the command window the breakpoints in FAST_Prog.f90 were not recognized.

Thank you for your help
Best regards
Sebastian


Return to “Airfoils”

Who is online

Users browsing this forum: No registered users and 0 guests