Meshing with COMSOL Multiphysics 4 - Michelsen · PDF file• Automatic mesh generation...

36
Meshing with COMSOL Multiphysics 4.3a General Introduction © 2012 COMSOL. All rights reserved.

Transcript of Meshing with COMSOL Multiphysics 4 - Michelsen · PDF file• Automatic mesh generation...

Page 1: Meshing with COMSOL Multiphysics 4 - Michelsen · PDF file• Automatic mesh generation adapted to the physics settings in the model • Tuned for – Fluid flow – Plasma – General

Meshing with

COMSOL Multiphysics 4.3a

General Introduction

© 2012 COMSOL. All rights reserved.

Page 2: Meshing with COMSOL Multiphysics 4 - Michelsen · PDF file• Automatic mesh generation adapted to the physics settings in the model • Tuned for – Fluid flow – Plasma – General

• Meshing Techniques

• Mesh Elements

• Creating Meshes

• Importing Meshes

• Virtual Geometry and Mesh Control Operations

• Mesh Adaptation During Solving

Contents

Page 3: Meshing with COMSOL Multiphysics 4 - Michelsen · PDF file• Automatic mesh generation adapted to the physics settings in the model • Tuned for – Fluid flow – Plasma – General

Meshing Techniques

Page 4: Meshing with COMSOL Multiphysics 4 - Michelsen · PDF file• Automatic mesh generation adapted to the physics settings in the model • Tuned for – Fluid flow – Plasma – General

• Automatic mesh generation adapted to the physics settings in the model

• Tuned for – Fluid flow

– Plasma

– General physics

Model of an ICP reactor created with the Plasma Module

Physics-Controlled Meshing

Page 5: Meshing with COMSOL Multiphysics 4 - Michelsen · PDF file• Automatic mesh generation adapted to the physics settings in the model • Tuned for – Fluid flow – Plasma – General

• Nine predefined mesh size settings

ranging from ”Extremely fine” to

”Extremely coarse”

• Starting point for manual mesh

generation

ICP reactor geometry meshed

with “Extra Fine” setting

ICP reactor geometry meshed

with “Extra Coarse” setting

Physics-Controlled Meshing

Page 6: Meshing with COMSOL Multiphysics 4 - Michelsen · PDF file• Automatic mesh generation adapted to the physics settings in the model • Tuned for – Fluid flow – Plasma – General

• Manually add mesh operations to

generate a mesh

• Mesh operations are saved in a

meshing sequence

• Several meshing sequences may be

saved in a model

• Nine predefined mesh size settings

• Manual control over mesh size

User-Controlled Meshing

Page 7: Meshing with COMSOL Multiphysics 4 - Michelsen · PDF file• Automatic mesh generation adapted to the physics settings in the model • Tuned for – Fluid flow – Plasma – General

• Add, delete, disable, move, or edit

mesh operations

• Mesh operations can be

parameterized – Use expressions with variables for mesh size

parameters

• Enables automatic regeneration of

mesh for geometric parametric sweeps

The Meshing Sequence

Page 8: Meshing with COMSOL Multiphysics 4 - Michelsen · PDF file• Automatic mesh generation adapted to the physics settings in the model • Tuned for – Fluid flow – Plasma – General

Mesh Elements

Page 9: Meshing with COMSOL Multiphysics 4 - Michelsen · PDF file• Automatic mesh generation adapted to the physics settings in the model • Tuned for – Fluid flow – Plasma – General

Triangles

Quadrilaterals

Tetrahedrons Hexahedrons

Prisms Pyramids

2D and 3D Elements

Page 10: Meshing with COMSOL Multiphysics 4 - Michelsen · PDF file• Automatic mesh generation adapted to the physics settings in the model • Tuned for – Fluid flow – Plasma – General

Creating Meshes

Page 11: Meshing with COMSOL Multiphysics 4 - Michelsen · PDF file• Automatic mesh generation adapted to the physics settings in the model • Tuned for – Fluid flow – Plasma – General

• Generate triangular, quadrilateral, or

tetrahedral meshes

• Robustness ensured by automatic or

manual choice of Delaunay and

advancing front triangulation methods

