CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   FLUENT (https://www.cfd-online.com/Forums/fluent/)
-   -   UDF for Oscillations (https://www.cfd-online.com/Forums/fluent/33012-udf-oscillations.html)

 Cfdtoy February 10, 2004 17:00

UDF for Oscillations

Hi

In case i want to oscillate a wall with a frequency f, does anyone know how to create a UDF for the same ? . There is a spring analogy in the website however, i want the oscillation to be somethin like a sine wave kinda.

thanks for ur time and help

Cfdtoy

 FJ February 16, 2004 03:21

Re: UDF for Oscillations

Hi,

DEFINE_CG_MOTION is very suitable for your issue. If the wall velocity is a function of time, It's very easy to coding . You just define the following in the UDF macro.

vel[0] = sin(2*3.14*f)

Thanks

FJ

 Cfdtoy February 18, 2004 17:50

"Non Positive Volumes" ..Re: UDF for Oscillations

Hi there

Thanks for the response. I used the sinusoidal variation, I kinda tend to get "non-positive volume Exist" Message during my simulation using Dynamic Meshes.

Although, I use min and max volumes as the same as given by the Grid Check Function

Does anyone know how to treat the message ?

Thanks

CFDtoy

 FJ February 23, 2004 01:42

Re: "Non Positive Volumes" ..Re: UDF for Oscillati

Hi,

It must be that the time step size is too large to re-mesh. To use small time step size, it will be no problem.

FJ

 Cfdtoy February 26, 2004 18:11

Re: UDF for Oscillations

Hello FJ...

Thanks for the response. I would like to explain my situation a little better. I have an object ( say Diameter 'd') placed in a liquid. This rod ( solid wall around) is protuding inside the domain. Now, the rod is made to move back and forth with an frequency 'f' ..so..if i take a rod placed in the domain and mesh it around, the movement of the wall (rod) would be considered as a case of dynamic meshing isnt it ? Hence, I request help for writing a UDF for the wall movement ..I did look around Fluent and came to know about the Define_CG_Motion but how about Define_Grid_motion ?

If you can ..can you help me with a sample code ?

Thanks

CFDtoy

 FJ February 27, 2004 02:20

Re: UDF for Oscillations

Hi,

I'll send you cas file and UDF directly.

FJ

 Qureshi March 12, 2004 08:21

Re: UDF for Oscillations

Can I also have the file and UDF?

 FJ March 15, 2004 05:36

Re: UDF for Oscillations

Hi,

The UDF is very simple , see the followings.

---

#include "udf.h"

real freq = 1.;

DEFINE_CG_MOTION(osc, dt, vel, omega, time, dtime) {

vel[0] = sin(2*M_PI*freq*time);

}

---

This is my personal opinion that UDF for FLUENT MDM function is not so difficult compared with its settings. I mean, I think , most difficult settings is "Define-Dynamic Mesh-Zones". Sometimes this function makes me unhappy!.

FJ

 All times are GMT -4. The time now is 03:48.