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

trying to simulate the compression stroke inside cylinder, using UDF for injection

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 17, 2009, 04:24
Default trying to simulate the compression stroke inside cylinder, using UDF for injection
  #1
New Member
 
Join Date: Oct 2009
Posts: 26
Rep Power: 16
mayur is on a distinguished road
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
mayur is offline   Reply With Quote

Old   November 25, 2009, 06:57
Default
  #2
Senior Member
 
dmoroian's Avatar
 
Dragos
Join Date: Mar 2009
Posts: 648
Rep Power: 20
dmoroian is on a distinguished road
Check this post: http://www.cfd-online.com/Forums/flu...tml#post237366
dmoroian is offline   Reply With Quote

Old   November 25, 2009, 07:59
Default
  #3
New Member
 
raoudha
Join Date: Nov 2009
Posts: 18
Rep Power: 16
raoudha is on a distinguished road
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
raoudha is offline   Reply With Quote

Old   November 25, 2009, 08:11
Default
  #4
Senior Member
 
dmoroian's Avatar
 
Dragos
Join Date: Mar 2009
Posts: 648
Rep Power: 20
dmoroian is on a distinguished road
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.
dmoroian is offline   Reply With Quote

Old   November 25, 2009, 08:21
Default
  #5
New Member
 
raoudha
Join Date: Nov 2009
Posts: 18
Rep Power: 16
raoudha is on a distinguished road
thank you dmoroian
raoudha is offline   Reply With Quote

Old   November 27, 2009, 10:56
Default
  #6
New Member
 
raoudha
Join Date: Nov 2009
Posts: 18
Rep Power: 16
raoudha is on a distinguished road
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
raoudha is offline   Reply With Quote

Old   November 28, 2009, 04:59
Default You need a compiler
  #7
Senior Member
 
dmoroian's Avatar
 
Dragos
Join Date: Mar 2009
Posts: 648
Rep Power: 20
dmoroian is on a distinguished road
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
dmoroian is offline   Reply With Quote

Old   November 28, 2009, 05:35
Default
  #8
New Member
 
raoudha
Join Date: Nov 2009
Posts: 18
Rep Power: 16
raoudha is on a distinguished road
hi dragos
i have installed c++ but the same msg is chown,
shall i use an other compiler?

thankx
raoudha
raoudha is offline   Reply With Quote

Old   November 28, 2009, 11:46
Default
  #9
Senior Member
 
dmoroian's Avatar
 
Dragos
Join Date: Mar 2009
Posts: 648
Rep Power: 20
dmoroian is on a distinguished road
I have never used fluent+udf on Windows, but Microsoft Visual C++ should be enough. Do you have it installed?

Dragos
dmoroian is offline   Reply With Quote

Old   November 28, 2009, 12:20
Default
  #10
New Member
 
raoudha
Join Date: Nov 2009
Posts: 18
Rep Power: 16
raoudha is on a distinguished road
yes i have installed Microsoft Visual C++2008 express edition
and no change :-((
raoudha is offline   Reply With Quote

Old   November 28, 2009, 13:51
Default
  #11
New Member
 
raoudha
Join Date: Nov 2009
Posts: 18
Rep Power: 16
raoudha is on a distinguished road
finally this problem is solved, i had to open fluent from Visual Studio command prompt
thank for help
raoudha
raoudha is offline   Reply With Quote

Old   December 2, 2009, 00:23
Default
  #12
New Member
 
Saeed Abbasi
Join Date: Sep 2009
Location: Iran
Posts: 20
Rep Power: 16
sabbasi_mr is on a distinguished road
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......
sabbasi_mr is offline   Reply With Quote

Old   December 2, 2009, 05:47
Default
  #13
New Member
 
raoudha
Join Date: Nov 2009
Posts: 18
Rep Power: 16
raoudha is on a distinguished road
hello Saeed
i'll try to do it
thankx
raoudha is offline   Reply With Quote

Old   December 15, 2013, 08:04
Default UDF rotation for a VAWT
  #14
New Member
 
mangs
Join Date: Jul 2012
Posts: 2
Rep Power: 0
famangs is on a distinguished road
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;
}
Attached Images
File Type: jpg vawt.jpg (96.7 KB, 30 views)

Last edited by famangs; December 15, 2013 at 08:18. Reason: Fluent
famangs is offline   Reply With Quote

Old   December 15, 2013, 11:46
Default You need to study more
  #15
Senior Member
 
dmoroian's Avatar
 
Dragos
Join Date: Mar 2009
Posts: 648
Rep Power: 20
dmoroian is on a distinguished road
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.
dmoroian is offline   Reply With Quote

Old   December 16, 2013, 04:30
Default
  #16
New Member
 
mangs
Join Date: Jul 2012
Posts: 2
Rep Power: 0
famangs is on a distinguished road
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
famangs 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
[Earn cash] UDF For freely vibrating cylinder Ken FLUENT 1 January 1, 2011 15:27
Accelarating of a cylinder UDF Ashutosh FLUENT 4 August 3, 2010 06:52
adaptive mesh & UDF for cylinder compressor Pedro_RZ FLUENT 0 April 18, 2007 03:57
meshing F1 front wing Steve FLUENT 0 April 17, 2003 12:37
Species Mass Fraction inside UDF using PDF? Daniel Schneider FLUENT 0 September 20, 2000 06:34


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