Sie sind auf Seite 1von 12

Moving wall with velocity profile -- CFD Online Discussion Forums http://www.cfd-online.com/Forums/fluent/86619-moving-wall-velocity-p...

[S

Home
News
Forums
Wiki
Links
Jobs
Books
Events
Tools
Feeds
About
Search

Home > Forums > FLUENT


Welcome, moloykb.
You last visited: Today at 09:45
Private Messages: Unread 0, Total 4.

USER PANEL BLOGS FAQ COMMUNITY NEW POSTS UPDATED THREADS SEARCH QUICK LINKS LOG OUT

Likes

PAGE 1 OF 2 1 2 >

LINKBACK THREAD TOOLS SEARCH THIS THREAD RATE THREAD DISPLAY MODES

March 28, 2011, 23:23 Moving wall with velocity profile #1

Tobard Hi everyone!
New Member
I need to study a transient flow inside a closed cylinder which is starting to
Join Date: Mar 2011 rotate. It seems impossible to put a velocity profile instead of a constant
Posts: 28
value under rotating wall boundary conditions with Fluent. Is there another
Rep Power: 3
way to do this? Is there somebody here who already tried such a transient
simulation?

Thank you very much for your help!

Like

March 28, 2011, 23:44 #2

Amir Hi,
Senior Member if you try components option in wall boundary conditions, you can impose
any velocity profile by a UDF.

1 of 12 2/21/2013 10:52 AM
Moving wall with velocity profile -- CFD Online Discussion Forums http://www.cfd-online.com/Forums/fluent/86619-moving-wall-velocity-p...

Like

Amir
Join Date: May 2009
Location: Shiraz, Iran
Posts: 709
Blog Entries: 1
Rep Power: 11

March 29, 2011, 00:14 #3

Tobard Quote:
New Member
Originally Posted by Amir
Join Date: Mar 2011 Hi,
Posts: 28 if you try components option in wall boundary conditions, you can
Rep Power: 3 impose any velocity profile by a UDF.

Thank you for your answer. I tried this but I would like to input a rotational
speed and the only velocity components that are displayed are X, Y and Z
components in m/s... Is it possible to change it in order to work in
cylindrical coordinates for example? I haven't found anything satisfactory
so far.

Thank you!

Like

March 29, 2011, 02:31 #4

Amir note that you can implement coordinates of surface elements. so you can
Senior Member use a trigonometric functions in your UDF to obtain Cartesian components
from rotational speed.

Like

Amir
Join Date: May 2009
Location: Shiraz, Iran
Posts: 709
Blog Entries: 1
Rep Power: 11

2 of 12 2/21/2013 10:52 AM
Moving wall with velocity profile -- CFD Online Discussion Forums http://www.cfd-online.com/Forums/fluent/86619-moving-wall-velocity-p...

March 29, 2011, 21:45 #5

Tobard Dear Amir,


New Member
Ok, I am trying to use these UDF. Since I am not really used to this option,
Join Date: Mar 2011 it is difficult for me to understand how to implement coordinates of surface
Posts: 28
elements, as you said. Would it be possible to have an example of the kind
Rep Power: 3
of script you was thinking about? I haven't found anything similar in Fluent
UDF Guide.

Thank you very much for your help!

Tobard.

Like

March 29, 2011, 22:11 #6

Amir Hi,
Senior Member it's something like this (as a part of UDF):
Quote:

real x[ND_ND],xf,yf,zf,theta;
F_CENTROID(x,f,t);
xf=x[0];
yf= x[1];
zf= x[2];
Amir
Join Date: May 2009
theta=atan(yf/xf);
Location: Shiraz, Iran F_PROFILE(f,t,i) = R*omega*sin(theta);
Posts: 709
Blog Entries: 1
Rep Power: 11 it can be used for x-component. (check it's sign and ...)

Like

March 30, 2011, 22:50 #7

Tobard Hi,
New Member
Following your advice and trying to understand UDF philosophy, I have
Join Date: Mar 2011 written the following function (I think I will have to do 2 different files in
Posts: 28
order to fill both X and Y velocity component fields in Fluent boundary
Rep Power: 3
conditions later, but it is a global base):
Quote:

#include"udf.h"

3 of 12 2/21/2013 10:52 AM
Moving wall with velocity profile -- CFD Online Discussion Forums http://www.cfd-online.com/Forums/fluent/86619-moving-wall-velocity-p...

DEFINE_ADJUST(try3,d)
{
Thread *tf;
face_t f;
real time;
time = CURRENT_TIME;
real x[ND_ND];
real xf, yf;
real omega;
omega = 2*time;
begin_f_loop(f,tf)
{
if (BOUNDARY_FACE_THREAD_P(tf))
{
F_CENTROID(x,f,time);
xf = x[0];
yf = x[1];
F_U(f,time) = -omega*yf; /* For x-component */
F_V(f,time) = omega*xf; /* For y-component */
}
}
end_f_loop(f,tf)
}

Could you please take a look at this? The purpose is to change wall
rotational velocity at each time step, and I am not sure my code is correct.

Besides when I try to interpret this with Fluent, I get these errors:
Quote:

Error: [...] line 8: parse error.


Error: [...] line 9: parse error.
Error: [...] line 10: parse error.
Error: [...] line 11: omega: undeclared variable

and I don't understand why!?

Thank you very much for your help!

Tobard

Like

March 31, 2011, 02:31 #8

Amir Hi,
Senior Member I proposed you these changes:
Quote:

#include "udf.h"
#include "math.h"
DEFINE_PROFILE(x_velocity,thread,position)

4 of 12 2/21/2013 10:52 AM
Moving wall with velocity profile -- CFD Online Discussion Forums http://www.cfd-online.com/Forums/fluent/86619-moving-wall-velocity-p...

{
face_t f;
real time = CURRENT_TIME;
real x[ND_ND],theta;
real R=1.0;
Amir real omega=2.0*time;
Join Date: May 2009
begin_f_loop(f, thread)
Location: Shiraz, Iran
Posts: 709 {
Blog Entries: 1 F_CENTROID(x,f,thread);
Rep Power: 11 theta=atan(x[1]/x[0]);
F_PROFILE(f, thread, position) = R*omega*sin(theta);
}
end_f_loop(f, thread)
}

I've compiled this without any error.


you're right, you need another UDF for y velocity which is similar to above.

regards,

Like

stuart23 likes this.

March 31, 2011, 03:49 #9

Tobard Thank you, it helps me much! I just would like to understand some points:
New Member
- My study needs to change ONLY wall (boundary) velocity (and then
Join Date: Mar 2011 observe inertia and viscosity action into the fluid). Does your function
Posts: 28
really allow that? Using it under boundary conditions menu would then only
Rep Power: 3
apply it on boundary faces?

- Is it better to use F_PROFILE instead of F_U or F_V? I am afraid that


F_PROFILE may change both X and Y velocity components although I need
to change them one by one. (Furthermore F_U and F_V would allow me to
not use trigonometrical functions, writing u= -omega*y and v= omega*x)

- Does Fluent accept using several interpreted UDFs at the same time? Or
do I have to compile them? Thank you again, I think it will work now!

Regards,
Tobard

Like

March 31, 2011, 14:05 #10

5 of 12 2/21/2013 10:52 AM
Moving wall with velocity profile -- CFD Online Discussion Forums http://www.cfd-online.com/Forums/fluent/86619-moving-wall-velocity-p...

Amir Hi,
Senior Member
Quote:

- My study needs to change ONLY wall (boundary) velocity (and


then observe inertia and viscosity action into the fluid). Does your
function really allow that? Using it under boundary conditions
menu would then only apply it on boundary faces?

Amir
Join Date: May 2009 it depends on where you'll hook this UDF, if you hook that over wall
Location: Shiraz, Iran
boundary, it would change wall velocities.
Posts: 709
Blog Entries: 1
Rep Power: 11 Quote:

- Is it better to use F_PROFILE instead of F_U or F_V? I am afraid


that F_PROFILE may change both X and Y velocity components
although I need to change them one by one. (Furthermore F_U
and F_V would allow me to not use trigonometrical functions,
writing u= -omega*y and v= omega*x)

I don't agree with you, in both cases you need to use trigonometric
functions but here, you can simplify your relations. i.e. :
R*omega*sin(theta)=R*omega*sin(atan(y/x))=y*omega
these relations are applicable to both procedures. note that using
DEFINE_PROFILE for setting boundary conditions is more conservative and
reliable than using other functions.

Quote:

- Does Fluent accept using several interpreted UDFs at the same


time? Or do I have to compile them? Thank you again, I think it
will work now!

that's one of the restrictions of interpreted UDFs. I proposed you using


compiled one.

Regards,
Amir

Like
Last edited by Amir; March 31, 2011 at 15:24.

April 4, 2011, 20:52 #11

Tobard Hi,
New Member
I post this last message to thank you: my simulation is now working, using
Join Date: Mar 2011 DEFINE_PROFILE just as you said.
Posts: 28
A little feedback: working with direct coordinates rather than using
Rep Power: 3
trigonometrical functions avoids sign problems.

Regards,

6 of 12 2/21/2013 10:52 AM
Moving wall with velocity profile -- CFD Online Discussion Forums http://www.cfd-online.com/Forums/fluent/86619-moving-wall-velocity-p...

Tobard

Like
Last edited by Tobard; April 14, 2011 at 01:46.

April 14, 2011, 01:40 #12

Tobard Hi everybody!
New Member
I come here again because I encountered some new difficulties: I succeed
Join Date: Mar 2011 in putting a profile law making the wall of my 2D cylinder rotate.
Posts: 28
Rep Power: 3
Now I would like to improve my model by dividing my cylinder in several
zones (adding a wall along portion of diameter, basically). The whole
assembly is not rotating as expected because "you cannot use the moving
wall condition to model problems where the wall has a motion normal to
itself. FLUENT will neglect any normal component of wall motion that you
specify using the methods below." (Fluent User Guide).

A moving reference frame would allow me to make my walls rotate. But is


it possible to hook a UDF to a moving reference frame (I see no available
field for that)? Is there another way to do it?

Thank you so much for your help!

Tobard

Like

April 15, 2011, 01:53 #13

Amir Hi,
Senior Member I've done such cases by implementation of dynamic mesh, in FLUENT 6.3
you can't use MRF for arbitrary motions(as you said) but it may be included
in latest versions.

Like

Amir
Join Date: May 2009
Location: Shiraz, Iran
Posts: 709
Blog Entries: 1
Rep Power: 11

7 of 12 2/21/2013 10:52 AM
Moving wall with velocity profile -- CFD Online Discussion Forums http://www.cfd-online.com/Forums/fluent/86619-moving-wall-velocity-p...

April 15, 2011, 02:12 #14

Tobard I work on Fluent 12.0.1 or 12.1 and it seems not to be better. Do you think
New Member a moving mesh could be a solution? My geometry is similar to a disk split
into to parts...
Join Date: Mar 2011
Posts: 28
Tobard
Rep Power: 3

Like
Last edited by Tobard; April 15, 2011 at 21:55.

April 15, 2011, 21:17 #15

Amir certainly, moving mesh can help you to impose normal velocity to walls. I'll
Senior Member appreciate any other ideas ...

Like

Amir
Join Date: May 2009
Location: Shiraz, Iran
Posts: 709
Blog Entries: 1
Rep Power: 11

May 4, 2011, 01:11 #16

Tobard Dear Amir,


New Member
Do you know where I could find samples or UDF functions close to my
Join Date: Mar 2011 problem? I really don't see how to write (and hook) a UDF making my
Posts: 28
walls move and it is really difficult to find any help on the Internet.
Rep Power: 3

Any concrete suggestion would be appreciated...

Thank you very much.

Tobard

Like

8 of 12 2/21/2013 10:52 AM
Moving wall with velocity profile -- CFD Online Discussion Forums http://www.cfd-online.com/Forums/fluent/86619-moving-wall-velocity-p...

May 5, 2011, 01:52 #17

Amir Hi,
Senior Member I wrote a UDF which rotate a wall but you can change that easily; here you
are:
Quote:

#include "udf.h"
#include "stdio.h"
#include "math.h"
#define pi 3.1415
Amir
Join Date: May 2009
#define amp 0.174
Location: Shiraz, Iran #define freq 0.75
Posts: 709 real w=2*pi*freq;
Blog Entries: 1 DEFINE_GRID_MOTION(motion,domain,dt,time,dtime)
Rep Power: 11
{
Thread *tf = DT_THREAD(dt);
face_t f;
Node *v;
real theta,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);
theta=(-1)*amp*w*cos(w*time)*dtime;
a=cos(theta)*NODE_X(v)-sin(theta)*NODE_Y(v);
b=sin(theta)*NODE_X(v)+cos(theta)*NODE_Y(v);
NODE_X(v)=a;
NODE_Y(v)=b;
}
}
}
end_f_loop(f,tf);
}

