|
[Sponsors] |
July 10, 2010, 23:43 |
Data minning on an arbitrary zone...
|
#1 |
Member
Kasra
Join Date: Jun 2010
Location: USA
Posts: 44
Rep Power: 16 |
Hi everybody, I'm trying to get data on a surface in the field which I define it as a new surface...does anybody know
how I can get the flow field variables like velocity u, v, w on the specified surface and save them in file? And what if the surface is not coincident with that cell nodes or cell centers? can I still get the data on the corresponding node projection on the surface? I really appreciate any help, |
|
July 15, 2010, 11:28 |
|
#2 |
Member
Kasra
Join Date: Jun 2010
Location: USA
Posts: 44
Rep Power: 16 |
any help? idea? suggestion?
|
|
July 15, 2010, 22:14 |
|
#3 | |
Senior Member
Join Date: Feb 2010
Posts: 164
Rep Power: 17 |
Quote:
/************************************************** *************************** * Udf to retrieve the cells and thread (and subsequently all other variables) * through which a surface, created for postprocessing, passes * Written by Suman Basu of Fluent India ************************************************** **************************/ #include "udf.h" #include "surf.h" #define SURFID 4 /*this is the id of the surface of interest could be checked from Surface->Manage GUI panel*/ DEFINE_ON_DEMAND(loop_over_surface) { int phase_domain_index; real x[ND_ND]; cell_t cell; CX_Cell_Id c; Surface surf=SurfaceList[SURFID]; int i; Thread *cell_thread; FILE *fp; fp=fopen("store.dat","a"); Message("%d",surf.np); for(i=0;i<surf.np;i++) { c=surf.points[i].cell; cell=RP_CELL(&c); cell_thread=RP_THREAD(&c); C_CENTROID(x,cell,cell_thread); /*writes the X and Y coordinates of the cell centroid and cell index in the file*/ fprintf(fp,"%g %g %d\n",x[0],x[1],cell); } fclose(fp); } |
||
July 26, 2010, 14:07 |
|
#4 |
Member
Kasra
Join Date: Jun 2010
Location: USA
Posts: 44
Rep Power: 16 |
Thank you so much gearboy. It's perfect. This code returns the values on the centers of the cells through which the surface has passed. Since the surface is not necessarily passing through the cell centers but do you know how I can obtain the flow variables on the surface?
By the UDF you provided it is possible to obtain the cells through which the surface is passing do you know how the cell nodes coordinate can be obtained? I mean by knowing the cell index and thread how I can find the coordinates of its nodes? Thank you in advance, |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Commercial meshers] Fluent3DMeshToFoam | simvun | OpenFOAM Meshing & Mesh Conversion | 50 | January 19, 2020 16:33 |
[blockMesh] StitchMesh on two patches | anita | OpenFOAM Meshing & Mesh Conversion | 31 | April 4, 2013 12:51 |
Problem in IMPORT of ICEM input file in FLUENT | csvirume | FLUENT | 2 | September 9, 2009 02:08 |
How to update polyPatchbs localPoints | liu | OpenFOAM Running, Solving & CFD | 6 | December 30, 2005 18:27 |
Sliding mesh error | Karl Kevala | FLUENT | 4 | February 21, 2001 16:52 |