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. 运行算例出现segmentation fault

运行算例出现segmentation fault

已定时 已固定 已锁定 已移动 OpenFOAM
4 帖子 2 发布者 2.6k 浏览
  • 从旧到新
  • 从新到旧
  • 最多赞同
回复
  • 在新帖中回复
登录后回复
此主题已被删除。只有拥有主题管理权限的用户可以查看。
  • R 离线
    R 离线
    Rachel0096
    写于 最后由 Rachel0096 编辑
    #1

    各位老师晚上好~
    我自定义求解器编译成功,在运行算例的时候,读取我自定义phaseCoupling.H文件,会出现segmentation fault。其中这个文件是参照之前文章提供的求解器,我只进行了小部分修改。通过逐行输出,可以发现问题主要出现在 Heat_Capacity[volID] += alpha_[cellI]*mesh_.V()[cellI]*Cp_[cellI];这一句。
    可以麻烦有经验的老师帮我看一下可能的错误嘛~
    phaseCoupling.H

     forAll(mesh_.cells(), cellI)
        {
            if (vofID_[cellI] > 0.1)
            {
                Info << " debug6 " << endl;
                // Get volume ID
                label volID = floor(vofID_[cellI] + 0.5);
    
                Info << " debug7 " << endl;
                noCells[volID] += 1;
                Info << " debug8 " << endl;
                cellVolume[volID] += mesh_.V()[cellI];
                Info << " debug9 " << endl;
                volume[volID] += alpha_[cellI]*mesh_.V()[cellI];
                Info << " debug10 " << endl;
                velocity[volID] += alpha_[cellI]*mesh_.V()[cellI]*U_[cellI];
                Info << " debug11 " << endl;
                position[volID] += alpha_[cellI]*mesh_.V()[cellI]*mesh_.C()[cellI];
                Info << " debug12 " << endl;
                Temperature[volID] += alpha_[cellI]*mesh_.V()[cellI]*T_[cellI];
                Info << " debug13 " << endl;
                Heat_Capacity[volID] += alpha_[cellI]*mesh_.V()[cellI]*Cp_[cellI];
                Info << " debug14 " << endl;
                Density[volID] += alpha_[cellI]*mesh_.V()[cellI]*density_[cellI]; 
            }
        }
    

    报错信息:

     debug1 
     debug2 
     debug3 
     debug4 
     debug5 
     debug6 
     debug7
     debug8 
     debug9
     debug10 
     debug11
     debug12 
     debug13 
    #0  Foam::error::printStack(Foam::Ostream&) at ??:?
    #1  Foam::sigSegv::sigHandler(int) at ??:?
    #2  ? in /lib/x86_64-linux-gnu/libpthread.so.0
    #3  Foam::phaseCoupling::update() at ??:?
    #4  ? in ~/OpenFOAM/dyfluid-v2012/platforms/linux64GccDPInt32Opt/bin/mycompressible
    #5  __libc_start_main in /lib/x86_64-linux-gnu/libc.so.6
    #6  ? in ~/OpenFOAM/dyfluid-v2012/platforms/linux64GccDPInt32Opt/bin/mycompressible
    Segmentation fault (core dumped)
    
    
    1 条回复 最后回复
  • 李东岳李 在线
    李东岳李 在线
    李东岳 管理员
    写于 最后由 编辑
    #2

    @Rachel0096 在 运行算例出现segmentation fault 中说:

    Heat_Capacity[volID]

    把这个东西在debug13之后,输出一下看看是什么

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

    R 1 条回复 最后回复
  • R 离线
    R 离线
    Rachel0096
    在 中回复了 李东岳 最后由 编辑
    #3

    @李东岳 李老师
    输出Heat_Capacity[volID]的结果是:Heat Capacity[volID]:9.0420861e-12,这个值异常的小,我后面对这个变量进行累加并加权平均,这导致我液滴的Cp几乎为零,这或许是我segmentation fault的原因?

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

    Cp_[cellI]输出一下

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

    1 条回复 最后回复

  • 登录

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