Note: This discussion is about an older version of the COMSOL Multiphysics® software. The information provided may be out of date.

Discussion Closed This discussion was created more than 6 months ago and has been closed. To start a new discussion with a link back to this one, click here.

Dynamically Changing 3D Geometry in Matlab Problem

Please login with a confirmed email address before reporting spam

Hi Everyone,

I have created a heat transfer simulation on an object made up of rectangular prisms stacked on top of one another where each rectangular prism has different lengths, widths, and thicknesses. Now I would like to be able to change the widths, lengths, and thickness of each individual prism using Matlab. The topology of the object won't change, that is, if one prisms edges are on the surface of and contained inside the edges of another prism, then the object remains this way, just the dimensions may change a bit. The goal is to be able to measure the temperature on the top surface of the object using the postinterp function.

So far, I've been able to vary some of the thickness so long as the boundary indices do not change. However, once I start changing the widths or lengths, the boundary indices change which is not a problem in itself because I can just use the geomanalyze function to track how the indices change and make the necessary changes in the script. However, in the COMSOL model I made 4 groups for boundaries and when I change the geometry, I suspect that COMSOL is adding more groups and messing up the bnd.ind declaration. That is,

clear bnd
bnd.name = {'Bulk','Inter','Top Cell','Bottom Plate'};
bnd.ind = [1,1,1,1,1,1,1,4,2,1,1,2,1,1,1,1,1,1,1,1,1,1,2,1,1,2,1,1,2,3, ...
1,1,1,1,1,1,1,1,1,1,1,1,1,1];

Where I have specified four groups but I think COMSOL adds more on its own when the geometry changes before the boundaries are specified. The geometry changes this way before because I recreate the geometry of the original model and then use geomanalyze to track the changing of the indices which I set bnd.ind equal to.

So what this amounts to, I believe, is that COMSOL may designate some external boundaries as interior and/or I can not properly designate my boundary conditions. Hence I get the following message,

xfem.fem{1}.appl{1}.bnd.type{1} must have any of the values 'T'
xfem.fem{1}.appl{1}.bnd.type{2} must have any of the values 'T'

Any thoughts, ideas, etc?

Thanks for any advice/help in advance!

0 Replies Last Post Jun 8, 2010, 11:56 a.m. EDT
COMSOL Moderator

Hello Christopher David

Your Discussion has gone 30 days without a reply. If you still need help with COMSOL and have an on-subscription license, please visit our Support Center for help.

If you do not hold an on-subscription license, you may find an answer in another Discussion or in the Knowledge Base.

Note that while COMSOL employees may participate in the discussion forum, COMSOL® software users who are on-subscription should submit their questions via the Support Center for a more comprehensive response from the Technical Support team.