Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add test cases for Actuator Line in all solvers #251

Merged
merged 1 commit into from
Jan 16, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Add test cases for Actuator Line in all solvers
oscarmarino committed Jan 16, 2025
commit 76137c04b27d42d684e8651498f7c64ad5743c8f
53 changes: 53 additions & 0 deletions .github/workflows/CI_parallel.yml
Original file line number Diff line number Diff line change
@@ -895,6 +895,40 @@ jobs:
# source /opt/intel/oneapi/setvars.sh || true
# mpiexec -n 64 ./horses3d.ns virtualSurfaces_acoustics_pAdaptationRL.control
# if: ('!cancelled()' && matrix.compiler == 'gfortran')
#
# 31) Actuator Line (AL) average formulation
# --------------------------------------------
- name: Build AL_average
working-directory: ./Solver/test/NavierStokes/ActuatorLineAverage/SETUP
run: |
source /opt/intel/oneapi/setvars.sh || true
make MODE=${{matrix.mode}} COMPILER=${{matrix.compiler}} COMM=${{matrix.comm}} ENABLE_THREADS=${{matrix.enable_threads}} WITH_METIS=YES
if: '!cancelled()'

- name: Run AL_average
working-directory: ./Solver/test/NavierStokes/ActuatorLineAverage
run: |
source /opt/intel/oneapi/setvars.sh || true
mpiexec -n 64 ./horses3d.ns Actuator.control
if: '!cancelled()'


#
# 32) Actuator Line (AL) projection formulation
# --------------------------------------------
- name: Build AL_projection
working-directory: ./Solver/test/NavierStokes/ActuatorLineProjection/SETUP
run: |
source /opt/intel/oneapi/setvars.sh || true
make MODE=${{matrix.mode}} COMPILER=${{matrix.compiler}} COMM=${{matrix.comm}} ENABLE_THREADS=${{matrix.enable_threads}} WITH_METIS=YES
if: '!cancelled()'

- name: Run AL_projection
working-directory: ./Solver/test/NavierStokes/ActuatorLineProjection
run: |
source /opt/intel/oneapi/setvars.sh || true
mpiexec -n 64 ./horses3d.ns Actuator.control
if: '!cancelled()'

########################################################################
####### PARTICLES ########
@@ -1037,6 +1071,25 @@ jobs:
mpiexec -n 64 ./horses3d.mu monopole_pAdaptationRL.control
if: '!cancelled()'

#
# 6) Mu AL
# -------------------------------

- name: Build Mu-AL
working-directory: ./Solver/test/Multiphase/ActuatorLineAverage/SETUP
run: |
source /opt/intel/oneapi/setvars.sh || true
make MODE=${{matrix.mode}} COMPILER=${{matrix.compiler}} COMM=${{matrix.comm}} ENABLE_THREADS=${{matrix.enable_threads}} WITH_METIS=YES
if: '!cancelled()'

- name: Run Mu-AL
working-directory: ./Solver/test/Multiphase/ActuatorLineAverage
run: |
source /opt/intel/oneapi/setvars.sh || true
mpiexec -n 64 ./horses3d.mu Actuator.control
if: '!cancelled()'


# ########################################################################
# ####### INCOMPRESSIBLE ########
# ########################################################################
36 changes: 36 additions & 0 deletions .github/workflows/CI_sequential 2.yml
Original file line number Diff line number Diff line change
@@ -750,3 +750,39 @@ jobs:
./horses3d.ns virtualSurfaces_acoustics_pAdaptationRL.control
if: ('!cancelled()' && matrix.compiler == 'gfortran')

#
# 31) Actuator Line (AL) average formulation
# --------------------------------------------

- name: Build AL_average
working-directory: ./Solver/test/NavierStokes/ActuatorLineAverage/SETUP
run: |
source /opt/intel/oneapi/setvars.sh || true
make MODE=${{matrix.mode}} COMPILER=${{matrix.compiler}} COMM=${{matrix.comm}} ENABLE_THREADS=${{matrix.enable_threads}} WITH_MKL=${{matrix.mkl}} WITH_HDF5=${{matrix.hdf5}}
if: '!cancelled()'

- name: Run AL_average
working-directory: ./Solver/test/NavierStokes/ActuatorLineAverage
run: |
source /opt/intel/oneapi/setvars.sh || true
./horses3d.ns Actuator.control
if: '!cancelled()'

