21.01.2015 Views

COMSOL Multiphysics™

COMSOL Multiphysics™

COMSOL Multiphysics™

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

femlin<br />

nullfun and symmetric can be useful in finding out the result of the automatic<br />

null function or the automatic symmetric mechanisms.<br />

Example<br />

The L-Shaped Membrane with Three Subdomains<br />

Take a look at the geometry of the L-shaped membrane for examples of what you<br />

can do. First create the L-shaped membrane and examine the subdomain labels and<br />

edge segment labels by plotting:<br />

clear fem<br />

sq1 = square2(0,0,1);<br />

sq2 = move(sq1,0,-1);<br />

sq3 = move(sq1,-1,-1);<br />

fem.geom = sq1+sq2+sq3;<br />

fem.mesh = meshinit(fem);<br />

geomplot(fem,'edgelabel','on','sublabel','on')<br />

Say you want to use c = 1, 1/2, and 1/3 and f = x, y, and x 2 +1 in subdomains 1, 2,<br />

and 3, respectively. Use Dirichlet boundary conditions on the outer boundaries:<br />

fem.shape = 2;<br />

fem.equ.c = {1 1/2 1/3};<br />

fem.equ.f = {'x' 'y' 'x^2+1'};<br />

fem.bnd.h = 1;<br />

fem.xmesh = meshextend(fem);<br />

fem.sol = femlin(fem);<br />

postsurf(fem,'u')<br />

You can set fem.bnd.h = 1 because fem.border has not been set (and defaults to<br />

off). When fem.border is set to on you must type fem.bnd.h = {1 1 1 0 1 1<br />

0 1 1 1}. Otherwise you get u=0 also on interior boundaries.<br />

Using anisotropic c =<br />

2 x + y<br />

and f=1 in all subdomains can be done by<br />

x + y 10<br />

typing<br />

fem.equ.c = {{{2 'x+y' 10}}};<br />

fem.equ.f = 1;<br />

fem.xmesh = meshextend(fem);<br />

fem.sol = femlin(fem);<br />

postsurf(fem,'u')<br />

Cautionary<br />

When using the general form it is assumed that the coefficients c, α, β, a, q, h have<br />

been computed using fem=femdiff(fem). In the user interface, this is done<br />

automatically.<br />

Compatibility The property Variables has been renamed to Const in FEMLAB 2.3.<br />

127

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!