CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT > Fluent UDF and Scheme Programming

Problem in DEFINE_ZONE_MOTION UDF

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 8, 2015, 15:30
Default Problem in DEFINE_ZONE_MOTION UDF
  #1
New Member
 
mohsen
Join Date: Jun 2015
Posts: 25
Rep Power: 10
moabdi is on a distinguished road
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!!

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

Curve_00.jpg
moabdi is offline   Reply With Quote

Old   December 9, 2015, 11:02
Default
  #2
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 26
pakk will become famous soon enough
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?
pakk is offline   Reply With Quote

Old   December 12, 2015, 13:01
Default
  #3
New Member
 
mohsen
Join Date: Jun 2015
Posts: 25
Rep Power: 10
moabdi is on a distinguished road
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
moabdi is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
ATTN ALL: SOLUTON TO UDF COMPILE PROBLEM Rizwan Fluent UDF and Scheme Programming 40 March 18, 2018 06:05
Problem with DPM simulation with particles injection and EXECUTE_AT_THE_END UDF. Ari Fluent UDF and Scheme Programming 4 May 31, 2016 08:51
udf loading problem santu Fluent UDF and Scheme Programming 1 May 22, 2015 15:47
Vaporization pressure UDF property problem? lehoanganh07 Fluent UDF and Scheme Programming 1 September 13, 2014 10:59
Problem with my udf july Fluent UDF and Scheme Programming 3 June 20, 2010 06:56


All times are GMT -4. The time now is 03:14.