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

Implementing Waves Effect on Currents, WEC #15

Open
wants to merge 23 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
a18d6dd
Merging latest develop into feature/wec
hga007 Aug 28, 2023
deae16a
Merging latest develop into feature/wec
hga007 Aug 29, 2023
d2be430
Merging latest develop into feature/wec
hga007 Aug 31, 2023
6c5fe4e
Merging latest develop into feature/wec
hga007 Aug 31, 2023
5e25c48
Merging latest develop into feature/wec
hga007 Aug 31, 2023
77cf406
Merging latest develop into feature/wec
hga007 Sep 1, 2023
29ea880
Merging latest develop into feature/wec
hga007 Sep 4, 2023
367a37e
Merging latest develop into feature/wec
hga007 Sep 25, 2023
285fad7
Merging latest develop into feature/wec
hga007 Oct 27, 2023
b7c2c97
Merging latest develop into feature/wec
hga007 Dec 1, 2023
09623d9
Merging latest develop into feature/wec
hga007 Jan 4, 2024
514cca1
Merging latest develop into feature/wec
hga007 Jan 29, 2024
f9a8d24
Merging latest develop into feature/wec
hga007 Jan 30, 2024
50cf925
Merging latest develop into feature/wec
hga007 Feb 24, 2024
bd6b9a4
Merging latest develop into feature/wec
hga007 Feb 25, 2024
ab22368
Merging latest develop into feature/wec
hga007 Jul 10, 2024
89f4172
Merging latest develop into feature/wec
hga007 Jul 10, 2024
ca3bbb4
Merging latest develop into feature/wec
hga007 Jul 13, 2024
7268fab
Merging latest develop into feature/wec
hga007 Jul 24, 2024
19f5bec
Merging latest develop into feature/wec
hga007 Aug 9, 2024
3b51859
Merging latest develop into feature/wec
hga007 Aug 10, 2024
5741944
Merging latest develop into feature/wec
hga007 Oct 3, 2024
e608e12
Merging latest develop into feature/wec
hga007 Nov 17, 2024
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
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ add_subdirectory( "ROMS/Nonlinear" )
add_subdirectory( "ROMS/Nonlinear/BBL" )
add_subdirectory( "ROMS/Nonlinear/Biology" )
add_subdirectory( "ROMS/Nonlinear/Sediment" )
add_subdirectory( "ROMS/Nonlinear/WEC" )
add_subdirectory( "ROMS/Utility" )

