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

how can i get the size of mesh with udf?

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools 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
Join Date: Apr 2010
Posts: 143
Rep Power: 6
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

Reply

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Ugly mesh around cylinder rks171 STAR-CCM+ 4 May 9, 2012 14:35
Number of cells in mesh don't match with size of cellLevel colinB OpenFOAM Native Meshers: snappyHexMesh and Others 9 November 2, 2011 03:50
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 04:26.