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.

multiphysics<br />

Elements of fem1.***.(f/ga/g/r/weak/dweak/constr/c/da/ea/al/be/a/<br />

q/h) which correspond to subsystems for which the corresponding field does not<br />

exist are '0'. Elements of fem1.***.init in such cases are empty strings. Elements<br />

in fem1.***.(gporder/cporder) in such cases are 1. The fields fem1.elemmph<br />

and fem1.eleminitmph are obtained by concatenating the contents of the results<br />

of calling elem_compute for each application. The field fem1.shape is obtained by<br />

concatenating the contents of the fields fem.appl{:}.shape. Duplicate shape<br />

functions are removed and the fields fem.***.shape are adjusted to take account<br />

of this. The field fem1.sshape is obtained by taking the maximum of the fields<br />

fem.appl{:}.sshape. The resulting value is overridden if the property Outsshape<br />

is given. The fem1.border field is always 1 because coefficients for boundary<br />

conditions that are not used due to border being on or off in the application mode<br />

are set to zero and can be “applied”.<br />

Suppose multiphysics has been called previously, and fem is the result of such a<br />

call. If changes are made to fem.equ and it is wished to keep them (that is not allow<br />

changes to be written over when multiphysics is called again), it is possible to<br />

restrict the set of subdomains for which multiphysics writes over fem.equ. Thus<br />

giving the property Sdl the value [1 2] in a call to multiphysics results in the<br />

coefficients for subdomains 1 and 2 being “refreshed” from the applications, but all<br />

the coefficients in fem.equ relating to other subdomains being kept and copied into<br />

fem1.equ. The same principle holds for bnd/edg/pnt using the properties Bdl/<br />

Edl/Pdl.<br />

Example<br />

The model “Resistive Heating” uses the multiphysics function. Note that the<br />

structure fem contains the data that is common for the subsystems, that is, the<br />

geometry and the mesh. The electrical subsystem and the heat transfer subsystem<br />

are specified in the application structures a1 and a2, and the multiphysics<br />

function is used to combine them.<br />

clear fem a1 a2<br />

fem.geom = geomcsg({square2(0,0,1)});<br />

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

a1.mode = 'ConductiveMediaDC';<br />

a1.assignsuffix = '_dc';<br />

a1.bnd.V0 = {0.1 0 0};<br />

a1.bnd.type = {'V' 'nJ0' 'V0'};<br />

a1.bnd.ind = [1 2 2 3];<br />

a1.equ.init = '0.1*(1-x)';<br />

a1.equ.T0 = 293;<br />

a1.equ.T = 'T';<br />

a1.equ.alpha = 0.0039;<br />

309

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

Saved successfully!

Ooh no, something went wrong!