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.

mesh2geom<br />

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

Create an analyzed geometry from the mesh, into the new geometry Geom2.<br />

xfem=mesh2geom(fem,'destfem',2);<br />

Creating an Analyzed Geometry From a Deformed Mesh<br />

Draw two rectangles, one inside the other, and mesh<br />

clear fem<br />

g1=rect2(1.8,1.2,'base','corner','pos',[-0.8,-0.8]);<br />

g2=rect2(0.2,0.4,'base','corner','pos',[-0.2,-0.4]);<br />

fem.geom=geomcsg({g1,g2});<br />

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

Set the inner rectangle to move along the x-axis.<br />

clear appl<br />

appl.mode.class = 'MovingMesh';<br />

appl.sdim = {'X','Y','Z'};<br />

appl.assignsuffix = '_ale';<br />

appl.prop.analysis='transient';<br />

appl.prop.weakconstr.value = 'off';<br />

appl.bnd.defflag = {{1;1}};<br />

appl.bnd.deform = {{0;0},{'t';0}};<br />

appl.bnd.ind = [1,1,1,2,2,2,2,1];<br />

appl.equ.type = {'free','pres'};<br />

appl.equ.presexpr = {{0;0},{'t';0}};<br />

appl.equ.ind = [1,2];<br />

fem.appl{1} = appl;<br />

fem.sdim = {{'X','Y'},{'x','y'}};<br />

fem.frame = {'ref','ale'};<br />

fem=multiphysics(fem);<br />

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

Solve the problem:<br />

fem.sol=femtime(fem,'tlist',[0:0.01:0.1]);<br />

Create an analyzed geometry from the deformed mesh.<br />

fem=mesh2geom(fem,'srcdata','deformed','frame','ale');<br />

Remesh the created geometry and continue solving.<br />

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

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

fem.sol=femtime(fem,'tlist',[0:0.01:0.1]);<br />

249

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

Saved successfully!

Ooh no, something went wrong!