• Fully automatic meshing with 9

predefined mesh size parameters

• Manual adjustment of mesh size

parameters

Meshed geometry of a

continuous velocity (CV) joint.

The model is courtesy of Fabio Gatelli, Metelli S.p.A., Italy

Creating Unstructured Meshes

Page 12: Meshing with COMSOL Multiphysics 4 - Michelsen · PDF file• Automatic mesh generation adapted to the physics settings in the model • Tuned for – Fluid flow – Plasma – General

• Maximum element size

• Minimum element size

• Curvature

• Element growth

• Resolution of narrow regions

• Explicit sizing on edges

Element Size Control

Page 13: Meshing with COMSOL Multiphysics 4 - Michelsen · PDF file• Automatic mesh generation adapted to the physics settings in the model • Tuned for – Fluid flow – Plasma – General

Handling Small Features

• Built-in detection for small features

and narrow regions in geometry

• Automatic element size adjustment to

small features, narrow regions and

curved boundaries

• Detected edges and faces are

highlighted in the geometry and can be

used as input for further CAD

defeaturing or virtual geometry

operations

Page 14: Meshing with COMSOL Multiphysics 4 - Michelsen · PDF file• Automatic mesh generation adapted to the physics settings in the model • Tuned for – Fluid flow – Plasma – General

Model of a Li-Ion battery pack Swept, hexahedral mesh

Mapped mesh on end

surfaces

Tetrahedral mesh by conversion

Working with Structured Meshes

• Create mapped meshes in 2D, or 3D surfaces

• Create swept meshes, hexahedral or prismatic, in 3D

• Use a sequence of map, sweep, and convert operations to

create structured triangular or tetrahedral meshes

Page 15: Meshing with COMSOL Multiphysics 4 - Michelsen · PDF file• Automatic mesh generation adapted to the physics settings in the model • Tuned for – Fluid flow – Plasma – General

• Possible to sweep a source side with

N faces to a destination side with M

faces, where N≥M

• Control element distribution in the

sweep direction

• Supports triangular, quadrilateral and

mixed meshes on end surfaces

• Create sweepable domains by – Hiding geometry features with virtual

geometry operations

– Partitioning domains with geometry

operations

Partitioned source face with mixed

triangular and quadrilateral mesh

Swept mesh with prism and

hexahedron elements

Swept Meshes

Page 16: Meshing with COMSOL Multiphysics 4 - Michelsen · PDF file• Automatic mesh generation adapted to the physics settings in the model • Tuned for – Fluid flow – Plasma – General

• Possible to create a

continuous mesh while

keeping separate regions

(parts are bonded)

• Possible to mesh parts

individually with

compatible/incompatible

mesh on touching surfaces Continuous mesh

Incompatible mesh Compatible mesh

Meshing Several Parts (Assemblies)

Page 17: Meshing with COMSOL Multiphysics 4 - Michelsen · PDF file• Automatic mesh generation adapted to the physics settings in the model • Tuned for – Fluid flow – Plasma – General

• Use – In fluid flow applications to resolve boundary layers along the no-slip boundaries

– In heat transfer applications to resolve large temperature gradients close to heated surfaces

– In low-frequency electromagnetics to resolve the skin effect

• Boundary layer mesh is created automatically when needed for fluid flow

applications

Benchmark model of turbulent flow

field around a car-like object

Prism elements in the boundary

layer mesh of the above model

Boundary Layer Meshes

Page 18: Meshing with COMSOL Multiphysics 4 - Michelsen · PDF file• Automatic mesh generation adapted to the physics settings in the model • Tuned for – Fluid flow – Plasma – General

• The boundary layer mesh consists of – Layered quadrilateral elements in 2D

– Layered prism or hexahedron elements in 3D

• Automatic detection and treatment of

sharp corners

• Can be created for any mesh

• Manual control of boundary layer

properties

• Smooth transition to the interior mesh

• Support for boundary layers on

isolated boundaries

Creating Boundary Layer Meshes

New

New

Page 19: Meshing with COMSOL Multiphysics 4 - Michelsen · PDF file• Automatic mesh generation adapted to the physics settings in the model • Tuned for – Fluid flow – Plasma – General

