openfast icon indicating copy to clipboard operation
openfast copied to clipboard

BeamDyn: Node does not project onto any line2 element

Open Jamie7963 opened this issue 4 months ago • 9 comments

I am getting the following error when trying to use BeamDyn + ElastoDyn in OpenFAST 3.5.2

FAST_InitializeAll:InitModuleMappings:BD_2_AD_BladeMotion(1):MeshMapCreate:CreateMotionMap_L2_to_L 2:CreateMapping_ProjectToLine2:Node 7 does not project onto any line2 element. Closest distance is 1.73412E-02 m. InitModuleMappings:BD_2_AD_BladeMotion(2):MeshMapCreate:CreateMotionMap_L2_to_L2:CreateMapping_Pro jectToLine2:Node 1 does not project onto any line2 element. Closest distance is 2.1732 m.

I've tried working out what this is and I'm honestly stumped. The same model works on just ElastoDyn. But the weird part is that it doesn't report the same errors on both blades, even though both blades use the same blade file.

BeamDyn file:

--------- BEAMDYN with OpenFAST INPUT FILE ------------------------------------------- Generated with AeroElasticSE FAST driver ---------------------- SIMULATION CONTROL -------------------------------------- False Echo - Echo input data to "<RootName>.ech" (flag) True QuasiStaticInit - Use quasistatic pre-conditioning with centripetal accelerations in initialization (flag) [dynamic solve only] 0 rhoinf - Numerical damping parameter for generalized-alpha integrator 1 quadrature - Quadrature method: 1=Gaussian; 2=Trapezoidal (switch) "DEFAULT" refine - Refinement factor for trapezoidal quadrature (-). DEFAULT = 1 [used only when quadrature=2] "DEFAULT" n_fact - Factorization frequency (-). DEFAULT = 5 "DEFAULT" DTBeam - Time step size (s). "DEFAULT" load_retries - Number of factored load retries before quitting the aimulation "DEFAULT" NRMax - Max number of iterations in Newton-Ralphson algorithm (-). DEFAULT = 10 "DEFAULT" stop_tol - Tolerance for stopping criterion (-) False tngt_stf_fd - Flag to use finite differenced tangent stiffness matrix (-) False tngt_stf_comp - Flag to compare analytical finite differenced tangent stiffness matrix (-) "DEFAULT" tngt_stf_pert - perturbation size for finite differencing (-) "DEFAULT" tngt_stf_difftol - Maximum allowable relative difference between analytical and fd tangent stiffness (-) False RotStates - Orient states in the rotating frame during linearization? (flag) [used only when linearizing] ---------------------- GEOMETRY PARAMETER -------------------------------------- 1 member_total - Total number of members (-) 51 kp_total - Total number of key points (-) [must be at least 3] 1 51 - Member number; Number of key points in this member kp_xr kp_yr kp_zr initial_twist
(m) (m) (m) (deg)
0.00000000000000e+00 0.00000000000000e+00 0.00000000000000e+00 1.75000218240193e+01 0.00000000000000e+00 0.00000000000000e+00 8.00000000000000e-01 1.75000218240193e+01 0.00000000000000e+00 0.00000000000000e+00 1.60000000000000e+00 1.66613834992863e+01 0.00000000000000e+00 0.00000000000000e+00 2.40000000000000e+00 1.58228024703328e+01 0.00000000000000e+00 0.00000000000000e+00 3.20000000000000e+00 1.49841641455998e+01 0.00000000000000e+00 0.00000000000000e+00 4.00000000000000e+00 1.41455831166464e+01 0.00000000000000e+00 0.00000000000000e+00 4.80000000000000e+00 1.33069447919134e+01 0.00000000000000e+00 0.00000000000000e+00 5.60000000000000e+00 1.24683637629599e+01 0.00000000000000e+00 0.00000000000000e+00 6.40000000000000e+00 1.16297254382269e+01 0.00000000000000e+00 0.00000000000000e+00 7.20000000000000e+00 1.09469316337695e+01 0.00000000000000e+00 0.00000000000000e+00 8.00000000000000e+00 1.07314995028003e+01 0.00000000000000e+00 0.00000000000000e+00 8.80000000000000e+00 1.05160673718311e+01 0.00000000000000e+00 0.00000000000000e+00 9.60000000000000e+00 1.03006352408619e+01 0.00000000000000e+00 0.00000000000000e+00 1.04000000000000e+01 1.00852031098928e+01 0.00000000000000e+00 0.00000000000000e+00 1.12000000000000e+01 9.86977097892356e+00 0.00000000000000e+00 0.00000000000000e+00 1.20000000000000e+01 9.65433884795437e+00 0.00000000000000e+00 0.00000000000000e+00 1.28000000000000e+01 9.43890671698518e+00 0.00000000000000e+00 0.00000000000000e+00 1.36000000000000e+01 9.22347458601599e+00 0.00000000000000e+00 0.00000000000000e+00 1.44000000000000e+01 9.00804245504680e+00 0.00000000000000e+00 0.00000000000000e+00 1.52000000000000e+01 8.79261032407761e+00 0.00000000000000e+00 0.00000000000000e+00 1.60000000000000e+01 8.57717819310842e+00 0.00000000000000e+00 0.00000000000000e+00 1.68000000000000e+01 8.36174606213923e+00 0.00000000000000e+00 0.00000000000000e+00 1.76000000000000e+01 8.14631393117005e+00 0.00000000000000e+00 0.00000000000000e+00 1.84000000000000e+01 7.93088180020085e+00 0.00000000000000e+00 0.00000000000000e+00 1.92000000000000e+01 7.71544966923167e+00 0.00000000000000e+00 0.00000000000000e+00 2.00000000000000e+01 7.50001753826248e+00 0.00000000000000e+00 0.00000000000000e+00 2.08000000000000e+01 7.35001718749723e+00 0.00000000000000e+00 0.00000000000000e+00 2.16000000000000e+01 7.20001683673198e+00 0.00000000000000e+00 0.00000000000000e+00 2.24000000000000e+01 7.05001648596673e+00 0.00000000000000e+00 0.00000000000000e+00 2.32000000000000e+01 6.90001613520148e+00 0.00000000000000e+00 0.00000000000000e+00 2.40000000000000e+01 6.75001578443623e+00 0.00000000000000e+00 0.00000000000000e+00 2.48000000000000e+01 6.60001543367098e+00 0.00000000000000e+00 0.00000000000000e+00 2.56000000000000e+01 6.45001508290573e+00 0.00000000000000e+00 0.00000000000000e+00 2.64000000000000e+01 6.30001473214048e+00 0.00000000000000e+00 0.00000000000000e+00 2.72000000000000e+01 6.15001438137523e+00 0.00000000000000e+00 0.00000000000000e+00 2.80000000000000e+01 6.00001403060998e+00 0.00000000000000e+00 0.00000000000000e+00 2.88000000000000e+01 5.51998998984938e+00 0.00000000000000e+00 0.00000000000000e+00 2.96000000000000e+01 5.04002324486829e+00 0.00000000000000e+00 0.00000000000000e+00 3.04000000000000e+01 4.55999920410768e+00 0.00000000000000e+00 0.00000000000000e+00 3.12000000000000e+01 4.07997516334708e+00 0.00000000000000e+00 0.00000000000000e+00 3.20000000000000e+01 3.60000841836599e+00 0.00000000000000e+00 0.00000000000000e+00 3.28000000000000e+01 3.11998437760538e+00 0.00000000000000e+00 0.00000000000000e+00 3.36000000000000e+01 2.64001763262429e+00 0.00000000000000e+00 0.00000000000000e+00 3.44000000000000e+01 2.15999359186369e+00 0.00000000000000e+00 0.00000000000000e+00 3.52000000000000e+01 1.68002684688260e+00 0.00000000000000e+00 0.00000000000000e+00 3.60000000000000e+01 1.20000280612200e+00 0.00000000000000e+00 0.00000000000000e+00 3.68000000000000e+01 7.19978765361392e-01 0.00000000000000e+00 0.00000000000000e+00 3.76000000000000e+01 2.40012020380299e-01 0.00000000000000e+00 0.00000000000000e+00 3.84000000000000e+01 -2.40012020380302e-01 0.00000000000000e+00 0.00000000000000e+00 3.92000000000000e+01 -7.19978765361392e-01 0.00000000000000e+00 0.00000000000000e+00 4.00000000000000e+01 -1.20000280612200e+00 ---------------------- MESH PARAMETER ------------------------------------------ 5 order_elem - Order of interpolation (basis) function (-) ---------------------- MATERIAL PARAMETER -------------------------------------- "test_BeamDyn_Blade.dat" BldFile - Name of file containing properties for blade (quoted string) ---------------------- PITCH ACTUATOR PARAMETERS ------------------------------- False UsePitchAct - Whether a pitch actuator should be used (flag) 200.0 PitchJ - Pitch actuator inertia (kg-m^2) [used only when UsePitchAct is true] 20000000.0 PitchK - Pitch actuator stiffness (kg-m^2/s^2) [used only when UsePitchAct is true] 500000.0 PitchC - Pitch actuator damping (kg-m^2/s) [used only when UsePitchAct is true] ---------------------- OUTPUTS ------------------------------------------------- True SumPrint - Print summary data to "<RootName>.sum" (flag) "ES10.3E2" OutFmt - Format used for text tabular output, excluding the time channel. 0 NNodeOuts - Number of nodes to output to file [0 - 9] (-) 1, 2, 3, 4, 5, 6 OutNd - Nodes whose values will be output (-) OutNd - Nodes whose values will be output (-) OutList - The next line(s) contains a list of output parameters. See OutListParameters.xlsx for a listing of available output channels, (-) "RootFxr" "RootFyr" "RootFzr" "RootMxr" "RootMyr" "RootMzr" "TipRDxr" "TipRDyr" "TipRDzr" "TipTDxr" "TipTDyr" "TipTDzr" END of input file (the word "END" must appear in the first 3 columns of this last OutList line)

