一些杂记

来源:互联网 发布:淘宝网购物街 编辑:程序博客网 时间:2024/05/10 08:24

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 0
原创粉丝点击