Initial shape of the surface

General scientific issues regarding ROMS

Moderators: arango, robertson

Post Reply
Message
Author
matias.dinapoli
Posts: 18
Joined: Tue Jun 23, 2015 5:42 pm
Location: CIMA, ARG
Contact:

Initial shape of the surface

#1 Post by matias.dinapoli » Mon Jul 06, 2015 12:11 am

Hello,

I want to do a simple test to compare the open boundary conditions. To do it, I'm going to set a initial surface elevation and let this evolve. So, how I can set a gaussian, for example, as a initial condition of surface? I didn't find something like this in the manual.

Thanks!

User avatar
shchepet
Posts: 185
Joined: Fri Nov 14, 2003 4:57 pm

Re: Initial shape of the surface

#2 Post by shchepet » Mon Jul 06, 2015 5:08 am

An analytical setup for testing baroptropic Flather- or Orlanskii-type boundary
conditions from article Mason, et al., 2010: Procedures for offline grid nesting
in regional ocean models, Ocean Modeling, vol. 35, pp. 1-15, especially Sec. 2.1.2
and Figure 3 there (expanding ring in free surface field eventually radiating out
through open boundaries):


Add the following into "cppdefs.h"

Code: Select all

#elif defined WAVE_RAD
# undef  SOLVE3D
# define UV_COR
# define UV_ADV
# undef UV_VIS2

# define ANA_GRID
# define ANA_INITIAL
# define ANA_SMFLUX

# define OBC_WEST
# define OBC_EAST
# define OBC_NORTH
# define OBC_SOUTH
c--# define OBC_M2ORLANSKI
# define OBC_M2FLATHER
# define ANA_BRY
# define Z_FRC_BRY
# define M2_FRC_BRY
(Actually you can play with different options to see how the perform.)



Add the following into parameter file

Code: Select all

#elif defined WAVE_RAD
     &              LLm=384,  MMm=384, N=1
#else


Add the following into ana_grid.F

Code: Select all

# elif defined WAVE_RAD
     &                  Size_ETA=320.0e+3,  Size_XI=Size_ETA*LLm/MMm,
     &                  depth=500.,         beta=0.,  f0=0.
Add into ana-initial.F

Code: Select all

# elif defined WAVE_RAD

      x0=xl/2.                         ! Set initial perturbation in
      y0=el/2.                         ! in free surface and velocities
      cff=64./xl                       ! for isotropically expanding
      do j=jstr,jend                   ! circular wave.
        do i=istr,iend
          x=cff*(xr(i,j)-x0)
          y=cff*(yr(i,j)-y0)
          cff1=sqrt(x*x+y*y)
          if (cff1>9. .and. cff1<11.) then
            zeta(i,j,1)=1.+cos(pi*(cff1-10.))
          endif
        enddo
      enddo
      do j=jstr,jend
        do i=istr,iend
          x=cff*(0.5*(xr(i-1,j)+xr(i,j))-x0)
          y=cff*(               yr(i,j) -y0)
          cff1=sqrt(x*x+y*y)
          if (cff1>9. .and. cff1<11.) then
            ubar(i,j,1)=(1.+cos(pi*(cff1-10.)))
     &      *(x/cff1)*sqrt(2.*g/(h(i-1,j)+h(i,j)))
          endif
        enddo
      enddo
      do j=jstr,jend
        do i=istr,iend
          x=cff*(               xr(i,j) -x0)
          y=cff*(0.5*(yr(i,j-1)+yr(i,j))-y0)
          cff1=sqrt(x*x+y*y)
          if (cff1>9. .and. cff1<11.) then
            vbar(i,j,1)=(1.+cos(pi*(cff1-10.)))
     &      *(y/cff1)*sqrt(2.*g/(h(i,j-1)+h(i,j)))
          endif
        enddo
      enddo


matias.dinapoli
Posts: 18
Joined: Tue Jun 23, 2015 5:42 pm
Location: CIMA, ARG
Contact:

Re: Initial shape of the surface

#3 Post by matias.dinapoli » Mon Jul 06, 2015 10:58 pm

Thanks a lot, I used this to start my idea. I proposed this in ana_initial

Code: Select all

#elif defined CANAL
	x0=xl(ng)/2.0_r8
    y0=el(ng)/2.0_r8
	DO j=JstrT,JendT
      DO i=IstrT,IendT
        x=(xr(i,j)-x0)
        y=(yr(i,j)-y0)
        alfa=(x*x+y*y)/200.0_r8
        zeta(i,j,1)=EXP(-alfa)
      END DO
    END DO

	DO j=JstrT,JendT
	  DO i=IstrP,IendT
	    ubar(i,j,1)=0.0_r8
	  END DO
	END DO
	DO j=JstrP,JendT
	  DO i=IstrT,IendT
	    vbar(i,j,1)=0.0_r8
	  END DO
	END DO
and this in ana_grid:

Code: Select all

#elif defined CANAL
!      Xsize=1.0E+03_r8*REAL(Lm(ng),r8)
!      Esize=5.0E+02_r8*REAL(Mm(ng),r8)
      Xsize=1000.0E+03_r8
      Esize=500.0E+03_r8
      depth=100.0_r8
      f0=0.0_r8
      beta=0.0_r8
And the roms give a gaussian of 10^-18 m and the velocity blow up, I think that any initial parameter is wrong!

User avatar
shchepet
Posts: 185
Joined: Fri Nov 14, 2003 4:57 pm

Re: Initial shape of the surface

#4 Post by shchepet » Mon Jul 06, 2015 11:21 pm

Check your numbers:

Code: Select all

       .....
        x=(xr(i,j)-x0) ; y=(yr(i,j)-y0)
        alfa=(x*x+y*y)/200.0_r8
        zeta(i,j,1)=EXP(-alfa)
        ....
where 200.0_r8 means 200 square meters, or same as (14 m)^2, meaning that the semi-width of your Gaussian is only 14 meters. However your

Code: Select all

      Xsize=1000.0E+03_r8
      Esize=500.0E+03_r8
are 1000 and 500 km respectively. It is unlikely that your grid spacing is about
10 meters or less: you have to have 10,000 grid points in X direction and half of
that in Y. This means that your Gaussian is a most only 1 grid point wide if your
are lucky enought to have x0,y0 perfectly aligned with one of your rho-points.

So the roms give a gaussian of 10^-18 m is not surprising at all.

As far as blow up, it is for some other reason, surface gravity speed CFL or whatever.

matias.dinapoli
Posts: 18
Joined: Tue Jun 23, 2015 5:42 pm
Location: CIMA, ARG
Contact:

Re: Initial shape of the surface

#5 Post by matias.dinapoli » Mon Jul 13, 2015 11:10 pm

I solved it, I was thinking all in kilometers. I read fully ana_grid.h and understood how is created the grids points.

Post Reply