Moukalled F., Mangani L., Darwish M. The finite volume method in computational fluid dynamics. An advanced introduction with OpenFOAM and Matlab (811443), страница 18
Текст из файла (страница 18)
This is accomplished by avariety of techniques resulting in a wide range of mesh types. These meshes areclassified according to several characteristics: structure, orthogonality, blocks, cellshape, variable arrangement, etc. In all cases the mesh is composed of discreteelements defined by a set of vertices and bounded by faces. For the mesh to be auseful platform for equation discretization, information related to the topology ofthe mesh elements, in addition to some derived geometric information, are needed.These include element to element relations, face to elements relations, geometricinformation of the surfaces, element centroid and volume, face centroid, area andnormal direction, etc. This information is usually inferred from the basic mesh data.For certain mesh topologies, details about the mesh can be easily deduced from theelement indices as in structured grids, while for others it has to be constructed andstored in lists for later retrieval, as is the case with unstructured grids.4.1 The Discretization ProcessTsink(a)Tmicroprocessorinsulated89Patch#2(b)Patch#3Patch#1Patch#2Patch#1(c)Patch#3Fig.
4.3 a Computational domain; b computational mesh (quadrilateral); c computational mesh(triangular)Consider the simple domain shown in Fig. 4.3a. The domain consists of avolume (area for the two dimensional case) and boundaries that account for theheating or cooling of the microprocessor, a heat sink, and the heat spreader base.The domain is shown discretized with a simple mesh in Fig. 4.3b. The meshboundary is divided into three patches of boundary faces that are assigned numbers,i.e., Patch#1, Patch#2, and Patch#3.
These patches are used to define the physicalboundary conditions for the problem at hand. The mesh consists of 25non-overlapping elements whose geometry is defined by 40 points (vertices of thecells). The elements are also bounded by 66 faces (lines in a two dimensional case),34 of which are interior faces. The algebraic equations that result from the discretization of the governing equations, as will be explained in step III, are describedfor each element in the computational domain with the solution expressed as anelement field with values defined at the centroid of each element. In this examplethe elements have a square shape, though other shapes could have been used (e.g.,triangular elements, as shown in Fig. 4.3c).The mesh can be described from different perspectives.
At the most elementarylevel it is a list of vertices or points representing locations in one dimensional, twodimensional, or three dimensional spaces. The mesh also represents the discretizeddomain subdivided into non-overlapping elements, which can be of arbitraryconvex polyhedral shapes. Elements are completely bounded by faces that aregenerally shared by neighboring elements, except at the boundaries. Elements canbe defined either in terms of the points that delimit them or in terms of the faces thatbound them. The mesh faces, which are stored in a list, are of two types: (i) interiorfaces that are shared by (or connect) two elements, and (ii) boundary faces thatcoincide with the domain boundary; these boundary faces have only one contiguouselement.
While interior faces are derived from information related to the elementtopology, it is essential to provide boundary faces as they define the domainphysical boundary. In two dimensions faces are described in terms of their definingpoints. In three dimensions the defining points describe edges that bound the face.The direction of the normal to an interior face is usually defined based on thetopology of the neighboring elements. On the other hand, the direction of the904 The Discretization Process(a) Patch#2(b) Patch#2Patch#1123456789101112131458573516561522162317241825192620272128551419542930313726261 59602053373848373539401417421223456891011141516171819201011121315211622172318525124272528266366 6465305036Patch#3385134332Patch#334Patch#13992933(c) Patch#2Patch#1364049313348443447462122Patch#33245232425Fig.
4.4 a Mesh vertices, b faces, and c elementsnormal to a boundary face always points outward of the domain. Figure 4.4 showssome of the components (vertices, faces, and elements shown in Fig. 4.4a–crespectively) of a mesh. Furthermore the boundary faces are organized into lists offaces based on the boundary patch to which they belong.4.1.3Mesh TopologyDuring discretization, the partial differential equations are integrated over eachelement in the mesh resulting in a set of algebraic equations with each one linkingthe value of the variable at an element to the values at its neighbors.
The algebraicequations are then assembled into global matrices and vectors and the coefficientsof every equation stored at the row and column locations corresponding to thevarious element indices. The integration of the equations over each element isreferred to as local assembly while the construction of the overall system ofequations from these contributions is referred to as global assembly. Thus while thediscretization of the equations is derived in terms of neighbor elements, theassembly of the equations in the global matrix accounts for the actual indices of theelements.
This procedure will be detailed in later chapters, however the enablingingredients of this procedure are briefly introduced next at their most elementarylevel, which is in the form of topological information about elements, faces, andvertices that are represented in terms of connectivity lists.Element connectivity relates the local assembly matrix to the global matrix sothat the equations formed for one element are consistent with the equations formedfor the other elements in the computational domain. Generally element to element,element to face, and element to vertex connectivities are setup. These relate theelement to the neighboring elements, bounding faces, and defining vertices,respectively. Considering Fig.
4.4, the connectivity for element 9 is shown inFig. 4.5.4.1 The Discretization Process91Fig. 4.5 ElementconnectivityF2F3CF1Element 9 ConnectivityNeighbours [10 4 8 15]Faces [12 8 11 16]F4Vertices [19 11 12 18]Generally for arbitrary elements it is more efficient to assemble flux terms bylooping over faces. In this case it is essential that information about the face elementneighbors be readily available; this is defined in the Face connectivity. For faces,information about elements sharing the face is stored for use during computations.The orientation of the face is such that the normal vector to the face points from oneelement denoted by element 1 or owner to the second element denoted by element 2or neighbor.
Boundary faces bound only one element, defined as element 1, thus thenormal vector of boundary faces is always oriented outside of the domain. Theconnectivity for Face 12 is shown in Fig. 4.6.Fig. 4.6 Face connectivityE1ownerSffE2neighbourFace 12 ConnectivityElement1 9Element2 10Vertices[19 12]Vertex connectivity is useful for post processing and for gradient computation.As shown in Fig. 4.7, generally it involves the lists of elements and faces that sharethe vertex.Fig.
4.7 Vertex connectivityVertex ConnectivityElementsFaces924 The Discretization ProcessThe mapping between local and global indices is briefly illustrated in Fig. 4.8 fora mesh of five elements.1local element equation is assemble for element 31element connectivity is used totransform local indices to global indices223Element 3Neighbors45element equation isassembled into global matrix3Fig. 4.8 Local element matrix assembly into global matrixExample 1For the mesh shown below, derive the element connectivity and represent it ina global matrix (Fig.
4.9)1234Fig. 4.9 Mesh for example 1SolutionIn this mesh element counting starts from 1. The connectivity for thevarious elements are given by1 ! 2; 32 ! 1; 3; 43 ! 1; 2; 44 ! 2; 3this can be represented in a global matrix as4.1 The Discretization Process2 6 64 4.1.49332 3 2 367 67776 7 ¼ 6 7 54 5 4 5ð4:2ÞStep III: Equation DiscretizationIn step III, the governing partial differential equations, are transformed into a set ofalgebraic equations, one for each element in the computational domain. Thesealgebraic equations are then assembled into a global matrix and vectors that can beexpressed in the formA½T ¼ bð4:2Þwhere the unknown variable T is defined at each interior element and at theboundary of the computational domain.
Boundary values for T are generallyobtained from the specified boundary conditions. To this end an element field has tobe defined for T, and generally for each governing equation.As schematically depicted in Fig. 4.10, the element field consists of an array ofvalues defined at the centroid of each element, designated by the interior elementfield, which is represented by one array of size equal to the total number of interiorand boundary elements.The equation discretization step is performed over each element of the computational domain to yield an algebraic relation that connects the value of a variablePatch#2Patch#1Element FieldPatch#3Fig. 4.10 Element fieldinterior12 3patch#11234patch#21234patch#31234......2525944 The Discretization Processin an element to the values of the variable in the neighboring elements. Thisalgebraic equation is derived by discretizing the differential equation, which for theexample considered is the energy equation written in terms of temperature T, (i.e.,T is the unknown variable).
As shown below, in the finite volume method thediscretization of the equation is performed by first integrating the differentialequation over a control volume or cell to obtain a semi discretized form of theequation and then approximating the variation of the dependent variable betweengrid elements through imposed profiles to obtain the final discretized form. The factthat only a few grid elements participate in a given discretization equation is aconsequence of the piecewise nature of the chosen profiles. The value of T at a gridpoint thereby influences the distribution of T only in its immediate neighborhood.As the number of grid elements increases, the solution of the discretized equationsis expected to approach the exact solution of the corresponding differential equation.
This follows from the consideration that, as the grid elements get closertogether, changes in T between neighboring grid elements become small, and thenthe actual details of the profile assumption become unimportant.For a given differential equation, the possible discretization equations are by nomeans unique, although all types of discretization techniques in the limit of a very largenumber of grid elements are expected to give the same solution. The different typesarise from the differences in the profile assumptions and the methods of derivation.As an example of the equation discretization step using the finite volume method,the discretized form of the energy equation over the control volume C shown inFig.