3D pipe blockMesh 만들기

Main Forums Mesh Generation 3D pipe blockMesh 만들기

This topic contains 5 replies, has 2 voices, and was last updated by Curry Curry 1 year, 10 months ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1217
    Curry
    Curry
    Participant

    안녕하세요. 오늘만 벌써 2번째 질문이네요.
    지금 저는 3차원 파이프 형상의 blocKMesh를 만들고 싶습니다.

    3차원 파이프 형상

    위의 그림과 같은 형태로 만들기 위해서 지금 blockMeshDict를 만들었는데, 제대로 동작을 안하네요.
    아래에 제 blockMeshDict를 첨부하였습니다. 고수님들의 조언 기다리겠습니다.

    /*--------------------------------*- C++ -*----------------------------------*\
    | ========= | |
    | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
    | \\ / O peration | Version: 2.3.1 |
    | \\ / A nd | Web: www.OpenFOAM.org |
    | \\/ M anipulation | |
    \*---------------------------------------------------------------------------*/
    {
    version 2.0;
    format ascii;
    class dictionary;
    object blockMeshDict;
    }
    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
    
    convertToMeters 0.01;
    
    vertices
    (
    (0 0 0) //0
    (0.15 0.15 0)
    (-0.15 0.15 0) 
    (-0.15 -0.15 0)
    (0.15 -0.15 0)
    (0.3 0.3 0)//5
    (-0.3 0.3 0)
    (-0.3 -0.3 0) 
    (0.3 -0.3 0)
    (0.3535 0.3535 0)//9
    (-0.3535 0.3535 0)
    (-0.3535 -0.3535 0)
    (0.3535 -0.3535 0)
    (0.15 0.15 30)//13
    (-0.15 0.15 30)
    (-0.15 -0.15 30)
    (0.15 -0.15 30)
    (0.3 0.3 30) //17
    (-0.3 0.3 30)
    (-0.3 -0.3 30)
    (0.3 -0.3 30)
    (0.3535 0.3535 0) //21
    (-0.3535 0.3535 0)
    (-0.3535 -0.3535 0)
    (0.3535 -0.3535 0)
    (0 0 30) //25
    
    );
    
    blocks
    (
    hex (1 2 3 4 13 14 15 16) (10 10 150) simpleGrading (1 1 1)
    hex (1 5 6 2 13 17 18 14) (10 10 150) simpleGrading (1 1 1)
    hex (2 6 7 3 14 18 19 15) (10 10 150) simpleGrading (1 1 1)
    hex (3 7 8 4 15 19 20 16) (10 10 150) simpleGrading (1 1 1)
    hex (4 8 5 1 16 20 17 13) (10 10 150) simpleGrading (1 1 1)
    hex (5 9 10 6 17 21 22 18) (10 10 150) simpleGrading (1 1 1)
    hex (6 10 11 7 18 22 23 19) (10 10 150) simpleGrading (1 1 1)
    hex (7 11 12 8 19 23 24 20) (10 10 150) simpleGrading (1 1 1)
    hex (12 9 5 8 24 21 17 20) (10 10 150) simpleGrading (1 1 1)
    
    );
    
    edges
    (
    arc 5 6 (0 0.42426 0)
    arc 6 7 (-0.42426 0 0)
    arc 7 8 (0 -0.42426 0)
    arc 8 5 (0.42426 0 0)
    arc 9 10 (0 0.5 0)
    arc 10 11 (-0.5 0 0)
    arc 11 12 ( 0 -0.5 0)
    arc 12 9 (0.5 0 0)
    arc 17 18 (0 0.42426 30)
    arc 18 19 (-0.42426 0 30)
    arc 19 20 (0 -0.42426 30)
    arc 20 17 (0.42426 0 30)
    arc 21 22 (0 0.5 30)
    arc 22 23 (-0.5 0 30)
    arc 23 24 (0 -0.5 30)
    arc 24 21 (0.5 0 30)
    
    );
    boundary
    (
    inlet
    {
    type inlet;
    faces
    (
    (13 16 15 14)
    (13 14 18 17)
    (14 15 19 18)
    (15 16 20 19)
    (16 13 17 20)
    (17 18 22 21)
    (18 19 23 22)
    (19 20 24 23)
    (20 17 21 24)
    
    );
    }
    outlet
    {
    type outlet;
    faces
    (
    (1 5 6 2)
    (2 6 7 3)
    (3 7 8 4)
    (4 8 5 1)
    (1 2 3 4)
    (5 9 10 6)
    (6 10 11 7)
    (7 11 12 8)
    (8 12 9 5)
    
    );
    }
    fixwdWalls
    {
    type fixedWalls;
    faces
    (
    (21 22 10 9)
    (22 23 11 10)
    (23 24 12 11)
    (24 21 9 12)
    );
    }
    );
    
    mergePatchPairs
    (
    );
    
    // ************************************************** *********************** //
    #1218
    ant8si
    ant8si
    Participant

    curry씨 안녕하세요.
    음, 아마 blockMeshDict의 문법이 몇가지 잘못된게 잇는 것 같은데, 일단 BC type드에서 fxdwalls, inlet, outlet 이라는 것은 없습니다.
    patch, wall, empty, symmetryPlane 등등 있는데 이 중에 맞는 걸로 사용하셔야할 것 같네요.
    제가 나름대로 문법에 맞게 수정한 내용 첨부하겠습니다.

    /*--------------------------------*- C++ -*----------------------------------*\
    | =========                 |                                                 |
    | \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
    |  \\    /   O peration     | Version:  2.3.0                                 |
    |   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
    |    \\/     M anipulation  |                                                 |
    \*---------------------------------------------------------------------------*/
    FoamFile
    {
        version     2.0;
        format      ascii;
        class       dictionary;
        object      blockMeshDict;
    }
    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
    
    convertToMeters 0.1;
    
    vertices
    (
        (0 0 0) //0
        (0.15 0.15 0)
        (-0.15 0.15 0)
        (-0.15 -0.15 0)
        (0.15 -0.15 0)
        (0.3 0.3 0)//5
    
        (-0.3 0.3 0)
        (-0.3 -0.3 0)
        (0.3 -0.3 0)
        (0.3535 0.3535 0)//9
    
        (-0.3535 0.3535 0)
        (-0.3535 -0.3535 0)
        (0.3535 -0.3535 0)
        (0.15 0.15 30)//13
    
        (-0.15 0.15 30)
        (-0.15 -0.15 30)
        (0.15 -0.15 30)
        (0.3 0.3 30) //17
    
        (-0.3 0.3 30)
        (-0.3 -0.3 30)
        (0.3 -0.3 30)
        (0.3535 0.3535 0) //21
    
        (-0.3535 0.3535 0)
        (-0.3535 -0.3535 0)
        (0.3535 -0.3535 0)
        (0 0 30) //25
    );
    
    blocks
    (
        hex (1 2 3 4 13 14 15 16) (10 10 150) simpleGrading (1 1 1)
        hex (1 5 6 2 13 17 18 14) (10 10 150) simpleGrading (1 1 1)
        hex (2 6 7 3 14 18 19 15) (10 10 150) simpleGrading (1 1 1)
        hex (3 7 8 4 15 19 20 16) (10 10 150) simpleGrading (1 1 1)
        hex (4 8 5 1 16 20 17 13) (10 10 150) simpleGrading (1 1 1)
        hex (5 9 10 6 17 21 22 18) (10 10 150) simpleGrading (1 1 1)
        hex (6 10 11 7 18 22 23 19) (10 10 150) simpleGrading (1 1 1)
        hex (7 11 12 8 19 23 24 20) (10 10 150) simpleGrading (1 1 1)
        hex (12 9 5 8 24 21 17 20) (10 10 150) simpleGrading (1 1 1)
    );
    
    edges
    (
        arc 5 6 (0 0.42426 0)
        arc 6 7 (-0.42426 0 0)
        arc 7 8 (0 -0.42426 0)
        arc 8 5 (0.42426 0 0)
        arc 9 10 (0 0.5 0)
        arc 10 11 (-0.5 0 0)
        arc 11 12 ( 0 -0.5 0)
        arc 12 9 (0.5 0 0)
        arc 17 18 (0 0.42426 30)
        arc 18 19 (-0.42426 0 30)
        arc 19 20 (0 -0.42426 30)
        arc 20 17 (0.42426 0 30)
        arc 21 22 (0 0.5 30)
        arc 22 23 (-0.5 0 30)
        arc 23 24 (0 -0.5 30)
        arc 24 21 (0.5 0 30)
    );
    
    boundary
    (
        inlet
        {
            type patch;
            faces
            (
            (13 16 15 14)
            (13 14 18 17)
            (14 15 19 18)
            (15 16 20 19)
            (16 13 17 20)
            (17 18 22 21)
            (18 19 23 22)
            (19 20 24 23)
            (20 17 21 24)    
            );
        }
    
        fixedWalls
        {
            type wall;
            faces
            (
            (21 22 10 9)
            (22 23 11 10)
            (23 24 12 11)
            (24 21 9 12)
            );
        }
    
        outlet
        {
            type patch;
            faces
            (
            (1 5 6 2)
            (2 6 7 3)
            (3 7 8 4)
            (4 8 5 1)
            (1 2 3 4)
            (5 9 10 6)
            (6 10 11 7)
            (7 11 12 8)
            (8 12 9 5)
            );
        
        }
    );
    
    mergePatchPairs
    (
    );
    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
    #1219
    Curry
    Curry
    Participant

    ant8si님 답변 감사합니다.
    그런데, 주신 스크립트를 이용해서 blocMesh를 만들고 checkMesh를 실행해봤더니 fail 된 mesh들이 발생합니다.
    log파일 내용을 첨부할테니 한번 확인해봐주실 수 있으신가요?

    Checking geometry...
    Overall domain bounding box (-1.43321 -1.43321 0) (1.43321 1.43321 3)
    Mesh (non-empty, non-wedge) directions (1 1 1)
    Mesh (non-empty) directions (1 1 1)
    Boundary openness (-8.33742e-18 -1.47677e-16 -3.01599e-18) OK.
    ***High aspect ratio cells found, Max aspect ratio: 4896.76, number of cells 2704
    <<Writing 2704 cells with high aspect ratio to set highAspectRatioCells
    Minimum face area = 7.56604e-07. Maximum face area = 0.247873. Face area magnitudes OK.
    Min volume = 2.46125e-08. Max volume = 1.77893e-05. Total volume = 0.2571. Cell volumes OK.
    Mesh non-orthogonality Max: 180 average: 52.447
    *Number of severely non-orthogonal (> 70 degrees) faces: 147240.
    ***Number of non-orthogonality errors: 5716.
    <<Writing 152956 non-orthogonal faces to set nonOrthoFaces
    ***Error in face pyramids: 11432 faces are incorrectly oriented.
    <<Writing 5716 faces with incorrect orientation to set wrongOrientedFaces
    ***Max skewness = 9.38368, 36 highly skew faces detected which may impair the quality of the results
    <<Writing 36 skew faces to set skewFaces
    Coupled point location match (average 0) OK.
    
    Failed 4 mesh checks.
    #1220
    ant8si
    ant8si
    Participant

    일단, 제가 한번 blockMesh를 실행시켜봤는데, 생각한 것이랑은 영 다른 매쉬가 만들어졌네요…
    null
    지금 기본적인 내용부터 많이 잘못된 것 같은데, 일단 다른 참고할만한 자료를 하나 보시는게 좋을 것 같네요.

    • This reply was modified 1 year, 10 months ago by ant8si ant8si.
    #1222
    ant8si
    ant8si
    Participant

    Google을 찾아보니까 볼만한 pipe mesh가 있네요. code와 blockMesh 사진 첨부할게요!

    /*--------------------------------*- C++ -*----------------------------------*\
    | =========                 |                                                 |
    | \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
    |  \\    /   O peration     | Version:  1.7.1                                 |
    |   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
    |    \\/     M anipulation  |                                                 |
    \*---------------------------------------------------------------------------*/
    FoamFile
    {
        version     2.0;
        format      ascii;
        class       dictionary;
        object      blockMeshDict;
    }
    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
    
    convertToMeters 1;
    
    vertices        
    (
    //internal square
        (0 -1 -1) //0
        (1 -1 -1) //1
        (1 -1  1) //2
        (0 -1  1) //3
        (0  1 -1) //4
        (1  1 -1) //5
        (1  1  1) //6
        (0  1  1) //7
    //Going clockwise with sections
    //North section
        (0  2  2) //8
        (0 -2  2) //9
        (1  2  2) //10
        (1 -2  2) //11
    //East section
        (0  2 -2) //12
        (1  2 -2) //13
    //South section
        (0 -2 -2) //14
        (1 -2 -2) //15
    );
    
    edges           
    (
    //North section
       arc  8  9 (0  0     2.82)
       arc 10 11 (1  0     2.82)
    //East section
       arc  8 12 (0  2.82  0)
       arc 10 13 (1  2.82  0)
    //South section
       arc 12 14 (0  0 -2.82 )
       arc 13 15 (1  0 -2.82 )
    //West section
       arc 14  9 (0  -2.82 0)
       arc 15 11 (1  -2.82 0)
    );
    
    blocks
    (
    //Centre
        hex (4 5 6 7 0 1 2 3) (32 48 48) simpleGrading (1 1 1)
    //East section
        hex (8 10 11 9 7 6 2 3) (32 48 92) simpleGrading (1 1 0.25)
    //East section
        hex (12 13 10 8 4 5 6 7) (32 48 92) simpleGrading (1 1 0.25)
    //South section
        hex (14 15 13 12 0 1 5 4) (32 48 92) simpleGrading (1 1 0.25)
    //West section
        hex (9 11 15 14 3 2 1 0) (32 48 92) simpleGrading (1 1 0.25)
    );
    
    patches         
    (
        wall pipeWall
        (
            (9 11 10 8)
            (8 10 13 12)
            (12 14 15 13)
            (14 9 11 15)
        )
        cyclic cNorth
        (
            (9  3 7  8)
            (11 2 6 10)
        )
        cyclic cEast
        (
            (7  4 12  8)
            (6  5 13 10)
        )
        cyclic cSouth
        (
            (0 14 12 4)
            (1 5 13 15)
        )
        cyclic cWest
        (
            (0 14 9 3)
            (1 15 11 2)
        )
        cyclic cCentre
        (
            (0 4 7 3)
            (1 2 6 5)
        )
    );
    
    mergePatchPairs
    (
    );
    
    // ************************************************************************* //

    null

    #1223
    Curry
    Curry
    Participant

    친절한 답변 감사합니다.
    이렇게 직접 code까지 가져다 주실 줄은 몰랐네요.
    arc 기능을 처음 써봤더니, 어떻게 해야할지 모르겠어서 고민 많이 했는데,
    정말 감사합니다!

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.