Compile FAST to model distributed spring model for monopile.

Dear FAST programmer,

I am trying to model the equivalent distributed spring model for monopile foundation. What I have done is following:

  1. I downloaded the UserTwrLd_DS.f90 file from Turbine-soil interaction. Influence on the mode shapes.. And I modified the input with my pile and spring value.

  2. Copy the UserTwrLd_DS.f90 file to the folder where other FAST source files are located.

  3. Modify Compile_FAST.bat file according to wind.nrel.gov/public/bjonkman/De … ctions.pdf

The questions are

  1. I don’t know what is the syntax to add UserTwrLd_DS.f90 in Compile_FAST.bat file.
  2. How do you know whether you correctly include the soil-pile interaction model (distributed spring model in my case)?

Since I did not know how to add UserTwrLd_DS.f90 in Compile_FAST.bat. I just run the Compile_FAST.bat in the attachment with UserTwrLd_DS.f90 locating in FAST source folder but without any syntax to add it. Then I used the generated FAST source file to run my model. The natural frequencies I got are very close to what I got from BModes distributed spring model but without any spring constant inputs (i.e. a cantilever beam without soil-pile interaction). I believe my FAST.exe did not include correctly the distributed spring model.

Can somebody with such experience help me with my issue?

Really appreciate.

Best regards,
Lingling

I can not upload attachment. I attached the content of my Compile_FAST.bat file:

@ECHO OFF

REM The calling syntax for this script is
REM Compile_FAST [dll]
REM
REM Add the “dll” to the command line to compile FAST for the Bladed-style dll.

REM ----------------------------------------------------------------------------
REM set compiler internal variables
REM ----------------------------------------------------------------------------
REM You can run this bat file from the IVF compiler’s command prompt (and not
REM do anything in this section). If you choose not to run from the IVF command
REM prompt, you must call the compiler’s script to set internal variables.
REM TIP: Right click on the IVF Compiler’s Command Prompt shortcut, click
REM properties, and copy the target (without cmd.exe and/or its switches) here:

CALL “C:\Program Files (x86)\Intel\Compiler\11.1\072\bin\ifortvars.bat” intel64

REM IF “%INTEL_SHARED%”==“” CALL “C:\Program Files\Intel\Compiler\Fortran\10.1.024\IA32\Bin\IFORTVARS.bat”

REM ----------------------------------------------------------------------------
REM -------------------- LOCAL VARIABLES ---------------------------------------
REM ----------------------------------------------------------------------------

SET ROOT_NAME=FAST

SET COMPOPTS=/threads /O2 /inline:speed /traceback /Qzero /Qsave /real_size:32 /assume:byterecl
rem SET LINKOPTS=/link /stack:64000000
SET LINKOPTS=/link

REM ----------------------------------------------------------------------------
REM ------------------------- LOCAL PATHS --------------------------------------
REM ----------------------------------------------------------------------------
REM – USERS WILL NEED TO EDIT THESE PATHS TO POINT TO FOLDERS ON THEIR LOCAL –
REM ------- NOTE: do not use quotation marks around the path names!!! ---------
REM ----------------------------------------------------------------------------
REM NWTC_Lib_Loc is the location of the NWTC subroutine library files
REM AeroDyn_Loc is the location of the AeroDyn source files
REM Wind_Loc is the location of the AeroDyn wind inflow source files
REM FAST_LOC is the location of the FAST source files
REM ----------------------------------------------------------------------------

SET NWTC_Lib_Loc=C:\Users\lyin5\Desktop\Compile FAST\NWTC Library\Source
SET AeroDyn_Loc=C:\Users\lyin5\Desktop\Compile FAST\AeroDyn\Source
SET Wind_Loc=C:\Users\lyin5\Desktop\Compile FAST\AeroDyn\Source\InflowWind\Source
SET FAST_Loc=C:\Users\lyin5\Desktop\Compile FAST\FAST\Source

