Skip to content
  • 最新
  • 版块
  • 东岳流体
  • 随机看[请狂点我]
皮肤
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • 默认(不使用皮肤)
  • 不使用皮肤
折叠
CFD中文网

CFD中文网

lee459317530L

lee459317530

@lee459317530
关于
帖子
2
主题
0
群组
0
粉丝
2
关注
0

帖子

最新

  • 关于成核模型中的UDF问题
    lee459317530L lee459317530

    你这注释的格式就有问题呀!

    #include "udf.h"
    #include "sg_pb.h"
    #include "sg_mphase.h"
    DEFINE_PB_NUCLEATION_RATE(nuc_rate, cell, thread)
    {
    	real B;/* nucleation rate in #/(s kg-solvent) */
    	real Kb_1 = 4.355;  /* primary nucleation rate constant */
    	real Kb_2 = 3.968e14; /*secondary nucleation rate constant */
    	real b_1 = 1.852; /* primary nucleation law power index */
    	real b_2 = 4.226;/* secondary nucleation law power index */
    	real x;/*the antisolvent proportion in kg- antisolvent/kg-antisolvent and solvent */
    	real y;/*the solubility in kg-solute/kg- antisolvent and solvent */
    	real C;/*the solute concentration in kg-solute/kg-solvent*/
    	real Solubility;/*the solubility in kg-solute/kg-solvent */
    	real delta_C;/*the difference between the solute concentration and the solubility, kg-solute/kg-solvent*/
    	real solute_mass_frac,solvent_mass_frac,antisolvent_mass_frac;
    	real m;
    
    	Thread *tc = THREAD_SUPER_THREAD(thread); /*obtain mixture thread */
    	Thread *pt = THREAD_SUB_THREADS(thread); /*pointer to sub_threads */
    	Thread tp = pt[P_PHASE]; /* primary phase thread */
    
    	solute_mass_frac = C_YI(cell,tp,0);/*mass fraction of solute in primary phase (solvent,antisolvent,Paracetamol)*/
    	solvent_mass_frac = C_YI(cell,tp,1);/* mass fraction of solvent in primary phase (solvent,antisolvent,Paracetamol ) */
    	antisolvent_mass_frac = 1.-solute_mass_frac-solvent_mass_frac;/* mass fraction of antisolvent in primary phase (solvent,antisolvent,Paracetamol)*/
    
    	x = antisolvent_mass_frac/(antisolvent_mass_frac+solvent_mass_frac);/*the antisolvent proportion in kg- antisolvent/kg-antisolvent and solvent */
    	y = -2.63748*pow(x,4)+9.04654*pow(x,3)-10.86277*pow(x,2)+5.04399*x-0.57920; /* the solubility in kg-solute/kg- antisolvent and solvent */
    	Solubility = y*(1+(antisolvent_mass_frac/solvent_mass_frac)); /*the solubility in kg-solute/kg- solvent */
    	C = solute_mass_frac/solvent_mass_frac;/*the solute concentration in kg-solute/kg- solvent*/
    	delta_C = C-Solubility; /* Definition of Supersaturation */
    	m = C_VOF(cell, pt[1])*1293.;
    
    	if (delta_C == 0.)
    	{
    		B = 0.;
    	}
    	else
    	{
    		B = (Kb_1)*pow(delta_C,b_1)+(Kb_2)*pow(delta_C,b_2)*m;
    	}
    	return B;
    }
    

    2.png
    1.png
    代码的部分问题我帮你修改了,不一定都正确,你自己再检查检查,然后再按上面这图中提示的信息自己查阅资料(无论UDF手册还是C语言基础书籍还是其他什么资料)去进行调试吧,加油!:146:


  • Fluent板块版主?
    lee459317530L lee459317530

    毛遂自荐,较为熟悉Fluent.

  • 登录

  • 登录或注册以进行搜索。
  • 第一个帖子
    最后一个帖子
0
  • 最新
  • 版块
  • 东岳流体
  • 随机看[请狂点我]