Differential Models
Alexander Solodov Valery Ochkov
Differential Models An Introduction with Mathcad
With 169 Figures
123
Prof. Dr. Alexander Pavlovich Solodov Ass. Prof. Dr.-Ing. Valery Fedorovich Ochkov Moscow Power Engineering Institute (Technical University) Dept. of Theoretical Basis of Thermotechnics (A. Solodov) Dept. of Water and Fuel Technology (V. Ochkov) Krasnokasarmennaya ul., 14, MPEI 111250 Moscow, Russia e-mail:
[email protected], http://twt.mpei.ac.ru/solodov e-mail:
[email protected], http://twt.mpei.ac.ru/ochkov
Library of Congress Control Number: 2004111785
Mathematics Subject Classification (2000): 76-01, 76D10, 76N10, 76Exx, 76L05, 80A20
ISBN 3-540-20852-6 Springer Berlin Heidelberg New York This work is subject to copyright. All rights are reserved, whether the whole or part of the material is concerned, specifically the rights of translation, reprinting, reuse of illustrations, recitation, broadcasting, reproduction on microfilm or in any other way, and storage in data banks. Duplication of this publication or parts thereof is permitted only under the provisions of the German Copyright Law of September 9, 1965, in its current version, and permission for use must always be obtained from Springer. Violations are liable for prosecution under the German Copyright Law. Springer is a part of Springer Science+Business Media springeronline.com © Springer Berlin Heidelberg 2005 Printed in Germany The use of general descriptive names, registered names, trademarks, etc. in this publication does not imply, even in the absence of a specific statement, that such names are exempt from the relevant protective laws and regulations and therefore free for general use. Typeset by the authors Cover design: design & production GmbH, Heidelberg Production: LE-TEX Jelonek, Schmidt & Vöckler GbR, Leipzig Printed on acid-free paper
SPIN: 10962121
40/3142YL - 5 4 3 2 1 0
Foreword This book includes mechanical engineering projects executed in Mathcad according to the following plan: • Problem-setting and physical model formulation • Designing the differential mathematical model, i.e. model in the form of the differential equations (DE) • Integration of the differential equations • Visualization of results. The common denominator forms a nucleus of projects. In all cases, this is the ordinary (ODE) or partial (PDE) differential equations. Though the projects included in the book are educational, they contain an element of research, have important practical applications and are demanding with respect to the computing aspect. The authors hope to present suitable combination of both problems of engineering significance and high computing complexity. It is hoped that this overview will motivate the reader to refer to some of the current mathematical software packages. For this purpose, Mathcad [24–26] is an effective and user-friendly tool and, as a whole, it may be considered the most accessible of the known mathematical packages. The purpose of the book is to help students and young engineers to design and solve differential equations. The book is designed as a textbook and consists of eleven chapters, each chapter covering a specific topic as follows. In the first chapter “Differential mathematical models” the origin of the differential equations is discussed. They do not appear at once on a working table of the engineer in a ready kind for integration, and more often should be designed by the researcher – as mathematical models of technological processes or devices. It is not unlikely, that this stage will be the most difficult in the engineering project, and we considered it to be useful to give examples, how from the indistinct verbal description the differential mathematical models of researched objects are born. The second chapter “Integrable differential equations” contains the list and brief manual for the equations of the specified type. It is shown, how to apply symbolical Mathcad processor at mathematical calculations in this case. The third chapter “Dynamic model of the system with heat generation” is devoted to systems that can develop under catastrophic scripts – with ignition and explosion. The concept of catastrophe as some destructive phenomenon is supplemented with a mathematical metaphor, namely, the description of dynamic system in the form of so-called fold catastrophe from the theory of R.Toma. In this chapter are used the elements of the qualitative theory of the differential equations. In the fourth chapter “Stiff differential equations” the problem of numerical integration of this special type of the equations is considered in detail. Despite the practical importance of the question, it is difficult for students or engineers to find
VI Foreword
the well-documented description of this phenomenon. Mathcad offers the effective built-in functions for integration of stiff equations, but the Mathcad HELP function does not give much input on this issue. Therefore, materials in chapter 4 are meant to fill this gap. There, the reader will find plenty of examples using the various integrators and discussion of the features of explicit and implicit numerical methods. The fifth chapter “Heat transfer near the stagnation point at cross tube flow” models the following situation, in which the novice engineer can find oneself by solving a real problem. Generally, in educational examples of manuals the right parts of the differential equations are always set by simple analytical expressions. In real problems the right part is almost always represented in the form of complex algorithm, and not as analytical expression. Therefore, we show in practical applications the Mathcad structures (the programs, the built-in functions of optimization etc.) that should be used when dealing with real differential models, and not only DE solvers as such. Chapter six “The Falkner–Skan equation of boundary layer” is devoted to numerical analysis of a fundamental problem of hydrodynamics and heat transfer. Together with Sect. 1.4 “Conservation laws”, the sixth chapter forms a brief theoretical course of convective heat transfer. Using Mathcad, the main topic is the numerical solution of two-point boundary-value problems for the ordinary differential equations set with application of built-in function reducing the boundary problem to an initial problem. In chapter seven “The Rayleigh equation: hydrodynamic instability” the stability of free shear flow by a method of small perturbations (linearization method) is analysed. The progressing perturbations, discovered through analysis, are the predecessors of turbulence. This chapter can serve as an elementary introduction into stability theory. The technique of operation with the differential equations in complex domain is considered. It shows how to integrate the equations with complex coefficients using the numerical method and how to interpret the complexvalued solutions. The eighth chapter “Kinematic waves of concentration in ion-exchange filter” continues the theme of partial differential equations begun in the first chapter by the problem of shock waves on a motorway. The physical and mathematical model of ion-exchange filter is offered. The ion-exchange filters provide ultrapure water to the steam plants of thermal and nuclear power stations. The solution of partial differential equation for the space-time distribution of impurity concentration is received by method of characteristics. Here we show, how the nonlinearity of differential model results in discontinuous multivalued solution. The ninth chapter “Kinematic shock waves” continues the topic of the wave equations. In this chapter we develop the Mathcad program for numerical integration of the partial differential equations with effective reproduction of shock waves. With the Mathcad program we are able to complete the research of problems about shock waves on motorways and filters. The problem of gravitational bubble flows (such as floating bubbles in a glass filled with beer or in a watersteam flow in an evaporator) is considered in detail. As we saw in the problems
Foreword VII about traffic jams and filters, shock wave formations will be observed, but with a steam content. The tenth chapter “Numerical modeling of the CPU-board temperature field” considers the numerical methods for PDE of second order. The new program supplements the standard Mathcad tools, simulates two-dimensional temperature fields for a dilated circle of problems and describes adequately the various forms of thermal interaction between an investigated object and its surrounding. The eleventh chapter “Temperature waves” is devoted to unsteady-state temperature fields. Applications of this part of thermal physics are numerous. For example, in power engineering for optimum control of starting procedure it is necessary to forecast the non-stationary temperature fields in elements of machines and equipment. The purpose is to exclude infringements of backlashes in moving elements due to unequal thermal expansion and to prevent occurrence of destructive thermal stress. Interesting problem is the modeling of action of superpower energy fluxes to construction units. Often, the high-power actions have periodic character, and in solid bodies the temperature waves arise. The onedimensional, non-stationary problem of heat conduction is surveyed as a model of the processes described above. The corresponding Mathcad-program has been designed on the basis of the TDMA method. The authors aspire to show with real examples how to effectively use Mathcad at all stages of an engineering project: • During analytical preprocessing of the mathematical description (during normalization, research of the special points, identical transformations, etc.) • During analytical decisions-making, whenever possible • During numerical decisions whenever analytical decisions are impossible or inefficient • For the presentation and visualization of results. In modern engineering research, in engineering design as well as in education – more and more computer models are used to take into account essential important effects and to work with adequate mathematical models of the objects. The engineer-researcher should not fear that the developed model might be too difficult for computing and that, therefore, it is necessary to simplify a problem appreciably. Can be, up to such degree, that the model absolutely will cease to be similar to real object. The bibliography at the end of the book includes references to the sources uses as well as selected general literature about numerical analysis and computer modeling. The index contains those books concerning our theme, which were read by authors, have seemed to them interesting and, hence, in the explicit or implicit form were used during our work. From R.Hamming's book [14] we would like to adopt the following motto for our own text: “The purpose of calculations – not numbers, but understanding”. Additional resources and electronic versions of Mathcad-programs contained in this book are available through the following website: www.thermal.ru, in part also in mode Mathcad Application Server. The authors can be contacted at:
[email protected],
[email protected].
Contents 1
Differential Mathematical Models ..........................................................1 1.1 Introduction .........................................................................................1 1.2 Laws in the Differential Form ..............................................................1 1.3 Models of Growth................................................................................8 1.4 Conservation Laws ............................................................................ 14 1.5 Conservation Law for Traffic Problem ............................................... 23 1.6 One-Dimensional Stationary Models: Fuel Element............................ 29 1.7 Conclusion......................................................................................... 33
2
Integrable Differential Equations.......................................................... 37 2.1 Introduction ....................................................................................... 37 2.2 First-Order Linear Equations.............................................................. 37 2.3 Linear Homogeneous Equations with Constant Coefficients ............... 41 2.4 Linear Inhomogeneous Equations....................................................... 43 2.5 Equations with Separable Variables.................................................... 43 2.6 Homogeneous Differential Equations ................................................. 44 2.7 Depression of Equation ...................................................................... 44 2.8 Conclusion......................................................................................... 46
3
Dynamic Model of Systems with Heat Generation ............................... 47 3.1 Introduction ....................................................................................... 47 3.2 Mathematical Model .......................................................................... 47 3.3 Phase-Plane Portrait. Stable and Unstable Equilibrium........................ 50 3.4 State Set Representation..................................................................... 51 3.5 Plotting the Bifurcation Set ................................................................ 53 3.6 Fold Catastrophe................................................................................ 54 3.7 Catastrophic Jumps at Smooth Variation of Parameters....................... 55 3.8 Time Evolution of System with Heat Generation ................................ 57 3.9 Conclusion......................................................................................... 60
4
Stiff Differential Equations ................................................................... 61 4.1 Introduction ....................................................................................... 61 4.2 Model Differential Equation............................................................... 62 4.3 Method rkfixed. Numerical Instability................................................ 63 4.4 Method rkadapt. Integration Step Problem.......................................... 68 4.5 Method stiffr. Solution of Stiff Model Equation.................................. 70 4.6 Method stiffr. Solution of Chemical Kinetics Equations...................... 72 4.7 Explicit and Implicit Methods ............................................................ 74 4.8 Jacobian Matrix ................................................................................. 76 4.9 Conclusion......................................................................................... 77
X Contents
5
Heat Transfer near the Stagnation Point at ross Tube Flow ............. 79 5.1 Introduction ....................................................................................... 79 5.2 The Integral Equation of a Thermal Boundary Layer .......................... 80 5.3 Mathematical Formulation of the Problem.......................................... 82 5.4 External Flow Velocity Distribution................................................... 84 5.5 Analysis for the Stagnation Point ....................................................... 86 5.6 Dimensionless Formulation................................................................ 89 5.7 Optimization Algorithm for the Right-Hand Side................................ 90 5.8 Numerical Integration with the Built-in Function Odesolve................. 91 5.9 Conclusion ........................................................................................ 93
6
The Falkner–Skan Equation of Boundary Layer ................................. 95 6.1 Introduction ....................................................................................... 95 6.2 Model Construction ........................................................................... 99 6.3 Boundary-Value Problem. Method sbval .......................................... 101 6.4 The Solution of the Initial Problem. Method rkfixed ......................... 103 6.5 Flow Field Imaging.......................................................................... 105 6.6 Boundary Layer on Permeable Walls................................................ 107 6.7 Thermal Boundary Layer. Heat Transfer Law................................... 112 6.8 Troubles with Odesolve ................................................................... 119 6.9 Conclusion ...................................................................................... 120
7
Rayleigh’s Equation: Hydrodynamical Instability ............................. 123 7.1 Introduction ..................................................................................... 123 7.2 Hydrodynamic Equations for Free Shear Flow.................................. 124 7.3 Perturbation Method. Linearization .................................................. 125 7.4 Transition to Complex Domain ........................................................ 127 7.5 Numerical Integration in the Complex Domain: Program Euler......... 130 7.6 Integration and Search of Eigenvalues.............................................. 131 7.7 Returning to the Real Domain .......................................................... 134 7.8 Conclusion ...................................................................................... 136
8
Kinematic Waves of Concentration in Ion-Exchange Filter............... 137 8.1 Introduction ..................................................................................... 137 8.2 Conservation Equation for Concentration in Filter ............................ 138 8.3 Wave Equation for Concentration..................................................... 140 8.4 Dimensionless Formulation.............................................................. 141 8.5 Isotherm of Adsorption .................................................................... 142 8.6 Solving a Wave Equation Using Method of Characteristics............... 146 8.7 Conclusion ...................................................................................... 150
9
Kinematic Shock Waves...................................................................... 151 9.1 Introduction ..................................................................................... 151 9.2 Conservation Equation in Finite-Difference Form............................. 152 9.3 Discontinuous Solutions. Shock Waves ............................................ 154 9.4 MacCormack Method. Computing Program McCrm......................... 156
Contents XI 9.5 9.6 9.7 9.8
Shock Waves of Concentration in a Filter......................................... 158 Shock Waves on a Motorway........................................................... 165 Gravitational Bubble Flow. Steam-Content Shock Waves ................. 170 Conclusion....................................................................................... 180
10
Numerical Modeling of the CPU-Board Temperature Field .............. 181 10.1 Introduction ..................................................................................... 181 10.2 Built-in Functions for Partial Differential Equations ......................... 183 10.3 Finite-Difference Approximation...................................................... 184 10.4 Iteration Method of Solution. Program Plate ..................................... 186 10.5 Thermal Model of the CPU-Board.................................................... 187 10.6 Problem of Orbital Platform. Function bvalfit ................................... 191 10.7 Conclusion....................................................................................... 196
11
Temperature Waves ............................................................................ 203 11.1 Introduction ..................................................................................... 203 11.2 Formulation of the Boundary-Value Problem.................................... 204 11.3 Discretization................................................................................... 204 11.4 TDMA: Computing Programs Coef and SYSTRD ............................ 208 11.5 Computational Modeling of Cyclical Thermal Action ....................... 211 11.6 Built-in Function Pdesolve ............................................................... 214 11.7 Conclusion....................................................................................... 217
Literature ...................................................................................................... 219 Appendix: Built-in Solvers for ODE............................................................. 223 Index.............................................................................................................. 231
1
Differential Mathematical Models
1.1
Introduction
The main purpose of the first chapter is to discuss the origin of the differential equations that should be solved by engineers. The student on examination receives the ready equation for the decision, however in real engineering the differential equation should be made, deduced as mathematical model for the device or technological process. Probably, this stage will be the most difficult in the engineering project, and we think, it is useful to show examples of how the differential mathematical models are born from the indistinct verbal description of researched objects. The second reason for this chapter is a problem of physical meaning and correctness of result. In particular at the initial stage of research, computer solutions may be liable to oscillations, or may be rapidly growing and resulting in overflow error, or containing discontinuity, etc. In real practice the strange behavior of solution is more likely than good. The kept control over physical meaning helps the engineer to advance further also in such complex mathematical situations: to localize the error, to optimize a numerical method, to refuse too strong simplification, and finally to accept or reject the solution. 1.2
Laws in the Differential Form
Newton's Second Law of Motion Some laws of nature are directly given in the differential form, i.e. in the form of the differential equations. The most simple and important example is Newton's second law of motion: m ⋅ a = F , “mass ⋅ acceleration = force”. The acceleration is the second time derivative of a way. Therefore, it is possible to write down the second law for rectilinear motion as the differential equation: d 2x F = . dτ 2 m
(1.1)
For the simple case of freely falling body we have F/m = g. The acceleration of gravity, symbolized as g, has an average value of 9.8 m/s2 near the surface of the Earth. Given this condition, the right hand side of (1.1) will be constant. Such differential equation is simple for integrating. Function, whose second derivative
2 1 Differential Mathematical Models
ferential equation is simple for integrating. Function, whose second derivative is constant, is quadratic parabola. The result is the position x as a time function: x = gτ2/2. More complicated problems arise, when the force depends on body position, its velocity and, possibly, acceleration. If the force is proportional to the displacement x of the mass from equilibrium position (x = 0) and opposite by sign, F = – b⋅x, the linear homogeneous differential equation with constant coefficients follows: d2x dτ 2
=−
b x; m
b = ω2 > 0; m
d 2x dτ 2
= − ω2 x ,
(1.2)
known as the harmonic oscillator equation. The constant b may be the spring constant or the pendulum weight mg, divided by length L (see Fig. 1.1). F = – bx m
friction= – c (dx/dt)
x
0
F = – (GMm /|r|2)(r/|r|) m
dr/dt
x
r M
F = – bx
Fig. 1.1. Examples from mechanics
Linearity of the differential equation (such as (1.2)) means, that derivatives of some function are proportional to the function itself. The exponential have such property. Therefore, the presumptive solution can be written down as x = C exp (k ), assuming indefinite parameters k and C, and then must be substituted in the differential equation. Necessary symbolical (analytical) transformations can be executed in Mathcad, as shown in Fig. 1.2. In the first line, Eq. (1.2) is symbolized as eq. We see further in block 2, that the substitution (keyword substitute) of the exponential function transforms the differential equation eq into the algebraic equation eq1 for eigenvalue k. The symbolical operator collect brings to light the structure of eq1 (line 3) collecting terms with indicated common subexpressions C and exp (k ). The operator solve gives the solution (line 4). Thus, two conjugate imaginary roots for eq1 and, accordingly, two complex exponents as solutions for eq (block 5) are present.
1.2 Laws in the Differential Form 3
(1) eq :=
d2
dτ
2
x( τ ) + ω ⋅ x( τ ) 2
0
(2) eq1 := eq substitute , x( τ )
C ⋅ exp ( k ⋅ τ ) →
2 d d C ⋅ exp ( k ⋅ τ ) + ω ⋅ C ⋅ exp ( k ⋅ τ ) dτ dτ
g
C ⋅ k ⋅ exp ( k ⋅ τ ) + ω ⋅ C ⋅ exp ( k ⋅ τ ) 2
2
eq1 := eq1 simplify →
(3) eq1 := eq1 collect , exp ( k ⋅ τ ) , C →
0
( k2 + ω2) ⋅C ⋅ exp( k⋅τ)
0
i ⋅ω
(4) k := eq1 solve , k →
0
i ⋅ω
k→
−i ⋅ ω
−i ⋅ ω
(5) C ⋅ exp ( k0⋅ τ ) complex → C ⋅ cos ( ω ⋅ τ ) + i ⋅ C ⋅ sin ( ω ⋅ τ ) C ⋅ exp ( k1⋅ τ ) complex → C ⋅ cos ( ω ⋅ τ ) − i ⋅ C ⋅ sin ( ω ⋅ τ )
Fig. 1.2. Exponents as solutions of the linear differential equation
The symbolical operator complex transforms exponents to trigonometric forms, sine and cosine. The constant C remains arbitrary. Pay attention: the symbolic evaluations start with the symbolic equal sign (right arrow). Solutions of Eq. (1.2) are harmonic functions (see Fig. 1.2, line 5). By itself Eq. (1.2) is known as the equation of harmonic vibrations or the equation of harmonic oscillator. It is one of the basic mathematical models of physics. The Mathcad help system contains some examples of such problems: Resource Center, Quick Sheets and Reference Tables, Calculus & Differential Equations: Simple Pendulum Motion; Extending Mathcad, Mathematics, Differential Equations: Stabilizing an Inverted Pendulum. The force F in the differential equation (1.1) may be written according to the law of gravity: F=−
GMm r , 2 r r
where r is a vector connecting mass M with mass m, G is the gravitational constant. Then the differential equation "
d 2r GMm r 1 = − 2 r m dτ r !
4 1 Differential Mathematical Models
will be suitable for the description of orbital Earth’s motion around the Sun or the satellite around the Earth (Resource Center, Quick Sheets and Reference Tables, Calculus & Differential Equations: Planetary Orbits). In the previous examples the force of environmental resistance was not taken into account. If taken into account, the circle of problems described by Eq. (1.1) will be extended considerably. The problem of relaxation oscillations of the pendulum is one such example solved in Mathcad (see Resource Center, Quick Sheets and Reference Tables, Calculus & Differential Equations: Damped Harmonic Oscillation). As another example we will consider the movement of water drop in air by gravity and resistance force. This problem can be useful when designing sprinkler systems for fire-fighting or for irrigation, or for direct contact heat and mass exchangers in power engineering and technology. It is important to calculate a trajectory, to determine, how far the drops scatter and how long they remain in the air. The equation of drop motion can be written again as Newton's second law “mass · acceleration= force”: #
.
π π d w = ρ f D3 g − ρ f D3 6 6 dτ +
.
,
,
,
-
*
%
'
*
-
%
%
'
%
)
(
&
$
)
(
drop mass
&
Cd ,
-
%
drag coefficien t
drop mass
. +
+
ρ air w w
+
.
(
'
2
,
,
)
)
*
%
*
%
)
&
πD 2 , 4 '
%
)
(
(1.3)
&
dynamic pressure midship
where acceleration is written as time derivative from velocity vector w. The terms on the right-hand side are the weight and the air resistance acting on the drop with diameter D. Quantities f and air in (1.3) mean density of water and air accordingly. Size and direction of weight force are set by vector g – acceleration of gravity. The resistance force is already explained in (1.3). Direction of this force is back to speed vector w. The drag coefficient Cd is a function of the Reynolds number: /
/
Re D =
wD ν air
,
where air is the kinematic viscosity of air. The relationship Cd(ReD) is taken from work1 and approximately submitted as Mathcad function in Fig. 1.3. Eq. (1.3) looks simpler after division by drop mass: 0
C (Re D ) d A w w; w=g− d dτ 2
A=
3 ρ air . 2D ρ f
(1.4)
Vector equation (1.4) can be projected on horizontal (x) and vertical (y) axes of coordinates, and that results in a system of four equations – for horizontal (u) and
1
Boyd F Edwards, Joseph W Wilder and Earl E Scime (2001) Dynamics of falling raindrops. Eur. J. Phys, 22:113–118
1.2 Laws in the Differential Form 5
vertical (v, positive upward) velocity components and their definitions through changing coordinates:
d C (Re D ) u=− d A w u; dτ 2
d C (Re D ) v = −g − d Aw v; dτ 2 (1.5)
d x = u; dτ
d y=v. dτ
The system of differential equations (1.5) is nonlinear, and consequently we address at once to one of the built-in integrators (Odesolve, see Appendix) to receive the numerical solution. In Fig. 1.3 the input data are submitted, such as drop diameter, physical properties, constants, initial values of velocity components. We fix to work in SI system (kg, m, s) and consequently do not write down the units explicitly. In the bottom half of Fig. 1.3 the auxiliary functions for calculation of the velocity module w(u,v) through its components, for Reynolds number and for drag coefficient are written down too. D := 0.001
g := 9.8
ρ air := 1.205
ρ f := 998.2
A :=
3 ρ air ⋅ 2 ⋅D ρ f
ν air := 1.5 ⋅ 10
−5
A = 1.811
ubeg := 10 vbeg := 10 _________________________________________ w( u , v) :=
(
)
2
2
Red ( u , v) :=
u +v
Cd ReD :=
Cd ←
w(u , v) ⋅ D ν air
24 if ReD < 4 ReD
otherwise Cd ←
12 ReD
if ReD < 576
Cd ← 0.5 otherwise Cd
Fig. 1.3. The input data and auxiliary functions for the drop movement problem
6 1 Differential Mathematical Models
Given
d dτ
d dτ
d dτ
d dτ
x( τ )
u( τ )
y( τ )
v( τ )
u( τ )
−
C d Red ( u( τ ) , v( τ ) ) ⋅ A ⋅ w ( u( τ ) , v( τ ) ) ⋅ u( τ ) 2
v( τ )
−
C d Red ( u( τ ) , v( τ ) ) ⋅ A ⋅ w ( u( τ ) , v( τ ) ) ⋅ v( τ ) − g 2
x( 0) 4 1
)
(
)
y( 0)
0
5
x 2
0
(
1
8
2
4
7
8
y 5
u 2
3
6
v
ubeg
v( 0)
vbeg
;
5
;
2
y
5
2
: 5
x
5
2
u( 0)
:= Odesolve 8
5
;
2
5
2
9
3
u
8
6
,τ ,2 ;
<
v
.
Fig.1.4. System of the movement equations and the numerical integrator Odesolve call
In Fig.1.4 the system of differential equations (1.5) is written inside of the Mathcad structural block Given, including also the initial conditions and the builtin integrator Odesolve call. The result of numerical integration is presented in Fig. 1.5 as the trajectory y(x) of drop movement. But before that the time end of drop flight has been determined using the equation for vertical coordinate at the moment of landing: y( end)=0. The solution is obtained by built-in solver root. Last two arguments of root determine the interval of search set by user. Further more we set the uniform sequence of the time moments for which the moving drop positions on plane (x, y) will be constructed. The drop of 0.001 m diameter leaving the sprinkler with horizontal speed 10 m/s and vertical speed 10 m/s, will rise in 1.5 m height, will cover a distance of about 3 m and will be in flight about 1 second (Fig. 1.5). Not taking into account the effect of air resistance the results will be as follows (given the same starting conditions): height ~ 5 m, distance ~ 20 m, time ~ 2 s. These results differ greatly from real parameters. Another will be also the shape of trajectory. It is easy to be convinced of it, having repeated calculations in Mathcad at zero value of A. Concluding topic of drop flight we shall note, that for severity it was necessary to estimate, whether the integrity of a drop will be kept at flight with such speed in the air and whether the drop will be influenced by neighboring drops. =
=
1.2 Laws in the Differential Form 7 τ end := root (y( t) , t , 0.1 , 2)
τ end = 1.096
τ := 0 , 0.1 .. τ end + 0.1 1.5
1 y(τ ) 0.5
0
0
0.5
1
1.5
2
x( τ )
2.5
3
Fig. 1.5. The calculated trajectory of drop movement (the drop locations are marked at subsequent identical time intervals)
Behind the simple examples discussed in this item (Fig. 1.1, Fig. 1.5) there is a wide range of important problems both cosmic and earthy: calculations of space movements of heavenly bodies, determination of satellite orbits and rocket trajectories, the resonance phenomenon and the dangerous vibrations of buildings and suspension bridges, the oscillation damping etc. [9]. Heat Conduction and Viscous Friction Laws
One more group of problems with ready differential formulations is formed with calculations of heat exchange and friction for one-dimensional flows. The Couette flow (Fig. 1.6) is the elementary problem of this group. y
y
t – t0
u
δ
Fig. 1.6. Couette laminar flow
In the gap between very long plates there is a liquid. The top plate moves from left to right with speed u , the bottom plate is fixed. The top plate is hot at a temperature t , bottom – cold at a temperature t0. It is required to find the velocity u >
>
8 1 Differential Mathematical Models
and temperature t fields in the gap and also to calculate the shear stress s and the heat flux q. It is easy to show, that the quantities s and q are constant across thickness of the gap. Then, according to the one-dimensional formulations of Newton's law for viscous friction and Fourier’s low for heat conduction: s≡µ
du = const , dy
(1.6)
q≡λ
dt = const , dy
(1.7)
where y is the normal to the flow direction axis, λ – thermal conductivity, and µ – viscosity. Expressions (1.6), (1.7) are the differential equations for unknown speed and temperature distributions. If thermal conductivity and viscosity are constants, as by laminar flow, integration gives the linear distributions of temperature and speed. Then Eqs. (1.6) and (1.7) yield for the shear stress and heat flux: ?
@
uδ t −t ; q=λ δ 0 . δ δ
τ =µ
At turbulent motion the quantities , are not constant any longer. They depend on the (unknown) distribution of speed. In this case the differential equations (1.6), (1.7) become nonlinear and the Couette flow problem becomes much more sapid and complex. A complete discussion of hydrodynamics and heat transfer problems is considered below in Sect. 1.4. The one-dimensional solutions of thermal conduction problems are considered in Sect. 1.6. ?
1.3
@
Models of Growth
Exponential Growth We shall consider here those cases where the differential equations appear as the result of direct translation of verbal representation of a problem into the mathematical form. Simplified it looks approximately as follows: • The verbal source: “for the accounting quarter, the company assets have increased from $100 up to $103” • The equivalent mathematical model introduces the growth parameter as F C
1 dP 1 103 − 100 1 = 0.01 = . P dτ 100 3 month month D
•
A
D
A
E
B
•
In the verbal description the question was growth within a given time interval. Clearly, the suitable mathematical model will be a derivative on time.
1.3 Models of Growth 9
You should not to be too serious regarding the next example. But it is useful as an illustration, that everyone, meditating about some technical problem or a vital situation, may design his own differential equation. In folk speak: “money to money”. Or: “the money makes money”. How to formalize this statement and then, perhaps, to take from a mathematical model the useful instructions, how to grow rich? Preparing the saying, we come to the formulation: dY = k ⋅Y , dτ
(1.8)
according to which the speed of the capital increase dY/d is proportional to capital Y itself. A function, for which the derivative is proportional to the function, is well known: it is the exponential function. Simple operations of variables separation in (1.8), integration, reduction to the explicit form and graphic representation of result are shown in Mathcad fragment in Fig. 1.7. So, the mathematical model of exponential growth (1.8) satisfies the initial verbal description, i.e. the saying “money makes money”. The solution of (1.8) is: G
Y = Y0 exp( kτ) .
(1.9)
It is apparent, that capital Y quickly grows, if its initial value Y0 is nonzero. dY dτ
dY Y
k⋅Y
K
O N
Y
L
H
I
L
I
L
J
M
Y0
τ H
1 dy y
I
J
k ⋅ dτ
k dt solve , Y → exp ( τ ⋅ k) ⋅ Y0 O
O
0 P
Y( τ , Y0 , k) := Y0 ⋅ exp ( k ⋅ τ ) 3
2 Y( τ , 0.2 , 0.5)
1
0
0
2
4 τ
Fig. 1.7. Exponential growth
6
10
1 Differential Mathematical Models
Logistic Model However, experience and common sense tell us, that the capital may not grow indefinitely. There is a limit of growth, and the popular saying “superfluous money, superfluous worry” may turn out to be true. Now we should find a mathematical model of this second statement. We shall introduce in operation the limit of saturation Sat, probably timedependent. According to the model of limited growth, the growth should stop, once we have reached the limiting value (Y = Sat). Hence, the derivative dY/d should become zero. To provide this condition, in the right part of the differential equation (1.8) the multiplier (Sat – Y) should appear: Q
dY = k ⋅ Y ⋅ (Sat − Y ) . dτ
(1.10)
This is the differential equation with separable variables, and Mathcad allows the symbolical transformations to receive the analytical results (see Fig. 1.8). dY dτ
dY Y ⋅ ( Sat − Y)
k ⋅ Y ⋅ ( Sat − Y)
U
Y X
Y
V
R
τ R
1 dy y ⋅ ( Sat − y)
S
V
S
V
T
W
Y
S
k dt solve , Y → T
Y
0
Y0
Z
Y0 ⋅ Sat ⋅ Y0 := 0.01
k ⋅ dτ
k := 0.5
exp ( τ ⋅ k ⋅ Sat )
( Sat − Y0 + Y0 ⋅ exp ( τ ⋅ k ⋅ Sat ) )
Sat := 1
g
exp ( τ ⋅ k ⋅ Sat ) Y( τ ) := Y0 ⋅ Sat ⋅ ( Sat − Y0 + Y0 ⋅ exp ( τ ⋅ k ⋅ Sat ) ) 1
Y( τ )
0.5
0
0
5
10
15
τ
Fig. 1.8. The logistic curve
20
1.3 Models of Growth 11
In the given fragment of Mathcad worksheet are consistently submitted: • The original Eq. (1.10) and the form with separated variables • The integral from both parts of this form • The solution for Y, received by means of symbolical operator solve • The diagram of this time dependence. The result is an S-curve. At an initial stage, exponential growth is observed (the “money makes money” principle), and then restrictions come into effect (the “superfluous money, superfluous worry” principle). The S-shaped curve in Fig. 1.8 and the appropriate mathematical model (1.10) are known as the logistic and have a surprising generality. Many technical, biological and even social systems submit to such a law of growth. For example, the concentration at self-catalyzed chemical reactions has the same kind of time dependence, as in Fig. 1.8. Apparently, the development of new technologies submits to the same law (though computer technologies are still at the stage of exponential growth). Similar S-curves are observed at fissiparity of bacteria, at growth of biological populations. Probably, civilizations on a large time scale are also S-shaped. Stochastic Model If we take into account that the limit of growth Sat is a function of time, we may advance creating more and more real models. Indeed, in economics we observe rise followed by recession to perform at regular intervals. In the Mathcad-document in Fig. 1.9 the limit of growth is given as a sine wave function. It is a rough imitation of a random periodic function. The right part of the differential equation (1.10) is designated as DY( ,Y). Since the differential equation is nonlinear and variables are not separable, it is necessary to take advantage of a numerical method. In this case it is rkadapt – explicit adaptive Runge– Kutta method. We make the series of calculations at different initial conditions IC, therefore it is convenient to write down the reference to rkadapt as function. The result is shown in Fig. 1.9. The distinctions in growth are clearly visible according to the initial value of capital (for comparison, values 0.01 and 0.1 are assumed). It is visible also, that the achieved greatest values oscillate like theoretical limit Sat( ), with some phase shift. In the following example we shall describe a real situation more accurately. A parameter (factor) of growth k (see Eq. (1.10)) is subject to random influences. In Mathcad fragment Fig. 1.10 the quantity k is given as random function of time in the form of sine series with random coefficients A. The built-in function rnorm is applied for creation of the set of such coefficients. An average value of A is zero, and their dispersion is the unit variance. The growth under influence of random factors is shown in Fig. 1.11. We shall emphasize, that the parameter of growth k is a stochastic function (random stationary function) of time. Diagrams in Fig. 1.11 show, as far as the main law, such as in Fig. 1.8, may be disguised by random influences. Q
Q
12
1 Differential Mathematical Models k ≡ 0.5
Am ≡ 0.1
τ beg ≡ 0
acc ≡ 0.000001
Nmax ≡ 200
save_int ≡ 0
τ end ≡ 20 g
Sat ( τ ) ≡ Am⋅ sin( τ ) + 1 DY( τ , Y) ≡ k ⋅ ( Sat ( τ ) − Y) ⋅ Y
(
)
S ( IC) := rkadapt IC , τ beg , τ end , acc , DY , Nmax , save_int [
\
0
τ a := S ( 0.01) [
[
\
1
Ya := S (0.01)
\
[
\
Yb := S (0.2) 1
τ b := S ( 0.2) 0 1.5
Capital
Ya
1
Yb
( )
Sat τ a
0.5
0
0
5
10
15
20
τa , τb Time
IC=0.01 IC=0.1 Sat
Fig. 1.9. Logistic law with floating limit of growth (see Appendix about rkadapt)
Let us make some remarks concerning the origin of the logistic equations. The name testifies that these equations are received on an external, logic level of system analysis. Really, we did not concern the actual mechanism of how or why money makes money, or, how or why the rate of chemical reaction depends on concentration. Therefore, the constants (for example, the parameter of growth k) may not be determined within the framework of logistic models. The actual analysis of real systems is necessary for this purpose – in economics (growth of the capital), in physics-chemistry (chemical reactions) etc. But any shortcomings are made up for by the remarkable generality of such model types.
1.3 Models of Growth 13 k0 := 0.5
iMax := 10
ω := 0.2
A := rnorm(iMax + 1 , 0 , 1) a ^
iMax
sum := ]
_
k ( τ ) := k0 ⋅ 1 +
( Ai) 2
_
`
i=0
1 ⋅ sum
iMax ]
Ai ⋅ sin( i ⋅ ω ⋅ τ ) b
c
i=1
2 Growth factor
b
Fig. 1.7
1
k( τ )
0 1
0
10
20
τ Time
Fig. 1.10. The growth factor as stochastic function
acc := 0.000001
Nmax := 200
save_int := 0
τ beg := 0
τ end := 20
Sat := 1
DY( τ , Y) := k ( τ ) ⋅ ( Sat − Y) ⋅ Y
(
)
S ( IC) := rkadapt IC , τ beg , τ end , acc , DY , Nmax, save_int d
e
d
τ b := S ( 0.2)
d
0
τ a := S ( 0.01)
e
1
Ya := S ( 0.01)
e
d
0
Yb := S ( 0.2)
Fig. 1.8.
e
1
1
Ya Yb
0.5
0
0
5
10
15
20
τa , τb
Fig. 1.11. Logistic curves by different initial conditions and by influence of random factors (see Appendix about rkadapt)
14
1 Differential Mathematical Models
1.4
Conservation Laws
Almost all differential equations that are designed and solved by mechanical engineers and technologists, are deduced on the basis of conservation laws of mass, impulse, energy. Problems are manifold and concern the processes with liquid and gaseous heat-carriers in thermal and atomic power stations, in chemical, petroleum, and gas industries, and also in nature. Many natural phenomena are described by the above mentioned equations. For example, a weather forecast is based on numerical modeling of thermo- and hydrodynamical processes in the Earth atmosphere. For that purpose the most powerful of existing computers are used. Another example is modeling of the environmental problems connected to distribution of harmful emissions into atmosphere and into water. General Form of Balance Equation The general description of this process looks as follows (Fig. 1.12).
ϕ(x,y,z,τ) Φ
γ z
dV
f
y x Fig. 1.12. The formulation of the generalized equation of conservation
The domain separated by boundary from an environment is filled with moving two-componential liquid or gas. The system state can be fully described by means of fields of temperature t(x, y, z, ), concentration c1 (x, y, z, ), pressure p(x,y,z, ), and velocity w(x,y,z, ). The nonuniformity of temperature and concentration force so called conductive (molecular, diffusion) flows: heat flux q(x, y, z, τ) and mass flux of 1st-component j1(x, y, z, τ). Fluid flow provides the convective fluxes of extensive (connected with mass) quantities, such as enthalpy ( wh), mass of a component ( wc1). Here, , kg/m3 is fluid (eventual mixture) density; h, J/kg is the specific enthalpy. On boundary there is an interaction with an environment. For example, across the border the streams of mass and energy may pass. This interaction must be described by boundary conditions. Usually, the boundary separates the device elements from streams of gas or liquid heat-carriers. g
h
i
i
i
j
j
j
g
g
1.4 Conservation Laws 15
Generally, the system evolves from some initial state that should be determined by initial conditions. The problem is formulated as follows: at given initial and boundary conditions find the fields t,c1,p,w for the given configuration and then calculate the mass and energy flows. Let us consider a differential control volume dV, inside which the parameters t,c1,p,w are assumed to be approximately constant. For the neighboring volumes, these parameters may be others, but this difference must be small. The flows of mass, impulse, and energy pass through its surface. Inside the control volume the internal sources (positive or negative) are working (e.g. thermal energy may be generated during nuclear transformations, as in a power reactor). Common sense prompts some general idea about the balance for control volume: if receipt of any substance exceeds expenditure – its amount should grow. The following universal form can yield accurate record of balance for unit control volume: ∂ϕ = −div( ) + γ . ∂τ
(1.11)
k
According to (1.11), the time rate of increase of any substance in the control volume (the left part) is a consequence of the inflow through its surface (the first term on the right hand side) and of the generation (production) thanks to an internal source (the second term). In Eq. (1.11): – density of some extensive quantity, • [ϕ] = (∗3) , m – flux density of this quantity, including conductive and convective • components, [Φ ] = (∗2) , m s – source power, • [γ ] = (∗3) . m s The asterisks in the dimension formulas replace the concrete dimension of transferable extensive quantity (mass kg, energy J, impulse kg·m/s). Let us emphasize, that the control volume is fixed in space. Therefore, we use a partial time derivative in the left part (1.11) and have an opportunity to count all changes on unit of control volume. Let us consider implications of the first term on the right hand side (1.11). According to definition, divergence is a total vector flux through the surface of a small control volume, directed outside and counting on volume unit. It is the very thing that is necessary, except for a direction. Indeed, we consider inflow, therefore the minus is necessary. The divergence in the Cartesian coordinates may be calculated as: l
l
n
m
16
1 Differential Mathematical Models
div( ) = o
∂Φ x ∂Φ y ∂Φ z . + + ∂z ∂y ∂x
(1.12)
Now we need to fill the universal form (1.11) with concrete content. Mass Conservation Law: Continuity Equation In this case ϕ ≡ ρ;
≡ ρ w; γ ≡ 0 , p
(1.13)
where , kg/m3 is fluid density, the source term for mass is definitely absent. Introducing (1.13) into (1.11) yields the equation of continuity: q
∂ρ = −div(ρw ) . ∂τ
(1.14)
Often the fluid density may be considered as constant. Then the equation of continuity can be simplified: div ( w ) = 0 .
(1.15)
Conservation Law for Species Concentration In this case ϕ ≡ ρ1 = ρc1 ; s
≡ j1 + ρ w 1 ; γ = 0 . r
(1.16)
It is assumed, that chemical reactions in volume do not occur, therefore the source of mass is assumed zero. After introducing (1.16) into the universal form (1.11) the conservation equation for 1st-component is received: ∂ρ 1 = −div( j1 + ρ w 1 ) . ∂τ u
t
(1.17)
For conductive mass flux Fick's law is used: j1 = −ρD gradc1 . When Fick's law is incorporated into the conservation equation (1.17), the differential equation of convective diffusion is received: ∂ (ρc1 ) = −div( −ρDgrad c1 + ρ wc1 ) ∂τ
(1.18)
which appears as the determining equation for the concentration field c1. Here we refer only to a two-componential mixture, and the second component concentration is easily calculated: c2 = 1 − c1 .
1.4 Conservation Laws 17
Let us note, that we have entered a restriction, having refused from chemical reactions in volume. On the other hand, in many cases the reactions occur on interfaces. These are so-called catalytic reactions. Their rate is controlled by diffusion processes in a gas phase. Such problems can be described with Eq. (1.18), as well as propagation of passive impurity, the process of evaporation or condensation of gas-vapor mixtures in technique and in nature, etc. Thermal Energy Conservation Law: Energy Equation For the majority of processes in power engineering, technology and environment, it is possible to apply some justified simplifications in recording of energy balance. Since the flow velocity usually is substantially smaller than sound speed, we shall neglect the contribution of kinetic energy and viscous heat. A pressure drop in such flow is usually small in comparison to the absolute value of pressure. Therefore, we shall consider the thermodynamic processes as isobaric. For such systems the conservation law of energy can be written as enthalpy balance: the heat input is spent for enthalpy increase: ϕ ≡ ρh; v
≡ q + ρwh; γ ≡ qV ;
∂ (ρh ) = −div(q + ρwh) + qV , ∂τ
(1.19) (1.20)
where qV – internal heat source power, W/m3. For a heat flux q Fourier’s law is used with the addition of diffusion term (the second term on the right hand side): q = −λ gradT + j1 (h1 − h2 ) .
(1.21)
where h1, h2 – the specific partial enthalpy of components. When (1.21) is incorporated into the conservation equation (1.20), the differential equation of energy is received: ∂ ( ρh ) = −div(−λ grad T + j1 (h1 − h2 ) + ρ wh ) + qV , ∂τ
(1.22)
which appears as the determining equation for the temperature field. Additional thermodynamic relations are necessary for enthalpy and density as functions of temperature and concentration. Let us write down the energy equation (1.22) in more simple form for usual heat exchangers, without diffusion: ∂ (ρh) = −div(−λ gradT ) − div(ρwh ) + qV . ∂τ
Applying the equation of continuity (1.14), we shall receive:
(1.23)
18
1 Differential Mathematical Models
ρ
∂(h) = −div(−λgradT ) − ρw ⋅ grad (h) + qV . ∂τ
Assuming that enthalpy depends only on temperature (as for incompressible liquids at constant pressure or as for ideal gases), then: ∂ h dh ∂ T ∂T ≡ ≡ cp ; ∂τ dt ∂τ ∂τ
∂T ∂ h dh ∂ T . ≡ cp ≡ ∂x ∂x dt ∂x
After substitutions we shall receive the energy equation concerning temperature: ρ w
p
∂T = −div(−λ gradT ) − ρc p w ⋅ gradT + qV . ∂τ
(1.24)
Conservation Law for Momentum: Motion Equation Speed is an impulse of unit mass, and the unit control volume will contain the following amount of movement: ϕ ≡ ρ w , (kg m/s)/m3. x
The impulse flux consists of parts caused by pressure, viscous shear stress and convective impulse flow: z
≡ pI − ′ + ρww , (kg m/s)/(m2 s). y
x
As body force (i.e. the impulse source) we shall consider the Archimedean buoyancy force: {
≡ (ρ − ρ ∞ ) g .
Then: ϕ ≡ ρ w; ~
≡ pI − ′ + ρ ww; }
|
≡ (ρ − ρ ∞ ) g .
(1.25)
After introducing (1.25) into the universal form (1.11) the impulse conservation equation is received: ∂ (ρw ) = −div( pI − ′ + ρww ) + (ρ − ρ∞ )g . ∂τ
(1.26)
For conductive impulse flux, i.e. for viscous stress tensor used:
′ = µ(grad w + (grad w )T ) −
2 µ(div w )I . 3
, Stokes law is
(1.27)
If we have included this expression in the conservation law (1.26), the flow equation would ensue as the determining equation for the velocity field.
1.4 Conservation Laws 19
Thermohydrodynamical Differential Equations Set Let us collect all the received above thermohydrodynamical differential equations. 1. The continuity equation: ∂ρ = −div(ρw ) ∂τ
(1.28)
2. The equation of convective diffusion: ∂ (ρc1 ) = −div(−ρDgrad c1 + ρw c1 ) ∂τ
(1.29)
3. The energy equation: ∂ (ρh) = −div(−λ gradT − ρD(h1 − h2 )gradc1 + ρ wh ) + qV ∂τ
(1.30)
4. The flow equation: ∂ (ρw ) = −div( pI − ′ + ρww ) + (ρ − ρ∞ )g ∂τ
(1.31)
with σ from (1.27). We enumerate the decision variables: 1) temperature, 2) concentration, 3) pressure and 4) speed. Their number is equal to the number of the equations, i.e. the closed description in the form of system of the partial differential equations (PDE) is received. The integration of the full system (1.28)-(1.31) is a very complicated problem. But in the subsequent chapters of the book we give examples of solution for this system in Mathcad. The following equations will serve as the initial formulation:
∂u ∂v + =0 ∂x ∂y
(1.32)
∂ 2u ∂ 2u ∂p ∂u ∂u ∂u +µ + =− + ρv + ρu ρ ∂x ∂y ∂x ∂τ ∂x 2 ∂y 2
(1.33)
∂ 2v ∂ 2v ∂p ∂v ∂v ∂v +µ + =− + ρv ρ + ρu ∂y ∂x ∂x ∂τ ∂x 2 ∂y 2
(1.34)
∂ 2T ∂ 2T ∂T ∂T ∂T =λ + . + ρc p v + ρc p u ρc p ∂y ∂x ∂τ ∂x 2 ∂y 2
(1.35)
These equations follow from the more general formulation (1.28), (1.31), (1.30) in the case of a two-dimensional problem with constant physical properties. Eqs.
20
1 Differential Mathematical Models
(1.32)–(1.35) keep the basic features of a full problem though it is necessary to recognize, that they are insufficient for the calculation of turbulent flows. However, with the equations written out we shall analyze a flow disturbance as initial stage of turbulence (Chap.7). After some transformations of (1.32)–(1.35) we come to the system of ordinary differential equations (ODE). Their solutions will constitute a brief course of heat transfer (Chaps. 5, 6). A more detailed discussion of the basic equations of heat mass transfer can be found in [50]. Conservation Law for Finite Control Volume The balance equations can be written down for finite control volume. For a onedimensional problem the general chart (Fig. 1.12) will be replaced by drawing the balance for control volume as a block with thickness ∆x, and the two other sizes accepted as units. Notice that the material object is three-dimensional as it appears in reality, but changes (e.g. in temperature) may occur only along one of the coordinate axes (for a one-dimensional problem).
γ(x,τ)
(x,τ)
(x,τ)
∆x
x
(x+∆x,τ)
x+∆x
Fig. 1.13. Balance for the one-dimensional problem
For finite control volume and for a small but finite time interval the balance will be written down as:
ϕ( τ + ∆τ) − ϕ( τ) (∆x ⋅ 1 ⋅ 1) ≅ ∆τ
The rate in control volume ¢
(1.36)
− Φ ( x + ∆x ) −
¡
⋅ (1 ⋅ 1) + γ ⋅ (∆x ⋅ 1 ⋅ 1)
Φ( x)
Outflow across right border
Inflow across left border
Source
Pay attention to this formulation. For most people such a way of deduction of the differential equation will be the most natural:
1.4 Conservation Laws 21
i. ii. iii. iv. If £
At first we draw the control volume, such as in Fig. 1.13, and represent the inflow and outflow by arrows. Then we write down the balance as in (1.36). Further we design the modeling expressions for flows as shown in Eqs. (1.13), (1.16), (1.19), (1.21), and (1.25). We proceed to the zero limits for time and distance increments. x and in (1.36) approach zero, then ¤
¥
Φ( x + ∆x ) − Φ ( x ) ≈
∂Φ ∂Φ ∆x; Φ ( τ + ∆τ) − Φ (τ) ≈ ∆τ , ∂x ∂τ
and we come back to the differential representation (for the one-dimensional problem): ∂ϕ ∂Φ =− +γ. ∂τ ∂x
(1.37)
When the equation of conservation is written in the finite (discrete) form (1.36), there is a question about the allowable size of x. It is necessary that the size of control volume is essentially smaller than the size of the whole object. The minimal requirement is the reduction of the size to one order, and professional – to two orders. Note that for the one-dimensional problem it is necessary to divide the object into 102 parts, for two-dimensional into 102 102 = 104, and for three-dimensional into 102 102 102 = 106 parts. With such splitting it is possible to assume, that a state variable , such as temperature, is constant within the boundaries of the control volume. An individual value is attributed to each volume, and together they form a very large array. Having written down equation (1.36) for each control volume, we receive the pertaining system of equations. The order of the system is equal to the number of control volumes. For example, for a three-dimensional problem it may be 106. To solve such a system is a difficult problem, even for modern computers. We have outlined now the idea of a numerical method for partial differential equations (PDE). The reader will find concrete examples and computing Mathcadprograms in Chaps. 9–11. The best manual for beginners in this field is S.Patankar's small book [31]. ¤
¦
¦
¦
§
Poisson’s Equation and Built-In Solvers There are special mathematical packages, such as Phoenics, ANSYS, STAR-CD, to solve large-scale practical problems, like nuclear reactor computations or modeling of car aerodynamics: http://www.cham.co.uk, http://www.ansys.com, http://www.cd.co.uk. However, working with such programs demands special training, and the packages are expensive commercial products. The purpose for this book is the study of basic ideas in computer modeling, and therefore simple programs with codes easy to use and to update will be more suitable.
22
1 Differential Mathematical Models
Estimating corresponding abilities of Mathcad, it is necessary to ascertain, that this mathematical package possesses rather modest means for the solution of elliptical PDE such as Poisson’s equation: ∂ 2 u ∂ 2u + = ρ( x , y ) . ∂x 2 ∂y 2
(1.38)
Using the built-in functions multigrid and relax, the Dirichlet problem for Poisson’s equation can be solved in square area. We shall consider the built-in functions and create more powerful user functions in Chap. 10, but here we will discuss Eq. (1.38) itself. The physical content of the Poisson’s equation may be various. For example, it describes the distribution of electric potential, when the electric charges density is given as (−ρ). In heating engineering, the Poisson’s equation determines a stationary temperature field in bodies with internal sources of heat. The generalized equation (1.11) ∂ϕ = −div( ) + γ ∂τ ¨
is reduced to the Poisson’s equation, if • the problem is steady-state, / = 0, • the dependence of gradient type for the conductive flux, Φ = – Γφ grad , is assumed • the transport coefficient Γφ is constant. Then, instead of (1.11) we have: ©
§
©
¥
ª
0 = −div(−grad ϕ) +
γ , Γϕ
(1.39)
or, in coordinate decomposition for a two-dimensional problem: ∂ 2ϕ ∂ 2ϕ γ . + 2 =− 2 Γϕ ∂x ∂y
(1.40)
In case of heat conductivity the generalized form is replaced with the following concrete expression: q ∂ 2t ∂ 2t + 2 =− V . 2 λ ∂x ∂y
(1.41)
The physical meaning of this equation may be explained as follows. All heat produced by an internal source leaves the control volume by means of heat conductivity. Therefore, the temperature remains constant at all times. Spatial distribution of temperature should be determined by integrating Eq. (1.41). The solution of this equation and its applications are considered in Chap. 10.
1.5 Conservation Law for Traffic Problem 23
In Mathcad 11, one-dimensional parabolic and hyperbolic PDEs can now be solved inside solve blocks using the new built-in function pdesolve() or the new function numol() (see Chap. 11). 1.5
Conservation Law for Traffic Problem
Eq. (1.11) (or the one-dimensional Eq. (1.37)) we have named “generalized”, since it looks the same for different substances: mass, energy, impulse. The list can be continued, creating mathematical models for other problems, far from the mechanics of continua. Let us demonstrate this using an example of road movement modeling [5]. The traffic jams, the general delay and the threat of a full paralysis of the transport system – these factors deliver sufficient stimulus for the investigation of this problem. Basis for the analysis will be the generalized equation (1.37). The source γ will be zero: cars will neither leave nor enter the highway. The highway is located along an axis x (Fig. 1.13), its width is constant. In the role of ϕ the linear concentration of cars will act: [ϕ ] = cars / (km of highway length). The flux Φ represents the number of cars, passing the highway per time unit: [Φ] = cars/s. The differential equation of conservation (1.37) for the highway problem is written as: ∂ ϕ ( x , τ) ∂ Φ ( x, τ) . =− ∂τ ∂x
(1.42)
Eq. (1.42) contains two unknown quantities: car concentration and car flux density. We need a relationship, as dependence of car flux from car concentration. Now we can begin the concrete modeling. The car flux can be expressed in car speed w, m/s: Φ = ϕw .
(1.43)
If this statement seems non-evident, it is necessary to argue as follows. Let us recede from checkpoint against movement on distance L that numerically is equal speed. On this piece the number L, it is |w|, of cars will be placed. For time unit all of them will pass through checkpoint. The formula (1.43) is proved. Two limiting situations are evident: 0 the speed w has some limits, for example, the maximum speed • At allowed on the road, w wmax. • At closest packing, max, speed will approach zero, as common sense and experience suggests. The desired expression for w can be written as a linear approximation between the limits: ª
ª
«
ª
«
ª
«
ª
24
1 Differential Mathematical Models
® ±
ϕ
¯
w = wmax 1 − ¯
°
¬
¬
ϕ max
.
(1.44)
When (1.44) is incorporated into (1.43), there follows: ·
Φ = (ϕ max wmax )
´
·
ϕ ¶
µ
µ
´
µ
µ
²
ϕ max
²
³
¶
1−
ϕ ϕ max
²
²
³
.
(1.45)
The equations thus obtained can be written in the following compact dimensionless form: ∂Φ r ( x r , τ r ) ∂ϕ r ( x r , τ r ) =− , ∂x r ∂τ r
(1.46)
where x ; 0 ≤ xr ≤ 1 L τ τr ≡ L wmax xr ≡
ϕr ≡
ϕ ϕ max
; 0 ≤ ϕr ≤ 1
Φr ≡
Φ ; Φ r = ϕr (1 − ϕ r ) ϕmax wmax
wr ≡
w ; wr = (1 − ϕ r ) wmax
(1.47)
As Φ r = Φr (ϕr), it is possible to differentiate the right part (1.46) as composite function and to represent the conservation equation in the form of the wave equation: dΦ r ∂ϕ r ( x r , τ r ) ∂ϕ r ( x r , τ r ) =− dϕ r ∂x r ∂τ r
or ∂ ∂ ϕ r + Vwave (ϕ r ) ϕr = 0 , ∂τ r ∂x r
(1.48)
where Vwave (ϕ r ) =
dΦ r dϕ r
(1.49)
1.5 Conservation Law for Traffic Problem 25
is the wave velocity (of car concentration waves), or, in other words, speed of expansion of constant values of concentration. This statement can be proved as follows. Writing the change of concentration as full differential and equating this change to zero, ½
º
½
º
∂ ∂ dϕ r = ϕ r ( x r , τ r ) dτ r + ϕ r (x r , τ r ) dx r = 0 , ∂τ r ∂x r »
¸
»
»
¸
»
¼
¸
¸
¼
¹
¹
(1.50)
we receive the equation of a trajectory on a plane (x, ) along which concentration does not change (in Fig. 1.14, moving along dl, concentration does not vary): ¾
∂ ϕr ∂τ r =− . ∂ ϕr ∂x r Ä
∂x r ∂τ r
ϕr
Á
Â
¿
Â
¿
Â
¿
Ã
Ç
À
r(xr , r) È
Å
r
(1.51)
¿
Â
d r
= const
dl
Æ
dxr 0
xr
xr,0
Fig. 1.14. Characteristic
Comparing this expression with Eq. (1.48), rewritten as ∂ ϕr ∂τ r Vwave (ϕ r ) = − , ∂ ϕr ∂x r Î
Ë
Ì
É
Ì
É
Ì
É
Ì
É
Í
Ê
we receive: ∂x r ∂τ r
= Vwave (ϕ r ) .
(1.52)
ϕr
Hence, the external observer moving with the speed Vwave along a motorway would find identical concentration of automobiles at all times. The formula (1.52) is named the equation of the characteristic. As the wave speed depends only on concentration (see Eq. (1.49)), and as the concentration is
26
1 Differential Mathematical Models
constant along the characteristic, the characteristics on a plane (x,τ) will be straight lines (Fig. 1.14). According to definition (1.49) and to Eq. (1.47): Vwave =
dΦ r = 1 − 2ϕ r . dϕ r
(1.53)
Formulas (1.47) for car speed and car flux, and also for wave velocity are submitted graphically in Fig. 1.15. As the wave speed depends on concentration, the wave equation (1.48) is nonlinear. Wave speed (and the slope of the characteristics) is nonconstant and even changes a sign by change of concentration. Therefore two observers, having started along two characteristics with different slope, may meet in one point. This means, that different values of car concentration will take place in the same point. In other words, the discontinuity arises in the solution. Physically inadmissible ambiguity can be interpreted as occurrence of a compression shock (shock waves). See Chaps. 8, 9 for more detail. 1
( ) ( ) Vwave ( φ r)
wr φ r
Φr φr
0
1
0
0.5
1g
φr Car concentration
Fig. 1.15. The car speed, flux and wave velocity as functions of car concentration
Calculations in Mathcad of the car concentration waves are shown in Fig. 1.16: 1. Computing block 1. The first equation gives the initial distribution of cars along the road in form of an error curve. The characteristic starts at some point x0, whose 0 will be kept. The second equation sets the wave speed as function of concentration (1.53). The third is the equation of the characteristic received by means of integration (1.52). 2. Computing block 2. Further calculations are based on the fact that characteristics are level lines of function (x, ). For construction of the three-dimensional diagram the parametrical method (Parametric surface plot) is chosen. The set of initial points x0 is determined, and also the set of time moments for which calculations will be made. 3. Computing block 3. The grid on the plane “coordinate – time” is created, with nodes indexed as (i, j). In these nodes the concentration field i,j is calculated. For two-dimensional arrays of coordinates and time the designations are Ï
Ð
Ñ
Ï
Ñ
1.5 Conservation Law for Traffic Problem 27
changed to the appropriate capital letters X,T. The results obtained by characteristics method are presented in form of the two diagrams of Fig. 1.16, and both are constructed using the same data.
(
)
Ö
Ò
2 1) φ 0 x0 , φ m := φ m ⋅ exp − x0
(
×
)
Ó
ÔÕ
ØÙ
(
) x( τ , x0) := x0 + τ ⋅Vwave ( x0 , φ m)
V wave x0 , φ m := 1 − 2 ⋅ φ 0 x0 , φ m 2) x0_min := −3 τ min := 0 i := 0 .. Ni
x0_max := 3
Ni := 40
τ max := 3
Nj := 80
j := 0 .. Nj
(
(
)
i x0 := x0_min + x0_max − x0_min ⋅ i Ni
(
3) X i , j := x τ j , x0
)
i
Ti , j := τ j
)
τ j := τ min + τ max − τ min ⋅
(
)
φ i , j := φ 0 x0 , φ m i
j Nj
φ m ≡ 0.85
1
φi, 0 φ i , 40
0.5
φ i , 80
0
(X ,T ,φ)
5
0
5
Xi , 0 , Xi , 40 , Xi , 80
Fig. 1.16. Expansion of nonlinear waves of car concentration along a motorway
The diagram on the left gives a three-dimensional representation with the concentration on the vertical axis, and the horizontal axes are coordinate X and time T. The diagram on the right represents the usual graph of distribution of car concentration along motorway for three instants: initially (the time index, i.e. the second index of array, equal 0) and two subsequent times with time indexes of 40 and 80. During the movement of automobiles the initial profile of concentration (curve i,0 on the right) is shifted along the motorway and deformed. The observed deformation of the initial distribution occurs due to the dependence of wave speed on concentration (see Fig. 1.15). Sites of a wave with small concentration move forward (from left to right) with big speed, and others with big concentration lag behind. The waves with r > 0.5 travel backwards (from right to left) that means, their speed is negative (see Fig. 1.15). Ï
Ï
28
1 Differential Mathematical Models
The phenomenon of wave overturning (umklapp) is clearly visible. If the right slope of a wave becomes more and more flat, the left slope becomes steeper and steeper. There is an ambiguity: two or three values of concentration take place in the same coordinate at the same moment. This is impossible from a physical point of view. Crossing of characteristics, i.e. lines of constant concentration, is well visible in Fig. 1.17, where the three-dimensional diagram from Fig. 1.16 is submitted as viewed from top.
T
(X ,T , φ)
X
Fig. 1.17. Crossing of characteristics
The reason of such complex behavior is nonlinearity of Eq. (1.48). For comparison we shall calculate the linear wave transmission, i.e. we shall accept a wave speed as non-dependent of concentration (Fig. 1.18). Changes have touched only the computing block 1 where constant value of wave speed now is given. From resulting diagrams it is visible, that such linear waves move without deformation. So, by analysis of a nonlinear wave we have received the discontinuous solution in spite of the fact that the initial distribution was continuous and smooth. For practical purposes, the discontinuous solution is an important feature of a nonlinear problem and the essential complication for the researcher. The method of characteristics gives the formal nonsingle-valued solution. The ambiguous solution found must be replaced by a piecewise function, i.e. by a jump of car concentration, similar to the shock wave in gas-dynamics. However, special numerical methods and computing programs are necessary for the reproduction of shock waves. We shall continue discussion of this problem further in Chap. 9. To assert the generality of differential models for physically different problems, we shall consider two additional examples for the wave equation (1.48) in Chaps. 8, 9. In one of them, the quantity will be the vapor or gas bubbles concentration in water (as in a glass of beer, or in a two-phase steam-generating circuit of a power reactor). In the other case the quantity will be the concentration of harmful impurity in water percolating through the water-purification filter. Ð
Ð
1.6 One-Dimensional Stationary Models: Fuel Element 29
1)
(
)
Þ
ß
(
2)
Ú
2
φ 0 x0 , φ m := φ m ⋅ exp − x0 Û
)
ÜÝ
àá
(
)
x τ , x0 := x0 + τ ⋅ V wave x0 , φ m
x0_min := −3
x0_max := 3
Ni := 40
τ min := 0
τ max := 3
Nj := 80
i := 0 .. Ni
j := 0 .. Nj
(
)
i x0 := x0_min + x0_max − x0_min ⋅ i Ni
3)
(
)
V wave x0 , φ m := 1
(
X i , j := x τ j , x0
)
Ti , j := τ j
i
(
)
j τ j := τ min + τ max − τ min ⋅ Nj
(
)
φ i , j := φ 0 x0 , φ m i
φ m ≡ 0.85
1
φi, 0 φ i , 40
0.5
φ i , 80
0
(X , T , φ )
5
0
5
Xi , 0 , Xi , 40 , Xi , 80
Fig. 1.18. Linear wave with constant wave speed
1.6
One-Dimensional Stationary Models: Fuel Element
Many important design procedures widely used by engineers in practice can be received as solutions of elementary one-dimensional steady-state problems. We shall demonstrate this for heat conductivity problems in basic elements of power devices – for flat, cylindrical and spherical walls. Let us accept for a basis of analysis the generalized equation (1.11), ∂ϕ = −div( ) + γ , ∂τ â
and go to a stationary problem:
0 = −div( ) + γ . ã
For heat conductivity problem we use the usual denotations for heat flux and internal heat source: å
ä
q γ ä
qv .
30
1 Differential Mathematical Models
That gives: div(q ) = qv .
(1.54)
We present now the divergence as a special expression, suitable for objects with plane, cylindrical and spherical geometry (Fig. 1.19). F ~ r2
F ~ const F~r
Fig. 1.19. Objects with plane, cylindrical and spherical geometry
The control surfaces F, to which the heat flux refers, will be expressed by formulas, respectively: F = const ; F ( r ) = 2 π r ; F ( r ) = 4 π r 2 .
Let us construct further the special control volume dV, restricted with control surfaces F and representing the plane, cylindrical or spherical layer with small width dr. Then, according to definition of divergence: ë
è
d q( r ) ⋅ F (r ) dr q( r ) ⋅ F (r ) r +dr − q(r ) ⋅ F ( r ) r dr div(q ) = = . F (r ) ⋅ dr F (r ) ⋅ dr é
æ
ê
ç
(1.55)
The heat flux for one-dimensional problem is expressed by the formula: ∂t . ∂r
q ( r ) = −λ
(1.56)
After rewriting (1.54) with the explanation (1.55) d (q( r ) ⋅ F ( r ) ) = F ( r ) ⋅ qv dr
and integrating we shall receive the following equation of balance: ö
ó
rx
ô
ñ
ð
ô
q( rx ) ⋅ F ( rx ) − q( r0 ) ⋅ F ( r0 ) =
qv F ( r ) ⋅ dr
ñ
ô
ñ
ï
ï
ì
ì
î
ì
ì
í
ì
î
ì
í
õ
ò
Heat outgoing
Heat incoming
r0 ï
ì
ì
î
ì
ì
í
Thermal energy generation in layer ( rx − r0 )
. (1.57)
1.6 One-Dimensional Stationary Models: Fuel Element 31
We shall calculate further the temperature field in the fuel element of a nuclear reactor. For the fuel element as a cylindrical rod, it is necessary to put in (1.57): F ( r ) = 2π r ;
r0 = 0 ;
q(r0 ) ⋅ F (r0 ) r →0 = 0 . 0
Then we receive, in view of expression (1.53), the following differential equation for the temperature field: −λ
∂t 2π r 2 . 2 π r = qv ∂r 2
(1.58)
We make further calculations in Mathcad (see Fig. 1.20, Fig. 1.21). -3
-6 2
λ ( t) := 8.2 − 8.1 ⋅ 10 ⋅ t + 2.6 ⋅ 10 ⋅ t 10 8 λ ( t)
6 4 2 0
0
500
1000
1500
t
Fig. 1.20. Thermal conductivity , W / (m K), of uranium dioxide ÷
qV := 5 ⋅ 10
8
r1 := 0.0038
Given ø
ù
λ ( t (r) ) ⋅ ú
d t (r) dr
t_Fuel( r) :=
ýû
ü
−
qV ⋅ r
( )
t r1
2⋅1
500
t := odesolve ( r , 0 , 40)
t ( r) if r > 0 t ( −r) otherwise 1000 800 t_Fuel( r)
600
t ( 0) = 994.154
( )
t r1 = 500
400
0 r
Fig. 1.21. The temperature field in the fuel element (see Appendix about odesolve)
32
1 Differential Mathematical Models
The parameter set is as follows: source power qV = 500 MW/m3; rod radius r1 = 3.8 mm. We have also taken into account the essential temperature dependence of the heat conduction coefficient of nuclear fuel (Fig. 1.20). The numerical integration of the nonlinear differential equation (1.58) is carried out in block Given by method odesolve (Fig. 1.21). The boundary condition in this example is set as temperature on surface (t(r1) = 500˚C). Generally speaking, this temperature depends on the cooling conditions. As a result of integration the temperature distribution in fuel element is received. The maximal value is reached on axis: t0 = 994.2ºC. It is an allowable temperature for uranium dioxide as hightemperature material. Another solution mode for Eq. (1.58) is possible, as it is an equation with separable variables. After integration on a complete interval we shall receive: t
∆t =
1 0 qV r12 ; λm = λ(t ) dt , 4λ m t 0 − t1 t
(1.59)
þ
1
where m – average value of thermal conductivity. Let us show how to carry out the calculations with these formulas, if the setting of a problem has remained, i.e. the source power qV and surface temperature t1 are given and the temperature at centre t0 must be found (Fig. 1.22). ÿ
(
)
( )
λ ta
λ m ta , tb :=
ta − tb < 0.001
if
tb
1 ⋅ λ ( t) dt tb − ta t a
otherwise
q v := 5 ⋅ 10
(
)
8
r1 := 0.0038
(
)
eq t0 , t1 := t0 − t1 −
q v ⋅ r1
2
(
4 ⋅ λ m t1 , t0
)
t1 := 500
( (
)
t0 := root eq t0 , t1 , t0 , t1 , 2000
)
t0 = 994.154
Fig. 1.22. Calculation of maximal fuel element temperature
The design formula (1.59) is represented as expression eq, which should be zero. The nonlinear equation eq is solved with built-in function root. That returns the value of t0 lying in interval from t1 to 2000, at which the function eq becomes zero. The outcome (t0 = 994ºC) coincides with the outcome obtained earlier by another method (see Fig. 1.21).
1.7 Conclusion 33
The same calculation procedures will be suitable for an electric rod-type heater, when the internal heat source is caused by resistance against electric current. Starting with Eq. (1.57) and working similarly, it is easy to receive the formulas for thermal resistances of all basic elements of a heat exchanger. All calculations of fuel element temperature were carried out on a onedimensional model, which will be correct, if only geometry, structure of materials and the cooling conditions will be axially symmetric. Complications beyond this are considered in Chap. 10. 1.7
Conclusion
In this chapter, we have discussed how differential mathematical models are established in the analysis of different problems. It was shown, that a source of such formulations could be the direct translation of the verbal description into mathematical language, as in a case of a logistic model, or the direct application of laws of nature given in the differential form, or the record of the balance equations for control volume. In result, the circle of mathematical models is outlined, with which the work will be continued further: · the ordinary differential equations, · the first order partial differential equations, · the second order partial differential equations. Mostly nonlinear equations are dealt with; therefore the numerical methods must be used for integration. The problem about kinematic waves on motorways (i.e. about solutions of nonlinear differential partial equations of the first order) will be expanded in Chaps. 8, 9 by two new models: waves of an impurity concentration and waves of gas content in two-phase mediums. The shock waves problems will be solved by means of special programs (Chap. 9) developed for this purpose. The new programs for solving PDE of second order will be added to built-in Mathcad functions (Chap. 10). They allow describing several kinds of thermal interaction with the environment and are suitable for various shapes of twodimensional domains. Another enhancement is the program for one-dimensional non-stationary problems, such as heat waves (Chap. 11). By means of boundary layer methods, the solutions of a composite system of thermohydrodynamic differential equations for laminar flows will be obtained in Chaps. 5 and 6. The effect of hydrodynamic instability as forerunner of turbulence will be analyzed in Chap. 7. Not only differential models, but also other types of mathematical models are applied in engineering practice. If the subject of research can be considered as a lumped-parameter system functioning at steady-state conditions or varying step by step on discrete time intervals, the mathematical model will be submitted by the algebraic equations. In these cases, a matrix model frequently will be utilized Y = A⋅X ,
34
1 Differential Mathematical Models
e.g.,
y1
y2
=
a11
a12
a21 a22
a11 x1 + a12 x2
x1
x2
≡
a21 x1 + a22 x2
,
assigning a linear transformation of vector X = (x1,x2) in vector Y= (y1,y2). In geometrical interpretation, the transformation consists in the rotation and the scaling of vector X. For a square matrix A there are eigenvalues and eigenvectors Xeig, such, that the scaling only is carried out, but not the rotation:
λ X eig = A ⋅ X eig . The elementary application of the matrix model consists of the demonstration on a computer display, how the initial figure will be deformed (rotation, distortion, shear) under matrix transformation. The volume change during the transformation is set by matrix determinant. Other applications of the matrix model can be offered in order to interpret transformation as a modification of components x1 and x2 as a result of flows in a system, which are proportional to magnitudes of x1 and x2 themselves, and to take into account an interchanging both between components and with a surrounding medium. For instance, such matrix model can be gained for radiation heat fluxes in self-contained system of surfaces with various temperatures (see e.g. [10]). The task of the modeler consists in shaping a suitable matrix A. If this creative part of a problem is solved, all operations with the matrix model are best fulfilled in Mathcad, as there is a complete set of tools available for matrix multiplication and inversion, evaluation of determinant, searching of eigenvectors and eigenvalues etc. A very special place among methods of modeling is occupied by cellular automatons – the models reducing an explored object to a low-level logic cell, whose behavior is defined by prime rules of interaction with neighboring identical cells [9]. It is supposed, that at exact selection of rules it is possible to simulate actual systems, including hydrodynamic. An example of the cellular automaton is the computer game “Life” imitating birth, life and death of populations. It is accepted, that a living cell is identified by value 1, and a dead cell by 0. The destiny of each cell is defined by state of eight neighboring. One of the rules says: if the sum of values of neighboring cells equals 2 or 3, the cell survives, otherwise it dies due to overpopulation or loneliness: 0 0 1 1 1 0 0 1 0
1
0 0 1 1 1 1 0 1 0
0
0 0 1 0 1 0
0.
0 0 0
If one wants to set some initial allocation of living and dead cells in form of a large matrix from unity and zero, the system will evolve, forming composite varying patterns. The purpose of this game can be to search for conditions which en-
1.7 Conclusion 35
sure the survival of populations. It is best to implement algorithms of cellular automata in a specially designed programming environment CAM. For the modeling of compound objects which can not be completely formalized, so-called expert systems are developed, whose database contains the information on objects as a gang of rules, formulated by experts in the relevant fields of knowledge. For example, the elementary expert system of a weather forecast could function on the basis of the following rule: if today's temperature is e.g. 10ºC, then tomorrow's will be the same, plus/minus one or two degrees. Such system will work quite well, making mistakes only during the rare phases of a sharp change of weather. The rules can be expanded and gradually improved according to experience. The solutions or recommendations are based on logic deduction. There are algorithms for self-training expert systems. Therefore professional expert systems, such as MYCIN for medical diagnostics or DENDRAL for a discernment of chemical structures, fall into the area of artificial intelligence. Apropos, when we start the symbolical processor Mathcad to receive analytical expression for an integral or derivative of composite function, we consult an expert system in the area of mathematics. It is said, that thus we find the assistant– mathematician with Ph.D.
2
Integrable Differential Equations
2.1
Introduction
For reasons, which have, apparently, philosophical character, the majority of differential equations born in engineering practice, are not integrable. More precisely, they cannot be solved in quadrature, i.e. it is not possible to reduce the problem to integration of known functions. Therefore, numerical methods are applied. A source of these difficulties is nonlinearity of mathematical models of complicated real processes and devices. There are situations when the analytical methods allow advancing near the solution, but then we need the numerical methods again to finish the decision (for example, as in the boundary layer problem, Chapt. 6). Sometimes, the analytical solutions look so bulky, that they appear practically useless, and therefore it is more suitable to solve a problem numerically. At last, it is also possible, that the practical engineer does not have enough mathematical skills or enough time to reduce the problem to quadrature by means of complicated and nonstandard transformation of variables while the numerical result may be obtained quite operatively. Keeping these reasons in mind, we can accept the absence in Mathcad of special instruments for analytical solutions of differential equations, such as in Maple. Listed below is a list of the simplest situations when analytical solutions are possible and may be easily obtained manually: i. General first-order linear equations ii. Linear homogeneous equations with constant coefficients iii. Linear inhomogeneous equations with constant coefficients and with special structure of the right hand side iv. Equations with separable variables v. Homogeneous differential equations y' = f(y/x) vi. Depression of equation This list is not complete. If deriving analytical solutions is preferable for some reason, to consult a special manual. A simpler way is to look for the equation in E.Kamke's manual [17], where about 1650 differential equations with solutions are collected and the basic theoretical background (without proofs) is given. 2.2
First-Order Linear Equations
The general first-order linear equation for an indeterminate function y(x) is: y′ = f ( x) ⋅ y + g ( x) ,
(2.1)
38
2 Integrable Differential Equations
where f(x) and g(x) are arbitrary functions of the independent variable x. An initial condition prescribes the given value η for y at given point x = ξ: y (ξ) = η . The analytical solution and a numerical example will be submitted below in Mathcad-documents in Fig. 2.1 and Fig. 2.2. But first we shall discuss the possible physical contents of Eq. (2.1) by comparing them with the generalized form of conservation equation (1.11). We shall show, that the differential equation (2.1) may serve with equal success as model of a chemical reactor or describe the propagation of thermal radiation through an active medium. Suppose that the independent variable x is time τ. In this case the generalized equation (1.11) will take the form: ∂ϕ =γ. ∂τ
(2.2)
The divergence operator is omitted, as spatial distribution of dependent variable is uniform. We deal with the ordinary differential equation containing the unique independent variable – time . Comparing the form (2.2) with Eq. (2.1) we present its left part as rate of increase y′ of some physical quantity y in a control volume due to a source (Eq. (2.2), term on the right),
γ ≡ f ( τ) ⋅ y + g ( τ) ,
having two components. The first of them f( )⋅y is proportional to y just as it was in the elementary model of exponential growth (1.8). The second component g is the internal production or inflow from an environment, independent of y. Coefficient of proportionality f(τ) and quantity g(τ) do not depend on unknown variable , they are given, prescribed to the system from outside as any time functions. Therefore they may be interpreted as external action. A good example is the chemical reactor in which the concentration y of an active component grows due to autocatalytic reaction with a rate f( )⋅y, and this component also is injected (or moved away) with rate g. A reaction is autocatalytic when it is accelerated by its own product. The considered differential equation may also be a suitable model for a thermal state of an object, whose temperature y varies with time as a consequence of heater on-off g, assumed that heat sink to environment (f⋅y, f<0) is proportional to excess temperature y. Suppose that the independent variable x in (2.1) is now the spatial value. In ordinary differential equations considered here there can be only a single independent variable therefore we must eliminate the time dependence in equivalent conservation equation of kind (1.11). In this case the generalized conservation equation should be written as
0 = −div( ) + γ .
2.2 First-Order Linear Equations
39
For a one-dimensional problem with single spatial value x, we obtain: 0=−
dΦ +γ, dx
or in standard ODE form: dΦ = γ. dx
(2.3)
Comparing the form (2.3) with the analyzed Eq. (2.1), y′ = f ( x) ⋅ y + g ( x) ,
we interpret the left hand side as spatial variation of flux density y (or Φ) of any substance, assumed that this variation arises due to source action, γ ≡ f ( x) ⋅ y + g(x) ,
again having two components. As an example, let dependent variable y be the radiation flux. Then the first term of a source, i.e. f·y, is proportional to the flux itself. The coefficient of proportionality f must be negative because of absorption of radiation by propagation through matter. If this description is not quite obvious, it is useful to imagine the shooting at targets: the number of hits will be proportional to the number of shots. The radiation flux in such analogy is bullets, and hits are the acts of photon absorption on targets – i.e. on matter particles. The second source term is the emission, not dependent on the radiation flux y itself but dependent on temperature. If the temperature is coordinate-dependent then g = g(x). Let us return to the integration of the differential equation (2.1). The solution in quadrature is shown (without derivation) in Fig. 2.1. In the first line the differential equation and the initial condition are written: (ξ, η) – a point through which a solution should pass. In the second line, an auxiliary function F and a solution are shown. By writing of integrals the designation of integration variable was changed so that it did not coincide with limits on integrals, as provided by Mathcad. y'
f( τ) ⋅ y + g ( τ)
y( ξ )
η
q
τ
F ( τ ) :=
f ( t) dt
y( τ ) := exp ( F ( τ ) ) ⋅ η +
g ( u) ⋅ exp ( −F ( u) ) du
ξ
τ
ξ
Fig. 2.1. Analytical solution of a linear differential equation
40
2 Integrable Differential Equations
Evaluations are continued further as shown in Fig. 2.2 (both Figs. 2.1 and 2.2 are parts of unit Mathcad-sheet). Analytical y( ) and numerical z( ) solutions are obtained. The coordination of exact and approximated solutions is very good. There is full coincidence, with the accuracy of graphical representation. Let us look at Fig. 2.2. In the first line the values of the initial parameters and concrete functions as variable coefficients of the differential equation are given. In the second line the operator of symbolic computation (arrow to the right) is applied. Symbolic processor of Mathcad makes substitution of known functions and values and fulfils integration. In the third line the correctness of the obtained solution is confirmed: the differential equation becomes zero for the analytical solution y( ). The numerical solution is produced in block Given including the original equation, bound condition and the call of built-in numerical integrator odesolve. The numerical sequence of argument is created, in this case in order to avoid the fusion of markers in one continuous bold curve on the diagram.
ξ ≡ 0
y( τ ) simplify → d dτ
g ( τ ) ≡ cos ( τ ) + 1
η ≡ 4
f( τ ) ≡ −1
5 1 1 ⋅ exp ( − τ ) + 1 + ⋅ cos ( τ ) + ⋅ sin ( τ ) 2 2 2
y ( τ ) − ( f ( τ ) ⋅ y( τ ) + g ( τ ) ) simplify → 0
Given d dτ
z ( τ ) − ( f ( τ ) ⋅ z( τ ) + g ( τ ) )
0
z( ξ )
η
z := odesolve ( τ , 20 )
τ := 0 , 0.5 .. 20 4
y( τ ) z (τ )
2
g(τ )
0
0
10 τ
Fig. 2.2. Comparison of exact and numerical solution
20
2.3 Linear Homogeneous Equations with Constant Coefficients 41
2.3
Linear Homogeneous Equations with Constant Coefficients
The second order equation of this type can be written as y ′′ + a1 ⋅ y ′ + a2 ⋅ y = 0 ,
(2.4)
where a1, a2 are constants. In general, the coefficients of the equation may be complex quantities. However, the independent variable x is a real quantity. Therefore the solution will be a complex-valued function from the real argument: y ( x ) = yr ( x ) + i ⋅ yi ( x ) .
(2.5)
For this expression, the operations of derivation and integration may be fulfilled above real and imaginary parts: y ′( x ) = y r ( x ) + i ⋅ yi ( x ) , x2
x2
y ( x ) dx = x1
x2
y r ( x ) dx + i ⋅ yi ( x ) dx . x1
x1
The structure of the differential equation (2.4) is that the decision function y and its derivatives form a linear combination. The second derivative is proportional to a linear combination of the first derivative and a function itself. The exponential function, generally, the complex exponential function from real argument x e λ x ≡ e (a +i⋅b )⋅ x ≡ e ax ⋅ e ibx ≡ e ax (cos( bx ) + i ⋅ sin(bx ) )
has such property. Complex exponential functions are treated the same as the usual exponent, for example: d λx e = λ ⋅ e λx , dx x2 !
e λx dx =
x1
1 λx e λ
x2 x1
.
We write down a putative solution as the exponential function with an, for the time being, undefined exponent , y = exp( x), and substitute this expression into the differential equation (2.4). The exponential factors will be cancelled, and instead of a differential equation (2.4) we will receive the so-called characteristic algebraic equation for : "
"
#
λ 2 + a1λ 1 + a2 λ 0 = 0 .
(2.6)
42
2 Integrable Differential Equations
For a second-order differential equation, it is the quadratic characteristic equation having two radicals (λ1, λ2). Thus, there are two approaching exponential solutions: exp(λ1x), exp(λ2x). Using the superposition principle for linear systems, it is possible to construct the common decision as a linear combination y ( x ) = C1 e λ1 x + C2 e λ2 x .
(2.7)
If among radicals there are multiple roots then instead of taking constant C it is necessary to take a polynomial of a degree, one unit smaller than order of root. For example, if radicals of quadratic equation (2.6) are identical and equal λ the order is 2, and degree of polynomial is 1. Then y ( x ) = (C1 + %
(
'
$
%
2 &
x )e λx ≡ C1 e λx + $
2
x e λx .
polynomial
If the differential equation is written down immediately as the conservation equation for any real system (see Sect. 2.2), the included constants or the given functions will be real (not imaginary). However, the roots of the characteristic equation may be complex-valued. For our example with a second-order equation it will happen, if a discriminant of the quadratic equation (2.6) is negative. Then the solution appears complex-valued. The question is, how to select a real solution having physical meaning. If we substitute a complex solution (2.5) in differential equation (2.4) with real coefficients, the original Eq. (2.4) will split. Two completely identical equations, identical also to the original, arise: one of them – for real, and another – for imaginary part of the complex solution. We have step by step: y ′′ + a1 ⋅ y ′ + a2 ⋅ y = 0 ;
( y r′′ + a1 ⋅ y r′ + a 2 ⋅ yr ) + i ⋅ ( yi′′+ a1 ⋅ yi′ + a 2 ⋅ yi ) = 0 ; y r′′ + a1 ⋅ y r′ + a2 ⋅ y r = 0;
y i′′+ a1 ⋅ y i′ + a 2 ⋅ y i = 0 .
Hence, both real and imaginary parts of the complex-valued solution are solutions. Therefore, the common solution in the real area should be built as a linear combination of the real and imaginary part of the complex-valued solution. An example with the equation of type (2.4) was considered earlier in the first chapter in a problem about a pendulum (see Eq. (1.2) and Fig. 1.2). The real and imaginary parts were cos( τ) and sin( τ). Hence, the solution for harmonious oscillator will be )
)
x ( τ) = C1 cos( ωτ ) + C2 sin(ωτ) , where is the eigenfrequency of the system. Let us mark one more important characteristic of solutions following from reality of coefficients in Eqs. (2.4), (2.6): if λ is a root of characteristic equation, then )
2.4 Linear Inhomogeneous Equations
43
the complex conjugate number λ is also a root of this equation. This property is proved by substituting λ in characteristic equation, in view of equality:
(λ) = (λ ). n
n
The last equality is obvious if using the exponential form of a complex number. Thus, complex roots for the equations with real coefficients occur as conjugate pairs. 2.4
Linear Inhomogeneous Equations
Let us consider the linear inhomogeneous equations with constant coefficients and with a right hand side term of special structure y ′′ + a1 ⋅ y ′ + a 2 ⋅ y = Pm ( x ) ⋅ e wx ,
(2.8)
where Pm – a polynomial of a degree m. Generally speaking, exponent w is a complex number and its imaginary part is frequency of an external action. If w is not the root of the characteristic equation (2.6) the particular solution of the inhomogeneous equation (2.8) looks like y ( x ) Part = Qm ( x ) ⋅ e wx ,
(2.9)
where Qm – a polynomial of the same degree as Pm. If w is the n-fold root of the characteristic equation (2.6) the particular solution of the inhomogeneous equation (2.8) looks like y ( x ) Part = x n Qm ( x ) ⋅ e wx ,
(2.10)
where Qm – a polynomial of the same degree as Pm. The general solution of the inhomogeneous equation (2.8) is created as the sum of the general solution of the appropriate homogeneous equation (2.4) and a particular solution such as (2.9) or (2.10). The case when w coincides with the root of characteristic equations is named a resonance, since frequency of an external action (the term on the right of (2.8)) coincides with eigenfrequency of the system. 2.5
Equations with Separable Variables
The equation with separable variables has the following structure: dy = f ( y ) ⋅ g ( x) . dx
We can rewrite it in a form with separated variables:
44
2 Integrable Differential Equations
dy = g ( x ) ⋅ dx , f ( y)
and then integrate both left and right hand sides in consistent limits: y *
y0
x
dy = g ( x ) ⋅ dx , f ( y) x *
0
where y(x0) = y0 – the initial condition. The solution of the differential equation is expressed in quadrature. The example of such an equation is considered above in Chap. 1 (see Eq. (1.10) and Fig. 1.8). 2.6
Homogeneous Differential Equations
The equation y′ =
Q ( x, y ) , P ( x, y )
(2.11)
where Q and P – homogeneous polynomials with equal exponent n, such as Q (tx, ty ) = t nQ ( x , y );
P (tx, ty ) = t n P( x , y ) ,
will result in the form +
0
y′ = f /
.
-
y x ,
(2.12)
by division of the numerator and the denominator of the right member (2.11) on a maximal degree of x. By substituting y = x⋅u(x) into (2.12) the following equation with separable variables is obtained x ⋅ u′ = f ( u ) − u . The integration of such an equation is described above in Sect. 2.5. 2.7
Depression of Equation
If the differential equation does not contain in the explicit form • dependent variable y • or independent variable x, then its order can be depressed by means of the change of variables, as shown in the Mathcad-document in Fig. 2.3.
2.7 Depression of Equation
45
7
8
1)
2
1
d2 8
d 2
2
9
y(x) + 3
dx
dx
y(x)
46
f(x) substitute, 5
:<
d
;
dx
d dx 7
2)
2
8
2
9
d2 2
3
y( x) +
dx
d dx
y( x) + y(x)
z( x) + z(x)
substitute,
1
8
z( x) →
y(x)
;
2 5
0
4
6
<:
d dx
y(x)
;
5
2
f (x)
p ( y(x)) →
simplify ;
t ← y( x) ⋅ t ← x
1 2
+ p ( y(x)) + y( x)
2
0 w
d y( t) dt
d p (t) dt 1
2
d
3
p ⋅p + 46
dy
5
2
p+ y
0
Fig. 2.3. Depression of differential equation
For the second case we duplicate the result (the first-order equation) in a more precise form by hand (see final string). Mathcad is not accommodating to an analytical solution of the differential equations. The symbolical processor Mathcad is a subset Maple – top system for analytical calculations. For comparison we shall show, how Maple works with the equation, which is not containing explicitly the independent variable (Fig. 2.4). > restart ; with ( DEtools ) d2 d y( x ) + y ( x ) + y( x )2 = 0 dx dx 2 > odeadvisor ( ODE ) ; dsolve ( ODE ) =
> ODE :=
?
?
?
@
>
A
B
B
B
[ [ _2nd_order , _missing_x ] ] I
C K
y( x ) = 0, y ( x ) = _a &where { E
K
E
K
J
d _b( _a ) _b ( _a ) + _b( _a ) + _a 2 = 0 }, d_a F
K
D
G
H
H
S
d y( x ), _a = y ( x ) } , y ( x ) = _a , x = { _b ( _a ) = dx
1 d_a + _C1 _b ( _a )
N
N
O
N
N
L
M
T
U
N
N
P R
N
N V
Q W
X
U X
U X
X
U
Fig. 2.4. An example from Maple
The function odeadvisor classifies ODE as a 2nd order equation, with missing x. The solver dsolve specifies, what change of variables should be produced, presents the result of such replacement, the reduced equation of first order, and shows
46
2 Integrable Differential Equations
how to return to initial variables, when the solution of the equation will be found. In the given example, the reduced nonlinear equation was not integrable analytically, and any numerical method should be applied for this purpose. 2.8
Conclusion
When solving actual engineering problems, it is fortunate to obtain a mathematical model in the shape of the integrable differential equations. The cause is nonlinear nature immanent to composite engineering objects and the nonlinear form of the modeling differential equations, accordingly. The basic tools for nonlinear equathcad submits a rich artions are the numerical methods, and for this purpose senal of proprietary solvers (see Appendix). The majority of the equations deduced and solved in the book are nonlinear. The behavior of nonlinear systems is characterized by considerable variety and complexity in comparison with linear systems. It is not possible for nonlinear systems to use the principle of superposition which will be utilized for linear equations to make up the common solutions from partial solutions, or to make up the response on collective exterior action of several harmonic components (Sects. 2.2– 2.4). One should not expect either, that the response of the nonlinear system to exterior periodic action with given frequency will be registered on the same frequency, as it was for a linear system (see example in Fig. 2.2). Some special properties of nonlinear systems will be illustrated in the subsequent chapters of the book. In Chap. 3 we shall see, that, due to nonlinear dependence of right-hand part of DE on dependent variable, there are some equilibrium points, stable and unstable, and at change of control parameters a cardinal modification of solution character is observed (bifurcation phenomenon). The effects of nonlinearity are considered for partial differential equations in Chaps. 1, 8, and 9 on problems about propagation of kinematic waves. It is shown, as the progressing strain of a wave profile results in discontinuous solutions, shock waves, whereas the linear waves run without profile modification. The mutual relation of linear and nonlinear exposition is considered in Chap. 7. It is possible near to an equilibrium state for small amplitudes of deviations to linearize initial nonlinear exposition and due to this to receive prime solutions. However, these solutions remain valid only on quick-transient initial stage of perturbations. The oscillations and waves with major amplitude become nonlinear. One of the remarkable manifestations of nonlinearity in differential models is an auto-oscillations phenomenon, i.e. undamped oscillations in the dissipative systems which have not been exposed to exterior periodic actions. The example of “singing” wires by even wind is generally known (Aeolian harp). A special course of differential equations as a basis for the analysis of instabilities in selforganizing systems is contained in [12]. Y
Z
3
Dynamic Model of Systems with Heat Generation
3.1
Introduction
Heat, or thermal energy generation in natural and technical objects can result from transformation of • nuclear energy in thermal energy, as in a fuel elements of a nuclear reactor • chemical energy in thermal energy at exothermal chemical reaction, • electrical energy in thermal energy at passing electric current (resistance heating). Functioning of systems with heat generation can be connected with the danger of uncontrollable fast temperature increase, exceeding of permissible temperature limit, resulting in melting, spontaneous combustion or explosion. The possibility of such disastrous scenario contains in the elementary dynamic model of the system according to which: • Heat source power is determined by rate of chemical reaction under Arrhenius equation • Heat exchange to an environment happens under Newton–Richman law. On this model N.N.Semyonov’s theory of thermal explosion is based [37, 38]2. The concept of catastrophe as some destructive phenomenon is supplemented by a mathematical metaphor, namely, description of a dynamic system in the form of so-called fold catastrophe from R.Thom’s catastrophe theory [33]. Let us note, that our considerations do not include a detailed analysis of combustion physics. The subject of our interest will be the special structure of the nonlinear mathematical model. 3.2
Mathematical Model
The thermal energy balance,
[
dE dτ
Increase of thermal energy
=
QV Heat generation \
− QF
,
Heat sink ]
for a material volume V with internal heat source and with heat sink through surface F to surroundings (Fig. 3.1) is written in the form of a non-linear differential equation concerning temperature T as a state variable [38]: 2
Nikolay Semyonov, U.S.S.R., joint winner, with Sir Cyril Hinshelwood, of the Nobel Prize for Chemistry in 1956, works on the kinetics of chemical reactions
48 3 Dynamic Model of Systems with Heat Generation
ρ V b
a
^
`
d T dτ ^
E ) − αF (T − T f ) , RT
= qvmV exp( −
a
^
a
^
^
`
^
^
_
`
^
_
Heat sink
_
Heat generation
Increase of thermal energy
(3.1)
where τ − time as independent variable; Tf – ambient temperature; α − heat transfer coefficient; ρ − density; – specific heat; E – activation energy, the parameter in Arrhenius equation: “reaction-rate constant” ~ exp(–E/RT); R – gas constant; qvm – preexponential factor (W/m3). Uniform distribution of temperature inside the body is supposed at formulation of this equation, due to good intermixing or as a result of high heat conduction of substance. c
F
V
T( ) d
e
(T-Tf)F
qvm exp(–TR / T)V
Fig. 3.1. The object with internal heat generation
Using the quantities TR = E/R and τ0 = ρcTR/qvm as scales for temperature and time accordingly, we write (3.1) in form:
f
d W dt
1 ) − A(W − W f ) , W
= exp( −
j
j
g
g
Increase of thermal energy
i
g
i
g
h
Heat sink
h
Heat generation
(3.2)
where • • • •
W = T/TR – dimensionless temperature, state variable, T = τ/τ0 – dimensionless time, independent variable, A = αFTR / Vqvm – heat transfer coefficient, numeric parameter, Wf = Tf /TR – the dimensionless ambient temperature, the numeric parameter. The thermal energy generation rate by chemical reaction depends on (dimensionless) temperature nonlinearly, k
p
m
QV = exp − n
o
1 , W l
as shown in Fig. 3.2. At low temperatures, the heat generation is insignificant because of a small chemical reaction rate. Then sharp increase and finally gradual passage to an asymptotic value is observed.
3.2 Mathematical Model 49 q
−1 Qv( W) := exp W r
s
vt
u
1
Qv ( W ) 0 0
2 W
Fig. 3.2. Nonlinear S-shaped temperature dependence of heat generation rate
Heat exchange with surroundings is given by Newton–Richman law:
(
)
QF = A W − W f ,
according to which the heat flux on a surface is proportional to temperature difference of solid W and medium Wf. The behavior of the right hand side member (3.2) as function of dependent variable W (temperature), |
(
y
)
1 Q(W, A, W f ) = QV − Q F = exp − − A W −Wf , W z
w
x
{
will play the key role in further analysis. In a physical meaning, Q(W,A,Wf) is the resulting source term in Eq. (3.2), i.e. the heat generation rate QV minus heat outflow QF through the surface of control volume. In Fig. 3.3 the partial dependence Q(W) is shown for the selected pair of control parameters (A, Wf). The temperature Wf of the surroundings is marked by a vertical dotted line.
(
)
}
~
Q W , A , Wf := exp
−1 − A ⋅ W − Wf W
(
)
0.1
(
)
Q W , A , Wf mark_Wf
0
0.5
1
W , Wf
Fig. 3.3. Representation of the right hand side of Eq. (3.2) at values: W f = 0.2, A = 0.46
50 3 Dynamic Model of Systems with Heat Generation
At the intersections of the curve with the abscissa axis the resulting heat input is zero. Therefore, the derivative dW/dt vanishes, and the temperature of the object will not vary in time. Such points are called stationary or equilibrium points. Due to the brightly expressed nonlinearity of the problem there are three stationary points (Fig. 3.3). Further we shall diagnose stability or instability of such states. We also shall see, how location of these critical points depends on control parameters (A, Wf). 3.3
Phase-Plane Portrait. Stable and Unstable Equilibrium
The problem of equilibrium state stability is solved as follows. A small deviation from equilibrium is assumed. The state is steady, if spontaneous resetting occurs. Otherwise the equilibrium is unstable: even the small initial deviation will result in progressing change of the state, until the system will end up in another equilibrium state (or will be destroyed). In Fig. 3.4 three equilibrium states are designated by numbers 1, 2 and 3. The sign of the differential equation (3.2) on different segments of W axis is shown in circles. Assume that the state of the system has deviated to the right from the equilibrium point 2. It is visible, that the right hand side of the differential equation (3.2) and, therefore, derivative dW/dt are positive. Therefore value W will increase, the state of system will displace all further to the right from an initial point 2, as indicated by arrow. So, the equilibrium state 2 is a unstable stationary point. It is easy to prove, that points 1 and 3, vice-versa, are stable equilibrium states. At the bottom of Fig. 3.4 the phase portrait of system is drawn. For the first order problem (with one differential equation of the first order) it is an axis of the state variable W, labeled by equilibrium points and arrows showing the direction of evolution from different initial states. The main content of phase portrait in our example is presence of three equilibrium points, two stable and one unstable in between.
dW/dt or Q(W,A,Wf) + 0 1
0
–
*2 *
+ 3
– W
W
Fig. 3.4. The stable (points 1, 3) and unstable (point 2) states
3.4 State Set Representation
51
The stable points 1 and 3 are centres of attraction for different initial deviations, and unstable point 2 constitutes the boundary parting these two attraction areas. Reverting to the model with heat generation, we shall qualitatively describe the system evolution depending on initial state. Let us rememeber, that the analysis is carried out for some individual combination of parameters (A, Wf). If the reference temperature of object is lower than in point 2, the system will aim at the stable state 1 with rather low temperature. Such state can be interpreted, for example, as self-heating of organic matters (a stack of wet hay, peat, coal), due to the sluggish oxidizing reaction with heat generation. If the reference temperature is higher than at point 2, the system will aim to state 3 with very high temperature. Such process can be interpreted as heat-up with the subsequent ignition, flashout or explosion. The dynamics of these processes will be explored further. However, before doing that the dependence of location and character of equilibrium points on the control parameters needs to be surveyed. In other words, for any point on the parameters plane (A, Wf) the number of stationary states is determined, their temperatures are evaluated, and their stability or unstability is analyzed. 3.4
State Set Representation
As was already said, at equilibrium state the internal heat generation is counterbalanced by heat removal to a surrounding medium. Thus, the right hand side of the differential equation (3.2) will be zero: 1 ) − A(W − W f ) . W
0 = exp( −
(3.3)
Heat sink
Internal heat generation
Eq. (3.3) gives the set of equilibrium states W at different values of control parameters (A, Wf). We do not specifically label the equilibrium values W, as some time we shall be concerned oneself with only such states. The set of equilibrium states can be presented in a different graphic form. Let us begin at the usual two-dimensional graph. On the horizontal axis, the excess equilibrium temperature dW=W–Wf, and on the vertical axis the dimensionless heat transfer coefficient A are plotted (Fig. 3.5). The parameter on this graph is the environment temperature Wf. The explicit shape of such representation is easily obtained from the original equilibrium condition (3.3):
1 1 A(W f , dW ) = . exp − dW W f + dW
(3.4)
If we fix some value of surroundings temperature Wf (i.e. we pick out one of the curves in Fig. 3.5) and draw a horizontal line with the given value of coefficient A, the equilibrium values of excess temperature of the system will be received at the resulting crosspoints.
52 3 Dynamic Model of Systems with Heat Generation
1 −1 A Wf , dW := ⋅ exp dW Wf + dW
(
)
2
A( 0.15 , dW ) 1.5
A( 0.25 , dW ) A( 0.3 , dW )
(
A W fcr , dWcr
(
)
A 0.15 , dW unst
)
( ) A( 0.15 , dW unst)
1
A W fcr , dWcr
0.5
0 0.01
0.1
1
10
dW , dW , dW , dW cr , dWunst , dW , dW
Fig. 3.5. Representation of the equilibrium states set in the form A(Wf, dW). (A=0.541, Wf=0.25, dW=0.25 – initial critical point; A=0.205, W f=0.15, dW=0.12 – an example of unstable equilibrium point)
The curve Wf = 0.25 plays a key role. If we go down from larger Wf to smaller, on this curve a critical point appears for the first time, i.e. the point with horizontal tangent. This initial critical point (with coordinates Acr = 0.541; Wfcr = 0.25; Wcr = Wfcr + dWcr = 0.25 + 0.25 = 0.5) is an inflection point, in which also the second derivative reverts to zero. At smaller values, Wf < Wfcr, from initial critical point two additional critical points are born: minimum and maximum with the inflection point between them. At large values Wf > Wfcr the critical point degenerates to the usual inflection point. The evaluations illustrated in Fig. 3.5 are within elementary analysis of singular points, but they can require bulky transformations together with a double differentiation of functions and solution of equations sets. Mathcad has executed this operation, having saved the author from routine evaluations. The diagram in Fig. 3.5 relates the location of equilibrium points W (or dW) to values of control parameters A and Wf. Therefore, results of the analysis can be expressed as follows. If parameter A is between minimum and maximum (i.e. between critical points), there are three equilibrium points – two stable and one unstable between them (for example, the horizontal line A = 0.205 crosses the curve Wf = 0.15 at three points). Otherwise, there is only one equilibrium point.
3.5 Plotting the Bifurcation Set 53
The profit from this elementary analysis of equilibrium points is a prediction of qualitative behavior of system on the basis of control parameters values, i.e. the answers to following questions: • to which equilibrium state the evolutionary system tends, when it starts from a given initial state, • how many equilibrium points are present for the system in view, • which ones are stable and which unstable, i.e. unrealizable. In practice, a main problem is to forecast whether there are dangerous states among equilibrium points, whose attraction area should be avoided at any price. We shall advance in solving these problems. With so-called bifurcation diagram we split the plane of control parameters in areas, with different phase portraits, and then we shall yield three-dimensional representation of equilibrium states in the shape of the so-called “fold catastrophe”. 3.5
Plotting the Bifurcation Set
Within the full set of control parameters let’s discover a bifurcation subset, whose crossing varies the phase portrait, i.e. the number and character of equilibrium points. The problem can be reduced to mapping the critical points on a plane of control parameters. At critical points, the dW-derivative of function A(Wf, dW) given by (3.4) must be zero. That results in the quadratic equation:
(
)
dW 2 + 2W f − 1 ⋅ dW + W f2 = 0 .
Both branches of the solution
1 = − Wf − 2
dW1, 2
2
1 Wf − 2
− W f2
should be substituted in expression (3.4) to receive the bifurcation set on a plane of control parameters (A, Wf). The results of these evaluations as a curvilinear wedge with vertex at initial critical point (A = 0.541, Wf = 0.25) are shown in Fig. 3.6. Inside the wedge (e.g. the point (A,Wf ) = (0.25, 0.15) in Fig. 3.6) there are three equilibrium points on the phase portrait, i.e. three values of equilibrium temperature, two stable and one unstable. Outside the wedge for each pair of parameters (A, Wf) there is one steady state with temperature W (or excess temperature dW). Transferring through the boundary inside of the wedge the bifurcation of the solutions is observed. At boundary one more equilibrium point is born, which bifurcates to two equilibrium states: one of them is stable and another unstable. The dashed line shows a boundary corresponding to Semyonov’s criterion of thermal ignition [37,38].
54 3 Dynamic Model of Systems with Heat Generation
Wf
0.4
0.2
w 0
0
0.5 A
1
Fig. 3.6. The bifurcation diagram and Semenov’s criterion (dashed line) of thermal ignition
In the following section we shall describe one more representation of set of equilibrium states, and then we shall return to the more detailed definition, how these representations will be used for demonstration of change of state by change of control parameters. 3.6
Fold Catastrophe
The equilibrium conditions of system (Eqs. (3.3) or (3.4)) can be viewed as an implicit function connecting the state variable, i.e. equilibrium temperature W (or excess temperature dW), with control parameters, i.e. with heat transfer coefficient A and ambient temperature Wf : dW=dW(A, Wf). The three-dimensional surface (Fig. 3.7) will be a usual representation of dependence (3.4).
( A , Wf , log_dW) a)
( A , Wf , log_dW) b)
Fig. 3.7. Equilibrium states surface (a–side view, b–top view)
3.7 Catastrophic Jumps at Smooth Variation of Parameters 55
The surface is built as parametric plot in Mathcad. The obtained surface is titled “fold catastrophe”. The presence of fold results in an ambiguity of function: several (three) equilibrium points may appear, as is visible in the left-hand graph (Fig. 3.7a). The localization of parameters area, in which there is an ambiguity, is especially well determined in Fig. 3.7b – this projection extends the bifurcation diagram in Fig. 3.6. The title “catastrophe” is used because the indicated shape predetermines a jump, a disastrous development of the system, as shown in the next section. 3.7
Catastrophic Jumps at Smooth Variation of Parameters
The changes of a system state can be viewed under two aspects: • As time evolution from some initial state at given constant values of control parameters • As transferring from one equilibrium state to another at change of control parameters. Let us consider the second case. The parameter plane (A, Wf) is divided into two characteristic subdomains by the bifurcation diagram (see comments to Fig. 3.6).
Wf
(0.46, 0.2)
0.3
(0.49, 0.2)
(0.3, 0.2)
0.2
0.1
.
0 0
0.5
A
1
Fig. 3.8. The bifurcation diagram and the initial points for time evolution analysis
The result is a special behavior of the system at transition through boundary between subdomains. Namely, the continuous change of parameters causes a discontinuous change of the state variable (temperature in the model concerned here). The arrow from inside of the wedge to the right (Fig. 3.8) depicts a discontinuous diminution (jump) of temperature as result of the smooth magnification of heat transfer coefficient A. The representation of this process on the threedimensional diagram of equilibrium states is given in Fig. 3.9. The jump is shown by arrow, which is oriented downwards. That can be interpreted as extinguishing of a flame, when the heat sink to environment become too major.
56 3 Dynamic Model of Systems with Heat Generation
If we smoothly decrease the heat transfer coefficient A located on the inferior sheet of equilibrium surface, the jump will happen with sharp rise in temperature. This is shown in Fig. 3.8 by the arrow coming out of the wedge to the left, and in Fig. 3.9 by the arrow which is oriented upwards. This transition is interpreted as autoignition, i.e. a spontaneous increase of chemical reaction rate resulting in ignition without any triggering from outside.
Fig. 3.9. The fold catastrophe: the jumps by ignition (explosion) or extinguishing of a flame
The theory of thermal autoignition (thermal explosion) was designed by N.N.Semyonov in 1928 [37]. Semyonov’s criterion of thermal inflaming obtained for an extreme case of low temperature of the surroundings and small excess temperature of the system can be written in our designations as (quoted in [38]): 2.718 1 1 exp( − ) = 1. A W f2 Wf
This boundary is shown in the bifurcation diagram (Fig. 3.6) as dashed line. As expected, the good coordination with our calculations is observed in the area of small values of reduced environment temperature (at Wf < 0.1). In the theory of catastrophes some important properties are stressed which are inherent in composite objects and which can be explained on the basis of an equilibrium surface such as a fold. First of them was just argued: this is the discontinuous change of state at smooth variation of control parameters. The other is hysteresis. After the jump upwards it is necessary to go long on the upper sheet of surface in a direction of magnification A, to return then by jump down towards the inferior sheet (see Fig. 3.9). In the next Sect. 3.8 the time evolution of system is described, if the control parameters are divided into different areas by bifurcation lines.
3.8 Time Evolution of System with Heat Generation 57
3.8
Time Evolution of System with Heat Generation
Let us consider three examples of time evolution for three combinations of control parameters (A, Wf ), as shown in Fig. 3.8 by the three solid points. The right-hand term of basic differential equation (3.2) has a different number of roots for this set of control parameters (Fig. 3.10), in other words, the different number of equilibrium temperatures W. The roots can easily be calculated by built-in solver root (Fig. 3.11). We number the roots in ascending order W1, W2, W3, and take into account their prehistory. Therefore, in case of unicity there is a root W1 or W3.
(
)
¡
Q W , A , Wf := exp ¢
−1 − A ⋅ W − Wf W ¥£
(
¤
)
Wf := 0.2
( ) Q ( W , 0.49 , W f) Q ( W , 0.3 , W f) Q W , 0.46 , W f
0.1
0
1
2
W
Fig. 3.10. The right hand side of (3.2) for various sets of control parameters 1 ) A := 0.46
Wf := 0.2 W1 := root Q W , A , Wf , W , 0.1 , 0.3
W1 = 0.226
W2 := root Q W , A , Wf , W , 0.3 , 0.7
W2 = 0.533
( ( ) ) ( ( ) ) W3 := root ( Q( W , A , Wf) , W , 0.7 , 2.0) Wf := 0.2 W1 := root Q W , A , Wf , W , 0.1 , 0.3
W3 = 0.999
2 ) A := 0.49
( (
3 ) A := 0.3
Wf := 0.2
( (
) )
)
)
W1 = 0.223
W3 := root Q W , A , Wf , W , 0.1 , 3
W3 = 2.396
Fig. 3.11. Calculating equilibrium states
In the first example the point (A,Wf ) = (0.46, 0.2) is located inside of the curvilinear wedge on the bifurcation diagram (Fig. 3.8). Here we get three equilibrium states: two stable at low W1 or high W3, and one unstable at intermediate value W2 of dimensionless temperature (Fig. 3.10, Fig. 3.13 ). ¦
58 3 Dynamic Model of Systems with Heat Generation
The time evolution from different beginnings (tb, W b) was calculated by numerical integration of the differential equation (3.2) with built-in method odesolve for the time interval t = 0 – 200 (Fig. 3.12) and was charted in Fig. 3.13. A := 0.46
Wf := 0.2
§
®
¨
Q( W) := exp ¯
©
−1 − A ⋅ W − Wf W ¬ª
(
«
W1 := root ( Q ( W) , W , 0.1 , 0.3)
W3 := root (Q ( W) , W , 0.7 , 2.0)
W2 := root ( Q ( W) , W , 0.3 , 0.7)
WExpl := W2
1)
tb := 10
Given
d W ( t) dt
2)
tb := 30
Given
d dt
W ( t)
3)
tb := 50
Given
d W ( t) dt
) °
²
±
w
Wb := 0.01
( )
Q (W ( t) )
W tb
W1 := odesolve ( t , 200)
Wb
Wb := WExpl − 0.05
( )
Q (W ( t) )
W tb
W2 := odesolve ( t , 200)
Wb
Wb := WExpl + 0.05
( )
Q (W ( t) )
W tb
W3 := Odesolve( t , 200)
Wb
Fig. 3.12. Integrating the differential equation (3.2) with various initial conditions W1 = 0.226
W2 = 0.533
W3 = 0.999
WExpl = 0.533
0.1 1
W 1 ( t)
0.05
Q(W)
W 2 ( t) W 3 ( t)
0
0.5
0.5
1
W Expl
0.05
0
W
0
100
200
t
a)
b)
Fig. 3.13. The right hand side of (3.2) ( ) and time evolution in case of three equilibrium states (b) ³
The temperature of unstable equilibrium W Expl = 0.533 is the boundary between domains of attraction to the two stable states with low or with high temperature.
3.8 Time Evolution of System with Heat Generation 59
The two modes, launched practically from the same temperature, a little below or a little higher than W Expl, separate very strongly, i.e. there is a strong, discontinuous dependence of result from initial state. The quantity W Expl can be called ignition temperature. W1 = 0.223 0.1
1
W 1 ( t)
0.05 Q(W)
W 2 ( t) W 3 ( t) 0
1
0.5
W1
0.05
0 W
0
100
200
t
a)
b)
Fig. 3.14. The right hand side of (3.2) ( ) and time evolution in case of an equilibrium state at low temperature (b). ³
W3 = 2.396 3
Q(W)
0.1
W 1 ( t)
2
W 2 ( t)
0.05
W3 0
1
2
0
0.05
0
100
W
200
t
a)
b)
Fig. 3.15. The right hand side of (3.2) ( ) and time evolution in case of an equilibrium state at high temperature (self-ignition, explosion) (b) ³
60 3 Dynamic Model of Systems with Heat Generation
Each of the two examples shown in Fig. 3.14 and Fig. 3.15 has one stable state, accordingly for parameters (A, Wf)=(0.49, 0.2) at low and for (A, Wf)=(0.3, 0.2) at high temperature. The last mode can be called autoignition, because eventually, irrespective of initial temperature, there occurs a sharp increase of chemical reaction rate and temperature. 3.9
Conclusion
Large technical systems usually work in stationary operating mode at certain nominal, optimal parameters. If nevertheless the regime must be changed, the previous state should be replaced by some new but near and also stable equilibrium state, when the control parameters are continuously, smoothly changed. It is the reasonable requirement ensuring reliability and safety of technical system maintenance. Indeed, if the small changes of control parameters result in equally small changes of system state, then the operator, having noted adverse reaction, can always return back by putting “operating handles” in their initial positions. However, even such cautious behavior does not guarantee safety. The problem consists in possible discontinuity described above. It can happen, that a small change of control parameters will put the system in an unstable state, and then the time evolution will push the system in a very far new state. Taking into account the hysteresis behavior, the way back will be a different and, probably, lengthy path, because it will be necessary now to significantly change the values of control parameters, to return to an initial state. Discontinuous, or crisis behavior of systems whereas the control parameters are changed continuously is often observed in nature and technics, in economics and even society. We were trying to show such complex behavior in an instructive example of nonlinear model for a system with heat generation (see also [47]).
4
Stiff Differential Equations
4.1
Introduction
Special numerical algorithms for stiff differential equations were developed about thirty years ago [13]. Approximately at that time the ozone hole above Antarctica was detected. These two diverse events were closely connected in the subsequent history of research of the ozone depletion3. The problem has caused growing concern in the world because stratospheric ozone protects life on Earth from pernicious ultraviolet solar radiation. The human-produced chlorofluorocarbons (CFCs) used as refrigerants (freons) and as loading of aerosol cans have been recognized for being responsible for destroying the ozone layer. According to the Montreal Protocol on Substances that Deplete the Ozone Layer, the global production of ozone-depleting substances has been drastically reduced. Now the ozone depletion is expected to gradually disappear by about the middle of the 21st century– due to a timely recognition of the dangers and measures accepted on a global scale. There exists a drama history of several decades of mathematical modeling of chemical processes in atmosphere, research of hundreds of chemical reactions with participation of ozone, development of ecological politics and, at last – acceptance of critical decisions in industry and business. Because chlorofluorocarbons have chemical lifetimes on the order of a century, it was early clear that laboratory experiments alone would not be enough to check various suggested mechanisms of ozone depletion, and to estimate various allowable alternative chemicals. As it turned out, mathematical modeling has played a key role, on the basis of the differential equations with stiff property. Some of numerous atmospheric ozone reactions composing complex transformation chains have time scales of a fraction of a second. As follows from comparison with characteristic life time of chlorofluorocarbons – a century or more – the time scales in the differential equations differ by more than ten orders. Thus, it was necessary during numerical integration not only to calculate very fast reactions with minimal time steps, but also to trace the system behavior over the enormous time interval of about one century. Properties of the differential equations was that the numerical integration using conventional methods (for example, Runge-Kutta) had to be executed with smallest time steps through out the all big interval of system evolution even if fast reactions had already been coming to an end. Otherwise, at attempts to increase the integration steps, a numerical instability occured. Effective modeling was made possible only due to special algorithms for stiff systems. 3
Davis P (1995) CFCs and Stiff Differential Equations at DuPont. SIAM News, vol 28, 9
62 4 Stiff Differential Equations
4.2
Model Differential Equation
Let us consider the elementary model of control for some object Y. The control system should ensure the behavior of object Y according to law F(X): Y = F(X ) .
(4.1)
Let us suppose that significant aberrations arise from the ordered law, for example, from a random action or by start from special initial state: Y − F( X ) ≠ 0 .
It is necessary to ensure fast return to equilibrium trajectory F(X). Therefore, the speed of returning, i.e. derivative dY/dX, should be proportional to the deviation and opposite in sign, and the coefficient of proportionality should be large. Such a model is represented by differential equations with large parameter α: dY = −α(Y − F ( X )) . dX
(4.2)
Let us explain the meaning of parameter α, estimating the order of period ∆X during which Y is reverted to a correct trajectory F(X) (Fig. 4.1). This is done by replacing in (4.2) the derivative with its finite-difference approximation (see Mathcad-fragment (4.3)). It was also accepted, that control function F(X) varies sluggishly on big intervals X.
Y0 Y X
F(X0) F(X)
X0
∆X
Fig. 4.1. Rapid deviation decrease by large parameter α
The solve operator solves the finite-difference equation concerning the characteristic interval ∆X: F ( X0) − Y0 ∆X
−α ⋅ ( Y0 − F ( X0) ) solve , ∆X →
1
α
(4.3)
4.3 Method rkfixed. Numerical Instability 63
From this solution follows, that if the parameter α is large, then the liquidation of deviations will occur very quickly, on small interval ∆X (Fig. 4.1) equal to inverse –value (on order). There are many examples of the systems described by differential equations of type (4.2): • The autopilot ensures the given small altitude h of flight above a relief [F(X) – h], where X is a route of flight on a map. The altitude deviations, which have arisen for this or that reason, should be quickly eliminated otherwise a catastrophe is possible. It is necessary to ensure the fast returning of Y to prescribed value F(X), therefore the parameter α should be large. • The temperature Y of any object is positioned at necessary level F(X) depending on time X with the help of a thermostat. Intensity of heat exchange α between object and a fluid in the thermostat should be large so that the thermal equilibrium (Y=F(X)) between object and thermostat can be quickly restored. • The concentration Y of any component in a chemical reactor quickly tends to equilibrium value F owing to high speed of reaction. • etc. We examine further behavior of such systems by means of a numerical integration using various methods, namely: the explicit Runge–Kutta method with fixed step of integration rkfixed, the explicit Runge–Kutta method with step-size adaptation rkadapt, the implicit method stiffr special for stiff differential equations. During this investigation the peculiar features of stiffness will be detected. We shall see, that the special method stiffr has an important advantage over the two other methods. By comparison of two basic numerical schemes – explicit and implicit – it will be shown, that the stiff equations should be solved with implicit methods like stiffr. ´
µ
µ
µ
4.3
Method rkfixed. Numerical Instability
As the control law we shall choose the slowly varying periodic function with wave number k, k ≈ 1: F ( X ) ≡ sin(kX ) .
(4.4)
The key parameter should be large to ensure fast return of control variable Y to the prescribed equilibrium value F(X), 10. Let us receive some trial solutions at various integration steps h and at various initial conditions. Meaning of parameters of the built-in function rkfixed must be clear from mnemonic designations. In the Appendix, detailed help about built-in solver can be found. The term on the right of model differential equation (4.2) is denoted as function DY(X,Y). ´
´
¶
64 4 Stiff Differential Equations
Initial Variant: Solution with Small Step Let us calculate the evolution of a system from an initial state (Xbeg, Ybeg), noticeably different from equilibrium: Xbeg=0, Ybeg=4 (Fig. 4.2). The interval of integration is taken large in comparison with period of fast change (Xend =2 >> 1/ ). Number of steps NofSteps must be relatively large (32) and the integration step h small, ensuring an acceptable accuracy of calculations. If we try to increase the step, there will be a numerical instability (see below Sect. Variant 2). Now we call the built-in integration function with fixed step rkfixed. The obtained function Y(X) is demonstrated in Fig. 4.3. ·
¸
k≡ 1
F ( X) ≡ sin ( X ⋅ k)
α ≡ 10
DY( X , Y) ≡ −α ⋅ ( Y − F ( X) )
Xbeg := 0
Ybeg := 4
F ( Xbeg ) = 0
Xend := 2π
NofSteps := 32
h :=
Xend − Xbeg NofSteps
h = 0.1963
InitCond0 := Ybeg S := rkfixed ( InitCond , Xbeg , Xend , NofSteps , DY) º
X := S
»
0
º
Y := S
¹
»
1
Fig. 4.2. Initial variant of solution
Variant 1: Calculation of an Intermediate Deviation with Small Step Supposing that in intermediate point Xbeg (0 < Xbeg < Xend) a significant deviation arises, we calculate the evolution of this deviation keeping the former integration step. The results of the numerical integration for two versions calculated above are presented in Fig. 4.3 as functions Y(X) and Y1(X1). The equilibrium solution F(X) is shown in the same place. The initial deviation given in point X=0 dampens fast due to a large value α. Further change of Y happens slowly according to the given control function F(X). Such behavior of a solution is conserved for all areas of integration. The deviations originating in any point X, evolve similarly, as illustrated by branch of solution Y1. The solution of the model problem is characterized by the change of phases of fast and sluggish variation of control variable Y. The deviations, which have arisen in any point, generate the rapidly relaxing solutions (see Fig. 4.3). These features define a stiff problem. Now we extend the investigation of the model stiff equation (4.2) further and consider effectiveness of modified integration steps.
4.3 Method rkfixed. Numerical Instability 65
i_beg NofSteps
i_beg := 6
X1beg := 2 ⋅ π ⋅
Y1beg := −4
F ( X1beg ) = 0.9239 h :=
Steps := NofSteps − i_beg
X1beg = 1.1781
Xend − X1beg Steps
h = 0.1963
InitCond0 := Y1beg S1 := rkfixed ( InitCond , X1beg , Xend , Steps , DY) ¼
X1 := S1
½
¼
0
Y1 := S1
½
1
5
Y Y1
0
F ( X)
5
0
2
4
6
X , X1 , X
Fig. 4.3. Evolution of deviations originating at different points X
The special behavior of control variable Y – fast and slow phases of change – suggests the idea to use variing integration steps: small in the area of a fast change and large in the area of sluggish change, with the apparent purpose to save computational time and memory. Follow-up calculations confirm that this will happen as Fig. 4.4 demonstrates. Variant 2: Instability by Increased Step Let us double the integration step h in the area of weak changes of control variable Y. We start from point i_beg = 6 with value Yi_beg using the solution obtained in initial variant above. This solution is saved as array Y (see Fig. 4.2), so it is enough to select an element with index i_beg. The step is multiplied by two by dividing of stayed area (Xend –X2beg) into a twice smaller number of intervals than in the examples considered above. So, up to point i_beg the solution Y is obtained in Fig. 4.2, and then we continue with doubled step. The result is shown in Fig. 4.4.
66 4 Stiff Differential Equations
i_beg := 6
X2beg := 2 ⋅ π ⋅
i_beg NofSteps
X2beg = 1.1781
Yi_beg = 0.8781 h :=
Xend − X2beg
h = 0.3927
( NofSteps −i_beg ) 2
InitCond 0 := Yi_beg ¾
¿
S2 := rkfixed InitCond , X2beg , Xend , À
Ä
X2 := S2
Å
Ä
0
Y2 := S2
( NofSteps − i_beg ) , DY 2 Ã Á
Â
Å
1
5
Y Y2
0
F ( X)
5
0
1
2
3
4
5
6
X , X2 , X
Fig. 4.4. Instability by numerical integration of stiff problem with rkfixed after step increase
Curve Y (circles) represents the correct solution that was obtained by integration with constant small step. Solution Y2 (diamonds) starts with doubled step from point X2beg = 1.1781 where the fast changes already have ended. It is obvious that this attempt is unsuccessful. Disastrous deviations occur and function Y2 has nothing common with the correct Y. The described behavior is typical for stiff equations if explicit methods with fixed step such as rkfixed are used for numerical integration. The stiff equations have latent rapidly varying solutions. As soon as more or less noticeable deviations from equilibrium state F(X) arise in consequence of random actions (in the original) or computational errors (in the model) – even during slow change – it is necessary at once to adequately describe the fast relaxation process (reequilibration), i.e. to integrate with small step. Actually, the integration of stiff equations with rkfixed must always be made with the smallest step, even in spite of the fact that the solution varies very slowly. It is a paradox of stiff systems.
4.3 Method rkfixed. Numerical Instability 67
Variant 3: Instability at Increase of Relaxation Parameter Æ
Let us consider two more versions of integration – with doubled parameter α and the same steps as in the successful initial version in Sects. Initial Variant and Variant 1. Numerical integration is done in Fig. 4.5, and the results are demonstrated in Fig. 4.6. We start from different points X3beg and X4beg, to demonstrate once again that difficulties with stiff differential equations can arise in any point of integration interval. The initial deviations from the equilibrium solution F(X) are given zero, and we should hope, the solutions remain on the control curve F(X). α ≡ 20 DY( X , Y) ≡ − α ⋅ ( Y − F ( X ) ) X3beg := 0
Xend := 2π
NofSteps := 32
h :=
Y3beg := F ( X3beg )
F ( X3beg ) = 0
Xend − X3beg NofSteps
h = 0.1963
InitCond0 := Y3beg S3 := rkfixed ( InitCond , X3beg , Xend , NofSteps , DY) Ç
È
Ç
X3 := S3 0
È
Y3 := S3 1
________________________________________________________ α = 20
X4beg := 2 ⋅ π ⋅
i_beg := 15
i_beg NofSteps
X4beg = 2.9452
Xend := 2π
Xend − X4beg NofSteps − i_beg
NofSteps := 32
h :=
Y4beg := F ( X4beg )
F ( X4beg ) = 0.1951
h = 0.1963
InitCond0 := Y4beg S4 := rkfixed [InitCond , X4beg , Xend , ( NofSteps − i_beg ) , DY] Ç
X4 := S4
È
0
Ç
Y4 := S4
È
1
Fig. 4.5. Integration using enlarged value of relaxation parameter É
But the result of integration is quite another (see Fig. 4.6). Though the solution remains some time close to the equilibrium curve, but then the deviations grow disastrous because of numerical instability. To show measure of solution instability, it was necessary to select a large scale on a vertical axis. The step should
68 4 Stiff Differential Equations
be considerably reduced for given large value of to receive acceptable results with the rkfixed method. Concerning a step setting at use rkfixed, we need to note that it is difficult to select a priori such an integration step, which would ensure a necessary exactitude of a numerical solution. Therefore, in practice, the integration is conducted with some reasonably selected step and the result is stored. The step is further reduced twice. The difference between new and old results of integration will be good error estimation. Finally, the numerical examples show, that the rkfixed method is poorly applicable for the stiff equations, and we shall pass now to the analysis of a method with an adapted step. Ê
2000
Y3 Y4
0
F ( X)
2000 0
2
4
6
X3 , X4 , X
q.
Fig. 4.6. Instability of solution by large parameter α
4.4
Method rkadapt. Integration Step Problem
The idea of method rkadapt is to change the step automatically, in order to finetune it to the solution character, just as we tried to do “manually” in the previous Sect. 4.3. The argument list of this procedure is as follows: rkadapt ( InitCond , Xbeg , Xend , acc , DY , Nmax , save_int ).
The three additional parameters to rkfixed have the following meaning: o acc – accuracy level; the procedure reduces the step automatically, for the error on each step not to exceed the value of acc, o Nmax – the maximal number of points to be selected for output; if we set Nmax small the output points will be concentrated at the left border of the interval. o save_int – the minimum step for results to be shown in the output.
4.4 Method rkadapt. Integration Step Problem 69
If we set save_int = 0 and Nmax = “very large number” the output array will contain all points in which the solution was calculated, even if they are located very closely to each other. If we take save_int equal to full integration interval, only the end point of solution will be selected for output. The following example shows, how the input data are introduced and how the solution of stiff problem is obtained by rkadapt method (Fig. 4.7). k ≡ 1
F ( X ) ≡ sin ( X ⋅ k)
α ≡ 10
DY ( X , Y) ≡ − α ⋅ ( Y − F ( X ) )
Xbeg := 0
Xend := 2π
InitCond 0 := 4
acc := 0.001
Nmax := 200
save_int := 0
S := rkadapt ( InitCond , Xbeg , Xend , acc , DY , Nmax , save_int ) Ë
Ì
Ë
Ì
Y := S 1
X := S 0
last ( X ) = 29
5
Y F ( X)
0
0
2
4
6
8
X
Fig. 4.7. Integration of stiff problem with rkadapt
The built-in function last, returning the last index of an array, allows finding the number of integration steps (in the example of Fig. 4.7: 29). Apparently, the adapted algorithm copes with the stiff problem. Having treated the fast solution near to initial point, further the program tries to increase the step, but submitting to the requirement to keep the necessary calculation accuracy, leaves the step rather small. Due to this, there is no solution failure (because of numerical instability of explicit method) as it happened in the example with rough manual step magnification (see above Sect. Variant 2). However, there are also shortcomings when using rkadapt with stiff differential equations: in the area of sluggish modification the step should remain small, more or less the same as for a transient phenomenon in an origin of coordinates. If the area of integration would cover hundreds or thousand of periods, the concernment of this shortage would become even more apparent. Let us show now how much more effectively rkadapt works with the conventional, not stiff problem. To make the matching vivid, we shall integrate a secondorder differential equation:
70 4 Stiff Differential Equations
Y = – Y; Í
Y(0) = 0;
Y (0) = 1, Î
whose plain solution is the same function, as for the stiff problem, namely: Y = sin(X). The following Mathcad-sheet shows, how the second-order differential equation is transformed to the system of two first-order differential equations, how the input data are introduced and how the solution of the system is obtained by the rkadapt method (Fig. 4.8). Ï
Ï
Y1 Ð
DY( X , Y) := Ñ
−Y0
0 Ð
ÔÒ
InitCond := Ó
acc := 0.001
Ñ
Xbeg := 0
Ô
Ó
1 Ò
Nmax := 200
Xend := 2π
save_int := 0
S := rkadapt ( InitCond , Xbeg , Xend , acc , DY , Nmax , save_int) Õ
X := S
Ö
Õ
0
Y := S
Ö
1
last ( X ) = 7
2
Y sin ( t)
0
2
0
2
4
6
X,t
Fig. 4.8. Integration of the conventional, not stiff problem with rkadapt
Let us compare Fig. 4.7 and Fig. 4.8. In the conventional problem, a significantly lower number of integration steps (7 vs 29) was required. With higher α = 40, the difference of 7 vs 80 would be even more impressive. 4.5
Method stiffr. Solution of Stiff Model Equation
Let us now compare the explicit adapting method rkadapt with a special method for stiff equations stiffr at integration of the model differential equation (4.2). Conditions of matching will be very harsh – at very large parameter α = 1000. The results for rkadapt and for stiffr are compared in Fig. 4.9 and Fig. 4.10. Number of integration steps for stiffr is rather small (73), rkadapt needs many steps (1685) therefore points on the graph merge in a heavy line. Both methods have coped with a handling of fast transient phenomenon in the origin of coordinates, but the effectiveness of calculations in the area of solutions for slow changes differs strikingly – compare above-mentioned numbers of integration steps (1685 and 73).
4.5 Method stiffr. Solution of Stiff Model Equation
71
The rkadapt method spends uselessly computer time and memory for calculation of sluggish variations with very small step, while the stiffr method proves very capable to be fine-tuned to special character of the desired solution. In Sect. 4.7 we shall discuss an essence of these distinctions, taking into account that the compared procedures are on different sides of a principal watershed in the numerical analysis – of the watershed between explicit and implicit methods. α ≡ 1000 k ≡ 1
F ( X ) ≡ sin ( X ⋅ k )
DY ( X , Y) ≡ − α ⋅ ( Y − F ( X ) )
Xbeg := 0
Xend := 2π
IC0 := 4
acc := 0.001
Nmax := 2000
save_int := 0
S := rkadapt ( IC , Xbeg , Xend , acc , DY , Nmax , save_int ) ×
Ø
×
Ø
Y := S 1
X := S 0
last ( X ) = 1685
5
Y 0
F ( X)
0
2
4
6
8
X
Fig. 4.9. Integration of stiff problem with the rkadapt method Ù
d Ú
J (X , Y) := Û
dX
DY(X , Y)
d dY
DY(X , Y)
ÞÜ Ý
→ ( 1000 ⋅ cos (X ) −1000 )
S1 := stiffr( IC , Xbeg , Xend , acc , DY , J , Nmax, save_int) ß
X1 := S1
à
ß
0
Y1 := S1
à
1
last(X1 ) = 73
5
Y1 F ( X)
0
0
2
4
6
8
X1 , X
Fig. 4.10. Integration of stiff problem with the stiffr method; J(X,Y)– Jacobi matrix (see explanations in Sect. 4.7)
72 4 Stiff Differential Equations
4.6
Method stiffr. Solution of Chemical Kinetics Equations
Let us demonstrate one more example of effective work of the stiffr method – now for a stiff system of chemical kinetics equations [12]: Y0′ = α 0 Y0 − Y0 Y1
(4.5)
Y1′ = − α1 Y1 + Y0 Y0
(4.6)
Decision variables are concentrations Y0, Y1 of two reagents, independent variable is time T. Parameter values are defined by inequalities: α1 >> 1, α0 << 1. Eq. (4.5) describes a slow change of concentration of the 0-component owing to autocatalysis (the first term on the right) and reaction of the 0-component with the 1component (the second term on the right). According to Eq. (4.6), concentration of the 1-component decreases during fast disintegration (first term) and will increase due to a bimolecular reaction (second term). The solution is submitted in Fig. 4.11. DY(T,Y) is the 2-element vector-valued derivative function of equation set (4.5), (4.6); T – independent variable (time); Y = (Y0,Y1) – dependent variable, vector function, whose components Y0 and Y1 are the concentrations of components of reaction mixture. The Jacobian matrix and initial conditions vector are designated accordingly as J(T,Y) and IC. α 0 ≡ 0.02
Tbeg := 0
α 1 ≡ 10 ä á
α 0 ⋅ Y0 − Y0 ⋅ Y1 â
DY ( T , Y) :=
ç
−α 1 ⋅ Y1 + ( Y0)
2
0 α 0 − Y1 −Y0 è
å
J ( T , Y) :=
â
ã
Tend := 50
å
æ
è
é
0
2 ⋅ Y0
−α 1
ìê
ë
ë
ç
0.6 è
IC := é
acc := 0.0001 ì
0.2
Nmax := 2000
ê
ë
S := stiffr( IC , Tbeg , Tend , acc , DY , J , Nmax , 0) í
î
í
î
í
Y0 := S 1
T := S 0
î
Y1 := S 2
1
Y0 Y1
( Y0) 2
0.1
α1
0.01
10
0
10
20
30
40
50
T
Fig. 4.11. Integration of stiff problem of chemical kinetics by stiffr method
4.6 Method stiffr. Solution of Chemical Kinetics Equations
73
Obtained time dependence of reagents concentrations is presented in the diagram of Fig. 4.11. The time history covers a large time space, but at first there is also a very rapid decrease of concentration Y1 on a small time interval ~ 1/ 1. The stiffr method catches this fast change of Y1 (practically the jump) near the origin of coordinates due to the calculation with very small step, and then ensures economical evaluations with large steps in area of slow concentration change. If the rapid phase is not of interest, the mathematical model can be simplified. Instead of a differential equation (4.6) for 1-component the so-called adiabatic approximation can be used obtained by eliminating the left-hand side of (4.6): ï
− α1 Y1, ad + Y02 = 0 , whence follows: Y02 . α1
Y1, ad =
(4.7)
In Fig. 4.11 the coincidence of the “exact” solution (rhombs) and the adiabatic approximation (solid line) is visible after a very short initial phase. The adiabatic approximation is efficiently used for the analysis of complicated nonlinear systems [12]. This example allows us to briefly consider a common definition of stiff problem [13]. It is said, that the system of differential equations is stiff, if eigenvalues of Jacobian matrix strongly differ one from another. Therefore, these eigenvalues are calculated in Fig. 4.12, having applied built-in Mathcad function eigenvals. ó ð
α 0 − Y1 − Y0 ñ
Ja ( Y0 , Y1) :=
ô
ô
ñ
ò
−α 1
2 ⋅ Y0
õ
ó ð
ô
EV 0 ñ
i := 0 .. last ( T)
i
ö
ö
ô
:= eigenvals Ja ÷
ñ
ò
EV 1
õ
÷
( Y0) i , ( Y1) i øù
øù
i
0 EV0 EV1
10
0
10
20
30
40
50
T
Fig. 4.12. Eigenvalues of Jacobian matrix for stiff problem of chemical kinetics
74 4 Stiff Differential Equations
The Jacobian matrix is evaluated from the partial derivatives of DY with respect to dependent variables Y0, Y1. The local eigenvalues are evaluated, that is for serial instants on integration interval. We see that at full solution interval the eigenvalues differ more than an order, therefore, it is the stiff problem. It is simple to show, that at least locally (i.e. on small intervals of independent variable T) the small and large eigenvalues determine respectively the slow and fast solutions as exponential curves: exp(EV0T) and exp(EV1T). In our problem the greatest eigenvalue is approximately equal to parameter α1: EV1 ≈ −α1. 4.7
Explicit and Implicit Methods
Let us consider the elementary model of stiff equation: dY = − αY , dX
(4.8)
with the initial condition Y(0) = 1. The obvious solution is Y = exp(− αX ) . The stiff property will be exhibited, if α >> 1 and if the integration area is extended enough in comparison with interval of fast change 1/α. The finite-difference approximation of (4.8) on an interval h, h = X i − X i −1 , can be written in two different modes: by explicit scheme: Yi − Yi −1 = −α Yi −1 h
(4.9)
Yi − Yi −1 = −α Yi h
(4.10)
by implicit scheme:
The value Yi is to be defined, and the value Yi–1 is known from the initial condition or from the previous solution step. The fundamental difference of the two numerical schemes consists in the method how to define the term on the right: • the explicit scheme uses the known value Yi–1 (value from “the past”) • the implicit scheme uses unknown quantity Yi to be defined (value from “the future”) From these definitions the formulas for required Yi have to be deduced.
4.7 Explicit and Implicit Methods 75
In case of the explicit definition (4.9) there are no problems, since the unknown is present linearly only at the left part. The scheme is named explicit because we have already the expression exposed for Yi . After elementary transformations we shall receive: Yi = Yi −1 (1 − α h ) .
(4.11)
In case of the implicit scheme we solve Eq. (4.10) with unknown Yi and obtain: Yi =
Yi −1 . (1 + α h )
(4.12)
Due to linearity of the original differential equation one can easily resolve the finite-difference approximation (4.10) manually. But if we have a system of equations or/and we have nonlinear equations, we do need a solver for the implicit scheme. However this complication of the implicit scheme is outweighed by its remarkable property – absolute stability during calculation. We demonstrate this by comparative solving of a stiff equation with both explicit (Yexpl) and implicit (Yimpl) schemes, see Fig. 4.13. X 0 := 0
α := 10
h := 0.21
i := 1 .. NofSteps
NofSteps := 10
ý ú
Xi
Yimpl 0 := 1
Yexpl i û
þ
:=
ÿ
Yimpl i
i := 0 .. NofSteps
Yimpl i−1
ü
Yexpl i− 1 ⋅ ( 1 − α ⋅ h)
þ
û
Yexpl 0 := 1
X i− 1 + h
þ
û
1 + α ⋅h
2 Yexpl i Yimpl i
0
exp ( − α ⋅ t)
0.5
1
1.5
2 Xi , Xi , t
Fig. 4.13. Comparative solving of a stiff equation with explicit and implicit scheme
As we see from the graph in Fig. 4.13, the implicit scheme ensures satisfactory consent with the exact solution (compare circles and bold curve), taking into account the large integration steps. On the other hand, the explicit scheme yields a totally useless solution in the form of ghost oscillations with increasing amplitude showing clearly the numerical instability of this scheme.
76 4 Stiff Differential Equations
Instability can be avoided by reducing the step. The stability condition can be obtained from Eq. (4.11). The multiplier on the right-hand side (4.11) must be positive to eliminate the oscillations: 1 – h > 0 or h < 1/ . Thus, the calculation of fast-relaxing solution (α >> 1) requires a very small step ~1/α otherwise the numerical instability arises by using the explicit method. For stiff problems the computation with such small steps must also proceed in the area of slowly-varying solution (for x >> 1/α) as we have seen in above mentioned examples with explicit methods rkfixed, rkadapt. The big expenses of computer time, the apparent difficulties to diagnose oscillations, the aesthetically disagreeable necessity to compute slowly-varying functions by very small steps, all these reservations disqualify the explicit methods for solution of stiff problems. The implicit scheme as it is visible immediately from (4.12), is stable at every (positive) step. Therefore, implicit schemes should be preferred for stiff problems. In research, when the first numerical experiments are made without information about special behavior of a simulated system, the important advantage of implicit schemes are the reasonable, physically correct solutions even at rough scanning with large steps. Effectiveness of implicit schemes is explained by saying that in predicting “an information from the future” is used: the right side term of a differential equation is expressed through even unknown values of dependent variable from the following integration step (see (4.10)). Hereby, both the virtues of algorithm stability, and the complexity of its realization are determined.
4.8
Jacobian Matrix
Now, we have to discuss one more problem of built-in functions stiffr, stiffb, namely the computing of Jacobian matrix J(x,y) from the right side term of a differential equation: dy = f ( x, y ) . dx
The finite-difference approximation with implicit scheme can be written in the form: ∆y = f ( x0 + ∆x, y 0 + ∆y ) ; ∆x
∆ x = x − x0 ;
∆y = y − y0 .
If the differential equation is nonlinear, the linearization of the term on the right will be carried out by means of series expansion in the neighborhood of an initial point x0:
∂ f (x , y ) = f ( x 0 , y 0 ) + f ( x, y ) ∂x
∂ f (x, y ) ⋅∆x + ∂y
x 0 , y0
⋅ ∆y .
x0 , y 0
4.9 Conclusion 77
As all values in point (x0, y0) are known, the linear equation concerning unknown quantity y is obtained, as in our elementary example (4.12). If the system of differential equations of the order (N+1) is decided then the function f, the increment of y, and the derivative of f with respect to must be considered as column vectors with components:
f k ; ∆y k ;
∂f k ; ∂x
k = 0..N ,
and for the set of the partial derivatives of f with respect to dependent variables y a matrix should be used with components: ∂f k ; ∂y m
k = 0.. N ; m = 0..N .
In Mathcad reference system the Jacobian matrix is considered as a rectangular matrix resulting by augment of column vector ∂fk/∂x and square matrix ∂fk/∂ym. Such a matrix is necessary by calling of stiffr, stiffb. In the mathematical literature the Jacobian matrix more often is the square matrix with components ∂fk/∂ym. In numerical algorithms, the linearization is used together with iterations to obtain y. Expansion of f is adapted as follows for iterative procedure:
∂ f (x , y ) = f (x, y (x )) + f (x, y ) ( y − y (x )) , ∂y
there y(x) is the “old” value of y, taken from the previous iteration, is the desired new value.
4.9
Conclusion
The stiff differential equations are frequently met at mathematical simulation of engineering systems (see, e.g. [35, 41, 43, 45]). Practically any sufficiently complicated device or installation is characterized by several strongly differing time constants. On the one hand, there are the fast transient phenomena which arise in the initial phase or in any intermediate state due to random disturbances, errors etc. On the other hand, in a basic regime, the system parameters are usually constant or vary slowly on large time intervals. In other words, the engineering systems often are stiff systems, and special methods must be applied to their investigation. Despite the practical importance of the problem, it is difficult for a student or an engineer to find sufficient teaching material in this field. The Mathcad help system contains hardly anything about the inherent features of the problems to be solved. In this chapter, efficient solutions of such problems with built-in Mathcad instruments have been demonstrated using simple examples. The basic outcome was obtained through analysis of the differential equation of kind (4.2) with large multiplier within the term on the right. It is important here to
78 4 Stiff Differential Equations
emphasize, that the derivative should become very large already at small deviations from equilibrium. If we transfer parameter to the left-hand part, the relation will turn out as differential equation with small parameter at higher derivative:
ε
dY 1 = −(Y − F ( X ) ); ε ≡ → 0 . dX α
Such equations belong to problems from the class of special (singular) perturbations. Their solutions are considered within the framework of perturbation methods [56]. Perturbations parameter approaching zero, the asymptotic solutions are obtained. But formal substitution of limiting value = 0 will result in the depression of the differential equation. In an example with a differential equation of the first order, it changes to an algebraic equation, and an initial condition remains unclaimed. Such collision is resolved by special asymptotic technique, for example, using the method of asymptotic expansions [56]. The application of this method for a singular thermal physics problem with integro-differential equation is described in [15]. The detailed discussion of perturbation methods is not a subject of book. Instead, we use the approach of numerical methods, such as stiffr. The common character of special solutions is clear from Fig. 4.10 or Fig. 4.11. It is obvious, that the equilibrium solution Y = F(X) coincides with the complete solution throughout the range of X definition, except in the neighborhood of singular point X=0, where the initial condition is located (Fig. 4.10). An area of sharp modification is called a boundary layer. Problems with hydrodynamic and thermal boundary layers will be surveyed in Chap. 6. Along with singularities, there are regular perturbations, when the basic nonperturbed solution, uniformly applicable in all ranges of the argument, approaches on the limit = 0. In this case the perturbation technique provides the small corrections necessary for modifying the basic solution. A problem of this class is solved in Chap. 7 in connection with the topic of hydrodynamic instability.
5
Heat Transfer near the Stagnation Point at ross Tube Flow
5.1
Introduction
The most dangerous temperature conditions for steam-superheater pipes in a power plant steam-generator or for blades of gas turbines arise usually in the forward stagnation point S of cross flow where the flow is branching, see Fig. 5.1.
tw(x) x
u∞ (x)
tin
S
W tout
αout(x)
αin
R
δ Fig. 5.1. Heat transfer at cross tube flow
The analysis of local heat transfer under these conditions is a difficult problem, because the flow is accompanied by a variable pressure field, and the thermal boundary conditions on a wall can differ from the often used formulations with constant temperature or constant heat flux. To tackle problems of this kind in engineering practice, e.g. with complex boundary conditions, at flow acceleration or delay, at blowing or suction through transparent walls, an approximate integral method of boundary layer is applied [18, 36, 42, 44, 48]. The mathematical apparatus of the integral method includes the solution of the ordinary differential equations and nonlinear algebraical equations. Mathcad provides all necessary mathematical arsenal for the effective treatment of such problems. We shall give a brief description of the integral method in the following Sect. 5.2. However, being interested only in the computing aspect of the problem, it is possible to go to Sect. 5.3 at once.
80
5 Heat Transfer near the Stagnation Point at ross Tube Flow
5.2
The Integral Equation of a Thermal Boundary Layer
The boundary layer concept is explained in detail in Chap. 6. Before doing so, we start in the following discussion with the general empiric knowledge that the changes of speed or temperature in flow fields usually concentrate within a thin layer near a wall. Therefore, changes of all quantities in cross direction to the wall (on coordinate y) will be very sharp in comparison with longitudinal changes (lengthways x), see Fig. 5.2. The integral equation of thermal boundary layer represents the energy conservation law for special control volume, which covers the thickness of the entire boundary layer, but being differentially small in longitudinal direction. y
u∞
u∞
x
δT** t∞
t∞
tw
tw
δT** Fig. 5.2. Model of thermal boundary layer
The elementary way of the energy equation derivation is based on model approximations of thermal boundary layer in Fig. 5.2. The hot fluid flows along a cool wall. The main-stream velocity and temperature are designated as u∞ and t∞. The heat transfer occurs from the fluid to the wall. The wall is assumed to be permeable to include, e.g. the analysis of protection from a high-temperature stream by means of blowing. In the left part of the figure the real variation of speed and temperature distribution from the wall with tw, uw = 0 to the undisturbed fluid region with t∞, u∞ is shown. The image that is equivalent by enthalpy is represented on the right-hand side of the figure. It is accepted for the model approximations, that all fluid in layer δ ** is cooled down completely to wall temperature tw and that the flow velocity inside this layer remains equal to u∞ down to the wall. It is said, that the fluid loses its excess enthalpy within δ **. With this model, the mass flow of cooled down liquid can be written as ( u∞δ **), and the enthalpy loss per mass unit as (cp(t∞ –tw)). The quantity δ ** introduced to evaluate the excess enthalpy is called enthalpy thickness. This approximation of thermal boundary layer thickness is defined by:
∞
p 0
(t∞ − t( y ) )ρ u ( y ) dy ≡ (ρ u∞ δT ** )(c p (t∞ − tw )) .
5.2 The Integral Equation of a Thermal Boundary Layer
81
On the right side, the model expression of enthalpy loss is presented, and on the left the exact description of this quantity. We accept the elementary relationship between temperature and specific enthalpy dh = cpdt for fluid flow with approximately constant pressure. Thus, according to definition: ∞
ρc p u( y )(t ∞ − t ( y ))dy δT ** =
0
ρc p u ∞ ( t ∞ − t w )
(5.1)
.
After these preliminary remarks, it is possible to formulate immediately an integral equation for energy of thermal boundary layer:
[
]
d ρ u∞ δ T **c p (t ∞ − t w ) = − qw + jw c p (t ∞ − t w ) dx
(5.2)
according to which the enthalpy loss (the left part of the equation) increases at flow of fluid along the cool wall due to: • heat sink to the wall (the first term on the right) and • expenditures on heating of the injected medium jw from tw up to t∞ (the addend on the right-hand side). Such a statement of conservation law is apt for incompressible flows. Note also that for longitudinal (lengthwise x) directions only convective transfer is taken into account, because longitudinal thermal conductivity can be neglected in boundary layer approximation (see Sect. 6.7). Designations in integral equation are decrypted as follows: • (– qw) – the conductive heat flux to the wall (against the y direction), proportional to the temperature gradient near the wall: ∂t fluid qw = −λ fluid y = +0 , ∂y • jw – the mass flux on permeable boundary at blowing through a perforated wall or at mass transfer on interface. The thermal boundary layer equation (5.2) contains two unknown quantities. If surface temperature tw is given as boundary condition, the quantities sought are enthalpy thickness δ ** and heat flux on the wall qw. If qw is given, the quantities δ ** and tw should be found. The necessary padding relation between unknown quantities is set by Eq. (5.8), see below. Let us make following note concerning the mathematical structure of Eq. (5.2). Strictly speaking, it is an integro-differential equation, as the quantity δ ** within the differential is itself an integral from a priori unknown speed and temperature distributions in the boundary layer (see Eq. (5.1)). The efficiency of the integral method results from separately establishing the heat transfer law as algebraic relation (5.8) between integral quantity δ ** and heat flux qw. Due to this, Eq. (5.2) can be solved as an ordinary first-order differential equation.
82
5 Heat Transfer near the Stagnation Point at ross Tube Flow
A stricter derivation of Eq. (5.2) is shown below. Let us start with the energy equation (1.24), written for steady-state problems without internal heat sources:
0 = −div(−λ gradt ) − div(ρwh ) . We have further for a two-dimensional, laminar flow with (u,v) as longitudinal and transverse velocities:
∂ ∂ ∂ (ρuh ) ∂(ρvh ) ∂t ∂t 0= + − λ λ − . ∂x ∂x ∂y ∂y ∂x ∂y "
%
%
"
#
#
#
$
!
$
!
For boundary layer: ∂t ∂t ∂t . << ; q ≈ q y = −λ ∂x ∂y ∂y
The principal part for obtaining an integral equation is the integration over transversal coordinate y: ∂ (ρu(h − h∞ )) ∂ (ρv (h − h∞ )) ∂ dy + dy = − q y dy . ∂x ∂y ∂y 0 0 0
∞
∞
∞
)
,
*
'
&
&
&
*
'
(
+
Enthalpy h must be counted off from h to get convergence of the improper integrals: -
∞
d ρu (h∞ − h )dy − ρv w (h∞ − hw ) = − q y ,w . dx 0 .
Rearranging yields: ∞
d ρu (h∞ − h ) dy = − q y ,w + ρv w (h∞ − hw ) . dx 0 /
Eqs. (5.3) and (5.2) are identical, because qy,w 5.3
qw , vw
jw, h = cp t. 3
1
0
(5.3)
2
0
Mathematical Formulation of the Problem
According to Fig. 5.1, the hot fluid (gaseous products of combustion, in this example) flows perpendicular to the tube containing the cold fluid (steam). Heat is transferred from the hot fluid to the cold through the tube wall (through the heating surface). It is necessary to find the distributions of the exterior heat transfer coefficient αout(x), wall temperature tw(x), heat flux q(x) = –qw. The coordinate x is counted from the stagnation point S of the pipe. 4
4
4
5.3 Mathematical Formulation of the Problem 83
Values of heat transfer coefficient αin and temperature tin of the fluid in the tube are given, as well as temperature tout = t and upstream velocity W for the exterior fluid. For the main-stream velocity outside the boundary layer uinf(x) = u (x) we must still obtain the required distribution (see Sect. 5.4). The mathematical formulation of the problem includes the following equations: Overall heat transfer: 5
5
6
(tout − tin )
q(x ) =
1
α out (x )
+
,
1 αin
(5.4)
where heat transfer resistance of tube wall is neglected. Heat transfer on the external side: 6
q (x ) =
(tout − tw (x )) . 1 α out (x )
(5.5)
Integral equation for the thermal boundary layer on the external side: 6
[
]
d ρ u inf (x ) δTxx (x ) c p (tout − t w (x )) = q(x ) , dx
(5.6)
with δTxx = δT** as enthalpy thickness. Distribution of the main-stream velocity uinf(x) along tube wall: 6
<
9
x ; uinf (x ) = 2W sin R :
7
;
8
x π < . R 4
(5.7)
Heat transfer law for the laminar boundary layer: =
0.22 1 ; Pr 4 / 3 Re Txx u (x ) δTxx (x ) αout (x ) ν St ≡ ; Re Txx ≡ inf ; Pr ≡ , a ν ρ uinf (x ) c p St =
(5.8)
where St is Stanton number, ReTxx is Reynolds number based on enthalpy thickness δTxx as a linear scale, and Pr is the Prandtl number, the ratio of the kinematic viscosity to the thermal diffusivity. It is remarkable for laminar flow that the local heat transfer coefficient varies inversely to the local thickness δTxx of thermal boundary layer (see Eq. (6.27) and associated commentary in Chapt. 6). Boundary conditions in the forward stagnation point following from symmetry of the problem: =
d δ Txx dx
= 0; x =0
d θw dx
=0. x=0
(5.9)
84
5 Heat Transfer near the Stagnation Point at ross Tube Flow >
From now on, we use the excess temperature: θ w ( x ) ≡ t out − t w ( x ) . According to Eq. (5.4), the heat flux is transferred from the hot fluid on the outside to the cold fluid in the tube under the influence of temperature difference (potential drop) passing thermal resistances 1/ αout and 1/ αin. Eq. (5.4) brings to mind Ohm's law for series connection from electrical engineering. The problem is, that exterior thermal resistance 1/ αout in Eq. (5.4) is unknown and that it is a composite function of system geometry, flow velocity, and physical properties of fluid. Mathematical simulation of thermal resistance 1/ αout is a central point of the model calculation considered here. The aim is to find a functional dependence of heat flux q on some argument list including exterior fluid velocity and tube radius. Designers try to increase heat flux to miniaturize the bulky heat exchangers. But the first thing to be ruled out is that wall temperature exceeds the allowable value. Let us remember, that danger is connected to high temperature of an exterior gas flow and to high pressure of pipe steam. As we will show, the problem comes to a numerical solution of the thermal boundary layer equation (5.6) that represents the heat balance for fluid flow near the wall. The term in square brackets on the left is the enthalpy loss of the stream ρuinfδTxx being cooled from tout down to tw. Derivation indicates, that the enthalpy loss will increase along the cool wall, due to heat sink q(x). For a better understanding, it is useful to read Sect. 5.2 once again. Development of heat transfer law (5.8) is treated in Sect. 6.7 of following chapter. 5.4
External Flow Velocity Distribution
From Eqs. (5.6) and (5.8) follows, that we need the velocity distribution at cross flow around cylinders (Fig. 5.1). This can be obtained from solving of the classical problem of inviscid cross flow around cylinders. The complex-valued function defining vector of a complex conjugate velocity as result of potential flow theory is written as: w( z ) = 1 −
1 , z2
(5.10)
where z = x + iy, i – imaginary unit, x,y – coordinates. Let us set a square grid and calculate the longitudinal and cross velocity components for an area outside of a circle with unit radius, with help of intrinsic function if, as shown in Fig.5.3. To chart a vector field it is necessary to call the Mathcad menu Insert, Graph, Vector Field Plot and to insert – instead of a placeholder – the designation of arrays (U,V) assigning velocity projections, as shown in Fig. 5.4.
5.4 External Flow Velocity Distribution 85
1
w( z) := 1 −
2
z n := 10
i := 0 .. n
j := 0 .. n
?
?
@
xi := i − A
n 4 ⋅ 2 n DB
@
yj := j −
C
A
n 4 ⋅ 2 n BD
zi , j := xi + i ⋅ yj
C
Ui , j := if ( zi , j ≥ 1 , Re ( w( zi , j) ) , 0) Vi , j := if ( zi , j ≥ 1 , −Im( w( zi , j) ) , 0)
w
Fig.5.3. Calculation of velocity vector field in Mathcad
( U , V)
Fig. 5.4. Ideal cross flow around a cylinder Uinf ( X ) ≡
if X <
sin ( X )
π 4
E
π F
sin G
HJ
4
I
otherwise
1 Uinf ( X) sin ( X)
0.5
0
0
1 X
Fig. 5.5. Velocity distribution near the forward stagnation point
86
5 Heat Transfer near the Stagnation Point at ross Tube Flow >
At high velocities, the real flow on leeward side differs from this picture strongly due to separation of the boundary layer, approximately on the cylinder midship (Fig. 5.1). However, in the frontal part the inviscid flow yields good representation for a substantial stream. The assumption that the boundary layer is very thin allows calculating uinf(x) as velocity of inviscid flow immediately on tube contour. By employing (5.10) for points on the tube surface the sine function is obtained (Fig. 5.5). Operator if, however, confines use of this solution only to the area around the stagnation point. 5.5
Analysis for the Stagnation Point
For forward stagnation point x = 0, the simple, but rather bulky (if manually done) analytical transformations result in following formulas: StW 0 ≡
1 αout (0) 0.938 = 2/ 3 ρ W c p Pr 2R W ν N
M
K
P
O
1/ 2
;
δTxx (0) 1 = StW 0 . 2 R
(5.11)
L
The development of these formulas is shown in Fig. 5.6. The necessary calculations on the Mathcad-worksheet including derivations, substitutions and identical transformations for simplification of outcomes, was made by symbolic Mathcad processor, also a great time-saving tool. Let us briefly describe these symbolic computing processes. The idea of the first stage of analysis was to write the differential equation (5.6) immediately for stagnation point x = 0 and to receive a relationship between boundary layer thickness and heat transfer coefficient at this point. Consecution of analytical transformations of Eq. (5.6) is demonstrated in the upper part of Fig. 5.6. First two substitute operators fulfill the substitution of binomial series 0. Such expansion for temperature and boundary layer thickness at x decomposition follows from the boundary conditions (5.9), according to which the first derivative in the stagnation point comes to zero. The third operator orders to make evaluations exactly at the stagnation point x = 0 The fourth operator realizes the substitution of Newton–Richman law Operator factor makes a possibility obvious to cancel quantity W (0) The solve operator decides the equation for out(0) received as a result of preceding operations. The outcome is shown in the next line of this fragment. At the second stage (lower part of Fig. 5.6) the formula for out(0) is considered together this Eq. (5.8). The system for unknowns out(0) and txx(0) is again solved with symbolic processing. The outcome is returned as matrix of roots. Only two positive radicals have physical meaning, and they are finally submitted by formulas (5.11). Q
R
Q
Q
Q
Q
S
T
T
T
U
5.5 Analysis for the Stagnation Point 87 V
x uinf ( x) ≡ 2 ⋅ W ⋅ sin R W
X
Y[
Z
2
substitute , θ w ( x)
d dx
δ Txx( x) ⋅ θ w ( x) ⋅ uinf ( x) −
θ w ( 0) + a ⋅ x
2
substitute , δ Txx( x)
q ( x)
substitute , x
ρ ⋅ cp
δ Txx( 0 ) + b ⋅ x
→
0
substitute , q ( 0)
α out ( 0 ) ⋅ θ w ( 0 )
factor solve , α out ( 0 ) 2 ⋅ δ Txx( 0 ) ⋅ W ⋅ ρ ⋅
cp R
_____________________________________________________ V
V
W
α out ( 0 ) W
2 ⋅ δ Txx( 0 ) ⋅ W ⋅ ρ ⋅
cp
α out ( 0 ) W
Y
solve , Z
R
δ Txx( 0 )
W
W
W
X
α out ( 0 )
0.22 ⋅ c p ⋅ ρ ⋅ ν δ Txx( 0)
⋅ Pr
4 − 3 Z
.663 ⋅
Z
→
simplify Z
Z
]
]
Z
[
[
\
]
Y
W
X
Z
( W ⋅ ν ⋅ R)
]
Pr ]
1 2
2 3
_
⋅ρ ⋅
cp R
.331 ( W ⋅ ν ⋅ R) ⋅ 2 W
`
1 2 `
`
`
`
Pr
3 `
]
]
]
− .663 ⋅ ]
( W ⋅ ν ⋅ R)
]
^
Pr
2 3
1 2
`
⋅ρ ⋅
cp R
− .331 ( W ⋅ ν ⋅ R) ⋅ 2 W Pr
3
1 2 `
`
`
a
Fig. 5.6. Development of formula for heat transfer coefficient in cross flow stagnation point
In further calculations (see Sect. 5.6), both of these values are used as convenient scales for reduction of the equations to a dimensionless form. Eqs. (5.11) allow to calculate the heat transfer coefficient and thermal boundary layer thickness at the stagnation point, starting from specified values of approach flow velocity, tube radius R and fluid properties. Numerical examples are given in Fig. 5.7. The wall temperature is calculated from the relationship obtained by termwise division of the formulas (5.5) and (5.4). Thermal properties (density, heat capacity, kinetic viscosity, Prandtl number) are received from reference data tables for combustion gas at temperature 1000°C.
88
5 Heat Transfer near the Stagnation Point at ross Tube Flow b
Let us note, that properties should be selected at average temperature in boundary layer. Therefore, more exact accounts need an iterative procedure: after definition of the wall temperature the physical parameters must be updated and the calculations will be repeated. Graphs yield useful information for the designer. For example, it is well visible, that the increase of flow velocity may result in overheating of the wall. The influence of the tube radius as geometrical parameter is also reflected in the diagrams. ρ := 0.26 ⋅
kg m
cp := 1300 ⋅
3
J kg ⋅ K
ν := 174 ⋅ 10
2 −6 m
⋅
s
Pr := 0.58
°C := 1 ⋅ K tout := 1200 ⋅ °C
tin := 500 ⋅ °C
α in := 200 ⋅
watt 2
m ⋅K
0.938
α out_0( W , R) := ρ ⋅ cp ⋅ W ⋅ 2 3
1 2
c
Pr ⋅
2 ⋅ R⋅ W d
e
hf
g
ν 1
(
)
tw ( W , R) := tout − tout − tin ⋅
W := 1
m m .. 30 s s
α out_0( W , R)
1 1 + α out_0( W , R) α in
R1 := 0.01m
R2 := 0.02m
300
( ) α out_0( W , R2) α out_0 W , R1
(
R3 := 0.03m
1000
( ) tw ( W , R2) tw ( W , R3) tw W , R1
200
)
α out_0 W , R3 100
800
600
0
0
10 20 30 W
0 10 20 30 W
Fig. 5.7. Heat transfer coefficient out_0(W,R) and wall temperature tw(W,R) in cross flow stagnation point as functions from approach flow velocity W, for various tube radii R i
j
5.6 Dimensionless Formulation
5.6
89
Dimensionless Formulation
We return now to the main problem – calculation of circumferential distribution of thermal characteristics on the tube. Preliminary simple operations of variable scaling, which we omit, result in the dimensionless formulation, including: the differential equation for the dimensionless enthalpy loss H (obtained from (5.6)): k
d H (X ) = Q (X , H ); dX H (0) = 0
(5.12)
and the set of algebraical equations (5.13), (5.14), and (5.15), which establishes a functional dependence Q(X,H) for the right-hand side of Eq. (5.12) and encloses again: expression for enthalpy loss H through the given speed distribution Uinf (see below (5.19)) and unknown dimensionless values of enthalpy thickness D (see (5.18)) and thermal head T (see (5.16)): k
H = U inf (X ) D T
(5.13)
the overall heat transfer equation, including given numerical parameter R (obtained from (5.4) and from (5.18)): k
Q= k
1 D + Rα
l
(5.14)
the outside heat transfer equation (obtained from (5.5) and from (5.18)): Q=
T . D
(5.15)
The dimensionless dependent variables are determined through appropriate dimensional quantities by following equations. Dimensionless thermal head “external flow – wall”: T=
t − t (x ) θw (x ) = out w tout − tin t out − t in
(5.16)
1 q( x ) ρ c p W (tout − tin ) St w0
(5.17)
Dimensionless heat flux: Q=
Dimensionless (relative) thickness of thermal boundary layer and also reciprocal of relative heat transfer coefficient (as to this, see also the comment to Eq. (5.8) for heat transfer law in the laminar boundary layer):
90
5 Heat Transfer near the Stagnation Point at ross Tube Flow b
δ (x ) α out (x ) D ≡ txx = δ txx (0) α out (0)
−1
r
o
p
m
p
m
q
n
.
(5.18)
Dimensionless parameters and given functions are determined by the following formulas. External flow velocity distribution: U inf ( X ) =
uinf (x ) 2W
(5.19)
Ratio of heat transfer coefficients: α out (0) = Rα . αin
(5.20)
Rα is the single numerical parameter of the dimensionless problem. With growth of this parameter, the wall temperature will approach the high temperature of external heating and can exceed an allowable limit. 5.7
Optimization Algorithm for the Right-Hand Side
For numerical integration of (5.12), the built-in Mathcad functions can be used, e.g. rkfixed, rkadapt, Odesolve. But previous to that it is necessary to design the user function Q(X,H) for the right-hand side of (5.12). The problem is, that there is no explicit expression for Q(X,H). To define this function, we should develop a special program to solve the nonlinear set of equations (5.13), (5.14), (5.15). The appropriate program unit written in built-in programming language Mathcad is presented in Fig. 5.8. Solution of the nonlinear system (5.13)–(5.15) is organized by minimizing user’s function F with the help of built-in Mathcad function Minimize. Function F (Q,T,D,X,H,R ) is constructed in such a way that • F becomes zero if variables Q, T, D satisfy the set of equations (5.13)– (5.15) at given values X, H, R , • F grows unbounded when variables Q, T, D move away from the solution of this system. Further we create the new user function Mini() with the complete list of parameters that call the built-in function Minimize: s
s
Mini(Q,T,D,X,H,R ) := Minimize(F,Q,T,D). t
In the argument list of Minimize there is the goal function F and objective variables Q,T,D.
5.8 Numerical Integration with Built-in Function Odesolve 91 u
u
π π , sin ( X ) , sin Uinf ( X ) ≡ if X < 4 4 v
v
w
w
F ( Q , T , D , X , H , Rα ) ≡
zx
y
zx
y
eq1 ← H − Uinf ( X ) ⋅ D ⋅ T eq2 ← Q −
T D
eq3 ← Q −
1 D + ( Rα )
2
2
eq1 + eq2 + eq3
2
Mini ( Q , T , D , X , H , Rα ) := Minimize ( F , Q , T , D ) RH ( X , H) :=
D0 ← 1 Q0 ←
1 D 0 + Rα
T0 ← Q0 ⋅ D 0 Mini ( Q0 , T0 , D 0 , X , H , Rα )
Q ( X , H) := RH ( X , H) 0
Fig. 5.8. Program unit for definition of right hand side of differential equation (5.12)
The user function RH assigns an initial estimate as set of varied parameter values Q0,T0,D0 in the stagnation point and call function Mini() described above. RH is vector function with following components: the dimensionless heat flux Q, the dimensionless thermal head T, the dimensionless enthalpy thickness D. Thus, the last line of program fragment in Fig. 5.8 sets the right hand side of differential equation (5.12) as RH component with index zero. 5.8
Numerical Integration with Built-in Function Odesolve
Now it is possible to call the built-in function Odesolve for numerical integration of differential equation (5.12) and to present results graphically, as shown in Fig. 5.9. Using the obtained solution for enthalpy loss H, we finally calculate and represent graphically the circumferential distributions of the normalized (relative) values of heat transfer coefficient on the outer tube surface, heat flux and temperature difference “exterior stream – wall” as is done in Fig. 5.10. Index “rel” in designations in Fig. 5.10 indicates that values are referred to an appropriate scale and are dimensionless. The dimensionless heat flux qrel(X) (or Q) is connected to basic heat flux q(x), W/m2 with formula (5.17). In Fig. 5.10, the user function Q(X,H) from program block in Fig. 5.8 is applied to calculate qrel(X).
92
5 Heat Transfer near the Stagnation Point at ross Tube Flow {
Rα ≡ 1 X start := 0
X fin := 1.57
Given
d H( X) dX
H ( X start )
Q ( X , H ( X) )
0
H := Odesolve ( X , X fin) 1
H( X)
0.5 0
0
1
2
X
Fig. 5.9. Numerical integration of the thermal boundary layer equation
The relative heat transfer coefficient on the tube defined as α rel ( X ) =
αout (x ) αout (0)
is calculated using Eqs. (5.18) and (5.14). The resulting formula α rel =
qrel 1 1 Q = = = 1 1 − Rα Q 1 − Rα qrel D − Rα Q
allows calculating the distribution rel(X) by means of qrel(X). The dimensionless temperature difference defined by (5.16) as |
∆ t rel = T =
is evaluated from qrel and |
rel
tout − t w (x ) tout − tin
using (5.15):
T = QD =
q Q = rel . α rel α rel
As can be seen from Fig. 5.10, the greatest intensity of heat transfer on the front side of the tube is reached in the stagnation point x = 0. Also the temperature difference between the hot exterior flow and the tube wall is minimal here, i.e. the wall temperature tw is closest to the high temperature tout. Therefore, we find the most dangerous conditions for the tube material in point x = 0.
5.9 Conclusion 93 X := 0 , 0.1 .. 1.57 qrel ( X ) := Q ( X , H ( X ))
α rel ( X) :=
qrel (X ) 1 − Rα ⋅ qrel ( X)
∆trel ( X) :=
qrel (X ) α rel ( X )
1 α rel ( X) qrel ( X)
0.5
∆trel ( X)
0
0
0.5
1
1.5
X
Fig. 5.10. Distributions of the normalized values of heat transfer coefficient on the tube, heat flux and temperature difference
Let us notice, that the considered model for local heat transfer is fair for laminar boundary layer, within the area from the forward stagnation point up to a separation point or up to transition to turbulence. Furthermore, the local heat transfer maximum found at the stagnation point is a global maximum for the whole tube surface only with the restriction of not too high Reynolds numbers 2RW/ . }
5.9
Conclusion
The problem considered is connected to the reliability of high-temperature heating surfaces such as the steam superheater in thermal power stations. It is commonly satisfied by calculating the average wall temperature for comparison with permissible temperature for tube material. Such elementary calculations can be carried out using the following simple formulas for heat transfer: q=
(tout − tin ) 1 1 + αout αin
;
q=
(tout − tw ) , 1 αout
in which all values are considered as surface-averaged, or circumferentially constant. If the safety factor is selected small, however, an emergency situation is probable, when the average wall temperature will be below the permissible, but the maximum one will be higher. Therefore, to increase the reliability of superheater performance, it is necessary to calculate the circumferential distribution of heat transfer, as we did in our design. The differential model was necessary for calcula-
94
5 Heat Transfer near the Stagnation Point at ross Tube Flow ~
tion of local temperature. Evidently, Mathcad is the efficient instrument for such a complex problem. Under computational aspects, the central point of the model was integration of an ordinary differential equation. Mathcad provides the whole set of built-in functions for numerical integration. Therefore, no computational difficulties should arise for such a problem. Nevertheless, for the beginner the following collision may appear difficult: • In educational examples of manuals, the right-hand sides of differential equations are always represented by simple analytical expressions. • In engineering practice or scientific research, the right-hand sides of differential equations are represented as complex algorithms realized in the form of program modules, but not as analytical expression (see also [46,53]). Therefore, we thought it to be useful to demonstrate the operation of the typical structures of the Mathcad program for the solution of a real problem with differential equationes, whose right hand side is realized in the form of an optimization algorithm.
6
The Falkner–Skan Equation of Boundary Layer
6.1
Introduction
The Falkner–Skan equation [4] f ′′′ + f f ′′ + β (1 − f ′ 2 ) = 0
(6.1)
with boundary conditions η = 0;
f (0) = f w ;
f ′(0) = 0; (6.2)
η → ∞;
f ′(∞) → 1 ,
describes the class of so-called similar laminar flows in boundary layer on a permeable wall (Fig. 6.1) and at varying main-stream velocity. The dependent variable f is a dimensionless stream function, the independent variable η is a dimensionless distance from the wall, a so-called similarity variable. The first derivative of f with respect to η, i.e. f ', defines the dimensionless velocity component in x-direction, the second one, i.e. f'' defines the dimensionless shear stress in the boundary layer. Solutions of the boundary problem defined by Eqs. (6.1), (6.2) create the theoretical background for the analysis of friction resistance and heat or mass transfer for the following practical problems: flows along curvilinear profiles, such as gas turbine blades or airplane wings, flows on permeable (perforated) surfaces with blowing or suction, flows with condensation or evaporation on interfaces, flows with intensive catalytic reactions on a wall.
y
u∝
δ (x) v(x,y=0)
x
Fig. 6.1. Velocity boundary layer on permeable wall
96
6 The Falkner–Skan Equation of Boundary Layer
The mass-transfer parameter fw in the boundary condition sets the measure for the mass flow rate through the wall boundary in either direction. Positive values determine flows with suction, negative with blowing (Fig. 6.1) through the wall boundary. The zero value corresponds to flow along impermeable wall with zero mass transfer. The numerical parameter β (positive or negative) in the Falkner–Skan equation sets a degree of acceleration or deceleration of main stream. The flows with zero value for this parameter will be considered, i.e. the flows without longitudinal pressure gradient in main stream. The Falkner–Skan equation (6.1), together with similar Eq. (6.22) for thermal boundary layer (see Sect. 6.7), constitute the theoretical basis of convective heat and mass transfer. Both ordinary differential equations (6.1) and (6.22) mentioned above are obtained from more common partial differential equations of pulse and energy transport (1.32)–(1.35) using two fundamental ideas: boundary layer and similarity transformations. 0) fluids flow over body sur1. Boundary layer. When low-viscous ( / faces, the cross changes of velocity should be concentrated within a boundary layer near the wall so that the viscous force might ensure the necessary deceleration (loss of pulse) of main stream from u∞ down to zero at the wall, as can be shown by estimations of order in continuity and motion equations from Sect. 1.4:
∂u ∂v = 0; + ∂x ∂y u v x δ
v≈
δ u∞ x
(6.3)
∂u ∂u ∂p ∂ 2u ∂ 2u + ρv = − +µ +µ µ ∂x ∂y ∂x ∂x 2 ∂y 2 2 u u ρu ∞ ∞ ρ u ∞ δ u ∞ ρu ∞ µ u∞ d µ ∞ x x δ x x2 δ2 µ u∞ u u2 u∞ ∞ ≈ ∞ + ρ δ2 x x ρu
(6.4)
δ ≈ x
1 u∞ x ν
Here, we assume ( / ) 0, but not vanishing entirely, because the viscous force O( u / ) should exist in our problem, to ensure adhesion to the wall. This is rel0, << x. ized by very thin boundary layer
6.1 Introduction
97
An unacceptable alternative would be to generally neglect viscosity forces. Thus the second (i.e. the higher) derivatives would vanish. The mathematical degree of differential equation would be depressed, and the zero velocity condition on the wall could not be realized. From (6.4) apparently follows that the indistinct expression about “lowviscosity” fluid may be replaced by the stricter statement about flows in the asymptotical case of large Reynolds numbers Rex ≡ u∞x/ν >> 1. From (6.3), (6.4) the asymptotical simplified equations for velocity boundary layer follow: ∂u ∂v + = 0; ∂x ∂y u
(6.5)
1 dp ∂ 2u ∂u ∂u =− +v 2 . +v ∂y ρ dx ∂x ∂y
(6.6)
Within the limits of boundary layer δ/x << 1 (Fig. 6.1), the longitudinal velocity u quickly varies from u∞ down to zero on the wall, and transversal velocity v remains very small, v << u∞. The pressure variation over the cross-section can be neglected; only its longitudinal changes have to be taken into account. The following differential equation for thermal boundary layer is derived from energy equation (1.35) in an analogous manner:
u
∂ 2t ∂t ∂t =a 2; +v ∂y ∂x ∂y
a≡
λ . ρc
(6.7)
2. Similarity transformation. Now, similarity transformation allows us to proceed from partial differential equations to ordinary differential equations. Two independent variables x and y are combined into a unique independent variable = y/ (x), where (x) represents boundary layer thickness (Fig. 6.1). Thus, the similar variable is the distance from the wall, measured on the scale of boundary layer thickness. After entering a flow function as new dependent variable, such that
u=
∂Ψ ∂Ψ ; v=− , ∂y ∂x
the continuity equation (6.5) is automatically satisfied. The meaning of the new variable becomes clear by looking at relationships: y
d Ψ = u dy by x = const , Ψ = u dy , 0
according to which the flow function determines a fluid flow rate within the limits of the boundary layer.
98
6 The Falkner–Skan Equation of Boundary Layer
The scale for Ψ may be u∞δ, where boundary layer thickness δ, as we saw earlier (Eqs. (6.4)), is evaluated as: δ ≈ x
1
.
Re x
So, the idea is to proceed from variables u(x, y), v (x, y) to similar variables ( /(u ), ). The efficiency of such replacement depends not only on differential equations, but also on the structure of the boundary conditions. Generally, at the exterior boundary the distribution of main-stream velocity u (x) must be prescribed, as well as the cross mass flow rate at the wall boundary, also as function of x. In some cases (for example, at the power-behaved change of main-stream velocity, at the cross mass flux as reciprocal square root from x, at the power-behaved change of temperature drop in heat transfer problems), similar (automodel) solutions of such boundary problems can be obtained. Let us briefly write the designations for similar flows:
u∞ = c ⋅ x m ,
where m≡−
dP x /(ρ u∞2 ) dx
is modified Euler number. Parameter β in Falkner–Skan equation is connected to Euler number by: β=
The similar variable given as: η= y
2m . m +1
and the dimensionless stream function, f = 1 du∞ ⋅ ; νβ dx
f =
Ψ u∞
/(u ), are
1 du∞ ⋅ . νβ dx
Thus, due to asymptotic model of boundary layer and to similar transformations, the complicated original formulation (1.32)–(1.35) with partial differential equations is reduced to the ordinary differential equation problem (6.1), (6.2). However, even being the result of essential simplifications, the Falkner–Skan equation remains a complicated mathematical object, due to nonlinearity and boundary conditions mode [22, 54]. We will show now, that Mathcad provides the efficient tools to solve such complex problems. In addition, our educational purposes are: solution of the applied problem and elaborate the necessary technique. It is important to understand, how the velocity and temperature fields near the wall are established, how the flow resistance and heat transfer rate are to be calculated and how the process can be controlled. We shall reach this goal by varying
6.2 Model Construction 99
control parameters, such as main-stream velocity, properties of fluid, rate of blowing or suction, and representing the results visually. The principal technique issue will be the numerical solution of a two-point boundary problem for the system of ordinary differential equations using the builtin Mathcad function sbval. The design infrastructure includes integration with methods rkfixed and odesolve, evaluation of the radical by root, interpolation by cspline, interp, matrix operations with stack, matrix, etc. 6.2
Model Construction
As velocity profile and shear stress, i.e. the first and second derivatives f, are of main interest, it is expedient to present differential equation (6.1) of the third order as a system of three first-order differential equations. The required function, its first and second derivatives are considered as components of vector-function (F0, F1, F2). After apparent substitutions: ∂ ∂ f = F0 = F1 ; ∂η ∂η
∂ ∂2 f = F1 = F2 ; ∂η ∂η2 f = F0
∂ ∂3 f = F2 ; ∂η ∂η3
we receive the vectorial equations (6.8) instead of (6.1): ∂ F = D (η, F ) , ∂η
(6.8)
where the dependent variable and the right-hand side are defined as vector functions:
F0 F = F1 ;
F1 F2
D (η, F ) =
F2
.
(
− F0 F2 − β 1 −
F12
)
(6.9)
Because this system of differential equations is nonlinear (contains quadratic terms F0⋅F2 and F12), numerical integration is required. Boundary conditions (6.2) should be rewritten in new denotations as follows: F0 (0) = f w ;
F1 (0) = 0 ;
F1 (∞ ) = 1 .
(6.10)
The first of these conditions represents the mass flux through the wall boundary. The quantity fw is the given numerical parameter. The second condition sets longitudinal component of velocity to zero at the wall (at η=0) corresponding to the fundamental adhesion condition.
100 6 The Falkner–Skan Equation of Boundary Layer
The third condition determines the longitudinal velocity on infinity as the mainstream velocity outside the boundary layer. At numerical integration, this condition is given on some large enough, but finite coordinate η, η=ηinf, such that its further increase does not result in any deformation of velocity profile. That can be achieved during several trial numerical experiments. One can also formalize the selection ηinf so that the computational program itself would determine the necessary value of exterior boundary ηinf, satisfying the given calculation accuracy. The purpose of further calculations is to obtain the flow field near the wall by different values of parameter fw : negative, appropriate to blowing (or to evaporation), and positive for suction (or condensation). As to the second parameter β, we shall limit our further investigation to its zero value, i.e. with zero velocity-gradient in the main stream outside the boundary layer. By numerical integration of system (6.8), the functions F0(η), F1(η), F2(η) will be obtained. Then the flow field in physical coordinates x,y should be calculated and graphically represented, and also shear stress at the wall, i.e. hydrodynamic resistance is evaluated. Relationships between physical variables (i.e. longitudinal u(x,y) and transversal v(x, y) components of velocity, flow function ψ(x,y)), on the one hand, and similar Falkner–Skan variables (i.e. the dimensionless flow function f(η) and the dimensionless distance from wall η) on the other, are given by following formulas: Longitudinal velocity: U=
u ∂ = f = F1 . u∞ ∂η
(6.11)
Transversal velocity: £
v = V = u∞
ηF1 − F0 ∂ f − f = η . ∂η 2 Re L X 2 Re L X 1
¡
¡
¢
(6.12)
By zero value for η, eq. (6.12) determines connection between flow function at the wall and blowing or suction velocity: v = u∞
1 2 Re L X
(−
fw) =
− F0,w 2 Re L X
.
(6.13)
The second derivative calculated at the wall yields the friction coefficient:
cf 2
=
τw ρu∞2
µ =
∂u ∂y
w
ρu∞2
=
f w'' 2 Re L X
=
F2,w 2 Re L X
.
(6.14)
6.3 Boundary-Value Problem. Method sbval
The self-similar variable
101
¤
η=
Y X 2 Re L
. (6.15)
is evaluated by means of physical coordinates (x, y). The dimensionless flow function f (or F0) is connected to the original flow function ψ by: f =
Ψ Re L . u∞ L 2 X
(6.16)
Formulas (6.15), (6.16) are obtained for the case of constant main-stream velocity. The common relations for the similar variables ( , f) have been given at the end of Sect. 6.1. Let us remember the physical meaning of flow function: ¤
¥
ψ 2 − ψ1 =
y2 y1
u dy ,
(6.17)
saying that the difference of values on two streamlines in a stream cross-section is equal to the volume flow (Fig. 6.5). Reynolds number is determined by distance parallel to the wall L: Re L =
u∞ L . ν
Physical coordinates (x, y) are normalized by reference to length L: X=x/L, Y=y/L.
6.3
Boundary-Value Problem. Method sbval
Boundary conditions (6.2) for the Falkner–Skan equation are given on both borders of integration interval: at the wall, η = 0, and far from it, at η → ∞, in fact, however, in some large, but finite distance η = ηinf. In other words, it is necessary to decide a boundary problem, or as it is sometimes called, two-point boundary problem. Numerical algorithms for such problems are more complicated than for an initial problem when all boundary conditions are given in an initial point. For initial problems, the computational mathematics disposes of efficient numerical methods. The Runge–Kutta process with the fixed or adapted step is mostly used. It can be applied, reducing the boundary problem to the integration of series of initial problems with trial values of missing initial conditions in initial point. Then, in end point, one can measure the “distance” between calculated
102 6 The Falkner–Skan Equation of Boundary Layer
(trial) value of dependent variable and the one prescribed by boundary condition, and then judge the success or failure of each such attempt. The analogy to shooting becomes obvious when the aim is adjusted by distance of the hit from the target. The numerical method, grounded on this analogy, is named “shooting method”. Let us discuss this idea more concretely with reference to our problem. At initial point, two conditions are given, i.e. values F0(0) and F1(0). Missing initial condition is value F2(0) in initial point, instead of this the value F1(ηinf) = 1 at end point is given. The initial problem can be solved with initial condition F2(0) = ξ, where ξ is trial value taken by guess. As a result, some value F1,inf will be obtained at the end point. It is unlikely that the correct value F1,inf =1 will be received after first integration already, but obtained value can be considered as function of trial initial ξ. Now it is clear how to proceed further. There are two options: • To solve equation F1,inf (ξ)−1=0, for example, by secant method, realizing that trial values F1,inf (ξ) are not evaluated by simple substitution in some formula, but are obtained by numerical integration of a system of differential equations • To minimize the discrepancy (F1,inf (ξ)−1)2 → 0 using any optimization algorithm, for example, the coordinatewise optimization, or the simplex Nelder–Mead method, or any other available method. In Mathcad there is a built-in function sbval that helps to find the missing conditions at initial point. We do not really know the interior structure of this function, but apparently, it works on one of the versions mentioned above. In Mathcad reference system the title sbval is decrypted as follows. The part “bval” corresponds to “boundary value”. Character “s” means “shooting method”. As users, we can be content with this common view, but we should know how to write the call to this function (Fig. 6.2). As soon as the missing initial value will be returned by sbval function, the initial problem can finally be solved with the numerical method (for example, rkfixed). The set of numerical parameters in our example will be as follows: Numerical parameter of problem giving acceleration of main stream: β=0 (for uniform main stream) Numerical parameter of problem giving blowing (fw<0) or suction (fw >0): fw=0 (zero mass flux through the wall boundary) The fixed zero value of coordinate at the wall (service parameter): ηw=0 The numerical parameter giving exterior boundary(service parameter): ηinf =6. Use of built-in function sbval is demonstrated in Fig. 6.2. The sequence of operations is as follows: The parameter values are entered, the right-hand side (6.9) of equation set (6.8) is written The vector of initial conditions according to (6.10) is created by user's function SetInit ¦
¦
¦
¦
¦
¦
6.4 The Solution of the Initial Problem. Method rkfixed 103 ¦
¦
¦
The trial value of the second derivative at η=0 is entered as component of vector with zero index ξ0. In other problems, more than one initial condition may be missing, therefore ξ should be vector. User's function discrepancy evaluates the discrepancy at the end point of integration interval (F1–1). It should be equal to zero, see (6.10). Function call sbval is written, and the output, i.e. the missing initial condition, is introduced in vector MissingInitCond. We shall remember, that this missing condition is the value of the second derivative at the wall, i.e. F2(0). β := 0
η w := 0
η inf := 6
§
F1 «
D ( η , F) :=
© ¬
¬
«
F2 ¬
«
§
¨
−F0 ⋅ F2 − β ⋅ 1 − ( F1) ¨
fw := 0
2 ©ª
ª
ξ 0 := 0.1 °
(
)
±
®
SetInit η w , ξ :=
0 ®
¯
(
±
fw ®
ξ0
±
²
)
discrepancy η w , F := F1 − 1
(
MissingInitCond := sbval ξ , η w , η inf , D , SetInit , discrepancy
)
MissingInitCond = ( 0.4696 )
Fig. 6.2. Application of built-in function sbval returning the missing conditions at initial point (F2(0) = 0.4696 in case of zero mass transfer)
6.4
The Solution of the Initial Problem. Method rkfixed
As all initial conditions are known now, it is possible to call any built-in function of numerical integration, for example rkfixed (Fig. 6.3). Parameters of this function are: vector of initial conditions InitCond, coordinates of initial and end points, number of integration steps N and vector function of right-hand sides of system of differential equations. We shall remark, that the fragment of evaluations in Fig. 6.3 is the prolongation of the Mathcad document in Fig. 6.2, where the right-hand side D was already submitted.
104 6 The Falkner–Skan Equation of Boundary Layer
(
InitCond := SetInit η w , MissingInitCond InitCond
T
= ( 0 0 0.4696 )
(
η := S
)
S := rkfixed InitCond , η w , η inf , N , D
N := 200 ³
)
´
³
0
´
f := S
1
(
T
T
Uarray := stack U , U
³
U := S
´
2
³
Stress := S
´
3 µ
)
Zero ( i , j) := 0 V as_0 := matrix ( rows ( Uarray ) , cols ( Uarray ) , Zero )
fw = 0
( Uarray , V as_0 ) Fig. 6.3. Longitudinal velocity distribution in the boundary layer on an impenetrable surface
The output of integration is returned as array S, the column vectors of which are independent variable , dimensionless flow function f, longitudinal component velocity U and shear stress, as shown in line 4. The velocity profile is constructed in such manner that the wall is identified by the horizontal coordinate, and the stream is considered moving from left to right. On vertical axis the dimensionless distance from the wall and on horizontal axis velocity U are represented. It deserves attention that the graph in Fig. 6.3 is constructed as Vector Field Plot but so many horizontal arrows of velocity are drawn, that they merge creating the black area as distribution diagram. The last three lines above the diagram in Fig. 6.3 produce the data arrays required for diagram by built-in Mathcadfunctions stack and matrix. In Fig. 6.3, the classical velocity profile is shown in boundary layer on impermeable surface without cross mass flow through the wall. In the following, the calculations for permeable surface will be carried out, and we shall see, how blowing or suction control the velocity profiles in boundary layers. But beforehand, we present the output in two different manners (Fig. 6.5). At first, we construct a visual pattern of the vector flow field, and, secondly, we produce a diagram of the streamlines. It is useful to compare these pictures created by computer to photos of flows in album [57]. ¶
¶
6.5 Flow Field Imaging 105
6.5
Flow Field Imaging
For visualization of flow field in original physical coordinates it is necessary to fill the flow area by a square net of coordinates (x, y), to calculate the values of the similar variable for each mesh point by formula (6.15), and then to find the values of longitudinal U and transversal V velocity projections, and also the flow function from Eqs. (6.11), (6.12), and (6.16). These evaluations are realized in the Mathcad-program by interpolation using built-in function linterp as logical centre (Fig. 6.4). ¸
·
Fields ( S , Re L , X min ) ≡
( X max ← 1
nX ← 10 nY ← 40 )
(
»
¼
½
¹
Y max ← max S
º
0
)⋅
2
Y min ← 0
Re L
À ¾
¿
for i ∈ 0 .. nX − 1 Xi ← X min + i ⋅
X max − X min nX − 1
for j ∈ 0 .. nY − 1 Yj ← Y min + j⋅
Y max − Y min nY − 1
Re L
η i , j ← Yj
2 ⋅ Xi
(
¹
º
¹
º
)
Ui , j ← linterp S 0 , S 2 , η i , j
(
¹
fi , j ← linterp S Vi , j ←
0
¹
,S
1 2 ⋅ Re L ⋅ Xi
Ψ i , j ← fi , j ⋅
(U
º
º
1
)
, ηi , j
⋅ ( Ui , j ⋅ η i , j − fi , j)
2 ⋅ Xi Re L
V Ψ Y max )
Fig. 6.4. Interpolation routine to create flow field in physical coordinates
The results are shown in Fig. 6.5. On the leading edge of the wall (at X=0), the solution has a singularity, and construction of the graph starts with some small finite value Xmin. Two-dimensional arrays of U and V are defined on uniform grid, and the Vector Field Plot diagram is applied to construction of the flow field (upper figure). is also calculated as two-dimensional array on the same grid. Flow function Constant values correspond to streamlines, and for their construction, diagram Contour Plot is applied (lower figure). Á
Á
106 6 The Falkner–Skan Equation of Boundary Layer
fw = 0
(U
ReL := 100
Xmin := 0.01
V Ψ Ymax ) := Fields ( S , ReL , Xmin )
( U , V) X min = 0.01
Ymax = 0.849
Ψ Fig. 6.5. Vector flow field and flow function for the impermeable wall
As is visible in the upper figure, the boundary layer becomes gradually thicker downstream. Streamlines are directed almost parallel to the wall, although some upward deviation is noticed due to deceleration, as fluid is “adhering” the wall (lower figure). Both longitudinal and transversal velocity components are zero on the solid impermeable surface. The drag coefficient cf on the impermeable flat plate can be expressed by Eq. (6.14), in which the following substitution must be made using above obtained value of MissingInitCond (see Fig. 6.2) for the second derivative at the wall: f w'' ≡ F2 (0) = 0.4696 .
6.6 Boundary Layer on Permeable Walls 107
Thus we receive: cf 2
=
6.6
0.4696
1
2
u∞ x ν
=
0.332 u∞ x ν
.
(6.18)
Boundary Layer on Permeable Walls
At intensive blowing through permeable walls (see Fig. 6.6, Fig. 6.7, and Fig. 6.8), an abrupt change of flow structure in the boundary layer is observed. The velocity profile (Fig. 6.6) turns to the characteristic S-shaped form. The shear layer appears to be pushed aside from the wall. The phenomenon of flow separation appears. The shear stress at the wall decreases by actuation of blowing and will finally become zero at so-called critical blowing. The value of permeability parameter f w = –0.7 taken in this numerical example, is close to critical, and the friction coefficient practically becomes zero (f″w = F2(0) = 0.05458 , see Fig. 6.6, vs. f″w = F2(0) = 0.4696 for impermeable wall). Let us note, that the evaluation of the missing initial condition F2(0) by means of function sbval was carried out just as shown in Fig. 6.2 for the case of the impermeable wall, but with a modified set of parameters: ( = 0, f w = – 0.7), instead of ( = 0, f w = 0). Â
Â
(
InitCond := SetInit η w , MissingInitCond
)
T
InitCond = ( − 0.7 0 0.054577 ) N := 200 Ã
(
S := rkfixed InitCond , η w , η inf , N , D
Ä
η := S 0
Ã
Ä
Ã
f := S 1
(
T
Ã
) Ä
U := S 2
Stress := S 3
)
Zero(i , j) := 0
T
Uarray := stack U , U
Ä
Vas_0 := matrix( rows ( Uarray) , cols ( Uarray) , Zero)
fw = −0.7
( Uarray , Vas_0) Fig. 6.6. Longitudinal velocity distribution in the boundary layer at blowing (fw = –0.7, f″w = F2(0) = 0.05458)
108 6 The Falkner–Skan Equation of Boundary Layer
(U
V Ψ Ymax ) := Fields ( S , ReL , Xmin)
( U , V) Xmin = 0.2
Ymax = 0.849
Ψ Fig. 6.7. Vector flow field and flow function at blowing
( U , V) Fig. 6.8. Vector field of velocity near the wall at blowing
6.6 Boundary Layer on Permeable Walls 109
Flow in boundary layer with suction is presented in Fig. 6.9, Fig. 6.10, and Fig. 6.11. We observe essential differences compared to the case of the impermeable wall. Now the boundary layer is pressed to the wall. The boundary layer thickness decreases noticeably in comparison with an impermeable surface and, especially, with flow under intensive blowing. Since the boundary layer becomes very thin, the second derivative of flow function or, being the same, the first derivative of velocity becomes very large. Therefore, the shear stress will be increased by actuation of suction as it is visible from (6.14). The second derivative at the wall, proportional to shear stress, becomes f ″w = F2(0) = 7.0692 (by permeability parameter fw = 7). It is a very large value compared to f″w=F2(0) = 0.4696 for the original case of impermeable wall. Let us note, that the evaluation of the missing initial condition F2(0) by means of function sbval was carried out just as shown in Fig. 6.2 for the case of impermeable wall, but with a changed set of parameters: ( = 0, f w = 7) instead of ( = 0, f w = 0). To see the flow structure near the wall in more detail, the vector velocity field is made scaled-up in Fig. 6.8 (blowing) and Fig. 6.11 (suction). As always, due to adhesion condition, the longitudinal component at the wall equals zero. The transversal velocity component, in contrast to the impermeable surface, is nonzero (positive for blowing and negative for suction). Therefore, the velocity vector at the wall is nonzero and is directed normal to the surface. Å
Å
(
InitCond := SetInit η w , MissingInitCond InitCond
T
N := 200 Æ
η := S
= ( 7 0 7.069198 )
(
S := rkfixed InitCond , η w , η inf , N , D
Ç
0
)
Æ
f := S
(
Ç
Æ
1 T
U := S T
Uarray := stack U , U
Ç
2
)
Æ
Stress := S
) Ç
3
Zero ( i , j) := 0
V as_0 := matrix ( rows ( Uarray ) , cols ( Uarray ) , Zero )
fw = 7 È
( Uarray , V as_0 ) Fig. 6.9. Longitudinal velocity distribution in the boundary layer at intensive suction (fw = 7, f″w = F2(0) = 7.0692)
110 6 The Falkner–Skan Equation of Boundary Layer
fw = 7
(U
ReL := 100
Xmin := 0.2
V Ψ Ymax ) := Fields ( S , ReL , X min)
( U , V) X min = 0.2
Ymax = 0.849
Ψ Fig. 6.10. Vector flow field and flow function at suction
( U , V)
Fig. 6.11. Vector field of velocity near the wall at suction
6.6 Boundary Layer on Permeable Walls 111
In three numerical examples considered above (zero cross mass flux, blowing, suction), the parameter varied was the value of flow function fw on the wall, also called parameter of permeability (see Eq. (6.13)). Each time, at the numerical integration of the boundary value problem for the given parameter fw, the appropriate value of second derivative on the wall fw″ was obtained. The results are shown graphically in Fig. 6.12 in the form of functional dependence fw″(fw). Apparently, we discover from the graph the asymptotic f w″ fw for large positive parameter fw, i.e. for intensive suction. É
Ê
f''w Ë
Ì
ÏÍ
fw
3
1 Î
asympt
2
f''w 1
fw 1
0
1
2
3
1
fw
Fig. 6.12. Dependence of stress parameter fw" from mass flux parameter fw
Assuming this asymptotic in Eqs. (6.13) and (6.14) we obtain for intensive suction:
cf 2
=
− vw u∞
(6.19)
or, identically: τ w = [ρ ⋅ ( −v w )]⋅ u∞ .
(6.20)
The physical meaning of the asymptotic formula (6.20) can be explained as follows: the part in square brackets is the cross mass flow from exterior main stream into the permeable wall, and the second factor is the longitudinal impulse, contained in each mass unit of cross flow. The product of both factors produces a momentum flux through the wall boundary which is equivalent to the stress at the wall. Remarkable feature of the asymptotic law (6.19) or (6.20) is independence of stress (or friction coefficient) from viscosity of fluid (it is useful to compare the
112 6 The Falkner–Skan Equation of Boundary Layer
asymptotic formula (6.19) with equation (6.18) for viscous friction on the impermeable wall). Another important result already considered above is zero stress value on the wall by intensive blowing (Fig. 6.6). This case of boundary layer separation is seen on the graph (Fig. 6.12) in the area of extreme negative values fw of blowing where the wall velocity gradient fw″ will be zero. 6.7
Thermal Boundary Layer. Heat Transfer Law
If the temperature difference between wall and fluid (Fig. 6.1) is nonzero, there is a heat flux through the boundary layer that in engineering calculations is determined by the Newton–Richman law: qw = α(t w − t ∞ ) ,
(6.21)
where α is the heat transfer coefficient, a measure of heat exchange intensity between wall and fluid, an intricate function of velocity and flow regime, geometry, thermal properties of fluid. Finding this function is the main practical application of the theory of convective heat transfer. Thermal Boundary Layer Equation Let us remember, that the partial differential equations for velocity boundary layer (6.5), (6.6) after similar transformations turn into ordinary differential equations (6.1), whose integration yields the full information on velocity and stress distribution. Analogously, the partial differential equation (6.7) for thermal boundary layer is reduced to following ordinary differential equation: g ′′(η) + Pr⋅ f (η) ⋅ g ′(η) = 0 ,
(6.22)
with boundary conditions g ( 0) = 0 g ( ∞ ) = 1 .
(6.23)
The integration of this boundary problem yields the temperature and heat flux distribution and eventually the heat transfer coefficient. The similar variable has been defined previously, see (6.15). The required function g represents the dimensionless temperature in the fluid flow: Ð
g=
t( x, y ) − tw . t∞ − tw
(6.24)
Numerical parameter Pr (Prandtl number) is the ration of kinematic viscosity to thermal diffusivity of fluid.
6.7 Thermal Boundary Layer. Heat Transfer Law 113
Simple calculations show that heat transfer coefficient and Nusselt number Nu as its dimensionless form are expressed by following formulas which can be used after integration of the boundary problem (6.22), (6.23): Ò
Ñ
−λ α=
qw = tw − t∞
∂t ∂y
y= + 0
t w − t∞ Nu x =
=λ
dg dη
y= + 0
αx g w' = λ 2
u∞ ∂η ; = λg w' ∂y 2νx
(6.25)
u∞ x . ν
For integration (6.22) we need a solution for the flow field. Only flow function f (but not its derivatives) is needed immediately, therefore it is convenient to use built-in function Odesolve for integration , as shown in Fig. 6.13. Let us restrict the problem to heat exchange on impermeable surface, therefore fw = f(0) = 0. N := 200 Given f''' ( η ) + f ( η ) ⋅ f'' ( η )
0
f ( 0)
0
f' ( 0 )
f' ( 6 )
0
1
f := Odesolve ( η , 6 , N) i := 0 .. N
X i :=
6⋅i N
Yi := f ( X i) fspl ( η ) := interp ( Spl , X , Y , η )
Spl := cspline ( X , Y)
fa ( η ) :=
fspl ( η ) if η ≤ 6
(
η − 6 − fspl ( 6 )
U ( η ) :=
d dη
fa ( η )
)
otherwise
η inf := root ( 0.99 − U ( η ) , η , 1 , 10 )
η inf = 3.472
10
10
η η
5
0
η inf
0
fa ( η )
5
5
0
0
0.5
U( η )
1
Fig. 6.13. Velocity boundary layer on impermeable wall (solution with Odesolve)
114 6 The Falkner–Skan Equation of Boundary Layer
Referencing solver Odesolve takes only two lines of the program text. The computed distribution f is stored for further use in the form of spline-function fspl obtained with the built-in functions cspline and interp. To present clearly the area of boundary layer, the velocity distribution is constructed and the distance from the wall = 3.472 is marked on which 99% of all longitudinal velocity variation is completed. For finding of this boundary, the method root was used to solve the non-linear equation U( )=0.99. Outside of layer = 3.472, the velocity is practically constant already, and flow function varies linearly with distance from the wall. Good approximation for the flow function at any given will be user's function f a, which is applied further at integration of the thermal boundary layer equation. The integration of Eq. (6.22) and temperature distribution in the thermal boundary layer are demonstrated in Fig. 6.14. In the graph, the horizontal axis merges with the wall, and this axis also represents dimensionless temperature g. On the vertical axis, dimensionless distance from the wall is plotted. So we have the temperature profile in common presentation. Ó
Ó
Ó
Ó
Ó
Pr := 1 Given g'' ( η ) + Pr ⋅ fa ( η ) ⋅ g' ( η )
0
g ( 0)
0
g ( 6)
1
gPr_1 := Odesolve ( η , 6 , N) 10
Distance
8 6 4 2 0
0
0.2
0.4 0.6 Temperature
0.8
Pr=0.1 Pr=1 Pr=10 Wall
Fig. 6.14. Temperature distribution for various Prandtl numbers
6.7 Thermal Boundary Layer. Heat Transfer Law 115
The calculations are carried out for a large interval of Prandtl numbers. It should be remembered that values of the Prandtl number close to unit are characteristic for heat transfer with gases, much larger values for viscous lowconductivity organic liquids, much smaller unit values for molten metals. The graph in Fig. 6.14 shows, that the separation of heat-carriers in three such groups has a clear physical meaning. To distinguish between the results for different values of the Prandtl number, we have supplied g with an appropriate literal subscript. • In case Pr = 1, the profiles of velocity and temperature completely coincide and the thicknesses of hydrodynamic and thermal boundary layers are identical. Therefore, the curve labeled as Pr = 1 should also be considered as velocity profile for all of the three cases shown. • At Pr << 1 (see numerical example with Pr = 0.1), the thermal boundary layer thickness exceeds by far that of velocity. Therefore, velocity will be constant within most part of the thermal boundary layer, except in the very close neighborhood of the wall. • At Pr >> 1 (see numerical example with Pr = 10), quite the contrary occurs, and the thermal boundary layer only exists at the bottom of the velocity boundary layer. As a consequence, velocity will be low throughout the thermal boundary layer, diminished by proximity to the wall. The results of calculations at different Prandtl numbers are collected in the table of Fig. 6.15, where the first line indicates numbers 2 to 11 of the 10 variants, the second gives the Prandtl numbers are indicated, and the third the pertaining values of the dimensionless temperature gradient g w. These results are also presented as graphs containing the following data: • results of numerical integration (circles), • asymptotic solutions for large (dashed line) or small Prandtl numbers (dotted), respectively • approximated general-purpose equation g'appr for wall temperature gradient g'w (solid line, obtained by superposition of asymptotes, applicable in all ranges of Prandtl numbers). Values g'w are substituted in formulas (6.25) to calculate a required value of heat transfer coefficient as a measure of heat exchange intensity. Using this theory, we are able to calculate the heat transfer coefficient for three different heat-transfer mediums, mercury, air and oil, presenting three characteristic groups and also for the very important case of water (Fig. 6.16, fluids identified by indexes). Thermal properties are taken for standard conditions. Dimensional data are written in SI (kg, m, s, K): thermal conductivity , W/(m K), kinematic viscosity , m2/s; wall length L, m; main-stream velocity U, m/s; heat transfer coefficient , W/(m2 K). The wall length and main-stream velocity were selected small as to guarantee laminar conditions. Ô
Õ
×
Ö
116 6 The Falkner–Skan Equation of Boundary Layer 2
Pr_g T = 0
0.01
3
4
0.1
0.5
5
1 0.073 0.198 0.367 Ø
6
1
7
8
2
9
4
8
0.47 0.597 0.756 0.955
Ù
Ø
10
20
11
100
1.03 1.299 2.226
Ù
g' w := Pr_g 1
Pr := Pr_g 0
− 0.25
à
á
−4
Ú
Û
á
â
g' appr ( Pr) :=
10
Ü
0.479 ⋅ Pr
1 3
Û
Ýß
−4
Ú
Ü Þ
+ 0.798 ⋅ Pr
1 2
Ýß
Þ
ã
å
ä
ä
10
g'w 1
⋅ 0.479Pr
1
3
1
⋅ 0.798Pr
2
0.1
g'appr ( Pr )
0.01. 3 1 10
0.01
0.1
1
10
100
Pr
Calcul Pr >> 1 Pr << 1 approx
Fig. 6.15. Dimensionless temperature gradient as function of Prandtl number
The heat transfer coefficient is estimated by formula (6.25): α=λ
g w' 2
u∞ . νL
The graphs in Fig. 6.16 demonstrate, how strongly the intensity of heat exchange depends on physical properties of fluid. The heat transfer coefficient to mercury (molten metal with high thermal conductivity) on three orders exceeds the one to air. Evidently, water is a much better cooling agent, than viscous oil or air with its small density and thermal conductivity. Therefore, projects of replacing air-cooling of personal computers and even notebooks are seriously considered. It would make the cooling systems also silent. Another important result of the theory is essential increase of heat exchange intensity with increasing main-stream velocity: the heat transfer coefficient is proportional to the square root of velocity (see (6.25)).
6.7 Thermal Boundary Layer. Heat Transfer Law 117 é æ
æ
Hg ç
é
ê
ê
ê
0 ç
ê
ç
ê
ç
ê
Water ç
è
ê
2 è
2.6 ⋅ 10
ê
ç
ç
ë
λ := ç
−2
1.5 ⋅ 10
ê
ç
ê
ν :=
0.6
ç
ç
1.0 ⋅ 10 ç
ë
è
ê
0.03 ç
−5
è
1.5 ⋅ 10
1 −4 3 é
æ
æ
−6 −3
è
0.479 ⋅ Pr
α ( fluid , U , L) := λ fluid ⋅
Pr :=
7.0
ê
ç
è
ë
+ 0.798 ⋅ Pr
g' appr ( Prfluid) 2
L ≡ 0.1
⋅
ë
ê
ç
1.6 ⋅ 10
ê
4 ë
− 0.25
ê
ç
ë
î
1 −4 2 é
ê
ç
í
0.7 ç
è
0.15
í
ê
ê
ì
g' appr ( Pr) :=
é æ
ê
ë
3
Oil
ê
ê
ç
ç
:=
−7
ê
1
ê
ç
7.8 ç
ç
Air
1.2 ⋅ 10
é æ
é æ
ñ ï ð
ð
U ν fluid ⋅ L
U ≡ 0.1 , 0.2 .. 1 1 .10
4
α ( Hg , U , L)
1 .10
3
α ( Air , U , L) α ( Water , U , L) α ( Oil , U , L)
100
10
1
0
0.5
1
U
Fig. 6.16. Convective heat transfer to different heat-transfer mediums
Though these results are obtained for laminar conditions, the qualitative content of deduced relationships also holds for turbulent flows that are more important in practice (although more complicated for calculation). Heat Transfer Law Eq.(6.25) will now be presented in greater generality than the one deduced for longitudinal flow of the isothermal plate. Let us rewrite (6.25) as a relationship linking • the local value of heat transfer coefficient, made dimensionless by means of scaling with cu , • and the Reynolds number constructed on local values of boundary layer thickness and main-stream velocity: ò
ó
118 6 The Falkner–Skan Equation of Boundary Layer
g w' ⋅ δ txx, rel 1 α , = Pr Re txx ρ u∞
(6.26)
ô
where Re txx =
u∞ δ txx ; ν
δtxx , rel =
δtxx 2 νx u∞
.
Enthalpy thickness txx may be calculated under formula (5.1), if profile of velocity and profile of temperature are known. In dimensionless form: õ
∞
δ txx, rel = U (η) (1 − g (η))dη . ö
0
Results of relative enthalpy thickness computed by this formula are presented as graphs in Fig. 6.17. δ xx_rel := 0.4696
δ txx_rel
0.4
i
δ xx_rel
0.2
0
0
5
10
Pri
Fig. 6.17. Dimensionless enthalpy thickness as function of Prandtl number
For comparison, the value of the relative momentum thickness is marked in the same graph: δ xx _ rel =
δ xx 2 νx u∞
.
The thickness ratio of thermal and velocity boundary layers was considered above (see Fig. 6.14), and all numerical data needed for formula (6.26) were obtained already (see Fig. 6.13 and Fig. 6.14). The result will be as follows:
6.8 Troubles with Odesolve
St ≡
α ϕ(Pr) = , ρ cu∞ Re txx
ϕ(Pr) ≅
0.22 Pr 4 / 3
.
119
(6.27)
Approximation function (Pr) in (6.27) is suitable for gases and nonmetallic liquids. Within the integral method of boundary layer (see previous chapter), the relation (6.27) for Stanton number St is also called the heat transfer law at laminar condition. Let us accentuate that the formulation was obtained immediately for the limited conditions of heat exchange for the isothermal flat plates in parallel laminar flows. Calculations and experiments show, however, that this law can also be applied with satisfactory accuracy for convective heat transfer on not isothermal surfaces and with variable main-stream velocity. A practical example of such problems was considered in the previous chapter. ÷
6.8
Troubles with Odesolve
The built-in integrator, which appeared in Mathcad 2000 version, is intended for integration of ordinary differential equations, including two-point boundary problems. The Odesolve call (see e.g. Fig. 6.14) practically does not differ from the routine mathematical notation and looks much easier than the use of the sbval method. Solution of the Falkner–Skan equation is written in one line. By reference to Odesolve, a function will be returned, but not an array, when using other solvers such as rkfixed etc. The problem is, that manipulating with this return function the peculiar results may be obtained as is demonstrated in the examples of Fig. 6.18, Fig. 6.19. The first error is identified by evaluation of the first and second derivatives at an initial point (Fig. 6.18). It is apparent, that the zero value of the first derivative given by the initial condition is not reproduced. For the second derivative, zero is obtained instead of the correct value (0.4696, see Fig. 6.3). It looks like a serious mistake, rather than an allowable error of solution. Apparently, the return function f is not a routine function since it is not possible to apply standard mathematical operation of a series expansion. Fig. 6.19 illustrates the peculiarities detected at attempts to sequentially apply the spline interpolation and then the derivation. The first fragment shows that at small interpolation steps (0.01) the same improper results are returned as by direct evaluation of the derivatives. The second fragment shows, that interpolation steps may be selected (0.1) that yield satisfactory results but looking at the last fragment, countenance gets lost again, because minor step variation (0.09) gives rise to an abrupt change in the result. The user could eventually find reasons why Odesolve behaves in this manner (it would be better, however, the producer to explain its features more clearly).
120 6 The Falkner–Skan Equation of Boundary Layer TOL = 0 Given f :=
f''' ( η ) + f ( η ) ⋅ f'' ( η )
Odesolve ( η , 6 )
η := 0
d dη
0
f ( 0)
f' ( 0)
0
f' ( 6)
1
f = function d2
f ( η ) = 0.0135565
f ( η ) series , η
0
dη
2
f( η ) = 0
w e
0 ,2 →
Fig. 6.18. Odesolve and series expansion i := 0 .. 5
Spl := cspline ( X , Y) η := 0
Yi := f ( X i)
X i := 0.01 ⋅ i
d
fs ( η ) := interp ( Spl , X , Y , η ) d2
fs ( η ) = 0.013557
2
fs ( η ) = 1.781474 × 10
− 15
dη dη __________________________________________________________
i := 0 .. 5
X i := 0.1 ⋅ i
Spl := cspline ( X , Y)
Yi := f ( X i)
fs ( η ) :=
interp ( Spl , X , Y , η )
fs ( η ) = −3.976486 × 10
−6
d2
fs ( η ) = 0.469747 2 dη __________________________________________________________
η := 0
d
dη
i := 0 .. 5
X i := 0.09 ⋅ i
Spl := cspline ( X , Y) η := 0
d dη
Yi := f ( X i) fs ( η ) := interp ( Spl , X , Y , η )
fs ( η ) = 2.225674 × 10
−3
d2 dη
2
fs ( η ) = 0.417474
Fig. 6.19. Odesolve and spline interpolation
6.9
Conclusion
Use of the blowing technique can protect the surfaces from action of hightemperature gas flows or from chemically hostile environments. Patterns of vector flow fields show, that by blowing through permeable walls under large negative values of parameter fw = – 0.7 the phenomenon of separation of boundary layer takes place (Fig. 6.7, Fig. 6.8). In immediate proximity to the wall, the velocity is directed vertically, and not before some distance from the wall a longitudinal shear flow will be formed.
6.9 Conclusion 121
By varying the parameter value fw, the influence of mass flow through the boundary layer can be observed. At fw = 0 the standard flow pattern on impermeable walls is received, and at positive values – the flow pattern with suction. In aerodynamics, the suction technique is used for prevention of the dangerous phenomenon of boundary layer separation by flow over a wing with large angle of attack, as is the case during the landing of aircrafts. In heat exchangers, problems with suction arise in case of intensive condensation of vapours. Interesting effects may occur as happen combined effect of parameters of acceleration β and permeability f w. Varying these two parameters, the engineerdesigner can realize a boundary layer control, for example, applying the suction to prevent a flow separation in the case of an adverse pressure gradient (i.e. with flow in the direction of increasing pressure). Solution of the Falkner–Skan equation and the similar equation for thermal boundary layer explores the basic function relations for hydrodynamic resistance and heat transfer, showing the role of flow rate, geometry, and the physical properties of a fluid. Presented in the form of laws of resistance, heat and mass transfer for laminar flow (like Eq. (6.27)), the solutions are used within the integral method oriented on engineering applications [18, 44]. An example of such problems has been considered in Chap. 5. Application for the boundary layer concept near the phase boundary is described in [40]. The main purpose of the present chapter in the sphere of computing technique is the solution of two-point boundary problems for systems of ordinary differential equations. We have achieved this by using the built-in function sbval based on the shooting method. But this method does not always work [22]. There are problems with a strong dependence of the solution on the initial data. Then numerical instability will hinder convergence of the sbval method. Apparently, the built-in function bvalfit as a special modification of the shooting method will be more stable. An appropriate example is considered in Sect. 10.6. Another, more radical alternative would be the finite difference method in combination with TDMA (see Chap. 11). For systems of high order, the TDMA for tridiagonal block matrix may be used [1,22].
7
Rayleigh’s Equation: Hydrodynamical Instability
7.1
Introduction
In nature and engineering we deal with different steady-flow and time-varying (transient) processes. Though from the philosophical standpoint “all flows, and all varies” (by Heraclitus of Ephesus), it is necessary to recognize, that for engineering thinking the stationary approach is more intimate. There are two reasons for this. Firstly, large engineering systems work in steady-state, optimized conditions. For example, nuclear power plants are intended to work in basic, constant load. Secondly, the steady processes are easier to study and understand. However, such style of engineering thinking is fraught with serious danger. Any system is subject to random disturbances to which also accidental personnel mistakes can be added. The behavior after perturbation is one of the basic characteristics of the system. If restitution occurs, the system is stable and reliable. If the perturbations will grow, the system is unstable, and special stabilizing control will be necessary whose failure may result in catastrophe. We have considered earlier (Chap. 3) such problems and have analyzed the stability of three equilibrium points, one of which appeared to be unstable. Stability research starts with the analysis of the system response to small perturbations. If the deviations from equilibrium position are small, then the linearization of mathematical formulation is possible. To work with linearized models is much easier, than with original, very often non-linear mathematical formulations. The fundamental idea consists in expanding the putative solution near the equilibrium point in powers of the small parameter, which is a measure of the small deviation from equilibrium. If the system is stable against small perturbations this can be accepted as a positive but preliminary result, because stability must then be checked against finite perturbations, which are commonly non-linear. But this is a special research problem already. If the system is unstable to small perturbations, then the system is absolutely unstable. It would be an unwise decision, to design a plant or process with such an inherent property and to rely only on special stabilizing control. In case of natural phenomenon, this is the question about its observability, realizability. To be or not to be – that is the pressing question for an appearance, if any small perturbations destroy it. The topic of this chapter is instability in fluid flows. The examples of such problems are water waves generated by wind, or transition from laminar to turbulent flow. Impressive photos on this theme exist in literature [57]. The special interior tension of these problems is that the smooth solutions, without waves and turbulence, can be obtained naturally from the complete (not reduced) set of the governing differential equations (1.28), (1.31). There are no
124 7 Rayleigh’s Equation: Hydrodynamical Instability
visible reasons, why Poiseuille's solution with parabolical velocity profile, such as in blood capillary, should not be fit for big gas pipelines. It is not clear, why the wind not only accelerates surface layer of water due to friction, but also generates waves. This chapter gives some answers by means of analyse of Rayleigh’s equation (see e.g. [2, 55]): ý
ú
U b′′ v′′ = + k2 ⋅v , Ub − c ø
û
(7.1)
ø
û
ù
ü
where •
v – complex amplitude of velocity perturbations, sought as function of transverse (perpendicular to basic flow direction) coordinate y, • Ub(y) – the basic flow velocity profile, • k – wavenumber, – complex rate of propagation of the perturbations, or phase velocity • c = cr + i⋅ci , i – imaginary unit, • primes denoting differentiation with respect to y. For various wave lengths (various k), the phase velocity c will be obtained, and it will be shown that if the imaginary part of the phase velocity c will be positive, then instability will take place. From the viewpoint of the computing technique in Mathcad, it will be shown how to integrate the differential equations with complex coefficients and how to interpret the complex solutions. Introductory information on this problem can be found in Sect. 2.3. þ
7.2
Hydrodynamic Equations for Free Shear Flow
We consider the dynamic stability of the two-dimensional parallel steady flow with an S-shaped velocity profile (Fig. 7.1). The axis x is directed along the basic shear flow, the axis y – perpendicular to it. It is supposed, that the basic flow velocity varies only along axis y, Ub = Ub(y). Main changes of velocity are concentrated in a layer 2H thick near the point of inflection of the velocity profile. x U0
y -U0 2H
Fig. 7.1. The basic flow velocity profile
7.3 Perturbation Method. Linearization 125
The quantities U0 and H are used for scaling velocity and coordinates. Therefore, independent variables x,y, and the unknown functions – velocity W and pressure P – should be considered as dimensionless quantities according to following transformation formulas: ÿ
x⇐
x H
;
y⇐
τU 0 P y W ; τ⇐ ; W⇐ ; P⇐ . H H U0 ρU 02
(7.2)
The profile of the dimensionless velocity of basic flow is well approximated by the hyperbolic tangent: Ub ( y) = f ( y ) = tanh( y ) . U0
(7.3)
As a prototype of such velocity distribution, the shear flow away from a permeable wall, induced by intensive blowing, can be used (see Fig. 6.6, Fig. 6.7). A similar velocity profile would be formed on the periphery of jet exhaust, or at a river flowing into the sea. In other words, there is a wide area of such practical problems. When the formulation for nonstationary two-dimensional motion (1.32)–(1.34) is written in normalized form, it becomes: ∂U ∂V + =0; ∂x ∂y
(7.4)
∂P 1 ∂ 2U ∂ 2U ∂U ∂U ∂U ; + + =− +V +U ∂x R ∂x 2 ∂y 2 ∂y ∂x ∂τ
(7.5)
∂P 1 ∂ 2V ∂ 2V ∂V ∂V ∂V , + + =− +V +U ∂y R ∂x 2 ∂y 2 ∂y ∂x ∂τ
(7.6)
where R = U0H / ν – Reynolds number, ν – kinematic viscosity of fluid. Now we look at the stability of such a flow in relation to small perturbations. 7.3
Perturbation Method. Linearization
The idea of the perturbation method is to separate the perturbed flow (W,P) into the basic undisturbed flow (f(y),P0) and the perturbation (u,v,p): W = (U,V ); U ( x , y , τ) = f ( y ) + ε ⋅ u( x,y, ); V ( x, y , τ) = ε ⋅ v( x,y, );
P( x , y , τ) = P0 + ε ⋅ p( x , y , τ);
(7.7)
126 7 Rayleigh’s Equation: Hydrodynamical Instability
where << 1 is the small numerical parameter characterizing deviation from equilibrium. These expansions are then substituted into the full system (7.4)–(7.6). As a result, the equations will contain terms with different powers of the small parameter ε. The principal idea is to collect the terms with identical power of small parameter, i.e. to collect the terms of one smallness order. Symbolic processor of Mathcad may execute these operations with the built-in operator collect, as shown below. Let us begin with substitution of expansions (7.7) in continuity equation (7.4) (see Fig. 7.2).
∂ ∂x
U( x , y , τ ) +
∂ ∂y
V ( x , y , τ)
0
substitute, U( x , y , τ )
f(y) + ε ⋅ u( x , y , τ )
substitute, V ( x , y , τ )
ε ⋅ v( x , y , τ )
→
collect, ε
∂
∂x
u( x , y , τ ) +
∂
v( x , y , τ ) ⋅ ε
0
∂y
Fig. 7.2. Perturbations of continuity equation
The parameter ε can be cancelled, and as a result the continuity equation for velocity perturbations is obtained, which is formally not distinguished from original equation (7.4). Let us substitute now (7.7) on the left-hand side of Eq. (7.5) (see Fig. 7.3). ∂ ∂t
substitute , U ( x , y , t)
U ( x , y , t)
collect , ε
f ( y) + ε ⋅ u ( x , y , t) ∂ → ε ⋅ u ( x , y , t) ∂t
_________________________________________________________
U( x , y , τ ) ⋅
∂
∂x
U(x , y , τ)
substitute , U ( x , y , τ )
f ( y) + ε ⋅ u ( x , y , τ ) →
collect , ε
u( x , y , τ ) ⋅
∂ ∂x
u(x , y , τ ) ⋅ ε
2
+ f ( y) ⋅
∂ ∂x
u(x , y , τ ) ⋅ ε
_________________________________________________________
V(x , y , τ) ⋅
∂
∂y
U(x , y , τ)
substitute , U ( x , y , τ ) substitute
, V (x , y , τ)
f ( y) + ε ⋅ u ( x , y , τ ) ε ⋅ v( x , y , τ )
→
collect , ε
v( x , y , τ ) ⋅
∂ ∂y
u( x , y , τ ) ⋅ ε
2
+ v( x , y , τ ) ⋅
Fig. 7.3. Perturbations of motion equation
∂ ∂y
f ( y) ⋅ ε
7.4 Transition to Complex Domain 127
The convective contributions (second and third terms) contain items of order ε2 and ε. It is evident, that non-linear items with products of perturbations and their derivatives have higher order of smallness (ε2 << ε), and can therefore be neglected (Fig. 7.3). This linearization is an essential simplification of the problem. Further evaluations are of the same type, which we do not need to reproduce. Collecting the terms of equal order, we obtain the following system of differential equations for flow perturbations, i.e. for pulsations u, v, p: longitudinal velocity, transversal velocity, and pressure, respectively: ∂u ∂v + =0; ∂x ∂y
(7.8)
∂u ∂u ∂( f ( y)) ∂p 1 ∂ 2 u ∂ 2 u ; + + f ( y) +v =− + ∂τ ∂x ∂y ∂x R ∂x 2 ∂y 2
%
(7.9)
"
∂p 1 ∂ 2 v ∂ 2 v ∂v ∂v . + + =− + f ( y) ∂y R ∂x 2 ∂y 2 ∂x ∂τ #
#
$
!
(7.10)
The nonlinear items of order ε2 are eliminated as negligibly small. The principal advantage of Eqs. (7.8)–(7.10) over the origin formulation (7.4)–(7.6) is their linearity. Due to this, it is possible to pass from partial differential equations to ordinary differential equations, as will be demonstrated below. 7.4
Transition to Complex Domain
Analyzing structure of differential equations (7.8)–(7.10), we can make a priori assumptions about the solution. • First, the linearity of Eqs. (7.8)–(7.10) can be interpreted as proportionality between sought functions u, v, p and their derivatives. The complex exponential function h(x, )= exp(ik(x– )) has such remarkable property, and we can therefore use it for the description of wave propagation along the x axis, i.e. in the direction of flow, with wavenumber k and phase velocity c as with for the present indefinite parameters (see first block in Fig. 7.4). • Secondly, the nonconstant coefficients f(y) and f′(y) depend only on the transversal coordinate y, and that gives us the possibility on the separation of variables. These tips help to construct solutions as products of complex amplitudes pa(y), ua(y), va(y) depending on cross coordinate y, and wave exponential factor exp(ik(x– )), see second block in Fig. 7.4. '
(
&
&
&
128 7 Rayleigh’s Equation: Hydrodynamical Instability
∂ ∂x
∂
exp i ⋅ k ⋅ ( x − c ⋅ τ ) → i ⋅ k ⋅ exp i ⋅ k ⋅ ( x − c ⋅ τ ) )*
)*
+,
+,
exp i ⋅ k ⋅ ( x − c ⋅ τ ) → − i ⋅ k ⋅ c ⋅ exp i ⋅ k ⋅ ( x − c ⋅ τ ) )
)
*
+,
*
+,
∂τ ________________________________________
p ( x , y , τ ) := p a ( y) ⋅ exp i ⋅ k ⋅ ( x − c ⋅ τ ) )
*
u( x , y , τ ) := ua ( y) ⋅ exp i ⋅ k ⋅ ( x − c ⋅ τ )
+,
)
+,
*
v ( x , y , τ ) := va ( y) ⋅ exp i ⋅ k ⋅ ( x − c ⋅ τ ) ________________________________________ )
+,
*
∂ ∂x
u( x , y , τ ) +
∂ ∂y
v( x , y , τ )
0 simplify → 0
-
i ⋅ exp i ⋅ k ⋅ ( x − c ⋅ τ ) ⋅ k ⋅ ua ( y) − i ⋅ .
)
+,
*
∂
/
∂y
va ( y) 2
1
0
Fig. 7.4. Passage to complex area
Now the supposed solutions from the second block should be substituted in the system (7.8)–(7.10). These operations are demonstrated in the third block on example of equation of continuity. After automatic substitutions and derivation, the operator simplify will considerably simplify the original expression. The complex exponent is then canceled, and the result can be presented as follows: v ′( y ) = −i k u( y ) . To avoid bulky denotation, the complex amplitudes will be written further without the index “a”. As these depend only on y, they are easy to distinguish from perturbations of itself (for example, from u(x, y, τ)). At this working stage, we should decide about the role of viscosity of the fluid, and we consider it to be small and therefore neglect the operators with second derivatives on the right-hand side of Eqs. (7.9) and (7.10). Formally, we pass to the limit of large Reynolds numbers (R →∞). Therefore, the terms containing operators with second derivatives and factors (1/R) tend to zero. More rigorous study confirms, that fully viscous solution in this asymptotic limit comes to solution of inviscid perturbations problem in main. Omitting routine intermediate calculations, we can write out the obtained system of ordinary differential equations in complex domain as follows: v ′( y ) = −i k u( y ) ;
(7.11)
7.4 Transition to Complex Domain 129
− i k u( y ) ( f ( y ) − c ) − v ( y )
d f ( y ) = i k p( y ) ; dy
− i k v( y ) ( f ( y ) − c ) = p ′( y ) .
(7.12) (7.13)
It is easy to eliminate the pressure from these equations after preliminary differentiating Eq. (7.12). Simple transformations yield finally the following system for inviscid perturbations (u, v): 8
i u′ = k
f ′′( y ) + k2 ⋅ v ; f ( y) − c 5
6
3
6
3
7
4
v ′ = −i ⋅ k ⋅ u .
(7.14)
(7.15)
The following second-order differential equation (Rayleigh’s equation) is obtained by combining Eqs. (7.14) and (7.15), after differentiating (7.15) and substituting u′ from Eq. (7.14): v ′′ =
f ′′( y ) + k2 ⋅ v . f ( y) − c ;
>
9
9
=
<
<
:
(7.16)
The system (7.14), (7.15) and the equivalent Eq. (7.16) are linear and homogeneous. However their coefficients are nonconstant: they are functions of the independent variable y. Therefore, the differential equations are to be integrated numerically. If at given wave number k there is a solution, such that the imaginary part of the phase velocity c is positive, then instability will take place. It is evident from the expression for the wave exponential factor (see second block in Fig. 7.4.) h( x, τ) = exp(ik ( x − cτ)) = exp(ik (x − (cr + ici )τ )) =
= exp(kci τ ) exp(ik ( x − cr τ))
(7.17)
that the first factor on the final right-hand side will yield exponential growth of the perturbations, if ci > 0. The second factor describes the sinusoidal and cosine waves, which are running along the x-axis with phase velocity cr. For a fully symmetrical system with a fixed centerline (see Fig. 7.1), cr = 0 is to be expected, that corresponds to a standing wave. Let us summarize once again the features connected with the use of complex variables. Differential equations (7.14), (7.15) and (7.16) are written in the complex domain; their coefficients are complex quantities (the imaginary unit is present obviously, and the phase velocity c is the complex parameter). Independent variable y (integration variable, perpendicular to flow direction) is a real quantity. The desired solutions (u, v) will therefore be complex-valued functions of the real variable y.
130 7 Rayleigh’s Equation: Hydrodynamical Instability
7.5
Numerical Integration in the Complex Domain: Program Euler
The plan for the further operations is as follows. We shall assign certain value of wave number k and then try to find admissible solutions for pulsation amplitudes u(y) and v(y). As a second-order system is used, we will need two boundary conditions. We are interested in those perturbations, which are generated in the shear layer. Far from it, in the uniform stream, perturbations should be damped just as perturbations in motionless fluids are damped. From this, the zero conditions at infinity will follow. There is some freedom of selection of the complex phase velocity c. The real part should be zero due to symmetry, as was illustrated above, but the imaginary part may be varied. We should select a value for the phase velocity (its imaginary part ci) for the given wavenumber k so that at infinity the solution will be damped. After these preliminary notes we could begin with integrating Rayleigh’s equation, but we find an unexpected hurdle. Let us first apply any built-in solver, for example, rkfixed, in our case when initial conditions (vector IC) or right hand side terms (Dy) contain imaginary numbers: S:=rkfixed(IC,–3,3,N,Dy). Mathcad denotes an error by marking in red IC or Dy with a message as follows: “This value must be real. Its imaginary part must be zero”. The help system gives the following explanation: “This expression contains an imaginary or complexvalued expression somewhere in which it is not allowed. Examples are subscripts and superscripts, differential equation solvers, mod, and angle”. Thus, built-in Mathcad solvers do not work with differential equations in imaginary domain. It is necessary to develop a user's function for numerical integration of systems of differential equations, free from limitations on the type of variables. For the numerical method we shall select the modified Euler method, which is both exact enough and simple to use.
ymdl
y
yR yL
xL
xmdl
xR
x
Fig. 7.5. The second-order Euler method
The algorithm of this method is illustrated in Fig. 7.5. The slope of tangent is evaluated at an initial (left) point and then the half step is performed along this
7.6 Integration and Search of Eigenvalues 131
tangent. As a result, the predicted value Ymdl is calculated in the bisecting point Xmdl. The new tangent calculated in point (Xmdl, Ymdl) is close to true. Now the full step can be done from the left point along the tangent obtained in center. Due to symmetry of the middle point the order of method is heightened: using the half step, the error becomes one quarter. The realization of this algorithm in Mathcad language is shown in (Fig. 7.6). The output matrix of program Euler is composed by built-in function augment from X and Y. Structure of the output matrix is the same as for the built-in integrator rkfixed: the first column contains vector of the independent variable X, the second, the third, and et cetera columns are vectors of solution Y, in sequence as they are indicated in vector of right-hand sides Dy of system. The calculation by the Euler method at each integration step is repeated in cycle for. The designations in the program are chosen without any connection to concrete problem about hydrodynamic perturbations; x and y mean argument and function, as shown in Fig. 7.5. Argument P is a reserve parameter. A
(Y 0 ?
B
Euler ( IC , xL , xR , N , Dy , P ) :=
) ( X 0 ← xL)
@
CD
← IC
( xR − xL ) N
h←
for n ∈ 0 .. N − 1
( xL ← Xn) A
B
( yL ← Y n ) E
F
C
D
h xmdl ← xL + 2
(
) yR ← yL + h ⋅ Dy ( xmdl , ymdl , P ) ( X n+1 ← xL + h) ( Y n+1 ← yR)
1 ymdl ← yL + ⋅ h ⋅ Dy xL , yL , P 2
A
E
B
(
T
augment X , Y
)
F
C
D
g
Fig. 7.6. Mathcad-program of Euler method
7.6
Integration and Search of Eigenvalues
With the program Euler available it is now possible to begin integration of the differential equations set (7.14), (7.15). The general sequence of operations will be as follows: 1) It is necessary first to write the vector Dw of the second members of differential equations (7.14), (7.15) equivalent to Rayleigh’s equation (7.16) and to set the vector of the appropriate initial conditions IC for velocity
132 7 Rayleigh’s Equation: Hydrodynamical Instability
components (w0,w1) (u,v) on one of the edges of the integration segment (Fig. 7.7). 2) As the system must be repeatedly integrated with different values of the phase velocity, it is useful to include the varied imaginary part cIm in the Euler argument list and to design a function (uDv(t) in Fig.7.8) estimating the acceptability of a trial value cIm. 3) An automatic scan of the appropriate value of cIm (block Given … Find in Fig.7.8) must be organized. 4) And, finally, the results may be presented in graphic form (Fig. 7.9, Fig. 7.12). G
k := 0.4
f ( y) := tanh( y)
c ( cIm) := ( 0 + i ⋅ cIm) Q
K
N
H
d2 I
O
I
2
O
f ( y)
L
R
L
R
L R
dy i 2 ⋅ + k ⋅ w1 k f ( y) − c ( cIm)
Dw ( y , w , cIm) :=
I
O
O
J
R
M
−i ⋅ k ⋅ w0 P
S
w
K H
L
i I
IC := J
M
1
Fig. 7.7. The right-hand sides of system and initial conditions (z0=u, z1=v)
The appropriate initial conditions IC (Fig. 7.7) on the left edge of the integration segment (at y = –3) are formulated in the following way. Let us consider the solution of (7.16) outside the shear layer, i.e. at y < –3 and at y > 3. The second derivative of the basic flow velocity profile is equal to zero here (see Fig. 7.1). Therefore, the following equation with constant coefficients is obtained from (7.16): v ′′ = k 2 ⋅ v
(7.18)
v = A1 exp(− ky ) + A2 exp(ky ) .
(7.19)
with solution (see Sect. 2.3):
Clearly, for y < –3 the second term of solution (i.e. damping on negative infinity) must be chosen: v −∞ = A2 exp(ky ); u− ∞ =
v −′ ∞ A2 k exp(ky ) , = − ik − ik
(7.20)
where the expression for u was received from (7.15). The value A2 can be taken as exp(3k), without loss of generality. Then for point y = –3, we get the following simple conditions ensuring damping on negative infinity: u(–3) = i ; v(–3) = 1, which are written in the form of initial conditions vector IC in Fig. 7.7.
(7.21)
7.6 Integration and Search of Eigenvalues 133
As a result of integration with initial conditions IC, an appropriate point (u(3), v(3)) on the right edge y = 3 of integration segment is obtained. For an admissible solution this point should belong to the branch of solution damping on infinity (7.19): v ∞ = A1 exp(− ky ); u∞ =
v ∞′ − A1k exp(− ky ) ; = − ik − ik
u v
= −1 ⋅ i .
(7.22)
∞
Finally, information from Eqs. (7.22) sets the boundary condition that should be fulfilled on the right edge of the integration segment. The realization of this algorithm including Euler call and reference to uDv(t) is given in Fig.7.8. A valid value, an eigenvalue cimag of the problem, can be received as the solution of the non-linear equation in block “Given … Find”. Certainly, an explicit formulation of this non-linear “equation” does not exist, but there are the calling functions YUV, Euler, and uDv to calculate the ratio (u/v) on the right edge of integration segment. To make this ratio correct (equal to –i, see (7.22)) by means of selection of value cimag, the built-in function Find is used. N := 100
YUV( cIm) := Euler (IC , −3 , 3 , N , Dw , cIm)
(
V
uDv( t) := W
T
U
)
(
T
U
)
uinf ← YUV( t) 1 N vinf ← YUV( t) 2 N XY
uinf vinf
____________________________________________________ t := 0.45
Given
(
cimag = 0.46986
(
yuv := YUV cimag
−1
Im( uDv( t))
(
Re uDv cimag
cimag := Find ( t)
) ) = −1.336 × 10− 4
)
Fig.7.8. Search for eigenvalue cimag and eigenfunctions yuv (t – temporary name for cimag; 0.45 – first approximation)
In this example the calculations yield the value of phase velocity = i ⋅ 0.46986 for wave number k = 0.4. Thus, there is a solution with a positive imaginary part of the phase velocity. This implies, that exponential growth of perturbations will be observed (see (7.17)). For a certain time interval, originally small linear pulsations become large and already nonlinear and finally reach values, commensurable with the basic flow velocity. A real estimation is approximately 10% from U0, and there will be a passage from laminar to turbulent flow. Similar evaluations can be carried out also for other wavelengths. The perturbations with dimensionless wave numbers k (see (7.2)) within interval (0 ÷ 1) will be unstable. Z
134 7 Rayleigh’s Equation: Hydrodynamical Instability
7.7
Returning to the Real Domain
Distributions of real and imaginary parts of complex amplitudes calculated for longitudinal u and transversal v velocity pulsations are shown in Fig. 7.9. The distributions have extrema in the area of the shear layer, where the basic flow velocity (Fig. 7.1) strongly varies, and the first and second derivatives are nonzero (Fig. 7.10). On both sides of the shear layer, damping of perturbations occurs. [
y := yuv
\
[
0
u := yuv
\
[
1
\
v := yuv
2
i := 0 .. N
2
2
Re( v) Im(v)
Re( u)
1
0
Im( u)
2
0
4
2
0
2
4
4
4
y
2
0
2
4
y
Fig. 7.9. Distributions of complex amplitudes in shear layer f ( y) := tanh( y) 1
d2 f ( y) 2 dy d f ( y) dy f ( y)
0.5
0
0.5
1
2
0
2
y
Fig. 7.10. The basic flow velocity and its derivatives
Automatically a question arises as to the analysis of these distributions: how can the complex (imaginary) amplitudes represent the real flow field. To answer the question we should return to presentation of the pulsations through the complex amplitudes (ua va) and the wave factor h in Fig. 7.4 and Eq. (7.17):
7.7 Returning to the Real Domain 135
u ( x, y, τ ) = u a ( y ) ⋅ h ( x, τ ) ; v ( x, y , τ) = v a ( y ) ⋅ h( x , τ) ;
(7.23)
h( x , τ) = exp(ik ( x − cτ)) = exp(kci τ ) exp(ik (x − c r τ )) . These complex (imaginary) expressions are solutions of the linear system of partial differential equations (7.8)–(7.10) with real coefficients. We have already analysed a similar problem in Sect. 2.3. Those results can be transferred practically without modifications to the problem considered here: If there is any complex solution of a linear system with real coefficients, then the complex conjugate function will also be a solution. Consequently, the real solution can be obtained from two complex conjugate solutions (see also Fig. 7.11) by: u r ( x, y , τ ) =
u := ur ( y) + i ⋅ ui ( y)
(
)
1 u a ( y ) ⋅ h ( x, τ ) + u a ( y ) ⋅ h ( x, τ ) . 2
(
)
(
h := exp k ⋅ ci ⋅ τ ⋅ exp i ⋅ k ⋅ x − cr ⋅ τ
(7.24)
)
cr ≡ 0
complex simplify → −exp k ⋅ ci ⋅ τ ⋅ −ur( y) ⋅ cos ( k ⋅ x) + ui ( y) ⋅ sin ( k ⋅ x)
(
Re (u⋅ h)
)(
)
factor
⎯complex u⋅ h + ( u⋅ h) simplify → −exp k ⋅ ci ⋅ τ ⋅ −ur( y) ⋅ cos ( k ⋅ x) + ui ( y) ⋅ sin ( k ⋅ x) 2 w factor
(
)(
)
Fig. 7.11. Calculation of longitudinal pulsation in real domain (ur(y), ui(y) – real or imaginary part of complex amplitude)
Alternatively, pulsations may be characterized by their mean square value. For a given value of coordinate y, space averaging (along x) of squared pulsation can be performed: L
u2 =
1 2 1 ur ( x , y , τ)2 dx = ua ( y ) exp(2ci kτ ) ; L0 2 ]
L=
2π , k
(7.25)
where L is any wavelength. We see that the module of complex amplitude is a measure of the root-mean-square pulsation. Distribution of root-mean-squares across a shear layer is shown in Fig. 7.12. The most energetic pulsations are concentrated on the stream centerline combined with a point of inflection in the basic flow velocity profile.
136 7 Rayleigh’s Equation: Hydrodynamical Instability
4 3
vi ui
2 1 0
4
2
0 yi
2
4
.
Fig. 7.12. Mean-square velocity pulsations in shear layer
7.8
Conclusion
So, having assumed existence of very small (infinitesimal) perturbations in an originally smooth shear flow, we have detected that their amplitudes will increase exponentially. The subject of the analysis was free flow with an inflection point in velocity profile, and we concluded that such flows appear absolutely unstable to small deviations. Originally small linear pulsations become quickly large and nonlinear and finally reach values, commensurable with the basic flow velocity. Irregularly moving curls fill the stream – and there will be a passage from laminar to turbulent flow. Though the considered linear theory describes only initial stages when the disturbances are still smallish, and one simple model problem was solved only, we have received an explanation of apparent dominance of turbulent flows in nature and engineering. Nevertheless, the account is detailed enough to help the interested reader when experimenting with solutions in the Mathcad programming environment and to advance further understanding of hydrodynamic stability theory. More complicated problems than considered here occur in research of wall boundary layers, of flow in pipes, or of two-phase stratified streams. Particular examples can be found in the literature [2, 41, 45, 55]. The general theory of perturbation methods (regular and singular) is also explained in books [23,56]. Area of application of these methods is much wider than only hydrodynamic instability problems. Therefore, familiarization with both the basic ideas of perturbation methods and with adequate computing techniques in Mathcad will often be useful in practice.
8
Kinematic Waves of Concentration in Ion-Exchange Filter
8.1
Introduction
The problem which we consider below in connection with kinematical waves phenomenon (see Sect. 1.5) arises in mathematical modeling of ion exchangers. These units are applied to treat water for steam plants at heat and nuclear power stations [11, 20, 27] and sometimes for domestic use. Ion exchangers can be employed for extracting precious metals from solution in hydrometallurgy. There are many other areas that use ion-exchange method. w
c0
ε
L
1− ε
z
Fig. 8.1. Ion exchanger (schematic)
A ion exchanger (below briefly, filter) is presented in Fig. 8.1. The filter, L in depth, contains ion-exchange beads (with ionite). An aqueous solution together with undesirable ions (pollution) percolates through the porous bed of ionite. The following quantities are important parameters of the filter: • Porosity, or water volume fraction: ε=
•
volume filled with water entire volume of filter
Ion-exchange (ionite) volume fraction: (1 – ) ^
•
Concentration of impurities in the water at input: c0 =
mass of impurities volume of water
(8.1)
138 8 Kinematic Waves of Concentration in Ion-Exchange Filter
•
Superficial water velocity defined by volume flow rate related to the empty cross section (perpendicular to coordinate z) of filter column: w,
volume flow rate of water . area of entire cross section of filter column
Velocity w is called superficial because we assume water to pass through the entire cross section of filter column; (actual velocity being 1/ times as large). Further if we refer to porous bed it will mean the certain volume part which is filled with water, and (1– ) is occupied by ionite. If the concentration of impurities absorbed by the ionite is less than the limiting equilibrium value q0, the water will be purified. When this limiting value will be reached, purification stops. The mathematical model to simulate the process of purification should describe the spatial-time distribution of the concentration in the column and estimate the time at which the ionite is exhausted. In other words, our intention is to determine the distribution c(z, ) of impurities throughout the column depth (co-ordinate z in Fig. 8.1) for different times and to forecast the moment when the concentration of impurities in treated water leaving the filter will reach the acceptable limit. The main stages of work in this chapter are: • To formulate the differential equation of impurity concentration in water • To analyze different adsorption isotherms and to formulate equation of adsorption as the closure equation for differential mathematical model • To solve differential equation of concentration and to find the distribution c(z, ) of impurities. ^
^
^
_
_
8.2
Conservation Equation for Concentration in Filter
To formulate the conservation equation of adsorbed impurities, two other quantities should be determined: • The concentration of the impurity ions in the ionite q,
•
mass of impurities in the ionite beads entire volume of filter
The total concentration of the impurity ions in filter ρ,
mass of impuities in filter . entire volume of filter
Certainly, these quantities are local characteristics: q = q( z, τ); ρ = ρ(z, τ )
8.2 Conservation Equation for Concentration in Filter 139
The quantities c, q, their definitions: a
ρ
are interconnected by Eq. (8.2) obtained immediately by `
=
mass of impurities volume of filter
+
q b
mass of impurities volume of filter
(ε
⋅
c
volume of water volume of filter
c) d
mass of impurities volume of water
(8.2)
The meaning of the quantity in parentheses is: the impurity concentration in water multiplied by the porosity gives the impurity concentration in water per entire volume of porous bed (which includes water and the ionite beads). Now we can write the conservation equation for the control volume of filter based on the general form of the balance equation (1.11). The impurity density , i.e. the impurity content in a unit of control volume, we have just discussed. The generalized flow of conserved quantity (impurity in this case) is calculated as the concentration multiplied by the superficial velocity: e
Φ=
i
f
mass of impurities volume of water
⋅
=
w g
(volume of water)/tim e (area of total cross section )
i
w
h
mass of impurities (area of total cross section )⋅time
There is no internal source in the problem, equation (1.11) becomes: ∂ρ = −div(c ⋅ w) . ∂τ
j
(8.3)
= 0. Consequently the balance
(8.4)
For one-dimensional problem, substituting of relationship (8.2) for the total concentration of impurities results in: ∂q ∂c ∂ ( c ⋅ w) +ε =− . ∂τ ∂τ ∂z
(8.5)
The equation contains two unknown quantities, q and c. To get a closed problem, a relationship between these two variables must be found. Let as assume the distribution of the impurity concentration between the ionite beads and water to be at equilibrium. To understand the physical meaning of the simplified suggestion we can imagine that simultaneously water is flowing very slowly through the ionite column and mass-transfer between ionite and water is very rapid. The mathematical model of such rapid converge to equilibrium is discussed in Chap. 4 in the section on stiff differential equations. For a problem considered now the relaxation equation can be formulated as follows: ∂q = −α ⋅ q − qeq (c ) , ∂τ
(
)
(8.6)
where qeq(c) – impurity content at equilibrium, corresponding to adsorption isotherm of the ion-exchanger. We should bear in mind, however, that the concentration c is an unknown function of time before solving the problem.
140 8 Kinematic Waves of Concentration in Ion-Exchange Filter
The coefficient (relaxation parameter) will be large if the intensity of masstransfer in the “solution -- ionite” system is high. Thus, establishment of the equilibrium will be rapid: any deviation of concentration q from equilibrium qeq will quickly attenuate according to exponential law. We can thus assume that at the limit: k
q ≈ qeq (c ) .
(8.7)
As we are considering only this case the subscript “eq” can be removed. The relationship is therefore: q = q(c )
(8.8)
which will further signify the given adsorption isotherm. The complete description of the problem must take into account the finite masstransfer rate and includes both, the two differential equations (8.5), (8.6) and the adsorption isotherm (8.7). Appreciably simpler is the equilibrium model with infinite mass-transfer. It only includes the differential equation (8.5) and the adsorption isotherm (8.8). 8.3
Wave Equation for Concentration
The impurity concentration q in the ionite can be eliminated from the conservation equation (8.5) using the adsorption isotherm (8.8), then the differential equation for the impurity concentration in water becomes: ∂c( z , τ) dq( ) ∂ ( z, τ) ∂ ( c (z , τ ) ⋅ w) +ε =− . dc ∂τ ∂τ ∂z l
l
As the velocity of solution is constant we can derive the wave form of the concentration equation after some simple conversions and collecting terms to: r
o
p
m
w ∂c( z, τ) ∂c( z , τ ) + =0, dq( ) ∂τ ∂z +ε dc p
m
p
m
p
(8.9)
m
q
n
s
where the term in parenthesis is the wave velocity, i.e. the velocity of impurity concentration waves in the column, or the advance velocity of the front with given concentration: Vw ≡
w . dq( ) +ε dc
(8.10)
t
The detailed derivation of an equation similar to (8.9) can be found in Sect. 1.5.
8.4 Dimensionless Formulation
8.4
141
Dimensionless Formulation
With given scales L, w, c0, q0, the following system of dimensionless variables and parameters can be obtained. The dimensionless independent variables, length co-ordinate and time, will be: Z = z / L; T = ⋅ w / L . u
•
(8.11)
The basic parameters of ion-exchanger are: the distribution ratio cqRat: cqRat = c0 / q0,
(8.12)
where q0 is equilibrium concentration in the solid phase taken from the adsorption isotherm when initial concentration in water is c0 • the porosity (in programs and below, it is designated by Por, see Fig. 8.7). It should be noted that q0 not always coincides with so-called total capacity, which is the maximum adsorption capacity qsat. This distinction demonstrates Langmuir isotherm: v
q0 = qsat
a ⋅ c0 , 1+ a ⋅ c 0
(8.13)
which is written here as the relationship between input concentration c0 and corresponding equilibrium value q0. The value qsat is the amount of adsorbed matter in saturation. The equilibrium value q0 decreases with the diminishing of input concentration in solution. If concentration c0 is high the equilibrium concentration q0 approaches qsat. Parameter a can be eliminated from (8.13) by: a=
q0 1 , qsat − q0 c0
and the Langmuir equation for solutions can therefore be written as follows: c k q c0 = ; q0 1 + (k − 1) c c0
k≡
qsat . qsat − q0
(8.14)
This form of equation is convenient for computation modeling. However, we should keep in mind that values q0 and k depend on the initial concentration c0. The typical concentration for water at the input is about 0.2– 0.4 (g of impurities)/(kg of water), or 200–400 g/(m3 of water). With such initial concentration in the water, the capacity of the ionite amounts between 300 and 700 grams-equivalents/(m3 of column) depending on the type of ionite (e.g., for NaCl: 1 gram-equivalent = 58 g). Approximate values of the distribution ratio are determined as follows:
142 8 Kinematic Waves of Concentration in Ion-Exchange Filter
cqRat = c0 / q0 ≈ 200/(700⋅58) = 0.005. The dimensionless dependent variable C is introduced as a ratio of current value of concentration in water to input value: (8.15)
C = c(z,τ) / c0. The relative impurity concentration in the solid phase is: Q = q(c) / q0.
(8.16)
The dimensionless wave velocity from (8.10) becomes: Vwave ≡
Vw cqRat . = dQ (C ) w + Por ⋅ cqRat dC
(8.17)
With these variables, the wave equation can be written as follows: ∂ ( Z ,T ) ∂ (Z ,T ) + Vwave (C ) =0. ∂T ∂Z w
w
(8.18)
The conservative form of the wave equation is more useful for numerical computations (as presented in the next chapter): ∂ ∂ (W (C (Z , T ))) + =0. ∂T ∂Z x
(8.19)
The relationship for flow W results from comparison of (8.18) and (8.19): C
W (C ) = Vwave (C ) ⋅ dC ; y
Vwave (C ) =
0
dW (C ) . dC
(8.20)
The extra relationship “wave velocity – concentration” Vwave(C) (or the “flow density – concentration” W(C)) is required to integrate the differential equations (8.18) or (8.19). These closed equations can be obtained, if the adsorption equation, for example in form of equation (8.14), is given. 8.5
Isotherm of Adsorption
The classical adsorption isotherm (see the theory of adsorption in textbooks of Physical Chemistry) reproducing saturation limits is described by the Langmuir equation (8.13), which is given here in the form (8.14) adapted to our problem about filters: Q=
kC ; 1 + (k − 1)C
k q ≡ sat ≡ Qsat ; k − 1 q0
k≡
Qsat ; Qsat > 1 . Qsat − 1
(8.21)
8.5 Isotherm of Adsorption 143
Fig. 8.2 shows the Langmuir curve; the fiducial point (c0,q0) has dimensionless coordinates (1,1). k := 2
Q ( C ) :=
k⋅C 1 + ( k − 1) ⋅ C
2
Q ( C) refr ( 1)
1
0
0
1
2
3
4
5
C,1
Fig. 8.2. Langmuir isotherm
Langmuir isotherm describes strong adsorption when binding energy between impurity molecules and solid surface is high. The adsorption curve depends on saturation, because the number of molecular vacancies in the adsorbed layer becomes less and less with increasing concentration in solution. Convex curves like this are usually associated with strong adsorption profiles. Functions as (8.21) are also used in the theory of adsorption in binary solutions when filling of adsorption layers occurs under competition of two types of molecules [8]. In this case C and Q are the fractional parts in the solution and in the adsorption layer, respectively, that vary in the range from 0 to 1. Unlike Langmuir isotherm (8.21), k can be less than unity. This results in a concave isotherm (Fig. 8.3), and this is characteristic for weak adsorption, i.e. adsorption with low cohesive energy between the impurity molecules and the adsorbent. As the adsorption layer is filling, conditions for subsequent attachment improve and “exponential growth” renders the curve concave. k := 0.5
Q( C ) :=
k⋅ C 1 + ( k − 1) ⋅ C
1
Q ( C) 0.5
0
0
0.5
1
C
Fig. 8.3. Weak adsorption from the solution
144 8 Kinematic Waves of Concentration in Ion-Exchange Filter
Before modeling filter functioning numerically, we consider now the adsorption equilibrium constant k, which depends on the concentration C according to empiric data, and apply the following form of the functional dependence:
|
|
Qsat k( ) ≡ Qsat − 1 1 +
n
}
}
z
}
z
z
}
~
z
n
{
~
{
,
(8.22)
where Qsat and exponent n are empirical fitting parameters. The adsorption curve is now defined by the following equation: k( ) ⋅ C Q( ) = , 1 + (k ( ) − 1) ⋅ C
(8.23)
which is charted in Fig. 8.4 for Qsat = 2 and several values of n. The form and content of the obtained model resembles logistic model with limited growth (see Fig. 1.8). This model simulates ion exchange saturation by high values of concentration in solution. The unit value Q = 1 by C = 1 is a fiducial point on the adsorption curve (Fig. 8.4). To define equation (8.23) completely we need the fiducial concentration c0 of the solution (dimensional), corresponding equilibrium value q0 of the ionite, saturation capacity qsat > q0 of the ion exchanger under consideration, and exponent n in formula (8.22). n
(
)
Qsat ⋅ Qsat − 1
(
)
k C , Qsat , n ⋅ C 1 + k C , Qsat , n − 1 ⋅ C
k C , Qsat , n :=
Q C , Qsat , n :=
C
1+ C
( ((
n
) )
)
Qsat := 2 3
Q
2
1
0
0
1
2
3
C
n = 0.5 n=2 n=4 fiducial point
Fig. 8.4. Logistic curve of adsorption
8.5 Isotherm of Adsorption 145
Langmuir isotherm (Eq. (8.21), Fig. 8.2) and logistic curve (Eqs. (8.22), (8.23), Fig. 8.4) can be considered as the basic structure for describing more sophisticated cases. Sometimes, a two-level curve is observed that can be interpreted as successive filling of two adsorption layers. Such curves can be obtained by superposition of the basic structures as shown in Fig. 8.5.
( ((
) )
k C , Qsat , n ⋅ C Q1 C , Qsat , n := 1 + k C , Qsat , n − 1 ⋅ C
(
k2 := 10
)
)
k2 ⋅ C Q2 (C ) := 1 + k2 − 1 ⋅ C
(
)
3
Q1( C , 2 , 4) +Q2 ( C)
2
Q2( C) Q1( C , 2 , 4)
1
0
0
0.5
1
1.5
2
C
Fig. 8.5. Two-level Langmuir adsorption
The summation of these curves has a distinct physical meaning. At first, strong adsorption occurs while the first adsorption layer is being filled. Here interaction “adsorbate – adsorbent” plays the dominant role. Then the second layer is formed in the weak adsorption scenario where the interaction “adsorbate – adsorbate” plays the key role. The two-level curve is similar to Brunauer–Emmett–Teller (BET) multimolecular adsorption curve (Eq. (8.24), Fig. 8.6): amb a=
p 1− ps
p ps
,
p 1 + (b − 1) ps
(8.24)
where p is gas or vapour pressure above a solid surface, ps – saturation pressure, b – adsorption equilibrium constant and am is adsorption value corresponding to dense monomolecular layer. (In Fig. 8.6 relative quantities are used: pr = p/ps, qr = a/am).
146 8 Kinematic Waves of Concentration in Ion-Exchange Filter b ⋅ pr qr pr , b := 1 − pr ⋅ 1 + (b − 1) ⋅ pr
(
)
(
)
4
(
)
qr pr , 30
2
0
0
0.5
1
pr
Fig. 8.6. BET adsorption
The BET-curve presented above does not have a horizontal saturation line. Its behavior as p ps is absolutely different: this is the transition to vapour condensation with formation of a macroscopic film. Apparently, more realistic curves for solid matter adsorption in aqueous solutions are those with horizontal asymptotes, when solubility limit of an impurity in water noticeably exceeds the concentration for which an ionite reaches saturation. Using the basic forms of adsorption equations described above and severely limited set of coefficients we can find proper approximations for the base types of observable adsorption isotherms. Let us note here that our purpose was not to perform a concrete analysis of physicochemical mechanisms of ion exchange, but to construct the models of a logistics type.
8.6
Solving a Wave Equation Using Method of Characteristics
Using method of characteristics to solve wave equation such as (8.18) was specified above in the problem about concentration waves of cars on motorway (see Sect. 1.5). In the problem concerning an ion exchanger, the values of impurity concentration C in water are constant along the characteristics, and the characteristics themselves are straight lines in the plane (Z, T). The characteristic slope, i.e., the wave velocity, is described by Eq. (8.17) and depends on the form of adsorption isotherm Q(C). Langmuir isotherm. Now we consider the case when adsorption is described by the Langmuir isotherm (Eq. (8.21), Fig. 8.2). The wave velocity calculations are described in Fig. 8.7. The values of parameters such as porosity are the arguments of the wave velocity function. Dimensionless inlet concentration equals unity. Assumed value of the parameter k which equals two corresponds to the filter operation on the initial part of the isotherm (see location of the fiducial point refr in Fig. 8.7). The main conclusion, which follows from the calculations, is: the
8.6 Solving a Wave Equation Using Method of Characteristics 147
wave velocity increases with increasing concentration. Later we shall see what features of space-time changes in concentration will result from this. Q( C , k) :=
k⋅C 1 + ( k − 1) ⋅ C
Vwave( C , k , Por , cqRat) :=
cqRat
d Q ( C , k) + ( Por ⋅ cqRat) dC 0.03
2
Q ( C , 2) refr ( 1)
Vwave ( C , 2 , 0.4 , 0.005) 0.02 1
0
Vwave ( 1 , 2 , 0.4 , 0.005)
0
0.01 0
2
0
2
C,1
C ,1
Fig. 8.7. Wave velocity of a unit operating according to the Langmuir isotherm
The computations of the impurity concentration are made in Mathcad program in Fig. 8.8 and Fig. 8.9. The initial distribution of concentration along the filter is defined by user function init (z0) in Fig. 8.8 as a “fuzzy” step (see curve Ci,0 in Fig. 8.9). The characteristics with the initial value init (z0) begin at points z0. The second user function defines dependence of wave velocity Vwave on concentration. The third is the equation of the characteristics.
k := 2
( )
Cinit z0 :=
Por := 0.4
cqRat := 0.005
1.00 if z0 < 0
( )2 Vwave( z0 , k , Por , cqRat) :=
exp − 5z0
otherwise cqRat k
( ) z( τ , z0) := z0 + τ ⋅ Vwave ( z0 , k , Por , cqRat)
1 + Cinit z0 ⋅ ( k − 1)
2
+ ( Por ⋅ cqRat)
Fig. 8.8. Computation of characteristics starting from points z0
148 8 Kinematic Waves of Concentration in Ion-Exchange Filter z0_min := −1 τ min := 0
z0_max := 1 τ max := 160
i := 0 .. Ni
j := 0 .. Nj
(
)
Ni := 40 Nj := 80
(
)
i z0 := z0_min + z0_max − z0_min ⋅ i Ni
j τ j := τ min + τ max − τ min ⋅ Nj
Zi , j := z τ j , z0
Ci , j := Cinit z0 i
(
)
i
Ti , j := τ j
Ci , 0
( )
1
Ci , 40 Ci , 80 0 2
( Z , T , C)
0
2
Zi , 0 , Zi , 40 , Zi , 80
Fig. 8.9. Umklapp process for filter operating according to convex adsorption isotherm (Langmuir isotherm)
The subsequent computations (Fig. 8.9) are based on the fact that characteristics are the contour lines of function C(Z, T). The left plot is three-dimensional, the vertical axis is concentration; axes in horizontal plane are co-ordinate Z (marks –1, 0, 1) and time T. The plot is created using a parametric method (Parametric surface plot). To make this plot, two sets of points are created: one – of initial points z0 where the characteristics begin, and another – of points of time where computations will be made. Further, the grid in the plane (Z, T) with nodes (i, j) is created, and the concentrations are calculated in these points. The right plot is two-dimensional diagram representing concentration throughout the filter for three moments: initial (time index, i.e. the second index of an array, equals zero) and two subsequent with time index 40 and 80. When the aqueous solution passes through the filter, the initial profile of concentration (fuzzy step, curve Ci,0 in the right plot) shifts along the filter but then becomes deformed. Deformation results from the concentration dependence of the wave velocity. The wave segments with higher concentration advance (from left to right) with higher velocity, the wave segments with lower concentrations lag behind. The wave front (initially fuzzy) becomes steep, and then the wave umklapp occurs. An ambiguity arises: for one point in the Z,T-plane, three concentration values C are calculated, that is impossible from a physical point of view. One more illustration of the wave umklapp phenomenon is given by the contour diagram C(Z, T) = const in Fig. 8.10, constructed on the same data as in Fig. 8.9. We observe intersection of characteristics (lines of constant values of impurity concentration) that means again intolerable multivalued solution.
8.6 Solving a Wave Equation Using Method of Characteristics 149
( Z , T , C)
Fig. 8.10. Intersection of characteristics
The jump solutions resolve the contradiction between the formal multiplevalued solution and physical meaning of the problem. Instead of wave umklapp, that we obtain later (see Sect. 9.5) by means of special numerical procedure, the concentration jumps similar to shock waves in gas dynamics. Concave adsorption isotherm. For comparison, we calculate propagation of the concentration waves for filter operating according to concave isotherm (Fig. 8.11). Parameter k is assumed to be 0.5, producing concavity (see Fig. 8.3 and explanations). In this case, wave velocity decreases with increasing concentration. Evolution of concentration front is calculated using the same program (see Fig. 8.8 and Fig. 8.9), but with modified k-value. The calculated results are shown in Fig. 8.12. Obviously, the original steep concentration front is smeared throughout the filter because the parts of the curve with low concentrations move faster than the parts with higher concentrations. Q ( C , k ) :=
k⋅C 1 + (k − 1) ⋅ C
V wave ( C , k , Por , cqRat ) :=
cqRat
d Q ( C , k ) + ( Por ⋅ cqRat ) dC
2
0.01
1
Vwave ( C , 0.5 , 0.4 , 0.005 ) Vwave ( 1 , 0.5 , 0.4 , 0.005 ) 0.005
Q ( C , 0.5 ) refr ( 1)
0
0
2
C ,1
Fig. 8.11. Wave velocity for concave isotherms
0
0
2
C ,1
150 8 Kinematic Waves of Concentration in Ion-Exchange Filter
(
Zi , j := z τ j , z0
)
i
Ti , j := τ j
( )
Ci , j := Cinit z0 i
Ci , 0
1
Ci , 40 Ci , 80 0
2
( Z , T , C)
0
2
Zi , 0 , Zi , 40 , Zi , 80
Fig. 8.12. Smearing of the concentration front for filter operating according to concave adsorption isotherm
8.7
Conclusion
Thus, analyzing concentration waves in the ion exchanger by method of characteristics, we found the umklapp phenomenon with multivalue solution. In the other examples blurring of the originally steep concentration front due to rarefaction waves was observed. The deformation of a starting profile is typical for transmission by nonlinear waves. We have shown a similar phenomenon previously in the Sect. 1.5 concerning car concentration waves on motorways (compare Fig. 8.9 and Fig. 1.16). In fact, the shock waves hide behind the violation of uniqueness of solution. To simulate the shock waves a special numerical procedure is required. We have to recognize that this problem – although feasible – is difficult for programming in Mathcad. We proceeded as follows: we wrote and debugged the numerical procedure in Visual Basic with its effective debugging system and then imported it into Mathcad. Demonstration of this program reproducing generation and propagation of kinematic shock waves is given in the following Chap. 9.
9
Kinematic Shock Waves
9.1
Introduction
We continue solving wave equations in this chapter. The main point is to develop numerical integration methods providing effective simulating of a shock wave. We investigated the shock waves produced on roads (see Sect. 1.5) and in ion exchangers (see Chap. 8) and now consider one more problem of this type: the shock waves of gas content in gravitational bubble flows. The basis of analysis will be the conservation equation in a generalized form: ∂ϕ = −div( ) + γ . ∂τ
(9.1)
The variable ϕ defines the content of the transferred substance per unit of control volume. According to (9.1), the rate of increase of quantity ϕ in control volume (left part) results from inflow through its surface (first component on the right) and from internal sources (second). Divergence operator in balance equation (9.1) determines the summed flow of the vector flux density Φ through the surface of differential control volume, along the line of the exterior normal. The result is related to volume unit. The minus sign is necessary because the flow into the reference volume is to be calculated. The divergence in Cartesian coordinates is defined via derivatives of vector Φ components according to: div( ) =
∂Φ x ∂Φ y ∂Φ z + . + ∂z ∂y ∂x
Further we shall consider one-dimensional problem without internal sources, equation (9.1) then becomes: ∂ϕ ∂Φ =− . ∂τ ∂z
(9.2)
The mathematical description is closed by an equation which gives dependence of flux Φ on ϕ, Φ = Φ(ϕ), e.g. such as Eq.(1.45) in the problem about traffic jams in Sect. 1.5. Differentiating the right part of (9.2) by the rule of composite function, we can write the conservation equation in the form of a wave equation:
152 9 Kinematic Shock Waves
dΦ(ϕ) ∂Φ ∂ϕ ∂ϕ , ≡ −V (ϕ) =− dϕ ∂z ∂z ∂τ
(9.3)
where V is a wave velocity, and we can solve it by the method of characteristics (Sects. 1.5, 8.6). However, formal use of the method can result in non-physical ambiguous solutions, which denotes formation of shock waves in reality. 9.2
Conservation Equation in Finite-Difference Form
Now we turn to formulation of the mathematical model, which will enable us to describe formation and evolution of the shocks. The initial correlation will be the conservation equation in its original form (9.2), representing clearly meaning of conservation law: the net influx with a flow Φ results in increase of content in the control volume. To formulate the model we start with the balance equation for finite reference volume, not for the differential volume as it was in the original Eq. (9.2). The investigated object is composed of such finite volumes and the balance equations for each of them form the system of equations solved on the computer. Control volume in one-dimensional problem is a block thick ∆ z, and two other dimensions are assumed to equal unity (there are no changes along these directions in the object, Fig. 9.1).
j
j-1
j+1
j -1
j
j +1
Z
Z
j –1
j
j +1
Z
Fig. 9.1. Control volumes for one-dimensional problem
The balanced equation for finite control volume and for small but finite time interval becomes:
ϕ(τ + ∆τ) − ϕ(τ) 1 ⋅ = − Φ ( z + ∆z ) − Φ ( z ) . ∆z ∆τ Inflow through
¤
¤
Rate of increase in control volume ¡
¡
£
¡
¡
¢
Outflow through the right side ¡
£
¡
¢
the left side
(9.4)
9.2 Conservation Equation in Finite-Difference Form 153
Eq. (9.4) shows the main idea of the finite-difference scheme. In numerical analysis, there are many implementations of this general idea, which must ensure high accuracy and (on the assumption of not too small fragmentation) also stability and convergence in calculations. One more requirement is added to our problem: simulating of the shock waves, i.e. the correct processing of discontinuities. One of the best schemes of this kind is the MacCormack method [1, 7, 28, 32]. Each time step is executed in two stages. First, the prediction of changes is implemented for a small time interval ∆τ, and then correction is carried out taking into account the results calculated from the prediction. Conceptually, the scheme is similar to the Euler method of the second order for numerical solution of ordinary differential equations. Eq. (9.4) can be written for the prediction stage as follows: Old ϕ Pre =− j −ϕj
(
)
∆τ Old . Φ j +1 − Φ Old j ∆z
(9.5)
The right part contains the resulting inflow as forward difference in Φ (see Fig. 9.1). Accordingly, the left part gives increase of content in the reference volume for the time interval . The denotation Old indicates that the values are taken from the previous time step (or from the initial conditions in the first time step). So, from (9.5) the prediction value for with denotation Pre can be calculated. At the correction stage, the right part is calculated as arithmetic mean value of the resulting inflows in the beginning and at the end of time interval : ¥
¦
§
¥
¦
(
ϕ New − ϕOld =− j j
)
(
)
1 ∆τ Old ∆τ Pre Φ j +1 − Φ Old + Φ j − Φ Pre j j −1 . 2 ∆z ∆z
«
¬
§
ª
©
¨
(9.6)
Thus, the new content jNew at node j is calculated through forward difference of ΦOld and backward difference of Φ Pre. A noticeable symmetry of the numerical scheme and hence increased order of approximation (improved precision) result from using the time averaging and the differences forwards and backwards. Eq. (9.6) can be written in a form which is more handy for the calculations if the difference of the old values ΦOld in the right part is substituted from (9.5), that gives: ¥
ϕ New − ϕOld = j j
(
)
(
)
1 Pre 1 ∆τ Pre ϕ j − ϕOld − Φ j − Φ Pre j j −1 . 2 2 ∆z
(9.7)
Thus, Eqs. (9.5) and (9.7) form the MacCormack numerical scheme. Software implementation is given below. We remind the user that dimensions of the generalized quantities in (9.7) are written as follows: – density (or concentration) of a certain extensive quantity, i.e. its con• tent per unit of the reference volume, ¥
154 9 Kinematic Shock Waves
(∗)
[ϕ] = •
m3
,
Φ – flux density of that quantity; according to (9.1) or (9.2), dimension of Φ should be:
[Φ] = [ϕ] m = s
(∗) m 2s
.
The asterisks denote the dimension of the particular transferred extensive quantity. We can see that contains a velocity. Therefore, it is convenient for the calculations to introduce a certain characteristic, dimensioned velocity wmas and to rewrite the basic equations (9.5) and (9.7) of the numerical method as follows: ®
Old ϕ Pre =− j −ϕj
ϕ New − ϕOld = j j
(
(
)
∆τ ⋅ wmas Old W j +1 − W jOld ; ∆z
)
(9.8)
(
)
1 Pre 1 ∆τ ⋅ wmas ϕ j − ϕOld − W jPre − W jPre −1 , j 2 2 ∆z
(9.9)
where W = Φ / wmas – generalised flux. Dimensionless combination of the time step, space step, and velocity scale, ∆τ ⋅ wmas ≡ ∆z
∆τ ³
²
∆z wmas
time step time for transmission over
≡ ±
²
´
´
¯ ²
²
¯
³
°
µ
, ±
¯
¯
(9.10)
°
length z of control volume
is termed the Courant number. The obvious interpretation written on the right shows that the Courant number should not exceed unity in the calculations otherwise significant changes will occur in the system during the time step, which is contradictory to the basic idea of numerical analysis: steps of discretization should be small to make the finite differences of type (9.8) and (9.9) to accurate approximations. 9.3
Discontinuous Solutions. Shock Waves
As was already presented in Sects. 1.5, 8.6, the discontinuous solutions of Eq. (9.3) are possible, if the wave velocity depends on concentration. We must remind the reader, that “concentration” is understood in generalized sense and can mean concentration of automobiles on a road, concentration of an impurity in water passing through a filter, or finally gas (vapor) content in two-phase flow. In all these cases the identification of jumps (shock waves) is of high practical importance. In a problem about traffic the jump means stop and go on the motorway. In problems about the filter the jump on concentration can mean expansion
9.3 Discontinuous Solutions. Shock Waves
155
of intolerable contamination of water. In problems about two-phase flow the jump of gas content can result in foaming. Let us consider further the jump problem in terms of two-phase flow to avoid a stereotype and to underline the generality of methods for various problems. The parameters of two-phase flow will be surveyed in detail below (Sect. 9.7). But here, several simple definitions will be enough. Under gas content ϕ we understand volume ratio (volume concentration) of gas or vapor bubbles in fluid. As a generalized flux, Φ, a superficial velocity w of gas will appear, i.e. volumetric flow rate of gas related to the entire cross-section. It is useful to interpret velocity as volumetric flux: the velocity of a medium is a volume (m3), moving through a flow cross-section (m2) for a time unit (s), m3/(m2 s) = m/s. This explanation is applicable to the next equations linking the superficial velocity w and true velocity v: w = ϕ⋅v .
(9.11)
The values of vapor content ϕL and ϕR on the left and on the right of the shock front (see Fig. 9.2) differ to a finite extent. The shock wave as a discontinuity surface moves with velocity VShock. The kinematic coupling condition can be formulated as equality of vapor (gas) volumetric fluxes on both sides of the interface: ϕ L (v L − VShock ) = ϕ R (v R − VShock ) .
(9.12)
The true velocities of the vapor phase vL and vR are taken relative to interface velocity VShock. From (9.12) and (9.11) the relationship for shock velocity is as follows: VShock =
¶
(9.13)
¶
L
v2L
wL − wR . ϕL − ϕ R
R
v2R VShock
Fig. 9.2. Shock wave
z
156 9 Kinematic Shock Waves
9.4
MacCormack Method. Computing Program McCrm
Visual Basic Program The algorithm for calculations is presented below as a listing of the really functioning Visual Basic program. The original program was designed by us for the waves of vapor content in two-phase flow, and now we present the specifications. The quantity w2 represents the reduced vapor (gas) velocity. It is an equivalent of the generalized stream . The identifier phi denotes vapor (gas) content. The same label we use for generalized transferable quantity (it can also be concentration of automobiles on motorway in the problem about traffic jam or concentration of an impurity in filter problem). The identifier Dat.jH sets number of nodes on the coordinate axis, and Dat.Cour – the Courant number, i.e. dimensionless time step, ·
¸
Dat.Cour ≡
∆τ ⋅ wmas , ∆z
(9.14)
where wmas – the velocity scale. Prefix “Dat.” designates belonging to some data structure in Visual Basic program. Function subprogram Vel(phi).Flux calculates the flux W( ). This function is individual for each problem. FCT means call to the subprogram Flux-Corrected Transport method, improving handling of shocks (of discontinuity). ¸
The text of Visual Basic program: _____________________________________________________ Public Sub MacCormack() Dim i as Integer, j as Integer ReDim w2Old(Dat.jH) As Double, w2Pre(Dat.jH) As Double ‘=============================================== iTime = 0 For i = 1 To iTimeMax iTime = i phiPre(0) = phiNew(0) phiPre(Dat.jH) = phiNew(Dat.jH) For j = 1 To Dat.jH w2Old(j) = Vel(phiOld(j)).Flux Next ‘================================================ For j = 1 To Dat.jH – 1 'Prediction phiPre(j) = phiOld(j) – Dat.Cour * (w2Old(j + 1) – w2Old(j)) Next For j = 0 To Dat.jH – 1 w2Pre(j) = Vel(phiPre(j)).Flux Next
9.4 MacCormack Method. Computing Program McCrm 157
‘===================================================== For j = 1 To Dat.jH – 1 'Correction phiNew(j) = 0.5 * (phiOld(j) + phiPre(j)) – 0.5 * Dat.Cour * (w2Pre(j) – w2Pre(j – 1)) Next ‘====================================================== FCT ‘Flux-Corrected Transport For j = 0 To Dat.jH: phiOld(j) = phiNew(j): Next Next ‘Time End Sub Mathcad Program When designing the Mathcad-program for the MacCormack method we have not simply copied from the Visual Basic program, but have modified it, using arrays for organization of parallel calculations. Two user functions Vec_Up and Vec_Down are needed to realize shift up and down of vectors for operating the right hand sides of (9.8) and (9.9) (see Fig. 9.3). These user functions include the built-in functions submatrix and stack. Vec_Up ( M , LastEl ) := stack ( submatrix ( M , 1 , rows ( M) − 1 , 0 , 0) , LastEl ) Vec_Down ( M , FirstEl ) := stack ( FirstEl , submatrix ( M , 0 , rows ( M) − 2 , 0 , 0) ) ¼ ¹
¼
½
¹
0 º
½
FirstEl º
½
½
¼ ¹
º
⇐
º
M :=
1
Vec_Down ( M , FirstEl ) →
º
½
2 º
0
½
½
½
0 º
½
º
º
1 ½
1 º
½
º
½
»
¾
»
2
3 ½
0 º
º
»
¾
¿
3
¼ ¹
2
¾
½
½ ¼ ¹
1 º
º
1 ½
½
º
º
Vec_Up ( M , LastEl ) →
2
½
2
½
º
º
½
3 º
»
»
¾
⇐
¾
3
LastEl
Fig. 9.3. Shift of vectors
Mathcad-program McCrm (Fig. 9.4) performs computations by the MacCormack method in one time step. The formal parameters of the procedure are: vector φ, specifying the distribution of required variable along coordinate axis; this is the result from previous time step or the initial distribution; value φL on the left end of integrating interval as boundary condition; dimensionless time step d , i.e. Courant number (see (9.14)). À
À
À
Á
158 9 Kinematic Shock Waves
The procedure returns vectors φNew as a new coordinate distribution of concentration (or gas content). McCrm ( φ , φL , dτ) :=
iRight ← last ( φ ) w ← Ws( φ ) wUp ← Vec_Up ( w , wiRight) "Predictor:" φPre ← φ − dτ ⋅ ( wUp − w) φPre 0 ← φL w ← Ws( φPre ) wDown ← Vec_Down ( w , w0) "Corrector:" φNew ← 0.5 ⋅ ( φ + φPre) − dτ ⋅ 0.5 ⋅ ( w − wDown) φNew0 ← φL
*
φNew
Fig. 9.4. Mathcad-program for MacCormack method
The generalized flux is denoted as w and calculated by external function Ws(φ). Both main formulas – predictor (9.8) and corrector (9.9) – are marked in the program (see Fig. 9.4) by comment. Let us underline, that all quantities, except for numerical parameters φL and d , are vectors. Due to this, the explicit cycles on coordinate nodes are eliminated completely in the Mathcad-version, different from the Visual Basic original code. Á
9.5
Shock Waves of Concentration in a Filter
Numerical Method and Mathcad-Program Earlier the physical and mathematical models of the filter were described in detail. The result was that the space-time distribution of concentration calculated by method of characteristics could be multy-valued and therefore physically not real. Now we present the Mathcad-design based on the numerical MacCormack method that correctly simulates the filter functioning in most situations, including the formation of impurity concentration shock waves. In the first computational block (Fig. 9.5), Eqs. (8.17), (8.20), and (8.21) are used from previous chapter for adsorption isotherm Q(C), wave velocity Vwave(C) and flux W(C) of impurity. It is necessary to take into account that in further coding of the programs McCrm and TimeHistory the identifier C is replaced by the
9.5 Shock Waves of Concentration in a Filter 159
universal label φ. The function Ws(φ), specifying the functional dependence “flux – concentration”, is produced in the shape of spline-interpolation; pspline and interp are firmware Mathcad functions. Let us make some further notes concerning symbols. Generalized flux and concentrations we usually denoted as Φ (or W) and . However, in the programs in basic, φ is serviceable for concentration, but in filter problems the mnemonic symbol is also used. The generalized flux in the text of the programs will be marked by w or more often by W. This is due to historical reasons, as at first we designed the programs for two-phase bubble flows, and the flux was the reduced velocity with a natural mnemonic symbol W. Â
Ã
k := 2
Por := 0.4
Q ( C , k) :=
cqRat := 0.005
k ⋅C 1 + (k − 1) ⋅ C
Vwave(C , k , Por , cqRat) :=
cqRat
d dC
C Ä
W ( C , k , Por , cqRat) :=
Q ( C , k) + ( Por ⋅ cqRat)
Vwave( t , k , Por , cqRat) dt Å
Æ
0
iMax := 10
i := 0 .. iMax
(
)
Yi := W Xi , k , Por , cqRat
(
Zi := Vwave Xi , k , Por , cqRat
Xi :=
i iMax
SplW := pspline ( X, Y)
)
g
(
)
Ws (φ) := interp SplW , X, Y , φ SplV := pspline (X, Z)
(
)
Vs ( φ) := interp SplV , X, Z , φ
Fig. 9.5. Dependence of flow on concentration in form of spline interpolation
The results of working of the first program block are shown in Fig. 9.6. The distinctive flow value Ws(1) at maximum concentration in the given example is cited ibidem. We shall need this value at the end of the calculations to compare shock wave velocity in the numerical experiment with theoretical values (see discussion of the question in detail below). Two user functions Vec_Up and Vec_Down and the basic calculating procedure McCrm are shown in Fig. 9.7. Here the numerical solution of the partial differential equation as detailed in (9.2) is realized. The main program, or the manager program (Fig. 9.8) organizes the order of the computation. Here the numerical parameters and constants are evaluated, the starting distribution and limit value of concentration are set, the loop in time is created which calls McCrm procedure that evaluates the MacCormack numerical method.
160 9 Kinematic Shock Waves
0.005
Vs( C)
Ws ( C)
0.005 0
0
1
C
Ws(1) = 5.818 × 10
0
1
C
−3
Fig. 9.6. Flow and wave velocity in an ion-exchanger operating by the Langmuir isotherm
Vec_Up ( M , LastEl) := stack ( submatrix( M , 1 , rows ( M) − 1 , 0 , 0) , LastEl) Vec_Down (M , FirstEl) := stack ( FirstEl , submatrix( M , 0 , rows ( M) − 2 , 0 , 0) ) McCrm ( φ , φL , dτ) :=
iRight ← last ( φ ) w ← Ws( φ ) wUp ← Vec_Up ( w , wiRight) φPre ← φ − dτ ⋅ ( wUp − w) φPre0 ← φL w ← Ws( φPre) wDown ← Vec_Down ( w , w0)
φNew ← 0.5 ⋅ ( φ + φPre) − dτ ⋅ 0.5 ⋅ ( w − wDown) φNew0 ← φL φNew
Fig. 9.7. Mathcad program of the MacCormack method
The meanings of the denotations is as follows: Slope – coefficient defining the front slope of the starting distribution φ_Init; z0 – maximum location in starting distribution; φMax – maximum value of the starting distribution; iZm – numerical steps in space coordinate; iTm – numerical steps in time; φL – boundary value on the left end of the integration segment; dτ – dimensionless time step (see below); keyFCT – keying signal showing whether (or not) to call) the flow correction function FCT (Mathcad program evaluating FCT function is rather bulky and we do not give the text of the procedure here). In addition it is necessary, applying the built-in function matrix and the user function φ_Init, to make an array (vector) φ of initial values as input for TimeHistory.
9.5 Shock Waves of Concentration in a Filter 161 Slope := 10
z0 := 0
φMax := 1
iZm := 60
iTm := 100
Í
2
Ç
φ_Init( iz , φMax) := φMax⋅ exp −Slope ⋅ Î
Ï
É
È
iz − z0 iZm ÌÊ
Ë
ÒÐ
Ñ
1 φ_Init( iz , φMax)
IC ( iz , jy) := φ_Init( iz , φMax)
0
φ := matrix(iZm + 1 , 1 , IC) keyFCT := 1
0
100 iz
φL := φ 0
dτ := 80
TimeHistory( φ , φL , dτ) := for iT ∈ 0 .. iTm
φNew ← McCrm( φ , φL , dτ)
φNew ← FCT( φ , φNew , dτ) if keyFCT φ ← φNew Ó
Φ
Ô
iT
←φ
Fig. 9.8. Step-by-step computation of shock wave evolution
Results of Computational Modeling The results of calculations are shown in Fig. 9.9. The function TimeHistory forms the array with columns containing coordinate distribution for different moments of time. The number of column conforms with the number of time step, and the number of row with the number of coordinate node. The visualization of space-time distribution of concentration is carried out in two ways. In the left-hand diagram the isolines of concentration, i.e. characteristics of the wave equation are given. This contour graph is constructed as Parametric surface plot using instructions Graph / Surface Plot / Contour Plot. The array F is used for creation of matrixes of coordinates Z (horizontal axis), time T (vertical axis) and concentration C. The same data are submitted in the diagram on the right of Fig. 9.9 as a series of concentration distributions on coordinate Z for the different moments of time. The diagram is constructed in the serial mode Graph / XY-Plot. In the C-contour diagram in the left part of Fig. 9.9, we can see that the characteristics of the different slopes merge, forming a shock wave. The reader is reminded to compare this to the previous treatment by the method of characteristics which resulted in crossing of the lines with different C-values, i.e. in physically unrealistic multivalued solutions (see Fig. 8.10).
162 9 Kinematic Shock Waves F := TimeHistory( φ , φL , dτ) iT := 0 .. iTm iZ := 0 .. iZm
ZiZ , iT := iZ
TiZ , iT := iT
C iZ , iT := FiZ , iT
35 54 1 C iZ , 0 C iZ , 20 C iZ , 40 0.5 C iZ , 80
0
0
50 iZ
(Z , T , 1 − C)
Fig. 9.9. Intersection of characteristics and shock wave generation (on the left); front slope increasing with shock wave generation (on the right)
The plot on the right of Fig. 9.9 shows development of the concentration front that was rather diffuse originally. The slope of the front increases gradually and the shock wave finally proceeds with steady speed. Ahead of it, (i.e. on the right) the purified water is situated and behind it (on the left) raw water. One should note that these situations are rather dangerous because the so-called impurity breakdown point is difficult to determine in time. In fact, when the shock wave reaches the final section of a unit, i.e. its operating capacity is exhausted, the low leading increase of concentration changes rapidly, stepwise, to inadmissibly high concentration of polluted water. The same effect is demonstrated below in the problem of concentration surge. To miss the timely moment would mean a breakdown or possibly an accident in the case of a filter in life support system. Another way to demonstrate wave propagation clearly and efficiently is through animation (Fig. 9.10). The columns of the matrix F are marked by built-in variable FRAME the upper and lower limits of which are set in Animate dialog box from View menu (in Mathcad 11 in a slightly different way: Tools/Animate/Record). If we select an option for preparation of a plot (as in Fig. 9.10) and click the “Animate” button, the process will be recorded. One can repeat the result in the Playback window as a video recording, i.e. scroll forward, backward, stop, and so on. The special marks on the concentration graph (Fig. 9.9) were made at certain moments in time with numbers (2/5)iTm and (4/5)iTm when the shock wave was passing the iz-sections 35 and 54, accordingly. One can calculate the shock wave velocity with these data as shown in the right-hand part of Fig. 9.10. The obtained value corresponds closely with theoretical result defined by formula (9.13):
9.5 Shock Waves of Concentration in a Filter 163
V Shock =
W L − W R 5.818 ⋅ 10 −3 − 0 = 5.818 ⋅10 − 3 . ≡ CL − CR 1− 0
Numerical value of the flow W is taken from the calculations in Fig. 9.6. The indexes L and R indicate points to the left and to the right of the jump. If the superficial velocity of water passing throughout a unit is equal to 1 m/s the dimensional value of the shock wave velocity will amount to about 0.006⋅1 m/s=6 mm/s.
Fig. 9.10. Procedure to show the shock wave by animation
It is necessary to make the following note concerning a temporal pitch of evaluations, dτ =
∆τ ∆z / wmas
where the velocity scale wmas is the superficial speed of water traveling through the filter, and can be defined as follows: wmas ,
volume flow rate of water . area of entire cross section of filter column
As is visible from Fig. 9.8, d –value was large (80). Because d is similarly to Courant-grid-number (see formulas (9.10) and (9.14)), there is an inconsistency with the requirement that the Courant-number should not exceed unity (see comment to (9.10)). The indicated inconsistency is removed by the circumstance, that the expressions for wave velocity and flux (Fig. 9.5) in the filter problem include the small numerical parameter cqRat (in the computing example 0.005). In other words, the wave velocity (i.e. transport rate of perturbations of concentration), appears many times smaller than the velocity of water taken as a scale. This occurs due to absorption ability of the major filter. The outcome of this argument is as follows: the real (effective) value of the dimensionless time steps in filter problem is calculated by Õ
Õ
164 9 Kinematic Shock Waves
d ·cqRat = 80 ⋅ 0.005 = 0.4 < 1, Õ
i.e. the above mentioned requirement for values of Courant number is fulfilled. Propagation of the Concentration Pulse. Filter Diagnostics Let us finish the analysis of filter problems by one more example. In water stream there was a transient sharp raise in impurity concentration. In order to solve the problem about pulse advancing in a nonlinear medium, which is what the filter is, it may be necessary to trace a space–time modification of the concentration field. The results of numerical analysis are represented in Fig. 9.11. It is visible, that the forward pulse front becomes steeper and steeper, and the shock wave (jump in concentration) is eventually formed. The back pulse front, vice-versa, is gradually smoothed, so the pulses, being bell-shaped initially, turn to triangular shaped curves with vertical forward front. At the filter exit, the characteristic time dependence will be observed, with a sharp rise owing to transition of the shock wave (Fig. 9.12). The designed computer model can therefore be applied to diagnostics of filters. By comparison of observed data for concentration at filter exit with the theoretical prognosis, such as in Fig. 9.12, it is possible to evaluate the properties of various constructions of filters and the quality of the ionite filling compounds. Detailed diagnostics of filter state by means of trial concentration pulse and measuring its shape on exit is possible as demonstrated in the last example. In such situation the inverse problem must be solved, for which the basic software has also been designed. The formalized models of various types of adsorption can be useful in this case (see Sect. 8.5).
CiZ , 0
1
CiZ , 0.2 ⋅ iTm CiZ , 0.4 ⋅ iTm CiZ , 0.6 ⋅ iTm 0.5 CiZ , 0.8 ⋅ iTm
0
( Z , T , C)
0
50 iZ
Fig. 9.11. Propagation of concentration pulse
100
9.6 Shock Waves on a Motorway 165
1
CiZm , iT 0.5
0
0
100
200
iT Ö
Fig. 9.12. Time variation of concentration at filter exit
9.6
Shock Waves on a Motorway
When considering traffic jam problems at a certain concentration value ϕ, then ϕ signifies the line density of automobiles and can be calculated per unit of road length as follows: ϕ = (number of automobiles) / (km of a road), and the flux Φ can be measured by the number of automobiles passing on the road for a specific time unit: Φ = number of automobiles / s. The differential conservation equation for ϕ is written as indicated in the previous problem (compare with (9.2)): ∂ϕ( x , τ) ∂Φ ( x, τ) =− . ∂τ ∂x
(9.15)
This equation has the following meaning: the temporal magnification of concentration on the given small control segment of motorway (left-hand part) happens as a result of an excess of incoming automobiles in comparison with those leaving. It is useful to go once again to Fig. 9.1 and to Eq. (9.4), for explanation of this balance. Eq. (9.15) consists of two unknown variables: concentration ϕ and flow rate Φ of automobiles. The closed equation is required (see (1.45)) in the form of Φ(ϕ): Ü
Φ = (ϕ max wmax )
Ü Ù
ϕ Û
Ú
Ú
ϕ max
Ù
Ú
Ú
×
×
Ø
Û
1−
ϕ ϕ max
×
×
Ø
,
(9.16)
where wmax – maximal allowed velocity on the road, and ϕmax – greatest possible concentration of automobiles corresponding to densest packing, when the automobiles touch their bumpers.
166 9 Kinematic Shock Waves
In the following, the relevant equations and variables are written in compact dimensionless form. Conservation equation: ∂Φ r ( xr , τr ) ∂ϕr ( xr , τ r ) . =− ∂xr ∂τr
(9.17)
Independent dimensionless variables: xr =
x ; L
τr =
0 ≤ x r ≤ 1;
τ
(L / wmax )
.
Dependent dimensionless variables: ϕr =
ϕ ; ϕ max
Φr =
Φ
(ϕ max wmax )
.
Closed equation for car flow (9.16) in dimensionless form: Φ r = ϕ r (1 − ϕ r ) .
(9.18)
Substituting expression (9.18) into Eq. (1.49) defining wave velocity as derivative of flow with respect to concentration, it follows that Vwave =
dΦ r = 1 − 2ϕ r . dϕ r
(9.19)
As can be seen, wave velocity is a varying quantity and even changes sign when there is a change in concentration. From this, many-valued, ambiguous solutions arise in the motorway problem, if method of characteristics is applied, as was shown in Chap. 1, Fig. 1.16 and Fig. 1.17. Now, using a more effective numerical algorithm, it is possible to trace formation of shocks (jams) or rarefaction waves on a motorway. The Mathcad-program and the order of calculations are described explicitly already in Sect. 9.5. For first stage of the project, the user functions for flux and wave velocity are formed (Fig. 9.13). The user must pay attention to vectorization operator (arrow above expression, Vectorize operator), which is a function for flux Ws. This operator is required when the argument t of function Ws (t) is a vector, and it is necessary to apply the function termwise to each component of this vector. An example of such calculations is given at the bottom of Fig. 9.13. One can see, that the returned value Ws is a vector. An error may occur, if vectorization operator is omitted, as shown in Fig. 9.14. Now function Ws fulfills scalar multiplication of vectors, and the outcome appears as scalar. However, this is not what we actually want to get from function Ws.
9.6 Shock Waves on a Motorway 167 ⎯⎯⎯→ Ws(t) := [ t⋅ (1 − t)]
Vs ( φ ) := 1 − 2 ⋅ φ
0.4
2
Vs( C)
Ws ( C) 0.2
0
0
0.5
0
2
1
0
C à Ý
t :=
Ý
á
ß
Ý
Ws(t) =
Þ
ß â
0 Þ
á
1 − t → .5
á
á
0.25 Þ
ß â
0
1
à
á
1 Þ
0.5 Þ
à
á
0 Þ
1
C
â
0
Fig. 9.13. Flux Ws and wave velocity Vs for traffic jam problem Vs ( φ ) := 1 − 2 ⋅ φ
Ws(t) := t⋅ ( 1 − t)
2
0.4
Vs( C)
Ws ( C) 0.2
0
0
0.5
2
1
ç
ã
æ
0 ä
t := å
Ws( t) = 0.25
ä
è
1
ç
1 − t → .5
0.5 ä
å
1
ç æ
1 ä
ç
0
C
C ã
0
è
0
Fig. 9.14. Explanation of error due to omitting vectorization
The next stage is to generate an initial distribution of automobiles along the coordinate axis, i.e. along a motorway. The situation is considered, when on the right extremity of the controlled segment, traffic circulation was stopping (Fig. 9.15). The drivers approaching will use brakes till density packing is reached. We will trace the time evolution of this given initial distribution. The calculations are organized by user function TimeHistory (see Fig. 9.15) that calls the integrator McCrm presented in Fig. 9.4, at every time point. The results are shown in Fig. 9.16.
168 9 Kinematic Shock Waves Slope := 2
z0 := 1
φMax := 1
iZm := 100
iTm := 300
ï
2
é
φ_Init ( iz , φMax ) := φMax ⋅ exp − Slope ⋅
iz − z0 iZm
ð
ñ
ê
ë
ìî
í
òô
ó
1 φ_Init( iz , φMax)
IC ( iz , jy) := φ_Init ( iz , φMax )
0
φ := matrix ( iZm + 1 , 1 , IC)
0
100 iz
φL := φ 0
dτ := .4
keyFCT := 1
TimeHistory ( φ , φL , dτ) := for iT ∈ 0 .. iTm
φNew ← McCrm ( φ , φL , dτ)
φNew ← FCT ( φ , φNew , dτ) if keyFCT φ ← φNew õ
F
ö
iT
←φ
Fig. 9.15. Initial distribution of automobiles on motorway (on the right extremity, traffic stopped) C := TimeHistory( φ , φL , dτ)
iZ := 0 .. iZm
1 CiZ , 0 CiZ , 75 CiZ , 150 0.5 CiZ , iTm
0
0
50
100
iZ
C
Fig. 9.16. Generation of the shock wave, spreading from right to left, i.e. against the flow of traffic
The originally smooth distribution of automobiles along the motorway begins to become deformed creating an increasingly steeper front moving against the flow of automobiles. At time mark 150, i.e. half way of the observation period, the shock wave has already formed (right hand side of Fig. 9.16). This means, that the automobiles ar-
9.6 Shock Waves on a Motorway 169
riving with major velocity from left to right on the previously free flowing highway, are forced to brake sharply, before the shock wave spreading towards. The diagram in the left-hand part of Fig. 9.16 shows lines of identical concentration. Coordinate along the motorway is given on the abscissa, and time on the ordinate. Earlier, at arguing meaning of the wave velocity was shown, that the fixed values of concentration are spread along the straight line, with slope equal to the wave velocity. Hence, we see in Fig. 9.16 on the left that the characteristics are merging with formation of the shock wave of concentration (thick line, inclined to the left). The following computing example shows, how the traffic jam is dissolved (Fig. 9.17). The initial distribution is given in the diagram on the right as bell-shaped symmetric curve CiZ,0 with a zero temporal (second) index. Such distribution corresponds to local concentrating and deceleration of the cars by virtue of any exterior reason. Now, dissolution of a local jam can be explained. The right-hand pulse front begins to flatten, the automobiles leave to the right with increasing velocity on the free flowing road. The left-hand front, however, becomes steeper and steeper, and finally the shock wave is generated. But this wave also proceeds to the right with increasing speed. This is particularly well visible in the contour diagram on the left (horizontal axis–coordinate, vertical–time, color or gradation gray– concentration of automobiles), where the slope of the shock wave (thick line) is decremental. The shock intensity decreases (see Fig. 9.17 on the right). It is the favorable kind of outcome, as the blockage spontaneously dissipates.
(
)
C := TimeHistory φ , φ L , dτ
iZ := 0 .. iZm 1
CiZ , 0 CiZ , 0.25 ⋅ iTm CiZ , 0.5 ⋅ iTm
0.5
CiZ , iTm
0
C
0
50
100
iZ
Fig. 9.17. Evolution of concentration pulse on a motorway during dissolving the density package of automobiles
Let us accentuate, that the observable behavior on a motorway is defined by functional dependence of flux from concentration (9.18), or of automobiles velocity from concentration. The velocity on flowing motorway is taken to be equal to maximal allowed value by the rules of road driving. The velocity during dense
170 9 Kinematic Shock Waves
packing, when the automobiles practically touch each others bumpers, is considered zero, otherwise there would be numerous collisions because of lack of complete synchronization of the drivers operations. Between these asymptotic values the linear interpolation must be taken. It is possible to improve the model, analyzing the probability mechanism of collisions, and also using experimental data and statistics. However, principal content of the problem, and also effective numerical algorithm and computing program, are already presented and described in this brief exposition above. 9.7
Gravitational Bubble Flow. Steam-Content Shock Waves
Bubble Flows in Nature and Engineering The basic feature of considered two-phase flows is the separated movement of vapor (gas) and liquid phases with individual velocities. The vapor (gas) bubbles and the liquid move with different velocities as a result of the gravitational force. In other words, the bubbles rise in a liquid due to the buoyancy force, as in a glass filled with champagne or with beer. Such flows frequently occur in technical devices, for example, in evaporators of thermal and atomic power plants, in bubble columns of chemical industry, etc. (Fig. 9.18).
z ÷
L 1÷
w2( , z = 0) ø
Fig. 9.18. Bubbling
At high volumetric gas content, emulsions or foams are formed which can be positive in various technologies, including fire extinguishing and production of various hardening porous materials – porous foodstuff, foam plastics, sponge glass and even of foamed metals, but can also be negative, as in filling stations of champagne bottles. In the following, we develop mathematical models of this original and complex object. The outcome will be one more illustration of a remarkable generality of differential models for quite different phenomena.
9.7 Gravitational Bubble Flow. Steam-Content Shock Waves
171
Similar to traffic jams or filter problems, we come to a wave equation of a certain kind (1.48) and again we shall observe shock waves forming, but now waves of vapor (gas) content. Let us start from the elementary situation, when a single bubble exists within a pool of liquid. The bubble will move upwards with some velocity vinf depending on its size, viscosity of liquid, density difference and gravitational acceleration. If the liquid also rises, nothing new will happen, unidirectional travel of the bubble and the liquid takes place, but the bubble will move upwards faster than the liquid by the value of vinf. If the liquid moves downwards with small velocity, counter-current motion will result. If the liquid velocity increases, a situation will be reached, when the bubble becomes fixed for the exterior observer: the upwards-movement of the bubble within the liquid will be equal to downwards-movement of the liquid. At excess of this critical velocity, unidirectional motion of bubbles and liquid will be observed again but both flowing downwards. From a physicist’s viewpoint, it is all the same situation, when the bubble flows relative to the fluid with a fixed velocity vinf. However from the viewpoint of the engineer, cases are completely different because of the consequences for the operation of the installation. When the concentration of bubbles is small but finite, water is driven downwards with velocity greater then critical, there will be a vapor holdup in downwards channel. At the bottom of circulating system, the stream is dilated and veers to the horizontal. Such stream cannot further transport the entrapped bubbles; their concentration will be increase. The outcome can be steam flashing of the channel and deterioration or even stopping of the circulation. The common pattern of two-phase flow becomes complicated with increasing bubble concentration. There is a problem of modeling of relative flow of liquid and dense bubble agglomerates, i.e. by high vapor (gas) content ϕ. The bubbly flows of pure fluids usually take place at rather low values of ϕ. It is explained by fusion and growth of bubbles at their tight disposition, passage to slug flow with very large bubbles occupying the entire channel section, or also by the reverse type – passage to droplet-dispersed flow. The fusions of bubbles happen because the thin films of pure fluids, parting them, are completely labile and can easily collapse. However, experience shows, that at presence of impurities in water the bubble structures are maintained up to gas contents, close to unity. Apparently, stability of separating films may increase at the presence of surfactant species or electrolytes in the liquid. Let us not go too deep in the physicochemical aspect of the problem, and assume, that for the hydrodynamic analysis, all values of ϕ are possible, from zero up to unity [49]. It is useful to estimate a value ϕ, at which the effects are greatest, that occurs at density packing. If the bubbles are identical spheres, the vapor content will be 0.7405 at density packing. This value is calculated from easy geometrical reasons. For one horizontal layer of spheres with centres in corners of square (2r·2r):
172 9 Kinematic Shock Waves
4 3 πr π ϕ= 3 3 = . 6 (2r )
The next layer is stacked so that the upper spheres (bubbles)) lie in the holes of underlying layer. Therefore, the height, on which the centers of the following layer lay, will make not 2r, but only √2 r. The denseness of packing will increase in steps of 2/√2=√2, i.e. will make ù
2
π = 0.7405 . 6
Gas/liquid structures with gas contents as high as this are called emulsions. At higher , close to unity, formation of cellular foam with bigger structure elements becomes probable. ú
Two-Phase Parameters Let us write the brief report of the basic parameters of two-phase flow used in the following. The quantities without indexes denote properties of the two-phase fluid as uniform medium. Individual phases are marked with indexes: 1 – for liquid (continuous phase in case of bubbly flow), 2 – for vapor (gas) as dispersed phase. Actual volumetric vapor (gas) content ϕ (void fraction) is defined as ratio of vapor volume to volume of two-phase mixture: ϕ = (m3 vapor) / (m3 mixture). Separated flow is characterized by actual velocities v1 and v2 and by the relative velocity v12 or v21: v 21 = v 2 − v1 = −v12 .
(9.20)
Superficial (reduced) velocities, w1 and w2, are defined as volumetric fluxes (m3/s) of phase 1 or 2 referred to complete flow section (m2). Immediately from definitions of vapor content and reduced velocity the relations follow: w1 = (1 − ϕ)v1 ;
(9.21)
w2 = ϕv2 ;
(9.22)
w = w1 + w2 = (1 − ϕ)v1 + ϕv2 ,
(9.23)
where w – volumetric flux of mixture. From (9.20) and (9.23) follows: v1 = w − ϕv21 ;
(9.24)
9.7 Gravitational Bubble Flow. Steam-Content Shock Waves
v 2 = w + (1 − ϕ )v 21 .
173
(9.25)
Introducing (9.25) into (9.22) yields the following equation for superficial (reduced) vapor velocity: w2 = ϕ((1 − ϕ )v 21 + w) .
(9.26)
Eq. (9.26) plays a principal role in the further. It relates the volumetric flux w2 of vapor phase with vapor content . The result also depends on the relative velocity v21 of phases. In the limiting case v21=0, the apparent relations for one-velocity (homogeneous) stream will turn out: ú
w = v2 = v1; w2 = ϕw. If ϕ → 0 then: w2 → 0;
v21 → vinf ,
i.e. the relative velocity reaches to single bubble velocity. Exposition of the computing program for calculation of vinf can be found in [36]. Generally, the relative velocity must be considered as some function of vapor content: v21 = v21(ϕ). For bubbly flow, G.Wallis [58] has offered an elementary interpolation formula between the limiting cases of small and large vapor contents (Wallis model): v 21 = (1 − ϕ )vinf .
(9.27)
The influence of viscosity, sizes, difference of densities etc. is taken into account at calculation of a scale value vinf. Relation (9.27) correctly reproduces the limiting situations of small and large vapor content. At small values of ϕ, the relative velocity is equal to the upwards-floating velocity of single bubble. At large (close to unity) values ϕ and under condition of maintenance of bubbly (or fog) flow, the zero limit of the relative velocity is observed. Now according to (9.26) and (9.27), the reduced vapor velocity is expressed by the relation:
(
)
w2 = ϕ w + v inf (1 − ϕ )2 .
(9.28)
Vapor-Content Transport Equation If we further consider sluggish (hence, incompressible) two-phase flows, the actual densities of both phases can be considered as constant. Let us suppose also, that phase changes i.e. evaporation or condensation do not happen. Then for a onedimensional flow of uniform cross section developing along vertical coordinate z, the following conservation equation of vapor content can be written:
174 9 Kinematic Shock Waves
∂ ∂ ϕ (z , τ ) = − w2 (z , τ ) . ∂τ ∂z
(9.29)
According to (9.29), the vapor-content increases in a differential control volume (the left-hand part) due to the vapor phase inflow through the surface of control volume (right hand side). On examination we see this equation is identical to the generalized conservation equation (1.37). Volumetric mixture flux is constant along z-coordinate under our conditions: w = w1 + w2 =const. If at the entry, volumetric fluxes of both phases are fixed, then w will be a stationary value not depending on time and z-coordinate. However, variations w2 = w2(z, τ)
z>0
are admissible, following Eq. (9.29). By definition, the positive z-direction is assumed as upwards flow, against gravity (but with buoyancy, in the case of bubbles). Thus, the setting of certain problems is allowed, for which the given parameters are the volumetric mixture flux w = w1(z,τ) + w2(z,τ) and volumetric vapor flux w20 = w2(z = 0,τ) on inflow section, and have to be calculated the space-time distributions w2 = w2(z>0,τ); ú
= (z>0,τ). ú
A typical example is the bubbling (sparging) problem, for which the condition is assumed, that the flow of liquid through the lower section of bubble columns is zero: w1(z = 0,τ) = 0. Eq. (9.29) contains two unknown quantities: w2 and ϕ. The closure equation is (9.28), giving the relationship between volumetric vapor flux w2 and transferred quantity ϕ, w2 = w2(ϕ). Differentiating the right side of (9.29) as a composite function, we present the conservation equation in the shape of a wave equation: dw (ϕ) ∂ ∂ ϕ( z, τ) = − 2 ϕ( z , τ) dϕ ∂z ∂τ
or ∂ ∂ ϕ( z, τ) = −V ( ϕ) ϕ( z, τ) ; ∂τ ∂z
V w (ϕ ) =
d w2 ( ϕ) , ∂ϕ
(9.30)
where Vw(ϕ) is wave velocity for vapor content, i.e. speed of propagation for fixed values of ϕ.
9.7 Gravitational Bubble Flow. Steam-Content Shock Waves
175
Eq. (9.30) can be solved by the method of characteristics, i.e. by building lines of constant vapor content – the direct lines on the plane (z, ), which result in wave velocities by declination (see Fig. 1.14). Formal application of this method can lead, however, to ambiguous solutions, as we saw in the problems about traffic jams and filters. In reality, the shock waves of vapor content follow and again we take advantage of the numerical MacCormack method for computer modeling of such waves (Sects. 9.2, 9.4), which is applied immediately to the transport equation in the conservative form (9.29). But beforehand we present the mathematical exposition in a form convenient for numerical analysis, and also consider equilibrium solutions. û
Dimensionless Formulation. Equilibrium Solutions Floating-up velocity vinf of single bubble and actual vertical length L are natural scales for normalization of quantities: w2 ⇐
V v w2 ; Vw ⇐ w ; v 21 ⇐ 21 . vinf vinf v inf
(9.31)
According to Eqs. (9.29) and (9.30) we write the length coordinate and time as dimensionless quantities: τ⇐
τ ⋅ vinf L
; z⇐
z . L
So, within the Wallis model framework the following dimensionless representation of the basic relationships is obtained: v 21 = (1 − ϕ ) ;
(
(9.32)
)
w2 = ϕ w + (1 − ϕ )2 ;
(9.33)
v 2 = w + (1 − ϕ)2 .
(9.34)
Eq. (9.33) gives three stationary solutions for bubbling. Denoting the prescribed value of volumetric vapor flux as w2state, (w2state < 1/4), taking into account zero value for liquid velocity and then incorporating into (9.33) the substitution w2 = w2state ; w = w2state we obtain three roots for vapor content: ϕ0 =
(
)
1 1 − 1 − 4w2 state ; 2
ϕ1 =
(
)
1 1 + 1 − 4w2 state ; 2
ϕ2 = 1 .
(9.35)
176 9 Kinematic Shock Waves
0.2
0.15
0.1
0.05
0
0.05
0
0.5 Vapor content
1
w
w2 w 0.1Vw phi0 phi1 phi2
Fig. 9.19. The volumetric vapor flux and wave velocity as functions of vapor content φ at bubbling (w = 0.125; w2(w,φ) – Eq. (9.33), Vw(w,φ) – Eq. (9.36))
For example, the first two roots for w2state = 0.125 are 0 = 0.146 and 1 = 0.854. Third root ( 2 = 1) corresponds to motion of dry vapor above the liquid level in bubble column (see Fig. 9.19). The equilibrium vapor content values are derived from intersection of the horizontal line at the level of the given value w with curve (9.33). Eq. (9.33) together with the transport equation (9.29) or (9.30) define the space–time variations of ϕ for unsteady processes at bubbling. ú
ú
ú
Vapor-Content Waves and Shock Waves The expression for wave velocity can be derived from the defining equation (9.30) together with the Wallis model (9.32): Vw =
d w2 = w + (1 − ϕ )(1 − 3ϕ ) . dϕ
(9.36)
There is a strong dependence of wave velocity from vapor content (see Eq. (9.36) and Fig. 9.19), and that predetermines formation of rarefaction wave and compression wave, as shown in the examples below. Suppose, supply of vapor and liquid in lower section of bubble column is closed: w2 (z = 0, τ ) = 0 ; and therefore
w1 (z = 0, τ ) = 0
9.7 Gravitational Bubble Flow. Steam-Content Shock Waves
177
w(z, τ ) = 0 . The volumetric vapor flux and wave velocity depend on vapor content for such two-phase system (see Fig. 9.20). We ascertain, that the wave velocity is positive at small vapor contents and negative at large. Let us set as the initial conditions the continuous distribution of vapor contents comprising all values of ϕ = 0..1 (see Fig. 9.21). At the bottom of the column, there is pure liquid, and at the top – dry vapor. Between these extreme values of ϕ the linear distribution on height is assumed. The space-time evolution of vapor content field is calculated by means of numerical integration of differential partial equation (9.29). Numerical method and computing program have been described explicitly in Sect. 9.4. The results of the numerical solution are submitted in Fig. 9.22. The shock wave of vapor content arises from the originally continuous distribution as it is shown in the diagram on the right of Fig. 9.22, where the data are submitted as a series of -distributions on coordinate Z for several moments of time. The shock intensity increases, and the jump moves to the right (i.e. upwards in bubble column). Eventually on the middle mark of the column, the shock reaches maximal intensity: below this mark there is pure liquid, above – pure vapor. Thus, we have analysed the appearance of two-phase medium stratification in detail. ú
ú
w≡0 ⎯⎯⎯⎯⎯⎯⎯⎯ → ⎯⎯⎯ →
ü
ý
w2 ( φ ) := φ ⋅ w + ( 1 − φ )
þ
2 ÿ
Vw( φ ) := w +
⎯⎯⎯⎯⎯⎯⎯⎯ → ( 1 − φ ) ⋅( 1 − 3⋅φ )
φ := 0 , 0.05 .. 1 0.2 1
w2 ( φ )
Vw ( φ )
0.1
w
0
0
0
0
0.5 φ
1
0
1 φ
Fig. 9.20. The volumetric vapor flux and wave velocity as functions of vapor content φ for w=0
178 9 Kinematic Shock Waves φMax := 1
iZm := 100
φ_Init ( iz , φMax) :=
iTm := 400
( izL ← 10 izR ← iZm − 10 ) 0 if iz < izL φMax if iz > izR φMax ⋅
iz − izL izR − izL
otherwise
1 φ _Init( iz , φMax)
IC ( iz , jy) := φ_Init ( iz , φMax)
0 0
φInit := matrix( iZm + 1 , 1 , IC) φLeft := φInit0
100 iz
dτ := .4
keyFCT := 1
Fig. 9.21. Initial distribution of vapor content TimeHistory( φ , φL , dτ) := for iT ∈ 0 .. iTm
φNew ← McCrm ( φ , φL , dτ)
φNew ← FCT ( φ , φNew , dτ) if keyFCT φ ← φNew
F
iT
←φ
φ := TimeHistory( φInit , φLeft , dτ)
iZ := 0 .. iZm
φ iZ , 0
1
φ iZ , 100 φ iZ , 200 0.5 φ iZ , iTm
0
φ
z
0
50
iZ
Fig. 9.22. Stratification in two-phase medium (w = 0)
100
9.7 Gravitational Bubble Flow. Steam-Content Shock Waves
179
The shaping of a shock wave of vapor content occurs owing to the merging of on the plane characteristics. They are the contour curves of vapor content “coordinate Z (horizontal axis) and time (vertical axis)” (see contour diagram in Fig. 9.22 on the left). The characteristics have different slopes, as the wave velocity depends on vapor content (see Fig. 9.20). The shock wave is visible as a thick line separating area of the pure liquid (dark shaded, on the left) from the area with rising vapor content (on the right). Let us consider one more example of shock formation – as a result of pulse evolution of vapor content in an undisturbed pool of liquid without motion (Fig. 9.23, Fig. 9.24). The initial shape of pulse (Fig. 9.23) is set as error curve with symmetric fronts. The reader should remember, that the transition in the diagrams along horizontal axis (iz) to the right corresponds to movement upward in the actual device (Fig. 9.18). Visualization of the space-time distribution of vapor content, obtained as earlier by numerical procedures TimeHistory, McCrm, FCT, is submitted in Fig. 9.24. The forward (right) front of the pulse becomes gradually blurred (see graph in the right part of Fig. 9.24) due to the rarefaction waves. In the contour diagram for space-time -distribution (left part of Fig. 9.24), in the area of forward front, the fan of divergent characteristics is seen. Their slopes depending on vapor content are set by the relationship shown in Fig. 1.20 for the case of zero volumetric flux of two-phase mixture (w = 0). On the left hand side of the pulse, the shock wave rapidly develops as sharp boundary between the pure liquid (at the left) and vapor-liquid mixture. Later, the shock intensity decreases, and it moves along the bubble column with reduced velocity, as it is visible in the left-hand diagram of Fig. 9.24, where the slope of the shock wave (thick line) increases. ú
φMax := 0.8
iZm := 100
iTm := 300
Slope := 70
φ_Init ( iz , φMax) := φMax ⋅ exp − Slope ⋅
iz − z0 iZm
z0 := 0.3
2
1 φ _Init( iz , φ Max)
IC ( iz , jy) := φ_Init ( iz , φMax)
0 0
φInit := matrix ( iZm + 1 , 1 , IC) φLeft := φInit0
dτ := .4
100 iz
keyFCT := 1
Fig. 9.23. Generating of initial pulse of vapor content
180 9 Kinematic Shock Waves TimeHistory ( φ , φ L , dτ) := for
iT ∈ 0 .. iTm
φ New ← McCrm ( φ , φ L , dτ) φ New ← FCT ( φ , φ New , dτ)
if keyFCT
φ ← φNew
F
iT
←φ
φ := TimeHistory ( φ Init , φ Left , dτ )
iZ := 0 .. iZm 1
φ iZ , 0 φ iZ , 100 φ iZ , 200
0.5
φ iZ , iTm
0
0
50
100
iZ
φ
Fig. 9.24. Evolution of vapor-content pulse
9.8
Conclusion
This chapter terminates the analysis of kinematic waves. This title already demonstrates, that the considered models do not explicitly contain any forces in the streams. For example, the model of bubble flow does not explicitly include the analysis of hydrodynamic resistance; instead, the process is considered as quasistationary, without the inertial force of the fluid taken into account. In filter model on the over hand, very large mass transfer rate in the system “solution – ionite” is assumed, i.e. the quasi-equilibrium ratio of concentrations between solution and ionite packed bed is postulated. When considering kinematic models, the relationship between flux and concentration should be ascertained first: for bubble flow – Eq. (9.33), for traffic jam problem – Eq. (1.45), for filter – Eqs. (8.17), (8.20). The indicated equations are deduced from approximate model representations of concrete processes, as, for example, Wallis formula (9.27) for relative velocity in bubble flow being approaching interpolation between apparent asymptotic cases. The usefulness of kinematic models is arises from the fact that they are based on the generalized conservation laws establishing the most common connection between spatial and temporal variation of quantities. Therefore, equations as presented in (9.2) and (9.3) together with algorithms of their numerical realization (see Eq. (9.9), Fig. 9.4) are one of the common models for the analysis of transient and transport phenomena in nature and techniques.
10
Numerical Modeling of the CPU-Board Temperature Field
10.1 Introduction An image of a computer board as a plate heated rather strongly in some spots and cold in others is a good logotype for two-dimensional temperature field (Fig. 10.1). To provide desired temperature conditions is so important for reliable computer operating, that there are temperature detectors embedded, whose indications can be tested by utility programs like Hardware Doctor (Fig. 10.1). The noise of the working fans in the system unit is a permanent reminder of the problem of computer cooling.
Fig. 10.1. The temperature field of a computer board and characteristic (measured) temperatures for the system unit (29°C) and the processor (37°C)
The thermometer reading gives important but very limited information about temperature conditions in computer because the measurements are taken only at some points. Further a temperature field on a computer board must be calculated and become visible, i.e. the temperature distribution all over the surface, including different chips and strong heated processor. Modeling pattern of computer board as a thermal object is shown in Fig. 10.2 and Fig. 10.3. In chips, heat generation takes place, and heat diffuses along the board by heat conduction. There is convective heat transfer to the surroundings from upper and lower surfaces as well as from flanks (Fig. 10.3). After starting the computer, CPU-board begins to heat, but after some time, temperature will settle at the some level, and heat transfer to the surroundings will
182 10 Numerical Modeling of the CPU-Board Temperature Field
compensate internal heat generation. This regime is called the steady-state condition.
Chips with heatgeneration
Fig. 10.2. Modeling pattern z
P
(TP-TFh)
y x
(TWall-TF)
- grad(T)
Fig. 10.3. The scheme of heat transport in computer board
Strictly, the temperature field will be three-dimensional i.e. temperature will be changed both along the board (in x,y-directions, as axes x and y will be arranged along the board) and perpendicular to it (z-direction). However, the changes in z-direction will be neglected, if the board is thin and its thermal conductivity is rather large, but heat transfer coefficients on the upper and lower surfaces are relatively small. Let us take into account these assumptions and consider further the temperature field as two-dimensional. The heat emission from the upper and lower surfaces (i.e. to z-direction) will be simulated by internal heat sink i.e. negative source. This remark will be understandable later, after a balance equation (10.7) is written. The steady-state two-dimensional temperature field (x,y) in solid with thermal conductivity , W/(m K), and with internal heat sources qV, W/m3, is defined by the following differential equation (see also (1.41)):
∂ 2T ∂ 2T q + =− V . λ ∂x 2 ∂y 2
(10.1)
In the following, we will calculate temperature field in a computer board by numerical integration of this equation.
10.2 Built-in Functions for Partial Differential Equations 183
10.2 Built-in Functions for Partial Differential Equations As stated before, Mathcad has limited opportunities to solve the elliptical partial differential equations. By means of built-in functions multigrid and relax, the Poisson’s equation: ∂ 2u ∂x 2
+
∂ 2u ∂y 2
= ρ( x , y )
(10.2)
can be solved in square domain, by the following boundary conditions: • by constant zero value of required quantity u (using multigrid); • by some given u-distribution along the border (using relax). In both cases, the problem is solved under the boundary condition of the first kind (Dirichlet problem). By calling multigrid, u:=multigrid (M,ncycle), a quadratic matrix u of required values u(x,y) in square domain is obtained. The (n+1) by (n+1) matrix M with elements Mi,j , i := 0..n , j:= 0..n sets the internal heat sources on grid with (n+1)(n+1) nodes. Recommended values of estimated parameter ncycle is 1 or 2. Remind once more, that Dirichlet boundary condition with zero value is assumed. Function call to relax is more complicated: u := relax (A, B, C, D, E, F, U, rjac).
(10.3)
Quadratic matrices A, B, C, D, E determine the linear approximation coefficients of the Laplacian (it is the operator in the left part of Poisson’s equation) at every point of the grid. Matrix F gives the value of source function. Matrix U prescribes the boundary values of u along four sides (flanks) and gives the first approximation at the internal points. Calculated parameter rjac controls the convergence of iterations; its optimal value in interval 0 … 1 depends on the problem. In Mathcad-Help there is no additional information about the meanings of matrix coefficients A, B, C, D, E and the examples only explain that theirs standard elements are correspondingly 1, 1, 1, 1 and (–4). For our purposes it is necessary to explain in which way the above indicated matrices are formed and can be modified, depending on the problem setting. The first result will be the essential increase in the ability of the built-in function relax: the modification method for matrices E and F will be obtained (see (10.3)), which allows us to account for the heat exchange on the surfaces of plate. Furthermore, the algorithm and Mathcad-program will be created to solve the problems with more general boundary conditions, not only Dirichlet conditions, and finally the practical example of the temperature field of computer CPU-board will be considered.
184 10 Numerical Modeling of the CPU-Board Temperature Field
10.3 Finite-Difference Approximation By numerical integration of Eq. (10.1) the problem is reduced to the calculation of temperature at a limited number of points – in the grid nodes, around which so called control volumes are formed. Fragment of grid and typical control volume are presented in Fig. 10.4. Finite-difference approximation of differential equation results from the heat balance for control volume δ × h × h.
N
δ E
P
h
W
S h
Fig. 10.4. Control volume and heat flows
Internal energy of control volume will be changed during time, because: • there is heat input over the south, north, west and east boundaries from the neighboring volumes; for clarity, their temperatures are considered as higher than in P-node. For example, the heat flow through the west boundary is λ
TW − TP (δ ⋅ h ) ; h
(10.4)
• there is heat transfer to the surroundings with temperature Tfh through the upper or/and lower surfaces:
(
)
α P TP − T fh (h ⋅ h ) ;
•
(10.5)
the internal heat source produces: qV (δ ⋅ h ⋅ h ) .
(10.6)
After summing up the components of balance, we have: λ
TS − TP (δ ⋅ h ) + λ TN − TP (δ ⋅ h ) + λ TE − TP (δ ⋅ h ) + λ TW − TP (δ ⋅ h ) + h h h h
Heat supply via thermal conductivi ty
[
(
)
]
&
+ qV (δ ⋅ h ⋅ h ) − α P TP − T fh (h ⋅ h ) ⋅ 2 = ρ (δ ⋅ h ⋅ h )
Internal heat generation minus heat emission through upper and lower surfaces to surroundin gs
$
'
%
TP − T 0 P ∆τ
Increase of internal energy
#
(10.7) " !
10.3 Finite-Difference Approximation
185
where T0P – the temperature at previous moment of time, – time step. The balance equation (10.7) should be presented further in the form of a linear algebraic equation of the unknown temperatures: (
)
ATS + BTN + CTE + DTW + ETP = S .
(10.8)
The explicit expressions for the coefficients A, B, C, D, E, S are needed to call the solver. They will be obtained comparing the image (10.8) and the original (10.7). It will be limited in (10.7) to a case of steady-state regime (TP = T0P) and constant heat conductivity (λ = const). Mathcad can carry out necessary symbolic calculations using operator collect (see Fig. 10.5 and similar calculations in Sect. 11.3). The name bal (balance) is assigned to the left side (10.7), that equals zero for the steady-state problem. bal :=
(
(
)
(
)
)
λ ⋅ TN − TP λ ⋅ TE − TP λ ⋅ TW − TP ⋅ ( δ ⋅ h) ... ⋅ ( δ ⋅ h) + ⋅ ( δ ⋅ h) + h h h λ ⋅ TS − TP + ⋅ ( δ ⋅ h) + qv⋅ ( δ ⋅ h⋅ h) − α P ⋅ TP − Tfh ⋅ h⋅ h⋅ 2 h
(
)
(
)
expand bal λ ⋅δ
collect , TP
→
( collect , TW , TE , TN , TS) * *
+
TW + TE + TN + TS +
2
−4 ⋅ λ ⋅ δ − 2 ⋅ α P ⋅ h λ ⋅δ
+
,-
⋅ TP +
2
2
qv⋅ h ⋅ δ + 2 ⋅ α P ⋅ h ⋅ Tfh ,-
λ ⋅δ
Fig. 10.5. Coefficients of the finite-difference equation
The result can be written in the form: TS + TN + TE + TW − (4 + β)TP = S ,
(10.9)
where β≡
α P h 2 ⋅2 ; λδ
S≡−
qV h 2 − βT fh . λ
(10.10)
The coefficients A, B, C, D equal unity, and the following expression for E is obtained: E = − ( 4 + β) .
(10.11)
Coefficient takes account of heat transfer on the horizontal surfaces of plate (see Fig. 10.3). It is not obligatory that P and Tfh are identical on both sides of the plate. Generally, P can be considered as the average value of heat transfer coefficients on the upper and lower sides: .
/
/
186 10 Numerical Modeling of the CPU-Board Temperature Field
/
P
=( /
P_top
+ /
P_bottom)/2,
and Tfh – as weighted average value of fluid temperatures Tfh = ( /
P_topTfh_top + P_bottomTfh_bottom)/ /
( /
P_top + /
P_bottom).
For the boundary nodes placed on the flanks (Fig. 10.3), the temperatures are given when there are boundary conditions of the first kind (Dirichet’s conditions), or special equations are written (see further Eq. (10.13)). In any case, one obtains the system of linear equations (10.8), with the order equaling the number of grid nodes. For example, if every side of the plate contains 33 nodes, then there are 33·33=1089 nodes on the grid in all and the system matrix will contain 1089·1089=1185921 coefficients. This is a lot, even for up-to-date computers. Presently, difficulties of solving large systems are overcome to a great extent, numerical modeling of multidimensional problems of heat and mass transfer, however, remains kind of an art and requires a high-end computer. 10.4 Iteration Method of Solution. Program Plate
Equation for Internal Nodes One of the simplest solution algorithms of the resulting system of equations is based on Gauss–Saidel iterative procedure [1] according to which the subsequent approximation is obtained from the previous one by formula (10.9), rewritten for temperature in the node P: TP =
S − TS − TN − TE − TW ; E
E = −(4 + β ) .
(10.12)
This formula is used only for internal nodes of the grid. But if the temperatures in the boundary nodes are given (Dirichlet’s problem), nothing else is required. Equation for Boundary Nodes More often, however, mixed boundary conditions occur in practice. In these cases, the surrounding temperature Tf and heat transfer coefficient on the thin lateral faces δ × h of the plate are given. Finite-difference approximation of mixed boundary condition can be written in the form: /
α(T f − Twall )(δ ⋅ h ) ≅ λ
Twall − Tinner (δ ⋅ h ) , h
(10.13)
where Twall is the temperature in the boundary node on the lateral surface, Tinner – temperature of the nearest inner node, and Tf –temperature of the surroundings.
10.5 Thermal Model of the CPU-Board
187
Solving this equation for Twall and introducing the dimensionless heat transfer coefficient – Biot number (Bi-grid-number is better, because h is step of grid): Bi ≡
αh , λ
(10.14)
we obtain the iterative formula for the temperatures in the boundary nodes: Twall =
Bi ⋅ T f + Tinner 1 + Bi
.
(10.15)
On the base of Eqs. (10.12) and (10.15), Mathcad-program Plate is created to calculate the temperature in the rectangular domain (not only square) with allowance for heat transfer on the upper and lower surfaces. On the four flanks the mixed boundary conditions are set. This program gives opportunity to solve many important problems in practice. In addition to the example of computer boards, we will also focus attention to the calculation of the finned plates, used for heat transfer intensification in heat exchangers or finned radiators (e.g. of space power units), and compare in details built-in function relax with user function Plate. 10.5 Thermal Model of the CPU-Board Computational program Plate, presented in Fig. 10.6, yields: • Steady-state temperature field T of plate as two-dimensional array with indexes i=0..m, j=0..n; • Relative error relErr as the difference between two last iterations; • Number of iterations n_iter. The accuracy tol and maximal number of iterations maxiter are given in the text of program procedure, because these parameters aren’t required to change often. Let us itemize input parameters of procedure Plate: • E is the coefficient in the determining equation (10.12). Introduced as a matrix with dimension like temperature T in the nodes of grid. Calculated through β – dimensionless heat transfer coefficient on the upper and lower sides of plate (see Eqs. (10.10), (10.11) and Fig. 10.3, Fig. 10.4). • S is the right part of the determining equation (10.8) or (10.9), matrix with dimension like temperature T. Calculated with formula (10.10) by qV values (i.e. Joule heat generation in chip) and β. • IC is the initial temperature distribution, matrix with dimension like temperature T. • Bi is Biot number, the dimensionless heat transfer coefficients on the lateral faces of the plate (see Eq. (10.14)); dimension of this array is four, according to number of lateral faces. • Tf is the temperatures of the surroundings on the flanks of the plate (see Fig. 10.3 and Eq. (10.15)); dimension of this array is four, according to number of flanks.
188 10 Numerical Modeling of the CPU-Board Temperature Field
The structure of program Plate is the following. External cycle for with loopcontrol variable iter organizes iterative process. The result of previous iteration is kept in array T0. If the maximal difference in two subsequent iterations becomes less than the value tol, then after command break the calculations in the cycle are stopped, and the output array is formed. Plate( E , S , IC , Bi , Tf) ≡
[ ( m ← rows( IC) − 1) ( n ← cols( IC) − 1) ] [ ( tol ← 0.001 ) ( maxIter ← 100 ) ] T ← IC
for iter ∈ 1 .. maxIter for i ∈ 0 .. m for j ∈ 0 .. n T0i , j ← Ti , j for i ∈ 1 .. m − 1 for j ∈ 1 .. n − 1 Ti , j ←
( Si , j − Ti , j+1 − Ti+1 , j − Ti , j−1 − Ti−1 , j) Ei , j
for i ∈ 0 .. m 0 0
1 1
2 2
Ti , 0 ←
for j ∈ 0 .. n 0
1
2 2
0
1
T0 , j ←
( Ti , 1 + Bi 0 ⋅ Tf0) ( 1 + Bi 0)
( T1 , j + Bi 2 ⋅ Tf2) ( 1 + Bi 2)
( )
⎯ → Tm ← max T 0
Tm ← 0.01 if Tm < 0.01 ⎯⎯⎯ → max T − T0 relErr ← Tm
(
6
1
7
2
8
)
9
0
1
53
Ti , n ← 2
4
( Ti , n−1 + Bi 1 ⋅ Tf1) ( 1 + Bi 1)
0
1
4 35
2
Tm , j ←
5 3
4
( Tm−1 , j + Bi 3 ⋅ Tf3) ( 1 + Bi 3)
5 3
4
4 3 5
4 3 5
:
;
(n_iter ← iter) 3
4
5
break if relErr < tol T
( T relErr n_iter )
g
Fig. 10.6. Function Plate for numerical solution of Poisson’s equation
The internal double cycle with variables i, j uses formula (10.12) to iterate in the internal nodes of the domain. There is also the round along the boundary in two last for-cycles, and Eq. (10.15) is used to iterate in the boundary nodes. The same problem will be solved simultaneously with built-in function relax (10.3). Let us remind the reader that the coefficients A, B, C, D in (10.3) equal unity for uniform grid and constant thermal conductivity (see comment to the determining equation (10.7)). Coefficients E are calculated taking into account heat transfer on the horizontal (upper and lower) surfaces of the plate, as in program Plate. F and U matrices in (10.3) are identical to S and IC in the list of parameters for Plate. After these preliminary remarks, the working Mathcad-sheet is presented in Fig. 10.7 with the following numbered calculation blocks:
10.5 Thermal Model of the CPU-Board
189
1) Partition number n of square domain is prescribed, values of dimensionless heat transfer coefficient and of heat generation parameter S0 (in Kelvin) are set 2) Coefficient matrices for Eq. (10.8) are formed, initial temperature distribution as array Tinit is set, the Source array is zero filled, in that further the values of internal heat generation will be written 3) Internal heat source Source is set in three sub-domains simulating three chips 4) For program Plate, the boundary conditions on four flanks specify zero heat transfer, i.e. Biot numbers Bi are set zero. Surroundings temperatures Tf must also be prescribed, and generally speaking, not obligatorily set zero. .
( 1)
n := 32
β := 0.5
( 2)
i := 0 .. n
j := 0 .. n
A i , j := 1
B i , j := 1
Tinit i , j := 0
Source i , j := 0
i := 18 .. 26
j := 6 .. n − 6
i := 6 .. 14
n j := 2 .. 2
Source i , j :=
i := 6 .. 14
j := 22 .. 26
Source i , j :=
E i , j := − ( 4 + β )
( 3)
S 0 := − 50 B
C i , j := 1
D i , j := 1
Source i , j := S 0 <
( 4)
T
Tf := ( 0 0 0 0 )
@
?
S0 =
>
A
1.2 S0 2 T
Bi := ( 0 0 0 0 )
Fig. 10.7. Preparation of input data
Further, the user function Plate and built-in function relax are called and the results of the solution are presented (Fig. 10.8, Fig. 10.9). Different colors of image (or gradations of gray) designate different temperature values. Zones with high temperature are the three chips and the processor (it is the biggest chip) is the most heated. The method of visualization reflects professional features for experts in the field of heat transfer. We observe the changes of temperature from point to point; we focus our attention to the zones with different temperatures, especially where the temperature can exceed allowable values. Areas of closely spaced isotherms, i.e. areas with big temperature gradients and big heat fluxes, are i also mportant. As shown in the pictures (see Fig. 10.8, Fig. 10.9), the solutions give similar results in two ways as a whole. However, there are remarkable distinctions near the edges of the plate. This is the result of different boundary conditions.
190 10 Numerical Modeling of the CPU-Board Temperature Field Tplate := Plate ( E , Source , Tinit , Bi , Tf) Trelax := relax ( A , B , C , D , E , Source , Tinit , 0.95 )
Trelax
Tplate 0
Tplate 0
Trelax
Fig. 10.8. Results of numerical modeling for temperatures of the computer board
i := 10
j := 0 .. n 100
100
( Tplate0) i , j
Trelax i , j
50
0
0
20
50
0
0
j
Fig. 10.9. Temperature distributions along line i =10
20 j
10.6 Problem of Orbital Platform. Function bvalfit 191
For the built-in function relax, there is only one way to set boundary conditions – to prescribe the border temperature. It is unknown beforehand, what this temperature actually will be. It can be supposed that if heat generation is not too high and chips located at some distance from the edges, then the temperature on the edges should be close to the temperature of the surroundings. In the relax example, the temperature of the border was assigned zero (Tf = 0). Let us notice at once that the stated assumptions may not correspond to reality, and then the modeling proposed by the relax method will result in nonsens. In the program Plate, any boundary conditions can be specified. There is a fairer assumption – the heat sink from the narrow lateral faces is negligible. Such condition can be simulated, giving zero heat transfer coefficient. The user should pay attention to the fact that the temperatures of the edges aren’t zero (see Fig. 10.8, Fig. 10.9). The zone with increased temperature will be particularly pronounced, when one of the chips is placed close to the border. Thus, using the relax method leads to serious errors because of incorrect boundary conditions, but method Plate ensures a realistic result. The base of the art of mathematical modeling of heat and mass transfer problems is the ability to correctly set the boundary conditions. Correspondingly, good tools for the solution of these tasks must give such chances. The built-in function relax has insufficient ability to adequately simulate interaction between object and surroundings. Therefore, the program Plate (Fig. 10.6) fills a gap. 10.6 Problem of Orbital Platform. Function bvalfit The temperature regulation of artificial space objects is connected with calculation of their thermal radiation to the surroundings. The simplest heat model of an orbital platform is demonstrated in Fig. 10.10. It is supposed, that there is heat generation in the central part caused by power installation, electronic equipment or a life-support system. The power generation W (watt) is specified within the bounds of the active part of the platform with dimensions (Lact·B· ) (position 2 in Fig. 10.10). Heat is released to the surroundings by means of thermal radiation and also transmitted along the plate by heat conduction into the passive part (position 1) acting as subsidiary irradiator. Emissitivity factor is set unity. Thermal conductivity , W/(m K) of the plate and general platform dimensions (L·B· ), <
C
C
C
C
192 10 Numerical Modeling of the CPU-Board Temperature Field
radiation
T L
δ
B 2
1
3
x
0
Lact
heat conduction
Fig. 10.10. Thermal scheme of orbital platform
The mathematical subtlety consists of the necessity to solve a double-point boundary-value problem for differential equation with discontinuous right hand part. It represents a good motivation, to use the alternative method of reduction of the boundary-value problem to the initial problem, namely using function bvalfit. Let us remember the fact that for this purpose, function sbval was used above (see Sect. 6.3). As original formula, the energy equation (1.24) will be used, ρ E
∂T = −div(−λ gradT ) − ρc w ⋅ gradT + qV , ∂τ
where the operator of convection should be excluded (w = 0 in the second term on the right-hand side), the stationarity and one-dimensionality (t=t(x)) of the problem should be taken into consideration and thermal conductivity should be assumed to be constant, so we get an ordinary differential equation: D
0=λ
d 2T − 0 + qV , dx 2
or: qVeff d 2T =− . 2 λ dx
(10.16)
We change the designation of volumetric generation rate from qV to qVeff because in our problem the internal source consists of two parts: qVeff = qV + qVrad .
True heat generation rate qV is determined by parameter W introduced above:
10.6 Problem of Orbital Platform. Function bvalfit 193
qV =
W . Lact Bδ
Radiation heat sink is simulated by means of internal negative source in the second term: 2σ 4 σT 4 2(dx ⋅ B ) T , =− δ (dx ⋅ B ⋅ δ)
qVrad = −
where = 5.67 10–8 W/m2K4 – Stefan–Boltzmann constant. After substitutions we obtain the defining differential equation of second order for the temperature field of the orbital platform: F
G
d 2T dx 2
= −QV ( x ) + cT 4
(10.17)
or equivalent presentation in the form of two combined equations of first order: d f 0 = f1 ; dx
(10.18) d f1 = −QV ( x ) + cT 4 , dx
where dT ; dx q 2σ QV ≡ V ; c ≡ . λ δλ f0 ≡ T ;
f1 ≡
Discontinuous function of heat generation can be given in the following way: M
J
K
if L
L x < act 2
H
I
then QV =
qV λ
else QV = 0 .
(10.19)
On the symmetry axis at x = 0, the temperature reaches extremum, and on the platform end at x = L/2 the heat emission from narrow sidewall can be neglected, therefore: dT dx
=0; x=0
dT dx
=0.
(10.20)
x= L / 2
These two relationships give two-point boundary conditions. It should be noted, that no temperature value is known beforehand. Let us begin solving the problem using Mathcad.
194 10 Numerical Modeling of the CPU-Board Temperature Field
At first, it is necessary to input basic data (such as geometry, properties, conditions) and to calculate some coefficients (Fig. 10.11). δ := 0.003 L := 1
B := L
xL := 0
xR :=
W := 1000
λ := 100
qv :=
W Lact ⋅ B ⋅ δ
Lact := 0.5 L 2
5
Lact 2
σ := 5.67051 ⋅ 10
−8 N
σ
c := 2 ⋅
qv = 6.667 × 10
xin :=
( δ ⋅λ)
c = 3.78 × 10
qv
−7
= 6.667 × 10
λ
3
Fig. 10.11. Basic data for calculation
Position data xL, xR, xin set the left and right boundaries of integration interval and also a passing point, where the heat generation function contains a discontinuity. Then the following job steps are executed (Fig. 10.12): 1) The right hand part of equations set is written as vector-function D. 2) Initial approximations for the temperature vL0 and vR0 on the boundaries of interval are set. 3) Vector-functions SetInit of boundary conditions for the temperature and its first derivatives on the left and right end of integration interval are set; from these initial data, two trial solutions in the algorithm bvalfit are started running towards each other. 4) Function DisInter, manager of splicing of the trial solutions in the intermediate point xin, is written. 5) Built-in function bvalfit, defining the missing boundary conditions IC, i.e. the temperature values, is called. X U
R O
P
1)
2)
Qv( x) := if x < x in ,
qv
Q
vL0 := 300
V
,0 T
λ
D ( x , f) :=
vR0 := 150
Y
V
W
( )4
−Qv( x) + c ⋅ f0
R O
3)
(
)
SetInitL xL , vL :=
(
)
Q
T
0
S
(
)
SetInitR xR , vR :=
vR0 P
Q
T
0
4)
DisInter xin , f := f
5)
IC := bvalfit vL, vR, xL , xR , xin , D , SetInitL , SetInitR , DisInter
(
[
(IC 0 )0 = 348.102 \
IC = ( 348.102 249.008 )
Z
R O
S
vL0 P
Y
f1
S
)
]
Fig. 10.12. Calculation of missing initial conditions, using function bvalfit
10.6 Problem of Orbital Platform. Function bvalfit 195
The results of calculation of missing boundary conditions are values 348.1 K and 249.0 K. Initial approximations were accordingly 300 K and 150 K. After the initial conditions being known, it is possible to call the suitable integrator to receive distribution of temperature T and temperature gradient dT (Fig. 10.13). The graph on the left displays the temperature decrease from the center of the orbital platform to its edges. The temperature drop is quite noticeable, about 100 K. As we see in the graph on the right, the first derivative of temperature isn’t a smooth function. Therefore, the second derivative of the solution will be a discontinuous function, that corresponds to the original formulation of the problem (10.18), (10.19).
(
IC := bvalfit vL , vR , x L , x R , x in , D , SetInitL , SetInitR , DisInter
(IC 0 )0 = 348.102 ^
IC = ( 348.102 249.008 )
(IC 0 )0 ^
`
a
InitCond := a
)
_
_
b
c d
d
N := 100 e
0
(
)
S := Rkadapt InitCond , x L , x R , N , D ^
x := S
_
0
^
T := S
T0 = 348.102
_
^
1
dT := S
dT0 = 0
_
2
TN = 249.008
400
T
−9
500
300
200
dTN = 2.744 × 10
dT
0
0.25
0.5
0
500
x
0
0.25
0.5
x
Fig. 10.13. Solution of initial problem
Maximum value of temperature (348.1 K) is allowable for the equipment, but is extremely high for biological matter. Experimenting with computer model, it is possible to fit the parameters (geometrical sizes, materials etc.) of orbital platform so as to satisfy beforehand prescribed temperature requirements. Spatial appearance of the temperature field and contour diagram are presented in Fig. 10.14. The platform itself is a rectangle at the bottom of the left hand graph. It is useful to compare the results for this one-dimensional problem with the diagram obtained before for the two-dimensional problem of the computer board (Fig. 10.8).
196 10 Numerical Modeling of the CPU-Board Temperature Field i := 0 .. N
Te i+ N := Ti
i := 0 .. 2 ⋅ N
j := 0 .. N
xi , j := i
yi , j := j
platform i , j := 200
Te i := TN − i
Tplatf i , j := Te i
( x , y , Tplatf ) g ( x , y , Tplatf ) , ( x , y , platform )
Fig. 10.14. Temperature distribution on an orbital platform
Under computing aspects, the considered problem is closely connected to the solution of the Falkner–Scan equation (see Sect. 6.3). In both cases a two-point boundary-value problem was solved with the shooting method, but using two different built-in functions. In the case of the function sbval, we shoot at full distance from the starting point to the finishing point of integration interval. In the case of bvalfit, we shoot at about half the distance from the finishing points at intermediate point, where the results should be coordinated. Due to shortening of the distance we can expect more stabile results for the calculation with function bvalfit (probably not for high-order systems). This circumstance is essential, if the solution strongly depends on the initial conditions, and therefore numerical instability may arise in the shooting method [13]. 10.7 Conclusion In engineering practice there are some problems, which require more powerful computational programs, than we have used. As an example let us consider the computational modeling for the thermal regimes of gas-main pipelines with the purpose to control them [3]. The thousand-kilometers long gas pipelines laid in the North is influenced by the instability for permafrost of the soil. Under conditions of ground heave, firesetting, or frost penetration on some locality inadmissible deformations and even break of the pipeline may arise.
10.7 Conclusion
197
Computational modeling must provide the calculation of temperature field and heat flows in the system “pipeline – soil” on lengthy segments, taking into account the climatic, seasonal and weather fluctuations of the environment. The disposable programs relax and Plate lack at least two necessary properties to solve such problems: • They can’t calculate transient temperature fields • It is difficult to create required geometric configuration, so to speak “to build the pipeline”, i.e. to make the round orifice in domain and set the necessary boundary conditions on the internal surface .
T Fig. 10.15. Temperature field around a pipeline in the soil
We improved the program Plate in the following way to demonstrate the computation of such level of sophistication: • First of all we had to return to the original Eq. (10.7) and to keep the timedependent operator. In this connection the basic design equation (10.12) should also be changed. • Secondly we had to identify the grid nodes in a special way, i.e. to find out which should remain in the actual domain and which should fall in the orifice. It was also necessary to mark the nodes which appear on the internal round border of the actual domain, and to apply the special boundary condition for temperatures in these nodes. These modifications have made the Mathcad-program too bulky and that’s why we will not present it here. The significant example of calculation by this program (Fig. 1.15) shows, how in winter above the shallow heat pipeline the thawed ground can appear. One more example of using the modified program Plate is calculation of the temperature field in the fuel element of nuclear reactors (Fig. 10.16). The fuel element problem was solved in Chap. 1 in a one-dimensional axisymmetric treatment (Sect. 1.6). In practice, however, symmetry can be broken, and then it is necessary to calculate a two-dimensional temperature field.
198 10 Numerical Modeling of the CPU-Board Temperature Field
The fuel element is a long cylindrical rod made of uranium dioxide with a thin zirconium cover. There is strong heat generation because of nuclear reactions. The rod is cooled by water from outside. If cooling is insufficient, the temperature of the cover may exceed the allowed value (about 400oC) with disastrous consequences. Mathematical formulation of this problem includes differential equation (10.1) and the boundary condition of the third kind with given heat transfer coefficient, which is changing along the circumference of the rod. The results of numerical integration are presented in Fig. 10.16. On the left, a situation with enough and uniform cooling is shown. On the right, a dangerous situation arises where cooling conditions have become worse in the left upper sector and isotherms of high temperature closely approach the protective zirconium shell, whose allowable temperature is hardly more than 400˚ . At higher temperatures, destructive corrosion quickly develops in the presence of water. f
T
T Fig. 10.16. Temperature field in the fuel element of nuclear reactor
For the calculation of the temperature field in complex geometries, the finiteelement method (FEM) is often used [6, 32, 51, 52]. One of the main features of FEM is the irregular grid, adapted to the geometry of the object and the features of the temperature field. In Fig. 10.17, such irregular grid and calculated vector field of heat flux are demonstrated for “gas pipeline – soil” system. A FEM program was used for the analysis of heat conduction in finned tube with nucleate pool boiling on the outer surface [51]. Two characteristics of the temperature field in the finned wall at boiling are its complex geometry and the complex nonlinear boundary conditions. Fig. 10.18 shows the mesh, the isotherms and the vector field of heat flux for Tshaped fins. It can be seen, that the isotherms are significantly curved near the base and within the upper part of the fins. This demonstrates that in fact onedimensional approximation of heat conduction in such cases will not be correct, although this is often assumed.
10.7 Conclusion
199
Fig. 10.17. Calculation of the temperature field, using the finite-element method
Fig. 10.18. Mesh, isotherms and heat flux in T-shaped fin
Realistic calculations of convective heat transfer may contain much more intricate problems than considered above because both temperature field and flow field have to be computed. As an example, the vector flow field is presented in the model of a shell-and-tube heat exchanger (see Fig. 10.19, Fig. 10.20).
Fig. 10.19. Scheme of shell-and-tube heat exchanger
200 10 Numerical Modeling of the CPU-Board Temperature Field
Fig. 10.20. Flow field in shell-and-tube heat exchanger
The apparatus is presented schematically in Fig. 10.19. Baffles are installed to provide highly turbulent cross flow, and due to this, increased heat transfer rate. The flow field computed by FEM package ANSYS (see below) is presented in Fig. 10.20 in the form of a graphic display of the numerical solution of the differential equations for this situation with very complex hydrodynamics (such as (1.28), (1.31)). Please note that the tube bank is not shown in Fig. 10.20. It cannot be represented in correct scale, because the diameter of the tubes and their distances are much smaller than the characteristic sizes of the heat exchanger itself. This circumstance is also reflected in the mathematical model. We are compelled to ignore the details of flow near each single tube. Instead, we accept the hydraulic resistance of the tube bank with an ad hoc distributed impulse source. It is not possible here to discuss this problem more in detail, but let us only note that numerical modeling reveals an extensive stagnant zone behind the baffle where the circulation speed is insignificant or even vanishes, and combined with it heat transfer also decreases. During the design process, alternative calculations in ANSYS should be carried out with different geometrical characteristics in order to find an optimum configuration for the tube bank with baffles. Larger engineering problems, such as complete calculation of nuclear power reactors or modeling of automobile aerodynamics, require special mathematical packages. Powerful general-purpose computation package ANSYS (http://www.ansys. com) is created on the base of the finite-element method and used for problems of complex nature (structural strength, thermal physics, hydraulic gas dynamics, electromagnetism). The same will do computing packages STAR-CD (http://www.cd. co.uk); PHOENICS (http://www.cham.co.uk, http://213.210.25.174/website/new/ top.htm) in the field of fluid dynamics and heat-mass transfer.
10.7 Conclusion
201
STAR-CD, PHOENICS, ANSYS belong to the so-called “heavy” packages with large volume and equipped with effective numerical algorithms, convenient interface and powerful graphic means for formulation of the complex geometry of objects and for visualization of results. There are no restrictions on the complexity of problems, except for memory and speed of the computer. Work with such programs, however, requires special training, and packages are expensive commercial products. Our task is the study of the basic ideas of computer modeling. Simple programs with open codes accessible to study, updating and modification are more effective here.
11
Temperature Waves
11.1 Introduction
In power engineering and thermal technology, for optimum control of the starting or transition procedure it is necessary to compute the time-dependent temperature fields in the elements of the machines and equipment. Forecasting of a temperature field allows to avoid inadmissible temperature rise or too large temperature drops. A characteristic example is the start control of powerful steam turbines on thermal power stations. The desire to bring the stand-by capacity rapidly into action can be restricted by following effects: the backlashes in a moving elements of the turbine may decrease inadmissibly because of different thermal expansion, or the temperature stresses may cause breaking of massive components. More and more important will also be problems arising from the influence of powerful energy fluxes on construction elements. For example, the heat flux on walls of Controlled Thermonuclear Synthesis can reach up to 100 MW/m2. The extreme heat fluxes and high temperatures arise during laser or electronbeam processing with the purpose of surface hardening. Similar processes take place in chip manufacturing. One more example are graphite electrodes of plasmatrons which are working under heavy temperature conditions. These devices are used for high-temperature material processing. The high-power actions are almost always of pulsing, periodic character, so temperature waves are likely to arise in solid bodies. The one-dimensional nonstationary problem with interior heat generation can be taken as a model of the processes outlined above (Fig. 11.1). T
λ, c, ρ
qv
x
qwall
L
Fig. 11.1. One-dimensional non-stationary thermal conduction problem
Let us suppose that spatial changes only happen along an axis of coordinate x. The lateral areas is considered adiabatically insulated. If necessary, heat exchange on lateral area should be simulated by an internal negative heat source, exactly as described in the previous chapter.
204 11 Temperature Waves
To provide a universal model, we take advantage of the numerical method and then we develop the Mathcad-program for this purpose on the basis of the TDMA method. This method is famous as very-high-speed algorithm for the solution of large systems with diagonal structure. 11.2 Formulation of the Boundary-Value Problem
To start with, we take the energy equation (1.24), without convective term and reduced to one-dimensionality, t = t(x, ). Thus, we obtain: g
∂t ∂ ∂t + qV . = λ ∂τ ∂x ∂x n
ρ
k
l
h
i
m
(11.1)
j
At the left-hand (x = 0) and at the right-hand (x = L) ends of the rod shown in Fig. 11.1 there is thermal interaction with the environment, and here suitable boundary conditions should be specified. A universal way to describe the various interactions with surroundings is to set the Robbin (mixed) boundary conditions: −λ
∂t ∂x
x = +0
(
)
= α1 t f 1 − t ( x = 0, τ) ;
(11.2) ∂t −λ ∂x
x =L−0
(
)
= α 2 t ( x = L, τ) − t f 2 ,
where and tf are heat transfer coefficients and ambient temperatures on rod ends, which can be some given functions of time. In boundary condition of kind (11.2), two expressions for heat flux are equated, namely on both sides of boundary, inside the rod and outside: • Newton–Richman law for convective heat flux on outside (right-hand sides of (11.2)) • Fourier’s law for conductive heat flux inside the rod, but in immediate proximity from its end (left-hand sides of (11.2)). This equality is entirely correct only when there are no phase transformations on the boundary. Generally the difference of heat fluxes on both boundary sides will be caused by release or absorption of the latent heat during freezing or melting, condensation or evaporation. But we shall not solve here such composite problems with phase changes. o
11.3 Discretization To solve the partial differential equation (11.1), its finite-difference approximation must be prepared. We receive the necessary result, noting the energy conservation law for the small, but finite control volume. Here it would be useful once again to
11.3 Discretization
205
look for the similar calculations that were already carried out earlier (see Sects. 1.4, 9.2).
Λw W
i –1
Λe
qv E
P
∆x
∆x
i
x i+1
Fig. 11.2. Control volume and energy fluxes
Fig. 11.2 explains the energy balance for control volume around node P. From the western (W) and the eastern (E) nodes the heat fluxes owing to thermal conduction arrive. Inside the volume, heat source qV operates. As a result, thermal energy will increase, and we shall detect it as a rise in temperature – from T0P up to TP during the time interval . Energy conservation yields: p
bal ≡
q
T − TP ρc ∆x(TP − T 0 P ) T − TP − λ Λw W − λ Λe E − qV ∆x = 0 . ∆τ ∆x ∆x
(11.3)
The relative values of thermal conductivity are designated as capital Greek “lambda” which is assigned as shown on Fig. 11.2 for the specified control surfaces. For example, for the east surface: −1 t w
λ 1 / 2 1/ 2 Λe ≡ e = + λ ΛP Λ E
r
u
r
u
v
s
=
2Λ P Λ E , ΛP + ΛE
(11.4)
where is the reference thermal conductivity. If heat conductivity is constant, it is enough to specify one single characteristic value and all -values equal unity. If the thermal conductivity depends greatly on temperature or even includes jumps at the border between different layers of material, harmonic mean (11.4) ensures heat flux evaluation with good precision. Eq. (11.3) is given for inner nodes. Further, the similar equation for surface nodes (11.8) will be derived. x
x
y
Implicit Scheme The temperatures in other nodes, i.e. TW and TE are unknowns from the “future”, just as TP. Therefore, relationship (11.3) is an equation with three unknowns. The set of such equations for all nodes with unknown temperature must be solved as a system of linear equations.
206 11 Temperature Waves
In other words: there is no explicit expression for each unknown. Such scheme is called an implicit scheme in numerical analysis. Schemes of this kind have the important property of numerical stability, although they are complicated in handling, because of the necessity to solve a set of equations. Explicit Scheme It is also possible, to attach all temperatures in the second and third members of (11.3) to “past” and to supply them with the label “0”. The explicit scheme in this case is gained: each equation contains a unique unknown value TP (in the first member of (11.3)). The program and the evaluations will be very simple. But if the time step will exceed some value, parasitic oscillations will then occur and even will progress. Restrictions on steps are rather burdensome; therefore today, implicit schemes are preferred. Detailed arguing about explicit and implicit schemes and a corresponding computing example have been given in Sect. 4.7. Coefficients of Implicit Scheme Let us go back to the analysis of Eq. (11.3). After dividing termwise on ( we obtain: bal = (TP − T 0P ) − Fo Λ w (TW − TP ) − Fo Λ e (TE − TP ) − QV ,
z
{
p
x/ p
q
)
(11.5)
where Fo is dimensionless time step named the Fourier-grid-number, a is thermal diffusivity, QV is source term proportional to internal heat source power qV: Fo ≡
a ∆τ qV ∆x 2 λ ; ≡ a ; Q Fo . ≡ V ρc λ ∆x2
Eq. (11.5) must be rewritten in a standard form with the unknown temperatures from “future” TW, TP, TE: C TW + B TP + A TE + D = 0 ,
(11.6)
or, in indexed form: C k Tk −1 + Bk Tk + Ak Tk +1 + Dk = 0 . Comparing (11.6) and (11.5) yields the formulas for A, B, C, D. These symbolic operations are made by Mathcad (Fig. 11.3). In the first block of evaluations, the operator (keyword, in Mathcad terminology) collect agglomerates the terms together with enumerated variables TW , TP, TE. After that we write out the coefficients A, B, C, D easily. In the second block, the alternate variant is given with operator coeffs, writing out coefficients of a polynomial (in our case – first degree) for the indicated variable.
11.3 Discretization
207
So, the coefficients A, B, C, D are completed from known quantities including temperature T0P, taken from the previous time step, or from the initial condition.
(
)
(
)
(
)
bal := TP − T0P − Fo ⋅ Λ w ⋅ TW − TP − Fo ⋅ Λ e ⋅ TE − TP − QV bal collect , TW , TP , TE →
(
)
−Fo ⋅ Λ w ⋅ TW + 1 + Fo ⋅ Λ w + Fo ⋅ Λ e ⋅ TP − Fo ⋅ Λ e ⋅ TE − T0P − QV C := −Fo ⋅ Λ w
A := −Fo ⋅ Λ e
B := 1 − A − C
D := −T0P − QV
__________________________________________________________ |
−T0P − Fo ⋅ Λ w ⋅ TW − Fo ⋅ Λ e ⋅ TE − QV }
coeffsTP := bal coeffs , TP →
}
1 + Fo ⋅ Λ w + Fo ⋅ Λ e ~
B := coeffsTP1 → 1 + Fo ⋅ Λ w + Fo ⋅ Λ e
Fig. 11.3. Coefficients of implicit scheme
We now can derive the linear equations set with tridiagonal matrix as shown below in the example for a grid with five nodes:
B1 A1
0
0
0
T1
−D 1
−D 2
C 2 B2 A2
0
0
T2
−D 3
0
⋅ T3
0
C 3 B3 A3
(11.7)
−D 4
0
0
C 4 B4 A4
T4
0
0
0
C 5 B5
T5
−D 5
The matrices of big systems will appear almost empty: for grid with hundred of nodes only three percent of the matrix elements will be engaged, the rest will be zero. Therefore, at Gaussian elimination in basic the zeros will be handled. However, an express method of elimination has been developed, called TDMA (Tri-Diagonal-Matrix-Algorithm), which takes into account tridiagonal matrix structure [1, 7, 16, 31, 42]. Mathcad-program of this method is given in Fig. 11.6. For boundary nodes, a special expression for the heat balance should be derived. The control volumes here appear in half size (Fig. 11.4). The special formulation for heat flux through a boundary should be applied (see the second term on the right hand side): bal _ B =
1 ρ c ∆x (TP − T 0 P ) T − TP 1 − α T f − TP − λ Λ in in − qV ∆x . ∆τ 2 2 ∆x
(
)
(11.8)
This equation is a discrete analogue of boundary conditions (11.2). The index “in” means the proximate interior node: (n–1) for the right hand end of the rod, 2 – for
208 11 Temperature Waves
the left hand end. After dividing termwise on ( equation for the unknown temperatures TP and Tin :
(
x/2
) we obtain following
)
bal _ B = (TP − T 0P ) − 2 Bi Fo T f − TP − 2 Fo Λ in (Tin − TP ) − QV .
We shall not repeat the evaluations for surface nodes. They are completely similar to those carried out for interior nodes. The final expressions for coefficients can be read in the text of the program Coef (Fig. 11.5).
W
P
n–1
qw tf ,
n
x ∆x / 2 Fig. 11.4. Heat balance for a surface node
11.4 TDMA: Computing Programs Coef and SYSTRD
Mathcad-Program Coef Function Coef (Fig. 11.5) computes the coefficients A, B, C, and D in grid nodes for systems like (11.7). In the program code, D-coefficients are used with reversed sign as in (11.7). The indexing starts with unity, i.e. the value of the built-in Mathcad variable Origin should be 1. The vector T0 in the formal arguments list contains the initial values of temperature; the vector length of T0 is equal to the number of grid nodes, and so last(T0) is the index of rightmost grid point. The input QV is the source term in the balance equation (11.5), proportional to internal heat source power qV. Quantities Tf and Bi are two-element vectors specifying the temperatures of fluids and Bi-grid-numbers at the left and right ends of the rod respectively (Fig. 11.1). The Bi-grid-number is a dimensionless heat transfer coefficient: x/ . Bi = In for loop, the calculation of A, B, C, and D in internal grid points is made (see formulas in Fig. 11.3). Separately the coefficients on the surface grid points (on the left and right boundaries) are computed using Eq. (11.8). The reader may modify this part of the
11.4 TDMA: Computing Programs Coef and SYSTRD 209
program for another boundary condition. In our example, the temperature at the right end Tf2 is given as a sine temporal function. To calculate the current value of the surrounding temperature, the input parameter iTime informs the subroutine, in which point of time the process of calculations is situated. Setting in vector Pulse nonzero amplitude Ampl and some value of pulsatance , we can simulate periodic thermal influences. Program Coef returns an array assembled from vectors A, B, C, and D by means of built-in function augment.
(
)
Coef Fo , Λ , Q v , T0 , Tf , Bi , Pulse , iTime :=
iUp ← last ( T0) for i ∈ 2 .. iUp − 1
( Ai ← −Fo ⋅ Λ i
C i ← −Fo ⋅ Λ i−1 )
Bi ← 1 − A i − C i Di ← T0i + Q v "Left boundary:" A 1 ← −2 ⋅ Fo ⋅ Λ 1 B 1 ← 1 − A1 + 2 ⋅ Fo ⋅ Bi 1 C1 ← 0 D 1 ← T01 + Q v + 2 ⋅ Fo ⋅ Tf1 ⋅ Bi 1 "Right boundary:"
( Ampl ← Pulse1
ν ← Pulse2 )
Bi2 ← Bi 2 Tf2 ← Tf2 ⋅ ( 1 + Ampl ⋅ sin ( ν ⋅ iTime ) ) C iUp ← −2 ⋅ Fo ⋅ Λ iUp B iUp ← 1 − C iUp + 2 ⋅ Fo ⋅ Bi2 A iUp ← 0 D iUp ← T0iUp + Q v + 2 ⋅ Fo ⋅ Tf2⋅ Bi2 augment( A , B , C , D )
Fig. 11.5. The subroutine for calculation of the coefficient matrix
Before going into details, here is the full list of the user functions (subroutines) on the Mathcad-worksheet for calculation of temperature waves: 1. Coef, 2. SYSTRD, 3. TimeHistory. The program listing Coef is available in Fig. 11.5; the others are in Fig. 11.6 and Fig.11.7.
210 11 Temperature Waves
Mathcad-Program SYSTRD Function SYSTRD (see Fig. 11.6) solves a tridiagonal system of the linear equations by TDMA. Coefficients A, B, C, and D for three-diagonal system are prepared by subroutine Coef. D-values will be replaced by the calculated values of temperature at the end of procedure SYSTRD. So, the procedure SYSTRD returns a vector as a solution. SYSTRD( A , B , C , D) :=
iUp ← last ( A) for i ∈ 2 .. iUp
temp ←
Ci Bi−1
( Bi ← Bi − temp⋅ Ai−1 DiUp ←
Di ← Di − temp ⋅ Di−1 )
DiUp BiUp
for j ∈ iUp − 1 , iUp − 2 .. 1
Dj ←
( D j − A j ⋅ D j+1) Bj
D
Fig. 11.6. Solving tridiagonal system of equations
Mathcad-Program TimeHistory Program TimeHistory (Fig.11.7) organizes calculations by time steps. The parameter nTime sets the number of time steps. Function TimeHistory returns the temperature distributions on the x coordinate for the consecutive time moments iTime as columns of F-matrix.
(
)
TimeHistory Fo , Λ , Q v , T0, Tf , Bi , Pulse , nTime := for iTime ∈ 1 .. nTime S ← Coef Fo , Λ , Q v, T0, Tf , Bi , Pulse , iTime
(
)
"TDMA solver call:"
(
T ← SYSTRD S
1
,S
2
"Previous state update:" T0 ← T
F
iTime
←T
Fig.11.7. The main program TimeHistory
,S
3
,S
4
)
11.5 Computational Modeling of Cyclical Thermal Action
211
At each time step the procedure Coef is called to calculate the coefficients A, B, C, and D. Then the solver SYSTRD will be activated. With each resulting Tvector the old T0-vector of temperatures on the previous time step will be updated and a new column will be added to matrix F.
11.5 Computational Modeling of Cyclical Thermal Action In Fig. 11.8, the preparation of the input data is shown for the task that the temperature fluctuations in the brass rod of Fig. 11.1 (length L=40 mm) have to be calculated under the premise that at one end of the rod, temperature is kept constant at 0ºC, and at the other end temperature fluctuations exist with an amplitude of 320 K around a mean temperature level of 800ºC. From this description it is clear, that Dirichlet’s boundary conditions apply. In the program code, mixed type conditions are always set, but are easy to adapt to any situation. Setting the liquid temperatures Tf (Tf 1=0, Tf2=800, Ampl=320) and values of Bi-grid-numbers corresponding to very big heat transfer coefficients we simulate desired boundary conditions. Preparatory calculations in Fig. 11.8 should be clear without any comments. At the end of this fragment, the T0-vector of initial temperatures (100ºC) and also the -vector of relative heat conductivity are formed with the help of built-in function matrix. (As always in this book, calculations are made in system SI.) In the given example, is assumed to be constant. If heat conductivity depends on coordinates and/or temperature, an additional procedure or an insert in program Coef is required. The best way of averaging will be to calculate harmonic mean values by Eq. (11.4). We leave these improvements of the program as exercise for the readers.
λ
λ := 100
cp := 400
ρ := 9000
a :=
∆x := 0.001
nX := 41
∆τ := 1
nTime := 201
Fo = 27.778
qv := 0
2 qv Qv := Fo ⋅ ∆x ⋅ λ
Fo := a ⋅
∆τ 2
∆x
Ampl
Ampl := 0.4
ν := 0.1 T
Pulse :=
T
Tf := ( 0 800 )
Bi := ( 1 1 )
FT( i , j) := 100
T0 := matrix( nX , 1 , FT)
FΛ ( i , j) := 1
Λ := matrix( nX , 1 , FΛ)
Fig. 11.8. The input data
ν
cp ⋅ ρ
212 11 Temperature Waves
Results of calculations are shown in Fig. 11.9 to Fig. 11.11. The threedimensional diagram in Fig. 11.9 is given as complete representation. The basis plane of the diagram is produced by longitudinal coordinate x and time coordinate Time, and on the vertical axis the temperature is plotted. Retracing grid lines on the wavy surface in a normal plane to x-axis, we notice the time dependence. Tracing the alternate route - the spatial distribution of temperature along the rod. To construct such a diagram, we select tab Appearance and option Wireframe in the window 3-D Plot Format; in tab Special, the option Draw Line must be disabled for z-contour and enabled for x and y-contours. So the compelled temperature fluctuations on the hot end of the rod and reduction of amplitude by approaching the opposite end are clearly visible in Fig. 11.9. The next diagram (Fig. 11.10) represents a series of temperature distributions along the x axis for various time moments. It is noticed, that there is an initial stage of heating, and then fluctuations start to get established according to external action. Spectacular representation of a non-stationary temperature field can be achieved with the animation as it is shown in Fig. 11.11 by means of a full screen shot of the appropriate Mathcad worksheet (see also Fig. 9.10 and commentary).
(
)
T := TimeHistory Fo , Λ , Q v , T0 , Tf , Bi , Pulse , nTime
T
Fig. 11.9. Temperature waves: 3D-representation
11.5 Computational Modeling of Cyclical Thermal Action iX := 1 , 3 .. 41 1000
TiX , 1 TiX , 10 TiX , 20 500 TiX , 50
0
0
20
40
iX
Fig. 11.10. Temperature waves: time sequencing
Fig. 11.11. Temperature waves: animation
213
214 11 Temperature Waves
11.6 Built-in Function Pdesolve In Mathcad 11, we can now solve one-dimensional unsteady-state partial differential equations (PDEs) in the solve block Given … Pdesolve(). The new built-in solver
0 0 pdesolve u, x, , t, , [xpts], [tpts] tMax xMax
returns a function of spatial variable x and time variable t as a solution of PDE for function named u. On writing ODE and the boundary conditions, the literal subscripts are used to indicate partial derivatives. For example, uxx(x,t) is the second partial derivative of u with respect to x. The literal subscripts are created with the period key. Further comments: • the 2-element column vectors (0, xMax)T or (0, tMax)T contain the boundary values for x or t, respectively • xpts or tpts (optional) is the number of spatial or temporal discretization points, respectively. The output of pdesolve() is assigned to a function name, as in the example of Fig. 11.13. If pdesolve is applied to a system of partial differential equations, then u by formal argument must be a column vector with unknown functions names as components. The pdesolve call can look in this case as follows: ¢ ¥
¢ ¥
¢ ¥
¢ ¥
¢ ¥
0 0 w w = pdesolve , x, , t, , [xpts], [tpts] . tMax xMax u u £
£
£
£
£
£
£
£
£
£
¤
¡
¤
¡
¤
¡
¤
¡
¡
¤
Additional details can be found in Mathcad Help, also about solving system of PDEs, or about the command-line PDE-solver numol. Pdesolve is based on the numerical method of lines (MOL) that is only appropriate for hyperbolic and parabolic PDEs. For elliptic PDE, such as Poisson's equation, use the built-in relax or multigrid or also user function Plate (see Sect. 10.4). As an example for pdesolve, consider the same problem as in the previous section about temperature waves in the rod, but with some variations in the boundary conditions. We assume now that the properties are constant and the internal heat source is zero and we write down the thermal conductivity parabolic PDE, that is to solve: ∂ 2t ∂t =a 2 , ∂τ ∂x
(11.9)
where a is thermal diffusivity. The next three equations within (11.10) specify the boundary and initial conditions. The first from (11.10) is the Neumann boundary condition on the insulated
11.6 Built-in Function Pdesolve 215
end of the rod. The second is the Robbin (mixed) boundary condition on the other end in which the fluid temperature tf2 will be a function of time, specifically sinusoidal, and the heat transfer coefficient 2 can be assigned to be large to provide for the same temporal variation of the surface temperature. The initial distribution is given in its simplest form as constant temperature value. ¦
∂t ∂x −λ
∂t ∂x
=0; x = +0
(
)
(11.10)
= α 2 t ( x = L, τ) − t f 2 ;
x =L−0
t ( x, τ = 0 ) = t 0 . Basically task parameters will stay the same as in Fig. 11.8. Additional preparatory operations are shown in Fig. 11.12. Heat transfer coefficient at the right end of the rod is marked 2. The fluid temperature Tf2 oscillates about the middle value Tf2m. The initial temperature T0 along the rod is assumed to be constant and equal to the middle fluid temperature Tf2m. §
−5
λ := 100
a := 2.778 × 10
Tf2m := 800
T0 := Tf2m
Ampl := 0.4
ν := 0.1
L := 0.040
τMax := 200
Tf2( τ ) := Tf2m⋅ ( 1 + Ampl ⋅ sin ( ν ⋅ τ) )
¨
©
ª
α2 := 25000
Bi := ¨
©
L λ 1
«
¬
Bi = 10 ¬
ª
«
α2
Fig. 11.12. Additional input data for Pdesolve
Thus, we will investigate, how the temperature oscillations advance along the rod and how pulsations on the insulated (left) end look in comparison with the compelled fluctuations on the heated (right) end. The boundary value problem (11.9), (11.10) is entered in block Given … Pdesolve and the result of numerical integration is assigned to the function T (Fig. 11.13). The graphs show • the calculated temperature of heated (right) end T(L, ), • the desired temperature of fluid on the right end Tf2( ), • the temperature calculated for the insulated (left) end T(0, ). The temperatures T(L, ) and Tf2( ) practically coincide due to the large value of the heat transfer coefficient 2 (Bi>>1, see Fig. 11.12). The oscillations decrease along the rod, and a phase displacement occurs at conserved frequency. Full presentation gives the 3D-plot created with the built-in function CreateMesh that ensures the handy management of the graph construction (Fig. 11.14). ®
®
®
®
§
®
216 11 Temperature Waves nX := 41
nTime := 201
Given Tτ ( x , τ)
a ⋅ Txx ( x , τ)
T( x , 0)
T0
Tx ( 0 , τ)
0
<--PDE <--Initial condition
−λ ⋅ Tx ( L , τ) ¯
¶
°
²
µ
T := Pdesolve T , x , ·
0 ±
L
²
³
¯
0 °
´
α2 ⋅ ( T( L , τ) − Tf2( τ ) )
,τ, ±
´
τMax
¸ ³
<--Boundary condition g
¹
, nX , nTime º
T = function
1120 T( L , τ ) 960 Tf2( τ ) 800 T( 0 , τ )
Bi = 10
640 480
0
50
100
150
200
τ
Fig. 11.13. Block Given … Pdesolve
T := CreateMesh( T , 0 , L , 0 , τMax , nX, nTime)
T
Fig. 11.14. Temperature waves in the rod with insulated end
11.7 Conclusion
217
1120
T( L , τ ) 960 Tf2( τ ) 800 T( 0 , τ )
Bi = 0.5
640 480
0
50
100
150
200
τ
Fig. 11.15. Temperature waves in the rod for comparatively small heat transfer coefficient
The last numerical experiment is shown after twentyfold reduction of the heat transfer coefficient 2. Now the amplitude of fluctuations on surface has sharply decreased, while the phenomena of damping along the rod and of the phase displacement are still distinctly observed (Fig. 11.15). Let us consider briefly the numerical method of lines (MOL) used in Pdesolve. Coming back to the deriving of the discrete equation (11.3) we now make only half the work: we carry out digitization for spatial variable x and leave original continuous representation for time variable (for simplicity we also assume that properties are constant and the internal source is zero). This will result in the following equation (instead of (11.3)) §
®
dTP a = 2 (TW − 2TP + TE ) dτ ∆x
(11.11)
called a semidiscrete approximation. Equations like (11.11) can be written for all nodes of the grid, with some modifications for surface points. Thus, a system of ordinary differential equations with the order equal to the number of grid points is obtained instead of PDE. To solve the reduced problem, i.e. to integrate ODE system, apply well-known algorithms. So we have the effective method for the original PDE. Historically, the semidiscrete approximation was applied to the integration of partial differential equations on electronic analog computers (see e.g. [42]). 11.7 Conclusion The numerical experiment started above can be continued in the following directions: • To investigate the influence of heat transfer coefficient on surface temperature (on its maximal and time-averaged values) • To investigate the influence of material properties on the maximal surface temperature and on the heat flux within the rod
218 11 Temperature Waves
• To investigate the penetration of temperature waves, after taking a long rod and having set adiabatic conditions on one of its ends • To investigate the heat transmission through the wall when the heat transfer coefficient on one side will pulse in time (in this case it is required to slightly modify the program Coef, having provided the variations of Bi-number, the same as was shown already for temperature of the surroundings) • To investigate the temperature conditions of cylinder walls in combustion engines with air cooling • To investigate the temperature conditions of walls in buildings when exposed to weather and seasonal changes of temperature • To investigate, how the temperature of a surface irradiated depends on power and duration of a laser pulse • Etc. It is possible to analyse the majority of classical heat conduction problems, making numerical experiments on the computer model developed. With methods of computing to steady state also many stationary problems can be solved, e.g. the heat conduction in finned surfaces, in solids with internal sources and so on. There is one more important application area of the theory of temperature waves, namely measurements of thermophysical properties (thermal conductivity, thermal diffusivity) of materials with so-called Laser Flash Technique (LFT). In this method, a short laser pulse is applied to the front side of a sample, and the temperature rise on the opposite side is measured with infrared detectors or very small thermocouples. When a theoretical solution is available (similar to shown on Fig. 11.14), the opposite side temperature response measured can be interpreted with the purpose to find the thermal diffusivity and even its temperature dependence. LFT is used over the wide temperature range – from cryogenic to 2000°C. Easy sample preparation, small required sample dimensions, fast measurement times and high accuracy are at the same time marked. The last three chapters of the book were devoted to the realization of numerical methods for partial differential equations in Mathcad. Advantage of the simple Mathcad-programs developed here is that they show the basic algorithms of the numerical analysis, being accessible and open for updating and experiments. Wider discussion of numerical analysis as base of modern computing programs is provided in several sources included in the reference chapter: [1, 6, 7, 13, 14, 16, 19, 21, 22, 28–32, 34, 39].
Literature 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15.
16. 17. 18. 19. 20. 21. 22.
Anderson DA, Tannehill JC, Pletcher R (1984) Computational fluid mechanics and heat transfer. Hemisphere Publishing Corporation, New York Betchov R, Criminale W (1967) Stability of parallel flows. Academic Press, New York London Budsuljak BV, Grigorjev BA, Sedich AD, Solodov AP (2000) Heat engineering problems by gas transport (in Russian). Industry of Russia 10–11:112–117 Falkner VM, Skan SW (1931) Some approximate solutions of the boundary layer equations. Phil Mag 12:865–896 Farlow SJ (1982) Partial differential equations for scientists and engineers. John Wiley & Sons Inc Fletcher CAJ (1984) Computational Galerkin Methods. Springer-Verlag, New York Heidelberg Berlin Tokyo Fletcher CAJ (1988) Computational techniques for fluid dynamics. Springer-Verlag, Berlin New York Heidelberg Tokyo London Paris Gerasimov JaI (ed) (1963) Course of physical chemistry (in Russian). Chemistry Publishing, Moscow Gould H, Tobochnik J (1988) An introduction to computer simulation methods. Applications to physical systems. Addison-Wesley Publishing Company Grigorjev BA, Remisov VV, Sedich AD, Solodov AP (1999) Energy efficiency by gas transport (in Russian). Publishing MEI, Moscow , Kopilov S, Pilschikov P (1990) Water preparation: process and Gromoglasov devices (in Russian). Energoatomisdat, Moscow Haken H (1983) Advanced synergetics. Springer-Verlag, Berlin New York Heidelberg Tokyo Hall G, Watt JM (eds) (1976) Modern numerical methods for ordinary differential equations. Clarendon Press, Oxford Hamming RW (1962) Numerical methods for scientists and engineers. Mc Graw-Hill Book Company Inc Isatchenko VP, Solodov AP, Maltsev AP, Jakusheva EV (1984) Asymptotic analysis of dropwise condensation (in Russian). Teplophisica vysokich temperatur, AN SSSR, vol 2, 5:924 – 932 Kalitkin NN (1978) Numerical methods (in Russian). Nauka, Moscow Kamke E (1959) Differentialgleichungen, Loesungsmethoden und Loesungen. Gewoehnliche Differentialgleichungen, Leipzig Kutateladze SS, Leontyev AI (1985) Heat mass transfer and resistance in turbulent boundary layer (in Russian). Energoatomisdat, Moscow Marchuk GI (1989) Methods of computational mathematics (in Russian). Nauka, Moscow Martinova OI, Nikitin AV, Ochkov VF (1990) Water preparation: calculations on the personal computer (in Russian). Energoatomisdat, Moscow Moiseev NN {1979) Mathematical experiment (in Russian). Nauka, Moscow Na TY (1979) Computational methods in engineering boundary value problems. Academic Press »
»
»
»
220 Literature 23. 24. 25. 26. 27. 28. 29. 30. 31. 32. 33. 34. 35. 36.
37. 38. 39. 40. 41. 42. 43. 44. 45.
46. 47.
Nayfeh AH (1973) Perturbation methods. A Wiley-Interscience Publication Ochkov VF (1999) Mathcad 8 Pro for the students and engineers (in Russian). ComputerPress, Moscow Ochkov VF (2001) Advice to the Mathcad users (in Russian). Publishing MEI, Moscow Ochkov VF (2002) Units in Mathcad and Maple (in Russian). Finances & Statistics, Moscow Ochkov VF, Pilschikov P, Solodov AP, Chudova JV (2003) The analysis of ion exchange isotherms in Mathcad. Thermal Engineering 7:13–18 Oran ES, Boris JP (1987) Numerical Simulation of Reactive Flow. Elsevier, New York Amsterdam London Ortega JM, Poole WG (1981) An introduction to numerical methods for differential equations. Pitman Publishing Inc Paskonov VM, Polezjaev VI, Chudov LA (1984) Numerical modeling heat and mass transfer (in Russian). Nauka, Moscow Patankar S (1980) Numerical heat transfer and fluid flow. Hemisphere Publishing Corporation, New York Peyret R, Taylor TD (1983) Computational methods for fluid flow. Springer-Verlag, New York Heidelberg Berlin Poston T, Stewart I (1978) Catastrophe theory. Pitman, London San Francisco Melbourne Roache PJ (1976) Computational fluid dynamics. Hermosa Publishers, Albuquerque Sakrevski SL, Solodov AP (1998) Dynamic model of low pressure direct contact heat exchanger. Thermal Engineering 7:48–51. Salomsoda FG, Solodov AP (1997) Heat and mass transfer by condensation and sorbtion from geothermal steam (in Russian). Proceedings of the Russia Academy of Sciences, Energetika 4:35–47. Semyonov NN (1954) Some problems in chemical kinetics and reactivity. Moscow Shelkin KI (1970) Combustion and detonation theory (in Russian). In: Sedov LI (ed) Mechanics in USSR for 50 Years. Nauka, Moscow, vol 2, pp 343–422 Shih Tien-Mo (1984) Numerical heat transfer. Hemisphere Publishing Corporation, Springer-Verlag Solodov AP (1971) Condensation on laminar fluid jet. Thermal Engineering 4:50–53. Solodov AP (1985) Linear instability analyze of phase interface (in Russian). Interinstitute Transactions 54:105–116. Publishing MEI, Moscow Solodov AP (ed) (1986) Practicum in heat transfer (in Russian). Energoatomisdat, Moscow Solodov AP (1990) Numerical model of heat transfer by direct contact condensation. Thermal Engineering 10 Solodov AP (1992) Integral method of boundary layer problem (in Russian). Publishing MEI, Moscow Solodov AP (1994) Interface instability and turbulence in liquid-vapor system (in Russian) In: Proc. of the First Russia National Heat Transfer Conf. Publishing MEI, Moscow Solodov AP (1999) Computer Model of Nucleate Boiling. In: Lehner M., Mayinger F. (eds) Convective Flow and Pool Boiling. Taylor & Francis, pp 231–238. Solodov AP (2001) Dynamic model of system with heat generation (in Russian). Vestnik MEI 1:43–49. Publishing MEI, Moscow »
Literature 221 48. 49. 50. 51.
52.
53.
54. 55. 56. 57. 58.
Solodov AP (2001) Heat transfer near the stagnation point at ross tube flow. Thermal Engineering 3:75–77 Solodov AP (2002) Gravitational bubble flow. Thermal Engineering 8:59–64 Solodov AP (2002) Heat-mass transfer principles (in Russian). Publishing MEI, Moscow Solodov A, Eroshenko E (1996) Calculation of the two-dimensional temperature distribution in finned tubes at pool boiling. In: Gorenflo D, Kenning DBR, Marvilett Ch (eds). Eurotherm Seminar Pool Boiling 2, Edizony ETS, Pisa, pp 141–147 Solodov AP, Sidenkov DV (1994) Algorithm of numerical solving of heat convection problem in areas of composite geometry (in Russian) In: Proc of the First Russia National Heat Transfer Conf. Publishing MEI, Moscow Solodov AP, Sidenkov DV, Kutakov II (1993) Physical and mathematical model, algorithm and program for computation of heat mass transfer and resistance in steam condensation in inclined tubes. In: Proc. Engng. Foundation Conf. on Condensation and Condenser Design, St Augustine, Florida, ASME, pp 569–580 Spalding DB, Evans HL (1961) Mass transfer through laminar boundary layers. Int J Heat Mass Transfer, vol 2, pp 199–221 Swinney HL, Gollub JP (eds). Hydrodynamic Instabilities and the Transtion to Turbulence. Springer-Verlag. Berlin Heidelberg NewYork 1981 Van Dyke M (1964) Perturbation methods in fluid mechanics. Academic Press. New York London Van Dyke M (1982) An album of fluid motion. The Parabolic Press, Stanford. California Wallis GB (1972) One-dimensional two-phase flow. McGraw-Hill, New York London ¼
Appendix: Built-in Solvers for ODE The brief reference material from Mathcad Help about the differential equations solvers is presented. As an example, the Falkner–Scan equation (6.1) of the third order or equivalent system of three equations of the first order is by various methods solved. odesolve(x,b,step) Solving a single ordinary differential equation for either initial value or boundary value problems (Fig. A1): f = odesolve(x,b,[step]). You can to plot the function f(x) or to calculate any value, e.g. f(6). Arguments of function: • x is the variable of integration • b is the terminal point of the integration interval • step (optional) is the number of steps used internally when calculating the solution. The parameters x, b, step must be real. It is recommended to experiment with step to validate or reject the solution. You can also to choose between fixed step and adaptive step size and also stiff methods whereas you right-click on odesolve and choose Fixed or Adaptive or Stiff from the pop-up menu. N := 100 f''' ( η ) + f ( η ) ⋅ f'' ( η )
Given f( 0)
0
f' ( 0 )
f := Odesolve
0
0
f' ( 6 )
1
( η , 6 , N)
f = function
U ( η ) :=
f ( 6 ) = 4.783
dη
f( η )
1
6
f(η )
d
4
U (η )
0.5
2 0
0
5
η
0
0
5
η
Fig. A1. Application of odesolve for solution of the third order differential equation
224
Appendix: Built-in Solvers for ODE
odesolve(vector,x,b,[step]) This mode has appeared in the version Mathcad 2001i and is intended for systems of the differential equations. The first argument vector is a column vector with names of dependent variables. Its dimensionality is equal to the number of the differential equations, which not necessarily should be the equations of the first order. The solution is returned as a vector of functions of , with the same structure as the parameter vector. The number of conditions should be equal to the sum of orders of the differential equations. An example see in Fig. 1.4. ½
rkfixed(IC, x1, x2, npoints, D) Solution using fixed step sizes (Fig. A2): S= rkfixed(IC, x1, x2, npoints, D). S is a matrix containing x in the first column and the solution and its first (n –1) derivatives in the remaining columns; n is the order of system of differential equations. Â
Á ¾
Â
Á ¾
F1 ¿
0 ¿
Â
Â
¿
¿
D ( η , F) :=
F2 ¿
IC := Â
Â
0 ¿
À
−F0 ⋅ F2 À
η w := 0
0.4696 Ã
η inf := 6
(
Ã
N := 100
)
S := rkfixed IC , η w , η inf , N , D Ä
η := S
Å
Ä
0
f := S
0
S=
Å
Ä
1
U := S
1
Å
Ä
2
Stress := S
2
Å
3
3
0
0
0.47
0.06
0 8.45·10 -4
0
1
0.03
0.47
2
0.12
3.38·10 -3
0.06
0.47
3
0.18
7.61·10 -3
0.08
0.47
4
0.24
0.01
0.11
0.47
6
1
4 f
U
0.5
2 0
0
5 η
0
0
5 η
Fig. A2. Application of rkfixed for solution of differential equations system equivalent to Falkner–Scan equation
rkadapt(IC, x1, x2, acc, D, kmax, s) 225
Arguments of rkfixed: • IC is an n-vector of initial values of dependent variable Y. • D is from user defined vector-function D(x,Y) containing the second members of the equations (right-hand sides of equations). • x1, x2 are endpoints of integration variables interval. Initial values in IC are the values at x1. • npoints is the number of integration steps. This controls the number of rows (1 + npoints) in S. . In the example: Y F, x Æ
Æ
Ç
rkadapt(IC, x1, x2, acc, D, kmax, s) Solution using adaptive step sizes (Fig. A3): S = rkadapt (IC, x1, x2, acc, D, kmax, s). Unlike rkfixed, which integrates in equal size steps, rkadapt examines how fast a solution is changing and adapts its step-size accordingly. Arguments: • IC is a vector of initial values or a scalar. • x1, x2 are initial point and terminal point of the integration interval, respectively. • acc controls the accuracy of the solution. If the computational error on , the step decreases. the given step exceeds • D is a vector-function containing the first derivatives of the unknown functions (right-hand sides of equations). • kmax is the maximum number of intermediate points at which the solution will be approximated. The value of kmax places an upper bound on the number of rows of the matrix returned by these functions. • s is the smallest allowable spacing between the values at which the solutions are to be approximated. This places a lower bound on the difference between any two numbers in the first column of the matrix returned by the function. È
É
É
Rkadapt(y, x1, x2, npoints, D) The arguments and output of Rkadapt (Fig. A4) are the same as that of rkfixed. Rkadapt returns the solution at equally spaced points (total 1+ npoints). At each interval of this kind, Rkadapt calls rkadapt with acc equal to environment variable TOL. bulstoer(y,x1,x2,acc,D,kmax,s), Bulstoer(y, x1, x2, npoints, D) Solving of smooth systems. The arguments and output of each of these functions are identical to those of the rkadapt and Rkadapt, respectively. In Mathcad Help, bulstoer is recommended for smooth systems, and rkadapt for slowly varying systems. The average user hardly will notice a difference in application of these functions. Comparison can be found in the book [13].
226
Appendix: Built-in Solvers for ODE Î
Í Ê
Î
F1 Ë
Í Ê
0 Ë
Î
Î
Ë
Ë
D ( η , F) :=
F2 Ë
IC := Î
Î
Ë
0 Ì
Ì
η w := 0
−F0 ⋅ F2
Ï
0.4696 Ï
η inf := 6
Nmax := 200
acc := 0.0001
(
save_int := 0
)
S := rkadapt IC , η w , η inf , acc , D , Nmax , save_int Ð
η := S
Ñ
Ð
0
f := S
0
S=
Ñ
Ð
1
U := S
1
Ñ
Ð
2
Stress := S
2
Ñ
3
3
0
0
0
0
0.4696
1
1.146·10 -8
0
5.3814·10 -9
0.4696
2
2.1774·10 -8
0
1.0225·10 -8
0.4696
3
7.3348·10 -8
1.2632·10 -15
3.4444·10 -8
0.4696
4
3.3122·10 -7
2.5759·10 -14
1.5554·10 -7
0.4696
6
1
4 f
U
0.5
2 0
0
5
0
0
η
5 η
Fig. A3. Application of rkadapt for system equivalent to Falkner–Scan equation
Stiffr(y, x1, x2, npoints, D, J), stiffr(y,x1,x2,acc,D,J,kmax,s) This solvers just as two more functions: Stiffb(y, x1, x2, npoints, D, J), stiffb(y,x1,x2,acc,D,J,kmax,s) specifically designed for stiff systems. The list of arguments is similar to one for functions: Rkadapt (y, x1, x2, npoints, D), rkadapt (y, x1, x2, acc, D, kmax, s). The additional parameter J is a function that returns the n by (n+1) matrix whose first column contains derivatives and whose remaining rows and columns form the Jacobian matrix for the system of differential equations. Stiffb uses the Bulirsch–Stoer method for stiff systems. Stiffr uses the Rosenbrock method [13]. Solving of stiff differential equations is explained in detail in Chap. 4. Ibidem the key distinctions of methods rkfixed, rkadapt, stiffr are considered.
sbval(v, x1, x2, D, load, score)
227
−3
TOL = 1 × 10
Ö
Õ Ò
Ö
F1
η w := 0 Ó
Õ Ò
0 Ó
Ö
Ö
Ó
Ó
D ( η , F) :=
η inf := 6
F2 Ó
IC := Ö
Ö
0 Ó
Ô
N := 100
−F 0 ⋅ F 2 Ô
(
×
0.4696 ×
)
S := Rkadapt IC , η w , η inf , N , D Ø
η := S
Ù
Ø
0
f := S
0 0 S=
Ù
Ø
1
U := S
1 0
Ù
Ø
2
Stress := S
2
Ù
3
3
0
0
0.4696
1
0.06 8.45279·10 -4
0.02818
0.46959
2
0.12 3.38107·10 -3
0.05635
0.46954
3
0.18 7.60717·10 -3
0.08452
0.46939
4
0.24
0.11267
0.46909
0.01352
6
1
4 f
U
0.5
2 0
0
5 η
0
0
5 η
Fig. A4. Application Rkadapt for system equivalent to Falkner–Scan equation
sbval(v, x1, x2, D, load, score) Solving two-point boundary value problems (Fig. A5). Function sbval converts a two-point boundary value problem to an initial value problem, and returns a vector containing those initial values left unspecified at x1. Arguments: • v ( in the example) is a vector of guesses for the initial values left unspecified at x1. • x1, x2 are initial point and terminal point of the integration interval respectively. • D is an n-element vector-valued function containing right-hand sides of equations. • Load (SetInit in the example) is a n-vector of initial values at x1. Some values will be constants specified by your initial conditions (the first two in the example). Others will be unknown at the outset but will be found by sbval. If a value is unknown, use the corresponding guess value from v. • score (discrepancy in the example) is a vector-valued function having the same number of elements as v. Each element is the bound condition Ú
228
Appendix: Built-in Solvers for ODE
at x2, written down as expression that should be zero (F1–1 instead of F1=1, see example) . Functilon sbval solves a two-point boundary value problem by the “shooting method” which is discussed in detail in Chap. 6. The function sbval returns the missing initial conditions. Further you can use any suitable method for initial problem. Þ Û
F1 Ü
ß
ß
Ü
D ( η , F) :=
F2 Ü
Ý
−F0 ⋅ F2
F0 η w
à
η inf := 6
F1 η inf
ξ0 := 0.1 ß
0 Ü
ß
(
)
Ü
0 ß
Ü
Ý
0
( )
F1 η w
0
ξ0
(
(
)
1
<--- guess value for F2 ( η w) <--- known for F0 ( η w) <--- known for F1 ( η w) <--- unknown for F2 ( η w )
Þ Û
SetInit η w , ξ :=
( )
η w := 0 ß
à
( i.e. F1 ( η inf ) = 1)
)
discrepancy η inf , F := F1 − 1
(
MissingInitCond := sbval ξ , η w , η inf , D , SetInit , discrepancy MissingInitCond = ( 0.4696004917381 )
(
InitCond := SetInit η w , MissingInitCond
) Þ
Û
)
ß
0 Ü
ß
Ü
InitCond =
0 Ü
Ý
ß
à
0.4696
Fig. A5. Solving two-point boundary value problem for Falkner–Scan equation
bvalfit (v1, v2, x1, x2, xin, D, load1, load2, score) Using intermediate values to reconstruction of initial conditions. Returns a vector containing those initial values left unspecified at x1. Arguments: • v1 is a vector of guesses for the initial values left unspecified at x1. v2 is a vector, which contains guesses for initial values left unspecified at x2. • x1, x2 ( w, inf in the example) are endpoints of the interval on which the solution to differential equations will be evaluated. • Xin ( in in the example) is a point between x1 and x2 at which the trajectories of the solutions beginning at x1 and those beginning at x2 are constrained to be equal. • D is an n-element vector-valued function containing the first derivatives of the unknown functions. á
á
á
bvalfit (v1, v2, x1, x2, xin, D, load1, load2, score) 229
•
load1 (SetInitL in the example) is a vector-valued function whose n elements correspond to the values of the n unknown functions at x1. Some of these values will be constants specified by your initial conditions. If a value is unknown you should use the corresponding guess value from v1.
•
load2 (SetInitR in the example) is analogous to load1 but for values taken by the n unknown functions at x2. • score is an n-element vector-valued function used to specify how you want the solutions to match at xin. You'll usually want to define score(xin, y) := y to make the solutions to all unknown functions match up at xin. Notes: bvalfit (Fig. A6) solves a two-point boundary value problem by shooting from the endpoints and matching the trajectories of the solution and its derivatives at the intermediate point. This method becomes especially useful when the derivative has a discontinuity somewhere in the integration interval (see Sect. 10.6). å â
F1 ã
æ
æ
ã
D ( η , F) :=
F2 ä
ã
−F0 ⋅ F2 ç
v10 := 0.1
F0 η w
η inf := 6
F1 η inf
v20 := 2 æ
0 ã
æ
)
ã
SetInitL η w , v1 :=
0 æ
ã
ä
ç
v10
æ
v20 ã
æ
)
ã
SetInitR η inf , v2 :=
1 ã
ä
(
)
æ
ç
v21
v21 := 0
(
)
score η in , F := F
η in := 1
(
MIC := bvalfit v1 , v2 , η w , η inf , η in , D , SetInitL , SetInitR , score å â
0.4696004917523 ã
MIC =
)
æ
4.7832233700247 æ
ã
ä
0
0 g
1
<--- unknown for F0(η inf ) <--- known for F1(η inf ) <--- unknown for F2(η inf )
å â
(
( )
F1 η w
0
<--- known for F0(η w ) <--- known for F1(η w ) <--- unknown for F2(η w )
å â
(
( )
η w := 0 æ
−6 ç
3.5568749177207 × 10
Fig. A6. Solution of two-point boundary value problem with bvalfit
230
Appendix: Built-in Solvers for ODE
radau (y, x1, x2, acc, D, kmax, step), Radau (y, x1, x2, npts, D) These two functions for the integration of the ordinary differential equations have appeared in the version Mathcad 2001i. They have the lists of parameters, compatible with bulstoer, rkadapt, Bulstoer and Rkadapt. The new integrators radau and Radau are specifically intended for the stiff differential equations and have an important advantage in comparison with stiffb, stiffr, Stiffb, Stiffr: the matrix of Jacobi J is excluded from the list of parameters. But this is a disadvantage if J is readily available, because having J will tend to increase accuracy.
Index A adiabatic approximation, 73 animation, 162, 212 Archimedean buoyancy force, 18 Arrhenius law, 48 augment, 77, 131, 209
B bifurcation, 53 Biot number, 187 blowing, 81, 102, 107 boundary conditions, 112, 183, 186, 189, 193, 204, 207, 214 boundary problem, 101 break, 188 bulstoer, 225 bvalfit, 192, 228
C catastrophe theory, 47 collect, 2, 19, 126, 185, 206 complex, 3 complex amplitude, 124 complex amplitudes, 127 complex exponential function, 41 complex solution, 42, 135 Contour Plot, 105, 161 control volume, 15, 20, 152, 184 Couette flow, 7 Courant number, 154 cspline, 99, 114
D divergence, 15 drag coefficient, 4 drop motion, 4
E eigenvals, 73 enthalpy thickness, 80 explicit scheme, 74, 206
F factor, 86 Falkner–Skan equation, 95 Fick's law, 16 Find, 132, 133 fold catastrophe, 55 for, 131, 188 Fourier’s law, 17
FRAME, 162 fuel element, 31, 197
G Gauss–Saidel iterative procedure, 186 Given, 32, 132
H harmonic oscillator, 2, 3 heat transfer coefficient, 48, 86, 116, 117 hysteresis, 56
I if, 84, 86 implicit scheme, 74, 206 initial problem, 101 integral method, 79 interp, 99, 114, 159
J Jacobi matrix, 71
L Langmuir isotherm, 146 Laser Flash Technique, 218 last, 69 linearization, 76, 123, 127 linterp, 105 Logistic model, 10
M MacCormack method, 153 matrix, 104, 211 method of lines, 217 Minimize, 90
N Newton–Richman law, 49, 86, 112 numerical instability, 64, 69, 121 numol, 214 Nusselt number, 113
O odesolve, 6, 32, 40, 58, 91, 113, 223 Origin, 208 ozone layer, 61
P Parametric surface plot, 26, 148 pdesolve, 214 permafrost, 196 perturbation method, 78, 125 phase portrait, 50
232
Index
phase velocity, 124 pipeline, 196 Poisson equation, 183 pspline, 159
R Rayleigh’s equation, 124 relax, 183, 188, 189 resistance force, 4 Reynolds number, 4, 117, 125 rkadapt, 68, 69, 225 rkfixed, 63, 68, 103, 130, 224 rnorm, 11 root, 6, 32, 57, 114
S sbval, 102, 227 shock wave, 151, 155 shooting method, 102 similarity transformation, 97 solve, 2, 11, 86 source power, 15 stack, 104, 157
stiff problem, 73 stochastic function, 11 Stokes law, 18 submatrix, 157 substitute, 2, 86 suction, 102, 109, 121
T TDMA method, 207, 210
U unstable point, 51
V Vector Field Plot, 84, 104, 105 Vectorize, 166
W Wallis model, 173 wave equation, 24, 142, 151, 174 wave number, 63, 129 wave umklapp, 28, 148 wave velocity, 25, 140, 174