REM SET NWTC_Lib_Loc=C:\Users\lyin5\Desktop\Compile FAST\NWTC Library\Source
REM SET AeroDyn_Loc=C:\Users\lyin5\Desktop\Compile FAST\AeroDyn\Source
REM SET Wind_Loc=C:\Users\lyin5\Desktop\Compile FAST\AeroDyn\Source\InflowWind\Source
REM SET FAST_Loc=C:\Users\lyin5\Desktop\Compile FAST\FAST\Source

REM ----------------------------------------------------------------------------
REM -------------------- LIST OF ALL SOURCE FILES ------------------------------
REM ----------------------------------------------------------------------------

SET NWTC_Files=
SET NWTC_Files=%NWTC_Files% “%NWTC_Lib_Loc%\SingPrec.f90”
SET NWTC_Files=%NWTC_Files% “%NWTC_Lib_Loc%\SysIVF.f90”
SET NWTC_Files=%NWTC_Files% “%NWTC_Lib_Loc%\NWTC_IO.f90”
SET NWTC_Files=%NWTC_Files% “%NWTC_Lib_Loc%\NWTC_Num.f90”
SET NWTC_Files=%NWTC_Files% “%NWTC_Lib_Loc%\NWTC_Aero.f90”
SET NWTC_Files=%NWTC_Files% “%NWTC_Lib_Loc%\NWTC_Library.f90”

SET Wind_Files=
SET Wind_Files=%Wind_Files% “%Wind_Loc%\SharedInflowDefs.f90”
SET Wind_Files=%Wind_Files% “%Wind_Loc%\HHWind.f90”
SET Wind_Files=%Wind_Files% “%Wind_Loc%\FFWind.f90”
SET Wind_Files=%Wind_Files% “%Wind_Loc%\HAWCWind.f90”
SET Wind_Files=%Wind_Files% “%Wind_Loc%\FDWind.f90”
SET Wind_Files=%Wind_Files% “%Wind_Loc%\CTWind.f90”
SET Wind_Files=%Wind_Files% “%Wind_Loc%\UserWind.f90”
SET Wind_Files=%Wind_Files% “%Wind_Loc%\InflowWindMod.f90”

SET AeroDyn_Files=
SET AeroDyn_Files=%AeroDyn_Files% “%AeroDyn_Loc%\SharedTypes.f90”
SET AeroDyn_Files=%AeroDyn_Files% “%AeroDyn_Loc%\AeroMods.f90”
SET AeroDyn_Files=%AeroDyn_Files% “%AeroDyn_Loc%\GenSubs.f90”
SET AeroDyn_Files=%AeroDyn_Files% “%AeroDyn_Loc%\AeroSubs.f90”
SET AeroDyn_Files=%AeroDyn_Files% “%AeroDyn_Loc%\AeroDyn.f90”

SET FAST_Files=
SET FAST_Files=%FAST_Files% “%FAST_LOC%\fftpack.f”
SET FAST_Files=%FAST_Files% “%FAST_LOC%\FFTMod.f90”
SET FAST_Files=%FAST_Files% “%FAST_LOC%\HydroCalc.f90”
SET FAST_Files=%FAST_Files% “%FAST_LOC%\FAST_Mods.f90”
SET FAST_Files=%FAST_Files% “%FAST_LOC%\Noise.f90”
SET FAST_Files=%FAST_Files% “%FAST_LOC%\FAST_IO.f90”
SET FAST_Files=%FAST_Files% “%FAST_LOC%\FAST.f90”
SET FAST_Files=%FAST_Files% “%FAST_LOC%\FAST_Lin.f90”
SET FAST_Files=%FAST_Files% “%FAST_LOC%\FAST2ADAMS.f90”

IF /I “%1”==“DLL” GOTO dllFiles

SET FAST_Files=%FAST_Files% “%FAST_LOC%\PitchCntrl_ACH.f90”
SET FAST_Files=%FAST_Files% “%FAST_LOC%\UserSubs.f90”
SET FAST_Files=%FAST_Files% “%FAST_LOC%\UserVSCont_KP.f90”

GOTO endFASTfiles