• Use for applying periodic boundary

conditions with high accuracy

requirements, such as – Cyclic symmetry in structural mechanics

applications

– Floquet boundary condition for

electromagnetic wave propagation

• Available for domains, faces and

edges

• Automatic orientation of source mesh

on destination

• Supports copy to multiple destinations – Quick mesh generation for large periodic

geometries

Copying Meshes

Page 20: Meshing with COMSOL Multiphysics 4 - Michelsen · PDF file• Automatic mesh generation adapted to the physics settings in the model • Tuned for – Fluid flow – Plasma – General

• Use when creating meshes for geometric multigrid solver

• Use for convergence studies or to verify whether the solution is mesh dependent

• Different physics may have different meshes over the same region

• Duplicate, then edit mesh sequences

• Link meshing sequences by using the reference operation

– Apply scaling to the referenced mesh to create coarser or finer mesh

– Break the link to edit the meshes separately

• Use multiple imported meshes when preparing the mesh in other software

Multiple Meshes

Page 21: Meshing with COMSOL Multiphysics 4 - Michelsen · PDF file• Automatic mesh generation adapted to the physics settings in the model • Tuned for – Fluid flow – Plasma – General

• Quick overview of the mesh

• Minimum and maximum quality

• Histogram plot of element quality

Mesh Statistics

Page 22: Meshing with COMSOL Multiphysics 4 - Michelsen · PDF file• Automatic mesh generation adapted to the physics settings in the model • Tuned for – Fluid flow – Plasma – General

• Mesh plot to aid in creating good quality meshes – Plot various element types separately

– Color elements according to quality

– Show elements based on logical expressions

– Shrink elements for better visualization

Mesh Visualization

Page 23: Meshing with COMSOL Multiphysics 4 - Michelsen · PDF file• Automatic mesh generation adapted to the physics settings in the model • Tuned for – Fluid flow – Plasma – General

• Export the triangular surface mesh of the geometry, mesh, or deformed mesh to the

STL format (.stl)

• Create or modify designs in CAD programs based on the exported STL surface mesh

Large deformation analysis of a snap

hook. The deformed geometry can be

exported to STL format

STL Export

Page 24: Meshing with COMSOL Multiphysics 4 - Michelsen · PDF file• Automatic mesh generation adapted to the physics settings in the model • Tuned for – Fluid flow – Plasma – General

Importing Meshes

Page 25: Meshing with COMSOL Multiphysics 4 - Michelsen · PDF file• Automatic mesh generation adapted to the physics settings in the model • Tuned for – Fluid flow – Plasma – General

• Import mesh and materials

• Automatic split into domains

based on material data

• Automatic split into domains

based on element type

• Automatic or manual control

of parameters for face

partitioning

Imported Nastran

mesh of a crankshaft

Importing Nastran (.nas) Meshes

Page 26: Meshing with COMSOL Multiphysics 4 - Michelsen · PDF file• Automatic mesh generation adapted to the physics settings in the model • Tuned for – Fluid flow – Plasma – General

• .mphbin, .mphtxt mesh format

• Model with COMSOL Multiphysics on

meshes based on MRI and scanned

data

• The following software support export

to COMSOL mesh format • Mimics by Materialise, read more on

www.materialise.com

• +ScanFE by Simpleware, read more on

www.simpleware.com

Imported mesh, generated with

+ScanFE software by Simpleware,

of a scanned pork (bacon) side

The model is courtesy of Simpleware.

Importing COMSOL Meshes

Page 27: Meshing with COMSOL Multiphysics 4 - Michelsen · PDF file• Automatic mesh generation adapted to the physics settings in the model • Tuned for – Fluid flow – Plasma – General

• Create new boundaries and domains on imported meshes for assigning boundary

conditions and material properties

• Group existing mesh elements using one of the following operations:

– Ball

– Box

– Join Entities

– Delete Entities

– Create Vertex

– Logical Expression New

Partitioning Imported Meshes

Page 28: Meshing with COMSOL Multiphysics 4 - Michelsen · PDF file• Automatic mesh generation adapted to the physics settings in the model • Tuned for – Fluid flow – Plasma – General