#
# 32) Actuator Line (AL) projection formulation
# --------------------------------------------

- name: Build AL_projection
working-directory: ./Solver/test/NavierStokes/ActuatorLineProjection/SETUP
run: |
source /opt/intel/oneapi/setvars.sh || true
make MODE=${{matrix.mode}} COMPILER=${{matrix.compiler}} COMM=${{matrix.comm}} ENABLE_THREADS=${{matrix.enable_threads}} WITH_MKL=${{matrix.mkl}} WITH_HDF5=${{matrix.hdf5}}
if: '!cancelled()'

- name: Run AL_projection
working-directory: ./Solver/test/NavierStokes/ActuatorLineProjection
run: |
source /opt/intel/oneapi/setvars.sh || true
./horses3d.ns Actuator.control
if: '!cancelled()'

54 changes: 45 additions & 9 deletions .github/workflows/CI_sequential 3.yml
Original file line number Diff line number Diff line change
@@ -267,6 +267,41 @@ jobs:
./horses3d.mu RisingBubble.control
if: ('!cancelled()')

#
# 6) Mu AL
# -------------------------------

- name: Build Mu-AL
working-directory: ./Solver/test/Multiphase/ActuatorLineAverage/SETUP
run: |
source /opt/intel/oneapi/setvars.sh || true
make MODE=${{matrix.mode}} COMPILER=${{matrix.compiler}} COMM=${{matrix.comm}} ENABLE_THREADS=${{matrix.enable_threads}} WITH_MKL=${{matrix.mkl}}
if: '!cancelled()'

- name: Run Mu-AL
working-directory: ./Solver/test/Multiphase/ActuatorLineAverage
run: |
source /opt/intel/oneapi/setvars.sh || true
./horses3d.mu Actuator.control
if: '!cancelled()'

#
# 7) Multiphase monopole with acoustics, sponge and Reinforcement Learning p-adaptation
# --------------------------------------------
- name: Build Multiphase_Monopole_pAdaptationRL
working-directory: ./Solver/test/Multiphase/Monopole_pAdaptationRL/SETUP
run: |
source /opt/intel/oneapi/setvars.sh || true
make MODE=${{matrix.mode}} COMPILER=${{matrix.compiler}} COMM=${{matrix.comm}} ENABLE_THREADS=${{matrix.enable_threads}} WITH_MKL=${{matrix.mkl}}
if: '!cancelled()'

- name: Run Multiphase_Monopole_pAdaptationRL
working-directory: ./Solver/test/Multiphase/Monopole_pAdaptationRL
run: |
source /opt/intel/oneapi/setvars.sh || true
./horses3d.mu monopole_pAdaptationRL.control
if: '!cancelled()'

########################################################################
####### INCOMPRESSIBLE ########
########################################################################
@@ -396,19 +431,20 @@ jobs:
./horses3d.ins CylinderVremanRe3900.control
if: '!cancelled()'

#
# 8) Multiphase monopole with acoustics, sponge and Reinforcement Learning p-adaptation
# --------------------------------------------
- name: Build Multiphase_Monopole_pAdaptationRL
working-directory: ./Solver/test/Multiphase/Monopole_pAdaptationRL/SETUP
# 8) INS AL
# -------------------------------

- name: Build iNS-AL
working-directory: ./Solver/test/IncompressibleNS/ActuatorLineAverage/SETUP
run: |
source /opt/intel/oneapi/setvars.sh || true
make MODE=${{matrix.mode}} COMPILER=${{matrix.compiler}} COMM=${{matrix.comm}} ENABLE_THREADS=${{matrix.enable_threads}} WITH_MKL=${{matrix.mkl}}
if: '!cancelled()'

