⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 lshape3ad.m

📁 在有限元计算中作热交换分析的算例
💻 M
字号:
kappa=[0.2 0; 0 0.2]; % conductivity matrix
Q=0.013; % uniform heat source
num_integ_pts=1; % 1-point quadrature
[fens,gcells] = targe2_mesher({...
    ['curve 1 line 20 0 48 0'],...
    ['curve 2 line 48 0 48 48'],...
    ['curve 3 line 48 48 0 48'],...
    ['curve 4 line 0 48 0 13'],...
    ['curve 5 line 0 13 20 13'],...
    ['curve 6 line 20 13 20 0'],...
    'subregion 1  property 1 boundary 1 2 3 4 5 6',...
    ['m-ctl-point constant 2.5'],...
    ['m-ctl-point 1 xy 20 13 near 0.05 influence 0.26']
    }, 1.0);
prop=property_diffusion(struct('conductivity',kappa,'source',Q));
mater=mater_diffusion (struct('property',prop));
feb = feblock_diffusion (struct ('mater',mater,...
    'gcells',gcells,...
    'integration_rule',tri_rule(num_integ_pts)));
geom = field(struct('name',['geom'], 'dim', 2, 'fens',fens));
theta=field(struct('name',['theta'], 'dim', 1, 'nfens',...
    get(geom,'nfens')));
fenids=[fenode_select(fens,struct('box',[48 48 0 48],...
    'inflate', 0.01)),fenode_select(fens,struct('box',[0 48 48 48],...
    'inflate', 0.01)),fenode_select(fens,struct('box',[0 20 0 13],...
    'inflate', 0.01))];
prescribed=ones(length(fenids),1);
comp=[];
val=zeros(length(fenids),1)+ 30;
theta = set_ebc(theta, fenids, prescribed, comp, val);
theta = apply_ebc (theta);
theta = numbereqns (theta);
K = start (sparse_sysmat, get(theta, 'neqns'));
K = assemble (K, conductivity(feb, geom, theta));
F = start (sysvec, get(theta, 'neqns'));
F = assemble(F, source_loads(feb, geom, theta));
F = assemble(F, nz_ebc_loads_conductivity(feb, geom, theta));
theta = scatter_sysvec(theta, get(K,'mat')\get(F,'vec'));

% Plot
gv=graphic_viewer;
gv=reset (gv,[]);
T=get(theta,'values');
dcm=data_colormap(struct('range',[min(T),max(T)],'colormap',jet));
colorfield=field(struct ('name', ['colorfield'], 'data',...
    map_data(dcm, T)));
geomT=field(struct ('name', ['geomT'], ...
    'data',[get(geom,'values'), get(theta,'values')]));
for i=1:length (gcells)
    draw(gcells(i), gv, struct ('x',geomT, 'u',0*geomT,...
        'colorfield',colorfield, 'shrink',1));
    draw(gcells(i), gv, struct ('x',geom, 'u',0*geom, ...
        'facecolor','none'));
end
% draw_integration_points(feb, gv, struct ('x',geom,'u',0*geom, ...
%     'theta', theta, 'scale', 35,'color','red'));
headlight(gv);
camset (gv, [-214.1067  -64.2844  201.6982   19.8741   23.1974   13.4603    0.5637    0.2108    0.7986 10.3396])

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -