CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (http://www.cfd-online.com/Forums/fluent-udf/)
-   -   Help with UDF (http://www.cfd-online.com/Forums/fluent-udf/70201-help-udf.html)

mayur November 17, 2009 04:24

Help with UDF
 
Dear Sir/Madam

I am trying to simulate the compression stroke inside the cylinder. I need to specify a UDF for Injection from 310 degrees to 340 Degrees. I have to activate my inlet during this period.

Can you please guide me in writing an UDF. I have no experience in Programming :(

Thank you

dmoroian November 25, 2009 06:57

Check this post: http://www.cfd-online.com/Forums/flu...tml#post237366

raoudha November 25, 2009 07:59

dear dmoroian
i'm simulating slug flow with phase change (boiling heat transfer) in vertical tube and i need also to specify a UDF for mass and heat transfer between gas and liquid phases, would please help me

dmoroian November 25, 2009 08:11

Hi Raoudha,
Your topic is difficult, and I don't have much experience with it (mass transfer between phases). As a general answer you have to use DEFINE_SOURCE macro.

raoudha November 25, 2009 08:21

thank you dmoroian

raoudha November 27, 2009 10:56

hello dmoroian
i'm trying to understand how using udf for boiling flow (horizontal boiling flow) but when compiling (define-> udf->compiled) an error msg is shown: the system cannot find the path specified (the boiling.c file was saved in the same directory)

"(system "copy C:\Fluent.Inc\fluent6.2.16\src\makefile_nt.udf libudf\ntx86\2ddp\makefile") 1 fichier(s) copi‚(s).
0
(chdir "libudf")()
(chdir "ntx86\2ddp")()
'nmake' n'est pas reconnu en tant que commande interne
ou externe, un programme ex‚cutable ou un fichier de commandes.
'nmake' n'est pas reconnu en tant que commande interne
ou externe, un programme ex‚cutable ou un fichier de commandes.

Done."
what shall i do
thank in advance
raoudha

dmoroian November 28, 2009 04:59

You need a compiler
 
Quote:

...
'nmake' n'est pas reconnu en tant que commande interne
...
Hi Raoudha,
From the message you posted above I suspect that you don't have a compiler installed on your machine.

Dragos

raoudha November 28, 2009 05:35

hi dragos
i have installed c++ but the same msg is chown,
shall i use an other compiler?

thankx
raoudha

dmoroian November 28, 2009 11:46

I have never used fluent+udf on Windows, but Microsoft Visual C++ should be enough. Do you have it installed?

Dragos

raoudha November 28, 2009 12:20

yes i have installed Microsoft Visual C++2008 express edition
and no change :-((

raoudha November 28, 2009 13:51

finally this problem is solved, i had to open fluent from Visual Studio command prompt
thank for help
raoudha

sabbasi_mr December 2, 2009 00:23

some times the the nmake problem is solved, but other problems exist. It is better to counteract all problem at once:
Run the Vcvars32.bat file in the ..\BIN directory found in the installed directory under ..\MSDEV or ..\DevStudio\VC of your installed visual c++ directory. This file contains the environment variables required to run build tools from a command prompt.
After that run the fluent from this command prompt......

raoudha December 2, 2009 05:47

hello Saeed
i'll try to do it
thankx

famangs December 15, 2013 08:04

UDF rotation for a VAWT
 
1 Attachment(s)
Hi,
i want to do a simulation of a vawt using UDF with "Fluent" but i have some problem. I want that the blades move only with the wind velocity.
When i use a dynamic mesh, i have the message" negative volume" in "unsteady solver" but in "steady" i have solution.

Someone can help me. i send also the picture of my study

my udf:
DEFINE_CG_MOTION(piston,dt,vel,omega,time,dtime)
{
Thread *t;
face_t f;
real NV_VEC(A);
real force, dv;
/* reset velocities */
NV_S(vel, =, 0.0);
NV_S(omega, =, 0.0);
if (!Data_Valid_P())
return;
/* get the thread pointer for which this motion is defined */
t = DT_THREAD(dt);
}
/* compute pressure force on body by looping through all faces */
force = 0.0;
begin_f_loop(f,t)
{
F_AREA(A,f,t);
force += F_P(f,t) * NV_MAG(A);
}
end_f_loop(f,t)
/* compute change in velocity, i.e., dv = F * dt / mass
velocity update using explicit Euler formula */
dv = dtime * force / 50.0;
v_prev += dv;
Message ("time = %f, x_vel = %f, force = %f\n", time, v_prev,
force);
/* set x-component of velocity */
vel[0] = v_prev;
}

dmoroian December 15, 2013 11:46

You need to study more
 
Hello Famangs,
I don't know what a "vawt" is, so I looked at your picture, and it seems that you have a rotating part and a static part separated by an interface. I presume that you want to move only the rotor by rotating it around an axis. The rotation will be given by a resultant pressure force.
According to my view, these are the errors that you made:
1. The force should be vectorial not scalar. The summation you do, should be accurate only for a plannar surface.
2. You need to modify angular velocity (omega), not translational velocity, otherwise your rotating part will go out of its axis.

These errors are mostly conceptual, so I would advise you to ask for help from your supervisor, or study more.

famangs December 16, 2013 04:30

Hello, dmoroian,
thanks for your reply, it's the first time that i use the udf. I have a lot of difficulty with it. VAWT means vertical axis wind turbine


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