|
[Sponsors] |
December 16, 2020, 06:58 |
Problem in UDF for dynamic mesh
|
#1 |
Member
Dnyanesh Mirikar
Join Date: Jul 2019
Posts: 35
Rep Power: 7 |
Hello everyone,
I'm trying to simulate synthetic jet, where bottom wall oscillates according to the displacement equation. X=a*s*sin(2*pi*f*t) 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); SET_DEFORMING_THREAD_FLAG (THREAD_T0 (t)); 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. |
|
December 18, 2020, 00:32 |
Parallelization of UDF
|
#2 |
Member
Dnyanesh Mirikar
Join Date: Jul 2019
Posts: 35
Rep Power: 7 |
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" DEFINE_GRID_MOTION(diaphragm,domain,dt,time,dtime) { 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; SET_DEFORMING_THREAD_FLAG(THREAD_T0(tf)); begin_f_loop(f,tf) { f_node_loop(f,tf,n) { v=F_NODE(f,tf,n); if (NODE_POS_NEED_UPDATE (v)) { NODE_POS_UPDATED(v); dy0=amp*sin(omega*time); /*the displacement of the bottom wall in the Y direction*/ NODE_Y(v)=NODE_Y(v)+dy0; } } } end_f_loop(f,tf); #endif } |
|
Tags |
dynamic mesh, grid motion, oscillation, synthetic jet, udf |
|
|
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 10:39 |
[mesh manipulation] Importing Multiple Meshes | thomasnwalshiii | OpenFOAM Meshing & Mesh Conversion | 18 | December 19, 2015 19:57 |
[snappyHexMesh] No layers in a small gap | bobburnquist | OpenFOAM Meshing & Mesh Conversion | 6 | August 26, 2015 10:38 |
Need HELP in writing UDF for a dynamic mesh problem | farrux | Fluent UDF and Scheme Programming | 0 | July 3, 2015 03:53 |
How to control Minximum mesh space? | hung | FLUENT | 7 | April 18, 2005 10:38 |