iomega 发表于 2011-4-8 15:24:51

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

本帖最后由 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倍!

kevin210099 发表于 2011-4-8 16:33:14

感覺好深奧,努力學習中!

kkamber85 发表于 2011-4-9 14:12:55

版主就是版主这么强大的办法都能想的出来在下很佩服   学习了   以后会尝试着用一下的。

kkamber85 发表于 2011-4-9 14:15:24

版主就是版主这么强大的办法都能想的出来在下很佩服   学习了   以后会尝试着用一下的。

douguoju 发表于 2011-4-9 18:26:43

谢谢楼主提出这么高深的方法,虽然很难懂

zuchongzhi 发表于 2011-4-9 19:54:10

我靠 我要学习这种方法。要真的能提高百倍的话我毕业就有望了。

oyime 发表于 2011-4-9 21:29:44

版主 说实话从我注册到现在第一次见您的面一年了这个号是别人的没有你的ANSY热分析模块萧条的很   很多问题无法得到解决 期待您的归来!

zuchongzhi 发表于 2011-4-10 09:00:05

只能用在热分析里面吗?

zuchongzhi 发表于 2011-4-10 09:01:54

只能用在热分析里面吗?

iomega 发表于 2011-4-10 09:12:56

It can be used for any first and second order ODE systems.

iomega 发表于 2011-4-10 09:11:24

It can be used for any first and second order ODE systems.

livelife 发表于 2011-4-10 18:12:25

NxN的矩阵project到 r x r的矩阵,方法很好,对于r是不是得有个限制呢? 要不可能会得到很多解的。请教一下,r是通过什么设定范围的呢?

iomega 发表于 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.

gao9941 发表于 2011-4-11 15:44:15

版主 就是牛!

wangyan43 发表于 2011-4-12 19:20:13

恩,看来对非线性问题,还是麻烦多多啊。

胜者唯王 发表于 2017-5-16 10:32:52

下载学习了!
页: [1]
查看完整版本: [原创] ANSYS模型的Model Order Reduction(提高瞬态计算速度数百倍)