分享CFDEM+OpenFOAM+LIGGGHTS初次编译安装过程
-
@Mina-Lee 感谢回复,我的开发基于CFDEMcoupling-PUBLIC(https://github.com/CFDEMproject/CFDEMcoupling-PUBLIC),没有使用您提到的preCICE,我对该程序进行了适当的修改,让其识别OpenFOAM v2312的环境,此后基于OpenFOAM v2312再编译CFDEMcoupling这个库,根据每次的报错,修改相应的位置;主要原因是从OpenFOAM5.x版本到v2312版本,部分函数的定义有所不同。目前已经实现了两者的耦合,也进行了验证,还有部分程序目前无法兼容,但是不影响自己的工作,就暂时先放在To Do里。
-
@Mina-Lee Lee博士的回复很有道理,我此前的开发也是一直在OpenFOAM里,只在LIGGGHTS里植入了一些接触模型之类的。我的浅显理解是,当时DCS computing开的CFDEMcoupling,其实可以理解成是一个OpenFOAM的求解器,该求解器可以跟LIGGGHTS进行数据互换,计算void fraction, drag forces等等。
@李东岳 李导,代码在这里:https://github.com/CFDEMproject/CFDEMcoupling-PUBLIC
-
@capillaryFix 好嘞好嘞,谢谢老师
-
@capillaryFix 正在尝试进行OpenFOAM与LIGGGHTS的耦合,可以交流一下吗
-
@LionelXWJ yangli_cfd@sina.com,这是我邮箱,欢迎交流!
-
/home/dyfluid/CFDEM/CFDEMcoupling/tutorials/cfdemSolverPiso
我测试了一下这个没问题。你那个有问题我看好像是运行vtk后处理的时候的问题,如下。我不太东liggghts。你看看顺着思路能不能把后处理某个东西关掉之类的
// run_liggghts_init_DEM // /home/dyfluid/CFDEM/CFDEMcoupling/tutorials/cfdemSolverPiso/bubblingFluidizedBed/DEM LIGGGHTS (Version LIGGGHTS-PFM 24.01, compiled 2025-01-20-15:21:00 by dyfluid, git commit d075b97762ce4302707903718dda170920e630bd, based on LAMMPS 23 Nov 2013) # define the attributes associated with the particles, # 'granular' (or 'sphere') style uses diameter, mass and angular velocity atom_style granular # use an array to map particle IDs to local storage index, atom_modify map array # set simulation domain to be fixed in x y z boundary f f f # save communication by turning off Newton's 3rd law for pairwise interaction, # note: this setting only influences communication between procs, Newton's # 3rd law is still used for contact force calculations newton off # use a single value for ghost particle cutoff distance and # enable velocity to be communicated with ghost particles communicate single vel yes # set unit system to SI units si # define the region used as simulation domain (min/max X, min/max Y, min/max Z) region domain block 0.0 0.0432 0.0 0.01 0.0 0.1248 units box # create the simulation domain and 2 material types (with friction/frictionless) create_box 2 domain Created orthogonal box = (0 0 0) to (0.0432 0.01 0.1248) 1 by 1 by 1 MPI processor grid # specify the skin distance for neighbor list generation neighbor 0.0003 bin neigh_modify delay 0 # define the material properties required for granular pair styles # type 1 = particles / walls with friction # type 2 = frictionless walls fix m1 all property/global youngsModulus peratomtype 1.2e8 1.2e8 fix m2 all property/global poissonsRatio peratomtype 0.3 0.3 fix m3 all property/global coefficientRestitution peratomtypepair 2 0.986 0.986 0.986 0.986 fix m4 all property/global coefficientFriction peratomtypepair 2 0.1 0.0 0.0 0.0 # specify contact model to use pair_style gran model hertz tangential history SURFACE/DEFAULT loaded HERTZ loaded TANGENTIAL/HISTORY loaded pair_coeff * * # set the time step timestep 0.0000025 # apply gravity fix gravity all gravity 9.81 vector 0.0 0.0 -1.0 # define walls fix xwall1 all wall/gran model hertz tangential history primitive type 1 xplane 0.0000 SURFACE/DEFAULT loaded HERTZ loaded TANGENTIAL/HISTORY loaded fix xwall2 all wall/gran model hertz tangential history primitive type 1 xplane 0.0432 SURFACE/DEFAULT loaded HERTZ loaded TANGENTIAL/HISTORY loaded fix ywall1 all wall/gran model hertz tangential history primitive type 2 yplane 0.0000 SURFACE/DEFAULT loaded HERTZ loaded TANGENTIAL/HISTORY loaded fix ywall2 all wall/gran model hertz tangential history primitive type 2 yplane 0.0100 SURFACE/DEFAULT loaded HERTZ loaded TANGENTIAL/HISTORY loaded fix zwall1 all wall/gran model hertz tangential history primitive type 1 zplane 0.0000 SURFACE/DEFAULT loaded HERTZ loaded TANGENTIAL/HISTORY loaded # particle distributions and insertion fix pts1 all particletemplate/sphere 367127 atom_type 1 density constant 1000 radius constant 0.0006 fix pdd1 all particledistribution/discrete 681573 1 pts1 1.0 Fix particledistribution/discrete (id pdd1): distribution based on mass%: pts1: d=1.200000e-03 (max. bounding sphere) mass%=100.000000% Fix particledistribution/discrete (id pdd1): distribution based on number%: pts1: d=1.200000e-03 (max. bounding sphere) number%=100.000000% fix ins all insert/pack seed 4763687 distributiontemplate pdd1 vel constant 0.0 0.0 -0.15 insert_every once overlapcheck yes all_in yes particles_in_region 9240 region domain # use constant NVE integration to update position, velocity and angular velocity fix integr all nve/sphere # output settings, include kinetic energy thermo_style custom step atoms ke # set frequency of output thermo 1000 # ignore particles leaving the simulation domain, # do not normalize thermodynamic output values by the number of atoms thermo_modify lost ignore norm no compute_modify thermo_temp dynamic yes # insert the first particles so that dump is not empty run 1 Setting up run ... INFO: Resetting random generator for region domain INFO: Particle insertion ins: inserting every 0 steps Memory usage per processor = 5.00542 Mbytes Step Atoms KinEng 0 0 -0 insertion: proc 0 at 0 % insertion: proc 0 at 10 % insertion: proc 0 at 20 % insertion: proc 0 at 30 % insertion: proc 0 at 40 % insertion: proc 0 at 50 % insertion: proc 0 at 60 % insertion: proc 0 at 70 % insertion: proc 0 at 80 % insertion: proc 0 at 90 % INFO: Particle insertion ins: inserted 9240 particle templates (mass 0.008360) at step 1 - a total of 9240 particle templates (mass 0.008360) inserted so far. 1 9240 9.4067122e-05 Loop time of 0.0254776 on 1 procs for 1 steps with 9240 atoms Max time of 0.0254776 on 1 procs for 1 steps with 9240 atoms Pair time (%) = 0.000333961 (1.3108) Max Pair time (ib) = 0.000333961 (0) Neigh time (%) = 0.0043867 (17.2179) Max Neigh time (ib) = 0.0043867 (0) Comm time (%) = 5.4832e-05 (0.215217) Max Comm time (ib) = 5.4832e-05 (0) Outpt time (%) = 5.5202e-05 (0.216669) Max Outpt time (ib) = 5.5202e-05 (0) Other time (%) = 0.0206469 (81.0394) Max Other time (ib) = 0.0206469 (0) Nlocal: 9240 ave 9240 max 9240 min Histogram: 1 0 0 0 0 0 0 0 0 0 Nghost: 0 ave 0 max 0 min Histogram: 1 0 0 0 0 0 0 0 0 0 Neighs: 7500 ave 7500 max 7500 min Histogram: 1 0 0 0 0 0 0 0 0 0 Total # of neighbors = 7500 Ave neighs/atom = 0.811688 Neighbor list builds = 1 Dangerous builds = 0 # output particle properties dump dmp all custom/vtk 5000 post/liggghts_init_*.vtk id type x y z vx vy vz fx fy fz omegax omegay omegaz radius ERROR: Invalid dump style (/home/dyfluid/CFDEM/LIGGGHTS/src/output.cpp:589)