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

如何实现:矩形域,把左边界上的f(u)对x积分后的值放到右边界上【扩展、映射】

[复制链接]
发表于 2009-4-13 16:17:56 | 显示全部楼层 |阅读模式 来自 陕西西安
本帖最后由 TBE_Legend 于 2009-4-16 08:15 编辑

我的具体问题是:求解得到圆柱体的三维温度场分布T进而希望获得变量y,y为沿圆柱体底面到顶面轴向的积分,积分的表达式为y=aT+b(a、b为常数),即首先令底面y=0,底面每一点沿轴向到顶面积分即可得到相应的y,最后积分结果为顶面y的表面分布情况。COMSOL后处理里面的积分都是针对某一区域得到一个积分结果,不知道能不能处理我面临的这个问题,希望大家不吝赐教!
发表于 2009-4-13 19:07:53 | 显示全部楼层 来自 上海徐汇区
Simdroid开发平台
建议使用积分耦合变量试试,如果不行再试试其它办法。
回复 不支持

使用道具 举报

发表于 2009-4-14 10:09:56 | 显示全部楼层 来自 湖北武汉
补充一下,积分耦合变量好像只能在非结构网格中应用。
回复 不支持

使用道具 举报

发表于 2009-4-14 11:01:33 | 显示全部楼层 来自 黑龙江哈尔滨
不太明白楼主的意思。

你可以试试加个ode 或 试试命令 meshintegrate