AeroDyn15 blade file:

------- AERODYN v15.00.* BLADE DEFINITION INPUT FILE ------------------------------------- Generated with AeroElasticSE FAST driver ====== Blade Properties ================================================================= 7 NumBlNds - Number of blade nodes used in the analysis (-) BlSpn BlCrvAC BlSwpAC BlCrvAng BlTwist BlChord BlAFID (m) (m) (m) (deg) (deg) (m) (-) 0.000000000000000e+00 0.000000000000000e+00 0.000000000000000e+00 0.000000000000000e+00 1.750002182401927e+01 2.215000000000000e+00 1 8.000000000000000e-01 0.000000000000000e+00 0.000000000000000e+00 0.000000000000000e+00 1.750002182401927e+01 2.248674000000000e+00 1 7.000000000000000e+00 0.000000000000000e+00 0.000000000000000e+00 0.000000000000000e+00 1.111763008488386e+01 3.246174750000000e+00 2 2.000000000000000e+01 0.000000000000000e+00 0.000000000000000e+00 0.000000000000000e+00 7.500017538262475e+00 2.257343000000000e+00 3 2.800000000000000e+01 0.000000000000000e+00 0.000000000000000e+00 0.000000000000000e+00 6.000014030609979e+00 1.546826000000000e+00 4 3.200000000000000e+01 0.000000000000000e+00 0.000000000000000e+00 0.000000000000000e+00 3.600008418365988e+00 1.184308000000000e+00 5 4.000000000000000e+01 0.000000000000000e+00 0.000000000000000e+00 0.000000000000000e+00 -1.200002806121996e+00 4.500000000000000e-01 5