Like

seucj and cdf_user like this.

May 6, 2011, 05:33 #18

Tobard Dear Amir,


New Member
What a relief to receive your answer! It greatly helped me and my problem

9 of 12 2/21/2013 10:52 AM
Moving wall with velocity profile -- CFD Online Discussion Forums http://www.cfd-online.com/Forums/fluent/86619-moving-wall-velocity-p...

Join Date: Mar 2011 is solved: it rotates!


Posts: 28
Rep Power: 3
I sincerely thank you!

Tobard

Like

May 16, 2011, 21:49 #19

Tobard Dear Amir,


New Member
Sorry for coming to you again...
Join Date: Mar 2011 My simulations with Dynamic mesh give me strange results. Do you know
Posts: 28
how Fluent manage the transition between two time steps? The velocity is
Rep Power: 3
well defined at the boundary but seems not able to diffuse into the whole
fluid zone...!
I tried with a DEFINE_CD_MOTION function instead of the
DEFINE_GRID_MOTION one with no improvement. So I really don't know
where this problem comes from.

Is there restrictions in the use of Dynamic mesh?


Have you ever encountered such an issue?

Thank you again for your help!

Tobard

Like

May 16, 2011, 22:44 #20

Amir Hi Tobard,
Senior Member pay attention to locations where you hooked this UDF for. In other words,
in dynamic zones, set e.g. walls, define interior and other rotating
boundaries except the fluid zones.

