MindMap Gallery UDF data structure, loop macro, geometry macro
Learn the first chapter of UDF function. UDF mainly involves many aspects such as data structure, loop macro and geometric macro. Subsequent updates…
Edited at 2024-04-09 14:37:44This Valentine's Day brand marketing handbook provides businesses with five practical models, covering everything from creating offline experiences to driving online engagement. Whether you're a shopping mall, restaurant, or online brand, you'll find a suitable strategy: each model includes clear objectives and industry-specific guidelines, helping brands transform traffic into real sales and lasting emotional connections during this romantic season.
This Valentine's Day map illustrates love through 30 romantic possibilities, from the vintage charm of "handwritten love letters" to the urban landscape of "rooftop sunsets," from the tactile experience of a "pottery workshop" to the leisurely moments of "wine tasting at a vineyard"—offering a unique sense of occasion for every couple. Whether it's cozy, experiential, or luxurious, love always finds the most fitting expression. May you all find the perfect atmosphere for your love story.
The ice hockey schedule for the Milano Cortina 2026 Winter Olympics, featuring preliminary rounds, quarterfinals, and medal matches for both men's and women's tournaments from February 5–22. All game times are listed in Eastern Standard Time (EST).
This Valentine's Day brand marketing handbook provides businesses with five practical models, covering everything from creating offline experiences to driving online engagement. Whether you're a shopping mall, restaurant, or online brand, you'll find a suitable strategy: each model includes clear objectives and industry-specific guidelines, helping brands transform traffic into real sales and lasting emotional connections during this romantic season.
This Valentine's Day map illustrates love through 30 romantic possibilities, from the vintage charm of "handwritten love letters" to the urban landscape of "rooftop sunsets," from the tactile experience of a "pottery workshop" to the leisurely moments of "wine tasting at a vineyard"—offering a unique sense of occasion for every couple. Whether it's cozy, experiential, or luxurious, love always finds the most fitting expression. May you all find the perfect atmosphere for your love story.
The ice hockey schedule for the Milano Cortina 2026 Winter Olympics, featuring preliminary rounds, quarterfinals, and medal matches for both men's and women's tournaments from February 5–22. All game times are listed in Eastern Standard Time (EST).
UDF data structure, loop macro, geometry macro
UDF fixed format start
#include "udf.h"
mesh structure
2D mesh
mesh face=face
mesh edge=face
3D mesh
mesh=cell
mesh face=face
grid edge=edge
Computational domain
Domain
cell thread(linked list)
cell
face thread(linked list)
faces
cell zone condition
solid1 (linked list) corresponds to a thread
Thread*t
solid2 (linked list) corresponds to a thread
Thread*t
fluid1 (linked list) corresponds to a thread
Thread*t
fluid2 (linked list) corresponds to a thread
Thread*t
Composed of many custom structures (grids)
cell_t c
boundary condition
inlet (linked list) corresponds to a thread
Thread*t
outlet (linked list) corresponds to a thread
Thread*t
wall (linked list) corresponds to a thread
Thread*t
wall(interior)(linked list) corresponds to a thread
Thread*t
Composed of many custom structures (grid surfaces)
face_t f
Variables are stored in grid (custom) structures
type of data
Domain*d
Thread*t
cell_t c
face_t f
Node *node
The format in the red part cannot be moved
real xc[ND_ND]
two-dimensional
real xc[2]
three dimensional
real xc[3]
Geometry Macro
Find geometric features
(c,t)
Thread *t and cell_t c
(f,t)
Thread *t and face_t f
C_NNODES(c, t)
Number of cell nodes
n=C_NNODES(c, t); Equivalent to defining int n;
C_NFACES(c, t)
Number of cells
F_NNODES(f, t)
subtopic
C_CENTROID(xc, c, t)
cell center coordinates
Current grid center coordinates
x→xc[0]
y→xc[1]
z→xc[2]
F_CENTROID(x, f, t)
face center coordinates
Current grid center coordinates
x→xc[0]
y→xc[1]
F_AREA(A, f, t)
face normal vector
usage
real area[ND_ND]; F_AREA(area, f, t)
x→area[0]
unit normal vector
area[0]/sqrt(area[0]*area[0] area[1]*area[1] area[2]*area[2])
y→area[1]
unit normal vector
area[1]/sqrt(area[0]*area[0] area[1]*area[1] area[2]*area[2])
z→area[2]
unit normal vector
area[2]/sqrt(area[0]*area[0] area[1]*area[1] area[2]*area[2])
NV_MAG(A)
grid area
sqrt(area[0]*area[0] area[1]*area[1] area[2]*area[2])
Use with F_AREA(A, f, t)
real A[ND_ND];real At; F_AREA(A, f, t); At=NV_MAG(A)
Assign area to At
C_VOLUME(c, t)
grid volume
C_VOLUME_2D(c, t)
2D mesh volume
Cuboid planar (extends infinitely in z direction)
Fluent believes that the Z direction is 1m
Axisymmetric
2Pi
NODE_X(nn)
Node coordinates
NODE_Y(nn)
Node coordinates
NODE_Z(nn)
Node coordinates
moving mesh
variable
C_R(c,t)
density
C_P(c,t)
pressure
C_U(c,t)
speed in x direction
C_V(c,t)
y direction speed
C_W(c,t)
z direction speed
C_T(c,t)
temperature
C_H(c,t)
enthalpy
C_K(c,t)
turbulent kinetic energy
C_D(c,t)
Turbulent kinetic energy dissipation rate
C_YI(c,t,i)
quality score
C_UDSI(c,t,i)
User-defined scalar
Loop macro
Thread loop
thread_loop_c(t,d)
Loop through the calculation domains (solid1, solid2, fluid1, fluid2) in cell zone condition
Assume that when solid1 is calculated, solid1 is t
thread_loop_f(t,d)
Loop through the calculation domains (inlet, outlet,...) in the boundary condition
Assume that when inlet is calculated, inlet is t
cell loop
begin_c_loop(c,t)
end_c_loop(c,t)
Can be used alone
Loop through the cells in t
Assume that when solid1 is calculated, solid1 is t
Loop over mesh in solid1
face loop
begin_f_loop(f,t)
end_f_loop(f,t)
Can be used alone
Loop through the cells in t
Assume that when inlet is calculated, inlet is t
Loop over the grid in the inlet
Use structure
thread_loop_c(t,d) { begin_c_loop(c,t) {...} end_c_loop(c,t) }
thread_loop_f(t,d) { begin_f_loop(f,t) {...} end_f_loop(f,t) }