|
[Sponsors] | |||||
[snappyHexMesh] snappyHexMesh - spiral shaped pipe internal flow |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
|
|
|
#1 |
|
New Member
Taeyoon Lee
Join Date: Jul 2015
Posts: 3
Rep Power: 12 ![]() |
Hi,
I am trying to simulate an internal flow inside a spiral shaped pipe with twoPhaseEulerFoam. It is a closed spiral shaped pipe and it is saved in STL format. I am thinking of utilizing the autoPatch function and assign inlet, outlet, and wall. I am trying to snappyHexMesh inside the pipe but it doesn't work well and I don't know what is wrong. Attached are the overall design, blockMeshDict, snappyHexMeshDict, meshQualityDict, and the log file(includes only the end part) after a run. Please someone help me setting up the snappyHexMesh file properly. I would really appreciate it. Thank you. Last edited by callmety; July 31, 2015 at 00:29. |
|
|
|
|
|
|
|
|
#2 |
|
Senior Member
Niels Nielsen
Join Date: Mar 2009
Location: NJ - Denmark
Posts: 556
Rep Power: 28 ![]() |
Hello
I would make a 2D face mesh in Salome and extrude along helix path. http://www.elmerfem.org/elmerwiki/in...es_with_salome modified the script to better reflect a correct mesh. Doing the pipe in the Geo module produced warped cells. Doings the extrusion in the mesh gives a good result. Code:
# -*- coding: utf-8 -*-
###
### This file is generated automatically by SALOME v7.5.1 with dump python functionality
###
import sys
import salome
salome.salome_init()
theStudy = salome.myStudy
###
### GEOM component
###
import GEOM
from salome.geom import geomBuilder
geompy = geomBuilder.New(theStudy)
import math
import SALOMEDS
points = 50
radius = 0.018*1000
pipeRadius = 5
turnLength = (0.877/10.)*1000
numberOfturns = 10
def Helix(a, t):
return [a*math.cos(t), a*math.sin(t), turnLength*t/(2*math.pi)]
def dHelix(a, t):
return [a*math.sin(t), a*math.cos(t), turnLength/(2*math.pi)]
# create vertices
pointList=[]
for i in range(numberOfturns*points+1):
Helixx = Helix(radius, 2*math.pi/points * i)
pointList.append(geompy.MakeVertex(Helixx.pop(0), Helixx.pop(0), Helixx.pop(0)))
HelixCurve = geompy.MakePolyline(pointList,False)
Helixx = tuple(Helix(radius, 0))
dHelixx = dHelix(radius, 0)
P1forVector = geompy.MakeVertex(Helixx[0], Helixx[1], Helixx[2])
P2forVector = geompy.MakeVertex(Helixx[0]+dHelixx.pop(0), Helixx[1]+dHelixx.pop(0), Helixx[2]+dHelixx.pop(0))
VectorForBaseCircle = geompy.MakeVector(P1forVector, P2forVector)
Divided_Disk_1 = geompy.MakeDividedDiskPntVecR(P1forVector, VectorForBaseCircle, pipeRadius, GEOM.HEXAGON)
# add objects in the study
geompy.addToStudy(HelixCurve, "HelixCurve")
geompy.addToStudy(Divided_Disk_1, 'Divided_Disk_1')
###
### SMESH component
###
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
smesh = smeshBuilder.New(theStudy)
Mesh_1 = smesh.Mesh(Divided_Disk_1)
Regular_1D = Mesh_1.Segment()
Nb_Segments_1 = Regular_1D.NumberOfSegments(5)
Nb_Segments_1.SetDistrType( 0 )
Quadrangle_2D = Mesh_1.Quadrangle(algo=smeshBuilder.QUADRANGLE)
isDone = Mesh_1.Compute()
Nb_Segments_2 = smesh.CreateHypothesis('NumberOfSegments')
Nb_Segments_2.SetNumberOfSegments( 2 )
Nb_Segments_2.SetDistrType( 0 )
Mesh_2 = smesh.Mesh(HelixCurve)
status = Mesh_2.AddHypothesis(Nb_Segments_2)
status = Mesh_2.AddHypothesis(Regular_1D)
isDone = Mesh_2.Compute()
error = Mesh_1.ExtrusionAlongPathX( Mesh_1, Mesh_2, 1, 0, [ ], 0, 0, [ 0, 0, 0 ], 0, SMESH.FACE )
## Set names of Mesh objects
smesh.SetName(Regular_1D.GetAlgorithm(), 'Regular_1D')
smesh.SetName(Quadrangle_2D.GetAlgorithm(), 'Quadrangle_2D')
smesh.SetName(Nb_Segments_2, 'Nb. Segments_2')
smesh.SetName(Nb_Segments_1, 'Nb. Segments_1')
smesh.SetName(Mesh_1.GetMesh(), 'Mesh_1')
smesh.SetName(Mesh_2.GetMesh(), 'Mesh_2')
if salome.sg.hasDesktop():
salome.sg.updateObjBrowser(1)
__________________
Linnemann PS. I do not do personal support, so please post in the forums. Last edited by linnemann; July 30, 2015 at 08:58. |
|
|
|
|
|
|
|
|
#3 |
|
New Member
Taeyoon Lee
Join Date: Jul 2015
Posts: 3
Rep Power: 12 ![]() |
Hi Mr. Nielsen,
Thank you so much for your help. I really appreciate it. |
|
|
|
|
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| pisoFOAM (LES) - internal pipe flow - convergence | gu1 | OpenFOAM Running, Solving & CFD | 19 | August 10, 2018 08:00 |
| simpleFOAM (RANS) - internal pipe flow - 'k' | gu1 | OpenFOAM Running, Solving & CFD | 1 | May 15, 2018 08:17 |
| internal pipe flow | Amar Kad | CFX | 0 | January 23, 2016 01:46 |
| Question Regarding Modelling Internal Flow | Alteran | CFX | 1 | September 4, 2013 13:07 |
| internal flow and external flow ? | Pathway0320 | FLUENT | 1 | November 17, 2006 04:37 |