CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (https://www.cfd-online.com/Forums/fluent-udf/)
-   -   trying to adapt the tutorial: Using a UDF Flexible Oscillating membrane (https://www.cfd-online.com/Forums/fluent-udf/116234-trying-adapt-tutorial-using-udf-flexible-oscillating-membrane.html)

bluAero April 15, 2013 13:38

trying to adapt the tutorial: Using a UDF Flexible Oscillating membrane
 
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;

bluAero April 15, 2013 17:14

can any one help me :( ??

vasava April 16, 2013 03:44

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.

hellovers60 August 14, 2013 01:55

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....

vasava August 15, 2013 04:47

@Ankit: Can you post your UDF here? we can have a look.

hellovers60 August 23, 2013 00:55

#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

vasava August 23, 2013 03:13

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..

hellovers60 August 28, 2013 10:48

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 August 30, 2013 23:14

Finally, the udf is successfully executed. Thnaks... But after some iteration it gives an error " divergence detected in AMG solver: Pressure correction"

bia December 7, 2015 17:12

divergence detected
 
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 .':mad:
I tried with all the velocity and pressure schemes , different time steps , :cool:adaptative time step, implicit update... but always thye same divergence just the error message change from'' x momentum to y momentum '':confused:
stuck there for months :( :D just wanna be cool to not get crazy .

Saman95 June 26, 2018 03:55

hello

please say how i can find case and data file?

Saman95 June 26, 2018 03:56

Quote:

Originally Posted by bluAero (Post 420744)
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;

hello

please say how i can find case and data file?

Saman95 June 26, 2018 06:04

case file
 
I search on web but I can't find the case file

please send me address link or send case file to my Email.


Samanabasian95@gmail.com


All times are GMT -4. The time now is 22:57.