OpenFAST / matlab-toolbox

Collection of Matlab tools developed for use with OpenFAST
Apache License 2.0
50 stars 68 forks source link

How use ReadFASTMesh #26

Closed salicto closed 2 years ago

salicto commented 3 years ago

Hello everyone,

I don't quite understand how to use the matlab ReadFASTMesh function. Does the fileID correspond to a .vtk file? How to generate a mesh file? If anyone ever has a mesh file so I can analyze the structure.

Thank you for your answers.

Regards,

Tom

bjonkman commented 3 years ago

The ReadFASTMesh.m function is for reading binary data that was written using the MeshWrBin subroutine in the NWTC Library of OpenFAST (Fortran code). Normal OpenFAST simulations don't call MeshWrBin, though; it's a debugging function.

If you do output meshes in this format from OpenFAST (i.e., change the Fortran code and rebuild it), you could pass the file name to the ReadFASTMesh function as the FileID so the routine would open and close the file. If the file has multiple meshes written to it, you would open the file outside ReadFASTMesh routine, then pass the unit number from fopen and call ReadFASTMesh multiple times.

You can generate VTK files in OpenFAST and analyze them using software like ParaView. The .vtp files contain mesh connectivity and position, and if you output fields, it will give you other information, too.