一些杂记

IduMatrix is a general matrix class in which the coefficients are stored as three arrays, one for the upper triangle, one for the lower triangle and a third for the diagonal. 

IduMatrix是一个通用矩阵类,将系数存储在三个数组里,一个是上三角阵,一个是下三角阵,还有一个为对角线。


同时,lduMatrix也实现了H操作:


\boldsymbol \psi_n -= A_o \boldsymbol \psi_o

\boldsymbol \psi_o -= A_n \boldsymbol \psi_n


其中:

  • A 是系数矩阵
  • o 和 n 分别是拥有者和相邻的节点
  • \boldsymbol \psi 矩阵的场变量(fvMatrix类的一个参数)


H操作是一种应用不太多的快捷下标(类似于张量),但是在OpenFOAM中出现了。由一组动量方程中的项的集合构成。一个部分离散的动量方程如下:


A_p \mathbf U_p = \mathbf {S_m}_{,p} - \sum\limits_r A_r \mathbf{U}_r - \boldsymbol \nabla p^*


其中:

  • 下标 p 是体元编号
  • 下标 r 有关的体元
  • A 是系数矩阵
  • U 未修正的速度
  • S 离散的源项
  • p* 前一个迭代的值或者猜测的初值


H操作代表了式子右边除了压力项以外的项


\mathbf H_p = \mathbf {S_m}_{,p} - \sum\limits_r A_r \mathbf{U}_r

这样,动量方程的形式就变成了:


A_p \mathbf U_p = \mathbf H_p - \boldsymbol \nabla p


由于其在求解器中普遍存在,OpenFOAM直接在矩阵类中实现了H操作,包括:

  • fvMatrix::H
  • lduMatrix::H
  • lduMatrix::faceH

fvMatrix从lduMatrix派生而来,含有一个引用psi_变量,是一个const GeometricField<Type, fvPatchField, volMesh>的引用,这个应该就是Matrix对应的几何网格信息。


MULES: Multidimensional universal limiter with explicit solution.

Solve a convective-only transport equation using an explicit universal
multi-dimensional limiter.

Parameters are the variable to solve, the normal convective flux and the
actual explicit flux of the variable which is also used to return limited
flux used in the bounded-solution.

interpolate Class:Interpolates volume fields to surface fields for each time. 


32 template<class Type>
33 Foam::tmp<Foam::fvMatrix<Type> >
34 Foam::fvm::Su
35 (
36 const DimensionedField<Type, volMesh>& su,
37 const GeometricField<Type, fvPatchField, volMesh>& vf
38 )
39 {
40 const fvMesh& mesh = vf.mesh();
41
42 tmp<fvMatrix<Type> > tfvm
43 (
44 new fvMatrix<Type>
45 (
46 vf,
47 dimVol*su.dimensions()
48 )
49 );
50 fvMatrix<Type>& fvm = tfvm();
51
52 fvm.source() -= mesh.V()*su.field();
53
54 return tfvm;
55 }


98 template<class Type>
99 Foam::tmp<Foam::fvMatrix<Type> >
100 Foam::fvm::Sp
101 (
102 const DimensionedField<scalar, volMesh>& sp,
103 const GeometricField<Type, fvPatchField, volMesh>& vf
104 )
105 {
106 const fvMesh& mesh = vf.mesh();
107
108 tmp<fvMatrix<Type> > tfvm
109 (
110 new fvMatrix<Type>
111 (
112 vf,
113 dimVol*sp.dimensions()*vf.dimensions()
114 )
115 );
116 fvMatrix<Type>& fvm = tfvm();
117
118 fvm.diag() += mesh.V()*sp.field();
119
120 return tfvm;
121 }




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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值