Home

MMGen2D_M_elliptic 2D elliptic and algebraic Mesh

image

Contents

1. MMGen2D_M_ elliptic 2D elliptic and algebraic Mesh Generator V1 1 User s Manual Simone Marras simone marras gmail com September 2010 Contents 1 2 Introduction Installation 2 1 External libraries 2 2 The Makefile Execution Input Files 4 1 Input Parameters File 4 2 Structure of the Input Files Output Files 5 1 Output Mesh File Mathematical fundamentals behind MMesh2D 6 1 The elliptic solver 6 2 TFI transfinite interpolation 6 3 Vertical distribution of nodes in domains with topography 6 4 The vertical coordinate system 1 Introduction This is a short guide to the use of MMGen2D a 2D structured mesh generator for general simply connected domains but thought specifically for different vertical distributions in mountain problems It can generate quadrilaterals QUAD or triangles TRI using a Transfinit Interpolation TFT or an elliptic solver elliptic To avoid node overlapping the elliptic method is the best option in the current version of the code as shown in Figure Figure 1 TFI left vs Elliptic The source code is written in C commented throughout and can be easily modified or enhanced by the user s own functions I wrote this code for my own purposes but tried to write it in such a way that it could be re usable or changed by other users The code is free and can be modified and redistributed under the GNU GENERAL PUBLIC LICE
2. NSE The visit__writer library to write the visualization output file is included with the pack age It was written by Hank Childs at the Lawrence Livermore National Laboratory for the visualization software VisIt 6 and writes grids and data into the Visualization ToolKit format VTK The license of this library is reproduced in the header of the li brary itself and in the function wrt2plotfile c that calls it The dynamic allocation of the arrays is done on a 1 index base through functions from the library nrutil c This function is part of the NR library and is can be freely redis tributed The NR library is a numerical library that comes with the successful volume Numerical Recipes in C the Art of Scientific Computing 3 2 Installation The installation is standard on UNIX machines and it was installed free of problems on a Mac OS X 10 5 4 with gcc Version 4 0 1 and on Ubuntu Linux 8 10 with gcc Version 4 3 2 However with this version of gcc you may encounter a warning on the definition of some strings from the library visit__writer c Ignore the warning because it will not affect the correct execution of the program Follow the steps below for installation and go to 3 for executing 1 gt gt cd path to MMGen2D_M 2 gt gt cd src gt gt make clean not necessary but suggested if you previously built the code on another computer gt gt make MMGen2D_M a should now be in the src dir gt gt cd path to your
3. cal coordinate system The o coordinate system based on height 1 the smooth level vertical SLEVE coordi nates of 4 and a modified version of the hybrid pressure based system introduced by 5 were used as vertical coordinates to test the impact that different degrees of distorsion of the elements above the topography have on the solution Gal Chen and Sommerville With this transformation the topography features mapped in the computational grid decay linearly with height The transformation o a z z from the physical space x z as defined above to the space of the transformed vertical coordinate o has the form z h x ar a 1 oe H 1 that inverted gives yields the backward mapping from the sigma vertical coordinates into the original x y space as z x o h x o0 2 a2 Me 2 SLEVE coordinates To overcome the drawbacks of the o transformation over steep topographies e g incipient singularity of the Jacobian and its implications the SLEVE mapping now identified by is such that the vertical decay of the terrain characteristics reflected on the vertical coordinate depends on the scales of the topography and is not the same if different topographies are mapped In other words given a topographic chain this can be obtained by the composition of a large and small scale variation e g a Gaussian terrain perturbed by a wave like function Through this solution the vertical distorsion due to the underlying terrain is co
4. np files Execute as follows OonRFWNR gt gt MMGen2D_M a input_file 7 Two files should be written msh and vtk 8 Verify the output by visualization of the vtk out file 4 Input Files To run this software there is the need for one input file that must be in the working directory at the time of execution it is called the Input_meshparam inp and is described in 4 2 However there may also be the need for a second file that must be inside the working directory only if defined in the inp This file described in and with extension nc or dat or tzt is a file containing the height data of the real topography to be meshed This file is only used if entry TOPOGRAPHY Type in Input_meshparam inp is set to one of the following ones NCDF for NetCDF or DTE for Digital Terrain Elevation Data 4 1 Input Parameters File The default input file that comes with this version is called Input_meshparam inp It is a text file whose entries are identified by numbers and keywords as explained in 4 2 Every change in the structure of the input file e g order of the lines inside the file addition of new entries etc must be done accordingly in the function that reads this file READ_INPUT c Do not ever change the order of the lines inside the input file unless you modify also the function that reads it 4 2 Structure of the Input Files The input file has the structure represented below where the blue string
5. ntrolled from bottom to top by means of two parameters s in equation 3 The mapping is done through two successive steps first the topography h x is split into its large and small scale functions Asmau and hjarge and second hsma and hiarge are combined with the decay factors _ sinh H s bi G ened 3 to give the inverse mapping 2 i 1 Here defines the vertical coordinate in the same way of in equation 1 we called it differently to avoid confusion about the two transformations The combination of s and s2 drive the invertibility condition of the Jacobian See Schar et al for more on this Modified Simmons and Burridge That of 5 is basically a combination of the two methods described above Their mapping in fact uses the same vertical coordinate o and combines the topography h x and the height of the domain through two functionals a o and b a whose values are properly tabled and such that the the mapping is given by z o Ha o h x b o 5 The modified version of 5 that is used next was also studied in 4 and apart from only having one only control parameter s the structure of the inverse mapping is fully analogue to equation 4 in that it results sinh H o s aE 6 z x o 0 h z The resulting vertical grids are exemplified in Fig 2 Figure 2 From left to right o hybrid SLEVE multiblock Shading indicates the degree of skewness of the element
6. on top is the header of the file the keywords in red identify the name of the variable whose value is assigned after the the values blue strings are the only elements that can be changed by the user A slash indicates the options that can be used In green each entry is explained Note the colors are used here for the sake of illustration but the real input a text file without colors INPUT_FILE inp PROBLEM name swan closine square agnesi schar END_PROBLEM PROBLEM_DEFINITION Space_dimensions 3 Meshing scheme TFI elliptic SLEVE HYBRID SIGMA Element_types HEXA WEDGE Number_blocks 1 nnodesx 73 0 nnodesy 60 0 nnodesz 30 0 PERIODICX off PERIODICY off END_PROBLEM_DEFINITION BDY_FILE in_swan in_closine in_square in_agnesi in_schar END_INPUT_FILE inp 5 Output Files Two output files are generated one for visualization and one as input initialization file for the solver developed by the user The plotting file is written in the VTK format by the function wrt2VTK_unstr c This function uses the library developed by Hank Childs as part of VisIt 6 a visu alization software developed at the Lawrence Livermore National Laboratory See the copyright notice at http www llnl gov visit copyright html for the redistribution of this library The vtk output file can be open for visualization by any VTK reader such as VisIt or Para View 2 5 1 Output Mesh File The mesh file that is generated contain
7. s References 1 T Gal Chen and R Somerville On the use of a coordinate transformation for the solution of the navier stokes equations J Comp Phys 17 209 228 1975 2 ParaView Sandia National Laboratories Kitware Inc http www paraview org 3 W H Press S A Teukolsky W T Vetterling and B P Flannery Numerical Recipes in C The Art of Scientific Computing Cambridge University Press 2nd edition 1992 4 oo C Schar D Leuenberger O Fuhrer D Luthic and C Girard A new terrain following vertical coordinate formulation for atmospheric prediction models Mon Weather Rev 130 2459 2480 2002 5 a A Simmons and D Burridge An energy and angular momentum conserving vertical finite difference scheme and hybrid vertical coordinates Mon Wea Rev 109 758 766 1981 6 VISIT Lawrence Livermore National Laboratory https wci lInl gov codes visit
8. s the list of node coordinates x y z and the connectivity matrix as depicted below The first column here in blue identifies the element or coordinate numbers The connectivity between the keywords ELEMENTS and END ELEMENT will have 9 columns for hexahedral elements 1 column to identify the element index first column and 8 columns with the connectivity nodes Mesh msh file for hexahedral elements ELEMENTS 1 1 2 399 398 157 611 108 807 2 5 7 242 2 250 350 98 105 3 4 8 6 3 640 125 11 197 4 7 9 8 4 END_ELEMENTS COORDINATES 1 0 0000 10 0000 0 0000 5 0000 5 0000 10 0000 5 0000 5 0000 0 0000 0 0000 10 0000 10 0000 5 0000 0 0000 10 0000 5 0000 10 0000 0 0000 OAN OOF WD aOwWwrFrRrOoOeWONO OrFOOOF OO 0 END_COORDINATES 6 Mathematical fundamentals behind MMesh2D 6 1 The elliptic solver 6 2 TFI transfinite interpolation 6 3 Vertical distribution of nodes in domains with topography Given a proper analytical definition y x x y ER Tmin STL Imar 0 lt y lt Hdomain and y C1 as the lower surface of a quadrangular and regular domain 2 in R2 we decompose 2 by means of non overlapping conformal quadrilaterals and triangles K such that Ne Q Kr e 1 Being h the characteristic size of element K for quadrilaterals we let h correspond to the longest edge of element e while for triangles it is defined as the length of the side that satisfies a proper property of regularity for the mesh 6 4 The verti
9. working directory gt gt ln s path to MMGen2D_M src MMGen2D_M a w Noa 2 1 External libraries MMesh2D can be compiled and run without the use of any external libraries other than nrutil if topography is not read from a Network Common Data Form NetCDF file Otherwise if the input topography comes from a netcdf the NCDF library must be installed and correctly linked Download it from www unidata ucar edu software netcdf and install it on your system first edit the makefile in order to link to it see below and add define lt netcdf h gt to myinclude h 2 2 The Makefile The makefile is standard and straightforward to edit If using the netcdf library simply make sure that it is properly linked according to the point of installation on your machine By default the linking including that to netcdf is done as EXE OBJS LD CFLAGS L usr include lm lnetcdf OBJS o EXE where EXE LD CFLAGS and OBJS are defined at the top of makefile 3 Execution It is extremely easy to run the code after compilation All parameters are passed through 2 simple inout files Input_meshparam inp and mountain_parameters inp They are de scribed in 4 2 Have a copy or a link of the exec MMGen2D_M a in the working directory Have your inp files ready inside the working directory gt gt cd path to working directory Open the inp files and change the entries After modification save and close the i

Download Pdf Manuals

image

Related Search

Related Contents

congratulations!!  Amazon Leather Cover  BD SENSORS Aufsteckanzeige PA 430 - TRI  Hotpoint Cooktop CIA 641 C S User's Manual      QAD 2008 Enterprise Applications - Enterprise Edition User Guide  M Series合成機キャンペーンカタログはこちらからダウンロード出来ます。  (dépliant keeper 2 plis.pub)  "取扱説明書"  

Copyright © All rights reserved.
Failed to retrieve file