Home

ZINC 3.2 (Finite element code) User Manual

image

Contents

1. 0 or if labels has been set region 9 nodes 2 values T 0 04 V 0 for example The latter form is easier to read This fixes u4 T 0 04 and u5V 0 in region 9 nodes Variables not specified default to not being fixed The specification of all nodes and whether they are fixed is written out filename zls 5 2 38 Specifying Neumann boundaries at surfaces So far we have set material properties physics within regions and Dirichlet boundaries on nodes The other boundary condition is Neumann boundary which has the general form NjCijklUk dikuk Gi 5 1 The g and g values default to zero To set them non zero we identify a surface between to volumetric regions see Figure 2 6 and attach parameters using the command surface i j N values matrix name where i and j are the two regions N is the number of entries to follow and matrix name must be g or g A typical example is surface 1 2 3 values g 1 21 0 2 2 0 3 3 0 If labels have been defined these can be used as well Eg in an electrostatic problem with labels displacements u v w surface 1 2 3 values g u 1 v 2 Ww 3 O OO As shown in Figure 3 6 the simulation is conceptually surrounded by regions called XMAX etc Thus 1 XMAX is the surface between region 1 and the maximum x edge of the simulation Page 36 of 63 ZINC 3 2 user manual NPL Report Name Meaning pi The constant 7 i The constant 1 x X posi
2. 3 8 3 Transitio 3 8 5 Summary of advanced shape 4 PDE specificatio 93 Linux and Mad e isea SS ee a 312 View Menu e ce s sor SS RR 3 1 4 Output window en 3 3 Neuman Boundaries 38 Advanced parts s 3 84 Neon o a aaa RR Rs 4 1 Mode 1 Static problems leen NPL Report bo OO OO Oo CON NPL Report 5 Zinc core solver 5 2 _Material physics file filename zi 5 2 3 Specifving Neumann boundaries at surfaces 5 2 4 Initial state specificatio 5 5 Advanced non linear simulation 5 6 Examples of zinc input file 5 7 Zinc output files Zpp the Zinc post processo 6 1 Zpp input files 6 6 3 Example calculation 6 4 Zpp output file A Comsol s coefficient mode B Description of the zinc mtf file C Additional global variables in file zi i 5 1 Mesh definition file file mtl 5 21 Control variables een 5 2 2 Region specification blocks 5 4 The constants file file con 6 2 Scan expressions ce ZINC 3 2 user manual 49 io Bao w Be P da du N 49 T Er 51 DAG deed EE SEE 52 TP 53 57 59 63 ZINC 3 2 user manual NPL Report Chapter 1 Introduction ZINC is a finite element code capable of solving a wide range of physics and multiphysics prob lems ZINC can solve pretty much any physics based problems which can be expressed as s
3. calculation parameters expression Page 49 of 63 NPL Report Zinc 2 0 Zpp ZINC 3 2 user manual V Path DAMGC zincprog examples diele FINADISTEP 10000 3 Input files 0 00000E 00 0 10100E 00 0 30000E 00 0 10000E 01 0 748t Zpp dielectric zpp Sol n dielectric zou 0 20000E 01 0 10100E 00 0 30000E 00 0 96000E 00 0 1104 0 40000E 01 0 10100E 00 0 30000E 00 0 96000E 00 0 2208 0 60000E 01 0 10100E 00 0 30000E 00 0 94000E 00 0 3313 0 80000E 01 0 10100E 00 0 30000E 00 0 92000E 00 0 4417 Zinc inputfiles Input dielectric zin Mesh dielectric mtf Constants dielectric con 0 10000E 00 0 10100E 00 0 30000E 00 0 90000E 00 0 5521 0 12000E 00 0 10100E 00 0 30000E 00 0 88000E 00 0 663 0 14000E 00 0 10100E 00 0 30000E 00 0 86000E 00 0 774 0 16000E 00 0 10100E 00 0 30000E 00 0 84000E 00 0 885 Gnuplot dielectric gnu Graph files dielectric 1 out lt lt linescan 100 dielectric02 out lt lt linescan 100 dielectric03 out lt lt linescan 100 dielectric04 out lt lt linescan 100 dielectric05 out lt lt linescan 100 dielectricO6 out lt lt planescan dielectric07 out lt lt planescan Status READY Open Bun Cancel Zinc 2 0 Zpp Graph 0 18000E 00 0 10100E 00 0 30000E 00 0 82000E 00 0 996 lt Im gt 0 101 0 3 1 0 0101 03 1 0 v 0 101 0 3 1 0 0 101 0 3 1 0 v 2 0 101 0
4. n3033V 3 0 4 18 mkT n2kT 2 n3kT 3 0 4 19 which are open or natural boundaries The latter states that no energy flows out of the system insulator It may be noted that there is no coupling between V and T in this problem In fact we could have just solved for V and T separately Coupling could be introduced by putting some non zero off diagonals in 4 15 or by introducing non linearity For example the conductivities c11 etc might depend on temperature while the heat source Q might depend on electric field eg Q E ZINC can solve non linear problems such as this In linear problems we must set all the components of C a f q g to literal constants in the input files or expressions that evaluate to constants see Section 5 3 In non linear problems we can set some or all of the components to expressions involving the dependent variables See Section 4 5 Matrix and component form PDE specification It is often convenient to consider C as a matrix when specifying the problem Internally however ZINC regards it as being a 4 dimensional array of size N x d x N x d where N is the number of Page 27 of 63 NPL Report ZINC 3 2 user manual variables and d 3 the number of dimensions In the above example N 2 d 3 the matrix 4 15 can be written as Cui Cii Cins Cii Cu C1123 Cini Ciz C1213 Cii Ci C1223 Ci313 C1312 C1313 C1321 C1322 C1323 4 20 C211 C212 Conus C2121 C2122 C2123 C2211 C2212 C2213 C22
5. The line extends from xstart ystart to xend yend with arc centre in the case of arcs at xcentre ycentre Vectors should link to one another in sequence and form a closed loop in the x y plane Eg to make a square use type extrusion reer 0 1 1 0 H HA OO end 10 1 1 0 O OH To make a circle we could adapt this to read type extrusion A 00 10 0 50 5 A 10 11 0 50 5 A 11 01 0 5 0 5 A 01 00 0 5 0 5 end Page 20 of 63 ZINC 3 2 user manual NPL Report Note that arc segments may not be more the 90 degrees Longer arcs should be divided into smaller ones just as we have done here The extrusion fab command takes a single parameter the length of the extrusion fab L The extrusion is along the z axis from L 2 to L 2 The whole extrusion can be rotated and shifted into place in the usual way The S and SE commands at the end of each vector determine how surface fitting is done on the extruded surface of the shape If S is present the segment is surface fitted If SE is present edge fitting is done also Such surface fitting is performed only if a surface command appears in the part specification The top and bottom part of the surface is always fitted if such a surface command is present To turn off this fitting use the sidefit specifier A complete part specification for extrusion looks like for example part 1 region 1 type extrusion L 10 10 A 10 01 00 A 01 10 00 end fab 1 rotate 90 0 0 shift
6. This feature is intended to give a basic look at the raw data solved by the simulation For post processing linescans and surface plots i e more quantitative information use ZPP 3 1 1 File menu Open MIN read geometry input file Open MTF read pre processed mesh definition file Open ZOU View a solution file Shows a basic view of the data For more advanced views and post processing use ZPP View MIN Show input file on screen Note that this file cannot be edited The user should use a text editor to edit the file Notepad will do but a programming text editor may be preferable We use Emacs a free text editor with many advanced features For complex geometries it may be necessary to generate file min using a computer program Process Process the currently loaded MIN file Exit Terminate the program 3 1 2 View Menu Bounding box Brings up a dialog allowing user to select a rectangular section of the simulation volume to display User selects minimum and maximum i j k values indexing system for elements The maximum extents allowed are shown to the right of the dialog Click All to set the maximum extents and show the whole system Click one to select only one element which is taken to be that specified by imin jmin kmin Export View Allows you to export the current view as an Enhanced Metafile EMF Copy View Copies the current view to the clipboard 3 1 3 On screen controls Drag the on screen objects with
7. istep int length x double scanfun char label double x double y double z double nx double ny double nz double ur 1 int nvar int length Figure 5 4 Template for C non linear functions file d11 Here we have assumed that there is 1 variable The C functions receive an additional variable length which is the length of the string label This string is not null terminated Page 44 of 63 ZINC 3 2 user manual NPL Report dielectric con eps0 8 854e 12 dielectric zin N WO e nreg labels V lt other global commands gt region 1 elements 3 values C V x V x eps0 V y V y eps0 Vz V z eps0 region 2 elements 3 values C V x V x 2 epsO Vy V y 2 epsO V z V z 2 eps0 region 3 nodes 1 value V 1 region 4 nodes 1 value V 0 init Figure 5 5 Simple linear electrostatic simulation cf Figure 3 4 Page 45 of 63 NPL Report ZINC 3 2 user manual dielectric con eps0 8 854e 12 epsi epsO eps2 2 eps0 E01 1000 V m E02 2000 V m h 1e 3 m dielectric zin H o o o H n Il lt lt other global commands gt region 1 elements 3 values C V x V x 1 sqrt Vx 2 Vy 2 Vz 2 E0 eps1 Vy V y 1 sqrt Vx 2 Vy 2 Vz 2 E0 eps1 V z V z 1 sqrt Vx 2 Vy 2 Vz 2 EO eps1 region 2 elements 3 values C V x V x 1 sqrt Vx 2 Vy 2 Vz 2 E0 eps2 Vy V y 1 sqrt Vx 2 Vy 2 Vz 2 E0 eps2 V z V z 1 sqrt Vx 2 Vy 2 Vz 2 E0 eps2 region 3 nodes 1 value V 1 region 4 nodes 1
8. on the top surface etc The S parameter if present indicates that surface fitting will be done The fab command has the form fab L The shape then extends along the z axis from z L 2 to z L 2 3 8 4 Neon The neon shape is an arbitrary tube of circular cross section The trajectory of the cross section is given by a series of points part neon x1 yl z1 x2 y2 z2 end where x1 y1 z1 etc are points in 3 D space The fab command has the form fab r where r is the radius of the tube 3 8 5 Summary of advanced shapes The advanced shapes are summarised in Table 8 3 Page 22 of 63 ZINC 3 2 user manual NPL Report type type command fab Description extrusion type extrusion sidefit L extrusion from z L 2 to z L 2 Vector list end turning type turning sidefit 0 05 turning about z from 6 to 62 Vector list end transition type transition sidefit L transition along z from z L 2 to L 2 Vector pair list end neon type neon r Circular tube radius r points list end Table 3 3 Table of advanced shapes A Vector has the form xstart ystart xend yend xcentre ycentre SISE A Vector pair has the form xstarta ystarta xstartb ystartb S Page 23 of 63 NPL Report ZINC 3 2 user manual Page 24 of 63 ZINC 3 2 user manual NPL Report Chapter 4 PDE specification 4 1 Mode 1 Static problems For static systems ZINC supports the following partial differential equation sets V CVu au f 4
9. the constants in filename con the built in variables pi 3 14159 i sqrt 1 spatial variables x y z and variables corresponding to the dependent variables to be solved for These last are called u1 u2 u nvar Their derivatives are also available and are called uix uiy uiz u2x u2y u2z However if labels has been set these names are used instead Thus in a thermo electric system with variables T V the standard variables are T V Tx Ty Tz Vx Vy Vz The full set of built in variables in shown in Table Page 37 of 63 NPL Report ZINC 3 2 user manual Built in variables x y z are the spatial coordinate in the coordinate system specified in filename mtf If expressions are given in terms of dependent variables ul etc or their deriva tives the simulation automatically becomes non linear The functions sin cos tan sqrt exp log ln abs ang real imag conjg complex may be used Note that log is logio while 1n is loge Complex numbers may be constructed as a b i or with the function complex complex a b Note that although complex expressions are allowed all expressions must evaluate to real since ZINC operates with real numbers only If an expression is complex it will be truncated to real by discarding the imaginary part Examples of legal expressions include 1 same as 1 0 1e0 1t h 2 h must be present in filename con 1e 6 1 exp x x0 2 2 sig 2 Gaussian x0 sig must be in filename con ul 2t u2y u3z Dep
10. to see whether the ZINC package as a whole is suitable to their needs Then if more sophisticated geometries are needed the user can opt to purchase MetaMesh directly from the Field Precision website 3 1 The Zmesh program Zmesh is an interactive program as shown in Figure The user first prepares an input file file min which contains all the geometry details Section 3 2 He then uses the File gt Open MIN command to read this file At this point the file can be examined using File gt View MIN If all is well the file can be processed using File gt Process A meshed geometry is then created and is saved automatically as file mtf This geometry appears on screen and can be rotated Lwww fieldp com Page 9 of 63 NPL Report ZINC 3 2 user manual 1 8888 x 1 090988 y 1 8888 Eile View Help 1 8888 b Showing an xslice through the structure Figure 3 1 Zmesh a program for meshing arbitrary structures Page 10 of 63 ZINC 3 2 user manual NPL Report by dragging on screen the arrow keys can also be used Various viewing options also exist as described below A pre existing mesh file file mtf can be read using File gt open MTF If you have already run a ZINC simulation you can view the result using File gt open ZOU This shows a colour coded view of the data with a colour bar on the left indicating value variables You can cycle through the variables using the j and buttons
11. zpp filename This latter technique is useful for running ZINC under batch control ZINC can also be run from external programming systems like Matlab Python or Excel The actual filenames for the ZINC programs are zinc exe Core solver runs at the command line zincwin exe Windows version of ZINC zpp exe Post processor runs at the command line zppwin exe Windows version of ZPP zmesh exe Non interactive mesh generation zmeshwin exe Interactive mesh generation visualization package When ZINC installs the windows versions of ZMESH ZINC and ZPP appear in the Start Menu The installer adds ZINC s directory to your PATH so that you can conveniently run ZINC from the command prompt Windows programs like zincwin exe operate by calling their command line equivalents like zinc exe ZINC also comes bundled with Gnuplot ZPP invokes Gnuplot to generate graphs Gnuplot is then available for the user to run independently from ZiNC Gnuplot comes with documentation and many tutorial examples Since ZPP emits text output files as well these can be plotted using any graph plotter or spreadsheet program However we recommend the user of Gnuplot for best speed and quality For advanced non linear operation the user will need to prepare DLL files for ZINC to link to A free compiler like gcc or gfortran will do http gcc gnu org wiki GFortran See the Tutorial Manual Chapter 3 for an example of preparing a DLL file to link to ZiNC The u
12. 1 0 0 0 0 0 end This creates prism of semi circular cross section length 1 along the z axis then rotates it around x so it now points along y The part is shifted so that its centre is at 1 0 0 3 8 2 Turning A turning part is made by constructing a 2 D shape in r z plane then rotating about the z axis The type command has exactly the same form as for the extrusion including the use of lines or arcs and the S SE commands type turning sidefit Vector 1 S SE Vector 2 S SE end The fab command has the form fab angmin angmax where angmin angmax are the minimum and maximum turning angles about the z axis in degrees Use 0 and 360 to produce a full turning If the angle difference is less than 360 the turning will have start and end faces which are fitted according to the surface command unless sidefit is specified The turning may be shifted and rotated in the usual way Page 21 of 63 NPL Report ZINC 3 2 user manual 3 8 3 Transition The transition shape consists of two planar shapes at z zmin and z zmax connected together As we go from zmin to zmax the shape smoothly morphs between the two shapes The type command has the form type transition sidefit Vector ia Vector 1b 9 Vector 2a Vector 2b 9 end Each vector is of the form xstart ystart xend yend Note that arcs are not allowed so there is no need for the L or A specification Vector la on the bottom surface morphs into vector 1b
13. 1 value g V 2 The simulation is conceptually surrounded by regions called XMAX XMIN YMAX YMIN ZMAX ZMIN as shown in Figure B 6 Thus the red outer edge on the left hand of Figure can be designated Page 16 of 63 ZINC 3 2 user manual NPL Report YMAX XMIN XMAX region 1 YMIN Figure 3 6 Specification of surfaces for Neumann boundary conditions Surface 1 2 is the circular surface between regions 1 and 2 Surface 1 XMIN is the red surface surface 3 YMIN is shown blue and surface 3 XMAX is shown green 1 XMIN interface between region 1 and XMIN 3 4 List of part specification commands There are seven 7 part specification commands which appear within a part block part n end These are type fab region surface coat rotate shift We have al ready introduced these commands but now specify them in more detail type The type of part see Table Single parts are just of the form type part Advanced parts Table have the form type part Vector list end with each vector on a separate line Section fab Fabrication info for the part This depends on the part in question and is described in Table B I Table 3 2 Table 3 3 region Elements in this part will be assigned this region number Nodes around those elements will also be so assigned surface This command has the form surface region part n edge tol It causes nodes to be moved towards the surface between the
14. It is always guaranteed that node J J K will be connected to I 1 J K etc Every node in the interior is surrounded by 8 elements The input file zinc mtf is therefore very simple it begins like this IMax 20 JMax 20 KMax 27 I J K x y z RegNo RegUp 0 O 3 0000E 02 3 0000E 02 2 5000E 01 3 1 1 0 O 2 4531E 02 3 0000E 02 2 5000E 01 3 1 Page 32 of 63 ZINC 3 2 user manual NPL Report O 1 9140E 02 3 0000E 02 2 5000E 01 O 1 4003E 02 3 0000E 02 2 5000E 01 O 9 4604E 01 3 0000E 02 2 5000E 01 O 5 9265E 01 3 0000E 02 2 5000E 01 O 3 5648E 01 3 0000E 02 2 5000E 01 O01 WD O O O OO WwWww Ww PPP PP Nodes are numbered I J K 2 0 0 0 to IMax JMax KMax Each row in the table gives the 1 J K index of the node its coordinate its region number and the region number of the element in the positive x y z directions RegUp A detailed description of the mtf file format is given in Appendix B In practice file mtf is normally generated by ZMESH Once nodes and region numbers have been set in the mtf file the materials file filename zin sets the material properties associated with these regions The elements are given values C a f according to region numbers while nodes can be fixed at specified values according to their region numbers giving Dirichlet boundaries Nodes can be fixed within the volume not just over the boundary it is possible to set only certain variables while leaving others free on a given
15. Vui Vus A 4 V alb V a V b A 5 where alb is a 6 vector in 3D space partitioned into two 3 vectors In principle ZINC could be extended to allow the other variables in A I However the boundary condition variables q and g would be difficult to do in ZINC as these require a surface integral to be added to the energy function Currently the mesh specification file zinc mtf does not identify mesh faces so this would not be possible Note that comsol uses a Lagrange multiplier u This means that when Dirichlet boundary conditions are used the Neumann equation becomes trivial When Dirichlet is not set so that h 0 we default to the Neumann boundary Page 57 of 63 NPL Report ZINC 3 2 user manual Page 58 of 63 ZINC 3 2 user manual NPL Report Appendix B Description of the zinc mtf file Consider the illustration Figure Here the problem is shown in 2 D for clarity The 3 D mesh used in ZINCis analogous In the figure there are 3 material regions and we need to label the elements as region 1 2 or 3 appropriately we will later associate material properties with each region We want to label the top row of nodes as region 4 and the bottom row as region 5 We will later set Dirichlet boundaries for nodes with region number 4 and 5 The region numbers of the internal nodes does not matter provided it is not 4 or 5 Nodes with numbers 1 2 or 3 will not be fixed We will label internal nodes as 1 Note Metamesh will ge
16. also study the internal structure of the openFOAM source code in detail We can see the advantages that openFOAM has in terms of flexibility but we think that users should not need to be grandmasters of a particular programming language to use an FE package Also the user should not be exposed so much to the internal workings of the code as they are in OpenFOAM In ZINC we have therefore taken a middle ground Most users will never need to write any code to use ZINC You just set up the coefficients to correspond to the physics material properties you want Running a new physics problem just involves altering the input file no programming needed To support non linearity material properties can be entered as expressions of the variables being solved for For instance if you are solving a dielctric problem you can Page 2 of 63 ZINC 3 2 user manual NPL Report In Fortran function cfun string x y z ur dur nvar istep character string double precision x y z ur 1 dur 1 3 integer nvar if string eq permittivity Cfun 1 2 ur 1 ie permttivity 1 2 V end function cfun In C double cfun char label double x double y double z double ur 3 double dur 3 1 int nvar int istep int length 1 if equal label length permittivity return 1 2 ur 0 ie permittivity 142 V Figure 1 1 Example of functions used in ZINC for non linear simulation Fortran and C forms are showed but any language capable of producin
17. be entered as 2 epsO rather than the more cumbersome 1 778e 11 file dll contains the above mentioned non linear functions if needed more details of which are shown in Section Before a geometry can be solved in FE it needs to be broken up into many small shapes called elements through a process known as meshing ZMESH provides the functionalilty The user writes file min which specifies the geometry in a simple way ZMESH then processes this file and outputs file mtf which contains the geometry and position of all the elements ZINC then runs and writes an output file file zou containing the solution on each of the FE nodes This file can be viewed directly using ZMESH but for more advanced views and post processing the code ZPP is provided ZPP ZINC post processor reads the file file zpp in which the user specifies a series of linescans and or plane scans and generates corresponding graphs The user can plot arbitrary expressions based on the simulation variables and their derivatives ZPP automatically plots all files on the screen and also creates graph files in the form of Enhanced Metafiles EMF or Encapsulated Postscript EPS files EMF files are convenient for Microsoft Office products while EPS is most suitable for IATEX both are vector formats In order to generate these graphs ZPP outputs the datafiles file01 out fileO2 out etc These are simply numbered in order created depending on how many such plots the user has requested
18. case we replace O Ot with jwt in the PDEs and the problem again becomes spatial but we are solving for the phasors u r These phasors are complex numbers whose modulus indicates time oscillation amplitude and whose phase gives a phase shift according to 4 11 However ZINC does not support complex variables so it will be necessary to write u ur iui and expand each complex equation in terms of two real equations Some harmonic problems give real solutions for example if the material properties are real lossless In that case u r gives amplitudes of oscillation with each point oscillating in phase 44 Example with thermal electrical coupling A simple example of how to set the matrices is an electrical conduction thermal system In this case we have o OV O OV o OV p eu ay om z o 0 4 12 OT OT OT ET m E en e Q 4 13 Page 26 of 63 ZINC 3 2 user manual NPL Report where V is the electric potential o is the conductivity tensor T is temperature k is thermal conductivity Q is heat source These equations follow directly from Maxwell s equation and the diffusion equation In this case 4 14 4 15 We have Vi Vo of VER V3 Vu VT T 4 16 T2 T3 so that V CVu is euVa a 022V3 2 033 V3 3 4 17 ki Ta ar kT 2 a using Vi OV Ox etc And we set f 0 Q and a 0 to complete the equation set The Neumann BCs are of the form mon V1 n2022 V2
19. help Once a set of input files has been prepared it is easy to adapt it to say change material properties or geometry without needing to adjust the detailed physics Several examples of common physics systems are supplied in the supplied Tutorial Manual and it should be easy to adapt these for many bread and butter problems The beauty of ZINC is that it can solve these familiar problems at full speed while at the same time allowing the simulation of completely new or esoteric equations which might never have been written down before let alone solved However before we get too carried away we should admit that ZINC in common with other general purpose FE packages cannot necessarily solve any problem input to it Some problems will turn out to self contradictory a fact which is not always obvious when the equations are written on paper Other systems may be unstable giving a very poorly conditioned matrix and needing special techniques to solve ZINC comes with several built in solvers but users having particular problems should approach NPL for advice In some cases problem specific solution techniques may be needed which NPL can possibly provide We would like to emphasise that this limitation is not specific to ZINC but is a necessary feature of all general purpose FE programs For example we have tested ZINC extensively against Comsol When the equations Page 1 of 63 NPL Report ZINC 3 2 user manual were well formed ZINC and Co
20. node Finally Neumann boundaries are set using q g values 5 2 Material physics file filename zin The file consists of several parts which may be given in any order 1 Control variables of the form variable value This includes number of time steps to run the simulation type etc 2 Region specification blocks Associates material properties and physics with each region number These blocks start with region xx elements or region xx nodes see below 3 Surface statements applying Neuman boundary conditions 4 The initial condition This is followed by nvar lines of specifying the initial state of each simulation variable The above information may be given in any order Line spacing is unimportant and comment lines may be inserted beginning with Lines may be continued using the ampersand amp character for example key sim amp 1 is the same as key sim 1 Page 33 of 63 NPL Report ZINC 3 2 user manual 5 2 1 Control variables Some control variable are compulsory and ZINC will report an error if they are not set Others are optional and will take on default values if not set Compulsory control variables These are nvar nreg key sim nstep Also if key_sim 2 transient simulation the time step tstep must be set nvar Number of variables Eg 5 in multiferroics nstep number of iteration steps With key_sim 1 2 this is the total number of steps with non linear elements being updated periodicall
21. node specification region x nodes An example of ffun in Fortran would be function ffun label x y z ur dur nvar istep implicit none character label integer nvar double precision Cfun x y z ur nvar dur nvar 3 if label eq ohmic heating then ffun dur 1 1 2 dur 1 2 2 dur 1 3 2 Page 39 of 63 NPL Report ZINC 3 2 user manual other options endif end function ffun In C the function ffun would look something like this double ffun char label double x double y double z double ur 1 double dur 3 1 int nvar int istep int length double Ex Ey Ez if equal label length ohmic_heating Ex dur 0 0 Ey dur 1 0 Ez dur 2 0 return Ex Ex Ey Ey Ez Ez other options Note that the string passed in is not null terminated but of fixed length length and is hence dealt with using our own equal function as shown in Figure 52 Also the C dur matrix is transposed compared to the Fortran matrix You need to be aware of issues like this if you are using a different language read your compiler manual Chapter 3 of the Tutorial Manual shows a fuel cell simulation using Fortran and C non linear functions using the free gcc compiler In this example the program substitutes the value Bur V Ju V du M aa Gaz Gee 52 x Ox r3 wherever the token ohmic heating appears in filename zin For example in an electrostatic run ui V the potent
22. specifies C1111 0 31100 x 10 SI units Note that expressions may be entered in place of literal constants a facility which allows spacial variation of material properties and or non linearity See Section 5 3 An alternative if labels has been specified is to enter the variable names and the directions x y z Thus we might have V x V x 0 31100E 11 This still sets C1111 0 31100 x 10 as before but may be more helpful as it gives a clearer idea what the meaning of this C element is Coefficient a has 2 components so and entry in the list might be 1 1 3 03983816e15 OR V V 3 03983816e15 which specifies a1 3 03983816 x 1015 SI units Coefficient f has 1 component so an entry might be 1 0 5 OR 0 5 which specifies f 0 5 SI units A complete region entry would look like region 2 elements 3 values a 1 1 3 03983816e15 2 2 3 03983816e15 3 3 3 03983816e15 Page 35 of 63 NPL Report ZINC 3 2 user manual Note Zero values need not be entered these are assumed by default The full specification of C a f will be written in filename zls it is advisable to check this If the keyword is nodes then specify nodes to have fixed values of one or more variables N is the number of fixed values matrix name is not used There then follows a list of fixed variables of form variable number or symbol then value Eg to fix variables 4 and 5 in region 9 use region 9 nodes 2 values 4 0 04 5
23. the mouse to rotate or use arrow keys Zoom in out using keys A and Z Rotate in the plane using keys N and M Shift the view around by holding Shift and dragging with the mouse A legend for the region numbers are listed on the right of the screen Left click to toggle a region on or off when a region is off a cross appears in the box For example in Figure 3 1 a region 1 has been switched off allowing easier viewing of region 2 a sphere in this case When viewing a simultion result file ZOU file these buttons have three states on DATA off The DATA state shows colour coded data for the given region with a colour legend on the left Right clicking on a region in the legend brings up a colour dialog box which allows the user to change the colour for the indicated region number Page 11 of 63 NPL Report ZINC 3 2 user manual The buttons along the bottom are as follows x y z View along the x y or z axes xslice yslice zslice View a slice through the system ie a single plane of elements for exam ple as shown in Figure 3 I b You can change which slice is displayed using the up and down arrows on the keyboard off Switch off slices so that the whole system is displayed 3 1 4 Output window ZMESH gives various notifications to the user in the output window These include details of meshing or any errors encountered in the input file 3 2 Structure of the geometry input file The mesh input fi
24. to calculate the x component of the displacement field in the electrostatic calculation shown in Figure 5 5 we could use linescan parameters 1 eps1 2 eps2 Vx In region 1 the expression evaluates to epsi Vx in region 2 it becomes eps2 Vx NOTE Zpp reads the files filename con filename zin so is aware of the constants specified e g eps1 eps2 and the variable names e g V Alternatively the user may refer to the function scanfun in filename d1l In this case we use tokens beginning with eg Page 51 of 63 NPL Report ZINC 3 2 user manual linescan parameters D function scanfun label x y z ur dur nvar character label integer nvar double precision scanfun x y z ur nvar dur nvar 3 double precision parameter eps0 8 854e 12 double precision parameter epsi epsO eps2 epsO 2 double precision eps if z gt 0 then eps epsi else eps eps2 endif scanfun eps dur 1 1 end function scanfun would also generate the D field In this example we assume that region 1 z gt 0 and region 2 z 0 6 3 Example calculations Let us assume an electrostatic calculation with V as the only variable defined using the labels command in zin In that case linescan 100 0 101 0 3 1 0 0 101 0 3 1 0 V creates a line scan graph of voltage from 0 101 0 3 1 0 to 0 101 0 3 1 0 with 100 points sampled linescan 100 0 101 0 3 1 0 0 101 0 3 1 0 V 1 2 L creates the same graph but plottin
25. value V 0 init V 0 5 z h 1 Figure 5 6 Non linear dielectric simulation Page 46 of 63 ZINC 3 2 user manual NPL Report dielectric con lt other global commands gt region 1 elements 3 values C V x V x epsiloni V y V y epsiloni V z V z epsiloni region 2 elements 3 values C V x V x epsilon2 V y V y epsilon2 V z V z epsilon2 region 3 nodes 1 value V 21 region 4 nodes 1 value V 20 init V 20 5 z h 1 function Cfun label x y z ur dur nvar istep character label double precision Cfun x y z ur nvar dur nvar 3 integer nvar istep double precision parameter eps0 8 854e 12 double precision parameter epsi epsO eps2 epsO 2 double precision parameter E10 1000 E20 2000 double precision E E sqrt dur 1 1 2 dur 1 2 2 dur 1 3 2 if label eq epsiloni then Cfun 1 E E10 eps1 else if label eq epsilon2 then Cfun 1 E E20 eps2 endif end function Cfun Figure 5 7 Non linear dielectric simulation Page 47 of 63 NPL Report ZINC 3 2 user manual Page 48 of 63 ZINC 3 2 user manual NPL Report Chapter 6 Zpp the Zinc post processor The ZINC Post Processor ZPP is shown in Figure 6 1 Use Open to select a file zpp input file see below then Run to perform the post processing The lower list box shows the output files generated Clicking on one and selecting graph shows a graph of the line or plane scan selected this but
26. 1 n CVu gu g Neumann Here u u4 u2 where ui z y z etc are the independent variables to be solved for For example ui might be electrostatic potential and us temperature as in the example of Section 4 4 One must set the various components of C a f q g so that when 4 1 is multiplied out we obtain the needed set of PDEs and boundary conditions Here the meaning of grad and div is non standard For example with two variables we define Vu Vui Vua 4 3 V alb V a V b 4 4 where a b is a 6 vector in 3D space partitioned into two 3 vectors Thus grad is applied to each element in u and div takes groups of three variables and compacts them into one These equations can also be written in component form as CijklUk l j t Gikuk fi 1 1 N 4 5 NjCijklUk qikU k Ji Neumann i 1 N c V a with summation over repeat indices and N is the number of independent variables to be solved Here up Oux Ox etc This general PDE specification allows a wide range of systems to be solved including those mentioned in the introduction To give an example in an electrostatics problem setting C to the permittivity tensor and f to the charge density p defines the equation V D p and 4 2 with q g 0 corresponds to the natural Neumann boundary condition n D 0 which is a typical open boundary condition for electrostatic problems The components of C a f q g all vary in
27. 21 C2222 C2223 C2311 C2312 C2313 C2321 C2322 C2323 and it is these components C which must be entered in ZINC s input file In this way C may be written as a series of 3 x 3 blocks with the 1st and 3rd component indicating the index of each block Written in component form 4 1 4 2 become OUE t AU fi 1 0 N 4 21 Nj Cijkl uk qik k gi Neumann i 1 N 4 22 with implied summation over repeat indices Also a q are matrices and f g are vectors and their components aik di and fi gi are entered straightforwardly 4 6 Multiferroic equations a more complex example In multiferroics frequency domain 0 0t jw we may write Gys Pi pu 4 23 V D 0 4 24 V B 0 4 25 VxE 0 4 26 VxH 0 4 27 with Einstein summation convention The equations assume no space charge and no current In this case we can introduce E VV 4 28 H VV 4 29 1 Eij zii Uji 4 30 so that the curl equations 4 26 4 27 are automatically satisfied We use linear constitutive laws as Sij RHE kij Bk er He 4 31 D jjk jk KF E oi Hj 4 32 By eek HOE ui H 4 33 Page 28 of 63 ZINC 3 2 user manual NPL Report so that the magnetic and electric equations look just the same The equations can be written in matrix form as c CEH el e y D e KH a E 4 34 B p qu ae H Substituting 4 31 433 in 4 23 4 25 and using 4 28 430 we o
28. 3 1 0 0 101 0 3 1 0 vz 00 00 10 00 00 1 0 vz 0 0 0 0 1 0 00 00 1 0 1 eps1 2 eps2Pvz 200 10 10 1 0 10 40 40 v 200 10 10 1 0 10 40 40 1 eps1 2 eps2 vz 0 10100E 00 0 30000E 00 0 10000E 01 to 0 10100E 00 0 30000E 00 0 10000E 01 1 scan distance Figure 6 1 Program ZPP top and automatically generated graph bottom Page 50 of 63 ZINC 3 2 user manual NPL Report The following calculations are supported linescan Perform a linescan through the data The parameters are nline x1 y1 z1 x2 y2 z2 where nline is the number of points between coordinates xl yl z1 and x2 y2 z2 planescan Perform a planescan through the data The parameters are inorm pnorm al a2 b1 b2 Na Nb where inorm 1 2 3 indicates a plane perpendiculer to x y z respectively Within this plane al b1 is the starting coordinate and a2 b2 is the end coordinate Na and Nb are the number of intervals along each direction If inorm 1 a y b z if inorm 2 a x b z if norm 3 a x b y surfint Integrate over a specified surface giving f expression dS The parameters are ifrom ito such that the surface exists between regions ifrom and ito the same concept as for Neuman boundaries Section 3 3 The unit normal is available under variables nx ny nz and points from ifrom to ito Derivative quantities may be used and are taken in the ito region evaluated on the surface volint Integrate over a volume within the region specified giving f expressi
29. 5 0 2 b 0 5 0 1 0 2 end 0 1 0 1 0 033 0 1 0 5 0 2 ymesh end 0 5 0 5 0 2 end ymesh 0 5 0 1 0 2 0 1 0 1 0 033 0 1 0 5 0 2 end Figure 3 2 Logical mesh formed using the global commands shown In the real file a zmesh command is also needed For simplicity these figures show a 2 D analogy a Single meshing interval with one xmesh and one ymesh command b variable meshing with multiple meshing commands xmesh x1 x2 dx1 x2 x3 dx2 end where x1 x2 is a line segment divided into intervals dx1 wide etc If xmesh contains only one command line the meshing is uniform across the whole simulation region If there are multiple lines as in Figure 8 2 b this allows variable meshing as shown The commands ymesh zmesh have exactly the same form ZMESH then processes the parts one by one as shown in Figure 3 3 In response to the two part commands shown a sphere is created inside a cube The cube is specified first and covers the whole simulation region Then the sphere is specified which is inserted into the cube ie the cube is overwritten showing the importance of parts order in the file Notice that the cube is designated region 1 and the sphere as region 2 These region numbers will later be linked to material properties in file zin Figure 3 3 a shows what happens in response to the part 2 command ZMESH identifies the elements whose centroids are inside the sphere specified and sets the elements as region 2 In respons
30. INC is deliberately language agnostic and never needs to be recompiled The user simply provides a function in a DLL which calculates the needed material property given the point in space x y z and the solved for variables ur and their derivatives dur The user is entirely shielded from the inner working of ZINC and just needs to fill out a purely mathematical function Of course instead of the single line Cfun 1 2 ur 1 as above the user can enter arbitrarily complex code with loops branches calls to other functions read write from files etc We believe that this approach is much simpler and more effective than the OpenFOAM technique Note again that programming Page 3 of 63 NPL Report ZINC 3 2 user manual is optional and only needed for advanced simulations Full details of user functions accessed by ZINC are given in Section 1 2 Zinc operation With these ideas in mind let us look at the operation of ZINC which is shown diagrammatically in Figure This looks complex but bear with us The user can choose any stem name file for the simulation Thus file zin might become fuelcellcathode zin for example The file zin file contains all information about the physics of the problem to be solved file con optional contains a list of convenient constants in the simulation which will be referred in file zin Eg we can store eps0 8 854e 12 the permittivity of free space The permittivity of a material with rel permittivity 2 can then
31. NPL Report ZINC 3 2 Finite element code User Manual John Blackburn August 2011 NPL Report ZINC 3 2 Finite element code User Manual John Blackburn Materials Group August 2011 ABSTRACT This document describes the operation of ZINC version 3 2 ZINC is a program to solve non linear multiphysics problems using the finite element method It can be used to model almost any physics system NPL Report Crown copyright 2010 Reproduced with the permission of the Controller of HMSO and Queen s Printer for Scotland National Physical Laboratory Hampton Road Teddington Middlesex United Kingdom TW11 OLW Extracts from this report may be reproduced provided the source is acknowledged and the extract is not taken out of context We gratefully acknowledge the financial support of the UK Department for Innovation Universities and Skills National Measurement System Directorate Approved on behalf of the Managing Director NPL by Markys Cain Knowledge leader for the Materials Team ZINC 3 2 user manual Contents 1 Introductio 1 1 Comparison to other general purpose FE programs 1 2 Zinc operatio 2 Installing and running Zinc 2 1 Zinc install directory 22 Uninstalling zind 2 4 Zinc Memory requirements 3 Meshing with Zmes 31 The Zmesh progra 311 File men 3 1 3 On screen controls 3 2 Structure of the geometry input file 3 8 1 Extrusio
32. ZPP then calls Gnuplot using auto generated command file file gnu to generate the graphs needed Since the out files are still left behind on disk its easy to recreate the graphs when needed The user can use Gnuplot to change the symbols titles and formatting of the graph or to plot several simulation results in one graph It s easy for example to compare simulation results with experimental data Since the raw data files are always on disk there s never any mystery about where a graph came from This approach therefore provides good traceability and flexiblity See the Tutorial Manual Chapter 1 for more details on advanced graph plotting Page 4 of 63 ZINC 3 2 user manual NPL Report file dll OA file mls ZINC ZPP NS etc GNUPLOT file01 eps or file01 emf etc Figure 1 2 The operation of ZINC Ellipses are files and rectangles are programs Optional input files are shown in brackets The DLL file can be generated using any programming language Page 5 of 63 NPL Report ZINC 3 2 user manual Page 6 of 63 ZINC 3 2 user manual NPL Report Chapter 2 Installing and running Zinc ZINC is installed using an automatic installer which will guide you through the process The three programs ZMESH ZINC ZPP are available to run from the Start Menu in Windows The programs can also be invoked from the command line as zmesh filename zinc filename
33. and Mac using the Wine system Wine comes bundled with most Linux systems and is available for download on Mac The Wine website contains comprehensive information on running Windows programs with Wine To install ZINC you should run the installer executable through Wine Then run ZMESH ZINC and ZPP through Wine One issue we ve noticed on Linux it s better to install ZINC in a directory without spaces in its path i e not in the default c program files zinc directory Similarly the directory where you store your actual simulations should probably be free of spaces 2 4 Zinc Memory requirements Most of ZINC s memory requirement is due to storing the matrix Q This is stored in sparse format in Qval ip iQ ip jQ ip ip 1 lenQ where lenQ nnod nvar x 27 Here nnod nvar are the total number of nodes and number of variables respectively ZINC uses 8 byte real numbers double precision and 4 byte integers Therefore each entry in Q uses 8 4 4 16 bytes and the memory requirement is about nnod nvar 27 16 bytes Page 8 of 63 ZINC 3 2 user manual NPL Report Chapter 3 Meshing with Zmesh Before we can simulate a problem in ZINC the geometry must first be meshed This is the process of decomposing the required geometry into small elements ZINC requires that the geometry be meshed into hexahedral elements and this may be accomplished by using the included program ZMESH A hexahedron is a six sided solid figures resembling a squas
34. and writing snapshots in transient problems default 10 nstrideNL Steps between updating finite element matrices during non linear runs In non linear problems the matrices must be updated to account for changing material properties Only used if key_sim 1 2 default 10 key_export 0 No export 1 Export to Paraview format vtk files default 0 This is unfortunately a bit confusing In the case of key sim 1 2 the system runs for nstep timesteps and in the case of non linear systems updates the matrices every nstride_NL steps Other solvers simply converge based on tol and itmax For linear problems nstep is not used for non linear nstep is the number of non linear iterations Page 34 of 63 ZINC 3 2 user manual NPL Report labels List of nvar labels for the variables being simulated Eg in a thermo electric simulation we might have labels T V tol itmax Used only when key_sim 3 4 5 6 tol is the convergence tolerance and itmax is the maximum number of iterations carried out by these linear solvers 5 2 2 Region specification blocks These have the form region i keyword N values matrix name If keyword is elements specify material properties of elements with region number i The matrix name C a or f is given and number of values N to be specified There then follows a list of N entries of form lt list of indices gt value C has 4 components so an entry in the list might be 1 1 1 1 0 31100E 11 which
35. apshot is indicaed in the file filename01 eps filename02 eps In the case key plot 1 these are graphs are generated by gnuplot corresponding to the scans requested filename01 emf filename02 emf In the case key plot 2 these are graphs are generated by gnuplot corresponding to the scans requested Page 53 of 63 NPL Report ZINC 3 2 user manual Page 54 of 63 ZINC 3 2 user manual NPL Report Bibliography 1 Field Precision Ltd PO Box 13595 Albuquerque New Mexico 87192 USA www fieldp com 2 MetaMesh Three dimensional Conformal Mesh generator Field Precision 2003 3 ASEN 5367 Advanced Finite Element Methods Carlos A Felippa Aerospace Engineering Sciences University of Colorado at Boulder www colorado edu 2006 Chapter 18 Page 55 of 63 NPL Report ZINC 3 2 user manual Page 56 of 63 ZINC 3 2 user manual NPL Report Appendix A Comsol s coefficient mode Comsol allows the user to specify PDEs in the form V CVu au y au f8 Vu f A 1 n CVu au 7 qu g h p Neumann A 2 hu r Dirichlet A 3 Here u u4 u2 where ui z y z etc are the independent variables to be solved for For example ui might be electrostatic potential and uz temperature as in Section 4 4 One must set the various components of C etc so that when is multiplied out we obtain the needed set of PDEs Here the meaning of grad and div is non standard For example with two variables we define Vu
36. ation area in the x direction This defines the logical mesh Each line segment is divided into intervals allowing variable meshing Has the form xmesh lt line segments gt end with each line segment on a separate line of the form x1 x2 dx Commands ymesh zmesh have the same form presmooth N Smooths the logical mesh using N smoothing steps This is only important when variable resolution is used in the logical mesh Default no smoothing axissmooth dir N Smooths along one direction dir only Dir is either x y or z N is the number of steps Default no axis smoothing smooth N Smooths the final mesh after part fitting has been accomplished N steps of relax ation default 10 format Format asciilbinary causes the mesh output file to be text file mtf or binary file mdf respectively 3 6 List of basic 3D parts These parts may be rotated shifted into position using rotate and shift commands They are listed in Table 3 1 Page 18 of 63 ZINC 3 2 user manual NPL Report Shape Fab parameters Description box Lx Ly Lz Centred at origin and extends Lx Lx along x etc sphere R Centred at origin with radius R cylinder RH Centred at origin with radius R and extends H 2 H 2 along z cone RH Hz Truncated cone along z with base at z 0 with radius R Apex at z H and truncated at z Hz ellipcyl RxRyH Cylinder along z with elliptical cross section extending x Rx Rx y Ry Ry ellipsoid Rx Ry Rz Ellipsoid given by
37. btain 5 PDEs 1 EN uk Ek Vk Val EP pu u i 1 2 3 2 J 1 c EOM up S Vg oV 0 jt GERUG ukj ejiVj Hij Vmj 0 4 35 yt To input these in ZINC we use the following C matrix omitting some superscripts for clarity Eli eis Cis Cig C12 Cia Cis Cia Cig em e21 31 en e51 esi C61 Cee Co5 Ce6 C62 C64 Co5 Ca Co3 16 26 36 eie 36 36 C51 C56 C55 C56 C52 C54 C55 CEA C53 15 25 35 ers C55 e35 C61 C66 C65 Cee Coz C64 Cos Cor C63 ere 26 36 C16 ek 36 C91 C26 C25 C26 C22 Co4 Co5 C24 Co3 12 22 632 eb e 33 C41 C46 C45 C46 C42 C44 Cas C44 Cas 14 24 34 C14 em 3 C51 C56 C55 C56 C52 C54 C55 C54 Co3 C15 X 25 635 ejs ei 35 C41 C46 C45 C46 C42 C44 Cas C44 Cas 14 ex 34 ey 3 C31 C36 C35 C36 C32 C34 C35 C34 Ca3 i3 23 33 el ek E33 e11 eis els Gig 12 ed 15 1a 13 Qj 012 0O13 e21 26 25 26 22 24 25 24 23 a21 022 023 31 36 35 36 32 34 35 34 33 Q31 Q32 033 eji ele ei eie i 14 eis er ei O11 021 31 H11 H12 H13 em e ekt ek en en e3 ei 33 os 022 O32 H H22 H23 31 e36 35 36 32 34 35 34 33 13 023 33 M31 H32 H33 4 36 where we use the matrix representation tensor 11 22 33 23 32 13 31 12 21 matrix 1 2 3 4 5 6 so that cj213 Cas etc Of c
38. current part and the specified part or region n This causes the mesh to conform to the surfaces rather than having a Page 17 of 63 NPL Report ZINC 3 2 user manual staircase appearance The edge command causes edge fitting to take place also If present tol determines the speed of relaxation onto the surface It is a number in the range 0 1 If omitted the default value is 0 9 is assumed coat Has the form coat reg regnew Finds all nodes at the interface between the current part and region reg These nodes are then given region number regnew rotate Has the form rotate x y z string By default rotate part about the x y and z axes in that order angles in degrees If string is present the order of rotation may be altered Eg xzy means rotate about x then about z then about y The order of rotation is important x y and z are Euler angles Rotation is performed before shifting shift shift x y z shift the part along the vector specified after rotation is complete protect Protects node region numbers in current part from being overwritten This is useful in filled parts whose nodes might be overwritten by open parts Since open parts are always processed after filled parts it is not possible to simply rearrange the parts order This only affects node not elements 3 5 List of global commands These commands must appear in the global section of the input file xmesh ymesh zmesh Specified line segments spanning the simul
39. e 12 epsi epsO eps2 2 eps0 Page 38 of 63 ZINC 3 2 user manual NPL Report thus setting up permittivities in various regions In the file zin file we could then have region 1 elements 3 values C 1 1 1 1 epsi 1 2 1 2 epsi 1 3 1 3 eps1 region 2 elements 3 values C 1 1 1 1 eps2 1212 eps2 13 1 3 eps2 The con file contains a series of lines of the form var value Constants may be defined in terms of pervious constants but not later ones Thus the following con file would be illegal epsi epsO epsO not yet defined eps2 2 eps0 eps0 8 854e 12 The usual expression rules apply for expressions in the constants file 5 5 Advanced non linear simulations For linear simulations each of the numbers specifying C a f q g is either a constant or evaluates to a constant OR depends only on x y z In non linear simulations one or more C a f q g numbers or Dirichlet boundary values depends on the solved for variables u1 etc through an expression These expressions allow simple non linearity but there is a more advanced technique when the C a f q g expressions become complicated perhaps requiring an actual computer program to generate In this case the user should enter a token beginning with e g copper stiffness instead of a number The token is passed through to functions Cfun afun ffun gfun qfun BCfun which the user must provide in file dll BCfun is used for Dirichlet boundary conditions i e for
40. e to the surface command in the part 2 block ZMESH then moves nodes so that they lie on the sphere creating a shape which more closely conforms to the sphere Without the surface command the elements would remain cuboid and the sphere would have the blocky staircase appearance shown in Figure B 3 a The final appearance and region number of each element is shown in Figure 3 3 b Note that the picture shows an inverted elemnent which would actually be fixed by ZMESH An inverted element has Page 13 of 63 NPL Report ZINC 3 2 user manual part 1 part 2 region 1 region 2 type box type sphere fab 111 fab 0 3 surface region 1 end region 1 end g region 2 WS SVA MX Y SSNSS SESSE ES 1 NN NX BASS Ws N WWW e D 1 1 1 1 1 1 a b c Figure 3 3 Meshing of two parts using the commands shown The second part sphere is inserted into the initial box part a Identification of element region numbers in original logical mesh b nodes are moved onto surface between the two regions Element region numbers shown Note that the element marked is not acceptable since it is inverted see text In practice ZMESH avoids inverted elements or at least gives a warning c Final node region numbers a Jacobian which changes sign across the element preventing the code from integrating correctly over the element See Theoretical Manual ZMESH d
41. econd order partial differential equations Examples of physics systems which can be solved include electrostatics magnetics elastic theory thermal fluctuation diffusion etc Further any combination of these physics theories can also be solved as well ZINC has been success fully used to solve piezoelectric elastic electric multiferroic elastic electric magnetic and fuel cells multiple component diffusion pressure variation A near infinity of other systems could also be solved including all the most common scenarios in electromangetics mechanics thermodynamics fluid flow diffusion and so on The reason for ZINC s generality is that it is fundamentally a mathematical rather than physics program ZINC solves equations and it is up to the user to tune those equations to correspond to the needed physics system This requires a certain mathematical skill and familiarity with the problem in hand However we believe that no FE code is a substitute for such knowledge computer modelling is a highly skilled process and cannot be done without skilled human input We ll see fully automated modelling the day we have lawyer less courtrooms and doctor less hospitals Nonetheless the level of skill required to use ZINC is not enormously high Anyone with a physics maths or engineering degree should have no difficulty following the step by step instructions in this manual If users don t wish to set up their own problems they can come to NPL for
42. ends on solution variables non linear Allowed operators include addition multiplication subtraction division exponentiation There are some restrictions on the size of expressions 1 The total string length of each expression is limited to 1000 characters including blank spaces 2 The total number of items in each expression is limited to 350 Here an item is a variable a constant an operator an open or close bracket a function like sin cos exp 3 The maximum number of variables is 1000 In practice these restrictions still allow highly complex equations If your expressions are getting more complex than this you should consider using a DLL to specify the expression See Section 5 5 There are some restrictions on the type of expressions for each specification 1 q g specifications and node specifications Dirichlet boundaries may only be in terms of variables not their derivatives This is because derivative quantities are not well defined on element boundaries or nodes 2 Initialisation expressions may only be in terms of x y z and constants 5 4 The constants file file con It is often convenient to define constants in the file con file These can easily be changed between simulation without getting into the details of the file zin file which also contains the physics of the system For instance in an electrostatic simulation we might have the following con file eps0 8 854
43. etermines whether elements are inverted by calculating the Jacobian If it is inverted ZMESH relaxes the lattice to attempt to fix the element even if that means having a less conforming mesh A chevron shaped element is inverted Nodes are also given region numbers as shown in Figure B 3 c This is in order to specify Dirichlet boundary conditions Section whereby field values are specified on particular nodes For example in an electrostatic problem we could designate region 2 nodes as having a fixed potential which would make the sphere into a perfectly conducting object The default region numbering of nodes in this example is shown in Figure 3 3 c all nodes surrounding an element are given the same region number as that element Thus after processing part 1 all nodes are designated region 1 After processing part 2 the elements within the sphere are renumberd region 2 and their surrounding nodes are renumbered region 2 also In particular the nodes at the interface between the two regions are set to region 2 since part 2 was processed last In some cases it is necessary to override this behaviour and give a different region number to the interface nodes This can be accomplished by use of the coat command as shown in Figure 3 4 a In this case while processing part 2 ZMESH gathers all nodes at the interface between this part and region 1 and numbers these as region 6 Another way to set node region numbers is to use open part
44. g V 1 L assuming constant L is defined in the file con file linescan 100 0 101 0 3 1 0 0 101 0 3 1 0 Vz creates a plot of 0V Oz which is the z component of electric field in this example planescan 2 0 0 1 0 1 0 1 0 1 0 40 40 amp 1 epsi 2 eps2 Vz Page 52 of 63 ZINC 3 2 user manual NPL Report creates a planescan in the plane y 0 0 with x 1 1 and z 1 1 A 40 x 40 grid will be generated The expression is equal to eps1 Vz in region 1 and eps2 Vz in region 2 Recalling that Vz is OV dz and assuming the constants eps1 and eps2 are the permittivities of regions 1 and 2 the expression is the z component of electric displacement field D field surfint 2 1 epsO Vx nx 4Vy ny Vz nz Integrates over the surface between regions 1 and 2 and calculates cok nds 6 1 In this case the electric field is evaluated on the region 1 side of the interface the second region specified and the unit normal points from region 2 to region 1 If region 1 is vacuum and region 2 is a fixed potential electrode region this integral will give the electric charge on the electrode 6 4 Zpp output files filename01 out filename02 out Output files corresponding to the scans in filename zpp in the order they were defined In the transient case all specified snapshots are output in each file each separated by a double blank line These files can be plotted with any graph plotter or spreadsheet The timestep for each sn
45. g a DLL can be used Function egual is described in Figure 5 2 set the permittivities to be constants like 1 0 or expressions like 1 2 V where for example V is the electrostatic potential In the latter case the problem would be non linear since the permittivities depend on the potentials being solved for Arbitrary expressions may be entered depending on the solution variables and their derivatives and or space position x y z For conveniance the user can also refer to constants in the con file see Section 5 4 which can be altered between simulations Thus we can change the shape of the system or its material properties without going into details within the main physics input file zin However sometimes a simple expression like 1 2 V will not be sufficient it may is necessary to do complex calculation with loops and branches to discover the material properties An extreme case might involve running a molecular dynamics code to discover the material property This code could easily be larger than ZINC itself ZINC can therefore optionally be made to link to arbitrary code Instead of setting 1 2 V the user writes several functions an example of which is shown in Figure This function and a few others like it is all that is expected from the user even in this advanced method of using ZINC Note that any programming language can be used provided it can be compiled into a Dynamic Link Library DLL Unlike OpenFOAM Z
46. has the form Page 15 of 63 NPL Report ZINC 3 2 user manual lt global commands gt region 1 elements 3 values C V x V x 8 854e 12 Vy V y 8 854e 12 V z V z 8 854e 12 region 2 elements 3 values C V x V x 1 7708e 11 V y V y 1 7708e 11 VzVz 1 7708e 11 region 3 nodes 1 value V 1 region 4 nodes 1 value V 0 Figure 3 5 Sample ZINC input file file zin corresponding to the setup of Figure 3 4 b shift x y z and causes the part to be shifted along the displacement specified 3 3 Neuman Boundaries So far we have discussed the creation of elements and nodes and their region numbers which are later associated with volumetric material properties and Neuman boundary conditions respec tively The other boundary condition supported by ZINC is the Neuman boundary condition Whereas Dirichlet boundaries fix the variables being solved for eg voltage temperature elastic displacement Neuman boundaries fix derivatives of these surface charge thermal flux traction respectively These quantities may be classified as fluxes or applied forces of some kind Thus fluxes are applied at boundaries which may be internal to the simulation or external ZMESH does not specify such surfaces explicitly rather surfaces exist between volumetric regions For example the curved surface in Figure B 4 b between region 1 and region 2 would be identified 1 2 giving an extra command in Figure surface 1 2 1 value q V V 1 0 surface 1 2
47. hed cube Cuboids are special cases of hexahedrons if the geometry is a laminar system for example it may be sufficient to use cuboid hexahedrons In general however ZMESH will distort the hexahedrons so as to conform to surfaces in the geometry specified ZMESH works by reading in the geometry specification from file file min and writing out file mtf which contains the shape and position of each element file mtf is just a text file whose format is described in Section B so you can write your own program to do the meshing if you want This may be useful in cases where the geometry consists of irregular shapes For example we had a project to model the stress strain of ferroelectric domains We wrote a program to convert the domain map output by a microscopic imaging device into the corresponding file mtf ZMESH would not have been helpful in this case since the shapes are irregular and better represented as a map rather than a series of primitive shapes like spheres and boxes ZMESHuses the same geometry specification format as MetaMesh a commercial meshing program available from Field Precision As such MetaMesh can be used in place of ZMESH if required Metamesh has many more features than ZMESH including a CAD front end and the ability to read stereo lithography and popular CAD files for geometry specification Although more basic ZMESH will do the job in most systems and at least it s free The user may want to try using ZMESH first
48. ial so the above expression is EP In functions cfun afun ffun qfun gfun ur i u dur i j Ou Ox The variables passed to the non linear functions are as follows label A string containing the token specified in the input file including the initial x y z The current spatial position given by reference to the meshing double precision ur Array of length nvar containing the current solution at x y z ur i u double precision dur Array of size dur nvar 3 so that dur i j Ou Ox at x y z double precision 28 byte reals Page 40 of 63 ZINC 3 2 user manual NPL Report int equal char s int length char t int i len1 len2 for i 0 i lt length i if s il break leni i for i 0 i lt length i if t i 22 NO break len2 i if leni len2 1 for i 0 i lt leni1 i if s i t i return 0 return 1 else return 0 Figure 5 2 A simple function to compare strings s fixed length length and t null terminated Page 41 of 63 NPL Report ZINC 3 2 user manual nvar Number of variables integer istep The current iteration step In transient problems the current time is istep tstep where tstep is described in Section 5 2 1 istep may be useful in static problems as well since the non linear routines can use it to find out when the ZINC matrices have been updated nx ny nz only available when forming q and g matrices The current outward surface unit normal poin
49. l global variables in file zin These options should only be used by developers or if you are feeling adventurous key_db 0 no debug info 1 write debug info to zinc out 2 write detailed debug information Create files showing shape of each element default 0 idmin idbmax jdbmin jdbmax kdbmin kdbmax range for elements specified by lower nodes to be written for debuging Only used when key db 2 key_Q 1 Build Q by node pairs seems to be faster 2 build Q by element does not implement Surface commands default 1 Page 63 of 63
50. le file min has the form global global commands end part 1 part commands end part 2 part commands end endfile The global commands specifies the logical mesh and various global variables which define the quality of the meshing The part commands define various shapes spheres cubes extrusions etc that make up the geometry needed Note that later parts overlap earlier ones so the order of parts is important The logical mesh is illustrated in Figure 3 2 it is a simple cuboid mesh defined by the global commands xmesh ymesh zmesh as illustrated in that figure The logical mesh defines the number of elements and nodes intersection of the lines shown in the simulation and also the extent of the simulation In Figure 3 2 for example the simulation stretches from 0 5 to 0 5 in all directions Note that the overall simulation area is always cuboid shaped However it is possible to model curved outer boundaries by setting the properties of an outer region to correspond to vacuum Distance units are not specified at this stage so the value 0 5 may be metres or angstroms In ZINC input file file zin it is possible to scale the geometry using a scale factor as required see Section The global commands xmesh has the form Page 12 of 63 ZINC 3 2 user manual NPL Report 0 5 0 1 0 1 x 0 5 as 599 o5 o1 0l 0 5 xmesh xmesh a 0 5 0
51. lectric dl1 and link it to the ZINC core 5 7 Zinc output files filename zls Describes specification of run including C a f q g values for each region and which nodes are fixed Also shows initial and final distribution of energy in different regions The program actually calculates energy in two different ways which should give the same answer For checking purposes this file lists how many times each element was used in forming the FE matrix Each element should be used 64 times filename zou Value of each variable at each node This can be read by ZPP in post processing The format is I J K variable number and value To continue another run where you left off copy this file to filename rst and set key_rdu 1 filenamexx vtk Snapshots in Paraview format These are output every nstride timesteps if key_export 1 In static runs only one vtk file is output at the end of the simulation Page 42 of 63 ZINC 3 2 user manual NPL Report function Cfun label x y z ur dur nvar istep character label integer nvar istep double precision Cfun x y z ur nvar dur nvar 3 end function Cfun function afun label x y z ur dur nvar istep character label integer nvar istep double precision afun x y z ur nvar dur nvar 3 end function afun function ffun label x y z ur dur nvar istep character label integer nvar istep double precision ffun x y z ur nvar dur nvar 3 end function ffun function qfun label x y z nx ny nz ur nvar i
52. msol both solved the problem and gave the same answer When the equation were not well formed both solvers failed to converge and terminated with errors In general the only way to see if a set of equations will solve nicely is to try solving them 1 1 Comparison to other general purpose FE programs As mentioned we have tested ZINC against Comsol quite extensively In Comsol equations can be set up in the so called coefficient mode the strong mode and the weak mode ZINC s operation mirrors Comsol s coefficient mode That is the coefficients in a set of partial differential equations are set to specify the required mathematical system A simulation run in ZINC can therefore be easily transfered to Comsol and vice versa However we have not implemented the strong and weak formulations because most physics problems are naturally formulated as differential equations It has been said that physics is the simply the study of differential equations The strong and weak formulations of Comsol are an alternative way of writing the laws of physics which however do not appear naturally in most areas of physics but involve reformulating problems using advanced mathematical techniques Above we ve said that it takes first year undergraduate skills to form the ZINC and Comsol coefficient mode equations but these weak and strong forms are more complex requiring at least PhD in mathematics or theoretical physics Given that most physical la
53. name zin filename con for simulation 2 Run ZINC 3 Prepare filename zpp for post processing scans 4 Run ZPP to generate scans through the data ZPP can automatically create graphs or these files can be plotted with a graph plotter or spreadsheet of the user s preference 5 Alternatively results can be output and viewed with Paraview Page 31 of 63 NPL Report ZINC 3 2 user manual Path DAMGC zincprog examples diele Input files Input dielectric zin Mesh file dielectric mtf Constants file dielectric con NL file No NL file Restartfile None initial condition supplied Output files Outputfile dielectic zou List file dielectric zls Status READY Open Bun Cancel Figure 5 1 Program ZINC If a different set of line plane scans is needed just update filename zpp and run ZPP again It is not necessary to run ZINC again if you simply want to see the data along a different direction The ZINC program is shown in Figure 5 1 The program allows the user to marshal and view the various input and output files Click open to select an input ZIN file You can view files using the view buttons Then run the simulation using run ZINC can also be run at the command line using zinc filename 5 1 Mesh definition file file mtf ZINC works with a 3 D structured mesh of hexahedrons squashed cuboids The strucured mesh has the same topology as a regular cubic grid so that no connection table is needed
54. nerally label the internal nodes the same as adjacent elements as it performs the mesh Nodes are indexed as 0 0 1 0 etc Node 2 1 is indicated in the figure The complete zinc mtf file would be 0 0 0 0 0 5 0 0 etc C ND HBOLUWND HOLWND HOLUWND HO OO UOOLONNDNVDNDEEE EE HOOOO PPP PP RP RPRPRPPRP RP OU OI CO OI DOOOORRFPRONNN OO WW W RegNo specifies the region number of the node in question RegUp specified the region number Page 59 of 63 NPL Report top nodes region 4 d p g RE region 1 region 1 region 1 region 2 region 2 region 2 Node 2 1 0 1 2 3 E ce bottom nodes region 5 Figure B 1 2 D analogue of ZINCmeshing ZINC 3 2 user manual of the element connected to this node in the positive I J and K for the 3 D case direction Note that elements which do not exists are labelled 0 region 1 elements 3 values C ld 11 1212 13 1 d 26 6 26 6 26 6 region 2 elements 4 values C 11 1 Te 6 region 3 elements 6 values C a HHA H PP Be Orr ND d HEHE HE He WWNWN Ee 4e 6 4e 6 4e 6 3 6e 6 3 2e 6 Te 6 Page 60 of 63 Assuming one variable the corresponding filename zin file would be something like ZINC 3 2 user manual region 4 nodes 1 value 1 1 0 region 5 nodes 1 value 1 2 0 Page 61 of 63 NPL Report NPL Report ZINC 3 2 user manual Page 62 of 63 ZINC 3 2 user manual NPL Report Appendix C Additiona
55. on dV The single parameter is region the region number to integrate over All calculations put their results into out files named after the simulation with a numerical subscript Thus file01 out file02 out etc Linescans and planescans produce data which can be plotted in the form of a graph and indeed these graphs will be generated in the form of EPS of EMF picture files if key_plot 1 2 The integration commands simply output the integral result in their output files and no picture is generated The interactive version of ZPP allows the user to view the graphs generated immediately but in any case the graphs are written to the simulation directory for the user to examine 6 2 Scan expressions Scan expressions basically have the same form as non linear expressions Section Expressions can depend on solved for variables the spatial position the unit normal surface intregration only and constants in the con file see Table 5 1 However it is also possible to use region dependent expressions of the form regi expri reg2 expr2 Here regi etc is a valid region number expri is the corresponding expression in the usual form Section Note that region expressions may not be nested Region expressions are introduced because different regions have different material properties and it is often necessary to chose the right one An expression should be provided for each region traversed during the scan or an error will result For example
56. ourse c is not to be confused with C the ZINC PDE matrix The C matrix above is such that 1 eui ua ure eki Vk ef Vau j 1 Beni usa ulk ekz V e Vo p V CVu EC ure exaj Vk eff Vou 4 37 1 eign usc 3 Kig V GV E lem u EE ONE ee dere Uj urg ajiV j GV Page 29 of 63 NPL Report ZINC 3 2 user manual Rearranging 41I gives V CVu f au 4 38 so that pw 0 0 00 0 p 0 00 a 0 0 p 2 00 4 39 0 0 0 00 0 0 0 00 and f pj gives the correct set of equations 4 35 It is easy to check that the Neumann boundary condition 4 2 with q g 0 corresponds physically to Oi 0 n4 Dj 0 n4 Dj zi 4 40 i e zero charge zero magnetic flux and zero traction at the boundaries These are good choices for an open boundary This example if quite complicated and the input file filename zin will be very long It is likely that the user will write a preprocessor program to generate this file Page 30 of 63 ZINC 3 2 user manual NPL Report Chapter 5 Zinc core solver ZINC has two basic input files a geometry file filename mtf specifying the system mesh and a materials file filename zin specifying material properties physics initial state bound ary conditions and convergence information There are three optional files a file containing constants filename con a restart file filename rst for specifying the initial state if no
57. s as shown in Figure 3 4 b Here we have used two additional parts 3 and 4 These define surfaces at the top and of the simulation whose nodes are set to region 3 and region 4 respectively In this example assuming an electrostatic problem it would be possible to excite the system by putting 1 V on region 3 nodes top Dirichlet boundary and zero volts on region 4 nodes bottom Dirichlet boundary This would create an electric field on the simulation In elastic problems this would correspond Page 14 of 63 ZINC 3 2 user manual NPL Report part 2 region 2 type sphere fab 0 3 part 3 part 4 region 3 region 4 surface region 1 type boundyup type boundydn coat 16 end end end Figure 3 4 a Use of the coat command to change the node region numbers at an interface b use of open parts boundyup and boundydn to change the node region numbers to clamped displacements at the top and bottom of the simulation and so on Figure 3 5 shows the corresponding file zin for Figure 3 4 set up as an electrostatic prob lem This file will be described in more detail in Section 5 2 but for now note how region 1 and region 2 elements are given permittivity values of eg permittivity of free space 8 854 x 10 12 F m and 2eg Also region 3 and region 4 nodes are set to voltage values 1 V and 0 V respec tively Region 1 and 2 nodes are not set at all so these nodes the interior nodes in the problem are allo
58. s built up using an arbitrary number of line or arc segments which must form a closed 2 d shape in the x y plane The type command has the form Page 19 of 63 NPL Report Part point boundxup boundxdn boundyup boundydn boundzup boundzdn line arc circle rectangle disk plate bubble fab params xyz none none none none none none L R Omin Omaa R Lx Ly R Lx Ly R ZINC 3 2 user manual Description Creates a point at x y z plate comprising the upper x plane of the simulation plate comprising the lower x plane of the simulation plate comprising the upper y plane of the simulation plate comprising the lower y plane of the simulation plate comprising the upper z plane of the simulation plate comprising the lower z plane of the simulation line from 0 0 L 2 to 0 0 L 2 Arc in z 0 plane centred at origin from angle Omin to Omin radius R 0 0 is the x axis Angles in degrees open circle centred at origin radius R Open rectangle in z 0 from Lx Lx in x and Ly Ly in y As circle but filled As rectangle but filled Spherical surface centred at origin radius R Table 3 2 List of open parts type extrusion sidefit Vector 1 S SE Vector 2 S SE end Each vector describes a line or arc in the x y plane and is of the form L A xstart ystart xend yend xcentre ycentre Here L means line and A means arc The xcentre ycentre specification is only required for arcs
59. ser does not need to recompile ZINC Page 7 of 63 NPL Report ZINC 3 2 user manual 2 1 Zinc install directory In the install directory you will find the directory examples This contains several worked examples which are described in the Tutorial Manual Also there is a mesh_examples directory which contains various meshing examples min files You should try some of these out in ZMESH Other useful files include nltemplate f90 nltemplate c which contain empty user speci fied functions for non linear simulations If you are running an advanced non linear simulation you can create your non linear functions by copying these templates and filling in the functions provided If you are running ZINC from another system like Python or Matlab it may be preferable to run ZINC and ZPP indirectly using the provided batch files zincrun zpprun These short batch files simply ensure that the ZINC ZPP command prompts stay open should an error occur Otherwise you will not be able to read the error before the box closes Useage zincrun file zpprun file 2 2 Uninstalling zinc Simply use the Unistall icon in the Start Menu If you install a newer version of ZINC you should uninstall the old version first Note everything in the ZINC install directory will be deleted so you should not store simulation runs in the ZINC install directory 2 3 Linux and Mac While ZINC has been written for Windows computers it should run perfectly on Linux
60. space When the system is meshed it is divided into a structured mesh of hexahedral elements each of which is assigned a region number The mesh is specified in the input file filename mtf see Section 5 1 The materials file Page 25 of 63 NPL Report ZINC 3 2 user manual filename zin specifies C a f q g values for each region thus specifying material properties such as permittivity in the above example for each element The values of C a f q g components may be set to constant values or set to vary depending on the local values of the u vector For example they might be temperature dependent in a thermal problem In this case the problem becomes non linear Section Comsol implements a similar set of equations these are described in Appendix A A problem set in ZINC may easily be converted to Comsol and vice versa 4 2 Mode 2 Transient problems ZINC can solve transient problems of the form Ou E V CVu au f 4 7 n CVu qu g Neumann 4 8 or in component format Qus BE Cong j Qgk Uy fs S 1 2 ia N 4 9 NjCijklUk d gikuk gi Neumann i 1 N 4 10 Note that the boundary conditions are the same as in the static case Again one can set up either linear or non linear problems 4 3 Static and steady state problems The static mode of ZINC can be made to solve steady state problems as well Consider the problem where the u variables depend on time as u r t Re u r exp jwt 4 11 In that
61. step character label integer nvar istep double precision qfun x y z nx ny nz ur nvar end function qfun function gfun label x y z nx ny nz ur nvar istep character label integer nvar istep double precision gfun x y z nx ny nz ur nvar end function gfun function BCfun label x y z ur nvar istep character label integer nvar istep double precision BCfun x y z ur nvar end function BCfun function scanfun label x y z nx ny nz ur dur nvar character label integer nvar double precision scanfun x y z nx ny nz ur nvar dur nvar 3 end function scanfun Figure 5 3 Template for Fortran non linear functions file d11 Page 43 of 63 NPL Report ZINC 3 2 user manual double cfun char label double x double y double z double ur 1 double dur 3 1 int nvar int istep int length 1 double afun char label double x double y double z double ur 1 double dur 3 1 int nvar int istep int length 1 double ffun char label double x double y double z double ur 1 double dur 3 1 int nvar int istep int length 1 T double qfun char label double x double y double z double nx double ny double nz double ur 1 int nvar int istep int length double gfun char label double x double y double z double nx double ny double nz double ur 1 int nvar int istep int length double BCfun char label double x double y double z double ur 1 int nvar int
62. t supplied in filename zin see key_rdu and filename d1l which contains non linear functions if needed Regarding the restart file to continue from a previous run copy filename zou to filename rst In this case you will need to set key rdu 1 in file filename zin ZINC outputs two major files filename zou filename zls The output file filename zou contains the value of each of the variables solved for at each node in static steady state problems this file contains just the final snapshot in transient problems it contains several intermediate snapshots showing the time evolution see nstride below filename zls contains the full set of input data and information on the convergence etc of the run The information in filename zou is not directly useable for graph plotting Accordingly a post processor has been prepared ZPP which reads filename zou as prepared by ZINC and outputs a series of scans through the data see Chapter 6 ZINC also optionally exports files in ParaView format see key_export below Paraview is a powerful and free post processor that allows 3 D visualization of the simulation results For static runs just one paraview file filename vtk is output corresponding to the final state In transient runs snapshots are output every nstride timesteps These are written to files filenamexx vtk where zz is 1 2 3 The normal procedure for using ZINC is 1 Prepare filename mtf generated by ZMESH or another program file
63. ting from the first specified region to the second eg for a surface begin ning surface 1 2 3 values g the normal provided would be from region 1 to region 2 double precision The full template the for the non linear functions in file dll is shown in Figure 5 3 The function scanfun is used by ZPP which is described in Chapter 6 The full template for C non linear functions is given in Figure 5 4 Note that derivative quantities are available for forming C a f matrices but not for q g matrices since derivatives are not well defined on element boundaries On the other hand only qfun gfun have access to the local surface normal since this concept is only meaningful on a surface 5 6 Examples of zinc input files Refering to the simple sphere in a cube geometry shown in Figure 8 4 Figure 5 5 shows a simple linear system to solve an electrostatic problem with 1 V applied across the system The inner sphere has rel permittivity 2 and the outer area rel permittivity 1 T he initial voltage is 0 V In the second example Figure 5 6 the permittivity depends on the electric field as 1 E E0 xe In this example we have chosen a better guess for the initial voltage a linear variation between 0 at z h 2 say and 1 V at z h 2 on the top and bottom plates In the third example Figure the exact same simulation is carried out using non linear functions in dielectric dll In this case ZINC will detect the presence of die
64. tion in space y y position in space Z z position in space nx x component of unit normal used for q g only ny y component of unit normal used for q g only nz z component of unit normal used for q g only ul first variable value u2 second variable value ulx derivative of first variable with respect to x uly derivative of first variable with respect to y ulz derivative of first variable with respect to z u2x derivative of second variable with respect to x u2y derivative of second variable with respect to y u2z derivative of second variable with respect to z Table 5 1 Built in variables which can be used in ZINC expressions If the user defines the names of variables these will be used in place of u1 u2 etc The user may also reference constants in the con file 5 2 4 Initial state specification It is also necessary to specify the initial state of the system For example in a thermo electric problem with labels T V we could have init T 1 V 0 which sets the initial temperature to 1 and the initial voltage to zero It is also possible to set the initial state from a previous ZINCrun by setting key_rdu 1 In this case a file rst must be present Of course the user could write a program to generate his own initial state 5 3 Expressions Instead of entering a literal constant like 1 0 it is possible in C a f q g nodal and ini tial specifications to enter mathematical expressions The expression may depend on
65. ton is deactivated for integrals since these do not generate a graph Again individual files can be examined using the view buttons ZPP allows complex views to be taken through the data and can also perform integrations You can plot the raw solved for variables their derivatives or any function of these according to the usual rules for expressions Section However there is a new conditional expression type described in Section 6 2 If you want to plot an additional view just add it to the input file and re run ZPP There is no need to re run ZINC itself just to get a different line scan A basic view of the simulation output can also be obtained using ZMESH Section B I 6 1 Zpp input files ZPP reads filename zin filename mtf filename con just as ZINC does It also reads its own file filename zpp which has the form lt global commands gt calculation 1 calculation 2 etc The global commands are ftol tolerance for finding points in elements Must be less then 1 typically order 1e 3 This is used when the program tries to evaluate variable values at a point x y z e g in line plane scans If the point lies on the interface between elements there is ambiguity and this tolerance is needed to find a value default 0 001 key_plot 0 do not plot 1 automatically create Encapsulated Postscript files eps using gnuplot which must be installed 2 automatically create Enhanced Metafiles emf Calculations have the form
66. wed to vary in order to solve the electrostatic equations By the end of the part fitting process all elements and nodes should be given an region number If this is not the case ZMESH will report an error It is common practice for the first part to be a box part which covers the whole simulation area Other parts are then inserted into this part We have so far described most of the part commands type region fab surface coat The other two commands are shift and rotate allowing the part to be shifted and rotated into the required position Parts are conceptually constructed at the origin 0 0 0 with major axes generally along z y z Thus the box part is constructed with principle axes along the x y z directions It is centred at the origin and its extents are given by the 3 numbers following the fab fabricate command The meaning of the fab parameters depends on the part and is given in Table 3 1 The rotation command has the form rotate rx ry rz string If string is absent then a rotation is performed about the global x axis then the y axis then the z axis by the angle given in degrees If a different order is required this can be given using the string Eg using yzx would cause rotation to occur about y then z then x Since these are Euler angles rotation order is important Furthermore rotation is performed before the object is shifted irrespective of the order of commands in the part block The shift command
67. ws are not written in this way the strong and weak forms seem both confusing and unnecessary However many users of Comsol never come across these core formulations but are instead encouraged to combine areas of physics to get the system they need For example a piezo electric problem you would combine the elastic module with the electrostatic module We strongly believe that this paint by numbers approach to physics is extremely dangerous and the user is almost certain to end up simulating something different from what they intended This method is therefore not supported in ZINC Another general purpose FE package we have some experience of is OpenFOAM Whereas Comsol is very much a point and click style program requiring the user to enter data in a large number of dialog boxes openFOAM takes the opposite approach requiring the user to re write large portions of code and recompile openFOAM each time a new physics system is attempted specifically the user rewrites the main loop of the code and calls a large number of built in functions the operation of which the user must learn in detail This provides enormous flexibility in that the user can alter the fundamental operation of OpenFOAM but it also makes it very difficult for people to use the package without specialist help To use openFOAM you need in addition to maths and physics knowledge considerable understanding of C the language openFOAM is written in and you must
68. y according to nstrideNL In key_sim 3 4 5 6 it is the number of times the elements are e nreg Number of regions in file Zinc mtf should contain the same number of regions tstep Time step for transient problems key_sim 1 Static or steady state run 2 transient run 3 static run with GMRES solver di agonally scaled 4 GMRES solver Incomplete LU factorisation 5 Biconjugate Gradient solver Diagonally scaled 6 Biconjugate Gradient solver Incomplete LU factorisation Optional variables These are omega key_rdu scale nstride nstrideNL labels Some other control variables which are only of interest for debugging and code development are listed in Appendix C omega Successive over relaxation parameter Less than 1 of order 0 1 default 0 1 key_rdu 0 Start from initial condition in the init section of filename zin 1 read filename rst to define initial state If you want to continue from a pervious run copy filename zou to filename rst If the previous simulation was transient filename zou will consist of several snapshots In this case ZINC automatically reads the last one of these from filename rst and continues from that Default 0 scale factor to multiply distances found in zinc mtf to put them in metres or whatever dis tance unit in implied in the PDEs that have been set E g if the dimensions in the zinc mtf file are mm set scale to 0 001 Default 1 nstride Steps between output of convergence information
69. z R y R z R 1 torus Rr R is major radius and r is minor radius Plane of the hole is normal to z helix RrH Hw Circular cross section helix radius r which wraps around a z directed cylinder height H radius R centred at the origin Hw is the height along z attained during 1 revolution trapezoid LxU LxD Ly Lz Prism along z with trapezoidal cross section Full width in x is LxU top and LxD bottom Full width in y and z given by Ly Lz Table 3 1 List of 3 D parts and the meaning of the fab command 3 7 List of open parts These parts have no volume so elements are not effected The only result is to change the region numbers of nodes These parts are 0 1 or 2 D and may be rotated and shifted into position using rotate and shift commands Note that boundxup etc do not need fab commands and are unaffected by rotate and shift The parts are listed in Table 3 2 3 8 Advanced parts ZMESH supports 4 types of advanced parts which allow more general shapes to be created extrusion turning transition and neon Whereas the simple parts above have a single line type command E g type sphere these parts have a multi line type command of the form type extrusion turning transition neon lt data lines gt end Apart from this the part specification is the same and region surface coat shift rotate commands may be used as usual 3 8 1 Extrusion An extrusion is a prism shape along the z axis The cross section i

Download Pdf Manuals

image

Related Search

Related Contents

Gigaset S675ip  GUIDE PERSONNEL - nscinternationale  DE Gebrauchsanweisung GB Instructions for use FR Mode d`emploi  KD-S611  TSM800 User`s Manual  Operating instructions Monitor FR-1 / FR-1N  Hand Writing Recognition Software Installation  to IC670ALG620 PDF for more information.    Samsung DVD-HD755 User's Manual  

Copyright © All rights reserved.
Failed to retrieve file