Whats more, node 7 on the AeroDyn file should have exactly the same placement as the final node in BeamDyn.

My thinking is that there is a mapping issue in the version of OpenFAST that I'm using, as I wouldn't have thought there would be a convergence issue considering this happens on initialisation of the run.

Jamie7963 avatar Aug 27 '25 13:08 Jamie7963

Dear @Jamie7963,

Good question. It is not obvious to me where the issue is given that BeamDyn and AeroDyn meshes are straight and the same length.

You could trying moving the outboard node of AeroDyn inboard a bit to see if that solves the first issue. You can also try recompiling OpenFAST with the DEBUG_MESHMAPPING compiler directive set, which will generate a debugging file that may help identify the issue.

Best regards,

jjonkman avatar Aug 27 '25 15:08 jjonkman

Thanks for the reply. I actually wanted to try building openfast using debug mode as I thought it would be easier to trace the errors in my setup and help understand whats actually going on better.

However I'm having a little trouble with the compilation. My steps so far: cd openfast-main I have created a build folder in an uncompiled openfast-main folder mkdir build cd build cmake -G "Visual Studio 17 2022" -A x64 -DCMAKE_BUILD_TYPE=Debug -D CMAKE_Fortran_COMPILER="C:/Program Files (x86)/Intel/oneAPI/compiler/2025.2/bin/ifx.exe" .. cmake --build . --config Debug --parallel 4

