http://www.cfd-online.com/W/index.php?title=Special:Contributions/E_v_popov&feed=atom&limit=50&target=E_v_popov&year=&month=CFD-Wiki - User contributions [en]2016-08-31T22:07:38ZFrom CFD-WikiMediaWiki 1.16.5http://www.cfd-online.com/Wiki/Mesh_adaptationMesh adaptation2012-05-01T04:59:58Z<p>E v popov: /* r-Refinement */</p>
<hr />
<div>{{Meshing table of contents}}<br />
[[Unstructured mesh generation|<< Unstructured Mesh Generation]] | '''Mesh Adaptation''' | [[ First cell height calculation|First cell height calculation>>]]<br />
<br />
Mesh adaptation, often referred to as Adaptive Mesh Refinement (AMR), refers to the modification of an existing mesh so as to accurately capture flow features. Generally, the goal of these modifications is to improve resolution of flow features without excessive increase in computational effort. We shall discuss in brief on some of the concepts important in mesh adaptation.<br />
<br />
Mesh adaptation strategies can usually be classified as one of three general types: r-refinement, h-refinement, or p-refinement. Combinations of these are also possible, for example hp-refinement and hr-refinement. We summarise these types of refinement below.<br />
<br />
==r-Refinement==<br />
r-refinement is the modification of mesh resolution without changing the number of nodes or cells present in a mesh or the connectivity of a mesh. The increase in resolution is made by moving the grid points into regions of activity, which results in a greater clustering of points in those regions. The movement of the nodes can be controlled in various ways. On common technique is to treat the mesh as if it is an elastic solid and solve a system equations (suject to some forcing) that deforms the original mesh (see for instance [http://en.wikipedia.org/wiki/Stretched_grid_method Stretched grid method]). Care must be taken, however, that no problems due to excessive grid skewness arise.<br />
<br />
==h-Refinement==<br />
h-refinement is the modification of mesh resolution by changing the mesh connectivity. Depending upon the technique used, this may not result in a change in the overall number of grid cells or grid points. The simplest strategy for this type of refinement subdivides cells, while more complex procedures may insert or remove nodes (or cells) to change the overall mesh topology. <br />
<br />
In the subdivision case, every "parent cell" is divided into "child cells". The choice of which cells are to be divided is addressed below. For every parent cell, a new point is added on each face. For 2-D quadrilaterals, a new point is added at the cell centroid also. On joining these points, we get 4 new "child cells". Thus, every quad parent gives rise to four new offsprings. The advantage of such a procedure is that the overall mesh topology remains the same (with the child cells taking the place of the parent cell in the connectivity arrangement). The subdivision process is similar for a triangular parent cell, as shown below. It is easy to see that the subdivision process increases both the number of points and the number of cells.<br />
<br />
[[Image:MESH_subdivide.png]]<br />
<br />
An additional point to be noted is that this type of mesh adaptation can lead to what are called "hanging nodes." In 2D, this happens when one of the cells sharing a face is divided and the other is not, as shown below. For two quad cells, one cell is divided into four quads and other remains as it is. The highlighted node is the hanging node.<br />
<br />
[[Image:MESH_hanging.png]]<br />
<br />
This leads to a node on the face between the two cells which does not belong (properly) to both of the cells. The node "hangs" on the face, and one of the cells becomes an arbitrary polyhedron. In the above case, the topology seemingly remains same, but the right (undivided) cell actually has five faces.<br />
<br />
Further, there are two ways of h-refinement: Isotropic and Anisotropic. Isotropic refinement, is what was described a little back. In isotropic refinement, new points are added in both the directions, say x and y. In anisotropic refinement, the division takes place in one predominant direction. Thus, in short, an isotropic refinement for a quad would produce four new offsprings, while anisotropic refinement would only generate two. Anisotropic refinement is made use of, when the user knows that the flow feature is predominantly to be resolved in one direction, for e.g. Boundary Layers. However, there are situations where an anisotropic refinement alone may not be satisfactory, such as a shock-boundary layer interaction. <br />
<br />
The simplest reifnement anyone can think of is to divide all cells in the domain. This is referred to as "Uniform Refinement". Although it does improve the solution vastly, it is easy to realise that we are going for a huge unwanted effort in doing so. For e.g., in the farfield region of an airfoil, cell division is not bringing in any improvement because the flow there does not experience any activity. Therefore, to achieve the goal of mesh adaptation, the refinement is done at "selected" regions alone based on certain criterion. This is referred to popularly as AMR or Adaptive Mesh Refinement. It is to be remarked that AMR does not only encompass division of cells into smaller ones ( Refinement ), but also the agglomeration of smaller cells into a larger one (De-refinement or coarsening), when the need arises.<br />
<br />
==p-Refinement==<br />
A very popular tool in Finite Element Modelling (FEM) rather than in Finite Volume Modelling (FVM), it achieves increased resolution by increasing the order of accuracy of the polynomial in each element (or cell).<br />
<br />
In AMR, the selction of "parent cells" to be divided is made on the basis of regions where there is appreciable flow activity. It is well known that in compressible flows, the major features would include Shocks, Boundary Layers and Shear Layers, Vortex flows, Mach Stem , Expansion fans and the like. It can also be seen that each feature has some "physical signature" that can be numerically exploited. For eg. shocks always involve a density/pressure jump and can be detected by their gradients, whereas boundary layers are always associated with rotationality and hence can be detected using curl of velocity. In compressible flows, the velocity divergence, which is a measure of compressiblity is also a good choice for shocks and expansions. These sensing paramters which can indicate regions of flow where there are activity are referred to as ERROR INDICATORS and are very popular in AMR for CFD.<br />
<br />
Just as refinement is possible by ERROR INDICATORS as mentioned above, certain other issues also assume relevance. Error Indicators do detect regions for refinement, they do not actually tell if the resolution is good enough at any given time. In fact the issue is very severe for shocks, the smaller the cell, the higher the gradient and the indicator would keep on picking the region, unless a threshold value is provided. Further, many users make use of conservative values while refining a domain and generally end up in refining more than the essential portion of the grid, though not the complete domain. These refined regions are unneccesary and are in strictest sense, contribute to unneccesary computational effort. It is at this juncture, that reliable and resonable measure of cell error become necessary to do the process of "coarsening", which would reduce the above-said unnecessary refinement, with a view towards generatin an "optimal mesh". The measures are given by sensors referred to as ERROR ESTIMATORS, literature on which is in abandunce in FEM, though these are very rare in FVM.<br />
<br />
Control of the refinement and/or coarsening via the error indicators is often undertaken by using either the 'solution gradient' or 'soultion curvature'. Hence the refinement variable coupled with the refinement method and its limits all need to be considered when applying mesh adaptation.<br />
<br />
----<br />
[[Unstructured mesh generation|<< Unstructured Mesh Generation]] | '''Mesh Adaptation''' | [[ First cell height calculation|First cell height calculation>>]]</div>E v popovhttp://www.cfd-online.com/Wiki/Structured_mesh_generationStructured mesh generation2012-04-27T03:53:40Z<p>E v popov: </p>
<hr />
<div>{{Meshing table of contents}}<br />
[[Mesh classification|<< Mesh Classification]] | '''Structured Mesh Generation''' | [[ Unstructured mesh generation|Unstructured Mesh Generation>>]]<br />
<br />
The simplest algorithms directly compute nodal placement from some given function. These algorithms are referred to as algebraic algorithms. Many of the algorithms for the generation of structured meshes are descendents of "numerical grid generation" algoritms, in which a differential equation is solved to determine the nodal placement of the grid. In many cases, the system solved is an elliptic system, so these methods are often referred to as elliptic methods. The best basic refence on this topic is the book of Thompson, Warsi, and Mastin<ref>Thompson, Joe F., Warsi, Z.U.A., and Mastin, C. Wayne, ''Numerical Grid Generation'', Elsevier Science Publishers, 1985</ref>. There are more recent texts available, but this is the classic book on the subject, and it is available online [http://www.hpc.msstate.edu/publications/gridbook/ here].<br />
<br />
==Algebraic Grid Generation==<br />
The simplest way to obtain a grid would be to specify the grid coordinates <math>\vec{x}</math> as the result of some vector function, or <br />
<br />
:<math>\vec{x}=\vec{x}\left(\vec{\xi}\right),</math><br />
<br />
where <math>\vec{\xi}</math> is the "index" vector, sometimes referred to as a computational coordinate. For our purposes here the entries of the computational coordinate will range from zero to a maximum. <br />
If such a function can be found for a given geometry, then the actual generation of gridpoints is straightforward. The problem, however, is that the determination of the function is not neccessarily that easy. In practice, it is sometimes easier to add an intermediate parametric space, denoted by <math>\vec{s}</math>, in between the physical space representation of the grid and the computational space representation of the grid:<br />
<br />
:<math>\vec{x}=\vec{x}\left(\vec{s}\left(\vec{\xi}\right)\right).</math><br />
<br />
The entries in the computational coordinate are taken from the unit interval. This representation can help simplify matters, especially in the one dimensional case. <br />
<br />
Many mesh generation systems (both structured and unstructured) require the generation of boundary grids before interior cells can be generated. This is an area in which algebraic grid generation is ideal - typically, we want to specify boundary edge point distributions quickly, with a minimum of complexity, and a high degree of repeatability. Consider a line segment joining two points <math>\vec{x}_1</math> and <math>\vec{x}_2</math> together. The segment can be expressed as the linear form<br />
<br />
:<math>\vec{x}(s)=s(\vec{x}_2 - \vec{x}_1) + \vec{x}_1,\ \ s\in [0,1].</math><br />
<br />
Similar expressions are possible for other curves connecting the two points. Of particular interest is the cubic Bézier curve, which allows the specification of direction and location at both endpoints and can be written as<br />
<br />
:<math>\vec{x}(s)=\vec{P}_0 (1-s)^3 + 3\vec{P}_1 s (1-s)^2 + 3 \vec{P}_2 s^2 (1-s) + \vec{P}_3 s^3,</math><br />
<br />
where the <math>P_i</math>'s are the control points and again <math>s\in [0,1]</math>.<br />
<br />
By changing the functional expression for <math>s</math>, we can change the grid distribution along the line segement. These functions are often referred to as stretching functions, and there are many choices available. The simplest choice is a uniform distribution, in which we set<br />
<br />
:<math>s(\xi)= \frac{\xi}{I},</math><br />
<br />
where <math>\xi\in[0,I]</math>. For cases in which grid clustering is desired, the hyperbolic trigonometric functions such as the hyperbolic tangent are a popular choice. A simple one-parameter hyperbolic tangent stretching function is defined by <br />
<br />
:<math>s\left(\xi\right) = 1 + \frac{\tanh\left[\delta\left(\xi/I-1\right)\right]}{\tanh\left(\delta\right)},</math><br />
<br />
where <math>\delta</math> is the stretching factor and <math>\xi\in[0,I]</math>. This function partitions the unit interval and allows the specification of a single location. This sort of distribution is good for wall-normal grid distribution in viscous flows. This distribution is due to Vinokur <ref><br />
Vinokur, Marcel, ''On One-Dimensional Stretching Functions for Finite-Difference Calculations'', Journal of Computational Physics. 50, 215, 1983.<br />
</ref>. Vinokur's procedure for the determination of the proper stretching factor to obtain desired spacings uses the derivatives of the stretching functions. Suppose we wish for our first grid spacing to be <math>\Delta s</math>. This can be taken to mean that <math>s(1)=\Delta s</math> or that <math>ds/d\xi (1) = \Delta s</math>. Vinokur's procedure guarantees the latter.<br />
<br />
A related double-sided stretching function (that gives symmetric spacings about <math>\xi=I/2</math>) is given by<br />
<br />
:<math>u\left(\xi\right) = \frac{1}{2}\left[1 + \frac{\tanh\left[\delta\left(\xi/I-1/2\right)\right]}{\tanh\left(\delta/2\right)}\right].</math><br />
<br />
This function is good for duct flows, such as turbulent channel flow. In situations in which different grid spacings are desired, a stretching function can be constructed that has specified spacings at both ends: <math>\Delta s_1</math> and <math>\Delta s_2</math>. Vinokur gives such a function, first defining<br />
<br />
:<math>A=\frac{\sqrt{\Delta s_2}}{\sqrt{\Delta s_1}},\ \ B=\frac{1}{I\sqrt{\Delta s_2\Delta s_1}}.</math><br />
<br />
The stretching factor <math>\delta</math> is found from the solution of the transcendental equation<br />
<br />
:<math> \frac{\sinh\left(\delta\right)}{\delta} = B.</math><br />
<br />
The final grid distribution is then given by<br />
<br />
:<math>s\left(\xi\right)=\frac{u\left(\xi\right)}{A + (1-A)u\left(\xi\right)}.</math><br />
<br />
Again, Vinokur's procedure ensures that the derivative conditions <math>ds/d\xi (1) = \Delta s_1</math> and <math>ds/d\xi (I) = \Delta s_2</math>, and not the grid spacings obtained in the direct evaluation of the stretching function.<br />
<br />
For the generation of interior cells, algebraic techniques are also available, most usually in the form of interpolation between boundary faces.<br />
<br />
==Elliptic Grid Generation==<br />
The oldest numerical grid generation techniques are based upon the solution of elliptic PDE's. Typically, a Poission-type equation is solved given the boundary grid distribution to generate interior nodal points. The solution domain is often topologically equivalent to a cube in 3D and a square in 2D. Consider the solution domain shown below with the indicated boundary resolution.<br />
<br />
[[Image:MG_boundary.png]]<br />
<br />
The simplest technique we could use here would be a solution of the Laplace equation using the standard second order finite difference stencil. This approach simplies into a form that is easily solved using Jacobi or Gauss-Seidel iterative techniques:<br />
<br />
:<math>\nabla\vec{x}=0\ </math> <br />
<br />
with Dirichlet boundary conditions is discretized as <br />
<br />
:<math>\ \vec{x}_{i,j} = \frac{\vec{x}_{i+1,j}+\vec{x}_{i-1,j}+\vec{x}_{i,j+1}+\vec{x}_{i,j-1}}{4}</math><br />
<br />
An initial grid is shown below in (a), and the resulting grid (after iterations) is shown in (b).<br />
<br />
[[Image:MG_initial_final.png]]<br />
<br />
Note that the grid spacing near the curved section increases and then decreases as we move left to right, and that grid lines near the left and right boundaries are not very orthogonal. These issues are reasons that production grid generation techniques are usually more complicated. The addition of [[control functions]] allows for better grid clustering properties, which will be necessary for viscous flow simulations.<br />
<br />
==Grid Marching Methods==<br />
<br />
==Other Techniques==<br />
[http://en.wikipedia.org/wiki/Stretched_grid_method Stretched grid method]<br />
<br />
==References==<br />
<div class="references-small"><br />
<references/><br />
</div><br />
----<br />
[[Mesh classification|<< Mesh Classification]] | '''Structured Mesh Generation''' | [[ Unstructured mesh generation|Unstructured Mesh Generation>>]]</div>E v popovhttp://www.cfd-online.com/Wiki/Structured_mesh_generationStructured mesh generation2012-04-27T03:48:46Z<p>E v popov: /* Other Techniques */</p>
<hr />
<div>{{Meshing table of contents}}<br />
[[Mesh classification|<< Mesh Classification]] | '''Structured Mesh Generation''' | [[ Unstructured mesh generation|Unstructured Mesh Generation>>]]<br />
<br />
The simplest algorithms directly compute nodal placement from some given function. These algorithms are referred to as algebraic algorithms. Many of the algorithms for the generation of structured meshes are descendents of "numerical grid generation" algoritms, in which a differential equation is solved to determine the nodal placement of the grid. In many cases, the system solved is an elliptic system, so these methods are often referred to as elliptic methods. The best basic refence on this topic is the book of Thompson, Warsi, and Mastin<ref>Thompson, Joe F., Warsi, Z.U.A., and Mastin, C. Wayne, ''Numerical Grid Generation'', Elsevier Science Publishers, 1985</ref>. There are more recent texts available, but this is the classic book on the subject, and it is available online [http://www.hpc.msstate.edu/publications/gridbook/ here].<br />
<br />
==Algebraic Grid Generation==<br />
The simplest way to obtain a grid would be to specify the grid coordinates <math>\vec{x}</math> as the result of some vector function, or <br />
<br />
:<math>\vec{x}=\vec{x}\left(\vec{\xi}\right),</math><br />
<br />
where <math>\vec{\xi}</math> is the "index" vector, sometimes referred to as a computational coordinate. For our purposes here the entries of the computational coordinate will range from zero to a maximum. <br />
If such a function can be found for a given geometry, then the actual generation of gridpoints is straightforward. The problem, however, is that the determination of the function is not neccessarily that easy. In practice, it is sometimes easier to add an intermediate parametric space, denoted by <math>\vec{s}</math>, in between the physical space representation of the grid and the computational space representation of the grid:<br />
<br />
:<math>\vec{x}=\vec{x}\left(\vec{s}\left(\vec{\xi}\right)\right).</math><br />
<br />
The entries in the computational coordinate are taken from the unit interval. This representation can help simplify matters, especially in the one dimensional case. <br />
<br />
Many mesh generation systems (both structured and unstructured) require the generation of boundary grids before interior cells can be generated. This is an area in which algebraic grid generation is ideal - typically, we want to specify boundary edge point distributions quickly, with a minimum of complexity, and a high degree of repeatability. Consider a line segment joining two points <math>\vec{x}_1</math> and <math>\vec{x}_2</math> together. The segment can be expressed as the linear form<br />
<br />
:<math>\vec{x}(s)=s(\vec{x}_2 - \vec{x}_1) + \vec{x}_1,\ \ s\in [0,1].</math><br />
<br />
Similar expressions are possible for other curves connecting the two points. Of particular interest is the cubic Bézier curve, which allows the specification of direction and location at both endpoints and can be written as<br />
<br />
:<math>\vec{x}(s)=\vec{P}_0 (1-s)^3 + 3\vec{P}_1 s (1-s)^2 + 3 \vec{P}_2 s^2 (1-s) + \vec{P}_3 s^3,</math><br />
<br />
where the <math>P_i</math>'s are the control points and again <math>s\in [0,1]</math>.<br />
<br />
By changing the functional expression for <math>s</math>, we can change the grid distribution along the line segement. These functions are often referred to as stretching functions, and there are many choices available. The simplest choice is a uniform distribution, in which we set<br />
<br />
:<math>s(\xi)= \frac{\xi}{I},</math><br />
<br />
where <math>\xi\in[0,I]</math>. For cases in which grid clustering is desired, the hyperbolic trigonometric functions such as the hyperbolic tangent are a popular choice. A simple one-parameter hyperbolic tangent stretching function is defined by <br />
<br />
:<math>s\left(\xi\right) = 1 + \frac{\tanh\left[\delta\left(\xi/I-1\right)\right]}{\tanh\left(\delta\right)},</math><br />
<br />
where <math>\delta</math> is the stretching factor and <math>\xi\in[0,I]</math>. This function partitions the unit interval and allows the specification of a single location. This sort of distribution is good for wall-normal grid distribution in viscous flows. This distribution is due to Vinokur <ref><br />
Vinokur, Marcel, ''On One-Dimensional Stretching Functions for Finite-Difference Calculations'', Journal of Computational Physics. 50, 215, 1983.<br />
</ref>. Vinokur's procedure for the determination of the proper stretching factor to obtain desired spacings uses the derivatives of the stretching functions. Suppose we wish for our first grid spacing to be <math>\Delta s</math>. This can be taken to mean that <math>s(1)=\Delta s</math> or that <math>ds/d\xi (1) = \Delta s</math>. Vinokur's procedure guarantees the latter.<br />
<br />
A related double-sided stretching function (that gives symmetric spacings about <math>\xi=I/2</math>) is given by<br />
<br />
:<math>u\left(\xi\right) = \frac{1}{2}\left[1 + \frac{\tanh\left[\delta\left(\xi/I-1/2\right)\right]}{\tanh\left(\delta/2\right)}\right].</math><br />
<br />
This function is good for duct flows, such as turbulent channel flow. In situations in which different grid spacings are desired, a stretching function can be constructed that has specified spacings at both ends: <math>\Delta s_1</math> and <math>\Delta s_2</math>. Vinokur gives such a function, first defining<br />
<br />
:<math>A=\frac{\sqrt{\Delta s_2}}{\sqrt{\Delta s_1}},\ \ B=\frac{1}{I\sqrt{\Delta s_2\Delta s_1}}.</math><br />
<br />
The stretching factor <math>\delta</math> is found from the solution of the transcendental equation<br />
<br />
:<math> \frac{\sinh\left(\delta\right)}{\delta} = B.</math><br />
<br />
The final grid distribution is then given by<br />
<br />
:<math>s\left(\xi\right)=\frac{u\left(\xi\right)}{A + (1-A)u\left(\xi\right)}.</math><br />
<br />
Again, Vinokur's procedure ensures that the derivative conditions <math>ds/d\xi (1) = \Delta s_1</math> and <math>ds/d\xi (I) = \Delta s_2</math>, and not the grid spacings obtained in the direct evaluation of the stretching function.<br />
<br />
For the generation of interior cells, algebraic techniques are also available, most usually in the form of interpolation between boundary faces.<br />
<br />
==Elliptic Grid Generation==<br />
The oldest numerical grid generation techniques are based upon the solution of elliptic PDE's. Typically, a Poission-type equation is solved given the boundary grid distribution to generate interior nodal points. The solution domain is often topologically equivalent to a cube in 3D and a square in 2D. Consider the solution domain shown below with the indicated boundary resolution.<br />
<br />
[[Image:MG_boundary.png]]<br />
<br />
The simplest technique we could use here would be a solution of the Laplace equation using the standard second order finite difference stencil. This approach simplies into a form that is easily solved using Jacobi or Gauss-Seidel iterative techniques:<br />
<br />
:<math>\nabla\vec{x}=0\ </math> <br />
<br />
with Dirichlet boundary conditions is discretized as <br />
<br />
:<math>\ \vec{x}_{i,j} = \frac{\vec{x}_{i+1,j}+\vec{x}_{i-1,j}+\vec{x}_{i,j+1}+\vec{x}_{i,j-1}}{4}</math><br />
<br />
An initial grid is shown below in (a), and the resulting grid (after iterations) is shown in (b).<br />
<br />
[[Image:MG_initial_final.png]]<br />
<br />
Note that the grid spacing near the curved section increases and then decreases as we move left to right, and that grid lines near the left and right boundaries are not very orthogonal. These issues are reasons that production grid generation techniques are usually more complicated. The addition of [[control functions]] allows for better grid clustering properties, which will be necessary for viscous flow simulations.<br />
<br />
==Grid Marching Methods==<br />
<br />
==Other Techniques==<br />
[Stretched grid method]<br />
<br />
==References==<br />
<div class="references-small"><br />
<references/><br />
</div><br />
----<br />
[[Mesh classification|<< Mesh Classification]] | '''Structured Mesh Generation''' | [[ Unstructured mesh generation|Unstructured Mesh Generation>>]]</div>E v popov