regards,

Amir
Amir
Join Date: May 2009 Like
Location: Shiraz, Iran
Posts: 709
Blog Entries: 1
Rep Power: 11

10 of 12 2/21/2013 10:52 AM
Moving wall with velocity profile -- CFD Online Discussion Forums http://www.cfd-online.com/Forums/fluent/86619-moving-wall-velocity-p...

PAGE 1 OF 2 1 2 >

Tags Edit Tags

fluent, rotating wall, transient, velocity profile

Quick Reply

Message:

Please click one of the Quick Reply icons in the posts above to
activate Quick Reply.

Options

Quote message in reply?

« Previous Thread | Next Thread »

Posting Rules

You may post new threads


You may post replies
You may post attachments
You may edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump
Forum Rules

Similar Threads
Thread Thread Starter Forum Replies Last Post

11 of 12 2/21/2013 10:52 AM
Moving wall with velocity profile -- CFD Online Discussion Forums http://www.cfd-online.com/Forums/fluent/86619-moving-wall-velocity-p...

Similar Threads

calculated velocity profile as new wall


wouter OpenFOAM 0 March 5, 2011 05:25
boundary

January 14, 2010


The velocity of wall boundary condtion Dhb FLUENT 1
23:30

October 28, 2005


Prescribed inflow velocity profile - how to? Alan Main CFD Forum 10
22:44

UDF for slip and moving wall lichun Dong FLUENT 2 May 31, 2005 00:54

October 26, 2004


Variables Definition in CFX Solver 5.6 RP CFX 2
12:43

All times are GMT +5.5. The time now is 10:47.

Contact Us - CFD Online - Top

© CFD Online

12 of 12 2/21/2013 10:52 AM

Das könnte Ihnen auch gefallen