Salome Preprocessing axisymmetric model valve

author:

Hernando Gasca Garzón

Version

Date

Description

0

2018-12-06

Geometry axisymmetric construction in Salome_Meca for OpenFOAM

This is a base for the axisymmetric mesh generation for OpenFOAM

PY-A910 Bottom Valve

Create Geometry

Body of Geometry generation - import as .py file on Salome - Geometry

d1 = 0.0209
d2 = 0.005
l1 = 0.009854


# Sketch 2D

O = geompy.MakeVertex(0, 0, 0)
OX = geompy.MakeVectorDXDYDZ(1, 0, 0)
OY = geompy.MakeVectorDXDYDZ(0, 1, 0)
OZ = geompy.MakeVectorDXDYDZ(0, 0, 1)
geomObj_1 = geompy.MakeMarker(0, 0, 0, 1, 0, 0, 0, 1, 0)
sk = geompy.Sketcher2D()
sk.addPoint(0.000000, 0.000000)
sk.addSegmentRelative(0.000000, d1/2)
sk.addSegmentRelative(l1, d2/2-d1/2)
sk.addSegmentRelative(l1, d1/2-d2/2)
sk.addSegmentRelative(l1, d2/2-d1/2)
sk.addSegmentRelative(l1, d1/2-d2/2)
sk.addSegmentRelative(l1, d2/2-d1/2)
sk.addSegmentRelative(l1, d1/2-d2/2)
sk.addSegmentRelative(l1, d2/2-d1/2)
sk.addSegmentRelative(l1, d1/2-d2/2)
sk.addSegmentRelative(l1, d2/2-d1/2)
sk.addSegmentRelative(l1, d1/2-d2/2)
sk.addSegmentRelative(l1, d2/2-d1/2)
sk.addSegmentRelative(l1, d1/2-d2/2)
sk.addSegmentRelative(l1, d2/2-d1/2)
sk.addSegmentRelative(l1, d1/2-d2/2)
sk.addSegmentRelative(l1, d2/2-d1/2)
sk.addSegmentRelative(l1, d1/2-d2/2)
sk.addSegmentRelative(l1, d2/2-d1/2)
sk.addSegmentRelative(l1, d1/2-d2/2)
sk.addSegmentRelative(l1, d2/2-d1/2)
sk.addSegmentRelative(l1, d1/2-d2/2)
sk.addSegmentRelative(l1, d2/2-d1/2)
sk.addSegmentRelative(l1, d1/2-d2/2)
sk.addSegmentRelative(l1, d2/2-d1/2)
sk.addSegmentRelative(l1, d1/2-d2/2)
sk.addSegmentRelative(0, -d1/2)
sk.close()
Sketch_1 = sk.wire(geomObj_1)
body = geompy.MakeFaceWires([Sketch_1], 1)
Rotation_1 = geompy.MakeRotation(body, OX, -2.5*math.pi/180.0)

