Car fire in an underground park - Simulate a temperature sensor
Dear All,
I need to simulate a car fire in an underground park and I've got a problem. I want to simulate a temperature sensor that starts a momentum source when the temperature reaches a specific value. I think the best way to simulate it is to create a UDF that starts the momentum source when the temperature at the cell x is at a temperature T. Something like, if C_T(cell,thread)==T we have momentum. Else no. Is it possible for me to identify a certain cell in order to establish this condition? If not, does anyone have an alternative for me? Thanks in advance!!! Pedro |
Quote:
The simplest scheme is to use the cell whose distance to your specified location is the least. Of course, this is not a very concise scheme if your grid is not fine enough. |
Quote:
I'll try it. Pedro |
Quote:
#include "udf.h" DEFINE_ON_DEMAND(find_cell) { cell_t c; Thread *t; CX_Cell_Id cx_cell; real NV_VEC(pt); real c_centroid[ND_ND]; NV_D(pt, =, 0.5, 0.3, 0.2); //coordinate of your specified location,it must be in the domain coordinate range CX_Start_ND_Point_Search(); cx_cell=*CX_Find_Cell_With_Point(pt); CX_End_ND_Point_Search(); c=RP_CELL(&cx_cell); //the right cell number t = RP_THREAD(&cx_cell); // the thread C_CENTROID(c_centroid,c,t); Message0("coordinate of the specified point: x=%g,y=%g,z=%g\n",pt[0],pt[1],pt[2]); Message0("coordinate of the cell found: x=%g,y=%g,z=%g\n",c_centroid[0],c_centroid[1],c_centroid[2]); } |
Quote:
|
just replace
real NV_VEC(pt); to float NV_VEC(pt); Pedro |
Quote:
I have place the above program in UDF and replace with float NV_VEC(pt). But it always remind that there is an assignment error in cx_cell=*CX_Find_Cell_With_Point(pt); I don't konw why and beg your instructions. |
Hello I get the following error:
Quote:
Quote:
Can anyone please say what the problem is? |
Quote:
|
I know this is an old post, but I have faced the same problem as Blackhawks84 and Seppl.
Can anybody help me? Cheers |
All times are GMT -4. The time now is 00:33. |