找回密码
 注册
Simdroid-非首页
查看: 105|回复: 2

[12.前后处理] 提取总体刚度阵出现的问题

[复制链接]
发表于 2013-9-26 11:03:47 | 显示全部楼层 |阅读模式 来自 大连理工大学
在Comsol 4.2 with matlab运行下面这段代码。该问题是来自帮助文档中的稳态热传导问题。我想提取总体刚度阵。1*1的矩形我划的网格是2*2的,按理说应该有9个自由度。但是得到的总刚size(MA.K)的结果却是25*25。请高人指点下,谢谢了。
  1. %% Create a new model object
  2. model = ModelUtil.create('Model');
  3. %% Create a square geometry
  4. geom1 = model.geom.create('geom1', 2);
  5. geom1.feature.create('sq1', 'Square');
  6. geom1.run;
  7. mphgeom(model,'geom1',...
  8.     'vertexlabels','off',...
  9.     'facelabels','on',...
  10.     'facemode','on',...
  11.     'facelabelscolor','r');
  12. %% Setup material properties
  13. mat1 = model.material.create('mat1');
  14. def = mat1.materialModel('def');
  15. def.set('thermalconductivity',{'4e2'});
  16. def.set('density',{'0'});
  17. def.set('heatcapacity',{'0'});
  18. %% Define the physics settings
  19. ht = model.physics.create('ht', 'HeatTransfer', 'geom1');
  20. hs1 = ht.feature.create('hs1','HeatSource',2);
  21. hs1.selection.set(1);
  22. hs1.set('Q',1,'1e5');
  23. temp1 = ht.feature.create('temp1','TemperatureBoundary',1);
  24. temp1.selection.set([1 2]);
  25. %% Create a mapped mesh
  26. mesh1 = model.mesh.create('mesh1','geom1');
  27. dis1 = mesh1.feature.create('dis1','Distribution');
  28. dis1.selection.set([1 2]);
  29. dis1.set('numelem',2);
  30. mesh1.feature.create('map1','Map');
  31. mesh1.run;
  32. mphmesh(model,'mesh1')%visualize the mesh
  33. %% Solve the problem
  34. std1 = model.study.create('std1');
  35. std1.feature.create('stat','Stationary');
  36. std1.run;
  37. %% Extract results
  38. U = mphgetu(model); %get the temperature
  39. model.sol('sol1').feature('v1').set('scalemethod','none');
  40. MA = mphmatrix(model,'sol1','Out',{'K','L'});
  41. size(MA.K)
复制代码
发表于 2013-9-26 19:15:21 | 显示全部楼层 来自 广西梧州
Simdroid开发平台
单元类型为二阶单元
如若是一阶线性单元 输出就是9个自由度
回复 不支持

使用道具 举报

 楼主| 发表于 2013-9-27 17:58:49 | 显示全部楼层 来自 北京
hhp886 发表于 2013-9-26 19:15
单元类型为二阶单元
如若是一阶线性单元 输出就是9个自由度

哦哦,谢谢提醒,之前不知道它默认的单元是二次的。
回复 不支持

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

Simapps系列直播

Archiver|小黑屋|联系我们|仿真互动网 ( 京ICP备15048925号-7 )

GMT+8, 2024-9-20 14:54 , Processed in 0.028848 second(s), 11 queries , Gzip On, MemCache On.

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表