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

Multiphase UDF Programming

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By pakk

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 17, 2020, 15:08
Default Multiphase UDF Programming
  #1
New Member
 
Mohammad Jamali
Join Date: Oct 2020
Posts: 6
Rep Power: 5
Mohammad_Jamali is on a distinguished road
Hello dear friends.
If you pay attention to the submitted forms.
I want to write a program that can automatically record the density and pressure associated with the id-nub of ​​each zone .
please guide me how could write Code for get Cell_zone ID automaticly and put It as Zone_ID Argument In function.
also in third Pic -i know Code Is Wrong But when i Load it in Fluent Show Error For Second Line And Write (PARSE....)
why Fluent did not Accept DEFIEN_INIT......

Thank You for Response and Help
Attached Images
File Type: jpg 01.JPG (44.4 KB, 7 views)
File Type: jpg 02.JPG (46.1 KB, 4 views)
File Type: jpg 03.JPG (43.0 KB, 10 views)

Last edited by Mohammad_Jamali; November 18, 2020 at 13:47.
Mohammad_Jamali is offline   Reply With Quote

Old   November 18, 2020, 15:25
Default
  #2
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 26
pakk will become famous soon enough
Next time, can you just copy your code, not a picture of your code?

You have already a typo in the first line. It is include, not inclide.
Mohammad_Jamali likes this.
pakk is offline   Reply With Quote

Old   November 18, 2020, 16:42
Default
  #3
New Member
 
Mohammad Jamali
Join Date: Oct 2020
Posts: 6
Rep Power: 5
Mohammad_Jamali is on a distinguished road
hi , first i am thankful for your helps and notes for guide me .
i have Some Change in Code but it doe not work ,
may be write 2 example for how use Lookup thread and thread_id
in the fact must of my problems are about define ID numbers and how Relating ID number to Cell Zone or Domain

my Code :
#include "udf.h"
DEFINE_ADJUST(M_Dens,d){
Domain *d ;
d=Get_Domain(1) ;
int id=4;
Thread t=lookup_thread(1,4);
double Den = 0.655 ;
thread_loop_t (t,d){
begin_t_loop(t,d)
c_r(c,t) = Den ;
c_t(c,t) = 300 ;
end_t_loop
}
}
Mohammad_Jamali is offline   Reply With Quote

Old   November 19, 2020, 03:04
Default
  #4
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
Code:
#include "udf.h"

DEFINE_ADJUST(M_Dens,d)
{
int id=4;
Thread *t=Lookup_Thread(d,id);
cell_t c;
double Den = 0.655 ;

begin_c_loop(t,d)
{
	C_R(c,t) = Den ;
	C_T(c,t) = 300 ;
}
end_c_loop
}
read Ansys Fluent Customization manual for more examples
__________________
best regards


******************************
press LIKE if this message was helpful
AlexanderZ is offline   Reply With Quote

Old   November 19, 2020, 03:43
Default
  #5
New Member
 
Mohammad Jamali
Join Date: Oct 2020
Posts: 6
Rep Power: 5
Mohammad_Jamali is on a distinguished road
Hi - thank you for attention .
I read Fluent's udf manual - but unfortunately I did not find a good example to illustrate these phrases.
Mohammad_Jamali 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
udf for multiphase flow with real gas mixture sugumaran Fluent UDF and Scheme Programming 2 January 27, 2013 23:10
UDF programming fullmonty FLUENT 5 June 30, 2011 02:40
udf for multiphase flow with real gas mixture sugumaran ANSYS 0 July 30, 2010 11:38
UDF programming for pressure 3D..HELP coolyihao Fluent UDF and Scheme Programming 4 July 15, 2010 15:28
multiphase udf Rashmi FLUENT 1 March 7, 2006 02:17


All times are GMT -4. The time now is 01:10.