Day 1
Day 1
Day 1
Contents
Day1
Introduction to COMSOL Multiphysics GUI
Modeling Procedure Example: H Cell
Hands on #1
Model Definitions
Hands on #2
Geometry
Hands on #3
Meshing
Hands on #4
Solving
Hands on #5
Contents
Day 2
Results
Hands on #6
Solvers
Infinite Element and PML (Perfectly Matched Layer)
Hands on #9
CHEMICAL
REACTION
STRUCTURAL
MECHANICS
MODULE
ENGINEERING
MODULE
ACOUSTICS
MODULE
BATTERIES &
FUEL CELLS
MODULE
HEAT
MEMS
MODULE
TRANSFER
MODULE
PLASMA
MODULE
EARTH SCIENCE
MODULE
CFD
MODULE
OPTIMIZATION
MODULE
LIVELINK FOR
SOLIDWORKS
LIVELINK FOR
AUTODESK
INVENTOR
LIVELINK FOR
PRO/ENGINEER
CAD IMPORT
MODULE
MATERIAL
LIBRARY
LIVELINK FOR
MATLAB
System requirements
COMSOL recommends:
64-bit computer, 4-16GB RAM to start, leave room to expand
Good graphics card (NVIDIA 512 MB appears to work well)
Comments
Does not require CAD Import Module
STL (.stl)
VRML (.vrml, .vrl)
Parasolid (.x_t, .xmt_txt, .x_b,
.xmt_bin)
CAD Livelinks
Comments
Requires AC/DC Module, RF Module
or MEMS Module
GDS (.gdx)
SPICE (.cir)
NASA file (.dat)
CHEMKIN (.dat)
Settings window:
Actively changes based on the branch
selected in the Model Builder.
Input and change model settings related
to physics, mesh, results, etc.
Provides a numbered
list of geometry,
domains, boundaries,
edges or points.
Left Mouse
Button (LMB)
Right Mouse
Button (RMB)
Physics
Laminar Flow
Convection & Diffusion
H-Cell Setup
Geometry:
Import >CAD > H_cell_GEOM_3D
Global definitions (Import these files)
Parameters> Load> H_cell_constants
Boundary Conditions:
Defaults to Wall, No-Slip
Boundaries 2 & 8: (Inlets)
22
20
P=0
2
P = p0
Diffusion to D
Velocity: Velocity field
c=0
8
20
Boundary Conditions:
Defaults to Insulation
Boundary 2: Concentration c=c0
Boundary 8: Concentration c=0
Boundaries 20 & 22: Outflow
c = c0
eta = eta*(1+alpha*c^2)
Parametric Solver
Study 1
Compute
Postprocessing
Slice plot for concentration
Model Definitions
Global Definitions
Global Definitions can be used to define:
Parameters
Variables
Functions
Local Definitions
Model 1 > Definitions
Only valid within the model
Variables
Selection
View
View 1
View 2
Contact Pairs
Identity
Pair
Functions
Right-click on
Model > Definitions
Pulse
Step
Triangle
wave
Square Wave
Arbitrary Interpolation
P1
T
Set up this type of function:
*flc2hs(T-T0,dT)
P1 (p1-P2)*flc2hs(T-T0,dT)
Step function
T0
dT
k_S
k_L
rho_S
rho_L
Cp_S
Cp_L
LH_melting
0[degC]
0.5
2.31[W/m/K]
0.613[W/m/K]
918[kg/m^3]
997[kg/m^3]
2052[J/kg/K]
4179[J/kg/K]
333[kJ/kg]
Ice
Water
Freezing point
Mushy zone width, in K
Thermal conductivity of ice
Thermal conductivity of water
Density of ice
Density of water
Specific heat of ice
Specific heat of water
Latent heat of melting of H20
Phase 2
See model file:
Example_discontinuity
Phase 1
T
Transition, or
mushy zone
Probes
Domain Probe
Boundary Probe
Edge Probe
Probes - Example
Model Couplings
Mapping operators
Source
Coupling
Operator
Destination
Integration
Average
Maximum
Minimum
Tx
w
T
wx
Ty
w
T
wy
Tz
TTx
Tt
w
T
wz
I nn T
T
w
T
wt
w 2 w 2T
Txytt
2
wt wxwy
If L = 0.3 m, d = 20 mm
OPEN
BOTH
ENDS
OPEN
ONE
END
Add Valves
Top
Open
Bottom
Closed
472 Hz
712 Hz
Geometry
3D Primitives
Workplane
Embeds the 2D
geometries in the 3D area
Extrude
Revolve
Chamfer (only in 2D)
Fillet (only in 2D)
Split
Delete
Boolean Operations
Union
Intersection
Difference
Compose
Transforms
Array
Copy
Mirror
Move
Rotate
Scale
Conversions
Convert to Solid
Convert to Surface
Convert to Curve
Convert to Point
Convert to COMSOL
Live-Links
COMSOL
Advantages Everything is in one native
file format
The CAD will be well-suited
for analysis
Geometry sequencing
Geometry parameterization
Union
Default option to be used in most cases
Combines all geometry into one finalized geometry
Assembly
Detached geometry
Required for identity and contact pairs
Allows you to mesh adjoining boundaries independently
Imprints create a copy of adjacent boundaries
Inspect each of
these cases
Geometry exercise
Example 1:
Five steps
Example 2:
Four steps
Example 3:
Ten steps
Example 4:
Ten steps
Actual part
89
Use symmetry
Use symmetry planes
Model on reduced geometry
- Less mesh
- Less memory
- Less time
Consider using:
- 2D if there is no variation in
geometry and solution out-of-plane
- 2D axisymmetry if there is no
variation in geometry and solution
about an axis of revolution
Materials
User-defined Materials
Model 1 > Materials >
Material
Call a function
1-D Plot
Temperature-dependent expression
Magnetostatics no
current
Symmetry and
antisymmetry boundaries
Automatic calculation of
magnetostatic force
Stationary problem
Mesh
Mesh parameters
Element size
Growth rate
Resolution
Why do we mesh?
10
1.E+00
1st order
Error
1.E-02
1.E-04
3rd
order
2nd order
1.E-06
Elements per Chord
1.000
0.995
0.990
0
Refinement Iteration
Numerical Error
k = exp(u) N/m
p=2N
u
The error can be minimized by
taking many iterations, but a
computer usually cannot find
an exact answer for two
reasons:
f (u)
1) Numerical approximations,
usolution 0.853
u
Discretization Error
10 1st order elements
uexact-umodel
Mesh error
decreases with
more elements
Numerical error is an inherent
property of computers, which
cannot exactly represent numbers.
It increases with more elements.
Total Error
1.E-02
1.E-04
1.E-06
1.E-08
1.E-10
1
10
100
1000
10000
100000
1000000
n=2
n=1
n=1
n=20
Insulated
quarter
cylinder
with heat
generation
Explore
2D mesh sequence
See model file:
Example_mesh_2D_sequence
Boundary Layer
Stretching factor: Ratio between 2 consecutive
Boundary layers.
Thickness adjustment: Thickness of first layer. Automatic
Means 1/20th of the local domain element height.
Tetrahedral
Most general, any 3D part
can be tet meshed. Use
this as much as possible.
Hexahedral
Prismatic
Hybrid mesh
Custom
Mesh parameters
Resolution of curvature
radius=0.5
Resolution=1
Resolution=5
Puts approximately the specified number
of elements into the narrow regions
Triangle
Quad
Mapped
Boundary Layer
3) Tetrahedral mesh
current
carrying
wire
23,000 elements
2,500 elements
186k d.o.f.
83K d.o.f.
MEMS model
Advanced structural
mechanics problem
Prestressed structure
Geometric nonlinearity
Mapped and Swept mesh
Parametric study
Solving
Solving
Solving
Type
Variables
Solving
Adaptive Meshing
Stationary or Eigenvalue problems
Evaluates residual, calculates local error
and refines mesh based on local error.
Solving