Purpose
Integrate over arbitrary cross section
Syntax
I = meshintegrate(p,t,d)
I = meshintegrate(p,d)
I = meshintegrate(p)
Description
I = meshintegrate(p,t,d) computes the integral I over the mesh given by p and t, with values (for each point) in d. d is of size 1-by-np, where np is the number of points in p (=size(p,2)). The elements are considered to be linear.
I = meshintegrate(p,d) assumes t=[1,2,3,... (np-1) ; 2,3,4,... np], (where np=size(p,2)), i.e., that the mesh is a line and that the points in p are sorted.
I = meshintegrate(p) calls meshintegrate(p(1,, p(2,:)).
This function is useful for computing integrals along cross sections plotted with postcrossplot, in which case p, t, and d are extracted from the output when the property outtype is set to postdata.
Examples
Line integral in 2D:
% Just set up a problem:
clear fem
fem.geom = circ2+rect2;
fem.mesh = meshinit(fem);
fem.shape = 2; fem.equ.c = 1; fem.equ.f = 1; fem.bnd.h = 1;
fem.xmesh = meshextend(fem);
fem.sol = femstatic(fem);
% Make a cross-section plot, with output being a postdata
% structure
pd = postcrossplot(fem,1,[0 1;0 1],'lindata','u',...                   'npoints',100,'outtype','postdata');
% Call meshintegrate:
I = meshintegrate(pd.p);
Line integral in 3D:
% Just set up a problem:
clear fem, fem.geom = block3;
fem.mesh = meshinit(fem,'hmax',0.15);
fem.shape = 2;
fem.equ.c = 1; fem.equ.f = 1;
fem.bnd.h = {1 1 0 0 1 1};
fem.xmesh = meshextend(fem);
fem.sol = femstatic(fem);

% Make cross-section plot:
pd = postcrossplot(fem,1,[0 1;0 1;0 1],'lindata','u',...                   'npoints',100,'outtype','postdata');
% Call meshintegrate:
I = meshintegrate(pd.p)
Surface integral in 3D using the same problem as above:
pd = postcrossplot(fem,2,[0 0 0;0 1 0;1 0 1]','surfdata','u',...outtype','postdata');
I = meshintegrate(pd.p, pd.t, pd.d)
This function only works for lines and surfaces actually intersecting the geometry. For plots along geometry boundaries or edges (or 1-D subdomains), better results are achieved using postint.
Cautionary
This function is not implemented for 3-D elements, i.e., when T has four rows.
See also
postcrossplot, postint

评分

1

查看全部评分

回复 不支持

使用道具 举报

 楼主| 发表于 2009-4-15 21:48:49 | 显示全部楼层 来自 陕西西安
感谢大家的帮助,可能我说的不是很明白。简单的来说,根据一个矩形的求解结果u,将左边的一条边离散成无数个点,每一点沿x轴方向对u做积分得到的积分结果赋加到右边的一条边上对应的点,即可得到右边上的积分结果。我看到例子里积分耦合变量均是得到一个固定值,而我要得到的这个积分结果赋在右边上每一点都是不一样的,不知道有没有什么办法能够做到,谢谢大家!
回复 不支持

使用道具 举报

发表于 2009-4-16 08:06:22 | 显示全部楼层 来自 黑龙江哈尔滨
本帖最后由 TBE_Legend 于 2009-4-16 08:12 编辑
感谢大家的帮助,可能我说的不是很明白。简单的来说,根据一个矩形的求解结果u,将左边的一条边离散成无数个点,每一点沿x轴方向对u做积分得到的积分结果赋加到右边的一条边上对应的点,即可得到右边上的积分结果。我 ...
xmhan 发表于 2009-4-15 21:48


说的还是不太清楚,不过大概能知道了。右边上的积分结果(从左边来的)你要干什么?

是仅仅后处理还是用于方程中?

下面是我用COMSOL35做的一个例子,你看看是不是你想要的。

其中:Projec就是你要的“右边上的积分结果”。

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注册

×
回复 不支持

使用道具 举报

 楼主| 发表于 2009-4-16 17:29:25 | 显示全部楼层 来自 陕西西安
TBE版主:您好
感谢你对困扰我很久的后处理积分问题给了详细的解答并帮我做了一个范例,我想得到的这个积分结果是做后处理,我的实际问题是得到一个三维磁场分布以后,计算圆偏振光在通过磁场后偏振光产生的旋转角的变化,即磁光效应,因此我需要知道每条光束在通过三维磁场后的磁场积分结果。
由于我现在使用的还是comsol3.4,无法运行您给出的版本,麻烦您能不能用3.4版本帮我做个范例,或者给我一个思路,告诉我您用到的功能控件。
回复 不支持

使用道具 举报

发表于 2009-4-16 17:43:36 | 显示全部楼层 来自 黑龙江哈尔滨
TBE版主:您好
感谢你对困扰我很久的后处理积分问题给了详细的解答并帮我做了一个范例,我想得到的这个积分结果是做后处理,我的实际问题是得到一个三维磁场分布以后,计算圆偏振光在通过磁场后偏振光产生的旋转角的 ...
xmhan 发表于 2009-4-16 17:29


我没有装3.4. 思路比较简单,就是用extrusion coupling variable和project coupling variable。

1)把左边界上的u拉伸成为名叫Extr的extrusion coupling variable,这样Extr就可以在整个矩形域上可用了。

2)把Extr映射到右边界上。
回复 不支持

使用道具 举报

发表于 2009-4-16 18:50:30 | 显示全部楼层 来自 北京
a与b已知的?如果已知就简单多了,直接用。

如果是积分常数且未知,用耦合变量。
回复 不支持

使用道具 举报

发表于 2009-4-17 17:28:11 | 显示全部楼层 来自 上海徐汇区
同志们,讨论这么复杂,难道就没人喜欢用投影耦合变量吗?手册上明明说的就是用它来实现线积分的嘛。
回复 不支持

使用道具 举报

发表于 2009-4-17 19:26:59 | 显示全部楼层 来自 黑龙江哈尔滨
同志们,讨论这么复杂,难道就没人喜欢用投影耦合变量吗?手册上明明说的就是用它来实现线积分的嘛。
kinggun 发表于 2009-4-17 17:28


看我做的了吗?

我的就是这么做的啊,给加点分吧。呵呵
回复 不支持

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-4-28 11:44 , Processed in 0.066447 second(s), 18 queries , Gzip On, MemCache On.

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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