https://www.cfd-online.com/W/index.php?title=Special:Contributions/Kri&feed=atom&limit=50&target=Kri&year=&month=CFD-Wiki - User contributions [en]2017-01-24T18:19:00ZFrom CFD-WikiMediaWiki 1.16.5https://www.cfd-online.com/Wiki/Staggered_gridStaggered grid2012-03-03T16:17:48Z<p>Kri: It's used for simulations of compressible flows too</p>
<hr />
<div>On a staggered grid the scalar variables (pressure, density, total enthalpy etc.) are stored in the cell centers of the control volumes, whereas the velocity or momentum variables are located at the cell faces. This is different from a [[Collocated grid|collocated grid]] arrangement, where all variables are stored in the same positions. A staggered storage is mainly used on [[Mesh_classification#Structured_Meshes|structured grids]] for [[Compressible flow|compressible]] or [[Incompressible flow|incompressible flow]] simulations.<br />
<br />
Using a staggered grid is a simple way to avoid [[Odd-even decoupling|odd-even decoupling]] between the pressure and velocity. Odd-even decoupling is a discretization error that can occur on collocated grids and which leads to checkerboard patterns in the solutions.<br />
<br />
The disadvantage of using staggered grids is that different variable are stored at different places and this makes it more difficult to handle different control volumes for different varibales and to keep track of the metrics. Most modern codes instead use a collocated storage.<br />
<br />
==References==<br />
<br />
{{reference-paper|author=Harlow, F. H. and Welch, J. E.|year=1965|title=Numerical calculation of time-dependent viscous incompressible flow of fluid with free surface|rest=Phys. Fluids. 8, 2182}}</div>Krihttps://www.cfd-online.com/Wiki/Gradient_computationGradient computation2011-06-07T13:04:54Z<p>Kri: /* Introduction */ This also works (prevented line break)</p>
<hr />
<div>== Introduction ==<br />
For structured orthogonal grids, the gradient of a scalar at a given control volume centroid can be easily computed using the definition of the derivatives. The case becomes more complicated when general unstructured grids are involved. The usual approach is to make use of Green-Gauss theorem which states that the surface integral of a scalar function is equal to the volume integral (over the volume bound by the surface) of the gradient of the scalar function. <br><br />
<br />
<math>\int_{\Omega}\nabla \phi\,d\Omega =\,\!\int_{S} \phi\,\hat{n}\,dS </math><br><br />
<br />
where <math>\hat{n}</math> is the surface normal pointing out from the volume. Assuming that <math> \nabla \phi </math> is constant over the control volume, the Green-Gauss equation can be rewritten as <br><br />
<br />
<math>\int_{\Omega}\nabla \phi\,d\Omega =\nabla \phi_P\,\Omega = \int_{S} \phi\,\hat{n}\,dS </math><br><br />
<br />
We next approximate the integral over the surface as a summation of the average scalar value in each face times the face's surface vector <br><br />
<br />
<math>\nabla \phi_P =\frac {1}{\Omega}\sum_{faces} \phi_f\,\vec S_f </math><br><br />
<br />
The face value <math>\phi_f</math> still needs to be defined. Following are some practical methods to compute the average face value.<br />
<br />
== Face value computation ==<br />
As mentioned above, the average value of the scalar at a given face has to be correctly approximated in order to yield a correct computation of the cell gradient. As the FVM uses a cell centered formulation, values at the faces are not readily available, they have to be interpolated. There are two main approaches to compute the face value of a scalar<br />
*'''Cell based''' in which the face value is computed using the values at its straddling cells<br />
*'''Node based''' in which the face value is computed using the values at its straddling nodes<br />
''Note that these methods are not specific for the computation of the gradient. They can be used in any occasion when the face value is needed.''<br />
<br />
=== Cell based methods ===<br />
We define <math>\alpha</math> as the weighing geometric factor between cells P and N <br><br />
<math> \alpha = \frac {\left | \vec r_N - \vec r_f \right |} {\left | \vec r_N - \vec r_P \right |}</math> <br><br />
then a simple approximation for the face value can be defined as <br><br />
<math> \phi _f = \alpha \phi_P + \left( {1 - \alpha} \right)\phi_N</math> <br><br />
This approximation is also known as a weighted interpolation. It is defined by a compact stencil in that only the cells straddling the face are only involved in the interpolation.<br><br />
A special case arises when the face is situated midway between the two control volumes and the approximation reduces to an arithmetic average <br><br />
<math> \phi_f = 0.5 \left( \phi_P + \phi _N \right) </math> <br><br />
<br><br />
The advantage of this approach is that it is simple to implement. All of the operations involved are face-based and do not require any additional grid connectivity. Furthermore, the procedure can be readily implemented in three dimensions. <br><br />
From an accuracy point of view, the above relation leads to a second order approximation of <math> \phi_f </math> only when the segment [PN] and surface Sf are aligned. Thus a second order accurate representation of the gradient is generally not achieved except for this case.<br><br />
For highly skewed unstructured grids, the accuracy decreases with increasing skewness. In such a case, a correction is added to the above approximation and an iterative procedure is usually needed to find the face value.<br />
<br />
===Node based methods ===<br />
The value of <math> \phi_f </math> can be computed as the mean of the nodes defining the face. This necessitates the estimation of the properties at the nodes. The properties at the nodes are calculated using the weighted average of the properties within the cells defining that node. The weight is taken as the inverse of the distance of the node from the cell center <br><br />
<math> \phi_{vertex} = \phi_v = <br />
\frac{{\sum\limits_{n = 1}^{cells} {\frac{{\phi _{Pn} }}{{\left| {\vec r_v - \vec r_{Pn} } \right|}}} }}{{\sum\limits_{n = 1}^{cells} {\frac{1}{{\left| {\vec r_v - \vec r_{Pn} } \right|}}} }}<br />
</math> <br><br />
where v denotes the concerned vertex and the loop is performed over the the cells that define the vertex. Pn is the index of the cell, and <math>\left| {\vec r_v - \vec r_{Pn} } \right|</math> is the distance from the vertex to the cell centroid. <br><br />
Finally, the face value is taken as the arithmetic average of the values at the vertices.<br><br />
<math> \phi _f = {\begin{matrix} {1 \over {N_{fv}}} \end{matrix}} \sum\limits_{i = 1}^{N_{fv}} {\phi _i }</math> <br><br />
where Nfv represents the number of '''Vertices''' defining a given face.<br />
<br />
== Note ==<br />
The above mentioned gradients are sometimes called '''unlimited gradients''' since the face value obtained from them can exceed the bounding cell values. For this reason, for implementing higher order schemes, it becomes important to restrict them, so as not to introduce over and undershoot of variables.<br />
<br />
<br />
----<br />
<i> Return to [[Numerical methods | Numerical Methods]] </i></div>Krihttps://www.cfd-online.com/Wiki/Gradient_computationGradient computation2011-06-06T19:05:04Z<p>Kri: /* Introduction */ for each face face</p>
<hr />
<div>== Introduction ==<br />
For structured orthogonal grids, the gradient of a scalar at a given control volume centroid can be easily computed using the definition of the derivatives. The case becomes more complicated when general unstructured grids are involved. The usual approach is to make use of Green-Gauss theorem which states that the surface integral of a scalar function is equal to the volume integral (over the volume bound by the surface) of the gradient of the scalar function. <br><br />
<br />
<math>\int_{\Omega}\nabla \phi\,d\Omega =</math><math>\,\int_{S} \phi\,\hat{n}\,dS </math><br><br />
<br />
where <math>\hat{n}</math> is the surface normal pointing out from the volume. Assuming that <math> \nabla \phi </math> is constant over the control volume, the Green-Gauss equation can be rewritten as <br><br />
<br />
<math>\int_{\Omega}\nabla \phi\,d\Omega =\nabla \phi_P\,\Omega = \int_{S} \phi\,\hat{n}\,dS </math><br><br />
<br />
We next approximate the integral over the surface as a summation of the average scalar value in each face times the face's surface vector <br><br />
<br />
<math>\nabla \phi_P =\frac {1}{\Omega}\sum_{faces} \phi_f\,\vec S_f </math><br><br />
<br />
The face value <math>\phi_f</math> still needs to be defined. Following are some practical methods to compute the average face value.<br />
<br />
== Face value computation ==<br />
As mentioned above, the average value of the scalar at a given face has to be correctly approximated in order to yield a correct computation of the cell gradient. As the FVM uses a cell centered formulation, values at the faces are not readily available, they have to be interpolated. There are two main approaches to compute the face value of a scalar<br />
*'''Cell based''' in which the face value is computed using the values at its straddling cells<br />
*'''Node based''' in which the face value is computed using the values at its straddling nodes<br />
''Note that these methods are not specific for the computation of the gradient. They can be used in any occasion when the face value is needed.''<br />
<br />
=== Cell based methods ===<br />
We define <math>\alpha</math> as the weighing geometric factor between cells P and N <br><br />
<math> \alpha = \frac {\left | \vec r_N - \vec r_f \right |} {\left | \vec r_N - \vec r_P \right |}</math> <br><br />
then a simple approximation for the face value can be defined as <br><br />
<math> \phi _f = \alpha \phi_P + \left( {1 - \alpha} \right)\phi_N</math> <br><br />
This approximation is also known as a weighted interpolation. It is defined by a compact stencil in that only the cells straddling the face are only involved in the interpolation.<br><br />
A special case arises when the face is situated midway between the two control volumes and the approximation reduces to an arithmetic average <br><br />
<math> \phi_f = 0.5 \left( \phi_P + \phi _N \right) </math> <br><br />
<br><br />
The advantage of this approach is that it is simple to implement. All of the operations involved are face-based and do not require any additional grid connectivity. Furthermore, the procedure can be readily implemented in three dimensions. <br><br />
From an accuracy point of view, the above relation leads to a second order approximation of <math> \phi_f </math> only when the segment [PN] and surface Sf are aligned. Thus a second order accurate representation of the gradient is generally not achieved except for this case.<br><br />
For highly skewed unstructured grids, the accuracy decreases with increasing skewness. In such a case, a correction is added to the above approximation and an iterative procedure is usually needed to find the face value.<br />
<br />
===Node based methods ===<br />
The value of <math> \phi_f </math> can be computed as the mean of the nodes defining the face. This necessitates the estimation of the properties at the nodes. The properties at the nodes are calculated using the weighted average of the properties within the cells defining that node. The weight is taken as the inverse of the distance of the node from the cell center <br><br />
<math> \phi_{vertex} = \phi_v = <br />
\frac{{\sum\limits_{n = 1}^{cells} {\frac{{\phi _{Pn} }}{{\left| {\vec r_v - \vec r_{Pn} } \right|}}} }}{{\sum\limits_{n = 1}^{cells} {\frac{1}{{\left| {\vec r_v - \vec r_{Pn} } \right|}}} }}<br />
</math> <br><br />
where v denotes the concerned vertex and the loop is performed over the the cells that define the vertex. Pn is the index of the cell, and <math>\left| {\vec r_v - \vec r_{Pn} } \right|</math> is the distance from the vertex to the cell centroid. <br><br />
Finally, the face value is taken as the arithmetic average of the values at the vertices.<br><br />
<math> \phi _f = {\begin{matrix} {1 \over {N_{fv}}} \end{matrix}} \sum\limits_{i = 1}^{N_{fv}} {\phi _i }</math> <br><br />
where Nfv represents the number of '''Vertices''' defining a given face.<br />
<br />
== Note ==<br />
The above mentioned gradients are sometimes called '''unlimited gradients''' since the face value obtained from them can exceed the bounding cell values. For this reason, for implementing higher order schemes, it becomes important to restrict them, so as not to introduce over and undershoot of variables.<br />
<br />
<br />
----<br />
<i> Return to [[Numerical methods | Numerical Methods]] </i></div>Krihttps://www.cfd-online.com/Wiki/Gradient_computationGradient computation2011-06-06T18:56:43Z<p>Kri: /* Introduction */ Changed to hat oven n (the first equation couldn't be rendered by some reason so I had to split it)</p>
<hr />
<div>== Introduction ==<br />
For structured orthogonal grids, the gradient of a scalar at a given control volume centroid can be easily computed using the definition of the derivatives. The case becomes more complicated when general unstructured grids are involved. The usual approach is to make use of Green-Gauss theorem which states that the surface integral of a scalar function is equal to the volume integral (over the volume bound by the surface) of the gradient of the scalar function. <br><br />
<br />
<math>\int_{\Omega}\nabla \phi\,d\Omega =</math><math>\,\int_{S} \phi\,\hat{n}\,dS </math><br><br />
<br />
where <math>\hat{n}</math> is the surface normal pointing out from the volume. Assuming that <math> \nabla \phi </math> is constant over the control volume, the Green-Gauss equation can be rewritten as <br><br />
<br />
<math>\int_{\Omega}\nabla \phi\,d\Omega =\nabla \phi_P\,\Omega = \int_{S} \phi\,\hat{n}\,dS </math><br><br />
<br />
We next approximate the integral over the surface as a summation of the average scalar value times the surface vector <br><br />
<br />
<math>\nabla \phi_P =\frac {1}{\Omega}\sum_{faces} \phi_f\,\vec S_f </math><br><br />
<br />
The face value <math>\phi_f</math> still needs to be defined. Following are some practical methods to compute the average face value.<br />
<br />
== Face value computation ==<br />
As mentioned above, the average value of the scalar at a given face has to be correctly approximated in order to yield a correct computation of the cell gradient. As the FVM uses a cell centered formulation, values at the faces are not readily available, they have to be interpolated. There are two main approaches to compute the face value of a scalar<br />
*'''Cell based''' in which the face value is computed using the values at its straddling cells<br />
*'''Node based''' in which the face value is computed using the values at its straddling nodes<br />
''Note that these methods are not specific for the computation of the gradient. They can be used in any occasion when the face value is needed.''<br />
<br />
=== Cell based methods ===<br />
We define <math>\alpha</math> as the weighing geometric factor between cells P and N <br><br />
<math> \alpha = \frac {\left | \vec r_N - \vec r_f \right |} {\left | \vec r_N - \vec r_P \right |}</math> <br><br />
then a simple approximation for the face value can be defined as <br><br />
<math> \phi _f = \alpha \phi_P + \left( {1 - \alpha} \right)\phi_N</math> <br><br />
This approximation is also known as a weighted interpolation. It is defined by a compact stencil in that only the cells straddling the face are only involved in the interpolation.<br><br />
A special case arises when the face is situated midway between the two control volumes and the approximation reduces to an arithmetic average <br><br />
<math> \phi_f = 0.5 \left( \phi_P + \phi _N \right) </math> <br><br />
<br><br />
The advantage of this approach is that it is simple to implement. All of the operations involved are face-based and do not require any additional grid connectivity. Furthermore, the procedure can be readily implemented in three dimensions. <br><br />
From an accuracy point of view, the above relation leads to a second order approximation of <math> \phi_f </math> only when the segment [PN] and surface Sf are aligned. Thus a second order accurate representation of the gradient is generally not achieved except for this case.<br><br />
For highly skewed unstructured grids, the accuracy decreases with increasing skewness. In such a case, a correction is added to the above approximation and an iterative procedure is usually needed to find the face value.<br />
<br />
===Node based methods ===<br />
The value of <math> \phi_f </math> can be computed as the mean of the nodes defining the face. This necessitates the estimation of the properties at the nodes. The properties at the nodes are calculated using the weighted average of the properties within the cells defining that node. The weight is taken as the inverse of the distance of the node from the cell center <br><br />
<math> \phi_{vertex} = \phi_v = <br />
\frac{{\sum\limits_{n = 1}^{cells} {\frac{{\phi _{Pn} }}{{\left| {\vec r_v - \vec r_{Pn} } \right|}}} }}{{\sum\limits_{n = 1}^{cells} {\frac{1}{{\left| {\vec r_v - \vec r_{Pn} } \right|}}} }}<br />
</math> <br><br />
where v denotes the concerned vertex and the loop is performed over the the cells that define the vertex. Pn is the index of the cell, and <math>\left| {\vec r_v - \vec r_{Pn} } \right|</math> is the distance from the vertex to the cell centroid. <br><br />
Finally, the face value is taken as the arithmetic average of the values at the vertices.<br><br />
<math> \phi _f = {\begin{matrix} {1 \over {N_{fv}}} \end{matrix}} \sum\limits_{i = 1}^{N_{fv}} {\phi _i }</math> <br><br />
where Nfv represents the number of '''Vertices''' defining a given face.<br />
<br />
== Note ==<br />
The above mentioned gradients are sometimes called '''unlimited gradients''' since the face value obtained from them can exceed the bounding cell values. For this reason, for implementing higher order schemes, it becomes important to restrict them, so as not to introduce over and undershoot of variables.<br />
<br />
<br />
----<br />
<i> Return to [[Numerical methods | Numerical Methods]] </i></div>Krihttps://www.cfd-online.com/Wiki/Gradient_computationGradient computation2011-06-06T18:51:21Z<p>Kri: /* Introduction */ Added normal and extra spacing between variables to the equations</p>
<hr />
<div>== Introduction ==<br />
For structured orthogonal grids, the gradient of a scalar at a given control volume centroid can be easily computed using the definition of the derivatives. The case becomes more complicated when general unstructured grids are involved. The usual approach is to make use of Green-Gauss theorem which states that the surface integral of a scalar function is equal to the volume integral (over the volume bound by the surface) of the gradient of the scalar function. <br><br />
<br />
<math>\int_{\Omega}\nabla \phi\,d\Omega = \int_{S} \phi\,\bold{n}\,dS </math><br><br />
<br />
where '''n''' is the surface normal pointing out from the volume. Assuming that <math> \nabla \phi </math> is constant over the control volume, the Green-Gauss equation can be rewritten as <br><br />
<br />
<math>\int_{\Omega}\nabla \phi\,d\Omega =\nabla \phi_P\,\Omega = \int_{S} \phi\,\bold{n}\,dS </math><br><br />
<br />
We next approximate the integral over the surface as a summation of the average scalar value times the surface vector <br><br />
<br />
<math>\nabla \phi_P =\frac {1}{\Omega}\sum_{faces} \phi_f\,\vec S_f </math><br><br />
<br />
The face value <math>\phi_f</math> still needs to be defined. Following are some practical methods to compute the average face value.<br />
<br />
== Face value computation ==<br />
As mentioned above, the average value of the scalar at a given face has to be correctly approximated in order to yield a correct computation of the cell gradient. As the FVM uses a cell centered formulation, values at the faces are not readily available, they have to be interpolated. There are two main approaches to compute the face value of a scalar<br />
*'''Cell based''' in which the face value is computed using the values at its straddling cells<br />
*'''Node based''' in which the face value is computed using the values at its straddling nodes<br />
''Note that these methods are not specific for the computation of the gradient. They can be used in any occasion when the face value is needed.''<br />
<br />
=== Cell based methods ===<br />
We define <math>\alpha</math> as the weighing geometric factor between cells P and N <br><br />
<math> \alpha = \frac {\left | \vec r_N - \vec r_f \right |} {\left | \vec r_N - \vec r_P \right |}</math> <br><br />
then a simple approximation for the face value can be defined as <br><br />
<math> \phi _f = \alpha \phi_P + \left( {1 - \alpha} \right)\phi_N</math> <br><br />
This approximation is also known as a weighted interpolation. It is defined by a compact stencil in that only the cells straddling the face are only involved in the interpolation.<br><br />
A special case arises when the face is situated midway between the two control volumes and the approximation reduces to an arithmetic average <br><br />
<math> \phi_f = 0.5 \left( \phi_P + \phi _N \right) </math> <br><br />
<br><br />
The advantage of this approach is that it is simple to implement. All of the operations involved are face-based and do not require any additional grid connectivity. Furthermore, the procedure can be readily implemented in three dimensions. <br><br />
From an accuracy point of view, the above relation leads to a second order approximation of <math> \phi_f </math> only when the segment [PN] and surface Sf are aligned. Thus a second order accurate representation of the gradient is generally not achieved except for this case.<br><br />
For highly skewed unstructured grids, the accuracy decreases with increasing skewness. In such a case, a correction is added to the above approximation and an iterative procedure is usually needed to find the face value.<br />
<br />
===Node based methods ===<br />
The value of <math> \phi_f </math> can be computed as the mean of the nodes defining the face. This necessitates the estimation of the properties at the nodes. The properties at the nodes are calculated using the weighted average of the properties within the cells defining that node. The weight is taken as the inverse of the distance of the node from the cell center <br><br />
<math> \phi_{vertex} = \phi_v = <br />
\frac{{\sum\limits_{n = 1}^{cells} {\frac{{\phi _{Pn} }}{{\left| {\vec r_v - \vec r_{Pn} } \right|}}} }}{{\sum\limits_{n = 1}^{cells} {\frac{1}{{\left| {\vec r_v - \vec r_{Pn} } \right|}}} }}<br />
</math> <br><br />
where v denotes the concerned vertex and the loop is performed over the the cells that define the vertex. Pn is the index of the cell, and <math>\left| {\vec r_v - \vec r_{Pn} } \right|</math> is the distance from the vertex to the cell centroid. <br><br />
Finally, the face value is taken as the arithmetic average of the values at the vertices.<br><br />
<math> \phi _f = {\begin{matrix} {1 \over {N_{fv}}} \end{matrix}} \sum\limits_{i = 1}^{N_{fv}} {\phi _i }</math> <br><br />
where Nfv represents the number of '''Vertices''' defining a given face.<br />
<br />
== Note ==<br />
The above mentioned gradients are sometimes called '''unlimited gradients''' since the face value obtained from them can exceed the bounding cell values. For this reason, for implementing higher order schemes, it becomes important to restrict them, so as not to introduce over and undershoot of variables.<br />
<br />
<br />
----<br />
<i> Return to [[Numerical methods | Numerical Methods]] </i></div>Kri