:dllFiles
SET FAST_Files=%FAST_Files% “%FAST_LOC%\BladedDLLInterface.f90”
SET FAST_Files=%FAST_Files% “%FAST_LOC%\UserSubs_forBladedDLL.f90”
SET FAST_Files=%FAST_Files% “%FAST_LOC%\UserVSCont_KP_forBladedDLL.f90”

REM NOTE: UserSubs_forBladedDLL.f90 is a copy of UserSubs.f90 with SUBROUTINES UserHSSBr() and UserYawCont() commented out
REM UserVSCont_KP_forBladedDLL.f90 is a copy of UserVSCont_KP.f90 with SUBROUTINE UserVSCont() commented out

SET ROOT_NAME=%ROOT_NAME%_DLL

:endFASTfiles
SET FAST_Files=%FAST_Files% “%FAST_LOC%\AeroCalc.f90”
SET FAST_Files=%FAST_Files% “%FAST_LOC%\SetVersion.f90”
SET FAST_Files=%FAST_Files% “%FAST_LOC%\FAST_Prog.f90”

:ivf
REM ----------------------------------------------------------------------------
REM ---------------- COMPILE WITH INTEL VISUAL FORTRAN -------------------------
REM ----------------------------------------------------------------------------

REM compile

ECHO.
ECHO Compiling FAST, AeroDyn, and NWTC_Library routines to create %ROOT_NAME%.exe:

ifort %COMPOPTS% %NWTC_Files% %Wind_Files% %AeroDyn_Files% %FAST_Files% %LINKOPTS% /out:%ROOT_NAME%.exe

:end
REM ----------------------------------------------------------------------------
REM ------------------------- CLEAR MEMORY -------------------------------------
REM ------------- and delete all .mod and .obj files ---------------------------
REM ----------------------------------------------------------------------------
ECHO a

DEL *.mod
DEL *.obj

SET ROOT_NAME=
SET COPTS=

SET NWTC_Files=
SET Wind_Files=
SET AeroDyn_Files=
SET FAST_Files=
SET A2AD_Files=
SET Fixed_Files=

SET NWTC_Lib_Loc=
SET Wind_Loc=
SET AeroDyn_Loc=
SET A2AD_Loc=
SET FAST_Loc=

SET COMPOPTS=
SET LINKOPTS=

You have to tell the compile script exactly what files you want compiled. It doesn’t go searching for random files.

As I see it, there are two options to compile your subroutine:

  1. Replace the default UserTwrLd subroutine in HydroCalc.f90 with your modified code.

SUBROUTINE UserTwrLd ( JNode, X, XD, ZTime, DirRoot, TwrAM, TwrFt ) ... END SUBROUTINE UserTwrLd

  1. Comment out the UserTwrLd subroutine in HydroCalc.f90 and tell the script to compile your new source file.

SET FAST_Files=%FAST_Files% "%FAST_LOC%\HydroCalc.f90" becomes

SET FAST_Files=%FAST_Files% "%FAST_LOC%\HydroCalc.f90" SET FAST_Files=%FAST_Files% "%FAST_LOC%\UserTwrLd_DS.f90" (This assumes UserTwrLd_DS.f90 is in the same folder as the rest of the FAST source files. You can, of course, change that by replacing %FAST_LOC%.)

Dear Bonnie,
I really appreciate your suggestions. According to your suggestions, I have done compilation in three different ways but all of them are failed. Please help me to check my methods again, thank you!

  1. First Method:
    Step 1.1: Comment out SUBROUTINE UserTwrLd in HydroCal.f90 file like this based on what Jason has commented:

!JASON: MOVE THIS USER-DEFINED ROUTINE (UserTwrLd) TO THE UserSubs.f90 OF FAST WHEN THE MONOPILE LOADING FUNCTIONALITY HAS BEEN DOCUMENTED!!!!! !SUBROUTINE UserTwrLd ( JNode, X, XD, ZTime, DirRoot, TwrAM, TwrFt )…… …………
Step 1.2: Move my modified SUBROUTINE UserTwrLd to the end of UserSubs.f90 right after END SUBROUTINE UserYawCont since there is no hold place for SUBROUTINE UserTwrLd.

  1. Second Method:
    This is basically the first option you suggested me.
    Step 2.1: Replace the defaulted SUBROUTINE UserTwrLd in HydroCalc.f90 with my modified code like this:

