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

how can i get the size of mesh with udf?

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 5, 2013, 05:48
Default how can i get the size of mesh with udf?
  #1
New Member
 
Join Date: Oct 2012
Posts: 1
Rep Power: 0
judgin is on a distinguished road
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!
judgin is offline   Reply With Quote

Old   September 5, 2013, 15:11
Default
  #2
Senior Member
 
Syavash Asgari
Join Date: Apr 2010
Posts: 473
Rep Power: 18
syavash is on a distinguished road
Quote:
Originally Posted by judgin View Post
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
syavash is offline   Reply With Quote

Old   April 3, 2018, 03:25
Default regarding cell dimensions
  #3
Member
 
Join Date: Oct 2017
Posts: 52
Rep Power: 8
gouravjee is on a distinguished road
Quote:
Originally Posted by syavash View Post
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?
gouravjee is offline   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
[snappyHexMesh] Number of cells in mesh don't match with size of cellLevel colinB OpenFOAM Meshing & Mesh Conversion 14 December 12, 2018 08:07
Ugly mesh around cylinder rks171 STAR-CCM+ 4 May 9, 2012 14:35
Phase locked average in run time panara OpenFOAM 2 February 20, 2008 14:37
Convergence moving mesh lr103476 OpenFOAM Running, Solving & CFD 30 November 19, 2007 14:09
How to control Minximum mesh space? hung FLUENT 7 April 18, 2005 09:38


All times are GMT -4. The time now is 09:59.