|
[Sponsors] |
September 13, 2019, 06:40 |
Explanation of a UDF codes
|
#1 |
New Member
Josh
Join Date: May 2019
Posts: 16
Rep Power: 7 |
Hi guys,
I am trying to apply a UDF to move one of the wall of a cubic tank in order to generate wave in the fluid inside. Regarding these thread I found: UDF for moving wall (oscillating) udf for sinusoidally oscillating wall It seems that I am in a very similar case, because I need to move just one of the faces (let's say along the x-axis for example) to obtain the effect. Essentially I do not grasp if these codes are moving one wall back and forth, because the key point of simulation is that my wall goes REALLY back and forth between a starting and an ending position (following a cosinusoidal law for the x-velocity that I wrote). Do they do this? In which part? |
|
September 23, 2019, 06:17 |
|
#2 |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 |
Code:
#include "udf.h" #include "dynamesh_tools.h" DEFINE_CG_MOTION(oscillate,dt,vel,omega,time,dtime ) { Thread *t; face_t f; /* define the variables */ t = DT_THREAD(dt); begin_f_loop(f,t) /* loop over each face in the zone to create an array of data */ { vel[0]= sin(time); } end_f_loop(f,t) } best regards |
|
Tags |
motion wall, sloshing tank 2d, sloshingtank3d, udf code, udf customize |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
UDF for vapor pressure | anuarun | Fluent UDF and Scheme Programming | 13 | June 23, 2024 14:12 |
Replicating Scalable Wall Function with a UDF | yousefaz | FLUENT | 0 | August 4, 2017 03:30 |
Source Term UDF VS Porous Media Model | pchoopanya | Fluent UDF and Scheme Programming | 1 | August 28, 2013 07:12 |
DEFINE_GEOM UDF Problems | Pat | FLUENT | 0 | August 14, 2003 14:16 |
UDF, UDF, UDF, UDF | Luc SEMINEL | Main CFD Forum | 0 | November 25, 2002 05:01 |