openfast
openfast copied to clipboard
Small improvements for -VTKLin visualization outputs
This pull request is ready to be merged.
Feature or improvement description This addresses the VTK output features when OpenFAST is being restarted using -VTKLin, to generate VTK files for mode shape visualization. The changes include:
- Screen outputs when modes are being processed
- Creating VTK directory on restart (if user deleted)
- Allowing default surface outputs when AeroDyn is not used.
Additional supporting information I have been using our mode shape visualization features lately and felt like some small changes could help the process.
Thanks, @ebranlard. I agree that these upgrades would be useful. These improvements will pair nicely with the automation of Campbell diagram generation that we have plans to develop next year.
Regarding your questions:
- I agree that it would be good to have default blade visualization when AeroDyn v15 is not enabled. Perhaps a simple rectangular cross section with the chordlength scaled from the blade length.
- I agree that adding an option to overwrite
VTK_fps
in the OpenFAST mode-shape visualization input file would be a good addition. Having the same number of steps per mode shape whenVTKLinTim
= 2 makes sense (which is equivalent to using a higherVTK_fps
for high-frequency modes).
I've changed the code such that:
- the number of outputs are the same for all modes when
VTKLinTim=2
(so far I've used VTK_FPS as a parameter for the number of outputs, but I will add that as an input to the VIZ file). - ElastoDyn and BeamDyn use a rectangular cross section when AD is not present.
I think we might need to work on the scaling of the modes on the matlab side. The beamdyn modes at high frequencies have low deflections compared to the ones at low frequencies. Interestingly, when I increase VTKLinScale
too much, I received the following error:
FAST_RestoreForVTKModeShape_Tary:FAST_RestoreForVTKModeShape_T:CalcOutputs_And_SolveForInputs:SolveOption1:FullOpt1_InputOutputSolve:LAPACK_SGETRF: U( 11, 11)=0. Factor U is exactly singular.
I'm a little puzzled why two of the python regression tests now fail. This PR should have no effect on them.
33 - 5MW_ITIBarge_DLL_WTurb_WavesIrr_py (Failed)
34 - 5MW_TLP_DLL_WTurb_WavesIrr_WavesMulti_py (Failed)
I'm a little puzzled why two of the python regression tests now fail. This PR should have no effect on them.
33 - 5MW_ITIBarge_DLL_WTurb_WavesIrr_py (Failed) 34 - 5MW_TLP_DLL_WTurb_WavesIrr_WavesMulti_py (Failed)
From the error message, it looks like they fail due to trying to copy the same AWT27 directories in parallel. They didn't make it to the part of the script that actually runs the cases:
-- Using gold standard files with machine-compiler type linux-gnu
33: Traceback (most recent call last):
33: File "/home/runner/work/openfast/openfast/reg_tests/executePythonRegressionCase.py", line 127, in <module>
33: shutil.copytree(os.path.join(moduleDirectory, data), dataDir)
33: File "/opt/hostedtoolcache/Python/3.9.13/x64/lib/python3.9/shutil.py", line 568, in copytree
33: return _copytree(entries=entries, src=src, dst=dst, symlinks=symlinks,
33: File "/opt/hostedtoolcache/Python/3.9.13/x64/lib/python3.9/shutil.py", line 467, in _copytree
33: os.makedirs(dst, exist_ok=dirs_exist_ok)
33: File "/opt/hostedtoolcache/Python/3.9.13/x64/lib/python3.9/os.py", line 225, in makedirs
33: mkdir(name, mode)
33: FileExistsError: [Errno 17] File exists: '/home/runner/work/openfast/openfast/build/reg_tests/glue-codes/python/AWT27'
34: -- Using gold standard files with machine-compiler type linux-gnu
34: Traceback (most recent call last):
34: File "/home/runner/work/openfast/openfast/reg_tests/executePythonRegressionCase.py", line 127, in <module>
34: shutil.copytree(os.path.join(moduleDirectory, data), dataDir)
34: File "/opt/hostedtoolcache/Python/3.9.13/x64/lib/python3.9/shutil.py", line 568, in copytree
34: return _copytree(entries=entries, src=src, dst=dst, symlinks=symlinks,
34: File "/opt/hostedtoolcache/Python/3.9.13/x64/lib/python3.9/shutil.py", line 467, in _copytree
34: os.makedirs(dst, exist_ok=dirs_exist_ok)
34: File "/opt/hostedtoolcache/Python/3.9.13/x64/lib/python3.9/os.py", line 225, in makedirs
34: mkdir(name, mode)
34: FileExistsError: [Errno 17] File exists: '/home/runner/work/openfast/openfast/build/reg_tests/glue-codes/python/AWT27'
Maybe there is a vtk
folder already present somewhere.
Instead of using shutil.copyTree
, I would use the function rtl.copyTree
that I added to the rtestlib.py, I think it should be more robust if file already exists.
I noticed the rtl.copyTree
some time ago -- it's a good addition. A few of the execute*
scripts were updated to use it, but not all. We can either update that here, or perhaps it would be better to do a quick PR to update these and a few other minor issues (a couple of _py
cases are failing, but their regular OpenFAST versions were temporarily disabled for stability reasons).
I think you’ll always have a race condition when copying these files from running tests concurrently. Using rtl.copyTree makes it less likely to occur because it checks the existence of each file instead of the entire directory. However, another test can still begin writing a file in between the existence check and the call to copy. I think it would be better to copy these shared directories with the build system instead of the python scripts.
On Wed, Aug 31, 2022 at 10:43 AM Andy Platt @.***> wrote:
I noticed the rtl.copyTree some time ago -- it's a good addition. A few of the execute* scripts were updated to use it, but not all. We can either update that here, or perhaps it would be better to do a quick PR to update these and a few other minor issues (a couple of _py cases are failing, but their regular OpenFAST versions were temporarily disabled for stability reasons).
— Reply to this email directly, view it on GitHub https://github.com/OpenFAST/openfast/pull/1199#issuecomment-1233175715, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABCSATOP25VPJNNKGCMJL73V36DR7ANCNFSM5433PXAA . You are receiving this because you are subscribed to this thread.Message ID: @.***>
I agree. I've run into errors due to this race condition several times already. We could also copy all the files in a separate script that runs serially, prior to running any of the test cases. Would be a nice option for those of us that use the manual python scripts.
A manual python script could be incorporated into CMake. That should work for both cases.
On Wed, Aug 31, 2022 at 11:23 AM Bonnie Jonkman @.***> wrote:
I agree. I've run into errors due to this race condition several times already. We could also copy all the files in a separate script that runs serially, prior to running any of the test cases. Would be a nice option for those of us that use the manual python scripts.
— Reply to this email directly, view it on GitHub https://github.com/OpenFAST/openfast/pull/1199#issuecomment-1233215573, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABCSATN44G3RV2MXBVU36X3V36IKTANCNFSM5433PXAA . You are receiving this because you commented.Message ID: @.***>
The change to use rtl.copyTree
is in PR #1244. That provides a partial solution to the race condition. I'll rerun checks after that is merged.
Minor error handling update with suggestion from @deslaughter.