注册 登录  
 加关注
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

随机过程

http://superware.blog.163.com

 
 
 

日志

 
 

Lid-driven cavity flow with OpenFoam  

2013-06-28 16:32:55|  分类: 默认分类 |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |
1、Pre-procession
$ mkdir -p $FOAM_RUN
$ cp -r $FOAM_TUTORIALS $FOAM_RUN
$ export EXAM_DIR=$FOAM_RUN/tutorials/incompressible/icoFoam/cavity
$ cd $EXAM_DIR
$ cd $EXAM_DIR/constant/polyMesh
$ vi blockMeshDict



1.1、Mesh generation
Lid-driven cavity flow with OpenFoam - superware - 随机过程
The mesh described in blockMeshDict file, and the context is

{

version 2.0;

format ascii;

class dictionary;

object blockMeshDict;

}


convertToMeters 0.1;


vectices

(

(0 0 0)

(1 0 0)

(1 1 0)

(0 1 0)

(0 0 0.1)

(1 0 0.1)

(1 1 0.1)

(0 1 0.1)

);


blocks

(

hex (0 1 2 3 4 5 6 7) (20 20 1) simpleGrading (1 1 1)

);


edges

(

);


boundary

(

movingWall

{

type wall;

faces

(

(3 7 6 2)

);

}

 

fixedWalls

{

type wall;

faces

(

(0 4 7 3)

(2 6 5 1)

(1 5 4 0)

);

}


frontAndBack

{

type empty;

faces

(

(0 3 2 1)

(4 5 6 7)

);

}

);


mergePatchPairs

(

);

 
1.2、Boundary condition

$ cd $EXAM_DIR

$ blockMesh -dict constant/ployMesh/blockMeshDict



/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.2.0 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
Build : 2.2.0-b363e8d14789
Exec : blockMesh -dict constant/polyMesh/blockMeshDict
Date : Jun 28 2013
Time : 16:58:14
Host : "debian"
PID : 8459
Case : /home/william/OpenFOAM/william-2.2.0/run/tutorials/incompressible/icoFoam/cavity
nProcs : 1
sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster
allowSystemOperations : Disallowing user-supplied system call operations

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Creating block mesh from
"/home/william/OpenFOAM/william-2.2.0/run/tutorials/incompressible/icoFoam/cavity/constant/polyMesh/blockMeshDict"
Creating curved edges
Creating topology blocks
Creating topology patches

Creating block mesh topology

Check topology

Basic statistics
Number of internal faces : 0
Number of boundary faces : 6
Number of defined boundary faces : 6
Number of undefined boundary faces : 0
Checking patch -> block consistency

Creating block offsets
Creating merge list .

Creating polyMesh from blockMesh
Creating patches
Creating cells
Creating points with scale 0.1

Writing polyMesh
----------------
Mesh Information
----------------
boundingBox: (0 0 0) (0.1 0.1 0.01)
nPoints: 882
nCells: 400
nFaces: 1640
nInternalFaces: 760
----------------
Patches
----------------
patch 0 (start: 760 size: 20) name: movingWall
patch 1 (start: 780 size: 60) name: fixedWalls
patch 2 (start: 840 size: 800) name: frontAndBack

End

1.3、Initial conditions
    Once the mesh generation is complete, the user can look at this initial fields set up for this case. The case is set up to start at time t = 0 s, so the initial filed data is storeed in a 0 sub-directory of the cavity direction. The 0 sub-directory contains 2 files, p and U, one for each of the pressure p and velocity U. fileds whose initial values and boundary conditions must be set. Let us examine file p:

dimensions [0 2 -2 0 0 0 0];

internalField uniform 0;


boundaryField

{

movingWall

{

type zeroGradient;

}


fixedWalls

{

type zeroGradient;

}


frontAndBack

{

type empty;

}

}  

and file U:

dimensions [0 1 -1 0 0 0 0];

internalField uniform (0 0 0);

boundaryField
{
movingWall
{
type fixedValue;
value uniform (1 0 0);
}

fixedWalls
{
type fixedValue;
value uniform (0 0 0);
}

frontAndBack
{
type empty;
}
}



