Skip to content

Commit

Permalink
Merge pull request #1759 from deslaughter/ifw-velavg
Browse files Browse the repository at this point in the history
InflowWind Flow Field fails to calculate AvgVel for large wind files when using Intel Compiler
  • Loading branch information
andrew-platt authored Sep 7, 2023
2 parents 1ee714a + 8e7e0b9 commit 60ac229
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 24 deletions.
69 changes: 49 additions & 20 deletions .github/workflows/automated-dev-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,14 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v3
with:
python-version: '3.9'
python-version: '3.11'
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install numpy "Bokeh>=2.4,!=3.0.0,!=3.0.1,!=3.0.2,!=3.0.3"
sudo apt-get update -y
sudo apt-get install -y libopenblas-dev libopenblas-openmp-dev
- name: Setup workspace
run: cmake -E make_directory ${{runner.workspace}}/openfast/build
- name: Configure build
Expand All @@ -58,6 +60,7 @@ jobs:
-DCMAKE_CXX_COMPILER:STRING=${{env.CXX_COMPILER}} \
-DCMAKE_C_COMPILER:STRING=${{env.C_COMPILER}} \
-DPython_ROOT_DIR:STRING=${{env.pythonLocation}} \
-DBLA_VENDOR:STRING=OpenBLAS \
-DCMAKE_BUILD_TYPE:STRING=DEBUG \
-DBUILD_SHARED_LIBS:BOOL=OFF \
-DGENERATE_TYPES=ON \
Expand Down Expand Up @@ -86,6 +89,10 @@ jobs:
uses: actions/checkout@main
with:
submodules: recursive
- name: Install dependencies
run: |
sudo apt-get update -y
sudo apt-get install -y libopenblas-dev
- name: Setup workspace
run: cmake -E make_directory ${{runner.workspace}}/openfast/build
- name: Configure build
Expand All @@ -97,6 +104,7 @@ jobs:
-DCMAKE_CXX_COMPILER:STRING=${{env.CXX_COMPILER}} \
-DCMAKE_C_COMPILER:STRING=${{env.C_COMPILER}} \
-DPython_ROOT_DIR:STRING=${{env.pythonLocation}} \
-DBLA_VENDOR:STRING=OpenBLAS \
-DCMAKE_BUILD_TYPE:STRING=DEBUG \
-DBUILD_SHARED_LIBS:BOOL=OFF \
-DVARIABLE_TRACKING=OFF \
Expand All @@ -119,12 +127,14 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v3
with:
python-version: '3.9'
python-version: '3.11'
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install numpy "Bokeh>=2.4,!=3.0.0,!=3.0.1,!=3.0.2,!=3.0.3"
sudo apt-get update -y
sudo apt-get install -y libopenblas-dev libopenblas-openmp-dev
- name: Setup workspace
run: cmake -E make_directory ${{runner.workspace}}/openfast/build
- name: Configure build
Expand All @@ -136,6 +146,7 @@ jobs:
-DCMAKE_CXX_COMPILER:STRING=${{env.CXX_COMPILER}} \
-DCMAKE_C_COMPILER:STRING=${{env.C_COMPILER}} \
-DPython_ROOT_DIR:STRING=${{env.pythonLocation}} \
-DBLA_VENDOR:STRING=OpenBLAS \
-DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo \
-DVARIABLE_TRACKING=OFF \
-DBUILD_TESTING:BOOL=ON \
Expand All @@ -162,13 +173,14 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v3
with:
python-version: '3.9'
python-version: '3.11'
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install numpy "Bokeh>=2.4,!=3.0.0,!=3.0.1,!=3.0.2,!=3.0.3"
sudo apt-get update -y
sudo apt-get install -y libopenblas-dev libopenblas-openmp-dev
sudo apt-get install -y libhdf5-dev libopenmpi-dev libyaml-cpp-dev # gcovr
- name: Setup workspace
run: cmake -E make_directory ${{runner.workspace}}/openfast/build
Expand All @@ -181,6 +193,7 @@ jobs:
-DCMAKE_CXX_COMPILER:STRING=${{env.CXX_COMPILER}} \
-DCMAKE_C_COMPILER:STRING=${{env.C_COMPILER}} \
-DPython_ROOT_DIR:STRING=${{env.pythonLocation}} \
-DBLA_VENDOR:STRING=OpenBLAS \
-DCMAKE_BUILD_TYPE:STRING=RELWITHDEBINFO \
-DOPENMP:BOOL=ON \
-DDOUBLE_PRECISION=ON \
Expand Down Expand Up @@ -213,13 +226,14 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v3
with:
python-version: '3.9'
python-version: '3.11'
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install numpy "Bokeh>=2.4,!=3.0.0,!=3.0.1,!=3.0.2,!=3.0.3"
sudo apt-get update -y
sudo apt-get install -y libopenblas-dev libopenblas-openmp-dev
sudo apt-get install -y libhdf5-dev libopenmpi-dev libyaml-cpp-dev
- name: Configure build
working-directory: ${{runner.workspace}}/openfast/build
Expand Down Expand Up @@ -250,13 +264,14 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v3
with:
python-version: '3.9'
python-version: '3.11'
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install numpy "Bokeh>=2.4,!=3.0.0,!=3.0.1,!=3.0.2,!=3.0.3"
sudo apt-get update -y
sudo apt-get install -y libopenblas-dev libopenblas-openmp-dev
sudo apt-get install -y libhdf5-dev libopenmpi-dev libyaml-cpp-dev
- name: Configure build
working-directory: ${{runner.workspace}}/openfast/build
Expand Down Expand Up @@ -287,13 +302,14 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v3
with:
python-version: '3.9'
python-version: '3.11'
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install numpy "Bokeh>=2.4,!=3.0.0,!=3.0.1,!=3.0.2,!=3.0.3"
sudo apt-get update -y
sudo apt-get install -y libopenblas-dev libopenblas-openmp-dev
sudo apt-get install -y libhdf5-dev libopenmpi-dev libyaml-cpp-dev
- name: Configure build
working-directory: ${{runner.workspace}}/openfast/build
Expand Down Expand Up @@ -326,12 +342,14 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v3
with:
python-version: '3.9'
python-version: '3.11'
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install numpy "Bokeh>=2.4,!=3.0.0,!=3.0.1,!=3.0.2,!=3.0.3"
sudo apt-get update -y
sudo apt-get install -y libopenblas-dev
- name: Setup workspace
run: cmake -E make_directory ${{runner.workspace}}/openfast/build
- name: Configure build
Expand Down Expand Up @@ -386,13 +404,14 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v3
with:
python-version: '3.9'
python-version: '3.11'
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install numpy "Bokeh>=2.4,!=3.0.0,!=3.0.1,!=3.0.2,!=3.0.3"
sudo apt-get update -y
sudo apt-get install -y libopenblas-dev libopenblas-openmp-dev
sudo apt-get install -y libhdf5-dev libopenmpi-dev libyaml-cpp-dev
- name: Configure Tests
working-directory: ${{runner.workspace}}/openfast/build
Expand Down Expand Up @@ -441,13 +460,14 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v3
with:
python-version: '3.9'
python-version: '3.11'
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install numpy "Bokeh>=2.4,!=3.0.0,!=3.0.1,!=3.0.2,!=3.0.3"
sudo apt-get update -y
sudo apt-get install -y libopenblas-dev libopenblas-openmp-dev
sudo apt-get install -y libhdf5-dev libopenmpi-dev libyaml-cpp-dev
- name: Configure Tests
working-directory: ${{runner.workspace}}/openfast/build
Expand Down Expand Up @@ -499,13 +519,14 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v3
with:
python-version: '3.9'
python-version: '3.11'
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install numpy "Bokeh>=2.4,!=3.0.0,!=3.0.1,!=3.0.2,!=3.0.3" vtk
sudo apt-get update -y
sudo apt-get install -y libopenblas-dev libopenblas-openmp-dev
sudo apt-get install -y libhdf5-dev libopenmpi-dev libyaml-cpp-dev
- name: Configure Tests
working-directory: ${{runner.workspace}}/openfast/build
Expand Down Expand Up @@ -546,13 +567,14 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v3
with:
python-version: '3.9'
python-version: '3.11'
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install numpy "Bokeh>=2.4,!=3.0.0,!=3.0.1,!=3.0.2,!=3.0.3"
sudo apt-get update -y
sudo apt-get install -y libopenblas-dev libopenblas-openmp-dev
sudo apt-get install -y libhdf5-dev libopenmpi-dev libyaml-cpp-dev
- name: Configure Tests
working-directory: ${{runner.workspace}}/openfast/build
Expand All @@ -566,7 +588,7 @@ jobs:
- name: Run 5MW tests
working-directory: ${{runner.workspace}}/openfast/build
run: |
ctest -VV -j8 \
ctest -VV -j4 \
-L openfast \
-LE "cpp|linear|python|fastlib" \
-E "5MW_OC4Semi_WSt_WavesWN|5MW_OC3Mnpl_DLL_WTurb_WavesIrr|5MW_OC4Jckt_DLL_WTurb_WavesIrr_MGrowth|5MW_OC3Trpd_DLL_WSt_WavesReg|5MW_Land_BD_DLL_WTurb"
Expand Down Expand Up @@ -598,13 +620,14 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v3
with:
python-version: '3.9'
python-version: '3.11'
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install numpy "Bokeh>=2.4,!=3.0.0,!=3.0.1,!=3.0.2,!=3.0.3"
sudo apt-get update -y
sudo apt-get install -y libopenblas-dev libopenblas-openmp-dev
sudo apt-get install -y libhdf5-dev libopenmpi-dev libyaml-cpp-dev
- name: Configure Tests
working-directory: ${{runner.workspace}}/openfast/build
Expand Down Expand Up @@ -647,13 +670,14 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v3
with:
python-version: '3.9'
python-version: '3.11'
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install numpy "Bokeh>=2.4,!=3.0.0,!=3.0.1,!=3.0.2,!=3.0.3"
sudo apt-get update -y
sudo apt-get install -y libopenblas-dev libopenblas-openmp-dev
sudo apt-get install -y libhdf5-dev libopenmpi-dev libyaml-cpp-dev
- name: Configure Tests
working-directory: ${{runner.workspace}}/openfast/build
Expand Down Expand Up @@ -696,13 +720,14 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v3
with:
python-version: '3.9'
python-version: '3.11'
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install numpy "Bokeh>=2.4,!=3.0.0,!=3.0.1,!=3.0.2,!=3.0.3"
sudo apt-get update -y
sudo apt-get install -y libopenblas-dev libopenblas-openmp-dev
sudo apt-get install -y libhdf5-dev libopenmpi-dev libyaml-cpp-dev
- name: Configure Tests
working-directory: ${{runner.workspace}}/openfast/build
Expand Down Expand Up @@ -745,13 +770,14 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v3
with:
python-version: '3.9'
python-version: '3.11'
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install numpy "Bokeh>=2.4,!=3.0.0,!=3.0.1,!=3.0.2,!=3.0.3"
sudo apt-get update -y
sudo apt-get install -y libopenblas-dev libopenblas-openmp-dev
sudo apt-get install -y libhdf5-dev libopenmpi-dev libyaml-cpp-dev
- name: Configure Tests
working-directory: ${{runner.workspace}}/openfast/build
Expand Down Expand Up @@ -794,13 +820,14 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v3
with:
python-version: '3.9'
python-version: '3.11'
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install numpy "Bokeh>=2.4,!=3.0.0,!=3.0.1,!=3.0.2,!=3.0.3"
sudo apt-get update -y
sudo apt-get install -y libopenblas-dev libopenblas-openmp-dev
sudo apt-get install -y libhdf5-dev libopenmpi-dev libyaml-cpp-dev
- name: Configure Tests
working-directory: ${{runner.workspace}}/openfast/build
Expand Down Expand Up @@ -843,13 +870,14 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v3
with:
python-version: '3.9'
python-version: '3.11'
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install numpy "Bokeh>=2.4,!=3.0.0,!=3.0.1,!=3.0.2,!=3.0.3"
sudo apt-get update -y
sudo apt-get install -y libopenblas-dev libopenblas-openmp-dev
sudo apt-get install -y libhdf5-dev libopenmpi-dev libyaml-cpp-dev
- name: Configure Tests
working-directory: ${{runner.workspace}}/openfast/build
Expand All @@ -863,7 +891,7 @@ jobs:
- name: Run OpenFAST linearization tests
working-directory: ${{runner.workspace}}/openfast/build
run: |
ctest -VV -j8 -L linear
ctest -VV -j4 -L linear
- name: Failing test artifacts
uses: actions/upload-artifact@v3
if: failure()
Expand Down Expand Up @@ -892,13 +920,14 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v3
with:
python-version: '3.9'
python-version: '3.11'
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install numpy "Bokeh>=2.4,!=3.0.0,!=3.0.1,!=3.0.2,!=3.0.3"
sudo apt-get update -y
sudo apt-get install -y libopenblas-dev libopenblas-openmp-dev
sudo apt-get install -y libhdf5-dev libopenmpi-dev libyaml-cpp-dev
- name: Configure Tests
working-directory: ${{runner.workspace}}/openfast/build
Expand Down
19 changes: 16 additions & 3 deletions modules/inflowwind/src/IfW_FlowField.f90
Original file line number Diff line number Diff line change
Expand Up @@ -1522,6 +1522,7 @@ subroutine IfW_Grid3DField_CalcVelAvgProfile(G3D, CalcAccel, ErrStat, ErrMsg)
character(*), parameter :: RoutineName = 'IfW_Grid3DField_CalcVelAvgProfile'
integer(IntKi) :: ErrStat2
character(ErrMsgLen) :: ErrMsg2
integer(IntKi) :: it, iz, ic

