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. toposet之后出现空集。。。

toposet之后出现空集。。。

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

    toposet之后polymesh下set文件夹的文件内全部显示是空集,终端显示识别了你的范围是XXX但是这个范围内狗der没有,我是真不到哪里出问题了。
    toposetdric代码是这样的:

    /*--------------------------------*- C++ -*----------------------------------*\
    | =========                 |                                                 |
    | \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
    |  \\    /   O peration     | Version:  5                                     |
    |   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
    |    \\/     M anipulation  |                                                 |
    \*---------------------------------------------------------------------------*/
    FoamFile
    {
        version     2.0;
        format      ascii;
        class       dictionary;
        location    "system";
        object      topoSetDict;
    }
    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
    
    actions
    (
       {
            name    porous;
            type    cellSet;
            action  new;
            source  boxToCell;
            sourceInfo
            {
                box     (0 0 10) (2000 500 15);
            }
        }
    
       
       /* 
       {
            name    porousZone;
            type    cellZoneSet;
            action  new;
            source  setToCellZone;
            sourceInfo
            {
                set porous;
            }
        }
            */
    
       
        {
            name    inletA;
            type    cellSet;
            action  new;
            source  boxToCell;
            sourceInfo
            {
                box (0 0 15) (0.1 500 25);
            }
        }
    
        {
            name    inletB;
            type    faceSet;
            action  new;
            source  cellToFace;
            sourceInfo
            {
                set     inletA;
                option  all;
            }
        } 
    
        {
            name    inletB;
            type    faceSet;
            action  subset;
            source  patchToFace;
            sourceInfo
            {
                name walls;
            }
        }
    
        {
            name    outletA;
            type    cellSet;
            action  new;
            source  boxToCell;
            sourceInfo
            {
                box (1999.9 0 15) (2000 500 50);
            }
        }
    
        {
            name    outletB;
            type    faceSet;
            action  new;
            source  cellToFace;
            sourceInfo
            {
                set     outletA;
                option  all;
            }
        } 
    
        {
            name    outletB;
            type    faceSet;
            action  subset;
            source  patchToFace;
            sourceInfo
            {
                name walls;
            }
        }
            
    );
    
    // ************************************************************************* //
    
    

    终端是这样说的:

    openfoam@openfoam-virtual-machine:~/OpenFOAM/openfoam-5.x/run/1$ topoSet
    /*---------------------------------------------------------------------------*\
    | =========                 |                                                 |
    | \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
    |  \\    /   O peration     | Version:  5.x                                   |
    |   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
    |    \\/     M anipulation  |                                                 |
    \*---------------------------------------------------------------------------*/
    Build  : 5.x-7f7d351b741b
    Exec   : topoSet
    Date   : Nov 25 2024
    Time   : 09:45:57
    Host   : "openfoam-virtual-machine"
    PID    : 181025
    I/O    : uncollated
    Case   : /home/openfoam/OpenFOAM/openfoam-5.x/run/1
    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 polyMesh for time = 0
    
    Reading topoSetDict
    
    Time = 0
        mesh not changed.
    Created cellZoneSet porous
        Applying source boxToCell
        Adding cells with center within boxes 1((0 0 10) (2000 500 15))
        cellZoneSet porous now size 0
    Created cellSet inletA
        Applying source boxToCell
        Adding cells with center within boxes 1((0 0 15) (0.1 500 25))
        cellSet inletA now size 0
    Created faceSet inletB
        Applying source cellToFace
        Adding faces according to cellSet inletA ...
        faceSet inletB now size 0
    Read set faceSet inletB with size 0
        Applying source patchToFace
        Adding all faces of patch walls ...
        Found matching patch walls with 31250 faces.
        faceSet inletB now size 0
    Created cellSet outletA
        Applying source boxToCell
        Adding cells with center within boxes 1((1999.9 0 15) (2000 500 50))
        cellSet outletA now size 0
    Created faceSet outletB
        Applying source cellToFace
        Adding faces according to cellSet outletA ...
        faceSet outletB now size 0
    Read set faceSet outletB with size 0
        Applying source patchToFace
        Adding all faces of patch walls ...
        Found matching patch walls with 31250 faces.
        faceSet outletB now size 0
    End
    

    blockMesh是这样的:

    /*--------------------------------*- C++ -*----------------------------------*\
    | =========                 |                                                 |
    | \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
    |  \\    /   O peration     | Version:  5                                     |
    |   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
    |    \\/     M anipulation  |                                                 |
    
    FoamFile
    {
        version     2.0;
        format      ascii;
        class       dictionary;
        object      blockMeshDict;
    }
    convertToMeters 0.001;
    vertices
    (
        (0 0 0)                 // 0
        (2000 0 0)               // 1
        (2000 500 0)            // 2
        (0 500 0)              // 3
    
       /* 
        (0 0 15)                // 4
        (2000 0 15)              // 5
        (2000 500 15)           // 6
        (0 500 15)             // 7
        */
    
        (0 0 50)                // 4
        (2000 0 50)              // 5
        (2000 500 50)            // 6
        (0 500 50)             // 7   
    
        // (0 0 25)                // 12
        // (0 500 25)              // 13
    );
    blocks
    (
        hex (0 1 2 3 4 5 6 7) (500 125 25) simpleGrading (1 1 1)
        // hex (4 5 6 7 8 9 10 11) (500 125 35) simpleGrading (1 1 1) 
        
    );
    
    edges
    (
    );
    
    boundary
    (
    
        walls
        {
            type wall;
            faces
            (
                (0 1 5 4)
                (2 3 7 6)
                (0 4 7 3)
                (1 2 6 5)
            );
        }
       
        atmosphere
        {
            type patch;
            faces
            (
                (4 5 6 7)
                (0 1 2 3)
            );
        }
    mergePatchPairs
    (
    );
    

    我搞这个破玩意好几天了,一点头绪没有,还得求着各位大佬帮帮忙瞅一眼。。。。

    1 1 条回复 最后回复
  • 学流体的小明学 离线
    学流体的小明学 离线
    学流体的小明 神
    写于 最后由 编辑
    #2

    你blockMesh文件convertToMeters 0.001;
    实际就是把下面的坐标乘以0.001画网格,画出来的计算域是(0,0,0)到(2,0.5,0.05)。
    而你toposet直接从(0,0,10)开始画box,当然找不到了。

    1 条回复 最后回复
  • 1 离线
    1 离线
    16c
    在 中回复了 16c 最后由 编辑
    #3

    @学流体的小明 在 toposet之后出现空集。。。 中说:

    你blockMesh文件convertToMeters 0.001;
    实际就是把下面的坐标乘以0.001画网格,画出来的计算域是(0,0,0)到(2,0.5,0.05)。
    而你toposet直接从(0,0,10)开始画box,当然找不到了。

    大哥 按你说的改了topoSetDric , box的坐标和网格尺寸我也确定了是能对应上的,但是createPatch并ParaFoam之后出现了inlet这个面变成了豁牙子。。。
    acf02495-3b8e-4b0c-944d-cb4618a69c26-image.png

    改之后的topoSet是这样的:

    /*--------------------------------*- C++ -*----------------------------------*\
    | =========                 |                                                 |
    | \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
    |  \\    /   O peration     | Version:  5                                     |
    |   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
    |    \\/     M anipulation  |                                                 |
    \*---------------------------------------------------------------------------*/
    FoamFile
    {
        version     2.0;
        format      ascii;
        class       dictionary;
        location    "system";
        object      topoSetDict;
    }
    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
    
    actions
    (
       {
            name    porous;
            type    cellSet;
            action  new;
            source  boxToCell;
            sourceInfo
            {
                box     (0 0 10e-3) (2000e-3 500e-3 12e-3);
            }
        }
    
       
       
       {
            name    porousZone;
            type    cellZoneSet;
            action  new;
            source  setToCellZone;
            sourceInfo
            {
                set porous;
            }
        }
            
    
       
        {
            name    inletA;
            type    cellSet;
            action  new;
            source  boxToCell;
            sourceInfo
            {
                box (0 0 12e-3) (4e-3 500e-3 22e-3);
            }
        }
    
        {
            name    inletB;
            type    faceSet;
            action  new;
            source  cellToFace;
            sourceInfo
            {
                set     inletA;
                option  all;
            }
        } 
    
        {
            name    inletB;
            type    faceSet;
            action  subset;
            source  patchToFace;
            sourceInfo
            {
                name walls;
            }
        }
    
        {
            name    outletA;
            type    cellSet;
            action  new;
            source  boxToCell;
            sourceInfo
            {
                box (1.996 0 12e-3) (2 500e-3 50e-3);
            }
        }
    
        {
            name    outletB;
            type    faceSet;
            action  new;
            source  cellToFace;
            sourceInfo
            {
                set     outletA;
                option  all;
            }
        } 
    
        {
            name    outletB;
            type    faceSet;
            action  subset;
            source  patchToFace;
            sourceInfo
            {
                name walls;
            }
        }
            
    );
    
    // ************************************************************************* //
    
    

    createPatch是这样的:

    /*--------------------------------*- C++ -*----------------------------------*\
    | =========                 |                                                 |
    | \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
    |  \\    /   O peration     | Version:  5                                     |
    |   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
    |    \\/     M anipulation  |                                                 |
    \*---------------------------------------------------------------------------*/
    FoamFile
    {
        version     2.0;
        format      ascii;
        class       dictionary;
        object      createPatchDict;
    }
    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
    
    // Do a synchronisation of coupled points after creation of any patches.
    // Note: this does not work with points that are on multiple coupled patches
    //       with transformations (i.e. cyclics).
    pointSync false;
    // writeCyclicMatch  false;
    // Patches to create.
    patches
    (
        {
            name inlet;
            patchInfo
            {
                type            patch;
            }
            constructFrom set;
            set inletB;
        }
    
        {
            name outlet;
            patchInfo
            {
                type            patch;
            }
            constructFrom set;
            set outletB;
        }
    );
    
    // ************************************************************************* //
    
    

    这个豁牙子问题我之前跟着阿B上田东的视频做案例的时候也出现了 不知道是什么玩意 而且case跑完之后他明显是个实际存在的数值上的豁牙子,不是paraview显示问题

    1 条回复 最后回复
  • 学流体的小明学 离线
    学流体的小明学 离线
    学流体的小明 神
    写于 最后由 编辑
    #4

    感觉是topoSet选择网格,提取各种面的时候有些问题了,我没用过这方面的功能,不太了解。
    你如果只是想把边界面提取出来的话,在blockMesh当中就可以设置吧。

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

    豁牙子注意一下toposet点位置的精度。

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

    1 条回复 最后回复
  • 1 离线
    1 离线
    16c
    在 中回复了 学流体的小明 最后由 16c 编辑
    #6

    @学流体的小明 在 toposet之后出现空集。。。 中说:

    感觉是topoSet选择网格,提取各种面的时候有些问题了,我没用过这方面的功能,不太了解。
    你如果只是想把边界面提取出来的话,在blockMesh当中就可以设置吧。

    @李东岳 在 toposet之后出现空集。。。 中说:

    豁牙子注意一下toposet点位置的精度。

    感谢两位大佬提点,豁牙子问题解决了...

    1 条回复 最后回复

  • 登录

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