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

UDF function for mesh spacing

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 16, 2015, 01:54
Default UDF function for mesh spacing
  #1
New Member
 
Jeric zhang
Join Date: May 2015
Posts: 3
Rep Power: 10
Jeric is on a distinguished road
Dear all,
I want to write a UDF for calculating the mesh spacing in 3D. Actually, I want to campute delta_x,delta_y and delta_z for each cell. my quastion is which function should be used? How can I write this udf?
function :L_S=C_x*(△x*△y*△z)^(1/3)
C_x=0.61
(delta_x means the length of a cell across x direction)
Jeric is offline   Reply With Quote

Old   August 18, 2015, 06:31
Default
  #2
`e`
Senior Member
 
Join Date: Mar 2015
Posts: 892
Rep Power: 18
`e` is on a distinguished road
First of all, how would you describe these lengths for an arbitrary, unstructured cell? For example, the "mesh spacing" of a tetrahedron would vary across the geometry. Assuming the maximum distance between nodes in each direction might be an overestimation for your physics. The problem is simplified with a structured mesh utilising hexahedron cells.

Start with writing a UDF which loops through each node of a cell using c_node_loop and calculating the lengths with:

\Delta x = x_{max} - x_{min}

and then checking if the results are what you expect.
`e` is offline   Reply With Quote

Old   August 19, 2015, 10:15
Default
  #3
Far
Super Moderator
 
Sijal
Join Date: Mar 2009
Location: Islamabad
Posts: 4,553
Blog Entries: 6
Rep Power: 54
Far has a spectacular aura aboutFar has a spectacular aura about
Send a message via Skype™ to Far
check the forum, similar udf is already discussed and i am sure you also want it for LES / DES usage
Far 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
whats the cause of error? immortality OpenFOAM Running, Solving & CFD 13 March 24, 2021 07:15
[blockMesh] Errors during blockMesh meshing Madeleine P. Vincent OpenFOAM Meshing & Mesh Conversion 51 May 30, 2016 10:51
using METIS functions in fortran dokeun Main CFD Forum 7 January 29, 2013 04:06
[blockMesh] error message with modeling a cube with a hold at the center hsingtzu OpenFOAM Meshing & Mesh Conversion 2 March 14, 2012 09:56
Version 15 on Mac OS X gschaider OpenFOAM Installation 113 December 2, 2009 10:23


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