Skip to content
  • 最新
  • 版块
  • 东岳流体
  • 随机看[请狂点我]
皮肤
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • 默认(不使用皮肤)
  • 不使用皮肤
折叠
CFD中文网

CFD中文网

  1. CFD中文网
  2. OpenFOAM
  3. 分享CFDEM+OpenFOAM+LIGGGHTS初次编译安装过程

分享CFDEM+OpenFOAM+LIGGGHTS初次编译安装过程

已定时 已固定 已锁定 已移动 OpenFOAM
32 帖子 11 发布者 31.3k 浏览
  • 从旧到新
  • 从新到旧
  • 最多赞同
回复
  • 在新帖中回复
登录后回复
此主题已被删除。只有拥有主题管理权限的用户可以查看。
  • Mina LeeM 离线
    Mina LeeM 离线
    Mina Lee
    在 中回复了 capillaryFix 最后由 编辑
    #15

    @capillaryFix 我之前想干的事,是把openfoam和liggghts通过precice耦合起来,但是这个工作量太大了,一个人很难完成。
    现在的OF和liggghts是通过侵入式的耦合,导致了升级OF版本,就需要重新修改求解器。

    微信截图_20241207104846.png
    这是我之前的设想,这个设想,不需要修改liggghts源代码,但是,因为现在苦于毕业没文章,所以这个想法只能暂时搁置了。

    1 条回复 最后回复
  • 李东岳李 离线
    李东岳李 离线
    李东岳 管理员
    写于 最后由 李东岳 编辑
    #16

    我不太懂liggghts,但我对耦合比较感兴趣。liggghts那面计算颗粒DEM,有没有输出力的接口?老铁能把github上的这一块代码发个链接么

    OpenFOAM跟别的软件耦合都是一个路子。只要外挂软件有接口,在OpenFOAM里面调用就行。数据驱动LES是用libtorch计算湍流粘度,然后再OpenFOAM里面调用。那CFDEM就是liggghts算颗粒,然后在openfoam里面调用。要做到这个耦合,要懂liggghts的代码。

    9月CFD算法编程课: http://dyfluid.com/class.html

    需要帮助debug算例的看这个 https://cfd-china.com/topic/8018

    Mina LeeM 1 条回复 最后回复
  • Mina LeeM 离线
    Mina LeeM 离线
    Mina Lee
    在 中回复了 李东岳 最后由 编辑
    #17

    @李东岳 DEM软件是没有网格的概念的,因为DEM软件就是对每个颗粒求解牛顿第二定律,计算得到每个颗粒的运动。

    所以OF耦合liggghts,OF是提取liggghts颗粒的位置、速度......,然后OF识别颗粒所在网格,最后计算拖曳力、体积分数......。反之,根据OF传递进来对每个颗粒的力,liggghts计算牛顿第二定律,得到颗粒位置。

    换而言之,CFD-DEM耦合,大多数的活都需要CFD软件干。

    所以我觉得,要做这个耦合,OF的代码修改量可能会远远大于liggghts的代码修改量。

    C 1 条回复 最后回复
  • C 离线
    C 离线
    capillaryFix
    写于 最后由 capillaryFix 编辑
    #18

    @Mina-Lee 感谢回复,我的开发基于CFDEMcoupling-PUBLIC(https://github.com/CFDEMproject/CFDEMcoupling-PUBLIC),没有使用您提到的preCICE,我对该程序进行了适当的修改,让其识别OpenFOAM v2312的环境,此后基于OpenFOAM v2312再编译CFDEMcoupling这个库,根据每次的报错,修改相应的位置;主要原因是从OpenFOAM5.x版本到v2312版本,部分函数的定义有所不同。目前已经实现了两者的耦合,也进行了验证,还有部分程序目前无法兼容,但是不影响自己的工作,就暂时先放在To Do里。

    1 条回复 最后回复
  • C 离线
    C 离线
    capillaryFix
    在 中回复了 Mina Lee 最后由 capillaryFix 编辑
    #19

    @Mina-Lee Lee博士的回复很有道理,我此前的开发也是一直在OpenFOAM里,只在LIGGGHTS里植入了一些接触模型之类的。我的浅显理解是,当时DCS computing开的CFDEMcoupling,其实可以理解成是一个OpenFOAM的求解器,该求解器可以跟LIGGGHTS进行数据互换,计算void fraction, drag forces等等。

    @李东岳 李导,代码在这里:https://github.com/CFDEMproject/CFDEMcoupling-PUBLIC

    1 条回复 最后回复
  • 小 离线
    小 离线
    小刘lyw
    写于 最后由 编辑
    #20

    @true 老师您好,我在进行这一步“7. 配置CFDEM环境变量和路径”的时候提示
    image.png
    请问可能是什么原因导致的呢

    C 1 条回复 最后回复
  • 李东岳李 离线
    李东岳李 离线
    李东岳 管理员
    写于 最后由 编辑
    #21

    楼主3年没来了,你可以用这个方式安装,http://dyfluid.com/download.html#iso

    9月CFD算法编程课: http://dyfluid.com/class.html

    需要帮助debug算例的看这个 https://cfd-china.com/topic/8018

    小 1 条回复 最后回复
  • 小 离线
    小 离线
    小刘lyw
    在 中回复了 李东岳 最后由 编辑
    #22

    @李东岳 好嘞老师,谢谢!

    1 条回复 最后回复
  • C 离线
    C 离线
    capillaryFix
    在 中回复了 小刘lyw 最后由 编辑
    #23

    @小刘lyw 你的路径不对,检查你的bashrc的完整、正确路径才行。

    小 1 条回复 最后回复
  • 小 离线
    小 离线
    小刘lyw
    在 中回复了 capillaryFix 最后由 编辑
    #24

    @capillaryFix 好嘞好嘞,谢谢老师

    1 条回复 最后回复
  • L 离线
    L 离线
    LionelXWJ
    在 中回复了 capillaryFix 最后由 编辑
    #25

    @capillaryFix 正在尝试进行OpenFOAM与LIGGGHTS的耦合,可以交流一下吗

    C 1 条回复 最后回复
  • C 离线
    C 离线
    capillaryFix
    在 中回复了 LionelXWJ 最后由 编辑
    #26

    @LionelXWJ yangli_cfd@sina.com,这是我邮箱,欢迎交流!

    1 条回复 最后回复
  • 液 离线
    液 离线
    液固两相流
    写于 最后由 编辑
    #27

    @李东岳 李老师,在用您提供的虚拟机跑算例时碰到如下问题:

    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)

    1 条回复 最后回复
  • 李东岳李 离线
    李东岳李 离线
    李东岳 管理员
    写于 最后由 编辑
    #28

    哪个算例

    9月CFD算法编程课: http://dyfluid.com/class.html

    需要帮助debug算例的看这个 https://cfd-china.com/topic/8018

    液 1 条回复 最后回复
  • 液 离线
    液 离线
    液固两相流
    在 中回复了 李东岳 最后由 液固两相流 编辑
    #29

    @李东岳 在 分享CFDEM+OpenFOAM+LIGGGHTS初次编译安装过程 中说:

    哪个算例

    流化床的几个算例都有这个问题

    1 条回复 最后回复
  • 李东岳李 离线
    李东岳李 离线
    李东岳 管理员
    写于 最后由 编辑
    #30

    /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)

    9月CFD算法编程课: http://dyfluid.com/class.html

    需要帮助debug算例的看这个 https://cfd-china.com/topic/8018

    液 1 条回复 最后回复
  • 液 离线
    液 离线
    液固两相流
    在 中回复了 李东岳 最后由 编辑
    #31

    @李东岳 在 分享CFDEM+OpenFOAM+LIGGGHTS初次编译安装过程 中说:

    ERROR: Invalid dump style (/home/dyfluid/CFDEM/LIGGGHTS/src/output.cpp:589)

    代码的最后一行也是同样的问题,可能时安装的时候有点问题,我再找找原因

    1 条回复 最后回复
  • 李东岳李 离线
    李东岳李 离线
    李东岳 管理员
    写于 最后由 编辑
    #32
    # 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)
    

    这个看起来是后处理输出什么变量导致的
    # output particle properties

    9月CFD算法编程课: http://dyfluid.com/class.html

    需要帮助debug算例的看这个 https://cfd-china.com/topic/8018

    1 条回复 最后回复

  • 登录

  • 登录或注册以进行搜索。
  • 第一个帖子
    最后一个帖子
0
  • 最新
  • 版块
  • 东岳流体
  • 随机看[请狂点我]