CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   FLUENT (http://www.cfd-online.com/Forums/fluent/)
-   -   Dynamic Mesh UDF (http://www.cfd-online.com/Forums/fluent/31181-dynamic-mesh-udf.html)

Jkl April 1, 2003 10:09

Dynamic Mesh UDF
 
I'm actually dealing with simple 2D test cases on Dynamic Meshes.

What I'm trying to do is to simulate a piston moving with constant velocity in a very long cylinder, by UDF, using Layering Dynamic Procedure on a Quad mesh.

I've written some VERY VERY simple UDF functions, like this:

#include "udf.h" DEFINE_CG_MOTION(Piston,dt,vel,omega,time,dtime) {

NV_S(vel,=,0.0);

NV_S(omega,=,0.0);

if(!Valid_Data_P())

return;

vel[0]=10; }

BUT It doesn't work.....

could anyone please provide me some samples of such an UDF???

Am I missing something else ???

I've read the documentation, is there something more I should read ???

Thanks a lot,

Jkl

Alex Munoz April 1, 2003 13:04

Re: Dynamic Mesh UDF
 
Hi

Careful with "return" before "vel[0]=10"; better write else {}

Regards

Alex Munoz

Alexandre April 2, 2003 02:22

Re: Dynamic Mesh UDF
 
Did you compile your UDF (DM only works with compiled UDFs).

Jkl April 3, 2003 11:53

Re: Dynamic Mesh UDF
 
Sorry for replying so late !!!

I compiled the UDF and hooked It to the right boundary, defined the deforming zones confining with the moving wall BUT when I want to view the mesh motion Preview nothing happens....

Any Samples would really be appreciated !

Thank you,

Jkl.

caloggero April 12, 2003 15:50

Re: Dynamic Mesh UDF
 
Hi JKL! I did the same with a moving airfoil, I realised that you need to set a very small time step otherwise, there are remeshing errors! thus you cannot see in real time the displacement of your piston! all what you can do is checking it at small intervals. I have questions about the UDF you wrote: NV_S(vel,=,0.0); NV_S(omega,=,0.0); if(!Valid_Data_P()) return; vel[0]=10; #1-this syntax (e.g. NV_S(vel,=,0.0))is it the C language one? or is it imposed by fluent? #2-here, you didn't declare as variable NV_S, does that mean that it is a variable recongnized by fluent? #3-when you write vel[0]=10, why this zero between [] ? vel is it an array of x, y & z component of the linear velocity? if you have any help about writing UDFs, please tellme where i can find it! ciao

calogero April 15, 2003 02:24

Re: Dynamic Mesh UDF
 
Hi JKL! another question please: what is the definition of the angle Z to define in the CG_MOTION dialog box ? thanx

jkl April 29, 2003 05:17

Re: Dynamic Mesh UDF
 
Dear caloger I'm sorry for replying so late but I've been away for few days.

Anyway: #1: That syntax is imposed by fluent

#2: NV_S(vel,=,0.0) is an instruction that states velocity vector is initialized to 0.0

#3: vel[0]=10 means the first component of velocity vector, namely the x-component, is 10 m/s.

You can find Help on UDF on the fluent user's area, downloading pdf fl61udf.pdf.

Best regards,

Jkl.

Buon Lavoro.

calogero April 29, 2003 09:05

Re: Dynamic Mesh UDF
 
thanx JKL ! since I've posted the last message, I've got fluent doc and I wrote the UDF. the movement is ok. but the pb, is that when I preview the dynamic mesh, it gives a very bad mesh deforming coz the mvt is large and the foil crosses its own wake several times. I wonder IF I'm setting bad remeshing method parameters ! (i posted message on that):coz I didn't find any case on that, and the fluent doc isn't sufficient. OR should I look for another method to model this movement coz it's too large ! (I posted another-recent- message on that) : what I'm trying to do for the moment with sliding mesh for the rotation + dynamic mesh for the foil oscillation. thanx for any help.

almostafa67 July 24, 2010 06:46

need help
 
hi,
I want to simulate motion of a rigid cylinder,to do this I should prepare a udf,when I load the udf file I face with this error
Error: open_udf_library: The system cannot find the file specified.
Can anybody help.

imharoon1 September 6, 2011 23:43

Visual studio
 
hi,
I want to simulate motion of a rigid cylinder,to do this I should prepare a udf,when I load the udf file I face with this error
Error: open_udf_library: The system cannot find the file specified.
Can anybody help.


Install the Microsoft visual studio 6.0.I think it will solve your problem
Regards
Haroon


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