CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   FLUENT (https://www.cfd-online.com/Forums/fluent/)
-   -   Moving Wall Boundary Condition (https://www.cfd-online.com/Forums/fluent/84749-moving-wall-boundary-condition.html)

neo_mor February 8, 2011 02:43

Moving Wall Boundary Condition
 
dear friends
Is there any udf for moving wall with time dependent velocity on the web?
i need it ASAP.

thanks,

Amir February 8, 2011 03:49

Hi Morteza,
I previously wrote a UDF for rotating wall. theta as a function of time, for other types of wall motions you can change some lines of that :
#include "udf.h"
#include "stdio.h"
#include "math.h"
// rotation theta=f(t)
DEFINE_GRID_MOTION(eye,domain,dt,time,dtime)
{
Thread *tf = DT_THREAD(dt);
face_t f;
Node *v;
real dtheta,a,b;
int n;
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);
dtheta=......; // compute dtheta as a function of dtime (differentiation)
a=cos(dtheta)*NODE_X(v)-sin(dtheta)*NODE_Y(v); // rotation tensor
b=sin(dtheta)*NODE_X(v)+cos(dtheta)*NODE_Y(v);
NODE_X(v)=a;
NODE_Y(v)=b;
}
}
}
end_f_loop(f,tf);
}

neo_mor February 8, 2011 03:56

Thanks
 
Dear Amir
thank u for your help.can you explain differences between moving wall and grid motion?

Amir February 11, 2011 03:36

Hi Morteza,
you can hang this UDF where ever you want, obviously your wall also has grid points and they can move. but notice that you can use remeshing and smoothing options in your case.

neo_mor February 12, 2011 04:00

thank u Amir,
Consider a tank that contains water about its half height.
and the whole tank begins to move with time dependent velocity.
in this case i should use moving mesh or moving wall?

tanks in advance.

Amir February 12, 2011 08:58

Hi Morteza,
of course you should use moving mesh without deforming or smoothing or... .
if velocity was constant, you could easily use moving reference frame but in your case the above UDF works. just hook it to all of your zones like wall,interior,... except fluid ones.

neo_mor February 15, 2011 04:02

Hi Amir
Thanks for your help.i will check it and whether i have problem i will inform you.
thanks again.


All times are GMT -4. The time now is 06:37.