quinta-feira, 25 de abril de 2013

Creating the mesh

It is well known that we have several types of grid generation methods and I want to be practical. Which means that I'll try to have the best method without taking care of the minor details. To have all my simulations running, I must choose from the beginning.

Of course, through the whole learning curve I should be adapting which kind of method best fits for the corresponding problem.

From now I have the following assumptions:

  • Flow is going to happen within an annular space created by a circular well-bore and a circular tool ;
  • We won't have any type of heat exchange;
  • We are going to have a non-Newtonian fluid within annular space;
  • Rheology values are going to be kept constant;
  • Well-bore and the tool will be centralized;
  • It is an incompressible flow;
  • The grid will be a mix of structured and unstructured ones, but I will be trying to use structured grids as much as possible;
Creating the Grid for Simple Axial Annular Flow with Salomé

In order to have my simulations running I must create a grid and this geometry is quite simple.



  • Length = 2 m
  • Well Bore OD = 8.5 in
  • Pipe OD = 6.5 in
  • g = -9.81 m/s2
You must be captured we'll have our flow in this space created between 8.5 in and 6.5 in, 1 inch of annular space. Also, looking at this simple drawing is easy to see we must have some structured grid meshing, right? No.

Structured grids can be very time consuming. My focus right now is to have some few simulations running. You will see the base of this grid is unstructured but which makes it unstructured as a whole. You can use as reference the following link http://www.salome-platform.org/user-section/salome-tutorials/edf-exercise-4 to see how to create some structured grid with Salomé. But be aware, Salomé is not that good with structured grids either.

To create the geometry I'll use the following Salomé script:
###########


import sys
import salome
import geompy
import math

salome.salome_init()
theStudy = salome.myStudy

import salome_notebook
notebook = salome_notebook.notebook

gg = salome.ImportComponentGUI("GEOM")

# BHA components parameters
Wellbore = 8.5 # in
OD_Component = 6.5 # in
ID_Component = 1 # in
Length_Component = 2 # m


# Converting imperial units to SI
Wellbore = Wellbore*0.0254
OD_Component = OD_Component*0.0254
ID_Component = ID_Component*0.0254


# Base vector for rotation and extrusion
Origin = geompy.MakeVertex (0,0,0)
EndVector = geompy.MakeVertex (0,0,1)
Vector = geompy.MakeVector(Origin ,EndVector)


# Base line for wellbore annular
pOD = geompy.MakeVertex(OD_Component,0,0)
pWell = geompy.MakeVertex(Wellbore,0,0)
vAnnular = geompy.MakeVector(pOD,pWell)


# Base annular disc
wAnnular = geompy.MakeWire([vAnnular])
revolution = geompy.MakeRevolution(wAnnular, Vector, 2*math.pi)
Annular = geompy.MakePrismVecH(revolution, Vector, Length_Component)
id_Annular = geompy.addToStudy(Annular , "Annular")

[Inlet,Inner_Wall,Outer_Wall,Outlet] = geompy.ExtractShapes(Annular, geompy.ShapeType["FACE"], True)
geompy.addToStudyInFather( Annular, Inlet, 'Inlet' )
geompy.addToStudyInFather( Annular, Inner_Wall, 'Inner_Wall' )
geompy.addToStudyInFather( Annular, Outer_Wall, 'Outer_Wall' )
geompy.addToStudyInFather( Annular, Outlet, 'Outlet' )

if salome.sg.hasDesktop():
  salome.sg.updateObjBrowser(1)

###################

I will use the results from this script to work on my mesh.

Toggle the Mesh Environment or choose Mesh on the list.

Go to "Mesh" and choose "Create Mesh". You need to choose the geometry we will be working on.
Mesh >> Create Mesh

Now we must choose what method of grid generation we have to use. I had worked with several meshes regarding this annular problem and I had identified some few things. I'm choosing the extrusion of the face to generate the rest of the mesh, because it satisfies the resolution of our problem and is also faster. If we had generated the whole grid just using, lets say, NETGEN 3D-2D-1D, the grid would have a very dense resolution without being practical.

Choose 3D extrusion:

Don't "Apply and Close" we have some few things to do with this subject. While extruding in z axis we must define how the meshing is going to behave. I want quadrangle:
Let it in standard
We must define how many "cuts" we do want in z axis. I choose 200:
You can put more or less than 200
Now we can "Apply and Close"

We need to define this extrusion's base:
I want 0.01 of Max Element Area
Still at the extrusion base we will divide the circumference into 90 segments:
Choose 90 segments
Do the same for the "Outlet"!!

Now we must define in the grid what is Inlet, Outlet, Inner_Wall and Outer_Wall.
Without this definition we can't run Openfoam.
Repeat this procedure to Outlet, Inner_Wall and Outer Wall.

Now we can compute the mesh. Right click over Mesh_1 and choose Compute.


Nenhum comentário:

Postar um comentário