找回密码
 注册
查看: 1833|回复: 4

[求助]斑竹帮忙!udf出错,请朋友们给个意见!

[复制链接]
发表于 2005-4-7 04:49:07 | 显示全部楼层 |阅读模式

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

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

x
[这个贴子最后由lemonwxd在 2005/04/07 01:03pm 第 2 次编辑]

/*********************************************************************
  UDF that specifies a custom mass-fraction weighted conductivity
**********************************************************************/
#include "udf.h"
DEFINE_PROPERTY(mass_wtd_k,c,t)
{
    real sum = 0.; int i;
    Material *sp;
    real ktc;
    Property *prop;
    mixture_species_loop(THREAD_MATERIAL(t),sp,i)
      {
        prop = (MATERIAL_PROPERTY(sp));
        ktc = generic_property(c,t,prop,PROP_ktc,C_T(c,t));
        sum += C_YI(c,t,i)*ktc;
      }
    return sum;
}
这其实就是udf帮助文挡里的一段代码,可是interpreted的时候却提示错误:
Error: E:\react\mass_wtd_k.c: line 12: structure reference not implemented
这是怎么回事!
程序调不对,都熬通宵了,望朋友费心提供帮助,谢谢!
 楼主| 发表于 2005-4-7 13:04:21 | 显示全部楼层

[求助]斑竹帮忙!udf出错,请朋友们给个意见!

就是mixture_species_loop(THREAD_MATERIAL(t),sp,i)这句!
 楼主| 发表于 2005-4-11 15:23:49 | 显示全部楼层

[求助]斑竹帮忙!udf出错,请朋友们给个意见!

怎么没有人帮忙啊?55555555555
发表于 2005-4-12 13:19:43 | 显示全部楼层

[求助]斑竹帮忙!udf出错,请朋友们给个意见!

看看这个,也许有帮助!
7.2.1 Common Errors Made While Interpreting Your Source File
If there are compilation errors when you interpret your UDF, they will appear in the console window. However, you may not see all the error messages if they scroll off the screen too quickly. For this reason, you may want to turn off the Display Assembly Listing option while debugging your UDF. You can view the compilation history in the ';log'; file that is saved in your working directory.
If you keep the Interpreted UDFs panel open while you are in the process of debugging your UDF , the Interpret button can be used repeatedly since you can make changes with an editor in a separate window. Then, you can continue to debug and interpret until no errors are reported. Remember to save changes to your source code file in the editor window before trying to interpret again.
One of the more common errors made when interpreting source files is trying to interpret source code that contains elements of C that the interpreter does not accommodate. For example, if you have code that contains a structured reference call (which is not supported by the C preprocessor), the interpretation will fail and you will get an error message similar to the following:

Error: /nsf/erflnx/home/erf/fluent/udfexample.c:
line 15: structure reference
See Section  1.3 for a list of limitations of interpreted UDFs.

Special Considerations for Parallel FLUENT

If you are running the parallel version of FLUENT on a Windows network and you encounter errors when trying to interpret your source file(s), it could be the result of an improper installation of cpp. Proper installation of parallel FLUENT for Windows ensures that the FLUENT_INC environment variable is set to the shared directory where FLUENT is installed. If the variable is defined locally instead, the following error message will be reported when you try to interpret a source file:

Warning: unable to run cpp
You will need to see your system administrator to reset the FLUENT_INC environment variable.
 楼主| 发表于 2005-4-12 19:04:13 | 显示全部楼层

[求助]斑竹帮忙!udf出错,请朋友们给个意见!

下面引用由scarecrow2005/04/12 01:19pm 发表的内容:
看看这个,也许有帮助!
7.2.1 Common Errors Made While Interpreting Your Source File
If there are compilation errors when you interpret your UDF, they will appear in the console window. However, y ...
谢谢,我用compiled就好了。可是在代码里加入读写文件的代码就又出问题了!
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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