Professional Documents
Culture Documents
MMS-V2 Manual
Version 2 of the book software (May 1st, 2010)
Contents
1 MMS.zip will be continuously updated...............................................................................3
2 CAELinux ..........................................................................................................................3
2.1 CAELinux 2008, CAELinux 2009, and CAELinux 2010.............................................3
2.2 What you should know about CAELinux 2009...........................................................3
2.2.1 Login, password, root commands, terminals.....................................................3
2.2.2 Keyboard ............................................................................................................3
2.2.3 Automatic login....................................................................................................4
2.3 New ideas regarding CAELinux and the book software ............................................4
2.3.1 Option 1: Using no CAELinux..............................................................................4
2.3.2 Option 2: Using CAELinux based on the Live-DVD............................................4
2.3.3 Option 3: Using CAELinux based on a hard-disk installation.............................4
2.3.4 Option 4: Using "virtualized" CAELinux ..............................................................5
2.3.4.1 Hardware requirements...............................................................................5
2.3.4.2 Step 1: Download and installation of VirtualBox..........................................5
2.3.4.3 Step 2: Download CAELinux 2009...............................................................5
2.3.4.4 Step 3: Installation of CAELinux in a virtual machine..................................5
2.3.4.5 Step 4: Installing Guest Additions and Folder Sharing................................5
2.4 Installation of missing R packages.............................................................................6
2.5 Use Syntax Highlighting..............................................................................................7
3 CFD, structural mechanics etc. using OpenFOAM ...........................................................8
3.1 Outstanding role of OpenFOAM.................................................................................8
3.2 Advantage of using OpenFOAM in CAELinux ...........................................................8
3.3 Example......................................................................................................................8
3.3.1 Flow problem.......................................................................................................8
3.3.2 Geometry construction and mesh generation in Salome-Meca..........................9
3.3.3 Solution of the flow problem in OpenFOAM......................................................14
3.3.4 Postprocessing in ParaView..............................................................................17
4 Design of Experiments ....................................................................................................20
4.1 R-Commander plugin for DOE.................................................................................20
4.2 Workaround based on VirtualBox and Ubuntu.........................................................20
4.3 Optimal and latin hypercube designs etc.................................................................20
5 Comments on book programs and examples..................................................................21
5.1 Salome-Meca sample session..................................................................................21
5.2 Backward facing step example.................................................................................21
5.3 Parameter estimation programs...............................................................................22
5.4 International csv format............................................................................................22
5.5 Using the Maxima programs.....................................................................................23
5.5.1 Starting wxMaxima in CAELinux 2009..............................................................23
5.5.2 Start Maxima programs using load() instead of batch()....................................23
5.5.3 Directories in the Maxima programs.................................................................23
5.5.4 Simplified initialization command using MMS.mac...........................................23
6 Other useful software.......................................................................................................24
6.1 Available in CAELinux 2009......................................................................................24
6.1.1 GMSH................................................................................................................24
6.1.2 JabRef...............................................................................................................24
6.1.3 Kile.....................................................................................................................24
6.2 Not available in CAELinux 2009...............................................................................24
6.2.1 g3data................................................................................................................24
MMS-V2 Manual
-2 -
2 CAELinux
2.1 CAELinux 2008, CAELinux 2009, and CAELinux 2010
The book was published based on CAELinux 2008 which is still available at caelinux.com.
The current book software version MMS-V2 is based on CAELinux 2009 which can be
obtained at caelinux.com.
Jol Cugnoni, the inventor of CAELinux, is currently working on a new version CAELinux
2010 which will appear this year at caelinux.com. CAELinux 2010 will include the newest
versions of all software packages discussed in the book, and later versions of MMS.zip will
of course refer to CAELinux 2010.
However, you don't need to wait for CAELinux 2010 since almost everything works
perfectly well in CAELinux 2009. The only little problem is that a useful new R-Commander
plugin for DOE that appeared this year doesn't work on the CAELinux 2009 platform since
a newer R version is needed, but there is a workaround, see section 4.
MMS-V2 Manual
-3 -
MMS-V2 Manual
-4 -
The procedure described below needs a processor with "hardware virtualization" support.
For many Intel processors, this is indicated by a "VT" in the name of the processor.
Usually, it is no problem to find out about the "hardware virtualization" capabilities of a
particular processor if you perform a web search for the name of the processor.
If you encounter "hardware virtualization" related problems in the procedure described
below, it may be necessary to activate virtualization in the BIOS. Usually, the BIOS setup
can be accessed by something like typing F2 during booting.
2.3.4.2 Step 1: Download and installation of VirtualBox
VirtualBox can be downloaded at virtualbox.org. You will find there an open-source version
VirtualBox-OSE and a non-open-source version. VirtualBox-OSE can e.g. be comfortably
used on platforms such as OpenSUSE (my own platform). However, since there is no
Windows binary available at virtualbox.org, Windows users may have to use the nonopen-source version (or look for appropriate VirtualBox-OSE binaries in the web). The
non-open-source version is based on a license that requires "that you use the Product on
the same Host Computer where you installed it yourself and that no more than one client
connect to that Host Computer at a time for the purpose of displaying Guest Computers
remotely", see virtualbox.org for details.
2.3.4.3 Step 2: Download CAELinux 2009
Load CAELinux 2009 from caelinux.com. Store the iso-file caelinux2009.iso on your
harddisk (you don't need a DVD for this procedure).
2.3.4.4 Step 3: Installation of CAELinux in a virtual machine
Start VirtualBox and generate a new virtual machine for 64-bit-Ubuntu (CAELinux 2009 is
based on 64-bit-Ubuntu). When you start that virtual machine for the first time, choose
caelinux2009.iso as the installation device. Follow the CAELinux installation instructions in
the VirtualBox window (e.g., you must enter INSTALL in the first screen).
2.3.4.5 Step 4: Installing Guest Additions and Folder Sharing
It is a good idea to install the "Guest Additions" of the VirtualBox software, e.g. for folder
sharing, but also for mouse integration and optimized graphics, see the VirtualBox help
pages for details. Use the following menu option to install the "Guest Additions":
MMS-V2 Manual
-5 -
to install the rgl and simecol packages, where I have assumed that the book software is
located in /home/caelinux/virtualbox/mms (see section 2.3.4). Then type
install.packages()
and after choosing a server in your region, install the following packages:
Rcmdr, odesolve, fUtilities, agricolae, deSolve
Note: rgl and simecol cannot be installed via install.packages() from the Internet since the
newest versions of these packages require a newer version of R than the one that is
installed within CAELinux 2009. Hence, an older version from the R-packages directory of
MMS must be installed here. If you should encounter similar problems with the other
packages, you can use the same procedure as it was used above for the rgl and simecol
packages.
MMS-V2 Manual
-6 -
MMS-V2 Manual
-7 -
3.3 Example
The fastest way to get acquainted with a software like OpenFOAM is to work with
examples, so a worked-out example is described in the next sections. It is a flow problem,
but almost the same procedure is also used when OpenFOAM is applied e.g. to problems
from structural mechanics. See chapter 4 of the book for any details on numerical methods
for PDE's.
3.3.1 Flow problem
Assume a geometry consisting of a
large cylinder with a small cylinder on
top like this:
Assume that a fluid enters this volume
with 1 m/s through the bottom surface
of the big cylinder, and that the fluid
leaves the system through the top
surface of the small cylinder. The
resulting flow pattern will now be
computed using OpenFOAM in
CAELinux 2009.
MMS-V2 Manual
-8 -
4. Generate a second cylinder the same way, but with a radius of 0.5 (0.5 m, since SI units
are used).
MMS-V2 Manual
-9 -
7. Choose
New Entity Group Create
to define the boundaries for the fluid flow simulation.
MMS-V2 Manual
-10 -
7.1. Definition of the outlet boundary where the fluid leaves the system:
Use the
mouse to
highlight the
top surface.
MMS-V2 Manual
-11 -
7.3 Definition of the inlet boundary where the fluid enters the system:
inlet
8. Start the mesh module using the drop down list from step 2 above.
9. Choose
Mesh Create Mesh
and apply the following settings:
Note: Press the button in the Hypothesis line to open up the "Hypothesis Construction"
window.
MMS-V2 Manual
-12 -
10. Click on "Mesh" in the Object Browser, right click to open the context menu below, then
choose Compute (or do the same thing in the Mesh menu).
MMS-V2 Manual
-13 -
12. To integrate the boundaries of the flow problem into the mesh file, choose
Mesh Create Groups from Geometry
and then apply the following selections:
MMS-V2 Manual
-14 -
MMS-V2 Manual
-15 -
We use the following settings here (which you can easily modify to solve other flow
problems):
7. Velocity Boundary conditions are imposed by editing the "U" file in cavity/0 similar to
step 6. We use the following settings:
Note that we are imposing 1 m/s inflow in the positive z direction as required by the
problem described above.
8. Now the flow problem is solved by typing
icoFoam
in the OpenFOAM terminal.
MMS-V2 Manual
-16 -
3. Use the color bar button and drop down list immediately below the File menu to color
the figure according to pressure levels:
MMS-V2 Manual
-17 -
After a little editing of the background color and the color bar options, this gives:
MMS-V2 Manual
-18 -
5. If you want to see the arrows in the original geometry, reactivate the first plot using the
top eye symbol in the "Pipeline Browser". After a little editing of the properties of the first
plot you may arrive at something like this:
Note that the "opacity" option has been used here to make the geometry transparent.
MMS-V2 Manual
-19 -
4 Design of Experiments
4.1 R-Commander plugin for DOE
A very useful package for design of experiments (DOE) has been published this year on rproject.org. It is called "RcmdrPlugin.DoE", and it can be downloaded via the CRAN link on
r-project.org in the "contributed packages" section. Unfortunately, it cannot be used in
CAELinux 2009 without larger modifications since the R version in CAELinux is too old. In
CAELinux 2010, however, you will be able to install this package as described in section
2.4. Until CAELinux 2010 will appear, we recommend the workaround described below.
Note: Examples of using this package will be provided in the next version of
MMS.zip based on CAELinux 2010.
-20 -
MMS-V2 Manual
-21 -
Here, the nonlinear function in line 214 (and its definition in another program part) has
been changed. It now includes all parameters that are estimated in the programs
ODEFitEx1.r, ODEFitEx2.r, and ODEFitEx3.r. The advantage of this procedure lies in the
fact that ODEFitEx1.r and ODEFitEx2.r can now be derived very easily from ODEFitEx3.r
just by editing the start vector in line 219 which determines the parameters that are to be
estimated. Note that the part of the programs that stores the result of the nls-functions
must also be adapted if the parameters to be estimated are changed. In ODEFitEx3.r, this
in done in the following lines:
In your own parameter estimation procedure, the advantage of this new procedure is that
you have to define the nonlinear function only once, including all parameter values that
you may want to estimate in its parameter list. Then you can decide about the parameters
that are actually estimated just by a simple editing of the start vector as described above.
MMS-V2 Manual
-22 -
MMS-V2 Manual
-23 -
MMS-V2 Manual
-24 -