如何运行一个CFDEM tutorial case

新手入门
万里长征第一步, 安装完CFDEM后, 我们知道有很多tutorial可以教我们怎么设置合理的参数.
很多tutorial case里都有写好的Allrun脚本, 最简单的方法就是运行Allrun脚本走一遍流程

准备工作

  1. 复制随便一个tutorial到用户自己的run文件夹, 比如
cp -r $CFDEM_PROJECT_DIR/tutorials/cfdemSolverPiso/ErgunTestMPI  $CFDEM_PROJECT_USER_DIR/run
  1. 进入自己的run文件夹
cfdemRun
cd ErgunTestMPI 

操作步骤

  1. 运行脚本: 键入
./Allrun.sh

这时候先开始注入颗粒,

run         10000 upto
Setting up run at Fri Aug 30 11:03:28 2019

Memory usage per processor = 8.20625 Mbytes
    Step    Atoms         KinEng            rke         Volume 
       1    10000   0.0052365014              0      5.076e-05 
    1000    10000    0.004499515  3.5724477e-05      5.076e-05 
    2000    10000   0.0032482753  3.7493628e-05      5.076e-05 

然后计算CFD-DEM,
每一步的输出信息是这样的(按control+s暂停, control+q继续)

Time = 0.0095

Courant Number mean: 0.000968667 max: 0.0141249

 Coupling...
Starting up LIGGGHTS
Executing command: 'run 50    '
run 50    
Setting up run at Fri Aug 30 11:05:36 2019

Memory usage per processor = 11.7595 Mbytes
    Step    Atoms         KinEng            rke         Volume       centerOf       explDrag       explDrag       explDrag        cfd2[1]        cfd2[2]        cfd2[3] 
   10900    10000  3.0235678e-08  2.5994714e-08      5.076e-05   0.0075815154 -0.00018318302 -0.00023266874     0.01306401 -0.00036988171  -0.0003432902    0.023220708 
0.1091 -0.000183183020571352 -0.000232668739458209 0.0130640101692349 -0.0003678459690244 -0.000335755459155665 0.023206490743792
   10910    10000  3.0142563e-08  2.5933345e-08      5.076e-05   0.0075815156 -0.00018318302 -0.00023266874     0.01306401 -0.00036784597 -0.00033575546    0.023206491 
0.1092 -0.000183183020571352 -0.000232668739458209 0.0130640101692349 -0.000365204126681696 -0.00032839151571164 0.0231922941826436
   10920    10000  3.0187885e-08   2.598686e-08      5.076e-05   0.0075815166 -0.00018318302 -0.00023266874     0.01306401 -0.00036520413 -0.00032839152    0.023192294 
0.1093 -0.000183183020571352 -0.000232668739458209 0.0130640101692349 -0.000362034487554226 -0.000321342127189345 0.0231802387654054
   10930    10000  2.9408987e-08  2.5738479e-08      5.076e-05   0.0075815184 -0.00018318302 -0.00023266874     0.01306401 -0.00036203449 -0.00032134213    0.023180239 
0.1094 -0.000183183020571352 -0.000232668739458209 0.0130640101692349 -0.000358262589164711 -0.000315580513497695 0.023171514882451
   10940    10000  2.8382954e-08  2.5868302e-08      5.076e-05   0.0075815208 -0.00018318302 -0.00023266874     0.01306401 -0.00035826259 -0.00031558051    0.023171515 
0.1095 -0.000183183020571352 -0.000232668739458209 0.0130640101692349 -0.000354708903814941 -0.000310413998526869 0.0231639215573515
   10950    10000  2.7996633e-08  2.5829582e-08      5.076e-05   0.0075815237 -0.00018318302 -0.00023266874     0.01306401  -0.0003547089   -0.000310414    0.023163922 
Loop time of 0.0830793 on 4 procs for 50 steps with 10000 atoms, finish time Fri Aug 30 11:05:37 2019


Pair  time (%) = 0.0551646 (66.3999)
Neigh time (%) = 0 (0)
Comm  time (%) = 0.00365216 (4.39599)
Outpt time (%) = 0.00136942 (1.64832)
Other time (%) = 0.0228931 (27.5557)

Nlocal:    2500 ave 2510 max 2494 min
Histogram: 1 1 0 1 0 0 0 0 0 1
Nghost:    737.25 ave 741 max 728 min
Histogram: 1 0 0 0 0 0 0 0 1 2
Neighs:    17461.8 ave 17537 max 17424 min
Histogram: 2 0 1 0 0 0 0 0 0 1

Total # of neighbors = 69847
Ave neighs/atom = 6.9847
Neighbor list builds = 0
Dangerous builds = 0
LIGGGHTS finished

 timeStepFraction() = 1

Solver level total Eulerian momentum exchange:
  TotalForceImp:  (-2.79566e-05 -0.000341161 -0.00907879)
  Warning, these values are based on latest Ksl and Us but prev. iteration U!

