Initial shape of the surface

 Posts: 18
 Joined: Tue Jun 23, 2015 5:42 pm
 Location: CIMA, ARG
 Contact:
Initial shape of the surface
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!
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!
Re: Initial shape of the surface
An analytical setup for testing baroptropic Flather or Orlanskiitype boundary
conditions from article Mason, et al., 2010: Procedures for offline grid nesting
in regional ocean models, Ocean Modeling, vol. 35, pp. 115, 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"
(Actually you can play with different options to see how the perform.)
Add the following into parameter file
Add the following into ana_grid.F
Add into anainitial.F
conditions from article Mason, et al., 2010: Procedures for offline grid nesting
in regional ocean models, Ocean Modeling, vol. 35, pp. 115, 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
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.
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*(cff110.))
endif
enddo
enddo
do j=jstr,jend
do i=istr,iend
x=cff*(0.5*(xr(i1,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*(cff110.)))
& *(x/cff1)*sqrt(2.*g/(h(i1,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,j1)+yr(i,j))y0)
cff1=sqrt(x*x+y*y)
if (cff1>9. .and. cff1<11.) then
vbar(i,j,1)=(1.+cos(pi*(cff110.)))
& *(y/cff1)*sqrt(2.*g/(h(i,j1)+h(i,j)))
endif
enddo
enddo

 Posts: 18
 Joined: Tue Jun 23, 2015 5:42 pm
 Location: CIMA, ARG
 Contact:
Re: Initial shape of the surface
Thanks a lot, I used this to start my idea. I proposed this in ana_initial
and this in ana_grid:
And the roms give a gaussian of 10^18 m and the velocity blow up, I think that any initial parameter is wrong!
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
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
Re: Initial shape of the surface
Check your numbers:
where 200.0_r8 means 200 square meters, or same as (14 m)^2, meaning that the semiwidth of your Gaussian is only 14 meters. However your
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 rhopoints.
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.
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)
....
Code: Select all
Xsize=1000.0E+03_r8
Esize=500.0E+03_r8
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 rhopoints.
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.

 Posts: 18
 Joined: Tue Jun 23, 2015 5:42 pm
 Location: CIMA, ARG
 Contact:
Re: Initial shape of the surface
I solved it, I was thinking all in kilometers. I read fully ana_grid.h and understood how is created the grids points.