CFD Online Logo CFD Online URL
Home > Forums > Software User Forums > ANSYS > FLUENT

Problem in UDF for dynamic mesh

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

LinkBack Thread Tools Search this Thread Display Modes
Old   December 16, 2020, 05:58
Default Problem in UDF for dynamic mesh
Dnyanesh Mirikar
Join Date: Jul 2019
Posts: 35
Rep Power: 6
DnyanMiri is on a distinguished road
Hello everyone,

I'm trying to simulate synthetic jet, where bottom wall oscillates according to the displacement equation.


I have created an UDF, which gets compiled but when I start solution it shows error before first iteration. (screenshot is attached below).

UDF I have created is as following

#include "udf.h"

DEFINE_GRID_MOTION(diaphragm, domain, dt, time, dtime)
int n;
Node *node;
face_t f;

real a, rad, r, rc, s, p, freq, A;

real xc[ND_ND];

a = 0.0002;

rad = xc[0];

if (rad<0)
rad *= -1;

r = rad;

rc = 0.0225;

s = (1-(r/rc));

p = 3.1425;

freq = 150;

Thread *t = DT_THREAD(dt);


begin_f_loop (f, t)
f_node_loop (f, t, n);
node = F_NODE (f, t, n);

A = a*s*sin(2*p*freq*time);

NODE_Y (node) = A;
end_f_loop (f, t)

Please guide me what I'm doing wrong. I'm new to dynamic mesh settings. Thank you for your help.
Attached Images
File Type: jpg error-dyn.jpg (75.8 KB, 5 views)
DnyanMiri is offline   Reply With Quote

Old   December 17, 2020, 23:32
Default Parallelization of UDF
Dnyanesh Mirikar
Join Date: Jul 2019
Posts: 35
Rep Power: 6
DnyanMiri is on a distinguished road
I was able set UDF for my dynamic mesh Here is the UDF.

Now problem is that I want to speed up my solution, so parallelization is needed. I have gone through the user manual but I was not able to grasp fully what need to be done. If you help point out whats need to be change to convert this for parallel use, I would be grateful. Thank you!

#include "udf.h"


real amp,dy0,omega;
amp=0.0005; /*amplitude of the oscillatory motion 5mm*/
omega=942; /*oscillations frequency*/

#if !RP_HOST
int n;
Thread *tf = DT_THREAD(dt);
face_t f;
Node *v;


dy0=amp*sin(omega*time); /*the displacement of the bottom wall in the Y direction*/
DnyanMiri is offline   Reply With Quote


dynamic mesh, grid motion, oscillation, synthetic jet, udf

Thread Tools Search this Thread
Search this Thread:

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
udf for valve closing a pipe using dynamic mesh chem engineer Fluent UDF and Scheme Programming 2 May 13, 2017 09:39
[mesh manipulation] Importing Multiple Meshes thomasnwalshiii OpenFOAM Meshing & Mesh Conversion 18 December 19, 2015 18:57
[snappyHexMesh] No layers in a small gap bobburnquist OpenFOAM Meshing & Mesh Conversion 6 August 26, 2015 09:38
Need HELP in writing UDF for a dynamic mesh problem farrux Fluent UDF and Scheme Programming 0 July 3, 2015 02:53
How to control Minximum mesh space? hung FLUENT 7 April 18, 2005 09:38

All times are GMT -4. The time now is 05:38.