CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (https://www.cfd-online.com/Forums/fluent-udf/)
-   -   how can i get the size of mesh with udf? (https://www.cfd-online.com/Forums/fluent-udf/123138-how-can-i-get-size-mesh-udf.html)

judgin September 5, 2013 06:48

how can i get the size of mesh with udf?
 
i'm writting a udf program to calculate the erosion rate of a workpiece. i want to get the mesh size with udf. with which macro can i get it?
thank you!

syavash September 5, 2013 16:11

Quote:

Originally Posted by judgin (Post 450028)
i'm writting a udf program to calculate the erosion rate of a workpiece. i want to get the mesh size with udf. with which macro can i get it?
thank you!

you may loop over the cells in your domain and using a counter to obtain cells number. This procedure can be done via a Define_on_demand macro.

DEFINE_ON_DEMAND(on_demand_calc)
{
Domain *d = Get_Domain(1); /* declare domain pointer since it is not passed as an argument to the DEFINE macro */
Thread *t;
cell_t c;
face_t f;
int n = 0;
thread_loop_c(t,d)
{
if (FLUID_THREAD_P(t))
{
begin_c_loop(c,t) /* loops over cells in a cell thread */
{
n += 1;
}
end_c_loop(c,t)
}
}
Message("grid size: %d\n", n);
}
Regards

gouravjee April 3, 2018 04:25

regarding cell dimensions
 
Quote:

Originally Posted by syavash (Post 450116)
you may loop over the cells in your domain and using a counter to obtain cells number. This procedure can be done via a Define_on_demand macro.

DEFINE_ON_DEMAND(on_demand_calc)
{
Domain *d = Get_Domain(1); /* declare domain pointer since it is not passed as an argument to the DEFINE macro */
Thread *t;
cell_t c;
face_t f;
int n = 0;
thread_loop_c(t,d)
{
if (FLUID_THREAD_P(t))
{
begin_c_loop(c,t) /* loops over cells in a cell thread */
{
n += 1;
}
end_c_loop(c,t)
}
}
Message("grid size: %d\n", n);
}
Regards

can you tell me how to access cell dimensions in fluent udf?


All times are GMT -4. The time now is 02:28.