listSubShapeIDs = geompy.SubShapeAllIDs(Rotation_1, geompy.ShapeType["VERTEX"])
listSubShapeIDs = geompy.SubShapeAllIDs(Rotation_1, geompy.ShapeType["VERTEX"])
listSubShapeIDs = geompy.SubShapeAllIDs(Rotation_1, geompy.ShapeType["EDGE"])
listSubShapeIDs = geompy.SubShapeAllIDs(Rotation_1, geompy.ShapeType["EDGE"])
listSubShapeIDs = geompy.SubShapeAllIDs(Rotation_1, geompy.ShapeType["EDGE"])
listSubShapeIDs = geompy.SubShapeAllIDs(Rotation_1, geompy.ShapeType["EDGE"])
listSubShapeIDs = geompy.SubShapeAllIDs(Rotation_1, geompy.ShapeType["EDGE"])
listSubShapeIDs = geompy.SubShapeAllIDs(Rotation_1, geompy.ShapeType["EDGE"])
listSubShapeIDs = geompy.SubShapeAllIDs(Rotation_1, geompy.ShapeType["EDGE"])
listSubShapeIDs = geompy.SubShapeAllIDs(Rotation_1, geompy.ShapeType["EDGE"])
listSubShapeIDs = geompy.SubShapeAllIDs(Rotation_1, geompy.ShapeType["EDGE"])
listSubShapeIDs = geompy.SubShapeAllIDs(Rotation_1, geompy.ShapeType["EDGE"])
listSubShapeIDs = geompy.SubShapeAllIDs(Rotation_1, geompy.ShapeType["EDGE"])
listSubShapeIDs = geompy.SubShapeAllIDs(Rotation_1, geompy.ShapeType["EDGE"])
listSubShapeIDs = geompy.SubShapeAllIDs(Rotation_1, geompy.ShapeType["EDGE"])
listSubShapeIDs = geompy.SubShapeAllIDs(Rotation_1, geompy.ShapeType["EDGE"])
listSubShapeIDs = geompy.SubShapeAllIDs(Rotation_1, geompy.ShapeType["EDGE"])
listSubShapeIDs = geompy.SubShapeAllIDs(Rotation_1, geompy.ShapeType["EDGE"])
listSubShapeIDs = geompy.SubShapeAllIDs(Rotation_1, geompy.ShapeType["EDGE"])
listSubShapeIDs = geompy.SubShapeAllIDs(Rotation_1, geompy.ShapeType["EDGE"])
listSubShapeIDs = geompy.SubShapeAllIDs(Rotation_1, geompy.ShapeType["EDGE"])
listSubShapeIDs = geompy.SubShapeAllIDs(Rotation_1, geompy.ShapeType["EDGE"])
listSubShapeIDs = geompy.SubShapeAllIDs(Rotation_1, geompy.ShapeType["EDGE"])
listSubShapeIDs = geompy.SubShapeAllIDs(Rotation_1, geompy.ShapeType["EDGE"])
listSubShapeIDs = geompy.SubShapeAllIDs(Rotation_1, geompy.ShapeType["EDGE"])
listSubShapeIDs = geompy.SubShapeAllIDs(Rotation_1, geompy.ShapeType["EDGE"])
listSubShapeIDs = geompy.SubShapeAllIDs(Rotation_1, geompy.ShapeType["EDGE"])
listSubShapeIDs = geompy.SubShapeAllIDs(Rotation_1, geompy.ShapeType["EDGE"])
listSubShapeIDs = geompy.SubShapeAllIDs(Rotation_1, geompy.ShapeType["EDGE"])
listSubShapeIDs = geompy.SubShapeAllIDs(Rotation_1, geompy.ShapeType["EDGE"])
listSubShapeIDs = geompy.SubShapeAllIDs(Rotation_1, geompy.ShapeType["EDGE"])
listSubShapeIDs = geompy.SubShapeAllIDs(Rotation_1, geompy.ShapeType["EDGE"])
listSubShapeIDs = geompy.SubShapeAllIDs(Rotation_1, geompy.ShapeType["EDGE"])
listSubShapeIDs = geompy.SubShapeAllIDs(Rotation_1, geompy.ShapeType["EDGE"])
listSubShapeIDs = geompy.SubShapeAllIDs(Rotation_1, geompy.ShapeType["EDGE"])
listSubShapeIDs = geompy.SubShapeAllIDs(Rotation_1, geompy.ShapeType["EDGE"])
listSubShapeIDs = geompy.SubShapeAllIDs(Rotation_1, geompy.ShapeType["EDGE"])
listSubShapeIDs = geompy.SubShapeAllIDs(Rotation_1, geompy.ShapeType["EDGE"])
listSubShapeIDs = geompy.SubShapeAllIDs(Rotation_1, geompy.ShapeType["EDGE"])
listSubShapeIDs = geompy.SubShapeAllIDs(Rotation_1, geompy.ShapeType["EDGE"])
listSubShapeIDs = geompy.SubShapeAllIDs(Rotation_1, geompy.ShapeType["EDGE"])
listSubShapeIDs = geompy.SubShapeAllIDs(Rotation_1, geompy.ShapeType["EDGE"])
listSubShapeIDs = geompy.SubShapeAllIDs(Rotation_1, geompy.ShapeType["EDGE"])
listSubShapeIDs = geompy.SubShapeAllIDs(Rotation_1, geompy.ShapeType["EDGE"])
listSubShapeIDs = geompy.SubShapeAllIDs(Rotation_1, geompy.ShapeType["EDGE"])
listSubShapeIDs = geompy.SubShapeAllIDs(Rotation_1, geompy.ShapeType["EDGE"])
listSubShapeIDs = geompy.SubShapeAllIDs(Rotation_1, geompy.ShapeType["EDGE"])
listSubShapeIDs = geompy.SubShapeAllIDs(Rotation_1, geompy.ShapeType["EDGE"])
listSubShapeIDs = geompy.SubShapeAllIDs(Rotation_1, geompy.ShapeType["EDGE"])
listSubShapeIDs = geompy.SubShapeAllIDs(Rotation_1, geompy.ShapeType["EDGE"])
listSubShapeIDs = geompy.SubShapeAllIDs(Rotation_1, geompy.ShapeType["EDGE"])
listSubShapeIDs = geompy.SubShapeAllIDs(Rotation_1, geompy.ShapeType["EDGE"])
listSubShapeIDs = geompy.SubShapeAllIDs(Rotation_1, geompy.ShapeType["EDGE"])
listSubShapeIDs = geompy.SubShapeAllIDs(Rotation_1, geompy.ShapeType["EDGE"])
listSubShapeIDs = geompy.SubShapeAllIDs(Rotation_1, geompy.ShapeType["EDGE"])
listSubShapeIDs = geompy.SubShapeAllIDs(Rotation_1, geompy.ShapeType["EDGE"])
listSubShapeIDs = geompy.SubShapeAllIDs(Rotation_1, geompy.ShapeType["EDGE"])
listSubShapeIDs = geompy.SubShapeAllIDs(Rotation_1, geompy.ShapeType["EDGE"])
listSubShapeIDs = geompy.SubShapeAllIDs(Rotation_1, geompy.ShapeType["EDGE"])
listSubShapeIDs = geompy.SubShapeAllIDs(Rotation_1, geompy.ShapeType["EDGE"])
listSubShapeIDs = geompy.SubShapeAllIDs(Rotation_1, geompy.ShapeType["EDGE"])
listSubShapeIDs = geompy.SubShapeAllIDs(Rotation_1, geompy.ShapeType["EDGE"])
listSubShapeIDs = geompy.SubShapeAllIDs(Rotation_1, geompy.ShapeType["EDGE"])
listSubShapeIDs = geompy.SubShapeAllIDs(Rotation_1, geompy.ShapeType["EDGE"])
listSubShapeIDs = geompy.SubShapeAllIDs(Rotation_1, geompy.ShapeType["FACE"])
listSubShapeIDs = geompy.SubShapeAllIDs(Rotation_1, geompy.ShapeType["FACE"])
listSubShapeIDs = geompy.SubShapeAllIDs(Rotation_1, geompy.ShapeType["FACE"])
listSubShapeIDs = geompy.SubShapeAllIDs(Rotation_1, geompy.ShapeType["FACE"])
listSubShapeIDs = geompy.SubShapeAllIDs(Rotation_1, geompy.ShapeType["FACE"])
listSubShapeIDs = geompy.SubShapeAllIDs(Rotation_1, geompy.ShapeType["FACE"])
listSubShapeIDs = geompy.SubShapeAllIDs(Rotation_1, geompy.ShapeType["FACE"])
listSubShapeIDs = geompy.SubShapeAllIDs(Rotation_1, geompy.ShapeType["FACE"])
listSubShapeIDs = geompy.SubShapeAllIDs(Rotation_1, geompy.ShapeType["FACE"])
listSubShapeIDs = geompy.SubShapeAllIDs(Rotation_1, geompy.ShapeType["FACE"])
listSubShapeIDs = geompy.SubShapeAllIDs(Rotation_1, geompy.ShapeType["FACE"])
Entrada = geompy.CreateGroup(Rotation_1, geompy.ShapeType["EDGE"])
geompy.UnionIDs(Entrada, [3])
Salida = geompy.CreateGroup(Rotation_1, geompy.ShapeType["EDGE"])
geompy.UnionIDs(Salida, [46])
movingWall = geompy.CreateGroup(Rotation_1, geompy.ShapeType["EDGE"])
geompy.UnionIDs(movingWall, [48])
Pared = geompy.CreateGroup(Rotation_1, geompy.ShapeType["EDGE"])
geompy.UnionIDs(Pared, [6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44])
frontAndBack = geompy.CreateGroup(Rotation_1, geompy.ShapeType["FACE"])
geompy.UnionIDs(frontAndBack, [1])
geompy.addToStudy( O, 'O' )
geompy.addToStudy( OX, 'OX' )
geompy.addToStudy( OY, 'OY' )
geompy.addToStudy( OZ, 'OZ' )
geompy.addToStudy( Sketch_1, 'Sketch_1' )
geompy.addToStudy( body, 'body' )
geompy.addToStudy( Rotation_1, 'Rotation_1' )
geompy.addToStudyInFather( Rotation_1, Entrada, 'Entrada' )
geompy.addToStudyInFather( Rotation_1, Salida, 'Salida' )
geompy.addToStudyInFather( Rotation_1, movingWall, 'movingWall' )
geompy.addToStudyInFather( Rotation_1, Pared, 'Pared' )
geompy.addToStudyInFather( Rotation_1, frontAndBack, 'frontAndBack' )

