Skip to content
Merged
Show file tree
Hide file tree
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
17 changes: 17 additions & 0 deletions .github/workflows/CI_parallel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -930,6 +930,23 @@ jobs:
mpiexec -n 64 ./horses3d.ns Actuator.control
if: '!cancelled()'

#
# 33) Cylinder with Adaptive Time Step and Reinforcement Learning p-adaptation
# --------------------------------------------
- name: Build Cylinder_AdaptiveTimeStep_pAdaptationRL
working-directory: ./Solver/test/NavierStokes/Cylinder_AdaptiveTimeStep_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_METIS=YES
if: '!cancelled()'

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

########################################################################
####### PARTICLES ########
########################################################################
Expand Down
18 changes: 18 additions & 0 deletions .github/workflows/CI_sequential 2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -786,3 +786,21 @@ jobs:
./horses3d.ns Actuator.control
if: '!cancelled()'

#
# 33) Cylinder with Adaptive Time Step and Reinforcement Learning p-adaptation
# --------------------------------------------

- name: Build Cylinder_AdaptiveTimeStep_pAdaptationRL
working-directory: ./Solver/test/NavierStokes/Cylinder_AdaptiveTimeStep_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}} WITH_HDF5=${{matrix.hdf5}}
if: '!cancelled()'

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

1 change: 1 addition & 0 deletions Solver/configure
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ TEST_CASES="./Euler/BoxAroundCircle \
./NavierStokes/VirtualSurfaces_acoustics_pAdaptationRL \
./NavierStokes/ActuatorLineInterpolation \
./NavierStokes/ActuatorLineProjection \
./NavierStokes/Cylinder_AdaptiveTimeStep_pAdaptationRL \
./IncompressibleNS/Convergence \
./IncompressibleNS/Kovasznay \
./IncompressibleNS/TaylorGreen \
Expand Down
7 changes: 7 additions & 0 deletions Solver/src/libs/mesh/HexMesh.f90
Original file line number Diff line number Diff line change
Expand Up @@ -5677,5 +5677,12 @@ subroutine HexMesh_DefineAcousticElements(self, observer, acoustic_sources, d_th
call acousticElementList % destruct
call aerodynamicElementList % destruct

safedeallocate(x)
safedeallocate(y)
safedeallocate(z)
safedeallocate(total_x)
safedeallocate(total_y)
safedeallocate(total_z)

end subroutine HexMesh_DefineAcousticElements
END MODULE HexMeshClass
34 changes: 32 additions & 2 deletions Solver/src/libs/mesh/StorageClass.f90
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ module StorageClass
real(kind=RP), allocatable :: S_NSP(:,:,:,:) ! NSE Particles source term
real(kind=RP), allocatable :: QbaseSponge(:,:,:,:) ! Base Flow State vector for sponges
real(kind=RP), allocatable :: intensitySponge(:,:,:) ! Intensity for sponges
real(kind=RP), allocatable :: QLowRK(:,:,:,:) ! NSE State vector solved with a lower order RK method (required for adaptive time-stepping)
#ifndef ACOUSTIC
real(kind=RP), allocatable :: mu_NS(:,:,:,:) ! (mu, beta, kappa) artificial
real(kind=RP), allocatable :: mu_turb_NS(:,:,:) ! mu of LES
Expand Down Expand Up @@ -791,6 +792,7 @@ elemental subroutine ElementStorage_Construct(self, Nx, Ny, Nz, computeGradients
!
#ifdef FLOW
allocate ( self % QNS (1:NCONS,0:Nx,0:Ny,0:Nz) )
allocate ( self % QLowRK(1:NCONS,0:Nx,0:Ny,0:Nz) )
allocate (self % QbaseSponge(1:NCONS,0:Nx,0:Ny,0:Nz) )
allocate (self % intensitySponge(0:Nx,0:Ny,0:Nz) )
allocate ( self % QdotNS(1:NCONS,0:Nx,0:Ny,0:Nz) )
Expand Down Expand Up @@ -877,6 +879,7 @@ elemental subroutine ElementStorage_Construct(self, Nx, Ny, Nz, computeGradients
self % S_NS = 0.0_RP
self % S_NSP = 0.0_RP
self % QNS = 0.0_RP
self % QLowRK = 0.0_RP
self % QbaseSponge = 0.0_RP
self % intensitySponge = 0.0_RP
self % QDotNS = 0.0_RP
Expand Down Expand Up @@ -980,6 +983,7 @@ elemental subroutine ElementStorage_Assign(to, from)

#ifdef FLOW
to % QNS = from % QNS
to % QLowRK = from % QLowRK
to % QbaseSponge = from % QbaseSponge
to % intensitySponge = from % intensitySponge

Expand Down Expand Up @@ -1076,6 +1080,7 @@ elemental subroutine ElementStorage_Destruct(self)
safedeallocate(self % QDotNS)
safedeallocate(self % QbaseSponge)
safedeallocate(self % intensitySponge)
safedeallocate(self % QLowRK)

if ( allocated(self % PrevQ) ) then
num_prevSol = size(self % PrevQ)
Expand Down Expand Up @@ -1109,6 +1114,9 @@ elemental subroutine ElementStorage_Destruct(self)
!if (self % anJacobian) then ! Not needed since there's only one variable (= one if)
safedeallocate(self % dF_dgradQ)
!end if

! Destruct statistics
call self % stats % destruct()
#endif

#ifdef CAHNHILLIARD
Expand Down Expand Up @@ -1139,6 +1147,18 @@ elemental subroutine ElementStorage_Destruct(self)

safedeallocate(self % PrevQ)

! Deallocate RKSteps
! ------------------
#ifdef MULTIPHASE
if ( allocated(self % RKSteps) ) then
do k = 1, size(self % RKSteps)
safedeallocate(self % RKSteps(k) % K)
safedeallocate(self % RKSteps(k) % hatK)
end do
deallocate(self % RKSteps)
end if
#endif

end subroutine ElementStorage_Destruct
#ifdef FLOW
pure subroutine ElementStorage_SetStorageToNS(self)
Expand Down Expand Up @@ -1271,6 +1291,7 @@ impure elemental subroutine ElementStorage_InterpolateSolution(this,other,nodes,
if (all(this % Nxyz == other % Nxyz)) then
other % Q = this % Q
other % QbaseSponge = this % QbaseSponge
other % QLowRK = this % QLowRK
else
!$omp critical
call NodalStorage(this % Nxyz(1)) % construct(nodes,this % Nxyz(1))
Expand Down Expand Up @@ -1319,6 +1340,15 @@ impure elemental subroutine ElementStorage_InterpolateSolution(this,other,nodes,
this % Q(1:,0:,0:,0:) => this % QbaseSponge
other % Q(1:,0:,0:,0:) => other % QbaseSponge

call Interp3DArrays (Nvars = NCONS , &
Nin = this % Nxyz , &
inArray = this % Q , &
Nout = other % Nxyz , &
outArray = other % Q )

this % Q(1:,0:,0:,0:) => this % QLowRK
other % Q(1:,0:,0:,0:) => other % QLowRK

call Interp3DArrays (Nvars = NCONS , &
Nin = this % Nxyz , &
inArray = this % Q , &
Expand Down Expand Up @@ -1763,9 +1793,9 @@ subroutine Statistics_Construct(self, no_of_variables, N)

end subroutine Statistics_Construct

subroutine Statistics_Destruct(self)
pure subroutine Statistics_Destruct(self)
implicit none
class(Statistics_t) :: self
class(Statistics_t), intent(inout) :: self

safedeallocate( self % data )

Expand Down
Loading
Loading