!JASON: MOVE THIS USER-DEFINED ROUTINE (UserTwrLd) TO THE UserSubs.f90 OF FAST WHEN THE MONOPILE LOADING FUNCTIONALITY HAS BEEN DOCUMENTED!!!!! !======================================================================= SUBROUTINE UserTwrLd ( JNode, X, XD, ZTime, DirRoot, TwrAM, TwrFt ) …………

3.Third Method:
This is basically the second option you suggested me.
Step 3.1: Comment out the SUBROUTINE UserTwrLd in HydroCalc.f90 like what I did in Step 1.1.
Step 3.2: Copy my modified UserTwrLd_DS.f90 file to the same direction as the rest of the FAST source file like HydroCalc.f90 etc.
Step 3.3: Add one line of sentence to tell the script to compile my new source file like what you did:

SET FAST_Files=%FAST_Files% "%FAST_LOC%\HydroCalc.f90" SET FAST_Files=%FAST_Files% "%FAST_LOC%\UserTwrLd_DS.f90"

It is unfortunately that all of the three are aborted. I have attached the error screen in the attachment as well as my modified UserTwrLd_DS.f90 file.
Really appreciate!

Can somebody tell me why I can’t attach any documents any more?

I will type my error information from running Compile_FAST.bat file.

Errors from Method1:
UserSubs.f90(998): error #6404: This name does not have a type, and must have an explicit type. [INTERPSTP] Stff(J) = InterpStp( WaveKinzi0(J), zi(:), Spring(:), LastInd, NSpring) ___________^
compilation aborted for C:\Users\lyin5\Desktop\Compile FAST\FAST\Source\UserSubs.f90 (code 1)

Errors from Method2:
C:\Users\lyin5\Desktop\Compile FAST\FAST\Source\HydroCalc.f90(5106): error #7002: Error in opening the compiled module file. Check INCLUDE paths. [INTERPSUBS] USE ___________^InterpSubs
C:\Users\lyin5\Desktop\Compile FAST\FAST\Source\HydroCalc.f90(5335): error #6404: This name does not have a type, and must have an explicit type. [INTERPSTP] Stff(J) = InterpStp( WaveKinzi0(J), zi(:), Spring(:), LastInd, NSpring) ___________^
compilation aborted for C:\Users\lyin5\Desktop\Compile FAST\FAST\Source\HydroCalc.f90 (code 1)

Errors from Method3:
C:\Users\lyin5\Desktop\Compile FAST\FAST\Source\UserTwrLd_DS.f90(259): error #700: Error in opening the compiled module file. Check INCLUDE paths. [INTERPSUBS] USE ___________^InterpSubs
C:\Users\lyin5\Desktop\Compile FAST\FAST\Source\UserTwrLd_DS.f90(259): error #6404: This name does not have a type, and must have an explicit type. [INTERPSTP] Stff(J) = InterpStp( WaveKinzi0(J), zi(:), Spring(:), LastInd, NSpring) ___________^
compilation aborted for C:\Users\lyin5\Desktop\Compile FAST\FAST\Source\UserTwrLd_DS.f90 (code 1)
An internal threshold was exceeded for routine FAST2ADAMSSUBS_mp_MAKEADM and optimization level may be reduced. See software.intel.com/en-us/article … s-exceeded for more information and advice.

Once again, really appreciate!

Best regards,
Lingling.

Hi, Lingling,

My guess is that you need to put

USE NWTC_Library

at the top of your subroutine. (Look at other subroutines for an example).

Dear Bonnie,

Really appreciate your response. Do you mind if you can send me the HydroCalc.f90 file when you compile FAST to model the NREL 5 MW offshore wind turbine with distributed spring model as foundation in OC3? And also can you send me the NRELOffshrBsline5MW_Platform_Monopile.dat for DS model?