1.4、Physical properties

nu nu [0 2 -1 0 0 0 0] 0.01;

1.5、Control

application icoFoam;
startFrom startTime;
startTime 0;
stopAt endTime;
endTime 0.5;
deltaT 0.005;
writeControl timeStep;
writeInterval 20;
purgeWrite 0;
writeFormat ascii;
writePrecision 6;
writeCompression off;
timeFormat general;
timePrecision 6;
runTimeModifiable true;

1.6、Discretisation and lineare-solver settings
    The user specifies the choice of finite volume discretisation schemes in the fvSchemes dictio-
nary in the system directory. The specification of the linear equation solvers and tolerances
and other algorithm controls is made in the fvSolution dictionary, similarly in the system
directory.


2、Viewing the mesh

    Before the case is run it is a good idea to view the mesh to check for any errors. The mesh
is viewed in paraFoam, the post-processing tool supplied with OpenFOAM.

$ cd $EXAM_DIR

$ blockMesh -dict constant/polyMesh/blockMeshDict

$ paraFoam


3、Runing a application

$ cd $EXAM_DIR

$ blockMesh -dict constant/polyMesh/blockMeshDict

$ icoFoam


/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.2.0 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
Build : 2.2.0-b363e8d14789
Exec : icoFoam
Date : Jun 28 2013
Time : 18:27:20
Host : "debian"
PID : 29691
Case : /home/william/OpenFOAM/william-2.2.0/run/tutorials/incompressible/icoFoam/cavity
nProcs : 1
sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster
allowSystemOperations : Disallowing user-supplied system call operations

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Create mesh for time = 0

Reading transportProperties

Reading field p

Reading field U

Reading/calculating face flux field phi


Starting time loop

Time = 0.002

Courant Number mean: 0 max: 0
DILUPBiCG: Solving for Ux, Initial residual = 1, Final residual = 6.17564e-06, No Iterations 12
DILUPBiCG: Solving for Uy, Initial residual = 0, Final residual = 0, No Iterations 0
DICPCG: Solving for p, Initial residual = 1, Final residual = 8.25176e-07, No Iterations 88
time step continuity errors : sum local = 1.42199e-09, global = -3.52823e-20, cumulative = -3.52823e-20
DICPCG: Solving for p, Initial residual = 0.647093, Final residual = 8.24482e-07, No Iterations 87
time step continuity errors : sum local = 2.05992e-09, global = -3.73044e-20, cumulative = -7.25867e-20
ExecutionTime = 0.1 s ClockTime = 0 s

Time = 0.004

Courant Number mean: 0.059096 max: 0.540856
DILUPBiCG: Solving for Ux, Initial residual = 0.157133, Final residual = 7.39793e-06, No Iterations 10
DILUPBiCG: Solving for Uy, Initial residual = 0.322427, Final residual = 4.51336e-06, No Iterations 11
DICPCG: Solving for p, Initial residual = 0.574006, Final residual = 8.30615e-07, No Iterations 86
time step continuity errors : sum local = 1.98172e-09, global = -4.61993e-20, cumulative = -1.18786e-19
DICPCG: Solving for p, Initial residual = 0.483103, Final residual = 9.75044e-07, No Iterations 85
time step continuity errors : sum local = 2.44558e-09, global = 1.1133e-19, cumulative = -7.45633e-21
ExecutionTime = 0.16 s ClockTime = 0 s

The progress of the job is written to the terminal window. It tells the user the current
time, maximum Courant number, initial and final residuals for all fields.

4、Post-procession
    As soon as results are written to time directories, they can be viewed using paraFoam.
Return to the paraFoam window and select the Properties panel for the cavity.OpenFOAM
case module. If the correct window panels for the case module do not seem to be present at
any time, please ensure that: cavity.OpenFOAM is highlighted in blue; eye button alongside
it is switched on to show the graphics are enabled;
  评论这张
 
阅读(95)| 评论(0)
推荐

历史上的今天

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2017