找回密码
 注册
Simdroid-非首页
查看: 220|回复: 15

[二次开发] [原创] ANSYS模型的Model Order Reduction(提高瞬态计算速度数百倍)

[复制链接]
发表于 2011-4-8 15:24:51 | 显示全部楼层 |阅读模式 来自 美国
本帖最后由 iomega 于 2011-4-8 12:01 编辑

最近在做一些Fast simulation的工作,用到了Model Order Reduction (MOR),觉得十分有用,在这里推荐给大家,并且附上ANSYS 和Matlab的source code.现在最流行的MOR主要基于Krylov subspace projection method, 基本原理如下:
假设原来的linear system model的node数是N (NxN的矩阵), N ~ 100000,  我们可以创建一个N x r 的矩阵,把原来NxN的矩阵project到 r x r的矩阵上去 (r<<N),这样求解过程可以在这个小矩阵上完成,然后再把结果project回到原来的NxN的矩阵空间上去。
以下是源程序介绍:
(1) Example.mac: ANSYS mac file 用来建立一个三维的热传导模型,并加上载荷。用户必需设置文件里的SOLVE_OPTION变量。
取0时,输出模型的heat capacitance 和 heat conductance 矩阵,分别保存到C_File.dat和K_file.dat(Thermal load 也保存到K_File.dat)。
取1和2时分别做steady-state和transient simulation。


(2) MOR_ODE.m: matlab 程序,读取K_File.dat和C_file.dat进行MOR,并且和ANSYS 结果(ansys.dat,在Example.mac里SOLVE_OPTION=2)的对比。用户必需设置Solver_Option = 1调用matlab的lu分解函数。
(Solver_Option = 0 是使用external 的 MOR_MUMPS.exe程序做matrix factorization,速度可提高数倍。MOR_MUMPS.exe是我自己写的C语言程序,用到了GNU MUMPS linear solver library和BLAS library, 需用GNU fortran 和 gcc 编译).

ANSYS模型的MOR步骤:
(1): 在ANSYS里建模,mesh,以及加载 (不必求解)。
(2): 用HBMAT命令输出system matrice文件.
(3): 在Matlab里读入system matrice文件进行MOR.
(4): 在Matlab里用ODE solver求解并project solution back 得到原模型上的解
限制: 模型必需是linear system response model.




下图显示了用matlab/MOR求解ANSYS模型结果和直接用ANSYS simulation的结果的比较,可以看出结果完全一样,求解速度提高400倍!

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注册

×

评分

1

查看全部评分

发表于 2011-4-8 16:33:14 | 显示全部楼层 来自 台湾
Simdroid开发平台
感覺好深奧,努力學習中!
回复 不支持

使用道具 举报

发表于 2011-4-9 14:12:55 | 显示全部楼层 来自 江苏无锡
版主就是版主  这么强大的办法都能想的出来  在下很佩服   学习了   以后会尝试着用一下的。
回复 不支持

使用道具 举报

发表于 2011-4-9 14:15:24 | 显示全部楼层 来自 江苏无锡
版主就是版主  这么强大的办法都能想的出来  在下很佩服   学习了   以后会尝试着用一下的。
回复 不支持

使用道具 举报

发表于 2011-4-9 18:26:43 | 显示全部楼层 来自 江苏南京
谢谢楼主提出这么高深的方法,虽然很难懂
回复 不支持

使用道具 举报

发表于 2011-4-9 19:54:10 | 显示全部楼层 来自 福建福州
我靠 我要学习这种方法。要真的能提高百倍的话我毕业就有望了。
回复 不支持

使用道具 举报

发表于 2011-4-9 21:29:44 | 显示全部楼层 来自 河北秦皇岛
版主 说实话  从我注册到现在第一次见您的面  一年了  这个号是别人的  没有你的ANSY热分析模块萧条的很   很多问题无法得到解决 期待您的归来!
回复 不支持

使用道具 举报

发表于 2011-4-10 09:00:05 | 显示全部楼层 来自 福建福州
只能用在热分析里面吗?
回复 不支持

使用道具 举报

发表于 2011-4-10 09:01:54 | 显示全部楼层 来自 福建福州
只能用在热分析里面吗?
回复 不支持

使用道具 举报

 楼主| 发表于 2011-4-10 09:12:56 | 显示全部楼层 来自 美国
It can be used for any first and second order ODE systems.
回复 不支持

使用道具 举报

 楼主| 发表于 2011-4-10 09:11:24 | 显示全部楼层 来自 美国
It can be used for any first and second order ODE systems.
回复 不支持

使用道具 举报

发表于 2011-4-10 18:12:25 | 显示全部楼层 来自 陕西西安
NxN的矩阵project到 r x r的矩阵,方法很好,对于r是不是得有个限制呢? 要不可能会得到很多解的。请教一下,r是通过什么设定范围的呢?
回复 不支持

使用道具 举报

 楼主| 发表于 2011-4-11 00:07:10 | 显示全部楼层 来自 美国
Good question! There are physics behind it. In theory, the Krylov subspace method matches the first r moments of the linear system in the Laplace frequency domain. So the bigger the r is, the closer the r order system approximates the original N order system.
Now, choosing number of r is different for different problems. For thermal problem, since it is in nature a low-pass filter in both spatial and temporal domains, r below 10 is probably good enough to achieve good accuracy. For mechanical vibration problem, you might need large number of r if the bandwidth of dynamic response of system is high.

In a summary, you have to first have some idea of the bandwidth of the system dynamic response.
回复 不支持

使用道具 举报

发表于 2011-4-11 15:44:15 | 显示全部楼层 来自 河北石家庄
版主 就是牛!
回复 不支持

使用道具 举报

发表于 2011-4-12 19:20:13 | 显示全部楼层 来自 湖南长沙
恩,看来对非线性问题,还是麻烦多多啊。
回复 不支持

使用道具 举报

发表于 2017-5-16 10:32:52 | 显示全部楼层 来自 山东青岛
下载学习了!
回复 不支持

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|小黑屋|联系我们|仿真互动网 ( 京ICP备15048925号-7 )

GMT+8, 2024-4-20 16:32 , Processed in 0.055665 second(s), 18 queries , Gzip On, MemCache On.

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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