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

PLS help me find the error in the code.

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 3, 2007, 04:21
Default PLS help me find the error in the code.
  #1
arwang
Guest
 
Posts: n/a
Dear freind:

The following code is used to compute the sum pressure on two walls which will be applied on the other outlet. when I compile it,prompting the warning in console window like that:

-------------------------------------------------

..\..\src\wallpre.c(10) : warning C4700: local variable 'd' used without having been initialized

------------------------------------------------

Could you have a good ideal to solute the problem.I don't know whether the code can realize my thought to apply the sum pressure.

Code following:

---------------------------------------

#include "udf.h" real calc_pressure() {

real pressure;

face_t f;

int w_id0=6;

int w_id1=7;

real totalpressure;

Domain *d;

Thread *t1 = Lookup_Thread(d,w_id0);

Thread *t2 = Lookup_Thread(d,w_id1);

real sum0_a,sum0_f,sum0_p,sum1_a,sum1_f,sum1_p,force;

sum0_a=sum0_f=sum0_p=0;

sum1_a=sum1_f=sum1_p=0;

begin_f_loop(f,t1)

{

real aa[1],area;

F_AREA(aa,f,t1);

area=NV_MAG(aa);

sum0_a+=area;

force=F_P(f,t1)*aa[1];

sum0_f+=force;

sum0_p+=sum0_f/sum0_a;

}

end_f_loop(f,t1)

begin_f_loop(f,t2)

{

real aa[1],area;

F_AREA(aa,f,t2);

area=NV_MAG(aa);

force=F_P(f,t2)*aa[1];

sum1_a+=area;

sum1_f+=force;

sum1_p+=sum1_f/sum1_a;

}

end_f_loop(f,t2)

totalpressure=sum0_p+sum1_p;

return totalpressure; } DEFINE_ON_DEMAND(get) {

Domain *d;

d = Get_Domain(1); } DEFINE_PROFILE(outpressure,thread,position) {

real pressure;

face_t f;

pressure = calc_pressure();

begin_f_loop(f,thread)

{

F_PROFILE(f,thread,position) = pressure;

}

end_f_loop(f,thread) }

  Reply With Quote

Old   March 3, 2007, 04:26
Default Re: PLS help me find the error in the code.
  #2
arwang
Guest
 
Posts: n/a
Pwall1+Pwall2-->Poutlet wall1 id = 6 wall2 id = 7

how to set the Domain initial value.
  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
Who can find me this fortran code 'CHEMR'? Dong Ye Main CFD Forum 1 October 13, 2005 17:02
where to find code for nearest wall distance Frank Main CFD Forum 1 July 5, 2005 10:07
What is the Better Way to Do CFD? John C. Chien Main CFD Forum 54 April 23, 2001 08:10
user friendly cfd code waqar Main CFD Forum 19 August 18, 2000 16:31
Open source CFD code development, possible? Dr. Yazid Bindar Main CFD Forum 27 July 18, 2000 00:18


All times are GMT -4. The time now is 21:37.