OpenFOAM网格和场资料收集整理

OpenFOAM网格和场资料收集整理


Foam::PrimitiveMesh

构造函数

PrimitiveMesh
(
   const label nPoints,
   const label nInternalFaces,
   const label nFaces,
   const label nCells
);

virtual const pointFiels &points() const=0;
virtual const faceList  &faces() const=0;
virtual const labelList &faceOwner()const=0;
virtual const labelList &faceNeighbour() const=0;


Foam::PrimitivePatch

构造函数

PrimitivePatch 
(
    const FaceList &faces,
	const Field<PointType> &points
);

Foam::polyMesh

Foam::PrimitiveMesh的唯一派生类型。可从文件读取网格

explicit polyMesh(const IOobject &io);

并实现了Foam::PrimitiveMesh的虚函数。含有边界网格私有数据成员

mutable polyBoundaryMesh boundary_;

Foam::polyBoundaryMesh派生自Foam::polyPatchList, 既Foam::polyPatch列表。 该列表中的每一个元素都是polyPatch类型。


Foam::fvMesh

Foam::fvMesh派生自Foam::polyMesh
可从IOobject构造

一个经典的例子是位于/src/OpenFOAM/include的createMesh.H文件。该文件包含了创建fvMesh网格的代码,是所有求解器必须使用的


Foam::Info
    << "Create mesh for time = "
    << runTime.timeName() << Foam::nl << Foam::endl;

Foam::fvMesh mesh
(
    Foam::IOobject
    (
        Foam::fvMesh::defaultRegion,
        runTime.timeName(),
        runTime,
        Foam::IOobject::MUST_READ
    )
);


Foam::polyPatch

派生自Foam::PrimitivePatch

构造函数

polyPatch
(
	const word &name,
	const label size,
	const label start,
	const label index,
	const polyBoundaryMesh &bm,
	const word &patchType
);

polyPatch 
(
    const word &name,
	const dictionary &dict,
	const label index,
	const polyBoundaryMesh &bm,
    const word &patchType	
);


Foam::fvPatch

不是派生自Foam::polyPatch


fvPatch(const polyPatch&, const fvBoundaryMesh&);


Foam::fvBoundaryMesh
Foam::Field

派生自List,一个数组,没有网格和量纲,支持基本数组计算(比如max,sum,sqr,pow,+,-)

一些别名

typedef Field<label> labelField;
typedef Field<scalar> scalarField;
typedef Field<vector> vectorField;
typedef Field<tensor> tensorField;

Foam::DimensionField派生自Foam::Field,添加了网格和量纲,但没有边界条件.
Foam::GeometricField派生自Foam::DimensionField,内置boundary类,考虑了边界条件

别名


 typedef GeometricField<scalar, fvPatchField, volMesh> volScalarField;
 typedef GeometricField<vector, fvPatchField, volMesh> volVectorField;
 typedef GeometricField<sphericalTensor, fvPatchField, volMesh> volSphericalTensorField;
 typedef GeometricField<symmTensor, fvPatchField, volMesh> volSymmTensorField;
 typedef GeometricField<tensor, fvPatchField, volMesh> volTensorField;

 typedef GeometricField<scalar, pointPatchField, pointMesh> pointScalarField;
 typedef GeometricField<vector, pointPatchField, pointMesh> pointVectorField;
 typedef GeometricField<sphericalTensor, pointPatchField, pointMesh> pointSphericalTensorField;
 typedef GeometricField<symmTensor, pointPatchField, pointMesh> pointSymmTensorField;
 typedef GeometricField<tensor, pointPatchField, pointMesh> pointTensorField;

其中类Foam::fvPatchField和Foam::fvsPatchField用于考虑边界条件

一个经典的案例是读取初始温度场

Info << "Reading field T\n"
     << endl;

volScalarField T //温度场
    (
        IOobject(
            "T",
            runTime.timeName(),
            mesh,
            IOobject::MUST_READ,
            IOobject::AUTO_WRITE),
        mesh
	);


参考资料

openFoam网格绘制总结笔记

  • 4
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值