FlexPDE User Guide
FlexPDE User Guide
FlexPDE User Guide
Without limiting the rights under copyright, no part of this document may be reproduced, stored in or introduced into a retrieval system, or transmitted in any form or by any means (electronic, mechanical, photocopying, or otherwise) without the express written permission of PDE Solutions Inc. PDE Solutions may have patents, patent applications, trademarks, and copyrights or other intellectual property rights covering subject matter in this document. Except as provided in any written license agreement from PDE Solutions Inc., the furnishing of this document does not give you any license to these patents, trademarks, copyrights or other intellectual property.
PDE Solutions, and FlexPDE are either registered trademarks or trademarks of PDE Solutions Inc. in the United States and/or other countries.
This version of this and the companion manuals are current as of the initial release of version 5. Electronic versions of this manual together with subsequent release notices and the companion manuals in the FlexPDE documentation series are available online at www.pdesolutions.com. Electronic versions are updated more frequently than printed versions, and may reflect recent developments in FlexPDE more accurately.
Table of Contents
1. Foreword ...............................................................................................1 2. Overview ...............................................................................................2 2.1. What Is FlexPDE? ..........................................................................2 2.2. What Can FlexPDE Do?.................................................................4 2.3. How Does It Do It? .........................................................................5 2.4. Who Can Use FlexPDE? ................................................................7 2.5. What Does A Script Look Like?......................................................8 2.6. What About Boundary Conditions? ..............................................10 3. Basic Usage ........................................................................................11 3.1. How Do I Set Up My Problem? ....................................................11 3.2. Problem Setup Guidelines............................................................13 3.3. Notation ........................................................................................15 3.4. Variables and Equations...............................................................16 3.5. Mapping the Domain ....................................................................17 3.6. An Example Problem....................................................................19 3.7. Generating A Mesh.......................................................................20 3.8. Defining Material Parameters.......................................................22 3.9. Setting the Boundary Conditions..................................................24 3.10. Requesting Graphical Output .....................................................26 3.11. Putting It All Together .................................................................28 4. Some Common Variations ..................................................................31 4.1. Controlling Accuracy.....................................................................31 4.2. Computing Integrals .....................................................................33 4.3. Reporting Numerical Results........................................................35 4.4. Summarizing Numerical Results ..................................................36 4.5. Parameter Studies Using STAGES..............................................37 4.6. Cylindrical Geometry ....................................................................40 4.6.1. Integrals In Cylindrical Geometry...........................................40 4.6.2. A Cylindrical Example ............................................................41 4.7. Time Dependence ........................................................................44 4.7.1. Bad Things To Do In Time Dependent Problems..................47 4.8. Eigenvalues and Modal Analysis..................................................48 4.8.1. The Eigenvalue Summary .....................................................51 5. Addressing More Difficult Problems....................................................53 5.1. Nonlinear Coefficients and Equations ..........................................54 5.1.1. Complications Associated with Nonlinear Problems .............56 5.2. Natural Boundary Conditions .......................................................58 5.2.1. Some Typical Cases ..............................................................59 5.2.2. An Example of a Flux Boundary Condition............................61 5.3. Discontinuous Variables ...............................................................63 5.3.1. Contact Resistance................................................................63 5.3.2. Decoupling .............................................................................66 5.3.3. Using JUMP in problems with many variables ......................67 6. Using FlexPDE in One-Dimensional Problems...................................69
7. Using FlexPDE in Three-Dimensional Problems ................................71 7.1. The Concept of Extrusion .............................................................72 7.2. Extrusion Notation in FlexPDE .....................................................74 7.3. Layering........................................................................................76 7.4. Setting Material Properties by Region and Layer.........................78 7.5. Void Compartments......................................................................80 7.6. Limited Regions............................................................................81 7.7. Specifying Plots on Cut Planes ....................................................83 7.8. The Complete 3D Canister...........................................................84 7.9. Setting Boundary Conditions in 3D ..............................................87 7.10. Shaped Layer Interfaces ............................................................91 7.11. Integrals in Three Dimensions....................................................95 7.12. More Advanced Plot Controls.....................................................99 8. Moving Meshes .................................................................................101 8.1. Mesh Balancing ..........................................................................102 8.2. The Pulsating Blob .....................................................................103 9. Controlling Mesh Density ..................................................................105 10. Exporting Data to Other Applications..............................................108 11. Solving Nonlinear Problems............................................................112 12. Getting Help ....................................................................................115 Index......................................................................................................116
1. Foreword
This document attempts to introduce the reader gradually to the use of FlexPDE in the solution of systems of partial differential equations. We begin with a discussion of the basic character of FlexPDE. We then construct a simple model problem and proceed to add features to the model. The result is a description of the most common features of FlexPDE in what we hope is a meaningful and understandable evolution that will allow users to very quickly become accustomed to the use of FlexPDE and to use it in their own work. No attempt is made in this manual to present a complete description of each command or circumstance which can arise. Detailed descriptions of each command are presented in the companion volume, the FlexPDE Problem Descriptor Reference.
2. Overview
2.1. What Is FlexPDE?
FlexPDE is a "scripted finite element model builder and numerical solver". By this we mean that from a script written by the user, FlexPDE performs the operations necessary to turn a description of a partial differential equations system into a finite element model, solve the system, and present graphical and tabular output of the results. FlexPDE is also a "problem solving environment". It performs the entire range of functions necessary to solve partial differential equation systems: an editor for preparing scripts, a mesh generator for building finite element meshes, a finite element solver to find solutions, and a graphics system to plot results. The user can edit the script, run the problem and observe the output, then re-edit and rerun repeatedly without leaving the FlexPDE application environment. FlexPDE has no pre-defined problem domain or equation list. The choice of partial differential equations is totally up to the user. The FlexPDE scripting language is a "natural" language. It allows the user to describe the mathematics of his partial differential equations system and the geometry of his problem domain in a format similar to the way he might describe it to a co-worker. For instance, there is an EQUATIONS section in the script, in which Laplace's equation would be presented as Div(grad(u)) = 0. Similarly, there is a BOUNDARIES section in the script, where the geometric boundaries of a two-dimensional problem domain are presented merely by walking around the perimeter: Start(x1,y1) line to (x2,y1) to (x2,y2) to (x1,y2) to CLOSE This scripted form has many advantages 1 2
The script completely describes the equation system and problem domain, so there is no uncertainty about what equations are being solved, as might be the case with a fixed-application program. New variables, new equations or new terms may be added at will, so there is never a case of the software being unable to represent a different loss term, or a different physical effect. Many different problems can be solved with the same software, so there is not a new learning curve for each problem
There is also a corollary effect with the scripted model: The user must be able to pose his problem in mathematical form. In an educational environment, this is good. It's what the student wants to learn. In an industrial environment, a single knowledgeable user can prepare scripts which can be used and modified by less skilled workers. And a library of application scripts can show how it is done.
A data export module can write text reports in many formats, including simple tables, full finite element mesh data, CDF or TecPlot compatible files.
[Note: There are several other optional sections for describing special aspects of the problem. Some of these will be introduced later in this document. Detailed rules for all sections are presented in the FlexPDE Problem Descriptor Reference chapter "Sections".] Comments can be placed anywhere in a script. { Anything inside curly brackets is a comment. } ! from an exclamation to the end of the line is a comment. A simple diffusion equation on a square might look like this: TITLE 'Simple diffusion equation' { this problem lacks sources and boundary conditions } VARIABLES u DEFINITIONS
k=3 { conductivity } EQUATIONS div(k*grad(u)) =0 BOUNDARIES REGION 1 START(0,0) LINE TO (1,0) TO (1,1) TO (0,1) TO CLOSE PLOTS CONTOUR(u) VECTOR(k*grad(u)) END Later on, we will show detailed examples of the development of a problem script.
10
3. Basic Usage
3.1. How Do I Set Up My Problem?
FlexPDE reads a text script that describes in readable language the characteristics of the problem to be solved. In simple applications, the script can be very simple. Complex applications may require much more familiarity with the abilities of FlexPDE. In the following discussion, we will begin with the simpler features of FlexPDE and gradually introduce more complex features as we proceed. FlexPDE has a built-in editor with which you can construct your problem script. You can edit the script, run it, edit it some more, and run it again until the result satisfies your needs. You can save the script for later use or as a base for later modifications. The easiest way to begin a problem setup is to copy a similar problem that already exists. Whether you start fresh or copy an existing file, there are four basic parts to be defined: Define the variables and equations Define the domain Define the material parameters Define the boundary conditions Specify the graphical output.
options is detailed in the FlexPDE Reference. Many will also be addressed in subsequent topics.]
These steps will be described in the following sections. We will use a simple 2D heatflow problem as an example, and start by building the script from the most basic elements of FlexPDE. In later sections, we will elaborate the script, and address the more advanced capabilities of FlexPDE in an evolutionary manner. 3D applications rely heavily on 2D concepts, and will be discussed in a separate chapter. [Note: We will make no attempt in the following to describe all the options that are available to the user at any point, but try to keep the concept clear by illustrating the most common forms. The full range of 11 12
3.3. Notation
In most cases, FlexPDE notation is simple text as in a programming language. Differentiation, such as du/dx, is denoted by the form dx(u). All active coordinate names are recognized, as are second derivatives like dxx(u) and differential operators Div, Grad and Curl. Names are NOT case sensitive. "F" is the same as "f". Comments can be placed liberally in the text. Use { } to enclose comments or ! to ignore the remainder of the line. [Note: See the Problem Descriptor Reference chapter on Elements for a full description of FlexPDE notation.]
15
16
Arcs can also be built by specifying a center and an end point: START(r,0) ARC(CENTER=0,0) TO (0,r) { a 90 degree arc }
An elliptical arc will be built if the distance from the center to the endpoint is different than the distance from the center to the beginning point. The axes of the ellipse will extend along the horizontal and vertical coordinate axes; you cannot build a tilted ellipse.
Loops can be named for use in later references, as in: START "Name" ()
The prototype form of The BOUNDARIES section is then: BOUNDARIES REGION 1 <closed loops around the domain> REGION 2 <closed loops around overlays of the second material> You can build your domain a little at a time, using the "domain" menu button to preview a drawing of what you have created so far. The "Save" and "Save_As" menu buttons allow you to frequently save your work, just in case.
A rectangular region, for example, is made up of four line segments: START(x1,y1) LINE TO(x2,y1) TO (x2,y2) TO (x1,y2) TO CLOSE (Of course, any quadrilateral figure can be made with the same structure, merely by changing the coordinates. And any polygonal figure can be constructed by adding more points.)
Arcs can be built in several ways, the simplest of which is by specifying a center and an angle: 17
18
Notice that the circular boundary of region 2 is mapped onto cell legs. There are several controls that the user can apply to change the behavior of the automatic mesh. These are described in detail in the chapter "Controlling Mesh Density" below. As an example, we can cause the circular boundary of region 2 to be gridded more densely by using the modifier MESH_SPACING: REGION 2 'blob' { the embedded 'blob' } START(1/2,0) MESH_SPACING = 0.05 20
[Note: The detailed Rules for constructing domain boundaries is included in the Reference chapter "Sections | Boundaries".] 19
In most cases, it is not necessary to intervene in the mesh generation, because as we will see later, FlexPDE will adaptively refine the mesh wherever it detects that there are strong curvatures in the solution.
First, we define the name of the constant and give it a default value in the definitions section: DEFINITIONS k=1 This default value will be used as the value of "k" in every REGION of the problem, unless specifically redefined in each region. Now we introduce the constant into the equation: EQUATIONS Div(-k*grad(phi)) = 0 Then we specify the regional value in region 2: ... REGION 2 'blob' { the embedded blob } k = 0.001 START(1/2,0) ARC(CENTER=0,0) ANGLE=360
21
22
We could also define the parameter k=1 for the conductor in REGION 1, if it seemed useful for clarity.
23
24
NATURAL(Phi)=0 LINE TO (1,1) { Phi = 1 on top: } VALUE(Phi)=1 LINE TO (-1,1) { normal derivative =0 on left side: } NATURAL(Phi)=0 LINE TO CLOSE Notice that a VALUE or NATURAL statement declares a condition which will apply to the subsequent boundary segments until the declaration is changed. Notice also that the segment shape (Line or Arc) must be restated after a change of boundary condition. [Note: Other boundary condition forms are allowed. See the Reference chapter "Sections | Boundaries".]
Any number of plots may be requested, and the values plotted may be any consistent algebraic combination of variables, coordinates and defined parameters. In our example, we will request a contour of the temperature, a vector map of the heat flux, k*grad(Phi), an elevation of temperature along the center line, and an elevation of the normal heat flux on the surface of the blob: PLOTS CONTOUR(Phi) VECTOR(-k*grad(Phi)) ELEVATION(Phi) FROM (0,-1) to (0,1) ELEVATION(Normal(-k*grad(Phi))) ON 'ring' Output requested in the PLOTS section is produced when FlexPDE has finished the process of solving and regridding, and is satisfied that all cells are within tolerance. An alternative section, identical in form to the PLOTS section but named MONITORS, will produce transitory output at more frequent intervals, as an ongoing report of the progress of the solution. 25 26
A record of all PLOTS is written in a file with suffix .PG5 and the name of the .PDE script file. These recorded plots may be viewed at a later time by invoking the VIEW item in the FlexPDE main menu. MONITORS are not recorded in the .PG5 file. It is strongly recommended that MONITORS be used liberally during script development to determine that the problem has been properly set up and that the solution is proceeding as expected. [Note: FlexPDE accepts other forms of plot command, including GRID plots and HISTORIES. See the Reference chapter "Sections | Monitors and Plots".]
27
28
29
30
31
32
[Note: Three-dimensional integral forms will be addressed in a later section. A full description of integral operators is presented in the Reference section "Elements | Operators | Integral Operators".]
34
35
36
Kins = STAGED(0.01, 0.1, 1, 10) { Notice that the STAGED specification must appear at the initial declaration of a name. In cannot be used in a regional redefinition. } REGION 2 'blob' { the embedded blob } K = Kins START(R,0) ARC(CENTER=0,0) ANGLE=360 HISTORY(Phi) AT (0,-R) When this modified descriptor is run, the history plot produces the following:
In a staged run, all PLOTS and MONITORS requested will be presented for each stage of the run. Other Staging Controls The global selector STAGES can be used to control the number of stages to run. If this selector appears, it overrides any STAGED lists 38
in the DEFINITIONS section (lists shorter than STAGES will report an error). It also defines the global name STAGE, which can be used subsequently in arithmetic expressions. See the Problem Descriptor Reference for details. The default action is to proceed at once from one stage to the next, but you can cause FlexPDE to pause while you examine the plots by placing the command AUTOSTAGE=OFF in the SELECT section of the script.
39
40
END The resulting contour and boundary plot look like this:
We must offset the coordinates, so the left boundary becomes R=0. Since we want the rotation axis in the Y-direction, we must use YCYLINDER coordinates. Since 'R' is now a coordinate name, we must rename the 'R' used for the blob radius.
The full script, converted to cylindrical coordinates is then: TITLE 'Heat flow around an Insulating Torus' COORDINATES YCYLINDER VARIABLES Phi { the temperature } DEFINITIONS K = 1 { default conductivity } Rad = 0.5 { blob radius (renamed)} EQUATIONS Div(-k*grad(phi)) = 0 BOUNDARIES REGION 1 'box' START(0,-1) VALUE(Phi)=0 LINE TO (2,-1) NATURAL(Phi)=0 LINE TO (2,1) VALUE(Phi)=1 LINE TO (0,1) NATURAL(Phi)=0 LINE TO CLOSE REGION 2 'blob' { the embedded blob } k = 0.001 START 'ring' (1,Rad) ARC(CENTER=1,0) ANGLE=360 TO CLOSE PLOTS CONTOUR(Phi) VECTOR(-k*grad(Phi)) ELEVATION(Phi) FROM (1,-1) to (1,1) ELEVATION(Normal(-k*grad(Phi))) ON 'ring' 41 42
Div(k*grad(Phi)) = c*dt(Phi) To make things interesting, we will impose a sinusoidal driving temperature at the top plate, and present a history plot of the temperature at several internal points. The whole script with pertinent modifications now looks like this: TITLE 'Transient Heat flow around an Insulating blob' VARIABLES Phi (threshold=0.01) { the temperature } DEFINITIONS K=1 { default conductivity } C=1 { default heat capacity } R = 1/2 EQUATIONS Div(-K*grad(phi)) + C*dt(Phi) = 0 BOUNDARIES REGION 1 'box' START(-1,-1) VALUE(Phi)=0 LINE TO (1,-1) NATURAL(Phi)=0 LINE TO (1,1) VALUE(Phi)=sin(t) LINE TO (-1,1) NATURAL(Phi)=0 LINE TO CLOSE REGION 2 'blob' { the embedded blob } K = 0.001 C = 0.1 START(R,0) ARC(CENTER=0,0) ANGLE=360 TIME 0 TO 2*pi PLOTS FOR T = pi/2 BY pi/2 TO 2*pi CONTOUR(Phi) VECTOR(-K*grad(Phi)) ELEVATION(Phi) FROM (0,-1) to (0,1) HISTORIES HISTORY(Phi) AT (0,r/2) (0,r) (0,3*r/2) END At the end of the run (t=2*pi), the contour and history look like this:
45
46
i K = 0 t
=0
and/or
+ = 0 n
on the boundary. If we wish to solve for steady oscillatory solutions to this equation, we may assert
( x, y, t ) = ( x, y )exp( t )
i K + = 0 = C
The values of
are known as the eigenvalues and eigenfunctions of the system, respectively. All steady oscillatory solutions to the PDE can be made up of combinations of the various eigenfunctions, together with a particular solution that satisfies any non-homogeneous boundary conditions. Two modifications are necessary to our basic steady-state script for the sample problem to cause FlexPDE to solve the eigenvalue problem. A value must be given to the MODES parameter in the SELECT section. This number determines the number of distinct values of that will be calculated. The values reported will be those with lowest magnitude. 48
47
The equation must be written using the reserved name LAMBDA for the eigenvalue. The equation should be written so that values of LAMBDA are positive, or problems with the ordering during solution will result. The full descriptor for the eigenvalue problem is then: TITLE 'Modal Heat Flow Analysis' SELECT modes=4 VARIABLES Phi { the temperature } DEFINITIONS K = 1 { default conductivity } R = 0.5 { blob radius } EQUATIONS Div(k*grad(Phi)) + LAMBDA*Phi = 0 BOUNDARIES REGION 1 'box' START(-1,-1) VALUE(Phi)=0 LINE TO (1,-1) NATURAL(Phi)=0 LINE TO (1,1) VALUE(Phi)=0 LINE TO (-1,1) NATURAL(Phi)=0 LINE TO CLOSE REGION 2 'blob' { the embedded blob } k = 0.2 { This value makes more interesting pictures } START 'ring' (R,0) ARC(CENTER=0,0) ANGLE=360 TO CLOSE PLOTS CONTOUR(Phi) VECTOR(-k*grad(Phi)) ELEVATION(Phi) FROM (0,-1) to (0,1) ELEVATION(Normal(-k*grad(Phi))) ON 'ring' END The solution presented by FlexPDE will have the following characteristics: The full set of PLOTS will be produced for each of the requested modes. An additional plot page will be produced listing the eigenvalues. The mode number and eigenvalue will be reported on each plot. LAMBDA is available as a defined name for use in arithmetic expressions. 49
50
The appearance of a nonlinear dependence will automatically activate the nonlinear solver, and all the dependency details will be handled by FlexPDE. The modified result appears immediately:
53
54
Nonlinear terms in the equation are just as easy. If our system has a nonlinear sinusoidal source, for example, we may type: EQUATIONS Div(k*grad(phi)) + 0.01*phi*sin(phi) = 0 Click "run", and the solution appears:
55
56
There are several things that can be done to help a nonlinear problem find a solution: Provide as good an initial value as you can, using the INITIAL VALUES section of the script. Ensure that the boundary conditions are consistent. Use STAGES to progress from a linear to a nonlinear system, allowing the linear solution to provide initial conditions for the nonlinear one. Pose the problem as a time-dependent one, with time as an artificial relaxation dimension. Use SELECT CHANGELIM to limit the excursion at each step and force FlexPDE to creep toward a solution. Use MONITORS to display useful aspects of the solution, to help identify troublesome terms. We will return in a later section to the question of intransigent nonlinear problems.
iu = 0
The Divergence Theorem says that the integral of this equation over all space is equal merely to the integral over the bounding surface of the normal component of the flux,
(we have presented the equation in two dimensions, but it is valid in three dimensions as well). The surface value of niu is in fact the "natural boundary condition" for the Laplace (and Poisson) equation. It is the way in which the system inside interacts with the system outside. It is the (negative of the) flux of the quantity u that crosses the system boundary. The Divergence Theorem is a particular manifestation of the more general process of Integration by Parts. You will remember the basic rule,
udv = uv a vdu a a The term uv is evaluated at the ends of the integration interval and
b
gives rise to surface terms. Applied to the integration of a divergence, integration by parts produces the Divergence Theorem. FlexPDE applies integration by parts to all terms of the partial differential equations that contain second-order derivatives of the system variables. 57 58
In the Laplace equation, of course, this means the only term that appears. In order for a solution of the Laplace equation (for example) to be achieved, one must specify at all points of the boundary either the value of the variable (in this case, u ) or the value of niu . In the notation of FlexPDE, VALUE(u)=u1 supplies the former, and NATURAL(u)=F supplies the latter. In other words, The NATURAL boundary condition statement in FlexPDE supplies the value of the surface flux, as that flux is defined by the integration of the PDE by parts. Consistent with our discussion of nonlinear equations, the value given for the surface flux may be a nonlinear value. The radiation loss from a hot body, for example, is proportional to the fourth power of temperature, and the statement NATURAL(u) = -k*u^4 is a perfectly legal boundary condition for the Laplace equation in FlexPDE.
So let us first list some basic terms and their associated natural boundary condition contributions (we present these rules for twodimensional geometry, but the three-dimensional extensions are readily seen). Applied to the term
f (u ) x dxdy =
f (u )dy = f (u) dl
is the x-direction cosine of the surface normal and is Here the differential path length. Since FlexPDE applies integration by parts only to second order terms, this rule is applied only if the contains further derivatives of . Similar rules apply function to derivatives with respect to other coordinates. Applied to the term
2 f (u ) x2 dxdy =
f (u ) dy = x
f (u ) dl x
Since this term is second order, it will always result in a contribution to the natural boundary condition. Applied to the term
Divergence Theorem
Here n is the outward surface normal unit vector. As with the x-derivative case, integration by parts will not be applied
unless the vector Applied to the term Theorem
i F (u)dxdy = F (u)indl
F (u)dxdy = n F (u)dl
Using these formulas, we can examine what the natural boundary condition means in several common cases: 60
The Heat Equation Div(-k*grad(Temp)) + Source = 0 Natural(Temp) = outward surface-normal flux = normal(-k*grad(Temp)) [Notice that we have written the PDE in terms of heat flux with the negative sign imbedded in the equation. If the sign is left out, the sign of the Natural is reversed as well.] One-dimensional heat equation dx(-k*dx(Temp)) + Source = 0 Natural(Temp) = outward surface-normal component of flux = (k*dx(temp)*nx), where nx is the x-direction cosine of the surface normal. Similar forms apply for other coordinates. Magnetic Field Equation curl(curl(A)/mu) = J Natural(A) = tangential component of H = tangential(curl(A)/mu) Convection Equation dx(u)-dy(u)=0 Natural(u) is undefined, because there are no second-order terms. See the section "Hyperbolic systems" for further discussion.
of the jump is proportional to the heat flux or electric current flowing across the resistive film. In microscopic analysis, of course, there is a physical extent to the resistive material. But its dimensions are such as to make true modelling of the thickness inconvenient in a finite element simulation. In the contact resistance case, the heat flux across a resistive interface between materials '1' and '2' as seen from side '1' is given by F1 = -K1*dn(T) = -(T2-T1)/R where F1 is the value of the outward heat flux, K1 is the heat conductivity, dn(T) is the outward normal derivative of T, R is the resistance of the interface film, and T1 and T2 are the two values of the temperature at the interface. As seen from material '2', F2 = -K2*dn(T) = -(T1-T2)/R = -F1 Here the normal has reversed sign, so that the outflow from '2' is the negative of the outflow from '1', imposing energy conservation. The Natural Boundary Condition for the heat equation div(-K*grad(T)) = H is given by the divergence theorem as Natural(T) = -K*dn(T), representing the outward heat flux. This flux can be related to a discontinuous variable by use of the CONTACT boundary condition in place of the NATURAL. The FlexPDE expression JUMP(T) is defined as (T2-T1) in material '1' and (T1-T2) in material '2'. The representation of the contact resistance boundary condition is therefore CONTACT(T) = -JUMP(T)/R This statement means the same thing in both of the materials sharing the interface. [Notice that the sign applied to the JUMP reflects the sign of the divergence term.] We can modify our previous example problem to demonstrate this, by adding a heat source to drive the jump, and cooling the sidewalls. The restated script is: TITLE 'Contact Resistance on a heated blob' VARIABLES 64
Phi { the temperature } DEFINITIONS K = 1 { default conductivity } R = 0.5 { blob radius } H = 0 { internal heat source } Res = 0.5 { contact resistance } EQUATIONS Div(-k*grad(phi)) = H BOUNDARIES REGION 1 'box' START(-1,-1) VALUE(Phi)=0 { cold outer walls } LINE TO (1,-1) TO (1,1) TO (-1,1) TO CLOSE REGION 2 'blob' { the embedded blob } H=1 { heat generation in the blob } START 'ring' (R,0) CONTACT(phi) = -JUMP(phi)/Res ARC(CENTER=0,0) ANGLE=360 TO CLOSE PLOTS CONTOUR(Phi) SURFACE(Phi) mesh VECTOR(-k*grad(Phi)) ELEVATION(Phi) FROM (0,-1) to (0,1) ELEVATION(Normal(-k*grad(Phi))) ON 'ring' END The surface plot generated by running this problem shows the discontinuity in temperature:
5.3.2. Decoupling
Using the Contact Resistance model, one can effectively decouple the values of a given variable in two adjacent regions. In the previous example, if we replace the jump boundary condition with the statement CONTACT(phi) = 0*JUMP(phi) the contact resistance is infinite, and no flux can pass between the regions. [Note: The JUMP statement is recognized as a special form. Even though the apparent value of the right hand side here is zero, it is not removed by the arithmetic expression simplifier.]
65
66
NATURAL(temp) = -JUMP(Phi)^2/Res ARC(CENTER=0,0) ANGLE=360 TO CLOSE PLOTS CONTOUR(Phi) SURFACE(Phi) CONTOUR(temp) SURFACE(temp) END The temperature shows the effect of the surface source:
68
START(R1) POINT VALUE(Phi)=0 LINE TO (R2) POINT VALUE(Phi)=1 { note: no Close! } REGION 2 'blob' { the embedded layer } k = 0.001 START (Ra) LINE TO (Rb) PLOTS ELEVATION(Phi) FROM (R1) to (R2) END
70
A cross-section at any value of Z returns the original 2D figure. A cross-section cut at Y=0 shows the extruded structure:
71
72
73
74
In this case, the layers and surfaces must later be referred to by number. The first surface, z=0, is identified as "SURFACE 1". The second surface, z=1, as "SURFACE 2". Notice that there is no distinction, as far as the layer definition is concerned, between the parts of the layer which are in the cylinder and the parts of the layer which are outside the cylinder. This distinction is made by combining the LAYER concept with the REGION concept of the 2D base plane representation. In a vertical cross-section we can label the parts as follows:
7.3. Layering
Now suppose that we wish to model a canister rather than a full length cylinder. This requires that we break up the material stack above region 2 into three parts, the canister and the continuation of the box material above and below it. We do this by specifying three layers (and four interface surfaces): EXTRUSION SURFACE "Bottom" z=-1/2 LAYER "Underneath" SURFACE "Can Bottom" z=-1/4 LAYER "Can" SURFACE "Can Top" z=1/4 LAYER "Above" SURFACE "Top" z=1/2
Notice that the cylinder can be uniquely identified as the intersection of the 'blob' region of the base plane with the 'Everything' layer of the extrusion.
We have now divided the 3D figure into six logical compartments: three layers above each of two base regions. Each of these compartments can be assigned unique material properties, and if necessary, unique boundary conditions. The cross section now looks like this:
75
76
The comprehensive logical structure of parameter redefinitions in the BOUNDARIES section with the location of parameter redefinition specifications in this grid can be described for the general case as follows: BOUNDARIES REGION 1 params(1,all) 77 78
{ parameter redefinitions for all layers of region 1 } LAYER 1 params(1,1) { parameter redefinitions restricted to layer 1 of region 1 } LAYER 2 params(1,2) { parameter redefinitions restricted to layer 2 of region 1 } LAYER 3 params(1,3) { parameter redefinitions restricted to layer 3 of region 1 } START(,) .... TO CLOSE { trace the perimeter } REGION 2 params(2,all) { parameter redefinitions for all layers of region 2 } LAYER 1 params(2,1) { parameter redefinitions restricted to layer 1 of region 2 } LAYER 2 params(2,2) { parameter redefinitions restricted to layer 2 of region 2 } LAYER 3 params(2,3) { parameter redefinitions restricted to layer 3 of region 2 } START(,) .... TO CLOSE { trace the perimeter } { ... and so forth for all regions }
The example problem "Samples | Misc | 3D_Domains | 3D_Void.pde" demonstrates this usage.
79
80
81
82
83
Since we have specified no boundary conditions on the top and bottom extrusion surfaces, they default to zero flux. This is the standard default, for reasons explained in an earlier section. The first three of the requested PLOTS are:
85
86
The comprehensive logical structure of the BOUNDARIES section with the locations of the boundary condition specifications in 3D can be diagrammed as follows: BOUNDARIES 87
SURFACE 1 s(all, 1) { boundary conditions on surface 1 over full domain } SURFACE 2 s(all, 2) { boundary conditions on surface 2 over full domain } {other surfaces } REGION 1 SURFACE 1 s(1,1) { boundary conditions on surface 1, restricted to region 1 } SURFACE 2 s(1,2) { boundary conditions on surface 2, restricted to region 1 } START(,) { -- begin the perimeter of region m } w(1,..) { boundary conditions on following segments of sidewall of region 1 on all layers } LAYER 1 w(1,1) { boundary conditions on following segments of sidewall of region 1, restricted to layer 1 } LAYER 2 w(1,2) { boundary conditions on following segments of sidewall of region 1, restricted to layer 2 } LINE TO .... { segments of the base plane boundary with above BC's } LAYER 1 w(1,1) { new boundary conditions on following segments of sidewall of region 1, restricted to layer 1 } LINE TO .... { continue the perimeter of region 1 with modified boundary conditions } TO CLOSE REGION 2 SURFACE 1 s(2,1) { boundary conditions on surface 1, restricted to region 2 } SURFACE 2 s(2,2) { boundary conditions on surface 2, restricted to region 2 } START(,) { -- begin the perimeter of region m } w(2,..) { boundary conditions on following segments of sidewall of region 2 on all layers } LAYER 1 w(2,1) { boundary conditions on following segments of sidewall of region 2, restricted to layer 1 } 88
LAYER 2 w(2,2) { boundary conditions on following segments of sidewall of region 2, restricted to layer 2 } LINE TO .... { segments of the base plane boundary with above BC's } LAYER 1 w(2,1) { new boundary conditions on following segments of sidewall of region 2, restricted to layer 1 } LINE TO .... { continue the perimeter of region 2 with modified boundary conditions } TO CLOSE Remember that as in 2D, REGIONS appearing later in the script will overlay and cover up portions of earlier regions in the base plane. So the real extent of REGION 1 is that part of the base plane within the perimeter of REGION 1 which is not contained in any later REGION. For an example of how this works, suppose we want to apply a fixed temperature "Tcan" to the surface of the canister of our previous example. The canister portion of the domain has three surfaces, the bottom, the top, and the sidewall. The layer dividing SURFACES that define the bottom and top of the canister are named 'Can Bottom' and 'Can Top'. The part we want to assign is that part of the surfaces which lies above region 2 of the base plane. We therefore put a boundary condition statement inside of the region 2 definition, together with a SURFACE qualifier. The sidewall of the canister is the extrusion of the bounding line of REGION 2, restricted to that part contained in the layer named 'Can'. So we add a boundary condition to the bounding curve of REGION 2, with a LAYER qualifier. The modified BOUNDARIES section then looks like this: BOUNDARIES REGION 1 'box' START(-1,-1) 89
VALUE(Phi)=0 LINE TO (1,-1) NATURAL(Phi)=0 LINE TO (1,1) VALUE(Phi)=1 LINE TO (-1,1) NATURAL(Phi)=0 LINE TO CLOSE REGION 2 'blob' { the embedded blob } SURFACE 'Can Bottom' VALUE(Phi)=Tcan SURFACE 'Can Top' VALUE(Phi)=Tcan { parameter redefinition in the 'Can' layer only: } LAYER 2 k = 0.001 START 'ring' (R,0) { boundary condition in the 'Can' layer only: } LAYER 'Can' VALUE(Phi)=Tcan ARC(CENTER=0,0) ANGLE=360 TO CLOSE
90
K=1 { default conductivity } R = 0.5 { sphere radius } { shape of hemispherical cap: } Zsphere = sqrt(max(R^2-x^2-y^2,0)) EQUATIONS Div(-k*grad(phi)) = 0 EXTRUSION SURFACE 'Bottom' z=-1 LAYER 'underneath' SURFACE 'Sphere Bottom' z = -max(Zsphere,0) LAYER 'Can' SURFACE 'Sphere Top' z = max(Zsphere,0) LAYER 'above' SURFACE 'Top' z=1 BOUNDARIES REGION 1 'box' START(-1,-1) VALUE(Phi)=0 LINE TO (1,-1) NATURAL(Phi)=0 LINE TO (1,1) VALUE(Phi)=1 LINE TO (-1,1) NATURAL(Phi)=0 LINE TO CLOSE LIMITED REGION 2 'blob' { the embedded blob } LAYER 2 K = 0.001 START 'ring' (RSphere,0) ARC(CENTER=0,0) ANGLE=360 TO CLOSE PLOTS GRID(y,z) on x=0 CONTOUR(Phi) on x=0 VECTOR(-k*grad(Phi)) on x=0 ELEVATION(Phi) FROM (0,-1,0) to (0,1,0) END Cut-away and cross-section images of the LAYER x REGION compartment structure of this layout looks like this:
Layer interface surfaces may merge, but may not invert. Use a MAX or MIN function in the surface definition to block inversion. Using these rules, we can convert the canister of our example into a sphere by placing spherical caps on the cylinder. The equation of a spherical end cap is Z = Zcenter + sqrt( R^2 x^2 y^2) Or, Z = Ztop R + sqrt(R^2 x^2 y^2) To avoid grazing contact of this new sphere with the top and bottom of our former box, we will extend the extrusion from 1 to 1. To avoid arithmetic errors, we will prevent negative arguments of the sqrt. Our modified script now looks like this: TITLE 'Heat flow around an Insulating Sphere' COORDINATES Cartesian3 VARIABLES Phi { the temperature } DEFINITIONS 91
92
Notice that because of the symmetry of the 3D figure, this plot looks like a rotation of the 2D contour plot in "Putting It All Together".
93
94
Result = SURF_INTEGRAL(<integrand>, <surface name>, <region name> [, <layer_name>] ) Computes the integral of the integrand over the named extrusion surface, restricted to the named region. If the optional <layer_name> appears, it will dictate the layer in which the computation is performed. Result = SURF_INTEGRAL(<integrand>, <region name>, <layer name>) Computes the integral of the integrand over all surfaces of the compartment specified by the region and layer names. Evaluation will be made inside the named compartment. Result = SURF_INTEGRAL(<integrand>, <boundary name> [, <region_name>] ) Computes the integral of the integrand over all layers of the sidewall generated by the extrusion of the named base-plane curve. If the optional <region name> argument appears, it controls on which side of the surface the integral is evaluated.Portions of the surface that do not adjoin the named layer will not be computed. Result = SURF_INTEGRAL(<integrand>, <boundary name>, <layer name> [, <region_name>] ) Computes the integral of the integrand over the sidewall generated by the extrusion of the named base-plane curve, restricted to the named layer. If the optional <region name> argument appears, it controls on which side of the surface the integral is evaluated. Portions of the surface that do not adjoin the named layer will not be computed. [Note: The example problem "Samples | Misc | 3D_Integrals.pde" demonstrates several forms of integral in a three-dimensional problem.] Let us modify our Canister problem to contain a heat source, and compare the volume integral of the source with the surface integral of the flux, as checks on the accuracy of the solution: TITLE 'Heat flow from an Insulating Canister' COORDINATES Cartesian3 96
VARIABLES Phi { the temperature } DEFINITIONS K = 1 { default conductivity } R = 0.5 { blob radius } S=0 EQUATIONS Div(-k*grad(phi)) = S EXTRUSION SURFACE 'Bottom' z=-1/2 LAYER 'underneath' SURFACE 'Can Bottom' z=-1/4 LAYER 'Can' SURFACE 'Can Top' z=1/4 LAYER 'above' SURFACE 'Top' z=1/2 BOUNDARIES REGION 1 'box' START(-1,-1) VALUE(Phi)=0 LINE TO (1,-1) NATURAL(Phi)=0 LINE TO (1,1) VALUE(Phi)=1 LINE TO (-1,1) NATURAL(Phi)=0 LINE TO CLOSE REGION 2 'blob' { option: could be LIMITED } LAYER 2 k = 0.001 { the canister only } S=1 { still the canister } START 'ring' (R,0) ARC(CENTER=0,0) ANGLE=360 TO CLOSE PLOTS GRID(y,z) on x=0 CONTOUR(Phi) on x=0 VECTOR(-k*grad(Phi)) on x=0 ELEVATION(Phi) FROM (0,-1,0) to (0,1,0) SUMMARY REPORT(Vol_Integral(S,'blob','can')) AS 'Source Integral' REPORT(Surf_Integral(NORMAL(-k*grad(Phi),'blob','can'))) AS 'Can Heat Loss' REPORT(Surf_Integral(NORMAL(-k*grad(Phi)))) AS 'Box Heat Loss' REPORT(Vol_Integral(S,'blob','can')-Surf_Integral(NORMAL(k*grad(Phi)))) AS 'Energy Error' 97
[Note: The "Integral" reported at the bottom of the contour plot is the default Area_Integral(Phi) reported by the plot procedure.]
98
the plot grid. This computation should give the same result as the SURF_INTEGRAL, which uses a quadrature on the computation mesh. CONTOUR(NORMAL(-K*GRAD(Phi))) ON 'Sphere Top' ON 'Blob' ON 'Can' REPORT(surf_integral(NORMAL(-k*GRAD(Phi)),'Sphere Top','Blob','Can')) AS 'Surface Flux' The result looks like this:
Since in this case the integral is a cancellation of values as large as 7e4, the reported value 9.6e-8 is well within the default error target of ERRLIM=0.001. The plot grid integral, "Surf_Integral", shows greater error at 8.96e-6, due to poorer resolution of integrating the area-weighted function in the plot plane.
100
8. Moving Meshes
FlexPDE supports methods for moving the domain boundaries and computation mesh during the course of a problem run. The mechanisms for specifying this capability are simple extensions of the existing script language. There are three parts to the definition of a moving mesh: Declare a surrogate variable for each coordinate you wish to move: VARIABLES Xm = MOVE(x) Write equations for the surrogate variables: EQUATIONS dt(xm) = umesh Write boundary conditions for the surrogate variables: BOUNDARIES START (0,0) VELOCITY(xm) = umesh The specification of ordinary equations is unaffected by the motion of the boundaries or mesh. EQUATIONS are always presented in Eulerian (Laboratory) form. FlexPDE symbolically applies motion correction terms to the equations. The result of this approach is an Arbitrary Lagrange/Eulerian (ALE) model, in which user has the choice of mesh velocities: Locking the mesh velocity to a fluid velocity results in a Lagrangian model. (FlexPDE has no mechanism for reconnecting twisted meshes, so this model is discouraged in cases of violent motion). Specifying a mesh velocity different from the fluid velocity preserves mesh integrity while still allowing deformation of the bounding surfaces or following bulk motion of a fluid. If no mesh motion is specified, the result is an Eulerian model, which has been the default in previous versions of FlexPDE.
101
102
VALUE(Um) = 0.25*cos(t)*x/r VALUE(Vm) = 0.25*cos(t)*y/r ARC(CENTER=0,0) ANGLE=360 TO CLOSE PLOTS TIME 0 TO 2*pi PLOTS FOR T = pi/2 BY pi/2 TO 2*pi CONTOUR(Phi) VECTOR(-k*grad(Phi)) ELEVATION(Phi) FROM (0,-1) to (0,1) ELEVATION(Normal(-k*grad(Phi))) ON 'ring' END The extremes of motion of this problem are shown below. See Help system or online documentation for an animation.
104
For controlling the cell density along boundary segments, the controls MESH_SPACING and MESH_DENSITY may be used with the syntax of boundary conditions, and may appear wherever a boundary condition statement may appear. In this usage, the controls specify the cell spacing on the boundary curve or surface. The value assigned to MESH_SPACING or MESH_DENSITY controls may be functions of spatial coordinate. In the example of the chapter "Generating a Mesh", we could write: REGION 2 'blob' { the embedded 'blob' } MESH_DENSITY = 50*EXP(-50*(x^2+y^2)) START(1/2,0) ARC(CENTER=0,0) ANGLE=360 This results in the following initial mesh:
See also the example problems "Samples | Misc | Mesh_Control | Mesh_Spacing.pde" and "Samples | Misc | Mesh_Control | Mesh_Density.pde".
Once the initial mesh is constructed, FlexPDE will continue to estimate the solution error, and will refine the mesh as necessary to meet the target accuracy. In time dependent problems, an adaptive refinement process will also be applied to the initial values of the variables, to refine the mesh where the variables undergo rapid change. Whereas cells created by this adaptive refinement process can later be re-merged, cells created by the initial explicit density controls are permanent, and cannot be un-refined. [Note: The adaptive refinement process relies on evaluation of the various sources and derivatives at discrete points within the existing mesh. Sources or other effects which are of extremely small extent, such as thin bands or point-like functions, may not be discernible in this discrete model. Any effects of small extent should be brought to the attention of the gridder by explicitly placing gridding features at these locations. Use REGIONS or FEATURES wherever something interesting is known to take place in the problem. ] See also the FRONT and RESOLVE statements for additional controls.
107
108
In all cases of FORMATTED export, a header will be written containing descriptive information about the origin of the file. This header will be delimited by "{" and "}". In 2D grids, table points which are outside the problem domain will also be bracketed by "{" and "}" and marked as "exterior". If these commenting forms are unacceptable to the importing application, then the data files must be manually edited before import. TABLE Output The TABLE plot command may also be used to generate tabular export. This command is identical to a CONTOUR command with an EXPORT qualifier, except that no graphical output is generated. The FORMAT "string" qualifier may also be used with TABLE output. Transferring Data to another FlexPDE problem FlexPDE supports the capability of direct transfer of data defined on the Finite Element mesh. The TRANSFER output function writes the current mesh structure and the requested data values to an ASCII text file. Another FlexPDE problem can read this file with the TRANSFER input function. The transferred data will be interpolated on the output mesh with the Finite Element basis of the creating problem. The TRANSFER input mesh need not be the same as the computation mesh, as long as it spans the necessary area. The data format of the TRANSFER file is similar to the TECPLOT file described below. The TRANSFER file, however, maintains the quadratic or cubic basis of the computation, while the TECPLOT format is converted to linear basis. Since this is an ASCII text file, it can also be used for data transfer to user-written applications. The format of the TRANSFER file is described in the Problem Descriptor Reference chapter "Transfer File Format" Output to Visualization Software
CDF CDF(arg1 [,arg2,] ) selects output in netCDF version 3 format. CDF stands for "common data format", and is supported by several software products including SlicerDicer (www.visualogic.com ). Information about CDF, including a list of software packages supporting it, can be viewed at the website www.unidata.ucar.edu/packages/netcdf . CDF data are constrained to be on a regular rectangular mesh, but in the case of irregular domains, parts of the rectangle can be absent. This regularity implies some loss of definition of material interfaces, so consider using a ZOOMed domain to resolve small features. The CDF "plot" statement can be qualified by ZOOM or "ON SURFACE" modifiers, and its density can be controlled by the POINTS modifier. For global control of the grid size, use the statement "SELECT CDFGRID=n", which sets all dimensions to n. The default gridsize is 50. Any number of arguments can be given, and all will be exported in the same file. The output file is by default "<problem>_<sequence>.cdf", but specific filenames can be selected with the FILE modifier. TECPLOT TECPLOT(arg1 [,arg2,] ) selects output in TecPlot format. TecPlot is a visualization package which supports finite element data format, and so preserves the material interfaces as defined in FlexPDE. No ZOOM or POINTS control can be imposed. The full computation mesh is exported, grouped by material number. TecPlot can selectively enable or disable these groups. Any number of arguments can be given, and all will be exported in the same file. The output file is by default "<problem>_<sequence>.dat", but specific filenames can be selected with the FILE modifier. Information about TecPlot can be viewed at www.amtec.com . VTK
FlexPDE can export solution data to third-party visualization software. Data export is requested by what is syntactically a PLOT command, with the type of plot (such as CONTOUR) replaced by the format selector. Two formats are currently supported, CDF and TECPLOT. 109
VTK(arg1 [,arg2,] ) selects output in Visual Tool Kit format. VTK is a freely available library of visualization software, which is beginning to be used as the basis of many visualization packages. The file format can also be read by some visualization packages that are not based on VTK, 110
such as VisIt (www.llnl.gov/visit). The format preserves the mesh structure of the finite element method, and so preserves the material interfaces as defined in FlexPDE. No ZOOM or POINTS control can be imposed. The full computation mesh is exported. Particular characteristics of the visualization system are outside the control of FlexPE. Any number of arguments can be given, and all will be exported in the same file. The output file is by default "<problem>_<sequence>.vtk", but specific filenames can be selected with the FILE modifier. The VTK format supports quadratic finite element basis directly, but not cubic. To export from cubic-basis computations, use VTKLIN. VTKLIN(arg1 [,arg2,] ) produces a VTK format file in which the native cells of the FlexPDE computation have been converted to a set of linearbasis finite element cells. Information about VTK can be viewed at public.kitware.com/VTK/. Examples: Samples | Misc | Import-Export | Export.pde Samples | Misc | Import-Export | Export_Format.pde Samples | Misc | Import-Export | Export_History.pde Samples | Misc | Import-Export | Transfer_Out.pde Samples | Misc | Import-Export | Transfer_In.pde Samples | Misc | Import-Export | Table.pde Note: Reference to products from other suppliers does not constitute an endorsement by PDE Solutions Inc.
111
112
Start with a Good Initial Value Providing an initial value which is near the correct solution will aid enormously in finding a solution. Be particularly careful that the initial value matches the boundary conditions. If it does not, serious excursions may be excited in the trial solution, leading to solution difficulties. Use STAGES to Gradually Activate the Nonlinear Terms You can use the staging facility of FlexPDE to gradually increase the strength of the nonlinear terms. Start with a nearly linear system, and allow FlexPDE to find a solution which is consistent with the boundary conditions. Then use this solution as a starting point for a more strongly nonlinear system. By judicious use of staging, you can creep up on a solution to very nasty problems. Use artificial diffusion to stabilize solutions Gibbs phenomena are observed in signal processing when a discontinuous signal is reconstructed from its Fourier components. The charactistics of this phenomenon is ringing, with overshoots and undershoots in the recovered signal. Similar phenomena can be observed in finite element models when a sharp transition is modeled with an insufficient density of mesh cells. In signal processing, the signal can be smoothed by use of a "window function". This is essentially a low-pass filter that removes the high frequency components of the signal. In partial differential equations, the diffusion operator Div(grad(u)) is a low-pass filter that can be used to smooth oscillations in the solution. See the Technical Note "Smoothing Operators in PDE's" for technical discussion of this operator. In brief, you can use a term eps*Div(Grad(u)) in a PDE to smooth oscillations of spatial extent D by setting eps=D^2/pi^2 in steady state or eps=2*D*c/pi in time dependence (where c is the signal propagation velocity). The term should also be scaled as necessary to provide dimensional consistency with the rest of the terms of the equation. Use of such a term merely limits the spatial frequency components of the solution to those which can be adequately resolved by the finite element mesh. Use CHANGELIM to Control Modifications The selector CHANGELIM limits the amount by which any nodal value in a problem may be modified on each Newton-Raphson step. As in a onedimensional Newton iteration, if the trial solution is near a local maximum of the functional, then shooting down the gradient will try to step an enormous distance to the next trial solution. FlexPDE limits the size of 113
each nodal change to be less than CHANGELIM times the average value of the variable. The default value for CHANGELIM is 0.5, but if the initial value (or any intermediate trial solution) is sufficiently far from the true solution, this value may allow wild excursions from which FlexPDE is unable to recover. Try cutting CHANGELIM to 0.1, or in severe cases even 0.01, to force FlexPDE to creep toward a valid solution. In combination with a reasonable initial value, even CHANGELIM=0.01 can converge in a surprisingly short time. Since CHANGELIM multiplies the RMS average value, not each local value, its effect disappears when a solution is reached, and quadratic final convergence is still achieved. Watch Out for Negative Values FlexPDE uses piecewise polynomials to approximate the solution. In cases of rapid variation of the solution over a single cell, you will almost certainly see severe under-shoot in early stages. If you are assuming that the value of your variable will remain positive, don't. If your equations lose validity in the presence of negative values, perhaps you should recast the equations in terms of the logarithm of the variable. In this case, even though the logarithm may go negative, the implied value of your actual variable will remain positive. Recast the Problem in a Time-Dependent Form Any steady-state problem can be viewed as the infinite-time limit of a time-dependent problem. Rewrite your PDE's to have a time derivative term which will push the value in the direction of decreasing deviation from solution of the steady-state PDE. (A good model to follow is the time-dependent diffusion equation DIV(K*GRAD(U)) = DT(U). A negative value of the divergence indicates a local maximum in the solution, and results in driving the value downward.) In this case, "time" is a fictitious variable analogous to the "iteration count" in the steadystate N-R iteration, but the time-dependent formulation allows the timestep controller to guide the evolution of the solution.
114
Index
Accuracy.................................31 Application................................7 ARC........................................17 AREA_INTEGRAL .................33 BINTEGRAL ...........................33 BOUNDARIES................... 8, 17 boundary conditions ...............10 Boundary conditions...............24 Boundary Conditions in 3D ....87 case sensitivity .......................15 CDF ..................................... 108 CHANGELIM ..........................56 Contact Resistance ................63 CONTOUR .............................26 Curl Theorem .........................59 Decoupling Variables .............66 DEFINITIONS.................... 8, 22 Differentiation .........................15 Discontinuous Variables.........63 Divergence Theorem..............59 Domain Description................17 Eigenvalue Summary .............51 ELEVATION ...........................26 EQUATIONS ..................... 8, 16 ERRLIM..................................31 error tolerance ........................31 EXPORT.............................. 108 Extrusion ................................72 EXTRUSION ..........................74 Extrusion Notation..................74 finite element mesh ................20 Flux Boundary Condition........61 FORMAT ............................. 108 guidelines ...............................13 Heat Equation ........................59 Inconsistent Initial Conditions.47 Initial Conditions.....................47 initial value..............................56 INITIAL VALUES....................56 INITIALVALUES .......................8 Instantaneous Switching ........47 116 INTEGRAL .............................33 Integrals ...........................33, 40 Integrals in Three Dimensions95 integration by parts ................59 JUMP ...............................63, 67 LAYER ...................................74 Layer Interfaces .....................91 Layering .................................76 LINE .......................................17 LINE_INTEGRAL ...................33 Magnetic Field........................59 material parameters ...............22 Material Properties.................78 mesh ......................................20 Mesh Density .......................105 MONITORS............................26 NATURAL ..............................10 Natural boundary condition ....59 NATURAL boundary condition ............................................24 Newton-Raphson iteration .....56 nonlinear problems ................56 Nonlinear Problems .............112 Notation..................................15 ON..........................................99 ON LAYER .............................99 ON REGION...........................99 ON SURFACE........................99 Parameter Studies .................37 parameters .............................22 PLOTS ...............................8, 26 plots on cut planes .................99 problem setup ........................11 Problem Setup Guidelines .....13 problem solving environment ...2 questions..............................115 REGION .................................17 REPORT ................................35 script editing module ................5 scripting language....................2 SELECT ...................................8
115
Shaped Layer Interfaces ........91 STAGED.................................37 STAGES.................................37 START....................................17 SUMMARY ...................... 36, 51 SURFACE ....................... 26, 74 surface integrals.....................95 symbolic equation analyzer......5 TABLE Output ..................... 108 TECPLOT............................ 108 TITLE........................................8
Transferring Data .................108 VALUE ...................................10 VALUE (or Dirichlet) boundary condition .............................24 VARIABLES .......................8, 16 VECTOR ................................26 VisIt ......................................108 Void Compartments ...............80 VOL_INTEGRAL....................33 volume integrals.....................95 VTK ......................................108
117