Thank you!

The UserTwrLd routine that you are using looks like it was designed for an earlier version of FAST/HydroCalc/NWTC Subroutine Library than you are using. The routines from the InterpSubs module were moved to the NWTC Library and InterpSubs was deleted.

You need to replace USE InterpSubs USE Precision with

 USE NWTC_LIbrary

This corresponds to lines 5105-5106 in the HydroCalc.f90 source code you emailed me.

Dear Bonnie,

Yes, you are right. It works now. Really appreciate your help!

Dear all:
I tried to model DS model in FAST v7.02.
I did the following:

  1. I copied the file “UserTwrLd_DS.f90” to the file folder “source”.
    2.In “UserTwrLd_DS.f90” I replaced “USE InterpSubs USE Precision” with “USE NWTC_LIbrary”.( I couldn’t find the “NWTC_Library.f90” file in the soure of v7.02. I just downloaded one. I didn’t know whether it’s right.) And in Compile_FAST.bat I added "SET FAST_Files=%FAST_Files% “%FAST_LOC%\UserTwrLd_DS.f90” ".
  2. I downloaded the NRELOffshrBsline5MW_Monopile_RF.zip from wind.nrel.gov/public/jjonkman/NR … Bsline5MW/, and change it with “DS file” in the post “Natural frequency of NREL DS monotower in OC3”.
    I think all was done, but when I run FAST, it reads an unrelated error" Invalid numerical input for file “.\NRELOffshrBsline5MW_Platform_Monopile_DS.dat”. The error occurred whie trying to read CurrMod." But CurrMod was set to 0 in this file. I was completely confused now.
    Would you please tell me where the errors may occur? Thanks a lot.

Dear Yuqi,

I’m not sure which NWTC library you downloaded, but FAST v7.02 is compatible with the old library found here: nwtc.nrel.gov/nwtc_subs.

Regarding the runtime error you are receiving, I suggest that you use the Echo option from the primary FAST input file to debug errors in the input-file processing.

Best regards,

Dear Jason:
I did as you suggested. But the same error occurred. It seems that all data before CURRENT were read. And I copied all the files of the library to the source folder. Does it matter?
NRELOffshrBsline5MW_Platform_Monopile_DS.dat.txt (6.38 KB)
NRELOffshrBsline5MW_Monopile_DS.ech.txt (25.5 KB)

Dear Yuqi,

Looking at the FAST v7.02 source code, I don’t see any sign of HydroDyn input variable WaveNDAmp. This input parameter was added in an older branch of FAST v6 (and is also in the current version of HydroDyn within FAST v8), but doesn’t appear to have been included in the source code for FAST v7.02 for some reason. (This was too long ago and I can’t remember the reasoning–it was probably just an oversight.) Regardless, removing line 47 (for WaveNDAmp) from the NRELOffshrBsline5MW_Platform_Monopile_DS.dat input file should resolve the problem.

Just FYI: In old versions of HydroDyn that did not consider input parameter WaveNDAmp, HydroDyn computed the wave kinematics with normally distributed wave amplitudes as if WaveNDAmp = True; the functionality for WaveNDAmp = False, meaning that that the wave amplitudes depend only on the specified wave spectrum, was added later.

Best regards,

Dear Jason:
Thanks a lot for your quick response. It really works if the line of WaveNDAmp is deleted. And the following comes that GBRatio must be set to 1.0 when using UserVSCont routine. After the change(GBRatio from 97 to 1), “Small angle assumption violated…FF wind array was exhausted…” occurs. Here is my input file, I’d appreciate it if you help me check it. And I’d like to ask for a Turbsim input file as a reference.
Best regards.
NRELOffshrBsline5MW_Monopile_DS.fst.txt (20.7 KB)

Dear Yuqi,

A similar question has been answered in the following forum topic: FAST (particularly my Apr 06, 2011 post).

Best regards,

Dear Jason:
I’ll learn the topic “FAST” carefully.
Many thanks and best regards.