|
[Sponsors] |
August 16, 2015, 02:54 |
UDF function for mesh spacing
|
#1 |
New Member
Jeric zhang
Join Date: May 2015
Posts: 3
Rep Power: 11 |
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) |
|
August 18, 2015, 07:31 |
|
#2 |
Senior Member
Join Date: Mar 2015
Posts: 892
Rep Power: 18 |
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: and then checking if the results are what you expect. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
whats the cause of error? | immortality | OpenFOAM Running, Solving & CFD | 13 | March 24, 2021 08:15 |
[blockMesh] Errors during blockMesh meshing | Madeleine P. Vincent | OpenFOAM Meshing & Mesh Conversion | 51 | May 30, 2016 11:51 |
using METIS functions in fortran | dokeun | Main CFD Forum | 7 | January 29, 2013 05:06 |
[blockMesh] error message with modeling a cube with a hold at the center | hsingtzu | OpenFOAM Meshing & Mesh Conversion | 2 | March 14, 2012 10:56 |
Version 15 on Mac OS X | gschaider | OpenFOAM Installation | 113 | December 2, 2009 11:23 |