24/12/2011
Tips and Tricks
Some Tips & Tricks in COMSOL
24/12/2011
1. Express anything in terms of anything!
Materials and settings can simultaneously be:
complex-valued
directly type in values such as 2.5-j*0.1 or exp(-j*pi/2*(z+x)) etc.
for permittivity, refractive index, conductivity, or permeability
frequency dependent
anisotropic
spatially varying
nonlinear in for instance temperature T:
Ex: for conductivity, directly type in values as
5e6*(1-0.01*(T-273.15)) or
5e6*exp(-0.01*(T-273.15))
interpolated from tabulated data
2. Pick the right interface!
Example1 : Electric fields
Electrostatics or electric currents
Current or no currents
Electric currents, Shell
Magnetic field
Current or no current
Both Magnetic and electric
Example 2: Fluid flow
Stokes Flow
Laminar
Turbulent
High Reynolds
Low Reynolds
24/12/2011
3. Pick the right study type!
Stationary
Time Dependent
Steady-state solutions
Transients
Frequency Domain
Assume solution u u0 sin(t )
Solve one frequency at a time
Eigenfrequency
Frequency-Stationary, Frequency-Transient, etc.
Find mode shapes and eigenfrequencies
Specialized study types for multiphysics combinations
Treat for example an EM problem in the frequency domain and the induced
heating in the time domain
Good approximation if the heat problem is much slower than the EM problem
4. Expand windows!
Expand windows by double-clicking on the tab
Improved view easier to see
Return by double-clicking again
24/12/2011
5. Use Functions!
Available under Global Definitions > Functions
6. Adaptive mesh
If you do not know where to refine your mesh....
...use Adaptive mesh and let COMSOL do it for you!
Available in the Study Node
Stationary problems
24/12/2011
7. Name your selections!
Define once reuse any number of times
When defining materials
In physics settings
In postprocessing
...
8. Shadowing and Additive features
Physics features can be shadowing or additive
Source terms add
Constraints shadow
Improved book keeping
Avoid mixing flux contributions in one feature
Easier to control individual sources
24/12/2011
9. Deform your geometry!
Use to create shapes that can be described by functions
See Moving mesh ALE
You can also move and rotate things in your model
z=0.1*cos(100*Xm)*cos(100*Ym)*Zm
New in 4.2: Parameterized surfaces
Import interpolation data for elevation
24/12/2011
10. Revolve your solution!
Revolve axisymmetric solution data into 3D
Only a postprocessing step
11. Plot deformations in scale!
24/12/2011
12. Check the Error node!
13. Visit www.comsol.com/support !
24/12/2011
Step-by-step instructions are
included for all models in the model
library find it under the file menu
14. Model Library
And now...
24/12/2011
The very most powerful trick:
15. Walk to China step by step!
-Key to solve large multiphysics models
- Start with one or a few physics
-Add more one at the time
-Simplify modeling a lot!
10
24/12/2011
Tips and Tricks
11