Manning-Strickler for 2d bottom friction

General scientific issues regarding ROMS

Moderators: arango, robertson

Post Reply
Message
Author
stef
Posts: 192
Joined: Tue Mar 13, 2007 6:38 pm
Location: Independent researcher
Contact:

Manning-Strickler for 2d bottom friction

#1 Unread post by stef »

I'm comparing 2d vs 3d tide simulations with ROMS, and many studies with 2d tide models use a Manning-Strickler formula. If I wanted to use a Manning-Strickler type formulation for bottom friction into ROMS in a quick-and-dirty fashion, would I insert something like

Code: Select all

          cff1=0.25_r8*(vbar(i  ,j  ,krhs)+                             &
     &                  vbar(i  ,j+1,krhs)+                             &
     &                  vbar(i-1,j  ,krhs)+                             &
     &                  vbar(i-1,j+1,krhs))
          cff2=SQRT(ubar(i,j,krhs)*ubar(i,j,krhs)+cff1*cff1)
          
          ! modification starts here:
          
          mfac = 9.81_r8/((zeta(i,j,krhs) + h(i,j))**(1.0_r8/3.0_r8)) 
          rdr0 = mfac*(manning_n(i-1,j)**2)
          rdr1 = mfac*(manning_n(i,j)**2)
          bustr(i,j)=0.5_r8*(rdr0+rdr1)*                &
     &               ubar(i,j,krhs)*cff2
in set_vbc.F, where "manning_n" is the user-defined parameter?

Edit: The formula is c_D = g * (n^2) * h^(−1/3), see e.g.
https://www.marinespecies.org/introduce ... #3D_models

User avatar
arango
Site Admin
Posts: 1367
Joined: Wed Feb 26, 2003 4:41 pm
Location: DMCS, Rutgers University
Contact:

Re: Manning-Strickler for 2d bottom friction

#2 Unread post by arango »

Yes, set_vbc.F is the correct routine. You can code in the C-preprocessed set_vbc.f90 file if you are experimenting. Make sure the you save that .f90 file because it will be lost when you compile without the -noclean flag. In distributed routine, you just need CPP option and follow the design for other formulations available.

Good luck

stef
Posts: 192
Joined: Tue Mar 13, 2007 6:38 pm
Location: Independent researcher
Contact:

Re: Manning-Strickler for 2d bottom friction

#3 Unread post by stef »

Great, thanks for your help!

yaoyao
Posts: 3
Joined: Wed Dec 29, 2021 4:31 pm
Location: Ocean University of China

Re: Manning-Strickler for 2d bottom friction

#4 Unread post by yaoyao »

I also want to use a Manning-Strickler formula in the ROMS. But I couldn' t define the dimension of variable 'manning_n' and the variable 'h'. And there is a variable called 'cff3' which I don' t know how to process. So I want to ask stef if it is convenient to post the set_vbc.F or other file that you have modified. It would be of great help to me.

stef
Posts: 192
Joined: Tue Mar 13, 2007 6:38 pm
Location: Independent researcher
Contact:

Re: Manning-Strickler for 2d bottom friction

#5 Unread post by stef »

I never actually used the code snippet above. I'm lazy, what I actually did is "abuse" the existing field "rdrag2" (which is actually the quadratic bottom drag coefficient) in set_vbc.F and initialized it with manning_n values.

This is dangerous and can go very wrong, because the "rdrag2" variable could be used in other parts of the code (not just set_vbc.F) which expect it to be indeed a quadratic bottom friction coefficient, and the application could break. Don't do it.

The bottom line is that unfortunately I don't have a working code file to give you. Sorry.

If you want to implement it correctly, you could try to do the following, and then check with one of the ROMS developers if it's right.

Look up where in the code the drag coefficients (e.g. rdrag2) are defined and used, and add a new one called "manning_n". For reading/writing I would look at least into

*) mod_grid.F
*) get_grid.F
*) wrt_info.F

or if you want analytical values and not read from the grid

*) ana_drag.h

Instead of having e.g this code:

Code: Select all

# elif defined UV_QDRAG
      real(r8), intent(out) :: rdrag2(LBi:,LBj:)
# endif
you would have to write something like this:

Code: Select all

# elif defined UV_QDRAG
      real(r8), intent(out) :: rdrag2(LBi:,LBj:)
# elif defined MANNING
      real(r8), intent(out) :: manning_n(LBi:,LBj:)
# endif
where you introduce a preprocessor variable "MANNING". In most cases (all the input/output boiler plate) it will be pure copy/pasting/replacing text. Except of course in set_vbc.F (and possibly other places) where actual physics code is.

If you have a forward-only application, you might get away with ignoring all the files starting with "ad_*" "rp_*" or "tl_*".

stef
Posts: 192
Joined: Tue Mar 13, 2007 6:38 pm
Location: Independent researcher
Contact:

Re: Manning-Strickler for 2d bottom friction

#6 Unread post by stef »

regarding the 'h' variable, in set_vbc.F there is

Code: Select all

#   ifdef UV_QDRAG
      real(r8), intent(in) :: rdrag2(LBi:UBi,LBj:UBj)
      real(r8), intent(in) :: zeta(LBi:UBi,LBj:UBj,3)
      real(r8), intent(in) :: h(LBi:UBi,LBj:UBj)
#   endif
and you could write

Code: Select all

#   ifdef UV_QDRAG
      real(r8), intent(in) :: rdrag2(LBi:UBi,LBj:UBj)
      real(r8), intent(in) :: zeta(LBi:UBi,LBj:UBj,3)
      real(r8), intent(in) :: h(LBi:UBi,LBj:UBj)
#   endif
#   ifdef MANNING
      real(r8), intent(in) :: manning_n(LBi:UBi,LBj:UBj)
      real(r8), intent(in) :: zeta(LBi:UBi,LBj:UBj,3)
      real(r8), intent(in) :: h(LBi:UBi,LBj:UBj)
#   endif
and for the local variables something like

Code: Select all

!
!  Local variable declarations.
!
      integer :: i, j

      real(r8) :: cff1, cff2, rdr0, rdr1, mfac


Post Reply