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

UDF moving wall

Register Blogs Community New Posts Updated Threads Search

Like Tree7Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 1, 2012, 17:27
Default
  #21
Member
 
Vidit Sharma
Join Date: Aug 2012
Location: Delhi, India
Posts: 32
Rep Power: 14
Vidit Sharma is on a distinguished road
Quote:
Originally Posted by Vidit Sharma View Post
Dear Sir,

Thank you for the reply. I was not able to compile it in fluent as for that fluent is asking two files one is .c the code and the other one is .h header file. Can u plz explain how to do that in fluent I have wasted a lot of time with Visual Stdio may be that was not the right way. So, plz tell me.

Regards.
Dear Sir,

I tried to compile the UDF in fluent but it is showing some error as given below that i am not able to solve.

"Deleted old libudf\ntx86\2ddp\libudf.dll
The system cannot find the file specified.
The system cannot find the file specified.
(system "copy C:\Fluent.Inc\fluent6.3.26\src\makefile_nt.udf libudf\ntx86\2ddp\makefile")
1 file(s) copied.
(chdir "libudf")()
(chdir "ntx86\2ddp")()
'nmake' is not recognized as an internal or external command,
operable program or batch file.
'nmake' is not recognized as an internal or external command,
operable program or batch file.

Done."

Is anything i can do to eliminate this??

regards.
Vidit Sharma is offline   Reply With Quote

Old   November 1, 2012, 18:40
Default
  #22
Member
 
Join Date: Sep 2011
Posts: 43
Rep Power: 15
Komon is on a distinguished road
Hi!

Well, .c is the file type in which UDFs have to be saved. For the .h header file I assume that it is asking you for the #include "udf.h" command. and for dynamic meshes you have to add #include "dynamesh_tools.h" as well.

I don't know if this helps you at all as these are basic things reagrding UDFs...as for regarding ''nmake'' problem which I've not yet come across I found this thread:
http://www.cfd-online.com/Forums/flu...ues-nmake.html

hope it helps.
Komon is offline   Reply With Quote

Old   November 2, 2012, 07:57
Default
  #23
Member
 
Vidit Sharma
Join Date: Aug 2012
Location: Delhi, India
Posts: 32
Rep Power: 14
Vidit Sharma is on a distinguished road
Quote:
Originally Posted by Komon View Post
Hi!

Well, .c is the file type in which UDFs have to be saved. For the .h header file I assume that it is asking you for the #include "udf.h" command. and for dynamic meshes you have to add #include "dynamesh_tools.h" as well.

I don't know if this helps you at all as these are basic things reagrding UDFs...as for regarding ''nmake'' problem which I've not yet come across I found this thread:
http://www.cfd-online.com/Forums/flu...ues-nmake.html

hope it helps.
Dear Sir,

I have tried so many ways to compile the UDF on windows 64 bits, then I did not get anywhere. I still have this error, What should I do, Please let me know the details.

Deleted old libudf\win64\2d\libudf.dll
1 file(s) copied.
(system "copy "C:\PROGRA~1\ANSYSI~1\v130\fluent"\fluent13.0. 0\sr c\makefile_nt.udf "libudf\win64\2d\makefile" ")
1 file(s) copied.
(chdir "libudf")()
(chdir "win64\2d")()
# Generating ud_io1.h
time_step.c
# Generating udf_names.c because of makefile time_step.obj
udf_names.c
# Linking libudf.dll because of makefile user_nt.udf udf_names.obj time_step.obj
Microsoft (R) Incremental Linker Version 9.00.30729.01
Copyright (C) Microsoft Corporation. All rights reserved.

LINK : fatal error LNK1104: cannot open file 'kernel32.lib'

Done.
Vidit Sharma is offline   Reply With Quote

Old   November 2, 2012, 23:27
Default
  #24
Member
 
Join Date: Sep 2011
Posts: 43
Rep Power: 15
Komon is on a distinguished road
Hi!

