爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博登陆

只需一步, 快速开始

搜索
查看: 3386|回复: 3

计算流函数和速度势

[复制链接]

新浪微博达人勋

发表于 2022-12-27 10:47:42 | 显示全部楼层 |阅读模式

登录后查看更多精彩内容~

您需要 登录 才可以下载或查看,没有帐号?立即注册 新浪微博登陆

x
本帖最后由 MeteoInfo 于 2022-12-27 11:09 编辑

参考了 MIT 的 Kirill Pankratov 博士1994年的MATLAB程序,在MeteoInfoLab的meteolib包中实现了flowfun函数来计算流场的流函数和速度势,具体可以参考此网页:http://www-pord.ucsd.edu/matlab/stream.htm

网上例子的实现:
  1. e = 2.; g = 1.
  2. x, y = meshgrid(arange(0, 21), arange(0, 16))  # This makes regular grid
  3. u = e*x-g*y                  # Linear velocity field
  4. v = g*x-e*y
  5. psi, phi = meteolib.flowfun(u, v)  # Here comes the streamfun and potential.

  6. contour(phi, 20, colors='r', linestyle='--')   # Contours of potential
  7. contour(psi, 20, colors='g')    # Contours of streamfunction
  8. quiver(u, v, color='b', size=6)      # Now superimpose the velocity field


flowfun_1.png

一个实际气象风场数据的例子:
  1. fn = 'D:/Temp/nc/_grib2netcdf-webmars-public-svc-green-003-6fe5cac1a363ec1525f54343b6cc9fd8-VvjKkH.nc'
  2. f = addfile(fn)
  3. u = f['u'][0,'10:55','70:140']
  4. v = f['v'][0,'10:55','70:140']
  5. lon = u.dimvalue(1)
  6. lat = u.dimvalue(0)
  7. psi, phi = meteo.flowfun(u, v)  # Here comes the streamfunction and potential.

  8. axesm()
  9. geoshow('country')
  10. layer = contour(lon, lat, psi, 20)   # Contours of streamfunction
  11. s = 3
  12. quiver(lon[::s], lat[::s], u[::s,::s], v[::s,::s], color='b', size=20)      # Now superimpose the velocity field
  13. colorbar(layer)

flowfun_2.png
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2022-12-29 09:38:34 | 显示全部楼层
matlab的程序在哪里可以下载啊?谢谢
密码修改失败请联系微信:mofangbao
回复 支持 反对

使用道具 举报

新浪微博达人勋

发表于 2022-12-29 09:40:49 | 显示全部楼层
早起眼睛不好,看到了,哭
密码修改失败请联系微信:mofangbao
回复 支持 反对

使用道具 举报

新浪微博达人勋

发表于 2024-6-1 21:30:50 | 显示全部楼层
请问Kirill Pankratov的matlab程序经以下积分后,psi是否消除?
cx = cumsimp(u(1,:));  % Compute x-integration constant
cy = cumsimp(v(:,1));  % Compute y-integration constant
phi = cumsimp(v)+cx(ones(ly,1),:);
phi = (phi+cumsimp(u')'+cy(:,ones(1,lx)))/2;
密码修改失败请联系微信:mofangbao
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册 新浪微博登陆

本版积分规则

Copyright ©2011-2014 bbs.06climate.com All Rights Reserved.  Powered by Discuz! (京ICP-10201084)

本站信息均由会员发表,不代表气象家园立场,禁止在本站发表与国家法律相抵触言论

快速回复 返回顶部 返回列表