The build errors I'm getting are largely around pathing:

12>------ Build started: Project: hydrodyn_c_binding, Configuration: Debug x64 ------ AeroDyn_Inflow_Types.f90 ifx: command line warning #10161: unrecognized source type 'Files\Microsoft'; object file assumed Compiling with Intel© Fortran Compiler 2025.2.1 [Intel(R) 64]... 13>------ Build started: Project: moordyn_driver, Configuration: Debug x64 ------ ifx: command line warning #10161: unrecognized source type 'Files\Microsoft'; object file assumed HydroDyn_DriverSubs.f90 ifx: command line warning #10161: unrecognized source type 'Visual'; object file assumed ifx: command line warning #10161: unrecognized source type 'Files\Microsoft'; object file assumed ifx: command line warning #10161: unrecognized source type 'Files\Microsoft'; object file assumed Compiling with Intel© Fortran Compiler 2025.2.1 [Intel(R) 64]... 14>------ Build started: Project: moordyn_c_binding, Configuration: Debug x64 ------ ifx: command line warning #10161: unrecognized source type 'Visual'; object file assumed ifx: command line warning #10161: unrecognized source type 'Files\Microsoft'; object file assumed HydroDyn_C_Binding.f90 fpp: fatal: can't fopen file: Studio\2022\Community\VC\Tools\MSVC\14.44.35207\bin\HostX64\x64 /Qm64 C:\Users\james\Documents\debug_openfast\openfast-main\modules\inflowwind\src\InflowWind_Driver_Types.f90 ifx: command line warning #10161: unrecognized source type 'Visual'; object file assumed ifx: command line warning #10161: unrecognized source type 'Visual'; object file assumed

From what I can tell ifort became ifx very recently and one of the problems it has is its own internal syntax rules. Do you know anyone who has tried compiling using ifx?

Jamie7963 avatar Aug 28 '25 11:08 Jamie7963

@Jamie7963 There's something strange going on with the paths in the commands that CMake is executing. It looks like they haven't been quoted because it thinks the path to the compiler is several source files. Which environment are you running the CMake commands in? I tried to replicate this in both cmd and PowerShell, but I was able to compile.

deslaughter avatar Aug 29 '25 11:08 deslaughter

@deslaughter Did you use the ifort or ifx compiler?

I'm not sure if it is the new intel compiler

I'm using Windows 11

I was building using the intel oneAPI command prompt for Intel 64 for Visual Studio 2022.

