找回密码
 注册
查看: 4321|回复: 3

C_face_loop应用问题!~

[复制链接]
发表于 2010-12-1 16:01:37 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

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

x
使用如下一段代码做测试,验证使用c_face _loop加上C_FACE和C_FACE_THREAD对计算区域某些特定面的F_udmi和F_udsi进行赋值,发现这个方法不可行,即在c_face_loop进行面扫描时,在循环内部不能调用F_UDMI和F_UDSI。会报错如下:
Error:
FLUENT received fatal signal (ACCESS_VIOLATION)
1. Note exact events leading to error.
2. Save case/data under new name.
3. Exit program and restart to continue.
4. Report error to your distributor.
Error Object: ()

各位大虾是否也遇到过这个情况,怎么处理的?
DEFINE_SOURCE(velocity_u_source,c,t,dS,i)
{
        face_t f;
        Thread *tf;
        int n;
        real S=0;
        c_face_loop(c,t,n)
        {
                f=C_FACE(c,t,n);
                tf=C_FACE_THREAD(c,t,n);
                if (THREAD_ID(tf)==10)
                {
                        F_UDSI(f,tf,0)=0.0;
                }
        }
        return S;
}
发表于 2010-12-1 17:50:03 | 显示全部楼层
UDF帮助上是这么写的:
Note that F_UDMI is available for wall and flow boundary faces, only.

Note that F_UDSI is available for wall and flow boundary faces, only.
If a UDS attempts to access any other face zone, then an error will result.
 楼主| 发表于 2010-12-2 08:16:53 | 显示全部楼层
原帖由 znon 于 2010-12-1 09:50 发表
UDF帮助上是这么写的:
Note that F_UDMI is available for wall and flow boundary faces, only.

Note that F_UDSI is available for wall and flow boundary faces, only.
If a UDS attempts to access any  ...


收到。
还有一个问题,我测试一下,对于使用c_face_loop对面进行扫描时,即使该面是边界处的,也不能赋值。
我遇到的问题是,两个interface面的问题,两个进行interface时,除了原来的两个面,还生成四个面,其中两个面互为shadow。当使用thread_loop_f进行面扫描时,可以找到两个互为shadow的面的thread_id,同时还扫描interface最初两个面的id。但是使用c_face_loop时,仅仅能扫描到interface最初两个面的id,而不扫描两个互为shadow的面的thread_id,同时也无法使用扫描到的该面的id进行F_UDMI。
请问是什么原因?
发表于 2010-12-2 09:13:44 | 显示全部楼层
这个,后续的问题比较专,我以前没有遇到过,抱歉。

"使用c_face_loop时,仅仅能扫描到interface最初两个面的id,而不扫描两个互为shadow的面的thread_id",这两shadow是不是一切数据都从源面获得?

如果你只是想对边界条件处改动的话,不知道DEFINE_PROFILE是不是可以满足你的问题。

还有,如果你只是想固定这两个面的速度值, 可以看看帮助中USerGuide中Boundary Condition章节中关于Profile File Format的内容,可以通过自己写边界数据,然后导入的方式。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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