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 ;
>
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 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 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 . 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 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
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· ),