0% found this document useful (0 votes)
33 views25 pages

10-Boundary Conditions - Gradient Computations On Unstructred Meshes

The document discusses boundary conditions and gradient computation on unstructured meshes. It examines implementation of boundary conditions and looks at computation of gradients. It describes the gradient theorem approach and least squares approach for calculating gradients on unstructured meshes.

Uploaded by

alagarg137691
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
33 views25 pages

10-Boundary Conditions - Gradient Computations On Unstructred Meshes

The document discusses boundary conditions and gradient computation on unstructured meshes. It examines implementation of boundary conditions and looks at computation of gradients. It describes the gradient theorem approach and least squares approach for calculating gradients on unstructured meshes.

Uploaded by

alagarg137691
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 25

Lecture 10:

Boundary Conditions
Gradient Computation on Unstructured
Meshes
Last Time…

We looked at
z 2D steady diffusion on non-orthogonal unstructured
meshes
z Wrote diffusion flux in terms of primary and secondary
gradients
z Figured out how to write secondary gradients
This Time

We will
z Examine implementation of boundary conditions
z Look at computation of gradients on unstructured
meshes
Boundary Conditions

z Near-boundary cell balance:

z Boundary flux:

z Secondary gradient term:


Boundary Conditions (Cont’d)

z Boundary flux :

z Discretize primary component:

z Write secondary gradient in terms


(total-primary):
Boundary Conditions (Cont’d)

z Secondary flux at boundary:

z Find boundary gradient from cell value

z Thus:
Dirichlet Boundary Conditions

z For Dirichlet bc:

z Use given value in finding boundary flux:


Use given value to
compute gradient

Use given value


here
Discrete Equation

z Scarborough
criterion satisfied
for fixed secondary
gradient
z Boundedness?
z Iterative
procedure?
Other BCs

z What about other types of boundary conditions


z Neumann bc would be treated as for rectangular
meshes
» Total flux (Primary + Secondary) = qb,given
» Put into near-boundary cell balance
z Mixed bc
» Find φb in terms of φ∞ and φP using boundary
condition
» Substitute for φb in boundary flux expression
» Write cell balance
Gradient Calculation

z Need cell-centroid value of the gradient to find


secondary gradients
z Will need gradient later for other purposes
» Second and highe-order convective schemes
» Source terms for turbulence, non-Newtonian
viscosity expressions, others…
Gradient Calculation For Rectangular
Structured Meshes

z Easy to find either cell or face value

z Can easily find partial derivatives


Gradient Calculations for Structured
Meshes
Gradient Calculation (Cont’d)

z Alternatively, can find face gradient directly


Gradient Calculation on Unstructured
Meshes

z Two different methods


» Gradient theorem approach
» Least Squares approach
z Gradient Theorem:
Gradient Theorem Approach

z Write discrete form:

z As a first approximation:

z Iteratively improve face value


Discussion

z Iterative improvement is possible by updating face


value
z As number of iterations increase, we involve a larger
and larger stencil of neighbors; can lead to wiggly
gradients
z In practice, 1-2 iterations are done
z “Limiting” is used to bound the face value between
neighbor values
Least Squares Method for Gradient
Calculation

z Estimate values at
neighboring cell-centroids
assuming local linearity and
using cell gradient at C0
z Figure out an “error” in the
estimate
z Find gradient components at
C0 to minimize error
Least Squares Method (Cont’d)

z Let’s assume that local variation is linear


z We can estimate value at C1 centroid as:
Least Squares Method (Cont’d)

z Can do similar manipulation at all face centroids


j=1,2,…,J:

z Can write a set of equations where M is Jx2 matrix


Least Squares Method (Cont’d)

z Unknowns are the two components of the gradient


z However, we have as many equations as there are
face neighbors
z Too many equations – cannot satisfy them all
z Means you can’t find a linear profile through all the
neighbors
Least Squares Method (Cont’d)

z Difference value for all face


neighbors j=1,2,…,J

z Error with respect to real


difference is:

z Total error:
Least Squares Method (Cont’d)

z Defining

z Error:

z Find a, b so as to minimize error:


Least Squares Method (Cont’d)

z Can show that this yields

•2x2 matrix
•Function of geometry only; can
calculate once and store
Discussion

z For MTM to be non-singular, we need 3 non-collinear


points to compute the gradient
z Another way of understanding this is that a linear
variation can be written as

z We need 3 unique points φ(x,y) to find the 3 constants


z Not restricted to 2D; no need for structure
z Don’t have to restrict to face neighbors
Closure

In this lecture, we
z Saw that we needed to compute cell-based gradients
of φ
z Computed these gradients using two different methods
z Least squares technique is the preferable one
» Guarantees linear gradients exactly recovered
» Can be extended to higher order if necessary

You might also like