Virtual Geometry and

Mesh Control Operations

Page 29: Meshing with COMSOL Multiphysics 4 - Michelsen · PDF file• Automatic mesh generation adapted to the physics settings in the model • Tuned for – Fluid flow – Plasma – General

• Complements CAD defeaturing and repair operations on the imported geometry

• ”Hides” geometry features from the mesher

• Use to get rid of – Sliver faces

– Short edges

– Small faces

– Undesired surface partitioning

– Small domains due to overlapping solids

• Difference from geometry defeaturing – Works on the geometry that is seen by the mesher

– Keeps the underlying shape of the geometry

Virtual Geometry Operations

Page 30: Meshing with COMSOL Multiphysics 4 - Michelsen · PDF file• Automatic mesh generation adapted to the physics settings in the model • Tuned for – Fluid flow – Plasma – General

• Gain precise control over mesh layout and density in regions of known rapid changes

or steep gradients, which may occur for example in CFD simulations

• Selected geometry features are available exclusively to control local mesh properties

and do not affect the subdivision of edges, faces, or domains when applying physics

settings

Domain for mesh control in benchmark model of turbulent flow field around a car-like object

Mesh Control Operations

Page 31: Meshing with COMSOL Multiphysics 4 - Michelsen · PDF file• Automatic mesh generation adapted to the physics settings in the model • Tuned for – Fluid flow – Plasma – General

Mesh Adaptation during Solving

Plot of sound pressure level

after shape optimization of an

initially cone shaped horn

Page 32: Meshing with COMSOL Multiphysics 4 - Michelsen · PDF file• Automatic mesh generation adapted to the physics settings in the model • Tuned for – Fluid flow – Plasma – General

• Automatic or manual choice of shape

function and element order

• Available shape functions include – Lagrange

– Hermite

– Argyris

– Discontinuous Lagrange

– Curl (vector) elements, etc.

• Automatic or manual choice of

geometry shape order

Model of an antenna implemented with

the Electromagnetic Wave interface

utilizing curl elements

Shape functions and Element Order

Page 33: Meshing with COMSOL Multiphysics 4 - Michelsen · PDF file• Automatic mesh generation adapted to the physics settings in the model • Tuned for – Fluid flow – Plasma – General

• Improve solution accuracy by adapting

the mesh to the problem’s physical

behavior

• The solver minimizes the error

according to an error criterion by

adding mesh elements to refine the

mesh

• Available for stationary, eigenvalue,

eigenfrequency or time dependent

studies

Ink droplet ejected through a nozzle

modeled with the help of transient

mesh adaptation

Adaptive Mesh Refinement

Page 34: Meshing with COMSOL Multiphysics 4 - Michelsen · PDF file• Automatic mesh generation adapted to the physics settings in the model • Tuned for – Fluid flow – Plasma – General

• Study the behavior of different shape

of an original object by enabling mesh

movement

• Model a process which removes or

adds material from the original

geometry, for example electrochemical

polishing or electrodeposition

• Perform optimization and sensitivity

analyses

Model of electrodeposition of

copper

Sensitivity analysis of a

structural member to

determine the effect of small

design modifications

Deformed Geometry

Page 35: Meshing with COMSOL Multiphysics 4 - Michelsen · PDF file• Automatic mesh generation adapted to the physics settings in the model • Tuned for – Fluid flow – Plasma – General

• Study deformation of solid

objects

• Model fluid-solid interaction,

or for example movement of

solids under electric fields

Model illustrating the principles of a MEMS

flow meter. Due to the fluid flow the

obstacle in the channel is bending, which

results in considerable change of the

shape of the flow domain

Moving Mesh

Page 36: Meshing with COMSOL Multiphysics 4 - Michelsen · PDF file• Automatic mesh generation adapted to the physics settings in the model • Tuned for – Fluid flow – Plasma – General

• Available for Moving Mesh

and Deformed Geometry

• Automatic remeshing,

based on user-defined

mesh quality threshold

• The simulation is

automatically continued

starting from the new

mesh

Mesh elements before and after an automatic remesh,

during the solution of a model for electrodeposition of

copper

Automatic Remeshing