CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   FLUENT (http://www.cfd-online.com/Forums/fluent/)
-   -   Will the UDF work?? (http://www.cfd-online.com/Forums/fluent/29192-will-udf-work.html)

H.S.Fang December 27, 2001 22:21

Will the UDF work??
 
Hi,all,

DEFINE_ADJUST(adjustfunction,domain) { /*扫描全场,修改速度场为对应函数场*/ thread_loop_c(t,domain) {begin_c_loop(c,t) {

C_U(c,t)=C_UDMI(c,t,4);

C_V(c,t)=C_UDMI(c,t,5);

C_U(c,t)=C_U(c,t)-ul;

C_V(c,t)=C_V(c,t)-vl; } end_c_loop(c,t) }

/*求个网格的函数梯度并存于网格内存变量中*/ thread_loop_c(t,domain) {begin_c_loop(c,t) {

C_UDMI(c,t,0)=C_DUDX(c,t);

C_UDMI(c,t,1)=C_DUDY(c,t);

C_UDMI(c,t,2)=C_DVDX(c,t);

C_UDMI(c,t,3)=C_DVDY(c,t); } end_loop_c(c,t) } /*再次扫描全场改变速度场为对应函数场*/ thread_loop_c(t,domain) {begin_c_loop(c,t) {

C_U(c,t)=C_H(c,t)-hl;

C_V(c,t)=C_YI(c,t,i)-cll; } end_c_loop(c,t) }

/*再次求个网格的函数梯度并存于网格内存变量中*/ thread_loop_c(t,domain) {begin_c_loop(c,t) {

C_UDMI(c,t,6)=C_DUDX(c,t);

C_UDMI(c,t,7)=C_DUDY(c,t);

C_UDMI(c,t,8)=C_DVDX(c,t);

C_UDMI(c,t,9)=C_DVDY(c,t); } end_loop_c(c,t) }

/*还*速度场*/ thread_loop_c(t,domain) {begin_c_loop(c,t) {

C_UDMI(c,t,4)=C_U(c,t);

C_UDMI(c,t,5)=C_V(c,t); } end_c_loop(c,t) } }

I will use C_UDMI(c,t,i)(i=0,1,2,3 6,7,8,9) in the DEFINE_SOURCE functions,will they work? Thanks!


All times are GMT -4. The time now is 17:27.