- name: Run Multiphase_Monopole_pAdaptationRL
working-directory: ./Solver/test/Multiphase/Monopole_pAdaptationRL
- name: Run iNS-AL
working-directory: ./Solver/test/IncompressibleNS/ActuatorLineAverage
run: |
source /opt/intel/oneapi/setvars.sh || true
./horses3d.mu monopole_pAdaptationRL.control
if: '!cancelled()'
./horses3d.ins Actuator.control
if: '!cancelled()'

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -101,6 +101,6 @@ The following external routines/libraries can be used with **HORSES3D**, but are
export HDF5_DIR=path_to_hdf5
```

## Documentation



Read the complete documentation [here](https://loganoz.github.io/horses3d/).
4 changes: 4 additions & 0 deletions Solver/configure
Original file line number Diff line number Diff line change
@@ -76,20 +76,24 @@ TEST_CASES="./Euler/BoxAroundCircle \
./NavierStokes/EulerRK3_pAdaptationRL \
./NavierStokes/Cylinder_acoustics_pAdaptationRL \
./NavierStokes/VirtualSurfaces_acoustics_pAdaptationRL \
./NavierStokes/ActuatorLineAverage \
./NavierStokes/ActuatorLineProjection \
./IncompressibleNS/Convergence \
./IncompressibleNS/Kovasznay \
./IncompressibleNS/TaylorGreen \
./IncompressibleNS/LidDrivenCavity \
./IncompressibleNS/RayleighTaylor \
./IncompressibleNS/Cylinder \
./IncompressibleNS/CylinderVreman \
./IncompressibleNS/ActuatorLineAverage \
./CahnHilliard/TJokisaari \
./Multiphase/Convergence \
./Multiphase/EntropyConservingTest \
./Multiphase/RisingBubble \
./Multiphase/RisingBubbleVreman\
./Multiphase/Pipe \
./Multiphase/Monopole_pAdaptationRL \
./Multiphase/ActuatorLineAverage \
./Particles/FreeFall \
./Particles/RadiationHeat \
./Particles/Pouransari \
2 changes: 1 addition & 1 deletion Solver/src/libs/sources/ActuatorLine.f90
Original file line number Diff line number Diff line change
@@ -771,7 +771,7 @@ subroutine ForcesFarm(self, mesh, time)
interp = GaussianInterpolation(self%epsilon_type, mesh % elements(eID) % geom % x(:,i,j,k), self%turbine_t(kk)%blade_t(jj)%point_xyz_loc(ii,:), &
self%turbine_t(kk)%blade_t(jj)%chord(ii), self%gauss_epsil,self%turbine_t(kk)%blade_t(jj)%gauss_epsil_delta(ii))

! minus account action-reaction effect, is the force on the fliud
! minus account action-reaction effect, is the force on the fluid
actuator_source(1) = actuator_source(1) - self%turbine_t(kk)%blade_t(jj)%local_thrust(ii) * interp
actuator_source(2) = actuator_source(2) - (-self%turbine_t(kk)%blade_t(jj)%local_rotor_force(ii)*sin(self%turbine_t(kk)%blade_t(jj)%azimuth_angle) * interp)
actuator_source(3) = actuator_source(3) - self%turbine_t(kk)%blade_t(jj)%local_rotor_force(ii)*cos(self%turbine_t(kk)%blade_t(jj)%azimuth_angle) * interp
72 changes: 72 additions & 0 deletions Solver/test/IncompressibleNS/ActuatorLineAverage/Actuator.control
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
Flow equations = "iNS"
mesh file name = "../../TestMeshes/ActuatorBox.msh"
Polynomial order = 1
Number of time steps = 50
Convergence tolerance = 1.0e-13
Output Interval = 10

cfl = 0.4
dcfl = 0.4
viscosity (pa.s) = 1.831943887d-5
density (kg/m^3) = 1.22145354210477
reference velocity (m/s) = 9.99870964366903
artificial compressibility factor = 1161.661994 ! 1/M0^2

AOA theta = 0.0
AOA phi = 0.0

solution file name = "RESULTS/actuator.hsol"
save gradients with solution = .false.
restart = .false.
restart file name = "RESULTS/actuator.hsol"

autosave mode = "time"
autosave interval = 2.0

! ACTUATOR LINE
use actuatorline = .true.
actuator epsilon type = 2 ! calculate epsilon based on mesh cell size and p
actuator calculate with projection = .false. ! average formulation
actuator average subelement = .false. ! false for p1, better to use true for higher p
actuator save average = .false.
actuator save instant = .false.
actuator tolerance = 0.7 ! high tolerance for finding elements near the rotor for coarse mesh

Riemann solver = Exact

!-- TIME discret--
simulation type = time-accurate
final time = 5.d0

!---TURB---
LES model = Vreman

partitioning = SFC

!------------
! BC
!------------

#define boundary inlet
type = Inflow
#end

#define boundary sideA__sideB
type = FreeSlipWall
#end

#define boundary top__bottom
type = FreeSlipWall
#end

#define boundary outlet
type = Outflow
#end

!------------
! monitors
!------------
#define volume monitor 1
Name = source
Variable = source
#end
Loading