DILUPBiCG:  Solving for Ux, Initial residual = 0.161649, Final residual = 4.79585e-05, No Iterations 1
DILUPBiCG:  Solving for Uy, Initial residual = 0.184358, Final residual = 4.89484e-05, No Iterations 1
DILUPBiCG:  Solving for Uz, Initial residual = 0.00682738, Final residual = 6.70415e-06, No Iterations 1
DICPCG:  Solving for p, Initial residual = 0.018377, Final residual = 0.0017144, No Iterations 2
DICPCG:  Solving for p, Initial residual = 0.00195612, Final residual = 0.000171408, No Iterations 8
time step continuity errors : sum local = 6.78805e-07, global = 1.6253e-07, cumulative = -4.06517e-07
DICPCG:  Solving for p, Initial residual = 0.000469012, Final residual = 3.92574e-05, No Iterations 19
DICPCG:  Solving for p, Initial residual = 6.03135e-05, Final residual = 5.87118e-06, No Iterations 9
time step continuity errors : sum local = 2.32377e-08, global = 6.17836e-09, cumulative = -4.00339e-07
DICPCG:  Solving for p, Initial residual = 2.07466e-05, Final residual = 1.81581e-06, No Iterations 22
DICPCG:  Solving for p, Initial residual = 3.42227e-06, Final residual = 8.97405e-07, No Iterations 2
time step continuity errors : sum local = 3.55165e-09, global = 5.54202e-11, cumulative = -4.00284e-07
DICPCG:  Solving for p, Initial residual = 1.61219e-06, Final residual = 9.15959e-07, No Iterations 1
DICPCG:  Solving for p, Initial residual = 9.34752e-07, Final residual = 9.34752e-07, No Iterations 0
time step continuity errors : sum local = 3.69946e-09, global = -6.69031e-10, cumulative = -4.00953e-07
ExecutionTime = 2.99 s  ClockTime = 3 s

surfaceFieldValue volFlow_inlet write:
    sum(inlet) of phi = -2.2157e-06

surfaceFieldValue volFlow_outlet write:
    sum(outlet) of phi = 2.21947e-06

surfaceFieldValue volFlow_wall write:
    sum(wall) of phi = -3.81572e-09

  1. 然后弹出图片对比理论压降和模拟压降
    关闭图片

  2. 然后出现

simulation finished? ...press enter to proceed

按回车继续, 从而将dump文件转化为vtk文件, 以方便paraview调用.

  1. 出现
starting LIGGGHTS memory optimized parallel post processing
chunksize: 8 --> 8 files are processed per chunk. If you run out of memory reduce chunksize.
Working with 8 processes...
calculating chunks 1 - 3 of 3
wrote 21 granular snapshots in VTK format
time needed: 2.39329695702 sec
>>> 

这时调用的是一个python脚本,这个脚本用于将dump转化为vtk
">>>"表示python处于交互模式, 可以输入python命令

按control+d退出python

  1. 出现
/*---------------------------------------------------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  5.x                                   |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
Build  : 5.x-197d9d3bf20a
Exec   : foamToVTK
Date   : Aug 30 2019
Time   : 12:14:27
Host   : "cl"
PID    : 49452
I/O    : uncollated
Case   : /home/cl/CFDEM/cl-PUBLIC-5.0/run/cfdemSolverPiso/ErgunTestMPI/CFD
nProcs : 1
sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster (fileModificationSkew 10)
allowSystemOperations : Allowing user-supplied system call operations

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

Create mesh for time = 0

Time: 0
    volScalarFields            : nut rho p_backup p Ksl voidfraction k epsilon
    volVectorFields            : U Us

    Internal  : "/home/cl/CFDEM/cl-PUBLIC-5.0/run/cfdemSolverPiso/ErgunTestMPI/CFD/VTK/CFD_0.vtk"
    Original cells:4608 points:5225   Additional cells:0  additional points:0

    Patch     : "/home/cl/CFDEM/cl-PUBLIC-5.0/run/cfdemSolverPiso/ErgunTestMPI/CFD/VTK/inlet/inlet_0.vtk"
    Patch     : "/home/cl/CFDEM/cl-PUBLIC-5.0/run/cfdemSolverPiso/ErgunTestMPI/CFD/VTK/outlet/outlet_0.vtk"
    Patch     : "/home/cl/CFDEM/cl-PUBLIC-5.0/run/cfdemSolverPiso/ErgunTestMPI/CFD/VTK/wall/wall_0.vtk"
End

可以看到调用的是foamToVTK这个命令, 将CFD目录下的ascii文件转化为vtk

  1. 弹出paraview
    点击左上角的Open, 打开processor0目录下的file.foam
    这个下拉框里选择voidfraction, 然后点击play. 可以看到流场变化过程
    在这里插入图片描述
  2. 关闭paraview, 出现
...press enter to clean up case
press Ctr+C to keep data

这时计算完毕,可以清除case了, 如果要保留数据, 就直接contrl+c终止

  • 3
    点赞
  • 14
    收藏
    觉得还不错? 一键收藏
  • 9
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值