ParaView can save state files, which can then be loaded later. This is an easy way to apply the same template (glyphs, colors, scaling, etc.) to similar datasets.
When you have created a particular view in ParaView that you would like to save as a template for other OpenFAST simulations, click File -> Save State ... and choose a location and name for the file.
To use a state file:
-
Run OpenFAST with the appropriate modules and VTK inputs (
WrVTK,VTK_type,VTK_fields) set for the template ParaView state file you want to use. For the easiest use of ParaView state files, the name of the OpenFAST input file should have the same base name as the file used in the template. -
Open ParaView, click
File -> Load State ...and then select the appropriate.pvsmfile.- ParaView stores state files with absolute paths, so you will need to tell it the directory where the state data files are located. Choose
Search files under specified directoryin theLoad State Optionswindow, and then specify the directory where OpenFAST wrote the.vtpfiles. Typically this is the<OutPath>/vtk/directory.
- ParaView stores state files with absolute paths, so you will need to tell it the directory where the state data files are located. Choose
-
Tips
- Make sure you have a version of ParaView newer than May 2017 so that the
Load State Optionswindow is available. Otherwise you will have to manually set the path for each file ParaView reads. - Note that state files load on top of whatever is open in ParaView, so if you load the state file twice, you will get two copies of all the files.
- If your simulation generates files at more output times than were used in the state file, you can reload the files using
File -> Reload. There should be an option that saysThis reader supports file series. Do you want to look for new files in the series and load those, or reload the existing files?ChooseFind new files. - Most of the VTK data OpenFAST outputs are "Unstructured Grid" datasets.
- Make sure you have a version of ParaView newer than May 2017 so that the
Note: These steps are followed in the Matlab script AnalyzeModeShapes.m contained in this directory.
To visualize mode shapes:
- Run OpenFAST for linearization analysis (
Linearize = true) withWrVTK = 3. Note that if you would like to visualize the orientations, you should also setVTK_fields = trueandVTK_fpsto a value large enough to capture the motion of the mode shapes with the highest natural frequencies.
OpenFAST.exe 5MW_Land_ModeShapes.fst
- Run MBC3 analysis in Matlab. This will write a file named
ModesVizName(a string set by the user). Note that this requires the matlab-toolbox repository:
MBC_data = fx_mbc3( LinFileNames, ModesVizName );
- Run OpenFAST with the visualization input file:
OpenFAST.exe -VTKLin ElastoDyn-Modes.viz
- Run ParaView to view the mode shapes. You can either open the state file ED_Surfaces.pvsm inside ParaView, or
you can use the included Python script to generate
avifiles of the mode shapes. See Creating animations of the mode shapes
To create animations of the mode shapes
- Manually
- Open the mode-shape state file, ED_Surfaces.pvsm, using the instructions from the time-domain section of this document.
- If necessary, select each mesh and reload the files (
File -> Reload FilesorF5), selecting the option to search for new files. - Select
File -> Save Animation.- Type in a name for the animation file, and select the type of file to generate. Press
OK. - In the "Save Animation Options" window that pops up, select
Save all views, and set theFrame Ratethat was used when you generated the vtk files in OpenFAST (check the summary file for the exact value used). PressOK.
- Type in a name for the animation file, and select the type of file to generate. Press
- Using Python with ParaView
- Add ParaView's
bindirectory to your path. For example, on my Windows machine, I type:
- Add ParaView's
set path=C:\Program Files\ParaView 5.7.0-Windows-Python3.7-msvc2015-64bit\bin;%path%
You will need to modify this if you have a different version of ParaView or have installed it in a different directory.
- Open plotModeShapes.py, and edit variables at the top:
mainDirNameis the name of the directory where the mode-shape vtk (.vtp) files are storedfileRootFmtcontains a format specifier for the root name of the.vtpfiles, excluding the mesh name. Use{:d}in place of the mode number.nModesis the number of modes to visualize (starts sequentially from mode 1)fpsis the number of frames per second that the vtk files were generated with (see the FAST summary file for the exact value) Note: The current version of ParaView seems to ignore the frame rate that is specified when saving the animation.StructureModuleis a string indicating the abbreviation of the structural model being used. This should be"ED"when ElastoDyn is used, or"BD"when BeamDyn is used.
- Run ParaView Python:
pvpython plotModeShapes.py
- Download ParaView
- ParaView Online Wiki Note that this also contains a tutorial on ParaView.
- ParaView Python documentation