You are on page 1of 3

Computational Fluid Dynamics

back to home

Contents

1 Numerical solution of Heat equation, Navier Stokes equations 1

1 Numerical solution of Heat equation, Navier Stokes equations

Remark: Schemes
To discretize a differential equation is to specify ,for a single target grid point, how its affected by neighboring
grid points( spatially) and its old time step value(temporal). The result is of the form aP P = aN N + aS S +
aW W .
Temporal schemes: for the neighboring grid points, if using their previous time step value, then its explicit
scheme, if using present time step value, then implicit scheme, if an average, then Crank Nicholeson.
Spatial schemes: given two grid points, there is some arbitrariness in assuming how temperature varies between
them. As grid size vanishes, there is not much difference. But the problem is which is more physical for a finite
grid size. For pure conduction, a straight line is most reasonable since thats the steady state solution. But
for convective(advective) problem, the steady state is exponential whose decay(growth) rate is dependent on
velocity. This is the idea of exponential scheme. But the idea is once we believe its exponential profile
between grid points, ANY point located between them has a unique slope and temperature value. A set of
coefficients can be used as weights for a particular scheme.
Remark: Difficulties in Flow and momentum
Nonlinearity can be tackled by Iterating the A matrix coefficients. But obtaining the correct pressure is more
obscure, since it can only be ascertained when the velocity field satisfies the continuity equation
The alternative is the eliminate Pressure from the governing equation, using stream function and vorticity.
The disadvantage of Stream-Vorticity is that it cant be easily carried to 3D and that quantities calculated
are not physical.
Remark: P and U,V
Given any Pressure distribution, it is straightforward to obtain U,V profile that satisfies the momentum equation.
The difficulty is to get these profiles to satisfy the continuity equation as well.
Remark: Main difficulty of Momentum eqns
A erroneous zigzag distribution of pressure and momentum cannot be detected with typical control volume and
first order derivative approximation.
The solution proposed by Patankar is to use a new set of grid for velocity components alone. This staggered
grid method specifies U only on E/W Interstitial points, and V only on N/S Interstitials points ( Interstitial
points are defined previously as the representative point on the center of a control volume face).
the pressure value, however, are still prescribed on the original unstaggered grid.
advantages of Staggered Grid: continuity on control volume is now using adjacent points, rather than alternate,
thus wavy distribution is prevented.
Continuity equation takes different form for compressible case, in which density must be correlated to pres-
sure/temp using equation of state.
Remark: SIMPLE Algorithm procedures(constant props case:)
1. Start with P pressure estimation;
2. Obtain U , V using U , V , P momentum equation. (% Most likely, this set of U , V does not satisfy
continuity. Since acceptable velocities must satisfy continuity, we need to correct the velocities. This means a
correction to the pressure field, i.e, a P 0 is needed %).
3. P 0 to U 0 V 0 correlation (Semi-implicit): (% since momentum equations are satisfied for both real U, V, P

1
and estimate U , V , P , it can be readily concluded that the correction must do also. So momentum equation of
U 0 , V 0 , P 0 serves as a basis for correction. It relates P 0 to U 0 , V 0 . However, instead of solving the entire U 0 , V 0 , P 0
momentum eqn, the Semi-implicit SIMPLE algorithm uses only part of this equation, i.e the direct influence
from pressure, and ignores the indirect influence of pressure exerted by neighboring velocities.%) SIMPLE gives
U, V expressed as a function of P.
4. Solve Ax = b for P; the system is obtained from U,V continuity equation and P-to- UV relation. This
means the new corrected Pressure and old velocity exactly satisfy the continuity equation. (% Since continuity
is about U, V velocity, substitute in U + U 0 , and convert all U 0 , V 0 to P 0 will produce a system of equations
from which P 0 can be solved. Calculate new pressure estimate, go back to 1 if necessary.)
Remark: SIMPLE Algorithm Notes
SIMPLE: Semi-Implicit means velocityPcorrection only include direct influence of pressure, not influence
from neighboring corrected velocities. The anb u0nb term is omitted. It somehow turns out that this omission
generates no error
Convergence is best evaluated by the vanishing of mass correction residue, i.e b of the continuity equation
linear system.
Any pressure correction algorithm, once arrived at a satisfactory P distribution, is a acceptable algorithm
for the problem, however the means. Efficiency measured by rate of convergence does matter when comparing
various correction algorithms
Under-relaxation of pressure correction is needed for convergence. but not velocity! Since the corrected veloc-
ity satisfies continuity and will be conducive to convergence
Density depends on temperature and ,for sonic flows, pressure, through equation of state(Problem 6.6,
Patankar)
Remark: Boundary conditions
Farfield(adiabatic):, Ux = Uy = 0; Vx = Vy = 0 Pressure is inlet pressure.
Inlet(fixed): U, V, P specified
Remark: SIMPLER
SIMPLER uses the hat velocity, instead of the guessed stared velocity. The hat velocity includes the neigh-
boring velocity influences. Hence a correct velocity yields a correct pressure upon the first iteration of pressure
correction; in contrast, SIMPLE has a worsening of pressure at first iteration even thought the velocity is correct
The cost of SIMPLER resides in the computation cost of hat velocities.
SIMPLER doesnt pass corrected Pressure through consecutive iterations, only velocity profile is. But still, in
every iteration, estimated velocity field, in addition to its correction is re-calculated. This is the same for both
SIMPLE and SIMPLER.
The main difference between SIMPLE and SIMPLER is SIMPLER re-calculates p in addition to p0 , while
SIMPLE assumes previous p as estimate.
Remark: Double precision
When representing large numbers with double, substraction between two large numbers can yield zero when
the actual difference is not eg 264 (264 1).
subtraction must be done carefully .
Using single precision reduce memory by 50%, and computation time by 50%,
double gives 16 digit precision, single gives 8.
converting a single back to double will not restore the accuracy, and might introduce an error:
double(0.3000000)=0.300000011920929
avoid trying to expect zero from precision demanding calculations: it wont get you there. Manually overwrite
instead.
Remark: Matlab parallel computing
max #workers=max (# CPU threads, 8).
parallel computing suits independent tasks well, but if output is connect in a complicated way(say modify
A(index{i})), then the overhead usually outweighs the benefit.
use parfor for parallel for loop, indexing accepts only i, : and other literal index.

2
Nature of quasi linear PDE:
Given auxx + buxy + cuyy + dux + euy + f = 0, we look at the determinant = b2 4ac and classify linear
second order PDE as the following:
Hyperbolic, > 0, one way causality or explicit marching. E.g: 1D wave equation
Parabolic, = 0, one way causality or explicit marching. E.g: 1D Transient Conduction, thin invsiscid
freestream boundary layer equation.
Elliptical, < 0, two way causality, implicit approach. E.g: Laplace equation, NS, full Euler.

You might also like