(2006) Simulacion de Sistemas Mecatronicos

download (2006) Simulacion de Sistemas Mecatronicos

of 123

Transcript of (2006) Simulacion de Sistemas Mecatronicos

  • 7/27/2019 (2006) Simulacion de Sistemas Mecatronicos

    1/123

    Simulation ofMechatronic SystemsSmSy Lecture Notes

    SmSy Lecture NotesWinter Semester 2006

    Dr. Beat RuhstallerDr. Jrgen Schumacher

    Center for Computational PhysicsZurich University of Applied Sciences8401 WinterthurSwitzerlandhttp://www.ccp.zhwin.ch

  • 7/27/2019 (2006) Simulacion de Sistemas Mecatronicos

    2/123

    The contents of these notes were compiled either from newly written sections

    or from manuscripts of previously held lectures. Some sections originate from theSESES tutorial document1. Contributions from the following authors are includedin the enclosed lecture notes:

    Roman GmrDr. Thomas HockerDr. Paul LedgerDr. Beat RuhstallerDr. Guido SartorisDr. Jrgen Schumacher

    Dr. Hansueli SchwarzenbachThe copyright of these lecture notes is with the authors at the Center for Com-

    putational Physics (www.ccp.zhwin.ch). Theses lecture notes cover the topics dis-cussed in the lecture on Simulation of Mechatronic Systems held in the Wintersemester 2006 at the Zurich University of Applied Sciences, Switzerland.

    1http://www.ccp.zhwin.ch/seses/version/Tutorial.pdf

  • 7/27/2019 (2006) Simulacion de Sistemas Mecatronicos

    3/123

    Contents

    Introduction 7

    1 Guidelines to CAE 91.1 Computer Simulations in Product Development. . . . . . . . . . . 9

    1.1.1 Physical Understanding. . . . . . . . . . . . . . . . . . . . 91.1.2 Modeling . . . . . . . . . . . . . . . . . . . . . . . . . . . 91.1.3 Mathematical Methods . . . . . . . . . . . . . . . . . . . . 91.1.4 Computer Simulation. . . . . . . . . . . . . . . . . . . . . 10

    1.2 Physical Basics . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101.2.1 Transport Processes . . . . . . . . . . . . . . . . . . . . . 10

    1.2.2 Conversion Processes . . . . . . . . . . . . . . . . . . . . 101.2.3 Methodology . . . . . . . . . . . . . . . . . . . . . . . . . 101.2.4 Simulation Software . . . . . . . . . . . . . . . . . . . . . 11

    1.3 Modeling Basics . . . . . . . . . . . . . . . . . . . . . . . . . . . 111.3.1 Dimensional Analysis. . . . . . . . . . . . . . . . . . . . . 111.3.2 Integral Balances . . . . . . . . . . . . . . . . . . . . . . . 121.3.3 Local Balances . . . . . . . . . . . . . . . . . . . . . . . . 12

    1.4 Modeling Guidelines. . . . . . . . . . . . . . . . . . . . . . . . . 131.5 Simulation Guidelines . . . . . . . . . . . . . . . . . . . . . . . . 131.6 Project Management / Communication Guidelines. . . . . . . . . . 14

    2 Balance Laws and Transport Processes 172.1 Governing Equations. . . . . . . . . . . . . . . . . . . . . . . . . 18

    2.1.1 Continuum hypothesis . . . . . . . . . . . . . . . . . . . . 182.1.2 Balance Laws. . . . . . . . . . . . . . . . . . . . . . . . . 192.1.3 Material Laws. . . . . . . . . . . . . . . . . . . . . . . . . 222.1.4 Boundary Conditions. . . . . . . . . . . . . . . . . . . . . 23

    2.2 Example: Heat- and charge transport in an integrated circuit. . . . 25

    3

  • 7/27/2019 (2006) Simulacion de Sistemas Mecatronicos

    4/123

    CCP Center for Computational Physics SmSy

    3 Numerical Solution of Ordinary Differential Equations using Finite El-

    ements 293.1 Introduction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293.2 Model problem . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293.3 Derivation of the Finite Element Method for the model problem. . . 30

    3.3.1 Method of Weighted Residuals. . . . . . . . . . . . . . . . 303.3.2 Choice of shape functions . . . . . . . . . . . . . . . . . . 313.3.3 A rst worked example. . . . . . . . . . . . . . . . . . . . 33

    3.4 Boundary condition types . . . . . . . . . . . . . . . . . . . . . . 343.4.1 Finite elements with Neumann boundary conditions. . . . . 353.4.2 A second worked example . . . . . . . . . . . . . . . . . . 35

    3.5 Element mappings . . . . . . . . . . . . . . . . . . . . . . . . . . 363.5.1 Linear shape functions . . . . . . . . . . . . . . . . . . . . 373.5.2 Quadratic shape functions . . . . . . . . . . . . . . . . . . 383.5.3 A third worked example. . . . . . . . . . . . . . . . . . . . 38

    4 Heat Conduction in a Cylindrical Stick 414.1 Analytical model in 1D. . . . . . . . . . . . . . . . . . . . . . . . 424.2 Building a 2DSESES model for the heated stick . . . . . . . . . . 424.3 3DSESES Model for the heated stick. . . . . . . . . . . . . . . . 45

    5 Calorimetric Flow Sensor 49

    5.0.1 Building a Flow Sensor Model inSESES . . . . . . . . . . 515.0.2 Constant Heating Power Mode. . . . . . . . . . . . . . . . 52

    5.1 Constant Sensor Temperature Mode. . . . . . . . . . . . . . . . . 535.2 Dynamic Response. . . . . . . . . . . . . . . . . . . . . . . . . . 55

    6 Electrostatically Driven Comb Actuator 596.1 Introduction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 596.2 Theoretical background . . . . . . . . . . . . . . . . . . . . . . . 59

    6.2.1 Parallel-plate capacitor: Useful formulas. . . . . . . . . . . 596.2.2 Comb actuator . . . . . . . . . . . . . . . . . . . . . . . . 626.2.3 Numerical simulation. . . . . . . . . . . . . . . . . . . . . 65

    6.3 Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 676.3.1 Theoretical Understanding . . . . . . . . . . . . . . . . . . 676.3.2 FEM Calculations. . . . . . . . . . . . . . . . . . . . . . . 686.3.3 Practical hints. . . . . . . . . . . . . . . . . . . . . . . . . 68

    7 Modelling of a Micro-Reed Switch 717.1 Introduction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 717.2 Switching characteristics. . . . . . . . . . . . . . . . . . . . . . . 717.3 Basics of magnetostatics . . . . . . . . . . . . . . . . . . . . . . . 73

    ZHW, Smsy, WS06/07 4

  • 7/27/2019 (2006) Simulacion de Sistemas Mecatronicos

    5/123

  • 7/27/2019 (2006) Simulacion de Sistemas Mecatronicos

    6/123

    CCP Center for Computational Physics SmSy

    A.2.10 Physical Interpretation of Curl. . . . . . . . . . . . . . . . 121A.2.11 Divergence Theorem . . . . . . . . . . . . . . . . . . . . . 121

    ZHW, Smsy, WS06/07 6

  • 7/27/2019 (2006) Simulacion de Sistemas Mecatronicos

    7/123

    Introduction

    Computer Aided Engineering (CAE) concerns the application of physical-mathemati-cal models to real-world engineering problems. In particular, CAE-methods play akey role in the industrial product development process and help to

    Speed-up the development cycle of products.

    Optimize the product performance.

    Develop a thorough understanding of the underlying physical-chemical processes

    Visualize device functionality not accessible through experiments.

    Support the decision making process at different product development stages.

    Eliminate potential failures and identify pitfalls.

    The past decade has been a period of rapid progress for CAE. The elds of ap-plication have been expanded and computational methods have become increas-ingly sophisticated. The Center for Computational Physics (CCP) a team ofphysicists, mathematicians and engineers, located at the Zurich University of Ap-plied Sciences in Winterthur (ZHW) unites 15 years of experience in the develop-ment and application of computer simulations. For simulating coupled physical andchemical processes, we use our in-house multiphysics nite element (FE) codeNM SESES (see http://ccp.zhwin.ch/seses/ for details). Our expertise in modeling and

    simulation includes the following areas Micro-Opto-Electro-Mechanical systems (MOEMS).

    Magnetic eld and eddy current simulations.

    Piezoelectric actuators and sensors.

    Electrochemical processes (fuel cells, batteries).

    Microuidics (microreactors, membranes, ow sensors).

    7

  • 7/27/2019 (2006) Simulacion de Sistemas Mecatronicos

    8/123

    CCP Center for Computational Physics SmSy

    Thermal transport by convection, conduction and radiation.

    Optical systems (OLEDs, solid state lasers, waveguides).

    Semiconductor devices.

    In general, an engineering problem to be analyzed with CAE tools is modeled byidentifying relevant physical effects together with a hierarchical structure. Oftena problem can be described by a network model on a high level of abstraction.When it comes to understanding the physical origin of properties of system com-ponents, however, numerical techniques like nite element methods are needed.In this course, the theoretical background is provided for approaching engineering

    problems by means of system, network and numerical modeling. Emphasis is puton the ability to quickly form a solution path while references to in-depth literatureare also given. This document is addressed to engineering students majoring inComputer Aided Engineering and is a prerequisite for efcient problem solving inpractice. The contents have been developed at the Zurich University of AppliedSciences Winterthur.

    ZHW, Smsy, WS06/07 8

  • 7/27/2019 (2006) Simulacion de Sistemas Mecatronicos

    9/123

    Chapter 1

    Guidelines to CAE

    1.1 Computer Simulations in Product Development

    Computational engineering, i. e., enhanced of product development by computa-tional methods, requires experience and a variety of different skills. The followinglist contains ingredients that are essential to it.

    1.1.1 Physical Understanding

    By what types of transport does the heat or particle transfer occur ?

    Does one transport mechanism dominate over the others ?

    1.1.2 Modeling

    What are the correct governing equations for a specic process or phenomena ?

    How to dene an appropriate domain for balancing the conservation properties ?

    Wow to dene appropriate boundary conditions between the model domain andits environment ?

    Are there analogies to the considered processes and phenomena in other tech-nical elds ?

    1.1.3 Mathematical Methods

    Formulation of the governing equations in mathematical form.

    9

  • 7/27/2019 (2006) Simulacion de Sistemas Mecatronicos

    10/123

    CCP Center for Computational Physics SmSy

    For simplied cases, are there analytical solutions to the governing equations forvalidation purposes ?

    1.1.4 Computer Simulation

    Which tools are best suited for specic simulation task ?

    What numerical methods should be used in order to obtain reliable solutions ?

    1.2 Physical Basics

    Above all, a sound physical understanding of the underlying physical and chemicalphenomena and processes must be developed. Next, the physical picture needsto be cast into a mathematical form that allows for the solution of the relevant statevariables.

    1.2.1 Transport Processes

    Transport of conservation properties: mass, momentum, energy, electrical charge,etc.

    Rhere are often generic expressions for balance and constitutive equations (in-dependent of the technical eld).

    1.2.2 Conversion Processes

    Electro- and bio-chemical reactions.

    Conversion of electrical power or kinetic energy into heat.

    Semiconductor generation and recombination effects.

    1.2.3 Methodology

    Balance equations for conservation properties.

    Constitutive equations to connectuxes with potential changes asdriving forces .

    Boundary conditions to specify the interactions between the model and its envi-ronment.

    ZHW, Smsy, WS06/07 10

  • 7/27/2019 (2006) Simulacion de Sistemas Mecatronicos

    11/123

    CCP Center for Computational Physics SmSy

    1.2.4 Simulation Software

    Multipurpose mathematics programs : Matlab[8], Maple[6], Mathematica [7].

    Network simulators : PSpice [13], Simulink [9].

    FE-Tools : SESES [12], ANSYS [2], FEMLab[4].

    CFD-Tools : CFX [3], Fluent [5], StarCD [14], CFD-ACE+ [1].

    Scripting languages : Perl [10], Python [11].

    1.3 Modeling Basics

    There are generally a variety of modeling strategies that can be applied to a spe-cic problem. As trivial as it is, one should always start with the simplest modelthat one can think of and add further complexity thereafter. Often, valuable insightis gained by comparing models with different levels of abstraction to each other.

    1.3.1 Dimensional Analysis

    Advantages

    Estimation of characteristic times and lengths without the requirement to solvedifferential equations.

    Reduction of the number of parameters through formation of dimensionlessgroups.

    Estimations are possible for systems that would otherwise be too complex to bestudied.

    Allows extrapolation of experimental data.Disadvantages

    Often only rough estimates are possible.

    Does not provide a detailed understanding of the underlying processes and phe-nomena.

    Unsuitable for optimization tasks where geometric details are important.

    ZHW, Smsy, WS06/07 11

  • 7/27/2019 (2006) Simulacion de Sistemas Mecatronicos

    12/123

    CCP Center for Computational Physics SmSy

    1.3.2 Integral Balances

    Advantages

    Often provides more than dimension analysis.

    Often, simple numerical or analytical solutions for transport equations are avail-able.

    Allows to study fundamental issues likedoes it work in principle or not .

    Disadvantages

    Only provides limited understanding of the underlying processes and phenom-ena.

    Unsuitable for optimization tasks where geometric details are important.

    1.3.3 Local Balances

    Advantages

    Very accurate, provided that the models provide a reasonable description ofreality.

    Allows for a detailed understanding of the underlying processes and phenom-ena.

    Ideal for optimization tasks where coupled phenomena take place and wheregeometric details are important.

    Disadvantages

    Calculations can be very lengthy (often large requirements in CPU power andRAM).

    Simulation codes are often difcult to learn and require experience.

    There is a general riskto be drowned by the huge amounts of data generated.

    ZHW, Smsy, WS06/07 12

  • 7/27/2019 (2006) Simulacion de Sistemas Mecatronicos

    13/123

    CCP Center for Computational Physics SmSy

    1.4 Modeling Guidelines

    When setting-up the model keep in mind the main goals as well as the timeconstraints of the project. The model should give answers to questions that needto be answered in order to reach the project goals. Always try to understand theresults obtained. How do they compare with your expectations ?

    Identify all physical parameters that might be important. Classify the identiedparameters according to their expected relevance.

    Start with the simplest model that describes the basic aspects of the consid-ered problem. Build more detailed models upon the basic one. Compare themto each other in order to improve your understanding of the impact of variousphysical-chemical phenomena and other model features.

    Choosing an appropriate modeling domain is essential. The domain has to bechosen such that meaningful boundary conditions can be applied to discriminatethe model from its surroundings.

    Perform a sensitivity analysis of physical parameters as well as the types ofboundary conditions to see how they inuence the results.

    Analytical models: whenever possible do back-of-the-envelope calculations to

    get a rough idea of the results to expect. Apply more advanced analytical modelsand check that the numerical results are within allowable limits.

    Symmetries: whenever possible exploit symmetries in the eld variables to sim-plify the model, preferentially from 3D to 2D.

    Volume averaging: whenever possible, try to incorporate geometric details intoeffective transport parameters using volume averaging methods.

    1.5 Simulation Guidelines

    When dening physical models in a simulation program be aware of the com-plete set of model parameters that have to be adjusted. For example, whensolving steady-state heat conduction problems, only the thermal conductivity isrequired. However, when transient heat conduction problems are solved, thedensity and the heat capacity also needs to be prescribed.

    Write all material properties and all important model parameters to a propertiesle. This helps when reconsidering older simulations as well as to track downincorrect parameter settings.

    ZHW, Smsy, WS06/07 13

  • 7/27/2019 (2006) Simulacion de Sistemas Mecatronicos

    14/123

    CCP Center for Computational Physics SmSy

    Always do consistency checks, for example through evaluation of mass and en-ergy balances.

    To increase efciency run over night batch jobs.

    Think about strategies to track down errors efciently.

    Make a list of issues related to the interface, the syntax, and the results whichwere not understood and discuss them with others.

    Convergence criteria: check how your results alter when the convergence crite-ria is changed.

    Initialization conditions: check if the results depend on the initialization con-ditions applied. This is a common problem whenever non-linear phenomena(chemical reactions, thermal radiation, etc.) are present.

    Mesh-size: check if the results depend on the mesh-size.

    Temperature-dependent material parameters: check if temperature-dependentmaterial parameters are used within valid temperature ranges.

    For large models that require constant modications use a version control sys-tem such as CVS that keeps track of the changes made. This allows one toeasily get back to previous model versions.

    1.6 Project Management / Communication Guidelines

    Pursue a goal-oriented approach: in the end, it is not just the developed modelcounts, but also the goals reached to achieve it. Identify the goals to be reachedand the main problems to be solved. Develop strategies of how to approachthem and discuss them with other project members. Make a list of questions that

    need to be answered in order to reach the project goals. Ask yourself from timeto time what is the current status of your work. Are youon time ? In case youhave unforeseen difculties with your work, talk to other project members. Takeresponsibilities within the project. A fair distribution of responsibilities among theproject members makes the project more fun for everybody.

    Meeting protocols: its very important to keep track of the issues discussed andthe tasks assigned.

    To-do-lists: helps to keep track of main goals as well as of details.

    ZHW, Smsy, WS06/07 14

  • 7/27/2019 (2006) Simulacion de Sistemas Mecatronicos

    15/123

    CCP Center for Computational Physics SmSy

    Reports and presentations: helps yourself and others to see the current statusof your work.

    Make clear to other project members the differences between the model youhave developed and the real world. Point out the capabilities as well as thelimitations of the model.

    Data representation: extract the key results from the simulations in a way so thatthey can be understood by yourself and others. Try to condense your ndingsinto a small number of tables and graphs.

    Getting stuck: get feedback from others whenever you get stuck.

    Transparency and openness: make your work transparent to other project mem-bers.

    Communication: think about how to best communicate your ndings to others.

    References

    [1] ACE-CFD+ CFD-Software : http://www.cfdrc.com/

    [2] ANSYS FE-Software : http://www.ansys.com/

    [3] CFX CFD-Software : http://www-waterloo.ansys.com/cfx/

    [4] FEMLab FE-Software : http://www.femlab.com/

    [5] Fluent CFD-Software : http://www.uent.com/

    [6] Maple : http://www.maplesoft.com/

    [7] Mathematica : http://www.wolfram.com/

    [8] Matlab : http://www.mathworks.com/

    [9] Simulink : http://www.mathworks.com/ [10] Perl scripting language : http://www.perl.org/

    [11] Python scripting language : http://www.python.com/

    [12] NM-SESES FE-Software : http://ccp.zhwin.ch/seses/

    [13] PSpice network simulator : http://www.orcad.com/

    [14] StarCD CFD-Software : http://www.cd-adapco.com/

    ZHW, Smsy, WS06/07 15

  • 7/27/2019 (2006) Simulacion de Sistemas Mecatronicos

    16/123

    CCP Center for Computational Physics SmSy

    ZHW, Smsy, WS06/07 16

  • 7/27/2019 (2006) Simulacion de Sistemas Mecatronicos

    17/123

    Chapter 2

    Balance Laws and Transport

    Processes

    The design of a numerical model is a creative and often challenging task. For prac-tical applications, simple recipes usually do not exist. Rather, it is the combinationof physical insight, a sound basis in mathematics and last but not least comprehen-sive modeling experience that leads to thecorrect model and strategies for modelvalidation, respectively. One should always keep in mind that a nice graphical out-put is never proof of correct and useful results. This is especially true nowadays,where a number of easy to use, commercially available simulation packages makeit easy to produce nice pictures. In this section we are going to

    Explain fundamental concepts to model transport processes.

    Show how to put these concepts into mathematical language together with someexamples.

    A transport model is complete when thegoverning equations have been specied.The governing equations consist of the following parts.

    Conservation Laws : Exist forcountable quantities such as mass m, numberof molecules N , electrical charge Q, momentum I and energy E . Conserva-

    tion laws are universal, i.e. they are independent of the materials consideredand they always need to be satised. As an example, the conservation laws inuid mechanics are the mass and momentum balances, of which former is alsoknown as the continuity equation. In thermodynamics, the energy and entropybalances additionally come into play. These balance equations are also knownas the rst and second laws of thermodynamics.

    Material Laws : Balance equations by themselves are insufcient for a com-plete problem description, i. e. they usually contain more unknowns than avail-able equations. Furthermore, they often contain unknowns such a ux-quantities

    17

  • 7/27/2019 (2006) Simulacion de Sistemas Mecatronicos

    18/123

    CCP Center for Computational Physics SmSy

    that cannot be directly measured. However, it turns out that further relationshipsexist between these unknowns, i. e., they are not independent of each other.These relationships are calledmaterial laws or constitutive equations . As thename suggests, they do not hold universally, but only for particular materials ormaterial classes, such as the class of ideal gases or the class of incompressibleuids.

    Boundary Conditions : Are required tocut-off a model, i.e. to separate themodeling domain from its surroundings. The number of boundary conditionsrequired is determined by the degree (highest derivative) of the governing equa-tions involved. Often, the solution strongly depends on the chosen boundary

    conditions and an improper choice may render the results useless, irrespectiveof the numerical accuracy. Using the wrong boundary conditions means that themodel is incorrect or its connection to the exterior world is not correctly specied.

    Combining these ingredients together, we obtain a coupled system of governingequations belonging, almost exclusively, to the class ofPartial Differential Equa-tions or PDE. In light of the specic geometries and boundary conditions that ap-pear in realistic problems and the complexity of material laws, it is no surprise thatanalytical solutions to these problems can rarely be found. This in turn, motivatesthe use of numerical tools.

    2.1 Governing Equations

    2.1.1 Continuum hypothesis

    The eld equations used for the description of transport processes depend on theso-called continuum hypothesis . In continuum theory, physical effects on the scaleof single or few molecules are neglected. Instead, eld quantities that obey thecontinuum approximation are assumed to be averaged over a very small, but nitevolumeV cont

    = 1V cont V cont dV , V

    1/ 3cont lc , (2.1)

    where is a molecular dimension of the order 1 = 10 10 m and lc is a char- acteristic length of the considered system of the orderlc > 1 m. The followingconsequences arise from the continuum hypothesis

    Distinction betweenconvective (macroscopic) andconductive (molecular) trans-port processes.

    ZHW, Smsy, WS06/07 18

  • 7/27/2019 (2006) Simulacion de Sistemas Mecatronicos

    19/123

    CCP Center for Computational Physics SmSy

    Necessity forboundary conditions to discriminate the modeling domain from itssurroundings.

    2.1.2 Balance Laws

    For the theoretical description of a dynamical system, as a rst step, one has toask oneself about the relevant physical-chemical phenomena taking place. Thesephenomena usually involve transport processes of quantities for which conserva-tion principles do apply. The following list gives a number of physical quantities tobe conserved.

    Mass m = dV . Momentum I = vdV . Energy E = (u +

    12 v

    2) dV , Helmholtz, Joule, Mayer 1845.

    Consider an arbitrary conservation quantity = {m, I , E ,...}. For a nite andstationary arbitrary control volume with boundary , the conservation principlecan be stated as follows

    Accumulation of within = convective ux J conv of over

    + conductive ux J cond of over

    + production and/or loss of within

    We now aim at putting the above statement into mathematical terms. Let be thedensity related to through the relation

    =

    dV . (2.2)

    The accumulation of then follows as

    ddt

    = t dV . (2.3)As illustrated in Fig.2.1, the differential volumetric uxdV through the differentialsurface element d A is given by

    dV = d A v n = v d n . (2.4)

    ZHW, Smsy, WS06/07 19

  • 7/27/2019 (2006) Simulacion de Sistemas Mecatronicos

    20/123

    CCP Center for Computational Physics SmSy

    Figure 2.1: Differential volumetricux dV through the differential sur-face element d A characterized byits normal vector n. The differen-tial volume is given bydV = d Adl =d Adt v n, where v denotes the uidvelocity throughd A. Hence, dV =d A v n.

    Consequently, the convective ux of over follows as

    J conv =

    v d n . (2.5)

    Similarly, the conductive ux of over can be expressed as

    J cond =

    jcond d n, (2.6)

    with jcond denoting the local conductive ux-vector. By dening the productiondensity related to by

    = dV , (2.7)the integral formulation of the conservation law follows through combination of(2.3)

    t dV =

    v + jcond d n + dV . (2.8)To obtain a differential formulation of (2.8), we rst need to convert the surface intoa volume integral by use of the divergence theorem of Gauss

    k d n =

    k dV . (2.9)

    This form states that for a system at steady state, the total ux of k over the sur-face of the control volume is equal to the sum of all productions and losses within . These productions and losses are causing a local, spatial variation of k , rep-resented by its divergence k . With (2.9) and since the control volume isarbitrary, Eq. (2.8) is equivalent to thedifferential formulation

    t

    = ( v + jcond ) + . (2.10)

    ZHW, Smsy, WS06/07 20

  • 7/27/2019 (2006) Simulacion de Sistemas Mecatronicos

    21/123

    CCP Center for Computational Physics SmSy

    Both formulations (2.8) and (2.10) are quite general in that they describe time-dependent, molecular as well as convective transport processes in the presenceof different types of sources and sinks. In the case of stationarity, i. e. time-independent processes, the time-derivative / t in (2.8) and (2.10) vanishes. Forsystems at rest, we have v = 0 and (2.8), (2.10) simplify to

    jcond d n = dV , (2.11)or equivalently

    jcond = . (2.12)As shown in the following examples, a large class of physical phenomena can beunderstood in terms of the above balance equations for some conserved ux jcond .

    B 1: Charge balance with jcond = D the dielectric displacement and = q thecharge density.

    B 2: Thermal energy balance with jcond = jth the molecular heat energy ux and = q the heat source density.

    B 3: Force balance in a solid body with jcond = s the stress tensor and = f the body force. Note that the ux eld jcond is here a tensor and the source a vector so that(2.11) and (2.12) become vector equations.

    B 4: Current balance with jcond = jel the electric current and a zero source den-sity = 0.

    B 5: A particular case ofB 4 for currents with positive and negative charges.We then have two current balances jcond = jel , jel for negative and posi-tive charges and the recombinationR as source = R, R with the totalcurrent jel = jel + jel being divergence free, i.e. jel = 0.

    B 6: Diffusive ux, where each species has its own balance equation with jcond = j the species molecular mass ow and = the production ratefor the species with = 0 and j = 0.

    The mechanical case for the stress s deserves special attention since appliedforces deform the body and force balance must be expressed as

    ()

    s d n = ()

    f d , (2.13)

    with = x+ u the mechanical deformation, u the displacement at the point x and the domain of the initial conguration at rest. In the kinematic linear theory, weassume small displacement u 1 so that we have () thus tting into thegeneral form of balance equations.

    ZHW, Smsy, WS06/07 21

  • 7/27/2019 (2006) Simulacion de Sistemas Mecatronicos

    22/123

    CCP Center for Computational Physics SmSy

    2.1.3 Material Laws

    There are two types of commonly encountered material laws, those that representinterrelations between state variables and those that relate uxes to the gradientsof associate elds.

    State Variables and Equations of State : A state variable characterizes asits name suggests the thermodynamic state of a system. Examples for thermody-namic state variables are: temperatureT , pressure p, density , specic internalenergy u and specic enthalpyh = u + p/ .1 The thermal equation of state is anexample of a material law that represents a relation betweenT , p and

    f (T , p, ) = 0 . (2.14)This means that T , p and cannot be varied independently of each other. Forexample, when T and p are given, follows from (2.14). Specically for idealgases, we have

    p = R

    M T , (2.15)

    with R = 8.314 J / (molK ) and M the molecular weight inkg/ mol . The caloricequation of state gives a relation between the internal energyu and the state vari-ables T , p, .2 Because of (2.14), u can only depend on two independent state

    variablesu = u(T , p), u = u(T , ) . (2.16)

    For most gases, liquids and solids,u can be well approximated as a linear functionof temperature only, i. e.

    u = cv T + u0 , (2.17)

    withcv the heat capacity at constant volume andu0 an integration constant.Fluxes and the Gradients of Fields : The conductive or molecular ux per

    area jcond of a conservation quantity can generally be related to the gradient of an associated eld . In the simplest case, jcond depends linearly on ,

    i.e.

    jcond = = x

    , (2.18)

    1Note that state variables can be combinations of other state variables, as in the case of , uand h.

    2The internal energy is the sum of allmicroscopic energies of the considered system. In a gas,U is primarily given by the kinetic energies (translation, rotation, oscillation) of single molecules.In liquids, interaction energies between neighboring molecules come into play, whereas in solids,translational and rotational degrees are absent.

    ZHW, Smsy, WS06/07 22

  • 7/27/2019 (2006) Simulacion de Sistemas Mecatronicos

    23/123

    CCP Center for Computational Physics SmSy

    where represents a material-dependent coefcient that can be a function of thestate variables (T , ).3 The list below gives several examples of material laws ofthe this type.

    L 1: Ohms law for a conductor with the drift current J = E proportional to theelectric eld E and the conductivity.

    L 2: An improvement of Ohms law with the addition of a diffusion current J = E + D n withD a diffusion constant andn the mobile carrier density. Notethat in general and D are related to each other.

    L 3: Fouriers law jth = T with the heat ux jth proportional to the tempera-

    ture gradient T and the thermal conductivity.L 4: Hooks laws = C e( u) of linear elasticity with e( u) = 12 ( u + u

    T ) the engi-neering strain, s stress tensor, C the elasticity tensor and u the mechanicaldeformation.

    More complex material laws are nonlinear functions of the gradient eld e.g.hyper-elastic, hypo-elastic and plastic mechanical models. For some materials,good models are not known as difculties arise in the mathematical descriptionof the physical world. Clearly complex models often have more parameters to bespecied which may not be ready available thus contributing to the uncertainty of

    the model description.

    2.1.4 Boundary Conditions

    Combining together balance laws and material laws, we obtain governing equa-tions in the form of PDEs for some unknown elds to be determined by solving theequations. Some typical examples to be discussed later in more details are

    E 1: The electrostatic Poisson equation . = for the potential .

    E 2: The thermal diffusion equation . T = q for the temperatureT .

    E 3: The linear elasticity equation .(C ( u+ uT

    2 )) = f for the displacement u.

    E 4: The Ohmic model of current ow. = 0 for the potential .

    E 5: The drift-diffusion model of a semiconductor. This is an improvement ofE 4 byincluding diffusion .( Dne / V T e / V T n) = R and .( D pe / V T e / V T p) = R for the electron and hole densitiesn, p.

    3The fact that in general = (T , ) introduces nonlinearity into Eq. (2.18). However, thedependence of on other state variables is usually weak and therefore can be often neglected.

    ZHW, Smsy, WS06/07 23

  • 7/27/2019 (2006) Simulacion de Sistemas Mecatronicos

    24/123

    CCP Center for Computational Physics SmSy

    In order to be able to solve these equations, one needs to specify some val-ues at the boundary of the modeling domain . These constraints are calledboundary conditions (BCs). BCs represent the exterior world i.e. everythinghappening in the complement of must be condensed into BCs on . Thenumber and type of BCs required is determined by the degree (highest derivative)of the PDEs involved, which in our case is generally two. If the problem is timedependent, initial conditions on need also to be specied. Let us discuss thecommonly used BCs for the solution of a degree two problem.

    Dirichlet Boundary Condition : Named after the nineteenth century Frenchanalyst Lejeune Dirichlet this BC species the value of the eld on the bound-ary

    = f Dirichlet ( x, t ) . (2.19)Neumann Boundary Condition : Named after Carl Gottfried Neumann this BCspecies the component of the ux F normal to the boundary. This can be statedin the form

    F n = f Neumann ( x, t ) , (2.20)

    with n the unit vector normal to the boundary and pointing in the outwarddirection i.e. the exterior of . The ux F is the value within the divergenceoperator .(.) of the equations E 1 E 5 and can be seen to be directly related tothe eld gradient . The special case where the normal ux component at theboundary is zero F n = 0, is called anatural BC .

    Neumann Mixed Boundary Condition : This BC is a generalization of theNeumann BC, where the normal component of the ux may depend on , i.e.

    F n = f Mixed ( , x, t ). (2.21)

    Floating Boundary Condition : This BC is somewhat similar to a DirichletBC where the eld value over the boundary is prescribed but now only up to aconstant C

    = f Floating ,1( x, t ) + C , (2.22)

    and where the value of the constantC is determined by prescribing the integral of

    the normal ux component over the boundary i. e.

    F d n = f Floating ,2(t ) . (2.23)

    Jump Boundary Condition : This BC cannot be considered a native BC sinceit is not dened on the boundary . It is an artefact used to dene a discontinuouseld on some internal surface of

    = f Jump ( F n, , x, t ), (2.24)

    ZHW, Smsy, WS06/07 24

  • 7/27/2019 (2006) Simulacion de Sistemas Mecatronicos

    25/123

    CCP Center for Computational Physics SmSy

    with the superscripts and indicating evaluation on two different sides of thesurface. A jump BC is often used to replace a complex physical process takingplace on a surface by an analytical model and for this reason the jump valuef Jumpis often a function of the eld and normal ux component. It is to be noted, that ingeneral across the jump we have F n = F n, but this condition may be violatedby dening a Neumann BC on the same surface.

    2.2 Example: Heat- and charge transport in an inte-grated circuit

    The following example studies heat and charge transport in two legs of an inte-grated circuit (IC) that is soldered to a printed-circuit board[2]. The geometry ofthe modeled device covers half of the support frame for the IC. Fig.2.2 shows themodel geometry including the two legs that are made of copper, while the solder joints are made of an alloy containing tin.It is important to understand the coupling between charge transport and heat trans-port to guarantee a failure-free operation of the IC. Therefore, the model accountsfor the coupling of thermal and electronic current balances. The ohmic losses inthe metal legs generate heat, which increases the conductors temperature andthus also changes the materials electric conductivity.

    The model is formulated in terms of balance equations for the electric current andheat that are similar to Eq.2.10. The electric current densityjel is driven by a localgradient in the electric potential

    jel = , (2.25)

    where is the electrical conductivity of the respective metal. For a steady-statemodel we set the time derivative in Eq.2.10 to zero. Moreover, electron transportdoes not include a convective transport mechanism, that is, the term including thevelocity can be neglected, too. There is no current source present in the metal, ie. = 0, and we obtain the electronic current balance equation

    ( ) = 0. (2.26)

    The electric conductivity depends on the local temperature

    =1

    0(1 + (T T 0)), (2.27)

    where 0 is a reference resistivity at a reference temperatureT 0 , and is a pro-portionality constant for the temperature dependence.

    ZHW, Smsy, WS06/07 25

  • 7/27/2019 (2006) Simulacion de Sistemas Mecatronicos

    26/123

    CCP Center for Computational Physics SmSy

    The thermal energy balance equation is also obtained from Eq.2.10. It includes aheat production term = qel arising form the losses in the electronic conductors,and a term for the conductive heat uxjheat = T ,

    ( T ) = qel (2.28)

    The thermal concuctivity is abbreviated with , it is assumed to be constant.The ohmic heat production term is

    qel = V 2 . (2.29)

    To obtain a solution, boundary conditions for the balance equations2.26 and2.28 have to be specied for all domain boundaries. The boundary conditions forthe electronic current balance are as follows:

    At the solder-joint bases, where the joints make contact to the circuit board,the potential is set to a given value

    V 0 = V device , (2.30)

    that is, a Dirichlet boundary condition is specied at the contact points.

    The boundary condition for the top surface of the device gives the currentdensity as a function of the potential difference over a thin oxide lm

    ( ) n = k (V V g), (2.31)

    where n denotes the outward pointing normal vector of the boundary,k equals the lms conductance andV g is the ground potential (V g = 0Volt ).This is a Neumann boundary condition, that is, the ux over the surface( ) n is specied.

    All other boundaries are assumed to be electrically insulating

    ( ) n = 0. (2.32)

    The boundary conditions for the thermal energy balance are:

    For both the lm surface and the solder-joint bases we assume

    ( T ) n = 0, (2.33)

    i.e. these boundaries are modelled to be thermally insulating.

    ZHW, Smsy, WS06/07 26

  • 7/27/2019 (2006) Simulacion de Sistemas Mecatronicos

    27/123

    CCP Center for Computational Physics SmSy

    Figure 2.2: Unstructured geometrical grid that is used for the discretisation of thepartial differential equations.

    All other surfaces are in contact with the surrounding air at that is at temper-ature T amb . These surfaces are cooled by natural convection

    ( T ) n = h(T T amb ), (2.34)

    where h is the heat transfer coefcient.

    The purpose of the model is to calculate the unknown eld values, that is,the position dependent temperatureT and the electric potential . Approximatedsolutions for the eld variables can be obained with the Finite Element Method(FEM). Exemplary simulation results were obtained with the Software COMSOLMultiphysics[2]. Fig.2.4 shows the electric potential distribution in the model do-main at a voltage difference of0.11mV between the right solder joints and theouter surface of the lm. The electric current ow is indicated by the arrows inthe plot. The left solder joint is assumed to be broken leading to a contact failure(electrical insulation), and thus, no electric current ows in the left contact leg. Thetemperature distribution in the model domain is shown in Fig.2.3. The model canbe used to simulate the thermal load in the IC for different operating conditions,and to perform failure analysis of the IC.

    References

    [1] NM-SESES Tutorial , NM Numerical Modelling GmbH, http://www.nmtec.ch,Thalwil, Switzerland, 2005.

    [2] COMSOL Multiphysics Quick Start and Quick Reference , COMSOL AB,http://www.comsol.com, Stockholm, Sweden, 2005.

    ZHW, Smsy, WS06/07 27

  • 7/27/2019 (2006) Simulacion de Sistemas Mecatronicos

    28/123

    CCP Center for Computational Physics SmSy

    Figure 2.3: Temperature distribution.

    Figure 2.4: Electric potential distribution.

    ZHW, Smsy, WS06/07 28

  • 7/27/2019 (2006) Simulacion de Sistemas Mecatronicos

    29/123

    Chapter 3

    Numerical Solution of Ordinary

    Differential Equations using FiniteElements

    3.1 Introduction

    The Finite Element Method is one of the the most powerful computer-orientedmethods ever devised to analise practical engineering problems. Today, FiniteElement analysis is an integral and major component in many elds of engineeringdesign and manufacturing. One of the reasons for the wide applicability of FiniteElement Methods is that they are intrinsically well-suited to treating second orderpartial differential equation systems (PDE). An example of a second order PDEsystem was given in Section2.2. Most PDEs encountered in science and engi-neering are of second order, i.e. the highest derivative term is a second partialderivative.The FEM approach is explained for a one-dimensional test problem in this chapter.However, the same terminology applies to two- and three dimensional models. Anexcellent introductory book on FEM was written by Reddy[3].

    3.2 Model problem

    For the purposes of this lecture, we will restrict consideration to the following modelproblem. Let us suppose that we wish to compute the solution to the ordinarydifferential equation

    d 2 dx 2

    = 0, (3.1)

    29

  • 7/27/2019 (2006) Simulacion de Sistemas Mecatronicos

    30/123

    CCP Center for Computational Physics SmSy

    for the domain = {0 x L}, where we know that ( x = 0) = 0 and ( x = L) = 1. As we saw before the exact solution for this problem is

    ( x) =sinh xsinh L

    . (3.2)

    3.3 Derivation of the Finite Element Method for themodel problem

    We shall begin to develop the nite element method for the solution of the model

    problem described in the previous section. There are several different approachesfor deriving the nite element method. We shall follow the method ofweighted residuals , which is probably the simplest to understand.

    3.3.1 Method of Weighted Residuals

    In the nite element method we wish to approximate in our domain . Thisapproximation we shall denote by . In the nite difference approach, the approxi-mation was pointwise and in the nite element approach the approximation will begiven by

    = M

    i= 1

    i N i , (3.3)

    where i are constant coefcients andN i are linearly independent functions, oftencalled shape functions.

    When building our approximation, we wish to ensure that satises the bound-ary conditions exactly, so that ( x = 0) = 0 and ( x = L) = 1. In addition, we wishthat as M , our approximation tends in some way to the exact solution .

    If our approximation is not exact, then the differential equation (3.19), will nolonger be satised exactly, that is

    R := d 2 dx 2

    d 2 dx 2

    = d 2 dx2

    = 0, (3.4)

    and we call the remainderR , the residual . For a good approximation, we want tomake R as small as possible. It turns out that this can be achieved, by multiplying R by a series of weightsW i, i = 1, , M integrating over the domain and settingthe result to0. This has been done below

    RW id = L

    0

    d 2 dx 2

    W idx = 0 i = 1, , M . (3.5)

    ZHW, Smsy, WS06/07 30

  • 7/27/2019 (2006) Simulacion de Sistemas Mecatronicos

    31/123

    CCP Center for Computational Physics SmSy

    Depending on the choice of weights, different numerical methods can be obtained.We wish to pursue the standardGalerkin nite element method, where the weightsare chosen to be the shape functionsW i = N i, giving

    L

    0

    d 2 dx 2

    N i N i dx = 0 i = 1, , M . (3.6)

    An important tool in the derivation of the nite element method is the integration byparts formula, this states that

    u

    dvdx

    dx = uv

    dudx

    vdx . (3.7)

    Applying this formula to the termd 2

    dx 2N i in equation (3.6) gives

    L

    0

    d dx

    dN idx

    + N i dx =d dx

    N i x= L

    d dx

    N i x= 0

    i = 1, , M . (3.8)

    In doing this, we note that the second oder derivative has now disappeared and we

    have an equation involving only rst order derivatives. If we substitute = M

    i= 1

    i N i

    in to the terms on the left of equation (3.8) we obtain

    M

    j= 1

    j L

    0

    dN jdx

    dN idx

    + N j N i dx =d dx

    N i x= L

    d dx

    N i x= 0

    i = 1, , M .

    (3.9)where we have chosen to leave the boundary terms on the right hand side of theequation untouched. We may write this equation as linear system of equations

    K = r , (3.10)

    where = ( 1,

    2, ,

    M )T and typical entries in K and r are given by

    K i j = L

    0

    dN jdx

    dN idx

    + N j N i dx , r i =d dx

    N i x= L

    d dx

    N i x= 0

    . (3.11)

    3.3.2 Choice of shape functions

    To be able to solve the linear system in equation (3.22), we need to specify theshape functions N i. In the nite element method, we rst subdivide in to a num-ber of non-overlapping sub-domains or elements and construct the approximation

    ZHW, Smsy, WS06/07 31

  • 7/27/2019 (2006) Simulacion de Sistemas Mecatronicos

    32/123

    CCP Center for Computational Physics SmSy

    Figure 3.1: A typical nite element mesh, containing5 elements and 6 Nodes

    in a piecewise manner over each sub-domain. An illustration of the subdivision ofthe domain is given in Figure3.1.

    Thus we may write a typical contribution to the matrix K as

    K i j = E

    e= 1

    K ei j where K ei j = dN jdx dN idx + N j N i d e , (3.12)where E is the number of elements and =

    E

    e= 1

    e.

    The shape functions can also be dened in a piecewise manner by using dif-ferent expressions in the various sub-domains from which the total domain is de-veloped. Finite element shape functions are usually dened so that they are1 atone node and 0 at all other nodes. In addition they are often chosen to vary lin-early within the elements in which the node associated with it occurs, this gives

    them a hat like appearance, for this reason they are often called hat functions. Anillustration of the shape functions is shown in Figure3.2.

    Figure 3.2: Typical linear nite element shape functions

    Here we observe that the functionN 1 is only non-zero in element1, for allother elements it is zero, also the functionN 2 is only nonzero in elements1 and2. Similar observation can be made about the other functions. Consider Figure3.3which introduces a numbering convention for an element and its nodes. Using thisconvention we write the shape functions associated with this element as

    N p = N e p =xq x

    he, N q = N eq =

    x x phe

    , (3.13)

    where he = xq x p = xe+ 1 xe. It is now possible to obtainK ei j for different values

    ZHW, Smsy, WS06/07 32

  • 7/27/2019 (2006) Simulacion de Sistemas Mecatronicos

    33/123

    CCP Center for Computational Physics SmSy

    Figure 3.3: Numbering convention for elements and nodes

    Figure 3.4: A mesh of 2 elements

    of i and j:

    K ei j = 0 when i, j = p, q

    K e pq = K eqp =

    xe+ 1

    xe

    dN qdx

    dN pdx

    + N q N pdx =he6

    1he

    K e pp = K eqq =

    xe+ 1

    xe

    dN pdx

    2

    + N 2 pdx =1he

    +he3

    3.3.3 A rst worked example

    If we assume that the nodes are equally spaced, so thatxi = ( i 1)h where h = L/ ( M 1) = L/ 2 then, for the mesh containing two elements, shown in Figure3.5we get

    K 1

    =

    1h +

    h3

    h6

    1h 0

    h6

    1h

    1h +

    h3 0

    0 0 0, K

    2=

    0 0 00 1h +

    h3

    h6

    1h

    0 h6 1h

    1h +

    h3

    (3.14)

    By adding these contributions we obtain the matrix

    K =1h + h3 h6 1h 0h6

    1h

    2h +

    2h3

    h6

    1h

    0 h6 1h

    1h +

    h3

    (3.15)

    The linear system for the nite element solution of the problem is then

    1h +

    h3

    h6

    1h 0

    h6

    1h

    2h +

    2h3

    h6

    1h

    0 h6 1h

    1h +

    h3

    1 2 3

    = d dx x= 0

    0d dx x= L

    . (3.16)

    ZHW, Smsy, WS06/07 33

  • 7/27/2019 (2006) Simulacion de Sistemas Mecatronicos

    34/123

    CCP Center for Computational Physics SmSy

    From the boundary conditions, we already know that 1 = ( x = 0) = 0 and 3 = ( x = L) = 1, therefore, we can dispose of the rst and last equations and obtainthat

    2h

    +2h3

    2 =1h

    h6

    (3.17)

    For the particular case ofL = 1 we obtain the solution 2 = 0.4423076 whichcompares well with the exact result x = 12 = 0.4434094 .

    It should be apparent that it is not necessary to compute all the entries for each element. Instead we usually perform

    k

    e

    = xe+ 1

    xe

    dN e pdx

    dN e pdx + N

    e p N

    e p

    dN eqdx

    dN e pdx + N

    eq N

    e p

    dN e pdx

    dN eqdx + N

    e p N

    eq

    dN eqdx

    dN eqdx + N

    eq N

    eq

    dx =

    1he +

    he3

    he6

    1he

    he6 1he 1he +

    he3(3.18)

    which can then be added to the correct position in the matrix K for each element

    using the connectivity information Element 1 2

    p 1 2 q 2 3

    We wish to explore the topics of boundary conditions as well as exploring thepossibilities of quadratic shape functions in the following.

    3.4 Boundary condition typesLet us remind ourselves of our model problem We wish to compute the solution tothe ordinary differential equation

    d 2 dx 2

    = 0, (3.19)

    for the domain = {0 x L}, where we know that ( x = 0) = 0 and ( x = L) = 1. As we saw before the exact solution for this problem is

    ( x) = sinh xsinh L

    . (3.20)

    Up until now we have always prescribed the values of the solution at the twoends of our domain. Namely that ( x = 0) = 0 and ( x = L) = 1. In fact, theprescription of these values is given the special name,boundary conditions . Inthis example we prescribed known values of the solution, this type of boundaryconditions is called aDirichlet boundary condition .

    An alternative boundary condition, often used with ordinary differential equa-tions, is where the values of the rst derivative of the dependent variable with

    ZHW, Smsy, WS06/07 34

  • 7/27/2019 (2006) Simulacion de Sistemas Mecatronicos

    35/123

    CCP Center for Computational Physics SmSy

    respect to the independent variable are prescribed, eg d dx

    = f ( x). This type ofboundary condition is called aNeumann boundary condition .

    Note that we could formulate our model problem with Neumann boundary con-ditions instead of Dirichlet boundary conditions. The model problem would thenread as follows: Find the solution to the ordinary differential equation

    d 2 dx 2

    = 0, (3.21)

    for the domain = {0 x L}, where we know thatd dx x= 0

    =cosh0sinh L

    and

    d dx x= L

    = cosh Lsinh L

    . The exact solution to this problem is again ( x) = sinh xsinh L

    .

    3.4.1 Finite elements with Neumann boundary conditions

    We saw in the last lecture that the nite element method was well suited to solvingproblems with Dirichlet boundary conditions. In fact, it is equally well suited tosolving problems with Neumann boundary conditions. Let us remind ourselves ofthe linear system that one obtains from the nite element derivation

    K = r , (3.22)

    where = ( 1 , 2 , , M )T and typical entries in K and r are given by

    K i j = L

    0

    dN jdx

    dN idx

    + N j N i dx , r i =d dx

    N i x= L

    d dx

    N i x= 0

    . (3.23)

    If Neumann values of the solution are prescribed, we may directly substitute themin to the vector r .

    3.4.2 A second worked example

    Let us assume that we wish to solve our model problem using Neumann boundaryconditions. For simplicity we consider the two element mesh shown in Figure3.5where the nodes are equally spaced with coordinatesxi = ( i 1)h where h = L/ ( M 1). Note this is the same mesh that was used in our rst worked example.

    The connectivity information for this mesh isElement 1 2

    p 1 2q 2 3

    and the elemental

    ZHW, Smsy, WS06/07 35

  • 7/27/2019 (2006) Simulacion de Sistemas Mecatronicos

    36/123

    CCP Center for Computational Physics SmSy

    Figure 3.5: A mesh of 2 elements

    matrices maybe evaluated giving

    k 1 = k 2 =1h +

    h3

    h6

    1h

    h6

    1h

    1h +

    h3

    . (3.24)

    Assembling these contributions using the connectivity information gives

    K =

    1h +

    h3

    h6

    1h 0

    h6

    1h

    2h +

    2h3

    h6

    1h

    0 h6 1h

    1h +

    h3

    . (3.25)

    The nite element solution of the problem then reduces to the solution of the linearsystem

    1h +

    h3

    h6

    1h 0

    h6

    1h

    2h +

    2h3

    h6

    1h

    0 h6 1h

    1h +

    h3

    1 2 3

    = cosh0sinh L

    0cosh Lsinh L

    , (3.26)

    where the Neumann boundary conditions have already been substituted in to the

    vector r . Note that in the case of Neumann boundary conditions, the value of thesolution at the boundary nodes1 and 3 is not known and therefore we are alsorequired to determine its value at these locations.

    For the particular case ofL = 1, we obtain that136

    2312 0

    2312266

    2312

    0 2312136

    1 2 3

    = cosh0sinh1

    0cosh1sinh1

    , (3.27)

    which may then be solved by Gauss elimination to give 0 = 0.01 , 2 = 0.43 , 3 = 0.98 . These values compare reasonably with the exact solution ( x = 0) = 0,

    ( x =12 ) = 0.4434094 and ( x = 1) = 1, although we observe that the numericalsolution is less accurate than the same problem solved with Dirichlet boundary

    conditions.

    3.5 Element mappings

    A useful technique often used in the implementation nite elements is elementmapping. The element mapping takes an element in the physical domain andmaps it to a reference domain. This procedure has several advantages

    ZHW, Smsy, WS06/07 36

  • 7/27/2019 (2006) Simulacion de Sistemas Mecatronicos

    37/123

    CCP Center for Computational Physics SmSy

    It is easier to the dene shape functions on the reference domain than in thephysical domain;

    Approximate numerical integration (eg Gauss Quadrature) is more easilyperformed on the reference domain;

    In higher dimensions, the approach allows deformed elements to be gener-ated and used.

    Let us assume that we wish to map our physical element e = { xe x xe+ 1} ={ x p x xq} to a reference element e = { 1 1}. A suitable mapping isgiven by

    x( ) = x p N e p( ) + xq N eq ( ), (3.28)

    where N e p =

    12

    (1 ), N eq =12

    (1 + ), (3.29)

    are the linear shape functions on the reference element. The mapping gives thedesired result x( 1) = x p and x(1) = xq . Note that by differentiating (3.28) we

    obtain dxd

    =xq x p

    2=

    xe+ 1 xe2

    .

    3.5.1 Linear shape functions

    We notice that

    N e p and

    N

    eq are equivalent to the hat functions, but now expressed inthe reference coordinates. To evaluate the elemental contribution to the stiffness

    we change the limits of integration so that a typical integral becomes

    k ei j = xe+ 1

    xe

    d N e jdx

    d N eidx

    + N e j N ei dx =

    he2

    1

    1

    d N e jdx

    d N eidx

    + N e j N ei d , (3.30)

    where he = xe+ 1 xe. To obtain the derivative of N e j with respect tox, we use thechain rule

    d N e jdx

    =d N e jd

    d dx

    =2he

    d N e jd

    , (3.31)

    so thatk ei j =

    1

    1

    2he

    d N e jd

    d N eid

    +he2

    N ei N e j d . (3.32)

    By evaluating the integrals for the four casesk e pp , k e pq , k eqp and k eqq one obtains

    k e =k e pp k

    e pq

    k eqp k eqq

    =1he +

    he3

    he6

    1he

    he6

    1he

    1he +

    he3

    , (3.33)

    which is the same that was obtained by using the linear hat functions in the physicaldomain.

    ZHW, Smsy, WS06/07 37

  • 7/27/2019 (2006) Simulacion de Sistemas Mecatronicos

    38/123

    CCP Center for Computational Physics SmSy

    3.5.2 Quadratic shape functions

    Finite elements of higher order may be easily developed using the technique ofelement mapping. In order to build a piecewise quadratic approximation to thesolution we use elements which have three nodes: One located at = 1, onelocated at = 1 and an extra node located at the middle = 0. Associated witheach node is a shape function

    N e p = ( 1)

    2, N eq =

    ( + 1)2

    , N er = ( 1)( + 1). (3.34)

    The shape functions are illustrated in Figure3.6. Then, by following a similar pro-

    Figure 3.6: Illustration of quadratic shape functions on the reference element.

    cedure to that used for the linear shape functions, one may obtain the followingelemental matrix

    k e =k e pp k

    e pq k

    e pr

    k eqp k eqq k

    eqr

    k erp k erq k

    err

    =

    73h +

    2h15

    13h

    h30

    83h +

    h15

    13h

    h30

    73h +

    2h15

    83h +

    h15

    83h +h

    15 8

    3h +h

    15163h +

    8h15

    , (3.35)

    which represents the contribution to thematrix K for a quadratic element. Problemsinvolving quadratic nite elements may then be solved in much the same way aslinear nite elements.

    3.5.3 A third worked example

    As a last example let us assume that we wish to solve our model problem us-ing quadratic nite elements. We use a mesh consisting of just one element andcompute the solution for the cases

    1. Dirichlet boundary conditions ( x = 0) = 0 and ( x = L) = 1

    ZHW, Smsy, WS06/07 38

  • 7/27/2019 (2006) Simulacion de Sistemas Mecatronicos

    39/123

    CCP Center for Computational Physics SmSy

    2. Neumann boundary conditions

    d dx x= 0 =

    cosh0

    sinh L and

    d dx x= L =

    cosh L

    sinh L .Applying the quadratic nite element to this problem we obtain the linear system

    73h +

    2h15

    13h

    h30

    83h +

    h15

    13h

    h30

    73h +

    2h15

    83h +

    h15

    83h +h

    15 8

    3h +h

    15163h +

    8h15

    1 2 3

    = d dx x= 0

    d dx x= L

    0

    , (3.36)

    where x1 = 0, x2 = L and x3 = L/ 2. The solutions for the particular case ofL = 1are then as follows

    1. For Dirichlet boundary conditions, the rst and last equations are not re-quired and the middle equation becomes

    8815

    3 =3915

    ( ( x = 0) + ( x = L)) , (3.37)

    substituting the known values gives, 1 = 0, 2 = 1 and 3 = 0.44318 .

    2. Substituting the Neumann boundary conditions gives the linear system

    37

    15

    3

    10 39

    15310

    3715 3915

    3915 3915

    8815

    1 2 3

    = cosh0

    sinh1cosh1sinh1

    0, (3.38)

    and upon solution of the linear system we obtain 1 = 0.0006 , 2 = 0.4476and 3 = 0.9994 .

    Comparing these results to the earlier results, we can see that for this problem asingle quadratic nite element is more accurate than two linear nite elements.

    References[1] J.N. ReddyAn introduction to the Finite Element Method , McGrawHill, USA,

    ISBN 007-124473-5, 2006.

    ZHW, Smsy, WS06/07 39

  • 7/27/2019 (2006) Simulacion de Sistemas Mecatronicos

    40/123

    CCP Center for Computational Physics SmSy

    ZHW, Smsy, WS06/07 40

  • 7/27/2019 (2006) Simulacion de Sistemas Mecatronicos

    41/123

    Chapter 4

    Heat Conduction in a CylindricalStick

    Heat issues are of common interest since they occur in many distinct applicationelds and in general are the result of coupled effects. Thus it is worthwhile to con-sider a basic heat problem here in order to get familiar with the relevant simulationconcepts.

    Let us consider a cylindrical aluminum stick of total length125cm and a diam-

    eter of 4cm being cooled at one end and heated by a gas burner at the other end.For an overview of the experimental setup see Fig.4.1. Essentially, the elongatedgeometry of the stick suggests a simplication to a 1D problem and so we will rstpresent an analytical solution to a simplied 1D problem. As a next step, heat ra-diation loss at the stick surface is considered and an analytical solution method isproposed. Then a SESES model for a 2D case and lastly a 3D case are calculatedin order to rene the simulation results and make them comparable to experimentaldata of the stick in transient and steady-state.

    Figure 4.1: Sketch of the horizontal alu-minum stick heated on the right and wa-ter cooled on the left side.

    Figure 4.2: 2DSESES Model of theheated stick with cooling on the left andheating on the right.

    41

  • 7/27/2019 (2006) Simulacion de Sistemas Mecatronicos

    42/123

    CCP Center for Computational Physics SmSy

    4.1 Analytical model in 1D

    In one dimension, the heat equation reads

    c dT dt

    d 2T dx2

    = q . (4.1)

    with T the temperature, the heat conductivity,q the heat density rate, c thespecic heat capacity and the specic density. As a rst approach let us considerthe stationary equation with a heat loss proportional to the local temperature

    d 2T

    dx 2 =

    (T

    T

    ref ) ,(4.2)

    with a phenomenological heat loss coefcient. As boundary conditions, wechoose

    T (0) = T ref and F ( L) = h , (4.3)

    withT ref the temperature of the cooling water atx = 0, F = T the heat uxand h a measure of the heating power atx = L. The general solution is a particularsolution to the inhomogeneous equation that we simply choose asT I = T ref plusthe homogeneous solution which can be found with the help of the AnsatzT H ( x) =Ce x. Back substitution yields the characteristic polynomial and the general form

    2 = 0 = T H ( x) = C 1e + x + C 2e x (4.4)with the two coefcientsC 1 and C 2 determined by the boundary conditions(4.3).At x = 0, we obtainC 2 = C 1 = C and since dT / dx = h/ at x = L, we ndC = h/ ( 2cosh ( L)) with = / . The solution to (4.2)-(4.3) is therefore

    T ( x) = T I ( x) + T H ( x) = T ref +h

    2 cosh ( L)sinh ( x) . (4.5)

    The larger the heat transfer coefcient the stronger the temperature prole devi-ates from the linear solution obtained for 0. In other words, determines thecurvature of the temperature prole.

    4.2 Building a 2D SESES model for the heated stick

    We shall start with a 2D model of the heated stick which will be used to cal-culate the time-dependent temperature at selected points in the stick as well ascomplete temperature proles in the stick. TheSESES input le can be found at

    ZHW, Smsy, WS06/07 42

  • 7/27/2019 (2006) Simulacion de Sistemas Mecatronicos

    43/123

    CCP Center for Computational Physics SmSy

    examples/sens/HeatStick.s2d . These calculations will be compared to mea-surement data acquired at the slots indicated in Fig.4.1. The mesh of the 2Dmodel is shown in Fig.4.2. In order to get accurate simulation results one needsto consider heat loss by radiation and convective transport apart from the coolingand heating boundary conditions mentioned above in (4.3). In heat problems, it iscommon to introduce a phenomenological heat transfer coefcient as the pro-portionality factor between the heat change and the temperature difference withrespect to a reference point of temperatureT ref

    dQdt

    = A(T T ref ) , (4.6)

    with A being the surface area. The transfer coefcients for convection can bederived tabulated gures of merit that depend on the specic geometry and sur-rounding material. In the section discussing a 3D model, we will also introduceheat radiation and consider a realistic value for the heat transfer coefcient. In ourSESES model heat transfer is dened with the following statements

    BC Transfer IType nx-4 nx 1 IType 0 nx-5 1 IType 0 nx 0 JType 0 1 nxNeumann Temp D_Temp tcoeff*(-refTmp+Temp),tcoeff W/m**2-W/(m**2*K)

    with the reference temperature refTmp . We note that since the Neumann

    boundary condition depends on the temperature itself one needs to supply thederivative of the temperaturedof eld with theD_Temp statement in order to en-able a successful Newton-Raphson algorithm.

    The cooling conditions enforced with water ow through the left end of theheated stick is implemented with a simple Dirichlet boundary condition

    BC Cooling JType 0 1 0Dirichlet Temp refTmp K

    The heat source located at the right end of the stick is dened as follows

    BC Heating IType nx-5 nx-4 1Neumann Temp -(time

  • 7/27/2019 (2006) Simulacion de Sistemas Mecatronicos

    44/123

    CCP Center for Computational Physics SmSy

    Figure 4.3: Temperature elds at differ-ent times after turn-on during heating(temperature scale not shown).

    Figure 4.4: Temperature elds at differ-ent times after turn-off during cooling(temperature scale not shown).

    The rst line above makes sure that the temperature and heat ux elds arestored in theData le at each time step. For a heating parameter ofh = 160W / cm 2some time-dependent temperature elds during heating are shown in Fig.4.3. Thelowermost distribution corresponds to the steady state. In Fig.4.4 some tempera-ture elds during coolingt > t o f f are shown. Note that the color scale is normalizedfor each instance in time and therefore cannot be compared directly.

    Let us now compare the simulation results with measured data sets of tem-perature proles and transients. For this purpose four points along the aluminumstick were dened withLattice statements whose temperature is written to a leduring the calculation. Moreover a line was dened along the stick along which thetemperature prole was recorded. In Fig.4.5 two measurements with distinct heat-ing intensities are shown that can be reproduced successfully by our 2D simulationby adjusting the heating parameterh, denoted byheaterflux . For the simulationshown in this gure the heat transfer coefcienttcoeff was set to 100W / (m2 K).This value seems quite large but includes a correction factor due to the reducedsurface area in the 2D model. The reduced surface area results from the 2D modeldimensions that were determined by the requirement of identical volume as in thereal geometry, thus leading to a surface area smaller by a factor of11 with respectto the real cylinder surface. The exact value oftcoeff will be discussed in moredetail in the next section on a 3DSESES model of the heated stick. In addition, theanalytical solution of (4.5) is also plotted. The factor ofsinh representing the heat-ing intensity was adjusted. By contrast, the prefactor in the argument, = / where corresponds to our parameter tcoeff , was calculated as 0.021cm 1using = 10W / (m3K) and = 235W / (mK ).

    Keeping thesimulation parameters xed, we cannow consider the time-dependenttemperature at 4 selected points on the stick, denoted by T10, T21, T31, T41. Thetransient behavior is shown in Fig.4.6 during a 200 minute time window. Theheat source was switched off after 100 minutes. Fig.4.6 exhibits good agreement

    ZHW, Smsy, WS06/07 44

  • 7/27/2019 (2006) Simulacion de Sistemas Mecatronicos

    45/123

    CCP Center for Computational Physics SmSy

    50

    100

    150

    200

    250

    300

    0 50 100 150 200

    t e m p e r a

    t u r e

    ( K )

    time (min)

    Temperature Transients at 4 Positions

    T10 expT21 expT31 expT41 exp

    T10 sim 2DT21 sim 2DT31 sim 2DT41 sim 2D

    Figure 4.5: Steady-state temperatureprole in the stick for two distinct heat-ing powers and simulations with ad- justed heating parameter h (W/ m2).The prediction by the 1D analyticalmodel is shown for comparison.

    Figure 4.6: Time-dependent tempera-ture at different positions on the alu-minum stick.

    0

    50

    100

    150

    200

    250

    300

    350

    0 20 40 60 80 100 120

    t e m p e r a

    t u r e

    ( K )

    distance (cm)

    Heating Temperature Profiles vs Time

    10 min, exp20 min, exp30 min, exp40 min, exp90 min, exp

    10 min, sim 2D20 min, sim 2D30 min, sim 2D40 min, sim 2D90 min, sim 2D

    0

    50

    100

    150

    200

    250

    300

    350

    0 20 40 60 80 100 120

    t e m p e r a

    t u r e

    ( K )

    distance (cm)

    Heating Temperature Profiles vs Time

    100 min, exp110 min, exp120 min, exp130 min, exp140 min, exp

    100 min, sim 2D110 min, sim 2D120 min, sim 2D130 min, sim 2D140 min, sim 2D

    Figure 4.7: Time-dependent tempera-ture proles during heating.

    Figure 4.8: Time-dependent tempera-ture proles during cooling.

    between measurement and simulation during the heating cycle. However, afterturn-off the temperature drops signicantly faster in the simulation. In addition wecan compare the time-dependent temperature proles during heating as well ascooling. The former is shown in Fig.4.7. The data plotted in constant time incre-ments demonstrates that the heat conduction is fast initially but slows down whenapproaching steady state.

    4.3 3D SESES Model for the heated stick

    In the 2D approach above, we have achieved satisfactory agreement with mea-surement data by assuming convective heat transfer only and by adjusting the two

    ZHW, Smsy, WS06/07 45

  • 7/27/2019 (2006) Simulacion de Sistemas Mecatronicos

    46/123

    CCP Center for Computational Physics SmSy

    parameters heating intensityheaterflux and the transfer coefcienttcoeff . Theformer adjusts the resulting temperature scale and the latter the curvature of thetemperature prole. With the optimum valuetcoeff=100 the data is reproducednicely. However, a closer look into the heat transfer literature reveals that typicalvalues for are around 5 to 20W / (m2K). In particular, the convective heat trans-fer coefcient is determined by the Nusselt numberNu through = Nu / d whered is the characteristic length scale, in our case the cylinder diameter. For horizontalcylinders the Nusselt number is given by

    Nu = 0.6 +0.387Ra 0.167

    (1 + ( 0.559Pr )0.563 )0.296

    2

    , (4.7)

    where both the Prandtl numberPr and the Rayleigh numberRa depend on materialparameters of the surrounding air. For our geometry the convective heat transfercoefcient is calculated as10.1W / (m2K). We note that this value is in goodagreement with the value of100W / (m2K) used in the 2D model if the surfacereduction factor is considered. We shall now keep this value xed and in additionconsider heat transfer by radiation. The Stephan-Boltzmann radiation law states

    dQdt

    = A(T 4 T 4ref ) , (4.8)

    where we have introduced the Stephan-Boltzmann constant and the emissivity . The emissivity is a unitless material parameter between0 and 1 and for agiven material varies depending on the surface quality such as the roughness. Foraluminum a typical value above room temperature is 0.25. The new heat transferboundary condition considering both convective and radiative loss thus reads

    BC Transfer OnChange 1 Neumann TempD_Temp tcoeff*(-refTmp+Temp)+sigma*eps*(-(refTmp**4)+Temp**4),

    tcoeff+sigma*eps*4*Temp**3 W/m**2-W/(m**2*K)

    As for the geometry, a 3D model is derived with only minor corrections to the2D SESES le. For our cylindrical stick, we keep thex-axis parallel to the stickand choose the z-axis perpendicular tox and y. By use of the cylinder homotopyroutine we can thus dene the 3D stick geometry and the resulting geometry isillustrated in Fig.4.9.

    XME nx xlen/nxYME ny ylen/nyZME nz=ny (zlen=ylen)/ny

    Coord cylx(ylen/2,zlen/2,1)*1E-2 1

    ZHW, Smsy, WS06/07 46

  • 7/27/2019 (2006) Simulacion de Sistemas Mecatronicos

    47/123

    CCP Center for Computational Physics SmSy

    Alu Cooling Heating

    x

    y

    z

    Figure 4.9: 3DSESES Model of theheated stick shown from below withcooling on the right and heating on the

    left.

    Figure 4.10: Example of calculatedtemperature distribution in 3D assum-ing both convective and radiative heat

    transfer.

    Figure 4.11: Comparison of the 3Dsimulation results with the previouslyshown temperature prole data.

    Figure 4.12: Comparison of the 3Dsimulation results with the previouslyshown transient data.

    With the heat ux now chosen as60W / m2 we calculate the stationary distri-bution shown in Fig.4.10. The heated spot on the stick is pointing upward in thisgure. With the rened 3D model, we expect the data to be reproduced more ac-curately which is conrmed in the comparison of Fig.4.11. The curvature of thetemperature prole is now matched more closely to the measured data. Note thatthe temperature drops at distances exceeding 102 .5cm since the stick is heatedat this location. As for the transient behavior, the 3D model gives comparable re-sults as the 2D model, see Fig.4.12. With the 3D model the temperature decay ismatched somewhat closer.

    The last simulation aspect to be discussed here is the thermal expansion re-sulting from the heat distribution calculated above. For this purpose the thermalexpansion coefcientAlphaIso and the displacement eldDisp needs to be de-ned and enabled, respectively. The following statement inserted in the commandsection dening the calculation sequence is also required.

    ZHW, Smsy, WS06/07 47

  • 7/27/2019 (2006) Simulacion de Sistemas Mecatronicos

    48/123

    CCP Center for Computational Physics SmSy

    Figure 4.13: Calculation of the dis-placement due to thermal expansion inthe aluminum stick.

    Figure 4.14: Calculation of the dis-placement prole inx-direction due tothermal expansion.

    BlockStruct Block Temp Block Disp

    To x the cooled left end of the aluminum stick, we set thex-component of thedisplacement eld to zero in the boundary condition

    BC Cooling JKType 0 ny 0 nz 0Dirichlet Temp refTmp KDirichlet Disp.X 0 m

    The resulting total elongation of the stick is the value of the displacement eld x-component at the right end of the stick. For our example withh = 60W / (m2 K)and an expansion coefcient ofAlphaIso = 2.310 5 K 1, we get an elongation of3 mm . The displacement prole is shown in Fig.4.14 and is essentially the integralof the temperature prole times the expansion coefcient. From the solution ofthe simple 1D analytical model (4.5) one would thus predict a hyperbolic cosinefunction for thisx-displacement prole.

    In conclusion we have demonstrated the use ofSESES to model the tempera-ture distribution and thermal expansion in a heated aluminum stick by consideringboth convective and radiative heat loss. The simulation results were comparedsuccessfully with experimental data in transient and steady state.

    ZHW, Smsy, WS06/07 48

  • 7/27/2019 (2006) Simulacion de Sistemas Mecatronicos

    49/123

    Chapter 5

    Calorimetric Flow Sensor

    In this tutorial example the operating principle of a calorimetric ow sensor andits implementation inSESES is discussed. Rather than focusing on the geomet-rical design of realistic ow sensors, we wish to illustrate a modeling method forthis specic microuidic device that relies on the solution of the heat conductionequation with forced convection.

    Many different physical principles for measuring ow are employed in practice1. For conductive uids, an electromagnetic measuring principle based on the in-duced voltage in a magnetic eld is employed. For microuidic systems, the calori-

    metric ow sensor principle is widely used. Such sensors contain a heater andtwo temperature sensors that are in good thermal contact with the ow channelvolume, see Fig.5.1. Typically, the sensor and heater pads are separated from theow channel by a thin membrane. If the medium is at rest, a symmetric tempera-ture distribution around the heater is expected and the two sensors, one upstreamand one downstream from the heater location, measure identical temperatures.For non-zero ow rates, however, the temperature distribution is not symmetricany more. The difference of the two sensor temperatures is then proportional to,and therefore a measure of, the ow rate. The design of a specic sensor geom-etry will depend on the application of interest and the sensor electronics at hand.The simulations documented here allow for efcient sensor characterization priorto fabrication. In particular, a qualitative and quantitative understanding of sensoroperation is enabled by the simulation. We attempt to illustrate what kind of ques-tions might arise when developing a calorimetric ow sensor [1]. Table 5 gives anoverview of the operating principles commonly used with calorimetric ow sensors.

    Each operation mode has its benets and drawbacks. For instance, in constantpower mode, a regulation of the temperature of the heater is not necessary but thesensor signal will react slowly to an abrupt change in the ow rate. The simulation

    1see, for instance, www.owmeterdirectory.com

    49

  • 7/27/2019 (2006) Simulacion de Sistemas Mecatronicos

    50/123

    CCP Center for Computational Physics SmSy

    Figure 5.1: Geometry of a typical calori-metric ow sensor.

    Figure 5.2: Simulation domain with theboundary conditions highlighted.

    Operation Mode Characteristics Application CommentsConstant T 2 1 = f (v0) small uid ows, no temperaturePower P gaseous media regulation necessary

    T H = f (v0) uid ows

    Constant T 2 1 = f (v0) small uid ows temperature regulation

    Temperature T H P = f (v0) medium uid ows fast response

    Table 5.1: Operating principles of the calorimetric ow sensor.

    ZHW, Smsy, WS06/07 50

  • 7/27/2019 (2006) Simulacion de Sistemas Mecatronicos

    51/123

    CCP Center for Computational Physics SmSy

    results for different operating principles will be discussed below.

    5.0.1 Building a Flow Sensor Model in SESES

    Let us now build aSESES model of the ow sensor. Since we focus on the solutionalgorithm and the operating principle, we choose a simple 2D model of the sensorgeometry and solve the heat transport equation only. I.e. rather than solving a fullycoupled thermo-uidic model, we shall solve the heat transport equation only andprescribe the uid ow independently as a parabolic velocity prole

    v = v0 (1 4 y2

    d 2 ), (5.1)

    where v0 is the maximum speed at the center ( y = 0) of the channel andd theheight of the channel. Equation(5.1) is theHagen-Poiseuille law for viscous lami-nar ow, see also the example on page?? . This simplication is justied wheneverthe temperature rise is relatively small and thus not changing the uid propertiesthemselves.

    Let us discuss now the key parts of the input leexamples/flow/FlowSens.s2dprovided for this example. The geometry of our sensor is comprised of a horizon-tal uid channel, a medium above (pyrex) and a medium below (plexy glass), see

    Fig. 5.2. The temperature sensors and the signal analysis electronics are bothlocated on the upper side of the thin pyrex plate. The material specication state-ments contain the statementEquation Temp Enable for enabling the heat trans-port equation. Only for the uid material we need to specify also theNavier-Stokes equation as follows

    MaterialSpec FluidEquation ThermalEnergy NavierStokes EnableParameter PressEps 5e-8*1 sParameter Viscosity 1e-3 Pa*sParameter KappaIso 0.585 W/(K*m)Parameter Enthalpy cpFl*Temp,cpFl J/kg-J/(K*kg)Parameter Mmol MFl kg/molParameter Density.Val rhoFl kg/m**3

    The parameters stated above correspond to water, which is the incompressibleuid chosen here. The heat transport equation has a convective term which isautomatically accounted for inSESES . Therefore, no additional boundary conditionfor the channel entrance and exit needs to be specied. For the boundary of thesimulation domain we may formulate a heat transfer boundary condition (not shownin the screenshot of Fig.5.2), namely

    ZHW, Smsy, WS06/07 51

  • 7/27/2019 (2006) Simulacion de Sistemas Mecatronicos

    52/123

    CCP Center for Computational Physics SmSy

    BC Transfer OnChange 1 IType nnx3 nnx4 nytot Disable

    Neumann Temp D_Temp alpha*(Temp-Tamb) alpha (W/cm**2)-W/(cm**2*K)

    where is the heat transfer coefcient.The heater is specied either with aDirichlet or a Neumann type boundary

    condition, depending on whether we wish to operate the sensor in constant heatertemperature or power mode, also compare with Table5. To implement the constantpower mode we write

    BC Heater IType nnx3 nnx4 nytotNeumann Temp -Power/(lc*hcb) W/um**2

    where the negative sign prescribes the inward direction of the heat ux. Thetemperature sensors have been dened as boundary conditions ofFloating type

    BC SensUp IType nnx1+1 nnx2-1 nytot Floating Temp 0 WBC SensDown IType nnx5+1 nnx6-1 nytot Floating Temp 0 W

    and are visible in the DRAW window. The temperature and the thermal ux(power) at these boundaries will be exported for postprocessing.

    In the command section we rst initialize the velocity and we specify the tem-perature eld as the onlydof eld to be calculated, since the velocity eld is pre-

    scribed.Solve Init Velocity.X=v0*(1-4*y*y/(h*h))

    In our example we have generated aGnuplot script le which is embedded inthe SESES container le. For plotting the simulation data, theGnuplot script le isextracted and used as command line argument for theGnuplot command with thefollowingSESES statements

    Extract flowsensor.gnuSystem gnuplot flowsensor.gnu

    5.0.2 Constant Heating Power Mode

    For designing a realistic ow sensor, the geometry is optimized such that the sen-sor characteristics are as desired for the application of interest. In particular, the re-lation between the ow rate and the sensor temperatures for a given heater powerrange needs to be analyzed. This relation will then be used for calibration in prac-tice.

    ZHW, Smsy, WS06/07 52

  • 7/27/2019 (2006) Simulacion de Sistemas Mecatronicos

    53/123

    CCP Center for Computational Physics SmSy

    Figure 5.3: Steady-state temperature elds for different ow rates at identicalpower of the heater. The upper left shows the temperature eld when the uidis at rest, followed by examples of increasing ow rates.

    First, let us consider the situation when the uid is not owing for reference.For non-zero heating power one expects a symmetric temperature eld. The tem-perature eld can be visualized as shown in Fig.5.3 with contour lines of equaltemperature by choosing MATERIAL in the STYLE menu of the FIELD palette. Thecase of zero ow is shown in the upper left corner of Fig.5.3. Steady-state tem-perature elds for increasing ow rate are shown in the other examples of Fig.5.3.The difference in the thermal conductivity is apparent in the contour lines travers-ing material boundaries. As expected, the temperature eld is moving downstreamwith increasing ow rate.

    The sensor calibration curve is the curve relating the measurement signal andthe quantity of interest, i.e. the ow rate. In our example, we calculate the depen-dence of the sensor temperature differenceT 2 1 = T 2 T 1 on the mid-channelvelocityv0 . Fig.5.4 shows the dependence of T 2 1 and the heater temperaturerise above ambient temperatureT H at a given power density applied to the heater.We note that T 2 1 exhibits a maximum value whileT H decreases monotonicallywith increasing velocity in the channel. The slope of theT 2 1 curve decreasesand thus the sensitivity of the sensor is reduced at higher velocities. The heatingpower inuences the ow rate range in which the sensor can be operated. As anexample, Fig.5.5 shows such a dependence for the same geometry as above.

    5.1 Constant Sensor Temperature Mode

    As indicated in Table5, an alternative measurement mode adjusts the heaterpower density at constant heater temperature. For this mode one needs to mea-sure the local heater temperature and then regulate t