I'm using the most up to date CMake Think its 3.29

Jamie7963 avatar Aug 29 '25 12:08 Jamie7963

@Jamie7963 I used IFX 2025.2 but I was on Windows 10. I was also using CMake 4.0.1 which may make a difference. I don't think the issue is with IFX, it's more likely to be CMake because the paths aren't being treated correctly. May also be worth trying a different generator such as NMake. I've also had pretty good luck with Ninja on Windows, but you'll need to install it.

deslaughter avatar Aug 29 '25 14:08 deslaughter

Think I tried a ninja install and the install seemed to work, but when I tried running openfast, it didn't seem to work and just paused my terminal. but I'm honestly not that familiar with compiling source code. I feel a bit out of depth with this

Any chance you could suggest steps for a ninja install that would allow debugging?

Jamie7963 avatar Aug 29 '25 14:08 Jamie7963

How do you run OpenFast in the debugger? Most Windows users compile and debug using Visual Studio and bypass CMake. There are a set of projects in the vs-build directory that can be opened with Visual Studio.

deslaughter avatar Aug 29 '25 15:08 deslaughter

If I'm honest, I don't entirely know. I watched some videos of people debugging other fortran programs and wanted to try to follow their approach. I don't know how possible it is if I'm honest.

Fortran and CPP really isn't my background, I'm used to python where debugging is super easy.

My understanding is that you could compile OpenFAST using CMake with debug mode, then run OpenFAST using visual studio or visual studio code using the debugger. if using vs code then from a json file that looks like this:

{ "version": "0.2.0", "configurations": [ { "name": "Run GDB", "type": "cppdbg", "request": "launch", "program": "path/to/openfast/openfast_x64.exe", "args": ["path/to/fst_file/test.fst"], "stopAtEntry": false, "cwd": "path/to/cwd_folder", "externalConsole": true, "MIMode": "gdb", "miDebuggerPath": "C:/msys64/mingw64/bin/gdb.exe", "setupCommands": [ { "description": "Enable pretty-printing", "text": "-enable-pretty-printing", "ignoreFailures": true } ] } ] }

Jamie7963 avatar Aug 29 '25 15:08 Jamie7963

@Jamie7963 I like using VS Code instead of Visual Studio as well, but it requires a bit more setup. Also, compiling with Visual Studio and debugging with GDB isn't supported. If you want to use the GDB debugger, then you'll need to use the gfortran compiler, which you likely already have installed since you've got the miDebuggerPath listed as C:/msys64/mingw64/bin/gdb.exe. I recommend installing the following VS Code extensions:

  • CMake Tools: https://marketplace.visualstudio.com/items?itemName=ms-vscode.cmake-tools - this adds CMake integration for VS Code which lets you select which compiler to use, whether to build in Debug or Release, and to actually build the executables. It'll automatically detect the CMakeLists.txt file in the OpenFAST repo when you open that directory.
  • Modern Fortran: https://marketplace.visualstudio.com/items?itemName=fortran-lang.linter-gfortran - you'll need to use Anaconda, the Python distribution, to install fortls via conda install -c conda-forge fortls to provide auto-completion and other typical IDE functionality for Fortran.

Then, open the directory containing the OpenFAST source code, where you cloned the repo, and VS Code will ask you to search for or select a tool chain. You'll need to select GCC ... which will tell CMake to use the gfortran compiler. Then, it should automatically try to configure the project, what you get when you run cmake ... If that completes, you'll see a button in the status bar to build all the executables.

Finally, you'll need to give the path to the executable you want to debug in the JSON debugger config you filled out. Except the path will be more like ${workspaceRoot}/build/glue-codes/openfast/openfast.

There's a lot more to configure for debugging compiled codes, but don't give up, you'll get there. Hopefully, this will give you enough leads that you can get it working, if not, let me know.

deslaughter avatar Aug 29 '25 18:08 deslaughter