Velocity field and divergence of v and modeling mantle flow etc.

%Velocity field and divergence of velocity etc.
%Parameter
vx0 = 10.^(-9)
%vy0 = 10.^(-9)
%Tune scale of vyo in order to div(v) towards zero(five mangitudes)
vy0 = vx0./0.33333

%set gird
[x,y] = meshgrid(0:10000:1000000,0:10000:1500000)
[x1,y1] = meshgrid(0:100000:1000000,0:100000:1500000)
W = max(max(x))
H = max(max(y))
%msgbox(num2str(W), 'value of variable W', 'modal');
%msgbox(num2str(H), 'value of variable H', 'modal');

%field
velocity_x = -vx0*sin(2*pi*x./W).*cos(pi*y./H)
velocity_y = vy0*cos(2*pi*x./W).*sin(pi*y./H)
velocity_x_arrow = -vx0*sin(2*pi*x1./W).*cos(pi*y1./H)
velocity_y_arrow = vy0*cos(2*pi*x1./W).*sin(pi*y1./H)
x_derivative_of_velocity_x = -vx0*cos(pi*y./H).*(2*pi./W).*cos(2*pi*x./W)
y_derivative_of_velocity_y = vy0*cos(2*pi*x./W).*cos(pi*y./H).*(pi./H)
divergence_of_velocity = x_derivative_of_velocity_x + y_derivative_of_velocity_y

%x compontent of velocity
figure(1)
pcolor(x,y,velocity_x)
xlabel('Horizontal(m)')
ylabel('Vertical(m)')
title('Field of velocity x compontent of velocity')
set(gca,'xaxislocation','top');
%Two means of change axs' location
%ax = gca;
%ax.XAxisLocation = 'top'
set (gca,'YDir','reverse')
shading flat
colorbar

%y compontent of velocity
figure(2)
pcolor(x,y,velocity_y)
xlabel('Horizontal(m)')
ylabel('Vertical(m)')
title('Field of velocity y compontent of velocity')
set(gca,'xaxislocation','top');
set (gca,'YDir','reverse')
shading flat
colorbar

%x_derivative_of_velocity_x
figure(3)
pcolor(x,y,x_derivative_of_velocity_x)
xlabel('Horizontal(m)')
ylabel('Vertical(m)')
title('Field of x derivative of velocity x')
set(gca,'xaxislocation','top');
set (gca,'YDir','reverse')
shading flat
colorbar

%y_derivative_of_velocity_y
figure(4)
pcolor(x,y,y_derivative_of_velocity_y)
xlabel('Horizontal(m)')
ylabel('Vertical(m)')
title('Field of y derivative of velocity y')
set(gca,'xaxislocation','top');
set (gca,'YDir','reverse')
shading flat
colorbar

%divergence of velocity
figure(5)
pcolor(x,y,divergence_of_velocity)
xlabel('Horizontal(m)')
ylabel('Vertical(m)')
title('Field of divergence of velocity')
set(gca,'xaxislocation','top');
set (gca,'YDir','reverse')
shading flat
colorbar

%modeling mantle flow 
figure(6)
scale = 1
quiver(x1,y1,velocity_x_arrow,velocity_y_arrow,scale,'Color',[0.5 0.5 0.5])
xlabel('Horizontal(m)')
ylabel('Vertical(m)')
title('upwelling in the middle and two downwelling at sides')
set(gca,'xaxislocation','top');
set (gca,'YDir','reverse')
shading flat
colorbar

 

 

 

 

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值