CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (https://www.cfd-online.com/Forums/fluent-udf/)
-   -   Problem in DEFINE_ZONE_MOTION UDF (https://www.cfd-online.com/Forums/fluent-udf/163947-problem-define_zone_motion-udf.html)

moabdi December 8, 2015 15:30

Problem in DEFINE_ZONE_MOTION UDF
 
1 Attachment(s)
Hi every body

I have written an UDF to define zone motion. actually, rotation of a section of TORUS around it's axial axis (as shown in picture).
but answers are wrong!!:confused:

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"
#include "unsteady.h"

DEFINE_ZONE_MOTION(TORUSrotation,omega,axis,origin ,velocity,time,dtime)
{
real x[ND_ND];
real r=573;
real teta,m;
teta=atan(x[0]/x[1]);
m=-x[0]/sqrt(r*r-x[0]*x[0]);

origin[0]=-r*cos(teta);
origin[1]=-r*sin(teta);
origin[2]=0.0;

axis[0]=-r*cos(teta+dtime*teta);
axis[1]=-m*r*(cos(teta+dtime*teta)-cos(teta))+r*sin(teta);
axis[2]=0.0;
*omega=50.0;

return;
}


i have no idea why answers are wrong?!?!?!?
it's my pleasure if any body could suggest/help me.

BEST REGARDS

Attachment 44012

pakk December 9, 2015 11:02

It would be helpful if you give more info... You only say that the result is wrong, but in what sense? It must mean that you get something else than what you expected. But maybe the code is perfect, and your expectation is wrong...

1. What did you expect to get as a result?
2. What did you get as a result in stead?

moabdi December 12, 2015 13:01

Hi PAKK

as shown in the picture i want to use DEFINE_ZONE_MOTION MACRO to define "frame motion" in a domain consist of a section of TORUS.
that UDF should rotate a TORUS shape domain around it's axial axis ( as shown in the picture).
actually,the axis of rotation is a quarter of a circle NOT a STRAIGHT LINE. so, it's should be define by means of an UDF , so, i think it's better to use DEFINE_ZONE_MOTION MACRO to define that axis of rotation.

i replace that UDF by:

#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"
#include "unsteady.h"

DEFINE_ZONE_MOTION(TORUSnewrotation,omega,axis,ori gin,velocity,time,dtime)
{
real x[ND_ND];
real r=573.0608;
real teta;
teta=atan(x[0]/x[1]);
origin[0]=-r*sin(teta);
origin[1]=-r*cos(teta);
origin[2]=0.0;

axis[0]=cos(teta);
axis[1]=sin(teta);
axis[2]=0.0;
*omega=50.0;

return;
}

but, when i run the project i faced with : "AMG-SOLVER:x-momentum" error, i do not know what's that error mean and what should i do?

do you know why this error has accrued?

BEST REGARDS


All times are GMT -4. The time now is 02:12.