Dynamic Model¶
The fluid - body interaction must be simmulated due to the movement of the regulator cylinder inside the valve.
In openFoam we will use the dinamycMotionSolverFvMesh, please read:
https://openfoamwiki.net/index.php/Parameter_Definitions_-_dynamicMotionSolverFvMesh
Overset Meshing¶
search in YouTube Overset Meshes with OpenFoam:
https://www.youtube.com/watch?v=0mbmIOf3hRk
Coordinates for the Mesh, in order to create a mapped Mesh we developed the model of the figures:
Create Mesh in salome:
#!/usr/bin/env python
###
### This file is generated automatically by SALOME v9.3.0 with dump python functionality
###
import sys
import salome
salome.salome_init()
import salome_notebook
notebook = salome_notebook.NoteBook()
sys.path.insert(0, r'/home/hgasca/Desktop/valvula')
###
### GEOM component
###
import GEOM
from salome.geom import geomBuilder
import math
import SALOMEDS
geompy = geomBuilder.New()
O = geompy.MakeVertex(0, 0, 0)
OX = geompy.MakeVectorDXDYDZ(1, 0, 0)
OY = geompy.MakeVectorDXDYDZ(0, 1, 0)
OZ = geompy.MakeVectorDXDYDZ(0, 0, 1)
#ALL
GAP1 = 0.003
GAP2 = 0.002
GAP3 = 0.003
#OVERLAP
GAP4 = 0.001
GAP5 = 0.002
GAP6 = 0.0003
GAP7 = 0.0005
#GENERAL
D1 = 0.02365
D2 = 0.022
D3 = 0.003
D4 = 0.0099
D5 = 0.017
D6 = 0.024
D7 = D5
D8 = 0.038
D9 = 0.014
D10 = 0.021
D11 = 0.022
D12 = D7 + 0.001
L1 = 0.070
L2 = 0.001
L3 = 0.00633
L4 = 0.040
L5 = 0.003
L6 = 0.030
L7 = 0.08233
L8 = 0.002
L9 = 0.01
L10 = 0.05
L11 = 0.080
L12 = 0.005
L13 = 0.010
L14 = 0.035
L16 = 0.006
L15 = L14-L16
L17 = 0.010
AVANCE =0.01
Ax = 0
Bx = L1
Bx1=Bx-GAP2
Bx_d =Bx-GAP4
Cx = L1 + L2
Dx = Cx + L3
Ex = Dx + L4
Fx = Ex + L5
Gx = Fx + L6
Gx1= Gx + GAP1
Gx_d = Gx-AVANCE
Hx = Dx + L7
Ix = Hx + L8
Ix_d = Ix+GAP5
Jx = Hx + L17
Kx = Hx + L9
Lx = Jx + L16
Mx = Jx + L14
Nx = Kx + L10
Ox = Nx + L11
Px = Ox + L12
Qx = Px + L13
ay = 0
by = D3/2
by_d = (ay+by)/2
cy = D2/2-GAP6
dy = D1/2
dy2= D1/2-GAP6
dy_d = D6/2
ey = D4/2
fy = D5/2
fy_d = fy+GAP7
gy = D6/2
gy1 = gy + GAP3
hy = D11/2
iy = hy
jy = D8/2
ky = D9/2
ly = D9/2 + 0.001
my = D10/2
sy = D12/2
ty = (hy+sy)/2
#ALL
P_1 = geompy.MakeVertex(Ax, ay, 0)
P_2 = geompy.MakeVertex(Qx, ay, 0)
P_3 = geompy.MakeVertex(Ax, fy, 0)
P_4 = geompy.MakeVertex(Lx, fy, 0)
P_5 = geompy.MakeVertex(Ax, sy, 0)
P_6 = geompy.MakeVertex(Lx, sy, 0)
P_7 = geompy.MakeVertex(Ax, ty, 0)
P_8 = geompy.MakeVertex(Lx, ty, 0)
P_9 = geompy.MakeVertex(Ax, dy, 0)
P_10 = geompy.MakeVertex(Gx1, dy, 0)
P_11 = geompy.MakeVertex(Bx1, gy1, 0)
P_12 = geompy.MakeVertex(Gx1, gy1, 0)
P_13 = geompy.MakeVertex(Hx, ty, 0)
P_14 = geompy.MakeVertex(Hx, iy, 0)
P_15 = geompy.MakeVertex(Kx, jy, 0)
P_16 = geompy.MakeVertex(Nx, jy, 0)
P_17 = geompy.MakeVertex(Nx, hy, 0)
P_18 = geompy.MakeVertex(Mx, ky, 0)
P_19 = geompy.MakeVertex(Qx, ky, 0)
P_20 = geompy.MakeVertex(Nx, ky, 0)
P_21 = geompy.MakeVertex(Ox, ky, 0)
P_22 = geompy.MakeVertex(Ox, ly, 0)
P_23 = geompy.MakeVertex(Px, my, 0)
P_24 = geompy.MakeVertex(Qx, my, 0)
P_25 = geompy.MakeVertex(Bx1, ay, 0)
P_26 = geompy.MakeVertex(Bx1, dy, 0)
P_27 = geompy.MakeVertex(Gx1, ay, 0)
P_28 = geompy.MakeVertex(Hx, ay, 0)
P_29 = geompy.MakeVertex(Hx+(Jx-Hx)*2/3 , ay, 0)
P_30 = geompy.MakeVertex(Hx+(Jx-Hx)*2/3, hy, 0)
P_31 = geompy.MakeVertex(Hx+(Jx-Hx)*1/3, (jy+iy)*2/3, 0)
P_32 = geompy.MakeVertex(Jx, ay, 0)
P_33 = geompy.MakeVertex(Jx, sy, 0)
P_34 = geompy.MakeVertex(Jx, ty, 0)
P_35 = geompy.MakeVertex(Jx, hy, 0)
P_36 = geompy.MakeVertex(Lx, ay, 0)
P_37 = geompy.MakeVertex(Mx, hy, 0)
P_38 = geompy.MakeVertex(Mx, ay, 0)
P_39 = geompy.MakeVertex(Nx, ay, 0)
P_40 = geompy.MakeVertex(Ox, ay, 0)
P_41 = geompy.MakeVertex(Ox+(Px-Ox)*2/3, ay, 0)
P_42 = geompy.MakeVertex(Px, ay, 0)
P_43 = geompy.MakeVertex(Ox+(Px-Ox)*2/3, ky, 0)
P_44 = geompy.MakeVertex(Ox+(Px-Ox)*1/3, (ly+my)*2/3, 0)
P_45 = geompy.MakeVertex(Jx, jy, 0)
P_46 = geompy.MakeVertex(Kx, iy, 0)
P_47 = geompy.MakeVertex(Mx, jy, 0)
P_48 = geompy.MakeVertex(Hx+(Jx-Hx)*1/4 , ay, 0)
P_49 = geompy.MakeVertex(Hx+(Jx-Hx)*1/4 , jy, 0)
#OVERLAP
P_100 = geompy.MakeVertex(Bx_d,by_d,0)
P_101 = geompy.MakeVertex(Ix_d,by_d, 0)
P_102 = geompy.MakeVertex(Bx_d,by,0)
P_103 = geompy.MakeVertex(Ix_d,by,0)
P_104 = geompy.MakeVertex(Bx_d,cy,0)
P_105 = geompy.MakeVertex(Cx,cy,0)
P_106 = geompy.MakeVertex(Bx_d,dy2,0)
P_107 = geompy.MakeVertex(Gx_d,dy2,0)
P_108 = geompy.MakeVertex(Bx_d,dy_d,0)
P_109 = geompy.MakeVertex(Gx_d,dy_d,0)
P_110 = geompy.MakeVertex(Dx,fy_d,0)
P_111 = geompy.MakeVertex(Gx_d,fy_d,0)
P_112 = geompy.MakeVertex(Dx,fy,0)
P_113 = geompy.MakeVertex(Ix_d,fy,0)
P_114 = geompy.MakeVertex(Dx,ey,0)
P_115 = geompy.MakeVertex(Ix_d,ey,0)
P_116 = geompy.MakeVertex(Bx,by_d,0)
P_117 = geompy.MakeVertex(Bx,dy_d,0)
P_118 = geompy.MakeVertex(Cx,by_d,0)
P_119 = geompy.MakeVertex(Cx,by,0)
P_120 = geompy.MakeVertex(Dx,by_d,0)
P_121 = geompy.MakeVertex(Dx,dy,0)
P_122 = geompy.MakeVertex(Dx,dy_d,0)
P_123 = geompy.MakeVertex(Ex,by_d,0)
P_124 = geompy.MakeVertex(Ex,ey,0)
P_125 = geompy.MakeVertex(Ex,fy,0)
P_126 = geompy.MakeVertex(Ex,dy_d,0)
P_127 = geompy.MakeVertex(Fx,by_d,0)
P_128 = geompy.MakeVertex(Fx,ey,0)
P_129 = geompy.MakeVertex(Fx,fy,0)
P_130 = geompy.MakeVertex(Fx,dy_d,0)
P_131 = geompy.MakeVertex(Gx_d,by_d,0)
P_132 = geompy.MakeVertex(Ix_d,fy_d,0)
P_133 = geompy.MakeVertex(Ix,by_d,0)
P_134 = geompy.MakeVertex(Ix,fy_d,0)
## ALL
# Horizontales
Edge_1 = geompy.MakeEdge(P_1, P_2)
Edge_2 = geompy.MakeEdge(P_3, P_4)
Edge_3 = geompy.MakeEdge(P_5, P_6)
Edge_4 = geompy.MakeEdge(P_7, P_8)
Edge_5 = geompy.MakeEdge(P_9, P_10)
Edge_6 = geompy.MakeEdge(P_11, P_12)
Edge_7 = geompy.MakeEdge(P_30, P_35)
Edge_8 = geompy.MakeEdge(P_18, P_20)
Edge_9 = geompy.MakeEdge(P_21, P_19)
Edge_10 = geompy.MakeEdge(P_37, P_17)
# Verticales
Edge_11 = geompy.MakeEdge(P_25, P_11)
Edge_12 = geompy.MakeEdge(P_27, P_12)
Edge_13 = geompy.MakeEdge(P_28, P_14)
Edge_14 = geompy.MakeEdge(P_29, P_30)
Edge_15 = geompy.MakeEdge(P_30, P_31)
Edge_16 = geompy.MakeEdge(P_32, P_45)
Edge_17 = geompy.MakeEdge(P_40, P_21)
Edge_18 = geompy.MakeEdge(P_37, P_47)
Edge_19 = geompy.MakeEdge(P_41, P_43)
Edge_20 = geompy.MakeEdge(P_43, P_44)
Edge_21 = geompy.MakeEdge(P_42, P_23)
Edge_22 = geompy.MakeEdge(P_48, P_49)
## OVERLAP
#Horizontal
Edge_100 = geompy.MakeEdge(P_102, P_103)
Edge_101 = geompy.MakeEdge(P_104, P_105)
Edge_102 = geompy.MakeEdge(P_110, P_111)
Edge_103 = geompy.MakeEdge(P_106, P_107)
Edge_104 = geompy.MakeEdge(P_112, P_113)
Edge_105 = geompy.MakeEdge(P_114, P_115)
#Vertical
Edge_106 = geompy.MakeEdge(P_116, P_117)
Edge_107 = geompy.MakeEdge(P_120, P_122)
Edge_108 = geompy.MakeEdge(P_123, P_126)
Edge_109 = geompy.MakeEdge(P_127, P_130)
Edge_110 = geompy.MakeEdge(P_131, P_111)
Edge_111 = geompy.MakeEdge(P_133, P_134)
## ALL
# 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.addSegmentAbsolute(0.000000, dy)
sk.addSegmentAbsolute(Bx1 , dy)
sk.addSegmentAbsolute(Bx1 , gy1)
sk.addSegmentAbsolute(Gx1 , gy1)
sk.addSegmentAbsolute(Gx1 , ty)
sk.addSegmentAbsolute(Hx , ty)
sk.addSegmentAbsolute(Hx , iy)
sk.addSegmentAbsolute(Kx , jy)
sk.addSegmentAbsolute(Nx , jy)
sk.addSegmentAbsolute(Nx , ky)
sk.addSegmentAbsolute(Ox , ky)
sk.addSegmentAbsolute(Ox , ly)
sk.addSegmentAbsolute(Px , my)
sk.addSegmentAbsolute(Qx , my)
sk.addSegmentAbsolute(Qx , ay)
sk.close()
Sketch_1 = sk.wire(geomObj_1)
body1 = geompy.MakeFaceWires([Sketch_1], 1)
geomObj_2 = geompy.MakeMarker(0, 0, 0, 1, 0, 0, 0, 1, 0)
sk = geompy.Sketcher2D()
sk.addPoint(Lx, 0.000000)
sk.addSegmentAbsolute(Lx , ty)
sk.addSegmentAbsolute(Jx , ty)
sk.addSegmentAbsolute(Jx , hy)
sk.addSegmentAbsolute(Mx , hy)
sk.addSegmentAbsolute(Mx , 0)
sk.close()
Sketch_2 = sk.wire(geomObj_2)
body2 = geompy.MakeFaceWires([Sketch_2], 1)
body = geompy.MakeCutList(body1, [body2], True)
Partition_1 = geompy.MakePartition([body], [Edge_1, Edge_2, Edge_3, Edge_4, Edge_5, Edge_6, Edge_7, Edge_8, Edge_9, Edge_10, Edge_11, Edge_12, Edge_13, Edge_14, Edge_15, Edge_16, Edge_17, Edge_18, Edge_19, Edge_20,
Edge_21, Edge_22], [], [], geompy.ShapeType["FACE"], 0, [], 0)
Rotation_1 = geompy.MakeRotation(Partition_1, OX, -2.5*math.pi/180.0)
[Edge_23,Edge_24,Edge_25,Edge_26] = geompy.SubShapes(Rotation_1, [181, 162, 126, 193])
[Edge_27,Edge_28] = geompy.SubShapes(Rotation_1, [231, 236])
[Edge_29,Edge_30,Edge_31,Edge_32,Edge_33,Edge_34,Edge_35,Edge_36,Edge_37,Edge_38,Edge_39] = geompy.SubShapes(Rotation_1, [18, 51, 68, 172, 217, 128, 32, 229, 11, 203, 92])
[Edge_40,Edge_41,Edge_42,Edge_43,Edge_44,Edge_45,Edge_46,Edge_47,Edge_48,Edge_49,Edge_50,Edge_51,Edge_52,Edge_53,Edge_54,Edge_55,Edge_56,Edge_57,Edge_58,Edge_59,Edge_60,Edge_61,Edge_62,Edge_63,Edge_64,Edge_65,Edge_66] = geompy.SubShapes(Rotation_1, [226, 107, 176, 114, 121, 21, 200, 184, 117, 170, 155, 196, 40, 191, 238, 146, 157, 81, 212, 4, 42, 136, 141, 198, 150, 214, 143])
[Face_1,Face_2,Face_3] = geompy.SubShapes(Rotation_1, [134, 38, 194])
## OVERLAP
# 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_3 = geompy.MakeMarker(0, 0, 0, 1, 0, 0, 0, 1, 0)
sk = geompy.Sketcher2D()
sk.addPoint(Bx_d, by_d)
sk.addSegmentAbsolute(Bx_d, dy_d)
sk.addSegmentAbsolute(Gx_d , dy_d)
sk.addSegmentAbsolute(Gx_d , fy_d)
sk.addSegmentAbsolute(Ix_d , fy_d)
sk.addSegmentAbsolute(Ix_d , by_d)
sk.close()
Sketch_3 = sk.wire(geomObj_3)
body3 = geompy.MakeFaceWires([Sketch_3], 1)
geomObj_4 = geompy.MakeMarker(0, 0, 0, 1, 0, 0, 0, 1, 0)
sk = geompy.Sketcher2D()
sk.addPoint(Cx, by)
sk.addSegmentAbsolute(Cx , cy)
sk.addSegmentAbsolute(Bx , cy)
sk.addSegmentAbsolute(Bx , dy2)
sk.addSegmentAbsolute(Dx , dy2)
sk.addSegmentAbsolute(Dx , fy)
sk.addSegmentAbsolute(Ex , fy)
sk.addSegmentAbsolute(Ex , ey)
sk.addSegmentAbsolute(Dx , ey)
sk.addSegmentAbsolute(Dx , by)
sk.close()
Sketch_4 = sk.wire(geomObj_4)
body4 = geompy.MakeFaceWires([Sketch_4], 1)
geomObj_5 = geompy.MakeMarker(0, 0, 0, 1, 0, 0, 0, 1, 0)
sk = geompy.Sketcher2D()
sk.addPoint(Fx, ey)
sk.addSegmentAbsolute(Fx , fy)
sk.addSegmentAbsolute(Ix , fy)
sk.addSegmentAbsolute(Ix , ey)
sk.close()
Sketch_5 = sk.wire(geomObj_5)
body5 = geompy.MakeFaceWires([Sketch_5], 1)
bodyII = geompy.MakeCutList(body3, [body4,body5], True)
Partition_2 = geompy.MakePartition([bodyII], [Edge_100, Edge_101, Edge_102, Edge_103, Edge_104, Edge_105, Edge_106, Edge_107, Edge_108, Edge_109, Edge_110, Edge_111], [], [], geompy.ShapeType["FACE"], 0, [], 0)
Rotation_2 = geompy.MakeRotation(Partition_2, OX, -2.5*math.pi/180.0)
[Edge_67,Edge_68,Edge_69,Edge_70,Edge_71,Edge_72,Edge_73,Edge_74,Edge_75,Edge_76,Edge_77,Edge_78,Edge_79,Edge_80,Edge_81,Edge_82,Edge_83] = geompy.SubShapes(Rotation_2, [30, 89, 124, 37, 112, 67, 119, 184, 149, 25, 122, 115, 181, 39, 65, 70, 172])
[Edge_84,Edge_85,Edge_86,Edge_87,Edge_88,Edge_89,Edge_90,Edge_91,Edge_92,Edge_93,Edge_94,Edge_95,Edge_96,Edge_97,Edge_98,Edge_99,Edge_112,Edge_113,Edge_114,Edge_115,Edge_116,Edge_117,Edge_118,Edge_119] = geompy.SubShapes(Rotation_2, [77, 56, 190, 140, 21, 137, 34, 167, 53, 74, 157, 142, 11, 103, 164, 162, 100, 192, 4, 177, 18, 187, 51, 42])
inlet = geompy.CreateGroup(Rotation_1, geompy.ShapeType["EDGE"])
geompy.UnionIDs(inlet, [181, 162, 126, 193])
outlet = geompy.CreateGroup(Rotation_1, geompy.ShapeType["EDGE"])
geompy.UnionIDs(outlet, [231, 236])
axys = geompy.CreateGroup(Rotation_1, geompy.ShapeType["EDGE"])
geompy.UnionIDs(axys, [18, 51, 68, 172, 217, 128, 32, 229, 11, 203, 92])
wall_ext = geompy.CreateGroup(Rotation_1, geompy.ShapeType["EDGE"])
geompy.UnionIDs(wall_ext, [226, 107, 176, 114, 121, 21, 200, 184, 117, 170, 155, 196, 40, 191, 238, 146, 157, 81, 212, 4, 42, 136, 141, 198, 150, 214, 143])
porous = geompy.CreateGroup(Rotation_1, geompy.ShapeType["FACE"])
geompy.UnionIDs(porous, [134, 38, 194])
back = geompy.CreateGroup(Rotation_1, geompy.ShapeType["FACE"])
geompy.UnionIDs(back, [2, 12, 19, 26, 33, 45, 52, 57, 62, 69, 74, 79, 86, 93, 98, 103, 110, 115, 122, 129, 139, 144, 153, 158, 163, 168, 177, 182, 189, 201, 208, 215, 222, 227, 234])
wall = geompy.CreateGroup(Rotation_2, geompy.ShapeType["EDGE"])
geompy.UnionIDs(wall, [30, 89, 124, 37, 112, 67, 119, 184, 149, 25, 122, 115, 181, 39, 65, 70, 172])
oversetPatch = geompy.CreateGroup(Rotation_2, geompy.ShapeType["EDGE"])
geompy.UnionIDs(oversetPatch, [77, 56, 190, 140, 21, 137, 34, 167, 53, 74, 157, 142, 11, 103, 164, 162, 100, 192, 4, 177, 18, 187, 51, 42])
back_1 = geompy.CreateGroup(Rotation_2, geompy.ShapeType["FACE"])
geompy.UnionIDs(back_1, [2, 12, 19, 28, 35, 40, 47, 54, 61, 68, 75, 82, 87, 96, 101, 108, 113, 120, 126, 133, 138, 145, 150, 153, 160, 165, 170, 175, 182, 188])
geompy.addToStudy( P_1, 'P_1' )
geompy.addToStudy( P_2, 'P_2' )
geompy.addToStudy( P_3, 'P_3' )
geompy.addToStudy( P_4, 'P_4' )
geompy.addToStudy( P_5, 'P_5' )
geompy.addToStudy( P_6, 'P_6' )
geompy.addToStudy( P_7, 'P_7' )
geompy.addToStudy( P_8, 'P_8' )
geompy.addToStudy( P_9, 'P_9' )
geompy.addToStudy( P_10, 'P_10' )
geompy.addToStudy( P_11, 'P_11' )
geompy.addToStudy( P_12, 'P_12' )
geompy.addToStudy( P_13, 'P_13' )
geompy.addToStudy( P_14, 'P_14' )
geompy.addToStudy( P_15, 'P_15' )
geompy.addToStudy( P_16, 'P_16' )
geompy.addToStudy( P_17, 'P_17' )
geompy.addToStudy( P_18, 'P_18' )
geompy.addToStudy( P_19, 'P_19' )
geompy.addToStudy( P_20, 'P_20' )
geompy.addToStudy( P_21, 'P_21' )
geompy.addToStudy( P_22, 'P_22' )
geompy.addToStudy( P_23, 'P_23' )
geompy.addToStudy( P_24, 'P_24' )
geompy.addToStudy( P_25, 'P_25' )
geompy.addToStudy( P_26, 'P_26' )
geompy.addToStudy( P_27, 'P_27' )
geompy.addToStudy( P_28, 'P_28' )
geompy.addToStudy( P_29, 'P_29' )
geompy.addToStudy( P_30, 'P_30' )
geompy.addToStudy( P_31, 'P_31' )
geompy.addToStudy( P_32, 'P_32' )
geompy.addToStudy( P_33, 'P_33' )
geompy.addToStudy( P_34, 'P_34' )
geompy.addToStudy( P_35, 'P_35' )
geompy.addToStudy( P_36, 'P_36' )
geompy.addToStudy( P_37, 'P_37' )
geompy.addToStudy( P_38, 'P_38' )
geompy.addToStudy( P_39, 'P_39' )
geompy.addToStudy( P_40, 'P_40' )
geompy.addToStudy( P_41, 'P_41' )
geompy.addToStudy( P_42, 'P_42' )
geompy.addToStudy( P_43, 'P_43' )
geompy.addToStudy( P_44, 'P_44' )
geompy.addToStudy( P_45, 'P_45' )
geompy.addToStudy( P_46, 'P_46' )
geompy.addToStudy( P_47, 'P_47' )
geompy.addToStudy( P_48, 'P_48' )
geompy.addToStudy( P_49, 'P_49' )
geompy.addToStudy( P_100, 'P_100' )
geompy.addToStudy( P_101, 'P_101' )
geompy.addToStudy( P_102, 'P_102' )
geompy.addToStudy( P_103, 'P_103' )
geompy.addToStudy( P_104, 'P_104' )
geompy.addToStudy( P_105, 'P_105' )
geompy.addToStudy( P_106, 'P_106' )
geompy.addToStudy( P_107, 'P_107' )
geompy.addToStudy( P_108, 'P_108' )
geompy.addToStudy( P_109, 'P_109' )
geompy.addToStudy( P_110, 'P_110' )
geompy.addToStudy( P_111, 'P_111' )
geompy.addToStudy( P_112, 'P_112' )
geompy.addToStudy( P_113, 'P_113' )
geompy.addToStudy( P_114, 'P_114' )
geompy.addToStudy( P_115, 'P_115' )
geompy.addToStudy( P_116, 'P_116' )
geompy.addToStudy( P_117, 'P_117' )
geompy.addToStudy( P_118, 'P_118' )
geompy.addToStudy( P_119, 'P_119' )
geompy.addToStudy( P_120, 'P_120' )
geompy.addToStudy( P_121, 'P_121' )
geompy.addToStudy( P_122, 'P_122' )
geompy.addToStudy( P_123, 'P_123' )
geompy.addToStudy( P_124, 'P_124' )
geompy.addToStudy( P_125, 'P_125' )
geompy.addToStudy( P_126, 'P_126' )
geompy.addToStudy( P_127, 'P_127' )
geompy.addToStudy( P_128, 'P_128' )
geompy.addToStudy( P_129, 'P_129' )
geompy.addToStudy( P_130, 'P_130' )
geompy.addToStudy( P_131, 'P_131' )
geompy.addToStudy( P_132, 'P_132' )
geompy.addToStudy( P_133, 'P_133' )
geompy.addToStudy( P_134, 'P_134' )
geompy.addToStudy( Edge_1, 'Edge_1' )
geompy.addToStudy( Edge_2, 'Edge_2' )
geompy.addToStudy( Edge_3, 'Edge_3' )
geompy.addToStudy( Edge_4, 'Edge_4' )
geompy.addToStudy( Edge_5, 'Edge_5' )
geompy.addToStudy( Edge_6, 'Edge_6' )
geompy.addToStudy( Edge_7, 'Edge_7' )
geompy.addToStudy( Edge_8, 'Edge_8' )
geompy.addToStudy( Edge_9, 'Edge_9' )
geompy.addToStudy( Edge_10, 'Edge_10' )
geompy.addToStudy( Edge_11, 'Edge_11' )
geompy.addToStudy( Edge_12, 'Edge_12' )
geompy.addToStudy( Edge_13, 'Edge_13' )
geompy.addToStudy( Edge_14, 'Edge_14' )
geompy.addToStudy( Edge_15, 'Edge_15' )
geompy.addToStudy( Edge_16, 'Edge_16' )
geompy.addToStudy( Edge_17, 'Edge_17' )
geompy.addToStudy( Edge_18, 'Edge_18' )
geompy.addToStudy( Edge_19, 'Edge_19' )
geompy.addToStudy( Edge_20, 'Edge_20' )
geompy.addToStudy( Edge_21, 'Edge_21' )
geompy.addToStudy( Edge_22, 'Edge_22' )
geompy.addToStudy( Edge_100, 'Edge_100' )
geompy.addToStudy( Edge_101, 'Edge_101' )
geompy.addToStudy( Edge_102, 'Edge_102' )
geompy.addToStudy( Edge_103, 'Edge_103' )
geompy.addToStudy( Edge_104, 'Edge_104' )
geompy.addToStudy( Edge_105, 'Edge_105' )
geompy.addToStudy( Edge_106, 'Edge_106' )
geompy.addToStudy( Edge_107, 'Edge_107' )
geompy.addToStudy( Edge_108, 'Edge_108' )
geompy.addToStudy( Edge_109, 'Edge_109' )
geompy.addToStudy( Edge_110, 'Edge_110' )
geompy.addToStudy( Edge_111, 'Edge_111' )
geompy.addToStudy( Sketch_1, 'Sketch_1' )
geompy.addToStudy( body1, 'body1' )
geompy.addToStudy( Sketch_2, 'Sketch_2' )
geompy.addToStudy( body2, 'body2' )
geompy.addToStudy( body, 'body' )
geompy.addToStudy( Partition_1, 'Partition_1')
geompy.addToStudy( Rotation_1, 'Rotation_1' )
geompy.addToStudy( O, 'O' )
geompy.addToStudy( OX, 'OX' )
geompy.addToStudy( OY, 'OY' )
geompy.addToStudy( OZ, 'OZ' )
geompy.addToStudy( Sketch_3, 'Sketch_3' )
geompy.addToStudy( body3, 'body3' )
geompy.addToStudy( Sketch_4, 'Sketch_4' )
geompy.addToStudy( body4, 'body4' )
geompy.addToStudy( Sketch_5, 'Sketch_5' )
geompy.addToStudy( body5, 'body5' )
geompy.addToStudy( bodyII, 'bodyII' )
geompy.addToStudy( Partition_2, 'Partition_2' )
geompy.addToStudy( Rotation_2, 'Rotation_2' )
geompy.addToStudyInFather( Rotation_1, Edge_23, 'Edge_23' )
geompy.addToStudyInFather( Rotation_1, Edge_24, 'Edge_24' )
geompy.addToStudyInFather( Rotation_1, Edge_25, 'Edge_25' )
geompy.addToStudyInFather( Rotation_1, Edge_26, 'Edge_26' )
geompy.addToStudyInFather( Rotation_1, inlet, 'inlet' )
geompy.addToStudyInFather( Rotation_1, Edge_27, 'Edge_27' )
geompy.addToStudyInFather( Rotation_1, Edge_28, 'Edge_28' )
geompy.addToStudyInFather( Rotation_1, outlet, 'outlet' )
geompy.addToStudyInFather( Rotation_1, Edge_29, 'Edge_29' )
geompy.addToStudyInFather( Rotation_1, Edge_30, 'Edge_30' )
geompy.addToStudyInFather( Rotation_1, Edge_31, 'Edge_31' )
geompy.addToStudyInFather( Rotation_1, Edge_32, 'Edge_32' )
geompy.addToStudyInFather( Rotation_1, Edge_33, 'Edge_33' )
geompy.addToStudyInFather( Rotation_1, Edge_34, 'Edge_34' )
geompy.addToStudyInFather( Rotation_1, Edge_35, 'Edge_35' )
geompy.addToStudyInFather( Rotation_1, Edge_36, 'Edge_36' )
geompy.addToStudyInFather( Rotation_1, Edge_37, 'Edge_37' )
geompy.addToStudyInFather( Rotation_1, Edge_38, 'Edge_38' )
geompy.addToStudyInFather( Rotation_1, Edge_39, 'Edge_39' )
geompy.addToStudyInFather( Rotation_1, axys, 'axys' )
geompy.addToStudyInFather( Rotation_1, Edge_40, 'Edge_40' )
geompy.addToStudyInFather( Rotation_1, Edge_41, 'Edge_41' )
geompy.addToStudyInFather( Rotation_1, Edge_42, 'Edge_42' )
geompy.addToStudyInFather( Rotation_1, Edge_43, 'Edge_43' )
geompy.addToStudyInFather( Rotation_1, Edge_44, 'Edge_44' )
geompy.addToStudyInFather( Rotation_1, Edge_45, 'Edge_45' )
geompy.addToStudyInFather( Rotation_1, Edge_46, 'Edge_46' )
geompy.addToStudyInFather( Rotation_1, Edge_47, 'Edge_47' )
geompy.addToStudyInFather( Rotation_1, Edge_48, 'Edge_48' )
geompy.addToStudyInFather( Rotation_1, Edge_49, 'Edge_49' )
geompy.addToStudyInFather( Rotation_1, Edge_50, 'Edge_50' )
geompy.addToStudyInFather( Rotation_1, Edge_51, 'Edge_51' )
geompy.addToStudyInFather( Rotation_1, Edge_52, 'Edge_52' )
geompy.addToStudyInFather( Rotation_1, Edge_53, 'Edge_53' )
geompy.addToStudyInFather( Rotation_1, Edge_54, 'Edge_54' )
geompy.addToStudyInFather( Rotation_1, Edge_55, 'Edge_55' )
geompy.addToStudyInFather( Rotation_1, Edge_56, 'Edge_56' )
geompy.addToStudyInFather( Rotation_1, Edge_57, 'Edge_57' )
geompy.addToStudyInFather( Rotation_1, Edge_58, 'Edge_58' )
geompy.addToStudyInFather( Rotation_1, Edge_59, 'Edge_59' )
geompy.addToStudyInFather( Rotation_1, Edge_60, 'Edge_60' )
geompy.addToStudyInFather( Rotation_1, Edge_61, 'Edge_61' )
geompy.addToStudyInFather( Rotation_1, Edge_62, 'Edge_62' )
geompy.addToStudyInFather( Rotation_1, Edge_63, 'Edge_63' )
geompy.addToStudyInFather( Rotation_1, Edge_64, 'Edge_64' )
geompy.addToStudyInFather( Rotation_1, Edge_65, 'Edge_65' )
geompy.addToStudyInFather( Rotation_1, Edge_66, 'Edge_66' )
geompy.addToStudyInFather( Rotation_1, wall_ext, 'wall_ext' )
geompy.addToStudyInFather( Rotation_1, Face_1, 'Face_1' )
geompy.addToStudyInFather( Rotation_1, Face_2, 'Face_2' )
geompy.addToStudyInFather( Rotation_1, Face_3, 'Face_3' )
geompy.addToStudyInFather( Rotation_1, porous, 'porous' )
geompy.addToStudyInFather( Rotation_1, back, 'back' )
geompy.addToStudyInFather( Rotation_2, Edge_67, 'Edge_67' )
geompy.addToStudyInFather( Rotation_2, Edge_68, 'Edge_68' )
geompy.addToStudyInFather( Rotation_2, Edge_69, 'Edge_69' )
geompy.addToStudyInFather( Rotation_2, Edge_70, 'Edge_70' )
geompy.addToStudyInFather( Rotation_2, Edge_71, 'Edge_71' )
geompy.addToStudyInFather( Rotation_2, Edge_72, 'Edge_72' )
geompy.addToStudyInFather( Rotation_2, Edge_73, 'Edge_73' )
geompy.addToStudyInFather( Rotation_2, Edge_74, 'Edge_74' )
geompy.addToStudyInFather( Rotation_2, Edge_75, 'Edge_75' )
geompy.addToStudyInFather( Rotation_2, Edge_76, 'Edge_76' )
geompy.addToStudyInFather( Rotation_2, Edge_77, 'Edge_77' )
geompy.addToStudyInFather( Rotation_2, Edge_78, 'Edge_78' )
geompy.addToStudyInFather( Rotation_2, Edge_79, 'Edge_79' )
geompy.addToStudyInFather( Rotation_2, Edge_80, 'Edge_80' )
geompy.addToStudyInFather( Rotation_2, Edge_81, 'Edge_81' )
geompy.addToStudyInFather( Rotation_2, Edge_82, 'Edge_82' )
geompy.addToStudyInFather( Rotation_2, Edge_83, 'Edge_83' )
geompy.addToStudyInFather( Rotation_2, wall, 'wall' )
geompy.addToStudyInFather( Rotation_2, Edge_84, 'Edge_84' )
geompy.addToStudyInFather( Rotation_2, Edge_85, 'Edge_85' )
geompy.addToStudyInFather( Rotation_2, Edge_86, 'Edge_86' )
geompy.addToStudyInFather( Rotation_2, Edge_87, 'Edge_87' )
geompy.addToStudyInFather( Rotation_2, Edge_88, 'Edge_88' )
geompy.addToStudyInFather( Rotation_2, Edge_89, 'Edge_89' )
geompy.addToStudyInFather( Rotation_2, Edge_90, 'Edge_90' )
geompy.addToStudyInFather( Rotation_2, Edge_91, 'Edge_91' )
geompy.addToStudyInFather( Rotation_2, Edge_92, 'Edge_92' )
geompy.addToStudyInFather( Rotation_2, Edge_93, 'Edge_93' )
geompy.addToStudyInFather( Rotation_2, Edge_94, 'Edge_94' )
geompy.addToStudyInFather( Rotation_2, Edge_95, 'Edge_95' )
geompy.addToStudyInFather( Rotation_2, Edge_96, 'Edge_96' )
geompy.addToStudyInFather( Rotation_2, Edge_97, 'Edge_97' )
geompy.addToStudyInFather( Rotation_2, Edge_98, 'Edge_98' )
geompy.addToStudyInFather( Rotation_2, Edge_99, 'Edge_99' )
geompy.addToStudyInFather( Rotation_2, Edge_112, 'Edge_112' )
geompy.addToStudyInFather( Rotation_2, Edge_113, 'Edge_113' )
geompy.addToStudyInFather( Rotation_2, Edge_114, 'Edge_114' )
geompy.addToStudyInFather( Rotation_2, Edge_115, 'Edge_115' )
geompy.addToStudyInFather( Rotation_2, Edge_116, 'Edge_116' )
geompy.addToStudyInFather( Rotation_2, Edge_117, 'Edge_117' )
geompy.addToStudyInFather( Rotation_2, Edge_118, 'Edge_118' )
geompy.addToStudyInFather( Rotation_2, Edge_119, 'Edge_119' )
geompy.addToStudyInFather( Rotation_2, oversetPatch, 'oversetPatch' )
geompy.addToStudyInFather( Rotation_2, back_1, 'back' )
###
### SMESH component
###
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
smesh = smeshBuilder.New()
#smesh.SetEnablePublish( False ) # Set to False to avoid publish in study if not needed or in some particular situations:
# multiples meshes built in parallel, complex and numerous mesh edition (performance)
Mesh_1 = smesh.Mesh(Rotation_1)
Regular_1D = Mesh_1.Segment()
Local_Length_1 = Regular_1D.LocalLength(0.0002,None,1e-09)
Quadrangle_2D = Mesh_1.Quadrangle(algo=smeshBuilder.QUADRANGLE)
isDone = Mesh_1.Compute()
inlet_1 = Mesh_1.GroupOnGeom(inlet,'inlet',SMESH.EDGE)
outlet_1 = Mesh_1.GroupOnGeom(outlet,'outlet',SMESH.EDGE)
axys_1 = Mesh_1.GroupOnGeom(axys,'axys',SMESH.EDGE)
wall_ext_1 = Mesh_1.GroupOnGeom(wall_ext,'wall_ext',SMESH.EDGE)
porous_1 = Mesh_1.GroupOnGeom(porous,'porous',SMESH.FACE)
back_2 = Mesh_1.GroupOnGeom(back,'back',SMESH.FACE)
[ inlet_rotated, outlet_rotated, axys_rotated, wall_ext_rotated, porous_rotated, back_rotated, inlet_top, outlet_top, axys_top, wall_ext_top, porous_top, back_top ] = Mesh_1.RotationSweepObjects( [ Mesh_1 ], [ Mesh_1 ], [ Mesh_1 ], SMESH.AxisStruct( 0, 0, 9e-09, 10, 0, 0 ), 0.0872665, 1, 1e-11, 1 )
Mesh_2 = smesh.Mesh(Rotation_2)
Regular_1D_1 = Mesh_2.Segment()
Local_Length_2 = Regular_1D_1.LocalLength(0.0002,None,1e-09)
Quadrangle_2D_1 = Mesh_2.Quadrangle(algo=smeshBuilder.QUADRANGLE)
isDone = Mesh_2.Compute()
wall_1 = Mesh_2.GroupOnGeom(wall,'wall',SMESH.EDGE)
oversetPatch_1 = Mesh_2.GroupOnGeom(oversetPatch,'oversetPatch',SMESH.EDGE)
back_3 = Mesh_2.GroupOnGeom(back_1,'back',SMESH.FACE)
[ wall_rotated, oversetPatch_rotated, back_rotated_1, wall_top, oversetPatch_top, back_top_1 ] = Mesh_2.RotationSweepObjects( [ Mesh_2 ], [ Mesh_2 ], [ Mesh_2 ], SMESH.AxisStruct( 0, 0, 9e-09, 10, 0, 0 ), 0.0872665, 1, 1e-11, 1 )
## Set names of Mesh objects
smesh.SetName(wall_1, 'wall')
smesh.SetName(Regular_1D.GetAlgorithm(), 'Regular_1D')
smesh.SetName(back_top, 'back_top')
smesh.SetName(Quadrangle_2D.GetAlgorithm(), 'Quadrangle_2D')
smesh.SetName(Local_Length_2, 'Local Length_2')
smesh.SetName(back_rotated_1, 'back_rotated')
smesh.SetName(Local_Length_1, 'Local Length_1')
smesh.SetName(porous_1, 'porous')
smesh.SetName(back_2, 'back')
smesh.SetName(inlet_rotated, 'inlet_rotated')
smesh.SetName(outlet_rotated, 'outlet_rotated')
smesh.SetName(axys_rotated, 'axys_rotated')
smesh.SetName(wall_ext_rotated, 'wall_ext_rotated')
smesh.SetName(porous_top, 'porous_top')
smesh.SetName(Mesh_1.GetMesh(), 'Mesh_1')
smesh.SetName(Mesh_2.GetMesh(), 'Mesh_2')
smesh.SetName(back_rotated, 'back_rotated')
smesh.SetName(porous_rotated, 'porous_rotated')
smesh.SetName(wall_ext_top, 'wall_ext_top')
smesh.SetName(back_top_1, 'back_top')
smesh.SetName(oversetPatch_rotated, 'oversetPatch_rotated')
smesh.SetName(wall_rotated, 'wall_rotated')
smesh.SetName(inlet_1, 'inlet')
smesh.SetName(back_3, 'back')
smesh.SetName(axys_1, 'axys')
smesh.SetName(outlet_1, 'outlet')
smesh.SetName(inlet_top, 'inlet_top')
smesh.SetName(wall_ext_1, 'wall_ext')
smesh.SetName(axys_top, 'axys_top')
smesh.SetName(outlet_top, 'outlet_top')
smesh.SetName(oversetPatch_top, 'oversetPatch_top')
smesh.SetName(oversetPatch_1, 'oversetPatch')
smesh.SetName(wall_top, 'wall_top')
if salome.sg.hasDesktop():
salome.sg.updateObjBrowser()
Here we have created two meshes, one for the overset object (moving part) and other for the fixed cells.
The mesh corresponding to the fixed part coantains the inlet, outlet and wall_ext. It also has zones to identify the porous and the fluid zone.
The use of the overSet feature is exclusive for the openFoam ESI version, in this case we installed the 19.12 version. It created the folder /home/hgasca/openFoam/hgasca-v1912/run, there we created the case folders FRV… and inside three folders called all, cylinder ans ref_sol as in the overSet tutorials.
The cylinder folder contains a constant and system folder in order to create the Mesh from the .unv salome file. The all folder will contain the complete case. The oversetPatch was created without the hole region which could be produced later.
This is the Salome code to generate the meshes.
Parameters:
#!/usr/bin/env python
###
### This file is generated automatically by SALOME v9.3.0 with dump python functionality
###
import sys
import salome
salome.salome_init()
import salome_notebook
notebook = salome_notebook.NoteBook()
sys.path.insert(0, r'/home/hgasca/Desktop/valvula')
###
### GEOM component
###
import GEOM
from salome.geom import geomBuilder
import math
import SALOMEDS
geompy = geomBuilder.New()
O = geompy.MakeVertex(0, 0, 0)
OX = geompy.MakeVectorDXDYDZ(1, 0, 0)
OY = geompy.MakeVectorDXDYDZ(0, 1, 0)
OZ = geompy.MakeVectorDXDYDZ(0, 0, 1)
#ALL
GAP1 = 0.003
GAP2 = 0.005
GAP3 = 0.003
#OVERLAP
GAP4 = 0.002
GAP5 = 0.002
GAP6 = 0.0018
GAP7 = 0.001
#GENERAL
D1 = 0.02365
D2 = 0.022
D3 = 0.003
D4 = 0.0099
D5 = 0.017
D6 = 0.024
D7 = D5
D8 = 0.038
D9 = 0.014
D10 = 0.021
D11 = 0.022
D12 = D7 + 0.001
L1 = 0.070
L2 = 0.001
L3 = 0.00633
L4 = 0.040
L5 = 0.003
L6 = 0.030
L7 = 0.08233
L8 = 0.002
L9 = 0.01
L10 = 0.05
L11 = 0.080
L12 = 0.005
L13 = 0.010
L14 = 0.035
L16 = 0.006
L15 = L14-L16
L17 = 0.010
AVANCE =0.01
Ax = 0
Bx = L1
Bx1=Bx-GAP2
Bx_d =Bx-GAP4
Cx = L1 + L2
Dx = Cx + L3
Ex = Dx + L4
Fx = Ex + L5
Gx = Fx + L6
Gx1= Gx + GAP1
Gx_d = Gx-AVANCE
Hx = Dx + L7
Ix = Hx + L8
Ix_d = Ix+GAP5
Jx = Hx + L17
Kx = Hx + L9
Lx = Jx + L16
Mx = Jx + L14
Nx = Kx + L10
Ox = Nx + L11
Px = Ox + L12
Qx = Px + L13
ay = 0
by = D3/2
by_d = (ay+by)/2+0.00015
cy = D2/2
dy = D1/2
dy_d = dy+GAP6
ey = D4/2
fy = D5/2
fy_d = fy+GAP7
gy = D6/2
gy1 = gy + GAP3
hy = D11/2
iy = hy
jy = D8/2
ky = D9/2
ly = D9/2 + 0.001
my = D10/2
sy = D12/2
ty = (hy+sy)/2+0.0005
Poins and edges:
#ALL
P_1 = geompy.MakeVertex(Ax, ay, 0)
P_2 = geompy.MakeVertex(Qx, ay, 0)
P_3 = geompy.MakeVertex(Ax, fy, 0)
P_4 = geompy.MakeVertex(Lx, fy, 0)
P_5 = geompy.MakeVertex(Ax, sy, 0)
P_6 = geompy.MakeVertex(Lx, sy, 0)
P_7 = geompy.MakeVertex(Ax, ty, 0)
P_8 = geompy.MakeVertex(Lx, ty, 0)
P_9 = geompy.MakeVertex(Ax, dy, 0)
P_10 = geompy.MakeVertex(Gx1, dy, 0)
P_11 = geompy.MakeVertex(Bx1, gy1, 0)
P_12 = geompy.MakeVertex(Gx1, gy1, 0)
P_13 = geompy.MakeVertex(Hx, ty, 0)
P_14 = geompy.MakeVertex(Hx, iy, 0)
P_15 = geompy.MakeVertex(Kx, jy, 0)
P_16 = geompy.MakeVertex(Nx, jy, 0)
P_17 = geompy.MakeVertex(Nx, hy, 0)
P_18 = geompy.MakeVertex(Mx, ky, 0)
P_19 = geompy.MakeVertex(Qx, ky, 0)
P_20 = geompy.MakeVertex(Nx, ky, 0)
P_21 = geompy.MakeVertex(Ox, ky, 0)
P_22 = geompy.MakeVertex(Ox, ly/2, 0)
P_23 = geompy.MakeVertex(Px, my, 0)
P_24 = geompy.MakeVertex(Qx, my, 0)
P_25 = geompy.MakeVertex(Bx1, ay, 0)
P_26 = geompy.MakeVertex(Bx1, dy, 0)
P_27 = geompy.MakeVertex(Gx1, ay, 0)
P_28 = geompy.MakeVertex(Hx, ay, 0)
P_29 = geompy.MakeVertex(Hx+(Jx-Hx)*2/3 , ay, 0)
P_30 = geompy.MakeVertex(Hx+(Jx-Hx)*2/3, hy, 0)
P_30a = geompy.MakeVertex(Hx, hy, 0)
P_31 = geompy.MakeVertex(Hx+(Jx-Hx)*0.55, (jy+iy)*2/3, 0)
P_32 = geompy.MakeVertex(Jx, ay, 0)
P_33 = geompy.MakeVertex(Jx, sy, 0)
P_34 = geompy.MakeVertex(Jx, ty, 0)
P_35 = geompy.MakeVertex(Jx, hy, 0)
P_36 = geompy.MakeVertex(Lx, ay, 0)
P_37 = geompy.MakeVertex(Mx, hy, 0)
P_38 = geompy.MakeVertex(Mx, ay, 0)
P_39 = geompy.MakeVertex(Nx, ay, 0)
P_40 = geompy.MakeVertex(Ox, ay, 0)
P_41 = geompy.MakeVertex(Ox+(Px-Ox)*2/3, ay, 0)
P_42 = geompy.MakeVertex(Px, ay, 0)
P_43 = geompy.MakeVertex(Ox+(Px-Ox)*2/3, ky, 0)
P_44 = geompy.MakeVertex(Ox+(Px-Ox)*1/3, (ly+my)*2/3, 0)
P_45 = geompy.MakeVertex(Jx, jy, 0)
P_46 = geompy.MakeVertex(Kx, iy, 0)
P_47 = geompy.MakeVertex(Mx, jy, 0)
P_48 = geompy.MakeVertex(Hx+(Jx-Hx)*1/4 , ay, 0)
P_49 = geompy.MakeVertex(Hx+(Jx-Hx)*1/4 , jy, 0)
P_50 = geompy.MakeVertex(Hx+(Jx-Hx)*1/7 , ay, 0)
P_51 = geompy.MakeVertex(Hx+(Jx-Hx)*1/7 , jy, 0)
P_52= geompy.MakeVertex(Hx+(Jx-Hx)*1/12 , ay, 0)
P_53= geompy.MakeVertex(Hx+(Jx-Hx)*1/12 , jy, 0)
#OVERLAP
P_100 = geompy.MakeVertex(Bx_d,by_d,0)
P_101 = geompy.MakeVertex(Ix_d,by_d, 0)
P_102 = geompy.MakeVertex(Bx_d,by,0)
P_103 = geompy.MakeVertex(Ix_d,by,0)
P_104 = geompy.MakeVertex(Bx_d,cy,0)
P_105 = geompy.MakeVertex(Ix,cy,0)
P_106 = geompy.MakeVertex(Bx_d,dy,0)
P_107 = geompy.MakeVertex(Gx_d,dy,0)
P_108 = geompy.MakeVertex(Bx_d,dy_d,0)
P_109 = geompy.MakeVertex(Gx_d,dy_d,0)
P_110 = geompy.MakeVertex(Bx_d,fy_d,0)
P_111 = geompy.MakeVertex(Gx_d,fy_d,0)
P_112 = geompy.MakeVertex(Bx_d,fy,0)
P_113 = geompy.MakeVertex(Ix_d,fy,0)
P_114 = geompy.MakeVertex(Bx_d,ey,0)
P_115 = geompy.MakeVertex(Ix_d,ey,0)
P_116 = geompy.MakeVertex(Bx,by_d,0)
P_117 = geompy.MakeVertex(Bx,dy_d,0)
P_118 = geompy.MakeVertex(Cx,by_d,0)
P_119 = geompy.MakeVertex(Cx,by,0)
P_120 = geompy.MakeVertex(Dx,by_d,0)
P_121 = geompy.MakeVertex(Dx,dy,0)
P_122 = geompy.MakeVertex(Dx,dy_d,0)
P_123 = geompy.MakeVertex(Ex,by_d,0)
P_124 = geompy.MakeVertex(Ex,ey,0)
P_125 = geompy.MakeVertex(Ex,fy,0)
P_126 = geompy.MakeVertex(Ex,dy_d,0)
P_127 = geompy.MakeVertex(Fx,by_d,0)
P_128 = geompy.MakeVertex(Fx,ey,0)
P_129 = geompy.MakeVertex(Fx,fy,0)
P_130 = geompy.MakeVertex(Fx,dy_d,0)
P_131 = geompy.MakeVertex(Gx_d,by_d,0)
P_132 = geompy.MakeVertex(Ix_d,fy_d,0)
P_133 = geompy.MakeVertex(Ix,by_d,0)
P_134 = geompy.MakeVertex(Ix,fy_d,0)
## ALL
# Horizontales
Edge_1 = geompy.MakeEdge(P_1, P_2)
Edge_2 = geompy.MakeEdge(P_3, P_4)
Edge_3 = geompy.MakeEdge(P_5, P_6)
Edge_4 = geompy.MakeEdge(P_7, P_8)
Edge_5 = geompy.MakeEdge(P_9, P_10)
Edge_6 = geompy.MakeEdge(P_11, P_12)
Edge_7 = geompy.MakeEdge(P_30a, P_35)
Edge_8 = geompy.MakeEdge(P_18, P_20)
Edge_9 = geompy.MakeEdge(P_21, P_19)
Edge_10 = geompy.MakeEdge(P_37, P_17)
# Verticales
Edge_11 = geompy.MakeEdge(P_25, P_11)
Edge_12 = geompy.MakeEdge(P_27, P_12)
Edge_13 = geompy.MakeEdge(P_28, P_14)
Edge_14 = geompy.MakeEdge(P_29, P_30)
Edge_15 = geompy.MakeEdge(P_30, P_31)
Edge_16 = geompy.MakeEdge(P_32, P_45)
Edge_17 = geompy.MakeEdge(P_40, P_21)
Edge_18 = geompy.MakeEdge(P_37, P_47)
Edge_19 = geompy.MakeEdge(P_41, P_43)
Edge_20 = geompy.MakeEdge(P_43, P_44)
Edge_21 = geompy.MakeEdge(P_42, P_23)
Edge_22 = geompy.MakeEdge(P_48, P_49)
Edge_300 = geompy.MakeEdge(P_50, P_51)
Edge_301 = geompy.MakeEdge(P_52, P_53)
## OVERLAP
#Horizontal
Edge_100 = geompy.MakeEdge(P_102, P_103)
Edge_101 = geompy.MakeEdge(P_104, P_105)
Edge_102 = geompy.MakeEdge(P_110, P_111)
Edge_103 = geompy.MakeEdge(P_106, P_107)
Edge_104 = geompy.MakeEdge(P_112, P_113)
Edge_105 = geompy.MakeEdge(P_114, P_115)
#Vertical
Edge_106 = geompy.MakeEdge(P_116, P_117)
Edge_107 = geompy.MakeEdge(P_120, P_122)
Edge_108 = geompy.MakeEdge(P_123, P_126)
Edge_109 = geompy.MakeEdge(P_127, P_130)
Edge_110 = geompy.MakeEdge(P_131, P_111)
Edge_111 = geompy.MakeEdge(P_133, P_134)
Sketch and face for the fixed mesh:
## ALL
# 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.addSegmentAbsolute(0.000000, dy)
sk.addSegmentAbsolute(Bx1 , dy)
sk.addSegmentAbsolute(Bx1 , gy1)
sk.addSegmentAbsolute(Gx1 , gy1)
sk.addSegmentAbsolute(Gx1 , ty)
sk.addSegmentAbsolute(Hx , ty)
#sk.addSegmentAbsolute(Hx , iy)
sk.addSegmentAbsolute(Hx , 5*jy/6)
sk.addSegmentAbsolute(Kx , jy)
sk.addSegmentAbsolute(Nx , jy)
sk.addSegmentAbsolute(Nx , ky)
sk.addSegmentAbsolute(Ox , ky)
#sk.addSegmentAbsolute(Ox , ly)
sk.addSegmentAbsolute(Ox , 5*my/6)
sk.addSegmentAbsolute(Px , my)
sk.addSegmentAbsolute(Qx , my)
sk.addSegmentAbsolute(Qx , ay)
sk.close()
Sketch_1 = sk.wire(geomObj_1)
body1 = geompy.MakeFaceWires([Sketch_1], 1)
geomObj_2 = geompy.MakeMarker(0, 0, 0, 1, 0, 0, 0, 1, 0)
sk = geompy.Sketcher2D()
sk.addPoint(Lx, 0.000000)
sk.addSegmentAbsolute(Lx , ty)
sk.addSegmentAbsolute(Jx , ty)
sk.addSegmentAbsolute(Jx , hy)
sk.addSegmentAbsolute(Mx , hy)
sk.addSegmentAbsolute(Mx , 0)
sk.close()
Sketch_2 = sk.wire(geomObj_2)
body2 = geompy.MakeFaceWires([Sketch_2], 1)
body = geompy.MakeCutList(body1, [body2], True)
Partition_1 = geompy.MakePartition([body], [Edge_1, Edge_2, Edge_3, Edge_4, Edge_5, Edge_6, Edge_7, Edge_8, Edge_9, Edge_10, Edge_11, Edge_12, Edge_13, Edge_14, Edge_15, Edge_16, Edge_17, Edge_18, Edge_19, Edge_20,
Edge_21, Edge_22, Edge_300, Edge_301], [], [], geompy.ShapeType["FACE"], 0, [], 0)
Here is rotated the face a negative angle of 2.5 degrees:
Rotation_1 = geompy.MakeRotation(Partition_1, OX, -2.5*math.pi/180.0)
[Edge_23,Edge_24,Edge_25,Edge_26] = geompy.SubShapes(Rotation_1, [181, 162, 126, 193])
[Edge_27,Edge_28] = geompy.SubShapes(Rotation_1, [231, 236])
[Edge_29,Edge_30,Edge_31,Edge_32,Edge_33,Edge_34,Edge_35,Edge_36,Edge_37,Edge_38,Edge_39] = geompy.SubShapes(Rotation_1, [18, 51, 68, 172, 217, 128, 32, 229, 11, 203, 92])
[Edge_40,Edge_41,Edge_42,Edge_43,Edge_44,Edge_45,Edge_46,Edge_47,Edge_48,Edge_49,Edge_50,Edge_51,Edge_52,Edge_53,Edge_54,Edge_55,Edge_56,Edge_57,Edge_58,Edge_59,Edge_60,Edge_61,Edge_62,Edge_63,Edge_64,Edge_65,Edge_66] = geompy.SubShapes(Rotation_1, [226, 107, 176, 114, 121, 21, 200, 184, 117, 170, 155, 196, 40, 191, 238, 146, 157, 81, 212, 4, 42, 136, 141, 198, 150, 214, 143])
[Face_1,Face_2,Face_3] = geompy.SubShapes(Rotation_1, [134, 38, 194])
Sketch and faces for the overlap section:
## OVERLAP
# 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_3 = geompy.MakeMarker(0, 0, 0, 1, 0, 0, 0, 1, 0)
sk = geompy.Sketcher2D()
sk.addPoint(Bx_d, by_d)
sk.addSegmentAbsolute(Bx_d, dy_d)
sk.addSegmentAbsolute(Gx_d , dy_d)
sk.addSegmentAbsolute(Gx_d , fy_d)
sk.addSegmentAbsolute(Ix_d , fy_d)
sk.addSegmentAbsolute(Ix_d , by_d)
sk.close()
Sketch_3 = sk.wire(geomObj_3)
bodyII = geompy.MakeFaceWires([Sketch_3], 1)
Partition_2 = geompy.MakePartition([bodyII], [Edge_100, Edge_101, Edge_102, Edge_103, Edge_104, Edge_105, Edge_106, Edge_107, Edge_108, Edge_109, Edge_110, Edge_111, Edge_12], [], [], geompy.ShapeType["FACE"], 0, [], 0)
Rotation of -2.5 degrees necessary for the construction of wedge sector:
Rotation_2 = geompy.MakeRotation(Partition_2, OX, -2.5*math.pi/180.0)
[Edge_67,Edge_68,Edge_69,Edge_70,Edge_71,Edge_72,Edge_73,Edge_74,Edge_75,Edge_76,Edge_77,Edge_78,Edge_79,Edge_80,Edge_81,Edge_82,Edge_83] = geompy.SubShapes(Rotation_2, [30, 89, 124, 37, 112, 67, 119, 184, 149, 25, 122, 115, 181, 39, 65, 70, 172])
[Edge_84,Edge_85,Edge_86,Edge_87,Edge_88,Edge_89,Edge_90,Edge_91,Edge_92,Edge_93,Edge_94,Edge_95,Edge_96,Edge_97,Edge_98,Edge_99,Edge_112,Edge_113,Edge_114,Edge_115,Edge_116,Edge_117,Edge_118,Edge_119] = geompy.SubShapes(Rotation_2, [77, 56, 190, 140, 21, 137, 34, 167, 53, 74, 157, 142, 11, 103, 164, 162, 100, 192, 4, 177, 18, 187, 51, 42])
Groups from geometry:
inlet = geompy.CreateGroup(Rotation_1, geompy.ShapeType["EDGE"])
geompy.UnionIDs(inlet, [203, 259, 283, 230])
Wall = geompy.CreateGroup(Rotation_1, geompy.ShapeType["EDGE"])
geompy.UnionIDs(Wall, [223, 121, 160, 155, 42, 40, 213, 112, 187, 162, 288, 240, 146, 4, 198, 262, 21, 254, 117, 302, 81, 238, 151, 278, 286, 220, 252, 192, 290, 281])
outlet = geompy.CreateGroup(Rotation_1, geompy.ShapeType["EDGE"])
geompy.UnionIDs(outlet, [300, 295])
axis = geompy.CreateGroup(Rotation_1, geompy.ShapeType["EDGE"])
geompy.UnionIDs(axis, [243, 18, 194, 269, 169, 51, 205, 32, 92, 128, 11, 68, 293])
back = geompy.CreateGroup(Rotation_1, geompy.ShapeType["FACE"])
geompy.UnionIDs(back, [2, 12, 26, 33, 45, 52, 57, 62, 69, 74, 79, 86, 93, 98, 103, 108, 115, 122, 129, 134, 139, 144, 149, 158, 163, 175, 180, 185, 190, 199, 206, 216, 221, 226, 231, 236, 241, 248, 255, 260, 267, 274, 279, 291, 298])
porous_back = geompy.CreateGroup(Rotation_1, geompy.ShapeType["FACE"])
geompy.UnionIDs(porous_back, [170, 38, 19, 284, 211])
oversetPatch = geompy.CreateGroup(Rotation_2, geompy.ShapeType["EDGE"])
geompy.UnionIDs(oversetPatch, [138, 75, 51, 18, 11, 32, 104, 242, 212, 136, 175, 262, 245, 260, 220, 252, 227, 267, 235, 265, 205, 255, 166, 40, 93, 127, 21, 203, 64, 4])
back_1 = geompy.CreateGroup(Rotation_2, geompy.ShapeType["FACE"])
geompy.UnionIDs(back_1, [2, 12, 19, 26, 33, 38, 45, 52, 57, 62, 69, 76, 81, 86, 91, 98, 105, 110, 115, 120, 125, 139, 144, 149, 154, 159, 164, 176, 181, 186, 191, 196, 201, 213, 218, 223, 228, 233, 243, 253])
porous_back_1 = geompy.CreateGroup(Rotation_2, geompy.ShapeType["FACE"])
geompy.UnionIDs(porous_back_1, [238, 248, 263, 208, 258, 132, 171])
After this part it’s necessary to neme all the used variables with geompy command.
Then Mesh 2D regions and add groups from geometry:
###
### SMESH component
###
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
smesh = smeshBuilder.New()
#smesh.SetEnablePublish( False ) # Set to False to avoid publish in study if not needed or in some particular situations:
# multiples meshes built in parallel, complex and numerous mesh edition (performance)
Mesh_1 = smesh.Mesh(Rotation_1)
Regular_1D = Mesh_1.Segment()
Local_Length_1 = Regular_1D.LocalLength(0.0002,None,1e-09)
Quadrangle_2D = Mesh_1.Quadrangle(algo=smeshBuilder.QUADRANGLE)
isDone = Mesh_1.Compute()
## Set names of Mesh objects
smesh.SetName(Regular_1D.GetAlgorithm(), 'Regular_1D')
smesh.SetName(Quadrangle_2D.GetAlgorithm(), 'Quadrangle_2D')
smesh.SetName(Local_Length_1, 'Local Length_1')
Mesh_2 = smesh.Mesh(Rotation_2)
Regular_1D_1 = Mesh_2.Segment()
Local_Length_2 = Regular_1D_1.LocalLength(0.0002,None,1e-09)
Quadrangle_2D_1 = Mesh_2.Quadrangle(algo=smeshBuilder.QUADRANGLE)
isDone = Mesh_2.Compute()
inlet_1 = Mesh_1.GroupOnGeom(inlet,'inlet',SMESH.EDGE)
Wall_1 = Mesh_1.GroupOnGeom(Wall,'Wall',SMESH.EDGE)
outlet_1 = Mesh_1.GroupOnGeom(outlet,'outlet',SMESH.EDGE)
axis_1 = Mesh_1.GroupOnGeom(axis,'axis',SMESH.EDGE)
back_2 = Mesh_1.GroupOnGeom(back,'back',SMESH.FACE)
porous_back_2 = Mesh_1.GroupOnGeom(porous_back,'porous_back',SMESH.FACE)
oversetPatch_1 = Mesh_2.GroupOnGeom(oversetPatch,'oversetPatch',SMESH.EDGE)
back_3 = Mesh_2.GroupOnGeom(back_1,'back',SMESH.FACE)
porous_back_3 = Mesh_2.GroupOnGeom(porous_back_1,'porous_back',SMESH.FACE)
Now the meshes are rotated 5 degrees and a wedge is obtained, the tolerances are needed to produce an axis face. Openfoam works with volumes
[ inlet_rotated, Wall_rotated, outlet_rotated, axis_rotated, back_rotated, porous_back_rotated, inlet_top, Wall_top, outlet_top, axis_top, back_top, porous_back_top ] = Mesh_1.RotationSweepObjects( [ Mesh_1 ], [ Mesh_1 ], [ Mesh_1 ], SMESH.AxisStruct( 0, 0, 9e-09, 10, 0, 0 ), 0.0872665, 1, 1e-11, 1 )
[ oversetPatch_rotated, back_rotated_1, porous_back_rotated_1, oversetPatch_top, back_top_1, porous_back_top_1 ] = Mesh_2.RotationSweepObjects( [ Mesh_2 ], [ Mesh_2 ], [ Mesh_2 ], SMESH.AxisStruct( 0, 0, 9e-09, 10, 0, 0 ), 0.0872665, 1, 1e-11, 1 )
Finally it’s necessary to put the names for the meshes parts with smesh.SetName command.
On Salome’s GUI you must load this script and you will obtain the meshes showed below.
Before exporting to an unv file you have to delete the Groups on Edges from the meshes in the Object Browser pannel. You also coul see that in both meshes there are patches with the name porous. It will be created geometrically intersecting the front and back patches of both (fixed and overlap) and also the porous patches of them. the porous patches are going to act as «zero overset walls».
In the openFoam’s all folder create the mesh for the fixed part and then merge the mesh with the cylinder part:
>ideasUnvToFoam Mesh_1.unv
In the openFoam’s cylinder folder create the mesh with:
>ideasUnvToFoam Mesh_2.unv
Once created you must assure the compatibility betweem them and with the axisymmetric model.
In the first step you must modify the boundary file into the all/constant/bpolyMesh to the next:
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v1912 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class polyBoundaryMesh;
location "constant/polyMesh";
object boundary;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
9
(
overset
{
type overset;
nFaces 0;
startFace 185418;
}
back
{
type wedge;
nFaces 85861;
startFace 185418;
}
porous_back
{
type wedge;
nFaces 7754;
startFace 271279;
}
inlet
{
type patch;
nFaces 61;
startFace 279033;
}
Wall
{
type wall;
nFaces 2036;
startFace 279094;
}
outlet
{
type patch;
nFaces 53;
startFace 281130;
}
axis
{
type patch;
nFaces 1432;
startFace 281183;
}
front
{
type wedge;
nFaces 85861;
startFace 282615;
}
porous_front
{
type wedge;
nFaces 7754;
startFace 368476;
}
)
// ************************************************************************* //
The overset reference has to be added in order to improve the order and efficience of the running. The type wedge is used in order to the recognition of the axisymmetric case.
On the other hand, into the cylinder/polyMesh the boundary file must be like:
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v1912 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class polyBoundaryMesh;
location "constant/polyMesh";
object boundary;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
5
(
back
{
type wedge;
nFaces 25522;
startFace 57535;
}
porous_back
{
type wedge;
nFaces 3518;
startFace 83057;
}
oversetPatch
{
type overset;
nFaces 1090;
startFace 86575;
}
front
{
type wedge;
nFaces 25522;
startFace 87665;
}
porous_front
{
type wedge;
nFaces 3518;
startFace 113187;
}
)
// ************************************************************************* //
In the next steps the wedge patches from the all and cylinder meshes will be merged, but before it is necessary to collapse the edge axis from the all/constant/polyMesh/boundary file.
So, from all folder run:
>collapseEdges
It creates a new folder i.e 1e-09 and it’s necessary to remove from the boundary file:
axis
{
type patch;
nFaces 0;
startFace 281183;
}
And next replace the polyMesh folder from the all/constan by the correspondent folder and files in 1e-09
Delete the 1e-09 folder and merge the all and cylinder meshes from all by:
>mergeMeshes . ../cylinder -overwrite | tee log.mergeMeshes
>checkMesh
In the checkMesh result must appear:
*Number of regions: 2
The mesh has multiple regions which are not connected by any face.
<<Writing region information to "constant/cellToRegion"
<<Writing region 0 with 92121 cells to cellSet region0
<<Writing region 1 with 17069 cells to cellSet region1
It is recommended to create an Allrun.pre bash file to run the case:
#!/bin/sh
cd "${0%/*}" || exit # Run from this directory
. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions
#------------------------------------------------------------------------------
#runApplication blockMesh
cd all
mergeMeshes . ../cylinder -overwrite | tee log.mergeMeshes
# Select cellSets
runApplication topoSet
runApplication subsetMesh box -patch hole -overwrite
# Select cellSets
runApplication -s box topoSet
restore0Dir
# Use cellSets to write zoneID
runApplication setFields
#------------------------------------------------------------------------------
or manually run each one of the instructions, in the folder all/system you have to locate the topoSetDict like:
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v1912 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object topoSetDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
actions
(
{
name region0;
type cellSet;
action new;
source regionToCell;
insidePoints ((0.001 0.001 0));
}
//This coordinates ((0.001 0.001 0)) have to be choosen assuring
//than are only inside the region 0
{
name region1;
type cellSet;
action new;
source cellToCell;
set region0;
}
{
name region1;
type cellSet;
action invert;
}
// Select box to remove from region 1
{
name box;
type cellSet;
action new;
source cellToCell;
set region1;
}
//The next part produces the hole region.
{
name box;
type cellSet;
action subset;
source boxToCell;
boxes
(
(0.07 0.011 -1)(0.071 0.011825 1)
(0.071 0.0015 -1)(0.07733 0.011825 1)
(0.07733 0.00495 -1)(0.11733 0.0085 1)
(0.12033 0.00495 -1)(0.16166 0.0085 1)
);
}
{
name box;
type cellSet;
action invert;
}
);
// ************************************************************************* //
It is necessary to include the next lines in te fvSchemes in order to account the hole:
oversetInterpolation
{
method inverseDistance;
//the hole have to be inside this coordinates
searchBox (0 0 -0.01)(0.3 0.01 0.01);
searchBoxDivisions (1000 100 1);
//method trackingInverseDistance;
//searchBoxDivisions 2{(100 100 1)};
}
Another important files are the constant/setFieldsDict and constant/fvOptions. the setFieldsDict is necessary to accomplish the field division before running:
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v1912 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object setFieldsDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
defaultFieldValues
(
volScalarFieldValue zoneID 0
);
regions
(
// Set cell values
// (does zerogradient on boundaries)
cellToCell
{
set region0;
fieldValues
(
volScalarFieldValue zoneID 0
);
}
cellToCell
{
set region1;
fieldValues
(
volScalarFieldValue zoneID 1
);
}
);
// ************************************************************************* //
Into the fvOptions are the parameters for the porous regions:
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "constant";
object fvOptions;
}
// * * * * * * * * * ** * * * * * * * * * * * * * * * * //
porosity1
{
type explicitPorositySource;
explicitPorositySourceCoeffs
{
selectionMode cellZone;
cellZone porous_frontAndBack;
type DarcyForchheimer;
d (5e13 5e13 5e13);
f (0 0 0);
coordinateSystem
{
type cartesian;
origin (0 0 0);
coordinateRotation
{
type axesRotation;
e1 (1 0 0);
e2 (0 0 1);
}
}
}
}
porosity2
{
type explicitPorositySource;
explicitPorositySourceCoeffs
{
selectionMode cellZone;
cellZone porous_frontAndBack_body2;
type DarcyForchheimer;
d (5e13 5e13 5e13);
f (0 0 0);
coordinateSystem
{
type cartesian;
origin (0 0 0);
coordinateRotation
{
type axesRotation;
e1 (1 0 0);
e2 (0 0 1);
}
}
}
}
The distance between the external walls and the overset patch must be at least 8 FVM cells.
Then, run:
>. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions
>runApplication topoSet
>runApplication subsetMesh box -patch hole -overwrite
>paraFoam
On paraFoam check that the hole was generated and the region0 and region1 are wheel defined:
>runApplication -s box topoSet
>restore0Dir
>runApplication setFields
>paraFoam
The zoneID should looks like.
where the two regions are wheel defined.
Finally run:
>overPimpleDyMFoam