GMSH Guideline
GMSH Guideline
GMSH Guideline
VERSION 0.32
http://calculix.de/
http://calculixforwin.blogspot.com/
http://www.calculixforwin.com/
Table of Contents
Installation notes.........................................................................................................................................2
General Notes About Meshers and Mesh Formats.....................................................................................4
Settings for GMSH.....................................................................................................................................5
Units in CalculiX........................................................................................................................................6
How to get started. Learning Curve For CalculiX......................................................................................8
How CalculiX Works..................................................................................................................................9
Main Principles. How To Create Model And Apply Boundary Conditions..............................................13
Quality Of Mesh.......................................................................................................................................14
Free Structural Software...........................................................................................................................19
Installation notes
CalculiX Launcher is the collection of portable software, that
includes:
CalculiX CCX (finite element solver);
CalculiX CGX (preprocessor and postprocessor for CCX);
GMSH (simple parametric 3d program and mesher);
Mesh converters from UNV, MSH, Abaqus INP, VOL formats to CCX INP
format.
All programs (binaries) are placed under ../bin subfolder. Some
of them are statically linked or require some common libraries (Open
GL and GTK2 for linux), that makes launcher very portable.
There is no special installation procedure.
Xterm terminal emulator should be installed in the system
(Launcher uses it by default). Some linux distributions don't have
xterm by default, so install it, as usual (in ubuntu 'sudo aptget
install xterm')
Unzip archive to any place, you want.
There is one important note, that the full path to the launcher
folder should not contain spaces (blanks). For example:
/home/JohnSmith/Desktop/CL32linux
and
/home/John_Smith/Desktop/CL32linux
are OK,
but
/home/John Smith/Desktop/CL32linux
is not.
(To see or copy the full path in Ubuntu, press “Ctrl+L” in the active
folder)
VERY IMPORTANT NOTE:
DON'T USE BLANKS, CYRILLIC AND ETC SYMBOLS IN THE NAMES OF FILES,
FOLDERS, WHEN YOU WORK WITH LAUNCHER. FILES WON'T BE RECOGNIZED
PROPERLY.
Second step is making all binaries executable. This is the
standard procedure for linux systems. At first – make executable the
file, called “Launcher”, then go to the ../bin folder and do the same
with all files.
Select binary file with mouse, then make right click and select
“Properties” and go to “Permissions” tab. Allow this file to run as
program (see Fig. 1) below. Do it with all files!
Also you may cd.. to the /bin folder and type
chmod 777 *
It will mark all files as executable.
Fig. 1 – Making file executable.
Launcher comes with simple text editor for CalculiX (with code
highlighting and snippets for boundary conditions), but you may use
any other popular text and code editors, for example gedit, scite and
etc. Run launcher, go to menu > Settings and fill in 4 th line from
above.
Default terminal emulator is xterm, but you can install and use
xfce4terminal. In ubuntu install it with:
sudo aptget install xfce4terminal
Run launcher, go to menu > Settings and type 'xfce4terminal' in
3d line from above.
Most preferable configuration of hardware and operational system
is 64 bit. It gives you ability to solve large problems without
limitation by memory. If you want calculation to be performed in a
parallel way (for multicores processors), create environment
variables OMP_NUM_THREADS with value equal to number of cores.
To setup environment variable permanently in ubuntu, open terminal
emulator and type:
sudo gedit ~/.pam_environment
and then create two lines in the text file:
OMP_NUM_THREADS=2
export OMP_NUM_THREADS
You can create this file
After relogin the calculation will run a parallel way (you
will be able to see it in output for CCX).
For more information read CCX help 'How to perform CalculiX
calculations in parallel'.
You can find more information about the Calculix Launcher at
this page:
http://calculixforwin.blogspot.com/2015/05/calculixlauncher.html
Abaqus INP can be converted to CalculiX INP with pythion scripts
and with using free converter, coded by Sergey Prool (Kharkiv,
Ukraine);
MSH format (with python script).
The most powerful CAD and Mesh package is SalomePlatform.
Then you may get it at the:
http://www.codeaster.org/V2/spip.php?article303
http://www.alneos.com/downloads/salomemecalinux32en
http://www.salomeplatform.org/
Read more about that and see videolessons at here:
http://calculixforwin.blogspot.com/2015/12/salomeplatformand
salomemeca.html
Output mesh format from Salome is UNV format. It works with
'unical' converter for many types of mesh. Also you may try to use
combination: MED format > GMSH > CalculiX.
Netgen mesh generator (for 3d models with merged bodies)
usually can be installed from Synaptic Package Manager. It is also
available in caelinux2013 distribution. Netgen have export to the
abaqus INP and VOL format. VOL is supported natively in CalculiX CGX
(read CGX help for that, how to deal with CAD models) and with python
script, provided by dip28 (3d tetras).
In any case you may need to open converted file and correct
some output manually. For example output element type for unical
converter can be changed from S8R (multilayer shells for elastic and
plastic analysis) to CPS8 (plane stress).
To play with mesh conversion you can use files in the
'.../samples/Converters' folder.
Run GMSH from Launcher menu, go to Tools>Options>General
Advanced (see Fig. 2).
Setup text editor for text file (if you want to use parametric
features in future). On Fig. 2 gedit is selected as default Ubuntu
editor. When you start GMSH, it creates file 'untilted.geo' for
writing all your actions in the command mode. You can use this
feature to make parametric models with variables. But sometimes, if
you will make a mistake in the code, GMSH will crash at start. In
this case you can remember the default place for 'untilted.geo' and
delete (or rename it), to restore normal work.
Fig. 2 – GMSH Options
Units in CalculiX.
CalculiX is oldschool classical FEA code, and it doesn't have any certain
«units» inside.
It means, that you can use any units, whatever you want, but the units should
be compatible with each other.
The most simple way — to use SI system, just make sure that your model scaled
properly and all linear dimensions of your mesh are in meters.
When you provide some input for the program, all values can be
dimensionless or have some units. It is absolutely the same when you
use any abstract formulas.
For example the deflection of a beam of span “L”, under the
distributed load “q”, with cross section moment of inertia equal to
“J” and Young's Modulus of material equal to “E” is given by the
formula (bending part of full deflection).
q L4
y=
8 EJ
There are no units that come with this kind of formulas, but you may
vary with them, staying within one system for each type of value.
Let's calculate the rectangular steel beam 1x0.75 in (width=1'',
height=3/4''), with span equal to 3 ft for distributed load equal to
18 lb/ft:
L = 3 ft = 3*12= 36 in;
18lb
q=18 lb/ft = =1.5 lb/in;
12in
Young's Modulus E= 29,000,000 lb/in3;
1∗0.753
J = bh3/12 = =0.03516 in4;
12
4
1.5∗36
y= =0.309 in (or 7.8mm, or 0.0078 m)
8∗29000000∗0.03516
Now let's do the same with SI system:
L=0.0254*36=0.914 m;
q=1.5 lb/in = 4.448 (N/lb)*1.5 lb /(0.0254 m) = 262.7 N/m;
E=29*106 lb/in3=2*1011 Pa;
262.7∗0.9144
y= 11 −8
=0.0078 m
8∗2∗10 ∗1.463∗10
in4 can be converted to m4 using simple proportion:
1 in —> 0.0254 m;
1 in4 —> (0.0254)4 m4 = 4.162e7 m4 ;
0.03516 in4 => 4.162e7*0.03516 = 1.463e8 m4 .
When you will calculate this beam in CalculiX CCX, make sure that the mesh is
properly scaled in «inches» and apply Young's modulus 29e6 psi at the
*ELASTIC card.
It is little bit not so easy, when you are making modal analysis, because
there is the difference in «poundforce» and «pound mass» in terms of
Newton's law definitions (F=ma).
When using imperial units in CalculiX, the typical material card will be (for
steel):
*MATERIAL,NAME=Steel
*ELASTIC
2.9000E+07,0.3
*DENSITY
7.3500E04
Table 1 — Input data for mild steel, depend on unit system and units for
linear dimension (mesh)
Units for mesh,
meters inch ft mm
to be scaled
Young's Modulus
2e11 2.9e7 4.18e9 2e5
(or stress
Pa psi psf N/mm2= MPa
units)
Poisson Ratio 0.3 0.3 0.3 0.3
Density for 7850 7.35e4 15.25 7.85e9
modal analysis kg/m3 lbf/in3 lbf/ft3 Ns²/mm4
7850 0.284 490.5 7.85e9
Density
kg/m3 lbm/in3 lbm/ft3 Ns²/mm4
Gravity 9.8 386.4 32.17 9800
Acceleration m/s2 in/s2 ft/s2 mm/s2
Thermal 1.2e5 6.67e6 6.67e6 1.2e5
Expansion 1/degC 1/degF 1/degF 1/degK
60.5
Thermal 8.09e4 9.71e3 60.5
W/(m*degC)
Conductivity BTU/s in F BTU/s in F N/(s*degK)
I have good experience in You need some initial understanding of
FEA software but with using how console applications work. Go to
modern interfaces and CAD. “How CalculiX Works” section.
Text file interface in too This is pretty much style of how people
hard for me. Nothing were dealing with old DOS and UNIX apps,
appears when I double click even they were commercial and modern for
on program. their time.
I don't have experience Go to “Main Principles. How To Create
with FEA software, but I Model And Apply Boundary Conditions”
know physics of my problem.
I am not familiar with FEA, Probably CalculiX is not the program you
but I want to calculate really need.
barn and check stress in You can exploit your native redneck's
the girder. intuition, what is needed even for
professionals, when they are taking
final decision, what is good and what is
not applicable.
Also, there are many free templates and
web services for you. Go to section
“Free Structural Software”
The ways to learn CalculiX are:
1) Read help files and learn examples.
2) See the video lessons:
https://www.youtube.com/user/calculix09/videos
3) Solve your own problems and verification examples.
4) Learn GMSH and SalomePlatform.
CalculiX includes two independent programs: CCX is solver console
application with text file interface, CGX is prepostprocessor
with command and graphical user interface.
Visually CCX includes binary executable file and some libraries (dll
files at Windows, stored at the same folder with ccx.exe). When
running it reads input file (usually have .INP or .inp extension),
recognize data, starting from numbers and coordinates of nodes under
*NODE card, elements, groups (sets) and finally boundary conditions
and specific instructions within *STEP card.
For example, you have text file test.inp, with following text inside.
**Node numbers and coordinates
*NODE,NSET=Nall
1, 0, 0,
2, 1.5, 0,
3, 0, 1,
**Truss elements, type T3D2 (valid for CCX >2.11)
*ELEMENT,TYPE=T3D2,ELSET=EAll
1, 1, 2
2, 2, 3
**Material properties, Young's Modulus E=2e11 Pa, Poisson ratio=.3
*MATERIAL,NAME=STEEL
*ELASTIC
2e11,.3
**Cross section of each truss element, Area=0.01
*SOLID SECTION,ELSET=EAll,MATERIAL=STEEL
1e2
**Define nodal set for supports
*nset,NSET=support
1,
3
**Fix nodes of set in all three directions (X,Y,Z)
*BOUNDARY
support,1,3
*STEP
*STATIC
**Apply load 1e5 N on node #2 opposite to Y direction (2)
*CLOAD
2,2,1e5
**Request for output
**Reactions in DAT text file
*NODE PRINT,nset=support
RF
**Deflection and stress in FRD file for CGX
*NODE FILE,OUTPUT=3D
U
*EL FILE
S
*END STEP
This is simple bracket of two elements, you can draw it (starting
from nodes) on sheet of paper.
It has 3 nodes and two truss elements. In CGX preprocessor it looks
like shown on picture below (after entering commands “plus ea all”
and “plus na all”).
Fig.3
Let's save this file at some folder, also called working folder and
run solver in any terminal emulator (in Windows it will be standard
cmd application)
At the beginning type “cd path” to get into working folder with
stored CCX executable (diamond icon on picture below) and then type
ccx test
If ccx executable is placed outside, you have to type path to ccx
instead of ccx. Finally you will see some output and message “Job is
finished”
In the beginning we had only 2 files: ccx and test.inp, but after
calculation many other files has been created (by ccx). Two of them
are most interesting: test.dat – is text file with reaction forces
(requested by *NODE PRINT card) and test.frd – also text file, but
not very readable. This file is used for postprocessor and can be
run by CGX
path_to_cgx_exe v test.frd
Fig. 4 – Files, created by CCX
Fig. 5 – Deflection in CalculiX CGX (postprocessor)
Main Principles. How To Create Model And Apply Boundary
Conditions
In the example above, the model has been created manually in
text editor. Practically it is not possible, when you have complex
model with many elements. But before calculation you should obtain
the same kind of text input file. You can place some statements and
cards outside input file (in the other files). In this case you have
to add reference to the additional files:
*INCLUDE, INPUT=Mesh_1_OUT.inp
where Mesh_1_OUT.inp is the file, placed at the same folder.
Usually most complex part of preprocessing is creating mesh and
sets (groups) for boundary conditions. It can be done in CGX, GMSH.
SalomePlatform, Netgen or any other (free or commercial)
preprocessor.
CalculiX CGX has capabilities of CAD program, what means, that
you have ability to create CAD model, with points, lines, faces,
volumes (bodies) and mesh it. It has very efficient mesher for
creating strucured mesh, such as in example on official website:
http://calculix.de/fw05.html
http://calculix.de/fw05lav.html
http://calculix.de/fw05lat.html
Very detailed examples provided by Prof. Martin Kraska:
https://github.com/mkraska/CalculiXExamples
For people who completely spoiled by modern graphical
interfaces you can learn very detailed guide, created by Jeff Baylor.
http://www.bconverged.com/content/calculix/doc/GettingStarted.pdf
SalomePlatform is most powerful opensource CAD and mesher.
You can learn it, using youtube lessons.
Initially it is native linux software, but now has ports to
Windows (not recommended due to many bugs). More advanced version of
SalomePlatform, called Salome_MECA is for linux only, and it has
direct connection with Code_Aster, industrial class of FEA program.
The main steps of creating the mesh in both programs are:
1. Create CAD model or import it from any free or commercial software
(using STEP or IGES formats).
2. Prepare CAD model for meshing (scale it, make some treatment to
remove degenerated entities, apply partition operation (Boolean
fragments in GMSH) to obtain monolithic mesh for coincident bodies.
3. Create groups by selection of entities (points, lines, faces,
bodies).
4. Setup meshing options and parameters and mesh it.
5. Check mesh quality (aspect ratio, Jacobian for curved parts of
model), refine it (remesh) if needed.
6. Export created mesh using UNV, MSH or INP type of mesh format. In
SalomePlatform you have to pull groups from Geometry to Mesh
module .
7. Use converter to obtain mesh format compatible with CalculiX.
Finally you can open mesh in CalculiX CGX in preprocessor mode,
check it and apply some boundary conditions using 'send' card:
path_to_cgx_exe c mesh.INP
Quality Of Mesh
There is important practical question: how fine the mesh should
be for certain task?
It depends on type of problem and what are you actually looking
for. The goal of static calculation is investigation of stress state.
Any practical model has stress concentrators with high stress values
and singularity points where maximal stress is infinite value by
theory (in numerical analysis it will grow along with mesh
refinement). Also any weld seam has many welding defects (sharp
stress concentrators) and these are also singularity points, which
cannot be investigated based on stress values. This thing called
local stress state and it is interesting only in terms of fatigue
analysis for cyclic loading (usually > 20,000 cycles in the
definition of AISC manual). Many technical codes provide stress
limits for general stress state (it is also called “fiber stress”).
Investigation of general stress state is subject of structural
mechanics. For example beam under the bending has max. stress, that
can be calculated by formula “Max. bending moment”/”Section
Modulus”=M/S. It will give you fiber stress in outer fibers. This
stress is important in terms of structural capacity. If you will
drill little hole in the flange on the beam, maximal (local) stress
will be about 3 times more, than fiber, but it won't affect capacity
(only max number of cycles in terms of fatigue calculation, if the
stress is positive in the tensioned side of beam). When you're
looking for local stress state, you should make fine mesh to obtain
correct results.
Fig. 6 Rough 3d tetrahedral mesh: max displacement 5.35e3 inch
Stress distribution shown on picture below.
Fig. 7 Fine 3d tetrahedral mesh (2 elements per thickness): max
displacement 5.58e3 inch. Difference is about 4% with rough meshing
(not critical in most applications)
Stress distribution is similar to rough mesh. Maximal stress is in
singularity point for this model and vary with mesh quality
Fig. 8 Structured C3D20 type mesh: max displacement 5.41e3 inch.
Frame3dd
Free opensource software for static and dynamic structural analysis
of 2D and 3D frames and trusses with elastic and geometric stiffness.
http://frame3dd.sourceforge.net/
calc4fem
Opensource LibreOffice template for static structural analysis of 2D
frames and trusses with collection of custom basic functions for
manipulation of results.
https://sourceforge.net/projects/calc4fem/
z88Aurora
General purpose FEA software with user interface (partly opensorce,
freeware for commercial use)
https://en.z88.de/
Framework
Structural software for 2D and 3D frames (for Windows, but works with
winehq)
http://members.ziggo.nl/wolsink/
Online databases with collection of spreadsheets.
https://www.engineersedge.com
http://www.steeltools.org/home
Online services (CAD+CAE)
http://feacluster.com/calculix.php
http://www.alneos.com/en
https://www.simscale.com/
https://www.onshape.com/