动态接触角(共5页).doc

上传人:飞****2 文档编号:13966822 上传时间:2022-05-02 格式:DOC 页数:5 大小:20.50KB
返回 下载 相关 举报
动态接触角(共5页).doc_第1页
第1页 / 共5页
动态接触角(共5页).doc_第2页
第2页 / 共5页
点击查看更多>>
资源描述

《动态接触角(共5页).doc》由会员分享,可在线阅读,更多相关《动态接触角(共5页).doc(5页珍藏版)》请在taowenge.com淘文阁网|工程机械CAD图纸|机械工程制图|CAD装配图下载|SolidWorks_CaTia_CAD_UG_PROE_设计图分享下载上搜索。

1、精选优质文档-倾情为你奉上#include udf.h #include sg_mphase.h #include sg_vof.h #include sg.h #include mem.h #define VISCOSITY 0.001 #define SURF_TENS 0.0728 #define MYTRUE 1 #define MYFALSE 0 #define Hoff(x) acos(1-(2.0*tanh(5.16*(pow(x/(1+(1.31*pow(x, 0.99), 0.706) #define static_Con_Ang 60. #define index_sour

2、ce 2/* This Code computes the normals of the VOF function*/ DEFINE_ADJUST(store_gradient, domain) Thread *t; Thread *pt; Thread *phaset; cell_t c; int phase_domain_index = 1;/* Secondary Domain */ Domain *pDomain = DOMAIN_SUB_DOMAIN(domain,phase_domain_index); void calc_source(); Alloc_Storage_Vars(

3、pDomain,SV_VOF_RG,SV_VOF_G,SV_NULL); Scalar_Reconstruction(pDomain, SV_VOF,-1,SV_VOF_RG,NULL); Scalar_Derivatives(pDomain,SV_VOF,-1,SV_VOF_G,SV_VOF_RG, Vof_Deriv_Accumulate); mp_thread_loop_c (t,domain,pt) if (FLUID_THREAD_P(t) Thread *ppt = ptphase_domain_index; begin_c_loop (c,t) calc_source(c,t);

4、 end_c_loop (c,t) Free_Storage_Vars(pDomain,SV_VOF_RG,SV_VOF_G,SV_NULL); void calc_source(cell_t cell, Thread *thread) real VOF_Val2, VOF_Mag, source, VOF_Norm2; Thread *phaset; phaset= THREAD_SUB_THREAD(thread,1); if(C_VOF(cell,phaset)!=0.0 & N_TIME 1) /* The gradients of the VOF function are found

5、 in the x,y and z dir.*/ if (NULLP(THREAD_STORAGE(phaset, SV_VOF_G) Message0(N_TIME = %d, .show-grad:Gradient of VOF is not available n , N_TIME); Error(0); VOF_Val0=-C_VOF_G(cell,phaset)0; VOF_Val1=-C_VOF_G(cell,phaset)1; /* The magnitude of the VOF gradients is found so it can be normalized*/ VOF_

6、Mag=NV_MAG(VOF_Val); if(VOF_Mag!=0.0) VOF_Mag=NV_MAG(VOF_Val); VOF_Norm0=VOF_Val0/VOF_Mag; VOF_Norm1=VOF_Val1/VOF_Mag; else /* This is to avoid the divide by zero function*/ VOF_Norm0=0.0; VOF_Norm1=0.0; C_UDMI(cell,thread,0)=VOF_Norm0; C_UDMI(cell,thread,1)=VOF_Norm1; source=0.0; C_UDMI(cell,thread

7、,index_source)=source; DEFINE_SOURCE(VOF_Norms, cell, thread, dS, eqn) real source; source = C_UDMI(cell, thread, index_source); return source; DEFINE_PROFILE(con_ang, t, pos) /* First the various pointer variables are created*/ face_t f; cell_t c; real feta_d, vel_Val2, cont_Line_Vel, VOF_Normal2,

8、cap_Num, static_Con_Rad, x_Bottom, x_Top, x_Bisect, hoff_Old, hoff_Cur, hoff_New, finish_Cond, inv_Hoff=0.0; int notConverged, itNum; Thread *t0,*pt; /* This code is designed to find the zero for the inverted hoffman function by finding the zero*/ /* of the function at which the hoffman function res

9、ults in the static contact angle */ /* First the variables are assigned*/ notConverged=MYTRUE;x_Bottom=0.001; x_Top=2.0; itNum=0; static_Con_Rad=(static_Con_Ang*M_PI)/180.); /* A while loop performs the bisection method, a simple but very stable zero finder*/ while(notConverged) /* The variables use

10、d in the bisection method are assigned and the hoffman */ /* functions are evaluated */ itNum+; hoff_Old=(Hoff(x_Bottom)- static_Con_Rad); hoff_Cur=(Hoff(x_Top)- static_Con_Rad); x_Bisect=(x_Bottom+x_Top)/2.0; hoff_New=(Hoff(x_Bisect)- static_Con_Rad); finish_Cond=fabs(1-(x_Bisect/x_Top); /* The loo

11、p ends when the relative error is less than 1e-8 and the inverse*/ /* hoffman value is stored for use later */ if(finish_Cond) inv_Hoff=x_Bisect; notConverged=MYFALSE; /* Conditions for the bisection method */ if(hoff_Old*hoff_New)0.0) x_Top=x_Bisect; if(hoff_Cur*hoff_New)0 */ if(C_VOF(c,pt)!=0.0) /

12、* The velocities are recorded in each direction */ vel_Val0=C_U(c,t0); vel_Val1=C_V(c,t0); /* The VOF normals are brought in */ VOF_Normal0=C_UDMI(c,t0,0); VOF_Normal1=C_UDMI(c,t0,1); /* The contact line vel. is calc from the dot product of VOF and Vel*/ cont_Line_Vel=NV_DOT(vel_Val,VOF_Normal); /*

13、The capillary number is found based on cont line vel. */ cap_Num=fabs(VISCOSITY*cont_Line_Vel)/SURF_TENS); /* The dynamic contact angle is defined then stored in the profile*/ if(cap_Num+inv_Hoff0.0) cap_Num=inv_Hoff; feta_d=(Hoff(cap_Num+inv_Hoff)*180)/M_PI; F_PROFILE(f,t,pos)=feta_d; else F_PROFILE(f,t,pos)=static_Con_Ang; end_f_loop(f,t) 专心-专注-专业

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 教育专区 > 教案示例

本站为文档C TO C交易模式,本站只提供存储空间、用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。本站仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知淘文阁网,我们立即给予删除!客服QQ:136780468 微信:18945177775 电话:18904686070

工信部备案号:黑ICP备15003705号© 2020-2023 www.taowenge.com 淘文阁