ErrStat = ErrID_None
ErrMsg = ""
Expand All @@ -1536,7 +1537,13 @@ subroutine IfW_Grid3DField_CalcVelAvgProfile(G3D, CalcAccel, ErrStat, ErrMsg)
end if

! Calculate average velocity for each component across grid (Y)
G3D%VelAvg = sum(G3D%Vel, dim=2)/G3D%NYGrids
do it = 1, G3D%NSteps
do iz = 1, G3D%NZGrids
do ic = 1, G3D%NComp
G3D%VelAvg(ic,iz,it) = sum(G3D%Vel(ic,:,iz,it))/real(G3D%NYGrids, SiKi)
end do
end do
end do

! If acceleration calculation not requested, return
if (.not. CalcAccel) return
Expand All @@ -1549,9 +1556,15 @@ subroutine IfW_Grid3DField_CalcVelAvgProfile(G3D, CalcAccel, ErrStat, ErrMsg)
if (ErrStat >= AbortErrLev) return
G3D%AccAvg = 0.0_SiKi
end if

! Calculate average acceleration for each component across grid (Y)
G3D%AccAvg = sum(G3D%Acc, dim=2)/G3D%NYGrids
do it = 1, G3D%NSteps
do iz = 1, G3D%NZGrids
do ic = 1, G3D%NComp
G3D%AccAvg(ic,iz,it) = sum(G3D%Acc(ic,:,iz,it))/real(G3D%NYGrids, SiKi)
end do
end do
end do

end subroutine

Expand Down
2 changes: 1 addition & 1 deletion reg_tests/CTestList.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ of_regression_py("EllipticalWing_OLAF_py" "openfast;fastlib;p
of_regression_aeroacoustic("IEA_LB_RWT-AeroAcoustics" "openfast;aerodyn15;aeroacoustics")

# Linearized OpenFAST regression tests
of_regression_linear("Fake5MW_AeroLin_B1_UA4_DBEMT3" "openfast;linear;elastodyn") #Also: aerodyn
# of_regression_linear("Fake5MW_AeroLin_B1_UA4_DBEMT3" "openfast;linear;elastodyn") #Also: aerodyn
of_regression_linear("Fake5MW_AeroLin_B3_UA6" "openfast;linear;elastodyn") #Also: aerodyn
of_regression_linear("WP_Stationary_Linear" "openfast;linear;elastodyn")
of_regression_linear("Ideal_Beam_Fixed_Free_Linear" "openfast;linear;beamdyn")
Expand Down

0 comments on commit 60ac229

Please sign in to comment.