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

matlab

[复制链接]
发表于 2012-6-30 08:42:36 | 显示全部楼层 |阅读模式 来自 陕西西安
各位高手,我正在做一平板中含一边裂纹的热力耦合有限元分析,计算,温度场,位移场,热应力场,板的上边界温度降低10,下边界保持为原来的0,固定下边位移,请问1 MATLAB边界条件中,温度边界条件和位移边界条件能写在一块么?
2,计算热应力应变的温差应为多少?
下面是我的MATLAB 边界条件代码
function [freeDOF] = boundaryCond(DOF)
% This function defines the boundary conditions to be applied.              %  case 1              

global BC  CONNEC DOMAIN NODES

nXElem   = DOMAIN(1);                                                       % Number of elements in the x-direction
nYElem   = DOMAIN(2);                                                       % Number of elements in the y-direction
fixedTDOF = NaN(1,(DOMAIN(1)+1)*(DOMAIN(2)+1));                              % Initialize vector of fixed DOFs
fixedDOF = NaN(1,(DOMAIN(1)+1)*(DOMAIN(2)+1));   
TDOF     = 1*max(max(NODES));
index = 1;
switch BC
    case 1                                                                  % Fix the temperature in bottom and top edge of the domain
        
      
              for i = 1:nXElem+1;
                if i == 1;
                fixedTDOF(index) = node;                                        % Fix temperature in bottom edge of the domain
                fixedTDOFvalue=0;                                                  %    bcval2 = 0;
                index = index+1;
                 node = node+1;                                             
               
                 elseif node == (nYElem)*(nXElem+1)+1;
                fixedTDOF(index) = node;                                        %  bcval1 = -10;
                fixedTDOFvalue=-10;
                index = index+1;
                 node = node+1;
                                                            
                end  
               
             end
        
   
         
         
         
    case 2                                                                  % Boundary conditions for an edge crack
        fixedDOF = [2*(nXElem+1)-1 2*(nXElem+1) 2*(nXElem+1)*(nYElem+1)-1];
   
    case 3                                                                  % Fix the bottom edge of the domain
        for i = 1:nXElem+1
            if i == 1
                fixedDOF(indexindex+1)) = [2*i-1 2*i];                    % Fix displacement in x and y-direction
                index = index+2;
            else
                fixedDOF(index) = 2*i;                                      % Fix displacement in y-direction
                index = index+1;
            end
        end            
    case 4                                                                  % Boundary conditions for first quadrant
        node = 1;
        for i = 1:nYElem+1                                                  % Rollers left edge
            fixedDOF(index) = 2*node-1;
            index = index+1;
            node = node+nXElem+1;
        end               
        for i = 1:nXElem+1
            fixedDOF(index) = 2*i;                                          % Fix displacement in y-direction
            index = index+1;
        end      
end
                                         
fixedTDOF(:,isnan(fixedTDOF(1,)) = [];  
freeTDOF = setdiff(1:TDOF,fixedTDOF);
fixedDOF(:,isnan(fixedDOF(1,)) = [];
freeDOF = setdiff(1OF,fixedDOF);                                          % Solve for the free DOF



发表于 2012-6-30 09:49:27 | 显示全部楼层 来自 上海
Simdroid开发平台
发错区了吧?
回复 不支持

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-7-3 14:16 , Processed in 0.028615 second(s), 11 queries , Gzip On, MemCache On.

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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