include_directories(
Expand All @@ -175,6 +176,7 @@ include_directories(
"ROMS/Nonlinear/BBL"
"ROMS/Nonlinear/Biology"
"ROMS/Nonlinear/Sediment"
"ROMS/Nonlinear/WEC"
"ROMS/Utility"
)

Expand All @@ -193,6 +195,7 @@ list(APPEND srcs
${ROMS_Nonlinear_BBL_files}
${ROMS_Nonlinear_Biology_files}
${ROMS_Nonlinear_Sediment_files}
${ROMS_Nonlinear_WEC_files}
${ROMS_Utility_files}
)

Expand Down
28 changes: 28 additions & 0 deletions ROMS/Nonlinear/WEC/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# git $Id$
#:::::::::::::::::::::::::::::::::::::::::::::::::::::: David Robertson :::
# Copyright (c) 2002-2024 The ROMS/TOMS Group :::
# Licensed under a MIT/X style license :::
# See License_ROMS.md :::
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
#
# Source code list for sub-directory "ROMS/Nonlinear/WEC"

list( APPEND _files
ROMS/Nonlinear/Wec/wec_dissip.F
ROMS/Nonlinear/Wec/wec_output.F
ROMS/Nonlinear/Wec/wec_roller.F
ROMS/Nonlinear/Wec/wec_stokes.F
ROMS/Nonlinear/Wec/wec_streaming.F
ROMS/Nonlinear/Wec/wec_u2dbc_im.F
ROMS/Nonlinear/Wec/wec_u3dbc_im.F
ROMS/Nonlinear/Wec/wec_v2dbc_im.F
ROMS/Nonlinear/Wec/wec_v3dbc_im.F
ROMS/Nonlinear/Wec/wec_vf.F
ROMS/Nonlinear/Wec/wec_wave_mix.F
ROMS/Nonlinear/Wec/wec_wvelocity.F
)

set ( ROMS_Nonlinear_Wec_files
${_files}
PARENT_SCOPE
)
15 changes: 15 additions & 0 deletions ROMS/Nonlinear/WEC/Module.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#
# git $Id$
#::::::::::::::::::::::::::::::::::::::::::::::::::::: Hernan G. Arango :::
# Copyright (c) 2002-2024 The ROMS/TOMS Group Kate Hedstrom :::
# Licensed under a MIT/X style license :::
# See License_ROMS.md :::
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

local_sub := ROMS/Nonlinear/WEC

local_src := $(wildcard $(local_sub)/*.F)

sources += $(local_src)

$(eval $(compile-rules))
188 changes: 188 additions & 0 deletions ROMS/Nonlinear/WEC/wec_dissip.F
Original file line number Diff line number Diff line change
@@ -0,0 +1,188 @@
#include "cppdefs.h"
MODULE wec_dissip_mod

#if defined SOLVE3D && (defined WDISS_THORGUZA || \
defined WDISS_CHURTHOR)
!
!git $Id$
!=======================================================================
! Copyright (c) 2002-2024 The ROMS/TOMS Group !
! Licensed under a MIT/X style license Hernan G. Arango !
! See License_ROMS.md Nirnimesh Kumar !
!================================================== John C. Warner ====!
! !
! This routine computes wave dissipation due to breaking and !
! whitecapping using selected formulations. !
! !
! momentum equations. !
! !
! References: !
! !
! Thornton, E. B., and R. T. Guza, Surf zone longshore currents and !
! random waves: field data and models, J. Phys. Oceanogr., !
! 16,1165-1178, 1986. !
! !
! Church, J. C., and E. B. Thornton, Effects of breaking wave induced !
! turbulence within a longshore current model, Coastal Eng., 20, !
! 128, 1993. !
! !
!=======================================================================
!
USE mod_param
# if defined DIAGNOSTICS_UV
USE mod_diags
# endif
USE mod_forces
USE mod_grid
USE mod_ocean

USE mod_scalars
USE exchange_2d_mod
!
USE bc_2d_mod, ONLY : bc_r2d_tile
# ifdef DISTRIBUTE
USE mp_exchange_mod, ONLY : mp_exchange2d
# endif
!
implicit none
!
PRIVATE
PUBLIC :: wec_dissip
!
CONTAINS
!
!***********************************************************************
SUBROUTINE wec_dissip (ng, tile)
!***********************************************************************
!
integer, intent(in) :: ng, tile
!
! Local variable declarations.
!
character (len=*), parameter :: MyFile = &
& __FILE__
!
# include "tile.h"
!
# ifdef PROFILE
CALL wclock_on (ng, iNLM, 42, __LINE__, MyFile)
# endif
CALL wec_dissip_tile (ng, tile, LBi, UBi, LBj, UBj, N(ng), &
& IminS, ImaxS, JminS, JmaxS, &
& GRID(ng) % h, &
& OCEAN(ng) % zeta, &
& FORCES(ng) % Hwave, &
& FORCES(ng) % Pwave_top, &
& FORCES(ng) % Dissip_break, &
& FORCES(ng) % Dissip_wcap)
# ifdef PROFILE
CALL wclock_off (ng, iNLM, 42, __LINE__, MyFile)
# endif
!
RETURN
END SUBROUTINE wec_dissip
!
!***********************************************************************
SUBROUTINE wec_dissip_tile (ng, tile, LBi, UBi, LBj, UBj, UBk, &
& IminS, ImaxS, JminS, JmaxS, &
& h, zeta, &
& Hwave, Pwave_top, &
& Dissip_break, Dissip_wcap)
!***********************************************************************
!
! Imported variable declarations.
!
integer, intent(in) :: ng, tile
integer, intent(in) :: LBi, UBi, LBj, UBj, UBk
integer, intent(in) :: IminS, ImaxS, JminS, JmaxS
# ifdef ASSUMED_SHAPE
real(r8), intent(in) :: h(LBi:,LBj:)
real(r8), intent(in) :: zeta(LBi:,LBj:,:)
real(r8), intent(in) :: Hwave(LBi:,LBj:)
real(r8), intent(in) :: Pwave_top(LBi:,LBj:)
real(r8), intent(inout) :: Dissip_break(LBi:,LBj:)
real(r8), intent(inout) :: Dissip_wcap(LBi:,LBj:)
# else
real(r8), intent(in) :: h(LBi:UBi,LBj:UBj)
real(r8), intent(in) :: zeta(LBi:UBi,LBj:UBj,3)
real(r8), intent(in) :: Pwave_top(LBi:UBi,LBj:UBj)
real(r8), intent(inout) :: Dissip_break(LBi:UBi,LBj:UBj)
real(r8), intent(inout) :: Dissip_wcap(LBi:UBi,LBj:UBj)
# endif
!
! Local variable declarations.
!
integer :: i, j
real(r8) :: cff1, cff2
real(r8) :: fac1, sigmat, Dstp
# if defined WDISS_CHURTHOR
real(r8) :: RB1, RB2
# endif
real(r8), parameter :: gammaw=0.31_r8
real(r8), parameter :: eps = 1.0E-14_r8

# include "set_bounds.h"
!
!-----------------------------------------------------------------------
! Calculate wave dissipation due to breaking and whitecapping.
!-----------------------------------------------------------------------
!
fac1=3.0_r8*g*SQRT(pi)/16.0_r8
DO j=Jstr,Jend
DO i=Istr,Iend
!
! Compute total depth
!
Dstp=zeta(i,j,1)+h(i,j)
cff1=0.707_r8*Hwave(i,j)
sigmat=MIN(1.0_r8/(Pwave_top(i,j)+eps),1.0_r8)
!
# ifdef WDISS_THORGUZA
!
! Calcualate wave dissipation using empirical parameters of
! Thornton and Guza, 1986
!
cff2=1.0_r8/((gammaw**4.0_r8)*(Dstp**5.0_r8))
Dissip_break(i,j)=0.2621_r8*fac1*sigmat* &
& (cff1**7.0_r8)*cff2
Dissip_wcap(i,j)=0.0_r8
!
# elif defined WDISS_CHURTHOR
!
! Calculate wave dissipation using empirical parameters of
! Church and Thornton, 1993.
!
cff2=1.0_r8/(gammaw*Dstp)
RB1=1.0_r8+TANH(8.0_r8*((cff1*cff2)-1.0_r8))
RB2=1.0_r8-(1.0_r8+(cff1*cff2)**2.0_r8)**(-2.5_r8)
Dissip_break(i,j)=(0.2621_r8/Dstp)*fac1*sigmat* &
& (cff1**3.0_r8)*RB1*RB2
Dissip_wcap(i,j)=0.0_r8
# endif
END DO
END DO

# if defined WDISS_THORGUZA || defined WDISS_CHURTHOR
!
! Apply boundary conditions.
!
CALL bc_r2d_tile (ng, tile, &
& LBi, UBi, LBj, UBj, &
& Dissip_break)
CALL bc_r2d_tile (ng, tile, &
& LBi, UBi, LBj, UBj, &
& Dissip_wcap)
# endif
# ifdef DISTRIBUTE
!
CALL mp_exchange2d (ng, tile, iNLM, 2, &
& LBi, UBi, LBj, UBj, &
& NghostPoints, &
& EWperiodic(ng), NSperiodic(ng), &
& Dissip_break, Dissip_wcap)
# endif
!
RETURN
END SUBROUTINE wec_dissip_tile
#endif
END MODULE wec_dissip_mod
Loading