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

for help about gradient of UDM

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 28, 2006, 02:42
Default for help about gradient of UDM
  #1
Hanxsi
Guest
 
Posts: n/a
my programe as folows, it can be compiled but can not work.it is the message form the FLUENT the Error: FLUENT received fatal signal (ACCESS_VIOLATION) 1. Note exact events leading to error. 2. Save case/data under new name. 3. Exit program and restart to continue. 4. Report error to your distributor. Error Object: ()

any suggestions and advisor is appreciated. please help me,thanks a lot!

#include "udf.h" #define ANM 8

void calgra(int indx,cell_t c,Thread *thread) {

Thread *tf,*t1;

face_t f;

cell_t c1;

real x[ND_ND],detx,dety;

real dxdx,dydy,dxdy,dvardx,dvardy;

real varx,vary,undervar;

real adjac[ANM][2],adjvar[ANM];

int i,j,k,m;

int n;

for(i=0;i<ANM;i++)

for(j=0;j<2;j++){

adjac[i][j]=0.;adjvar[i]=0.;

}

C_CENTROID(x,c,thread);

adjac[0][0]=x[0];

adjac[0][1]=x[1];

adjvar[0]=C_UDMI(c,thread,indx);

k=1;

c_face_loop(c,thread,n)

{

f=C_FACE(c,thread,n);

tf=C_FACE_THREAD(c,thread,n);

if(NULL!=F_C1_THREAD(f,tf))

{

t1=F_C1_THREAD(f,tf);

c1=F_C1(f,tf);

C_CENTROID(x,c1,t1);

adjac[k][0]=x[0];

adjac[k][1]=x[1];

adjvar[k]=C_UDMI(c1,t1,indx);

k++;

}

}

dxdx=0.;dydy=0.;dxdy=0.;

dvardx=0.;dvardy=0.;

for(m=1;m<k;m++)

{

dxdx+=(adjac[m][0]-adjac[0][0])*(adjac[m][0]-adjac[0][0]);

dydy+=(adjac[m][1]-adjac[0][1])*(adjac[m][1]-adjac[0][1]);

dxdy+=(adjac[m][0]-adjac[0][0])*(adjac[m][1]-adjac[0][1]);

dvardx+=(adjac[m][0]-adjac[0][0])*(adjvar[m]-adjvar[0]);

dvardy+=(adjac[m][1]-adjac[0][1])*(adjvar[m]-adjvar[0]);

}

undervar=dxdx*dydy-dxdy*dxdy;

varx=dvardx*dydy-dvardy*dxdy;

vary=dvardy*dxdx-dvardx*dxdy;

C_UDMI(c,thread,1)=varx/undervar;

C_UDMI(c,thread,2)=vary/undervar; }
  Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
Segmentation violation louiza FLUENT 16 June 27, 2017 16:41
specified shear at wall - temperature gradient - UDF - access violation error senD Fluent UDF and Scheme Programming 9 September 18, 2014 08:29
How could I get the gradient of UDM? fireman FLUENT 2 February 8, 2011 06:36
can I use static enthalpy gradient to describe dT Jay CFX 0 August 7, 2008 00:01
How to compute gradient for non-orthogonal grids? Paul Hsieh Main CFD Forum 3 November 11, 2003 05:52


All times are GMT -4. The time now is 09:43.