|
[Sponsors] |
November 15, 2006, 08:41 |
problems with F_AREA
|
#1 |
Guest
Posts: n/a
|
Hello, I have some problems when I'm using F_AREA macro. It returns a zero vector, and I don't understand why. I have a function which computes the cross-section area of a domain at a given x position, but my variable is always 0. I appreciate any help. Thanks, Bogdan
void computeCrossSectionArea(Domain*mixture, real x,real*totalArea){ /************************************************** ****************** ** This function computes the cross-section area of a domanin at a ** given x. ** ************************************************** *******************/ Thread* face_thread; Message("x= %f\n",x); face_t face; real xf[ND_ND],area[ND_ND]; int counter1=0; *totalArea=0.0; FILE * fp; char filename[]="area_vectors.txt"; fp=fopen(filename,"a"); thread_loop_f(face_thread,mixture) { begin_f_loop_all(face,face_thread) { F_CENTROID(xf,face,face_thread); if(equals6(xf[0],x)){ counter1++; F_AREA(area,face,face_thread); fprintf(fp,"at x= %f area[0] is %f, area[1] is %f and area[2] is %f\n",xf[0],area[0],area[1],area[2]); *totalArea+=NV_MAG(area); } } end_f_loop_all(face,face_thread) } Message("counter1 is %d\n",counter1); fclose(fp); } int equals (real d1, real d2, real delta) { if ( fabs(d1-d2) < delta ) return 1 ; return 0 ; } int equals6 ( real d1, real d2) { return equals( d1,d2,0.000001); } |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[ICEM] Problems with coedge curves and surfaces | tommymoose | ANSYS Meshing & Geometry | 6 | December 1, 2020 11:12 |
Needed Benchmark Problems for FSI | Mechstud | Main CFD Forum | 4 | July 26, 2011 12:13 |
Some problems with Star CD | Micha | Siemens | 0 | August 6, 2003 13:55 |
Airpak: Problems with heat flow contour conditions | Ivan de Miguel Urain | FLUENT | 1 | November 16, 2001 09:36 |
unstructured grid | sreekanth | Main CFD Forum | 1 | August 6, 2001 15:09 |