Well at this point there is not much I could suggest. I have to admit, my experience in writing UDFs is not very vast. But from kernel32.lib trouble I would assume there is something wrong with the way you compile. Therefore I would suggest a manual I used to get Fluent on 64bit win7 accept compiled UDFs. check if what you do is ok regarding this (as there might be some problems if you don't set the compiler correctly-32 instead 64 bit):
http://www.cfd-online.com/Wiki/Fluen...ows_7_64bit.3F
Komon is offline   Reply With Quote

Old   October 21, 2013, 04:14
Default
  #25
New Member
 
Marie
Join Date: Oct 2013
Location: Knk
Posts: 24
Rep Power: 13
KITetima is on a distinguished road
hello,


I know that this post is quite old, however I have the same problem with the cylinder error. Did you solve your problem ?

thanks
KITetima is offline   Reply With Quote

Old   October 21, 2013, 04:37
Default
  #26
Member
 
Join Date: Sep 2011
Posts: 43
Rep Power: 15
Komon is on a distinguished road
could you describe at first the geometry(axisymmetric, 3d, ...)-there was a suggestion here that define_cg_motion might not be an appropriate udf for such simulations. for me it was, but maybe for someone else's geometry it is not. I assume that in such way, a better response can be found faster.
Komon is offline   Reply With Quote

Old   October 22, 2013, 06:11
Default
  #27
New Member
 
tran trung
Join Date: Aug 2013
Posts: 23
Rep Power: 13
tranvantrung551987 is on a distinguished road
hi
how to fluent message error ?
tranvantrung551987 is offline   Reply With Quote

Old   October 22, 2013, 06:17
Default
  #28
Member
 
Join Date: Sep 2011
Posts: 43
Rep Power: 15
Komon is on a distinguished road
sorry, but I do not understand your question-can you re-post it as I think you left something out of it.
Komon is offline   Reply With Quote

Old   May 9, 2014, 10:14
Exclamation
  #29
New Member
 
Khalid Ansari
Join Date: Apr 2014
Posts: 8
Rep Power: 12
khalidansari4u is on a distinguished road
hi guys

will some1 please help me. i m also working on flow past a cylinder and my cylinder wall is rotationally oscillating. i want to write a program for that but i dont know how to write it so some1 pls help!!!!!!!!!
khalidansari4u is offline   Reply With Quote

Old   April 9, 2015, 02:01
Default
  #30
Member
 
sanjeet Limbu
Join Date: Mar 2015
Posts: 91
Rep Power: 11
sanjeetlimbu is on a distinguished road
Dear frds

I am trying the rigid body motion in CFD fluent but UDF is showing error in preview. Warning unable to read the motion history


i got the following lines for UDF velocity :

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

DEFINE_CG_MOTION(oscillate, dt, vel, omega, time, dtime)
{
Thread *t;
face_t f; /* define the variables */

t = DT_THREAD(dt); /* get the thread pointer for which the motion is defined */

/* if (!Data_Valid_P())
/* return; /* check if the values of the variables are accessible before you compute the function */

begin_f_loop(f, t) /* loop over each face in the zone to create an array of data */
{
if (time <= 0.012)
vel[0] = (643* time); /* define the velocity of the moving zone---*/
else if (0.012 < time < 0.019)
vel[0] = vel[0] + (0.057 * time);
else if (0.019 < time < 0.027)
vel[0] = 14;
else if (0.027 < time < 0.03)
vel[0] = vel[0] - (0.162*time);
else if (0.03 < time)
vel[0] = 0;
}
end_f_loop(f, t)
}


I tried using the profile but the displacement is not meeting the 254mm as i mentioned in profile...

Please help to get this error
Attached Images
File Type: jpg velocity and distance vs time(milisec).jpg (19.6 KB, 26 views)
File Type: jpg Referance mesh needed.jpg (35.9 KB, 40 views)
sanjeetlimbu is offline   Reply With Quote

Old   April 9, 2015, 13:05
Default
  #31
Member
 
sanjeet Limbu
Join Date: Mar 2015
Posts: 91
Rep Power: 11
sanjeetlimbu is on a distinguished road
I am trying to move using the folowing UDF
getting the warning that its unable to read the file

#include "udf.h"
DEFINE_CG_MOTION(oscillate, dt, vel, omega, time, dtime)
{
Thread *t;
face_t f; /* define the variables */

t = DT_THREAD(dt); /* get the thread pointer for which the motion is defined */

/* if (!Data_Valid_P())
/* return; /* check if the values of the variables are accessible before you compute the function */

begin_f_loop(f, t) /* loop over each face in the zone to create an array of data */
{
if (time <= 0.02)
vel[0] = (673* time); /* define the velocity of the moving zone---*/
else if (0.02 < time < 0.027)
vel[0] = 14;
else if (0.027 < time < 0.03)
vel[0] = 3 - 2800*(time-0.03);
else if (0.03 < time)
vel[0] = 0;
}
end_f_loop(f, t)
}
Attached Images
File Type: jpg velocity and distance vs time(milisec).jpg (19.6 KB, 4 views)
File Type: jpg Referance mesh needed.jpg (35.9 KB, 9 views)
sanjeetlimbu is offline   Reply With Quote

Old   January 5, 2016, 13:53
Default Regarding the dynamic mesh
  #32
New Member
 
jessy dayal
Join Date: Jan 2014
Location: India
Posts: 5
Rep Power: 12
jessyastronasa is on a distinguished road
Hello there .., I'm simulating a flow through a c-d nozzle....I need a help for simulating a pintle (wall boundary), which moves translational (along linear axis only) along the axis of the nozzle ...The pintle moves transnationally along x axis from the point near throat towards the upstream boundary ...

What are the options in dynamic mesh should I use ??

Is there any udf required, if yes, I needed help to write it ...
jessyastronasa is offline   Reply With Quote

Old   January 6, 2016, 17:46
Default
  #33
Member
 
Join Date: Sep 2011
Posts: 43
Rep Power: 15
Komon is on a distinguished road
Hi!

Firstly, I'd ask, just to know if I got it correctly, is this like an injector with a needle in it? Or is it something else?

Years ago I did an udf for a case where we had a horn moving up and down, like a piston. So, I might be able to say something more if your case is similar to mine (hence the given question). But I honestly need to take a look at what has been done exactly to comment more.

regards
Komon is offline   Reply With Quote

Old   January 7, 2016, 11:02
Default regarding udf
  #34
New Member
 
jessy dayal
Join Date: Jan 2014
Location: India
Posts: 5
Rep Power: 12
jessyastronasa is on a distinguished road
Hello komon,

Its a kind of similar to your explanation for an injection. It's like a cylindrical rod being inserted into a nozzle (along the nozzle central line), so as to control (choke the flow) the mass flow rate which in turn will control the thrust ....I'm simulating this case in 2D ...

If you have a model udf which uses the transitional movement of the wall boundary condition ...id be grateful for it ....

Boundary conditions are an Axis, nozzle inlet, nozzle wall, pintle (moving wall), farfield.

The cylindrical rod (pintle) would move about 26 mm backwards from nozzle throat (extreme downstream position) towards nozzle inlet .
jessyastronasa is offline   Reply With Quote

Old   January 7, 2016, 11:56
Default
  #35
Member
 
Join Date: Sep 2011
Posts: 43
Rep Power: 15
Komon is on a distinguished road
Hi!

So, here's the UDF I used to make a moving wall boundary condition. I used the DEFINE_CG_MOTION udf. With it I moved the horn up and down in our domain, so I'd say you can easily change it to describe movement of your part. As you can see, you just need to put your movement into the vel[0] variable.

Code:
DEFINE_CG_MOTION(sonotrode,dt,vel,omega,time,dtime)
{
  Thread *t;
  face_t f;                 /* define the variables */

  t = DT_THREAD(dt);        /* get the thread pointer for which the motion is defined */

   begin_f_loop(f,t)         /* loop over each face in the zone to create an array of data */
    {
        vel[0] = ;    /* define the velocity of the moving zone---*/
     }
   end_f_loop(f,t)
}
what is a bit more tricky, as I remember, is the choice of the proper attributes for your domain in Fluent. If I remember correctly (I cannot access fluent atm), I defined the horn AND the inside of the domain(mesh) as a rigid body. This enabled me to avoid problems with negative volumes or adaptation of the mesh when the horn moved (I tried this but results were not ok as far as I remember, and also-I could not make big movements). I think that then, you can apply then the udf to them (again, if I remember well, to both of them).

This would be my advice, I'm just sorry that I cannot access the fluent now to really check how exactly I did this. What I'd say is-try and see. But since the mesh is considered as rigid body and I think that I made it move with the horn, please check how this affects your mesh at the outlet or walls etc. I fear it might make some negative volumes there if the mesh is very refiened at the walls/outlet (our case was pretty specific and didn't need to be refined at walls at all).

hope this helps
Komon is offline   Reply With Quote

Old   January 10, 2016, 02:24
Default regarding udf
  #36
New Member
 
jessy dayal
Join Date: Jan 2014
Location: India
Posts: 5
Rep Power: 12
jessyastronasa is on a distinguished road
hello komon, thanks for posting the udf ....but im facing the interpretation error ....

its showing that line 8 .....it is this one ( t = DT_THREAD(dt); /* get the thread pointer for which the motion is defined */ ), comment says that structure reference not implemented ...

And which one of the three dynamic methods should i use for my problem (smoothing, layering,etc) .
jessyastronasa is offline   Reply With Quote

Old   January 10, 2016, 05:27
Default
  #37
Member
 
Join Date: Sep 2011
Posts: 43
Rep Power: 15
Komon is on a distinguished road
hmm, never got that error. Maybe you need to define something regarding the boundary or the inside of the domain. did you choose them as rigid body?

for the rest, I fear I cannot really say, since I have no access to fluent atm to check which method was done. Let me see some things, if I have this noted somewhere...
Komon is offline   Reply With Quote

Old   January 10, 2016, 16:53
Default
  #38
Member
 
Join Date: Sep 2011
Posts: 43
Rep Power: 15
Komon is on a distinguished road
hey,

actually, I just figured I do have access to fluent. so, sorry for the mistake on my side, I thought fluent is not available on the machines I use.

regarding the mesh, my setting was to layering and remeshing. in the settings, I chose ratio based factor of 0,5 for layering and local cell for remeshing (max cell skewness of 0,7 I see is set, and min/max lenght scales are 0 and 1000m?).

for your udf-I got a bit rusty with fluent since I haven't used it in a while but...do you compile or interpret the udf and are you sure interpreted udf would be enough for the dynamic mesh udf?

regards
Komon is offline   Reply With Quote

Old   January 12, 2016, 12:09
Default regarding udf
  #39
New Member
 
jessy dayal
Join Date: Jan 2014
Location: India
Posts: 5
Rep Power: 12
jessyastronasa is on a distinguished road
Hello komon,

i'm interpreting the udf, and it was giving the error which i told you earlier ....can you please give your mail id ..i think its better i send you the case file ...
jessyastronasa is offline   Reply With Quote

Old   January 12, 2016, 12:42
Default
  #40
Member
 
Join Date: Sep 2011
Posts: 43
Rep Power: 15
Komon is on a distinguished road
Hi!

before this, try to compile the udf...look at this thread
http://www.cfd-online.com/Forums/flu...f-problem.html
Komon is offline   Reply With Quote

Reply


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Commercial meshers] Fluent3DMeshToFoam simvun OpenFOAM Meshing & Mesh Conversion 50 January 19, 2020 16:33
How to use UDF to define a moving wall lingo FLUENT 9 August 19, 2014 10:14
stationary wall vs. moving wall user0314 FLUENT 0 August 26, 2011 10:42
udf variable for wall temperature Kiran FLUENT 0 July 31, 2008 09:31
Multicomponent fluid Andrea CFX 2 October 11, 2004 06:12


All times are GMT -4. The time now is 19:05.