how to set velocity with vertical changes in ana_m2obc.h?

Report or discuss software problems and other woes

Moderators: arango, robertson

Post Reply
Message
Author
vip545
Posts: 11
Joined: Tue Jun 18, 2013 1:10 pm
Location: Tsinghua university

how to set velocity with vertical changes in ana_m2obc.h?

#1 Unread post by vip545 »

For seamount case, the model domain was set as a rectangular with incoming flow from the western boundary. The incoming flow decreases in vertical direction (z-axis) and it is that
u(z)=0.2+0.1tanh((z+hs)/hd)

its definition in ana_m2obc.h was given as below,

#if defined SEAMOUNT
IF (LBC(iwest,isUbar,ng)%acquire.and. &
& LBC(iwest,isVbar,ng)%acquire.and. &
& DOMAIN(ng)%Western_Edge(tile)) THEN
DO k=1,N(ng)
DO j=JstrT,JendT
BOUNDARY(ng)%ubar_west(j)=0.2_r8+0.1_r8*TANH((z_r(IstrT,j,k)+ &
& 2250.0_r8)/1500.0_r8)
END DO
DO j=JstrP,JendT
BOUNDARY(ng)%vbar_west(j)=0.0_r8
END DO
END DO
z_r was defined before, and it was that

#include "tile.h"
!
CALL ana_m2obc_tile (ng, tile, model,

GRID(ng) % z_r,

#ifdef ASSUMED_SHAPE

real(r8), intent(in) :: h(LBi:,LBj:,:)

#else
real(r8), intent(in) :: h(LBi:UBi,LBj:UBj,:)

#endif

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


And I also give its definition in ana_m3obc.h just like that,
#if defined SEAMOUNT
IF (LBC(iwest,isUvel,ng)%acquire.and. &
& LBC(iwest,isVvel,ng)%acquire.and. &
& DOMAIN(ng)%Western_Edge(tile)) THEN

DO k=1,N(ng)
DO j=JstrT,JendT
BOUNDARY(ng)%u_west(j, k)=0.2_r8+0.1_r8*TANH((z_r(IstrT,j,k)+ &
& 2250.0_r8)/1500.0_r8)
END DO
END DO

DO k=1,N(ng)
DO j=JstrP,JendT
BOUNDARY(ng)%v_west(j, k)=0.0_r8
END DO
END DO
END IF
And z_r was also defined before,
#include "tile.h"
!
CALL ana_m3obc_tile (ng, tile, model,
… GRID(ng) % z_r)

! Imported variable declarations.

#ifdef ASSUMED_SHAPE
real(r8), intent(in) :: z_r(LBi:,LBj:,:)
#else
real(r8), intent(in) :: z_r(LBi:UBi,LBj:UBj,:)
#endif



The oceanM can be generated after successful compilation and it was performed well. The initial flow field for the entire domain was set equal to the upstream boundary condition, that is u(z)=0.2+0.1tanh((z+hs)/hd). However, the obtained flow filed indicated that the flow could keep the vertical velocity changes even if the seamount was removed. I think the velocity definition was wrong. could someone give me some help, thank you in advance!

User avatar
kate
Posts: 4088
Joined: Wed Jul 02, 2003 5:29 pm
Location: CFOS/UAF, USA

Re: how to set velocity with vertical changes in ana_m2obc.h

#2 Unread post by kate »

The way you set u at the boundary should work, but you can't set ubar that way. Because it doesn't depend on k, you will only have set it for k=N (the last of the k loop). ubar is the depth-integrated flow field - it just doesn't depend on k.

Now maintaining a vertical sheer is going to depend on many things, including the density structure and the boundary condition options you picked in LBC. What was your question about a seamount? You have a straight channel with a seamount in it?

vip545
Posts: 11
Joined: Tue Jun 18, 2013 1:10 pm
Location: Tsinghua university

Re: how to set velocity with vertical changes in ana_m2obc.h

#3 Unread post by vip545 »

kate wrote:The way you set u at the boundary should work, but you can't set ubar that way. Because it doesn't depend on k, you will only have set it for k=N (the last of the k loop). ubar is the depth-integrated flow field - it just doesn't depend on k.

Now maintaining a vertical sheer is going to depend on many things, including the density structure and the boundary condition options you picked in LBC. What was your question about a seamount? You have a straight channel with a seamount in it?
Thank you for your advice, Kate. My case is a straight channel with a seamount in it. For LBC, I set the western incoming flow boundary as Cla boundary for U, V momentum in both 2D and 3D, while the eastern boundary condition was set as Rad boundary for both 2D and 3D. The density structure was set the similar changes vertically with the reverse changing trend, that’s to say, density increases vertically and velocity decreases with depth. However, I just still don’t understand how to set ubar. I made three trials. But they couldn’t work at all.
1) I set Do k=N
Do j=JstrT, JendT
BOUNDARY(ng)%ubar_west(j)=0.2_r8+0.1_r8*TANH((z_r(IstrT,j,k)+2250.0_r8)/1500.0_r8)

2) I give z_r(IstrT,j,k) as a fixed value, -4500, that is the maximum depth, it was wrong.
And ubar is that:
BOUNDARY(ng)%ubar_west(j)=0.2_r8+0.1_r8*TANH((-4500.0_r8+2250.0_r8)/1500.0_r8)
3) I made the depth-integrated flow velocity of u(z)=0.2+0.1tanh((z+2250)/1500), for -4500<z<0. And the integral value u was obtained. then I set ubar as u/4500=0.2m/s and give the following flow boundary.

Do j=JstrT, JendT
BOUNDARY(ng)%ubar_west(j)=0.2_r8 …

I want to set the correct boundary condition, how can I realize it?

User avatar
kate
Posts: 4088
Joined: Wed Jul 02, 2003 5:29 pm
Location: CFOS/UAF, USA

Re: how to set velocity with vertical changes in ana_m2obc.h

#4 Unread post by kate »

Your first one gives ubar as u at the surface (too strong) while the second one gives ubar as u at the bottom (too weak). What exactly do you get with all these? Do you get the ubar you ask for (but not what you expected)?

Anyway, a vertical shear with Coriolis forces balanced by a pressure gradient depends on a pressure gradient that is a function of depth. There exists some density structure that will be in balance with your velocity structure, but I'm not going to calculate it for you. It isn't level isopycnals.

vip545
Posts: 11
Joined: Tue Jun 18, 2013 1:10 pm
Location: Tsinghua university

Re: how to set velocity with vertical changes in ana_m2obc.h

#5 Unread post by vip545 »

Kate, Thank you for your help!

Post Reply