visc4, tnu4 clarification

General scientific issues regarding ROMS

Moderators: arango, robertson

Post Reply
Message
Author
jabent
Posts: 17
Joined: Tue Jan 22, 2008 11:31 pm
Location: Australian Institute of Marine Science

visc4, tnu4 clarification

#1 Unread post by jabent »

Hi, I just want to clarify the units used for the biharmonic mixing coefficients. The constants specified for VISC4 and TNU4 have units of m^4 s^-1 in the .in-file.

However, I noticed that in mod_scalars.F, visc4 and tnu4 are described as being the 'square root lateral biharmonic constant mixing coefficient (m^2 s^-1/2)'. Also, if I understand correctly, visc4_p and visc4_r are set equal to visc4 in mod_mixing.F. So, is the square root of VISC4 and TNU4 taken somewhere in the code when setting visc4_p, visc4_r, diff4?

On a related note, I'm interested in specifying increased horizontal mixing in a sponge layer with ana_hmixcoef. In the ADRIA02 example, visc2_r, visc2_p, and diff2 = 0 outside of the sponge layer. With biharmonic mixing coefficients, if I specify VISC4 and TNU4 in the model, do I also have to set visc4_r, visc4_p, diff4 explicitly in this file outside of the sponge layer? And do I have to make sure to take the square root of visc4 to get the correct units for visc4_r, visc4_p, diff4?

Thank you so much for clearing up my confusion!

-Jessica

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

Re: visc4, tnu4 clarification

#2 Unread post by arango »

Yes, the squared-root of the biharmonic coefficients is done in inp_par.F. You will see statements like:

Code: Select all

      DO ng=1,Ngrids
!
!  Take the square root of the biharmonic coefficients so it can
!  be applied to each harmonic operator.
!
        nl_visc4(ng)=SQRT(ABS(nl_visc4(ng)))
#ifdef ADJOINT
        ad_visc4(ng)=SQRT(ABS(ad_visc4(ng)))
#endif
#if defined TANGENT || defined TL_IOMS
        tl_visc4(ng)=SQRT(ABS(tl_visc4(ng)))
#endif
        tkenu4(ng)=SQRT(ABS(tkenu4(ng)))
      END DO
...

      DO ng=1,Ngrids
        DO itrc=1,NAT+NPT
          nl_tnu4(itrc,ng)=SQRT(ABS(nl_tnu4(itrc,ng)))
#ifdef ADJOINT
          ad_tnu4(itrc,ng)=SQRT(ABS(ad_tnu4(itrc,ng)))
#endif
#if defined TANGENT || defined TL_IOMS
          tl_tnu4(itrc,ng)=SQRT(ABS(tl_tnu4(itrc,ng)))
#endif
        END DO
      END DO
This is done so each harmonic term is multiply by its viscosity/diffusion coefficient. Currently, we allow the nonlinear, tangent, representer, and adjoint models to have different horizontal mixing coefficients. The associated arrays are initialized in ini_hmixcoef.F which is called during initialization.

If you want a sponge layer in your application with biharmonic mixing, you need to do this in visc4_r, visc4_p, and diff4. Follow the example for the harmonic case in ana_hmixcoef.h.

jabent
Posts: 17
Joined: Tue Jan 22, 2008 11:31 pm
Location: Australian Institute of Marine Science

Re: visc4, tnu4 clarification

#3 Unread post by jabent »

Great- thanks for letting me know!

-Jessica

feroda

Re: visc4, tnu4 clarification

#4 Unread post by feroda »

arango wrote: The associated arrays are initialized in ini_hmixcoef.F which is called during initialization.

If you want a sponge layer in your application with biharmonic mixing, you need to do this in visc4_r, visc4_p, and diff4. Follow the example for the harmonic case in ana_hmixcoef.h.
In the ana_hmixcoef.h, should the following code be deleted, because they put zero to the interior domain?

Code: Select all

      
        DO j=MAX(JstrR,7),JendR
          visc2_r(i,j)=0.0_r8
          visc2_p(i,j)=0.0_r8
        END DO

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

Re: visc4, tnu4 clarification

#5 Unread post by arango »

This is a user routine and you can do what it is appropriate for your application. In this particular example, the interior values were set to zero because the default hyper-diffusive advection scheme was activated. Therefore, no explicit viscosity/diffusion was specified because there is a lot of implicit mixing in them. This depends on your advection scheme. Various of the advection schemes in ROMS do require explicit viscosity/diffusion. In such cases, setting visc2_r, visc2_p, and diff2 outside of the sponge layers is not a good idea for stability.

Post Reply