|
[Sponsors] |
November 21, 2015, 16:50 |
Problem in DEFINE_GEOM Macro
|
#1 |
New Member
mohsen
Join Date: Jun 2015
Posts: 25
Rep Power: 11 |
Hi every body
I wrote an UDF to describe the geometry of a RING TORUS. NOTE: as you know a torus is a surface of revolution generated by revolving a circle in three-dimensional space about an axis coplanar with the circle. If the axis of revolution does not touch the circle, the surface has a ring shape and is called a Ring Torus. 220px-Torus.png but I think some thing is wrong about it, because when I try to see preview mesh motion, a small window is opened and show this message: "Resetting" and nothing happens. the UDF is: #include "udf.h" #include "math.h" #include "sg_udms.h" #include "sg.h" #include "stdio.h" #include "mem.h" #include "dpm.h" #include "surf.h" #define PI 3.14286 DEFINE_GEOM(torus, domain, dt, position) { int i, j, n = 360; real xx[129600], yy[129600], zz[129600]; xx[129600]=0; yy[129600]=0; zz[129600]=0; for (i = 1 ; i <= n ; i++) { for (j = 1 ; j <= n ; j++) { xx[0]=(50+3*cos (j*PI/180))*cos(i*PI/180); yy[1]=(50+3*cos (j*PI/180))*sin(i*PI/180); zz[2]=3*sin(j*PI/180); } } position[0]=xx[129600]; position[1]=yy[129600]; position[2]=zz[129600]; } DEFINE_CG_MOTION(CUTTING,dt,vel,omega,time,dtime) { /* reset velocities */ NV_S(vel, =, 0.0); NV_S(omega, =, 0.0); omega[2]=0.3; } it's my pleasure if any body could help me. thanks |
|
November 23, 2015, 09:21 |
|
#2 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
Code:
for (i = 1 ; i <= n ; i++) { for (j = 1 ; j <= n ; j++) { xx[0]=(50+3*cos (j*PI/180))*cos(i*PI/180); yy[1]=(50+3*cos (j*PI/180))*sin(i*PI/180); zz[2]=3*sin(j*PI/180); } } Code:
xx[0]=(50+3*cos (n*PI/180))*cos(n*PI/180); yy[1]=(50+3*cos (n*PI/180))*sin(n*PI/180); zz[2]=3*sin(n*PI/180); |
|
November 23, 2015, 12:35 |
|
#3 |
New Member
mohsen
Join Date: Jun 2015
Posts: 25
Rep Power: 11 |
Hi PAKK
you are right, there are many problems in that UDF, so what's your opinion on how to define a TORUS equation in FLUENT by use of DEFINE_GEOM macro? |
|
November 24, 2015, 11:09 |
|
#4 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
I have no opinion, I have never worked with DEFINE_GEOM. But you already wrote a code, so you must have had something in mind when you wrote it...
|
|
Tags |
udf |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
DEFINE_HET_RXN_RATE macro problem | zzt_1234 | Fluent UDF and Scheme Programming | 0 | December 6, 2010 04:16 |
problem in UDF | shen | FLUENT | 1 | November 20, 2007 08:56 |
Problem with FLUID_THREAD_P(t) macro | Sciaco | FLUENT | 0 | November 18, 2007 03:23 |
natural convection problem for a CHT problem | Se-Hee | CFX | 2 | June 10, 2007 07:29 |
Adiabatic and Rotating wall (Convection problem) | ParodDav | CFX | 5 | April 29, 2007 20:13 |