CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Fluent UDF and Scheme Programming

trying to adapt the tutorial: Using a UDF Flexible Oscillating membrane

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

Like Tree2Likes
  • 1 Post By vasava
  • 1 Post By hellovers60

Reply
 
LinkBack Thread Tools Display Modes
Old   April 15, 2013, 13:38
Default trying to adapt the tutorial: Using a UDF Flexible Oscillating membrane
  #1
New Member
 
musab
Join Date: Nov 2012
Posts: 11
Rep Power: 5
bluAero is on a distinguished road
I read that tutorial name : Using a UDF to Control the Dynamic Mesh of a
Flexible Oscillating Membrane ...

and i used it in fluent .. also i used the attachment c file ( that name is : butterfly-flex.c )

the moving type of membrane is ( moving arc motion ) .

but i note that the memberane length from this coordinates (-0.083552375 , -0.1 ) To (0.083552375 , -0.1 ) , which mean its length is 0.16710475 , and the center of arc is ( 0 , -0.1 ) ..

i need that :-

1- i need to use this ( arc motion ) for another membrane that have another length ( in example for 0.5 ) , what i shall to do in the C file ??

2- i need to put the center of arc in another point in x direction ( in example : ( 3 , -0.1 ) , how i can do that ??

3- what is the mean of any one of these ?
cg_vel[0] = 0.0;
cg_vel[1] = 0.0;
cg_vel[2] = 0.0;

cg_omega[0] = 0.0;
cg_omega[1] = 0.0;
cg_omega[2] = omega;

Last edited by bluAero; April 15, 2013 at 14:13.
bluAero is offline   Reply With Quote

Old   April 15, 2013, 17:14
Default
  #2
New Member
 
musab
Join Date: Nov 2012
Posts: 11
Rep Power: 5
bluAero is on a distinguished road
can any one help me ??
bluAero is offline   Reply With Quote

Old   April 16, 2013, 03:44
Default
  #3
Senior Member
 
Paritosh Vasava
Join Date: Oct 2012
Location: Lappeenranta, Finland
Posts: 553
Rep Power: 13
vasava will become famous soon enough
1- i need to use this ( arc motion ) for another membrane that have another length ( in example for 0.5 ) , what i shall to do in the C file ??

You need to change the 'moving_arc' part of the UDF based on the dimension and motion of your boundaries. If you have the original UDF (and the PDF file) the comments in the UDF are very useful.

2- i need to put the center of arc in another point in x direction ( in example : ( 3 , -0.1 ) , how i can do that ??

You must do that in fluent (dynamic mesh settings). However you must modify the UDF in accordance to how you anticipate the motion.

3- what is the mean of any one of these ?
cg_vel[0] = 0.0;
cg_vel[1] = 0.0;
cg_vel[2] = 0.0;

cg_omega[0] = 0.0;
cg_omega[1] = 0.0;
cg_omega[2] = omega;

There are the linear and angular velocities of the center of gravity.
bluAero likes this.
vasava is offline   Reply With Quote

Old   August 14, 2013, 01:55
Default
  #4
New Member
 
Ankit Gohel
Join Date: Jul 2013
Posts: 5
Rep Power: 4
hellovers60 is on a distinguished road
i am also facing the same problem.
I have to oscillate the cylinder to 180 degree.
i have to write the udf for the same.
but when i enter the udf it takes the inlet velocity insted of rotational motion....
hellovers60 is offline   Reply With Quote

Old   August 15, 2013, 04:47
Default
  #5
Senior Member
 
Paritosh Vasava
Join Date: Oct 2012
Location: Lappeenranta, Finland
Posts: 553
Rep Power: 13
vasava will become famous soon enough
@Ankit: Can you post your UDF here? we can have a look.
vasava is offline   Reply With Quote

Old   August 23, 2013, 00:55
Default
  #6
New Member
 
Ankit Gohel
Join Date: Jul 2013
Posts: 5
Rep Power: 4
hellovers60 is on a distinguished road
#include"udf.h"
#define ZONE_ID 3
#include<math.h>
#define dynamesh_tools.h
#define p 22/7
#define a 2*p /* when a=2*p*f, and take f=1*/

static real omega[2]_prev = 0.0;

DEFINE_CG_MOTION(cylinder, dt, velocity, omega, time, dtime)

{
Thread*t;
face_t f;

velocity[0]=0.0;
velocity[1]=0.0;
velocity[2]=0.0;

omega[0]=0.0;
omega[1]=0.0;

if (!Data_Valid_P())
return;

t=DT_OMEGA_CG(t);

domega[2] = a*sin(2*p*f*dtime);
omega[2]_prev += omega[2];

Message ("time = %f, omega[2] = %f\n", time, omega[2]_prev);

omega[2]=a*sin(2*p*f*time);

}


but in that omega[2] equation there is forcing frequency...
still i dont know... because when i go through the paper they always talk about ration of f/f0. where f0 is vortex shadding frequency of steady cylinder.

If there is some prob than pls help me
Thanks
zhaomu67 likes this.
hellovers60 is offline   Reply With Quote

Old   August 23, 2013, 03:13
Default
  #7
Senior Member
 
Paritosh Vasava
Join Date: Oct 2012
Location: Lappeenranta, Finland
Posts: 553
Rep Power: 13
vasava will become famous soon enough
You have so many problems with your UDF.

1. The use of 'f'.
2. The use of 't'
3. The use of 'omega[2]_prev'.
4. I think that you can avoid using 'a' and 't=DT_OMEGA_CG(t);'.

And so on.........

Here is the corrected UDF.

#include "udf.h"
#include "dynamesh_tools.h"

#define p1 22/7
#define f1 1.0

DEFINE_CG_MOTION(cylinder, dt, cg_vel, cg_omega, time, dtime)
{
Thread*t;
face_t f;
real omega_prev;
omega_prev = 0.0;

cg_vel[0] = 0.0;
cg_vel[1] = 0.0;
cg_vel[2] = 0.0;

if (!Data_Valid_P())
return;

/* t = DT_OMEGA_CG(dt); */

cg_omega[0] = 0.0;
cg_omega[1] = 0.0;
cg_omega[2] = (2*p1)*sin(2*p1*f1*dtime);

omega_prev = omega_prev + cg_omega[2];
Message ("time = %f, omega[2] = %f\n", time, omega_prev);
}


Lets see if that works for you..
vasava is offline   Reply With Quote

Old   August 28, 2013, 10:48
Default
  #8
New Member
 
Ankit Gohel
Join Date: Jul 2013
Posts: 5
Rep Power: 4
hellovers60 is on a distinguished road
Sir, Now its create problem in compile.
Its give an error report
nmake is not recognized as an internal or external command

Open_udf_library: the system cant find the file specified.
hellovers60 is offline   Reply With Quote

Old   August 30, 2013, 23:14
Default
  #9
New Member
 
Ankit Gohel
Join Date: Jul 2013
Posts: 5
Rep Power: 4
hellovers60 is on a distinguished road
Finally, the udf is successfully executed. Thnaks... But after some iteration it gives an error " divergence detected in AMG solver: Pressure correction"
hellovers60 is offline   Reply With Quote

Old   December 7, 2015, 18:12
Default divergence detected
  #10
bia
New Member
 
nabaouia
Join Date: Aug 2014
Posts: 14
Rep Power: 3
bia is on a distinguished road
I 've faced the same problem when simulating a dynamic mesh of a moving membrane after some iterations it diverge ''divergence detected in AMG solver x momentum .'
I tried with all the velocity and pressure schemes , different time steps , adaptative time step, implicit update... but always thye same divergence just the error message change from'' x momentum to y momentum ''
stuck there for months just wanna be cool to not get crazy .
bia is offline   Reply With Quote

Reply

Thread Tools
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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
UDF for object oscillating in direction of flow tsaget Fluent UDF and Scheme Programming 11 September 15, 2015 15:07
tutorial for solving oscillating cylinder problem CH FLUENT 8 April 2, 2014 10:56
Help! Compiled UDF problem 4 Wave tank tutorial Shane FLUENT 1 September 3, 2010 02:32
UDF tutorial 18 jan Main CFD Forum 0 October 16, 2006 04:05
UDF in MDM Tutorial mAx FLUENT 0 November 28, 2005 08:34


All times are GMT -4. The time now is 16:47.