Create Mesh

2D Nodes: Mesh_1

Go to Salome Mesh On object Browser select Rotation_1 Algorithm: NETGEN 1D-2D Hypotesis: NETGEN 2D Parameters Max. Size 0.0004 Min. Size 0.00004 Fineness Moderate Add. Hyotesis Viscous Layes 2D_1 Total thickness 0.0004 Number of layers 5 Stretch factor 2 Mesh: Compute

Mesh > create groups on Geometry Select all groups on Geometry > Elements > Apply and Close

Revolution Nodes: Mesh_1 Edges: Mesh_1 Faces: Mesh_1

Axis Poiny x=0 y= 0 z= 1e-9 Vector dx=10 Angle Total angle : 5, steps: 1 Tolerance 1e-11 Apply and Close Delete groups on Edges

Use on OpenFOAM

Export UNV file Mesh_1 and copy un /hgasca/OpenFOAM/run/case

ideasUnvToFoam Mesh_1.unv
collapseEdges

it creates a new time

Then replace constant Mesh by new time mesh and review names of boundaries

FoamFile
{
    version     2.0;
    format      ascii;
    class       polyBoundaryMesh;
    location    "1/polyMesh";
    object      boundary;
}

openFoam Flies

Assign patches

6
(
    frontAndBack_neg
    {
        type            wedge;
        nFaces          18029;
        startFace       27619;
    }
    Entrada
    {
        type            patch;
        nFaces          28;
        startFace       45648;
    }
    Salida
    {
        type            patch;
        nFaces          28;
        startFace       45676;
    }
    movingWall
    {
        type            patch;
        nFaces          0;
        startFace       45704;
    }
    Pared
    {
        type            wall;
        nFaces          560;
        startFace       45704;
    }
    frontAndBack_pos
    {
        type            wedge;
        nFaces          18029;
        startFace       46264;
    }
)


Change 6 by 5 an delete movingwall if nFaces = 0 else there is an error in collapse Edges

5
(
    frontAndBack_neg
    {
        type            wedge;
        nFaces          18029;
        startFace       27619;
    }
    Entrada
    {
        type            patch;
        nFaces          28;
        startFace       45648;
    }
    Salida
    {
        type            patch;
        nFaces          28;
        startFace       45676;
    }

    Pared
    {
        type            wall;
        nFaces          560;
        startFace       45704;
    }
    frontAndBack_pos
    {
        type            wedge;
        nFaces          18029;
        startFace       46264;
    }
)

Actions

manually delete new time Then

checkMesh

if errors review your mesh know use pimpleFOAM with one or more processors

decomposePar

Then

mpirun -np 4 pimpleFoam

This is not working on kubunto and OpenFOAM6 by now»

Pruebas