找回密码
 注册
置顶 ·分享 【UDF编译调试工具】VcUdfStudio--在Visual Studio中一体化编辑编译调试UDF
gearboy 2017-11-4 19:16
【UDF编译调试工具】VcUdfStudio--在Visual Studio中一体化编辑编译调试UDF
利用Visual Studio集成环境进行Fluent UDF编写,编译,调试的一体化工具终于完成了,历时几年的构思到编程实现,完全实现了自动化。解决了UDF调试困难,无法查看中间变量,初学者搭建编译环境困境的问题(装好Visual Studio和本软件就可以直接编译调试),甚至可以调用 VC++/MFC 函数。 试用版下载可到软件主页 https://v ...
个人分类: Fluent高级二次开发技术|15401 次阅读|3 个评论 热度 1
分享 UDF中根据组分名称获取组分序号的两种方法
gearboy 2013-4-17 16:23
方法一: #include "udf.h" DEFINE_ON_DEMAND(species_list) { int i = -1; char *spe_name; Domain *d=NULL; Material *mix_mat=NULL; d=Get_Domain(1); mix_mat= mixture_material(d); mixture_species_loop_i(mix_mat,i) { spe_name=MIXTURE_SPECIE_NAME(mix_mat,i); Message0("species index=%d,species name=%s\n" ...
个人分类: UDF使用技巧|2181 次阅读|0 个评论
分享 UDF求欧拉模型中颗粒撞击壁面的角度
gearboy 2013-4-17 14:11
#include "udf.h" #define WALL_ID 4 // the wall id to be computed collision angle #define PARTICLE_PHASE_ID 1 // the phase id of particle phase DEFINE_ON_DEMAND(report_angle) { face_t f; cell_t c0; &nbs ...
个人分类: UDF使用技巧|1830 次阅读|1 个评论
分享 UDF求DPM撞击壁面的角度
gearboy 2013-4-17 14:10
使用DEFINE_DPM_BC宏来实现。记得hook。 #include "udf.h" DEFINE_DPM_BC(usr_bc_reflect,p,t,f,f_normal,dim) { real cos_angle,angle; cos_angle=NV_DOT(f_normal,P_VEL(p))/MAX(NV_MAG(P_VEL(p)),DPM_SMALL); & ...
个人分类: UDF使用技巧|2014 次阅读|1 个评论
分享 UDF检测能量方程是否打开
gearboy 2013-4-17 14:03
#include "udf.h" DEFINE_ON_DEMAND(test_temp_field) { Domain *domain; Thread *c_thread; domain=Get_Domain(1); thread_loop_c(c_thread, domain) /*loops over all cell threads in domain*/ { if(NNULLP(THREAD_STORAGE(c_thread,SV_T))) Message0("Temp. field exists\n"); else Message0("Temp. field doesn't exi ...
个人分类: UDF使用技巧|1657 次阅读|2 个评论
分享 UDF获取气体分压力或摩尔分数
gearboy 2013-4-17 14:00
You can use the following equation pi=C_P(c,t)*gas_molar_fraction where, pi is the partial pressure, C_P(c,t) gets the mixed gas pressure. gas_molar_fraction is the mole fraction of a species in the mixture, which can be calculated by - first summing up of all species and - then dividing the same ...
个人分类: UDF使用技巧|2433 次阅读|0 个评论
分享 UDF获取颗粒,壁面,气体的发射率
gearboy 2013-4-17 13:50
use DPM_EMISSIVITY(p,m) to get the particle emissivity. Use THREAD_VAR(t).wall.in_emiss to get the internal emissivity of a wall. Return value: Profile structure type Use the following method to get the emissivity (absorption coeff.) of internal gas Thread*t; Material *m; real as; Property *pro ...
个人分类: UDF使用技巧|1002 次阅读|0 个评论
分享 UDF获取计算中的残差
gearboy 2013-4-17 13:48
This is an example to print the residuals on the console. #include "udf.h" DEFINE_ON_DEMAND(residual_list) { int nw; real scaled_res; Domain*domain=Get_Domain(1); for(nw=0; nwMAX_EQNS; ++nw) { if(strlen(DOMAIN_EQN_LABEL(domain,nw))0) { if(0==DOMAIN_RES_SCALE(domain,nw) ) DOMAIN_RES_SCALE(domai ...
个人分类: UDF使用技巧|1161 次阅读|1 个评论
分享 根据坐标来得到cell
gearboy 2013-4-17 13:43
Here is the example, Note: the location of the specified point must be in the computational domain, otherwise error will occur. #include "udf.h" DEFINE_ON_DEMAND(find_cell) { cell_t c; Thread *t; CX_Cell_Id cx_cell; real NV_VEC(pt); real c_centroid ; NV_D(pt, =, 0.5, 0.3, 0.2); //coordinate of your ...
个人分类: UDF使用技巧|1447 次阅读|1 个评论
分享 用VC++编译UDF并调用API函数实现Fluent内嵌菜单
gearboy 2013-4-17 13:14
采用VC++编译UDF即可支持MFC和Windows API函数甚至第三方的库,大大拓展UDF的功能,利用该技术可以实现复杂的界面,例如Fluent内嵌菜单,对话框,文档视图结构,以及操作系统函数级的相关操作,远远胜过别扭而功能有限的scheme命令。还可以调用现有的各种库,例如科学数据后处理VTK等等。
个人分类: Fluent高级二次开发技术|1182 次阅读|1 个评论 热度 1
12下一页
返回顶部