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

Vof udf

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By frode

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 20, 2014, 12:19
Default Vof udf
  #1
Senior Member
 
ahmad
Join Date: Feb 2012
Posts: 101
Rep Power: 14
malay is on a distinguished road
what the problem on my udf ?

I want find summation of VOF


/************************************************** ******************
UDF for VOF summation and displaying it in the
console
************************************************** *******************/
#include "udf.h"
#include "sg_mphase.h"
DEFINE_ADJUST(my_adjust,d)
{
Thread *t;
/*VOF sum. */
real sum_vof=0.;
cell_t c;
thread_loop_c(t,d)
{
begin_c_loop(c,t)
sum_diss += C_VOF(c,t);
end_c_loop(c,t)
}
printf("VOF summation : %g\n", sum_vof);
}
malay is offline   Reply With Quote

Old   May 21, 2014, 06:48
Default
  #2
New Member
 
Igor
Join Date: Mar 2012
Posts: 13
Rep Power: 14
DaddySpeleo is on a distinguished road
And what the problem with your udf ?
What's wrong?
DaddySpeleo is offline   Reply With Quote

Old   May 21, 2014, 11:40
Default
  #3
Senior Member
 
ahmad
Join Date: Feb 2012
Posts: 101
Rep Power: 14
malay is on a distinguished road
when i did iteration . i had a problem and fluent restart
malay is offline   Reply With Quote

Old   May 21, 2014, 18:38
Default
  #4
New Member
 
Igor
Join Date: Mar 2012
Posts: 13
Rep Power: 14
DaddySpeleo is on a distinguished road
sum_diss overflow?
You wrote sum_diss=0 earlier?
Why do you need DEFINE_ADJUST?
DaddySpeleo is offline   Reply With Quote

Old   May 22, 2014, 02:31
Default
  #5
Senior Member
 
ahmad
Join Date: Feb 2012
Posts: 101
Rep Power: 14
malay is on a distinguished road
Quote:
Originally Posted by DaddySpeleo View Post
sum_diss overflow?
You wrote sum_diss=0 earlier?
Why do you need DEFINE_ADJUST?
I just need to find summations of VOF when [C_VOF (c,t)>0.5 && C_VOF(c,t) <1.0]
malay is offline   Reply With Quote

Old   May 25, 2014, 08:04
Default
  #6
New Member
 
Frode Yu
Join Date: May 2014
Posts: 1
Rep Power: 0
frode is on a distinguished road
Quote:
Originally Posted by malay View Post
what the problem on my udf ?

I want find summation of VOF


/************************************************** ******************
UDF for VOF summation and displaying it in the
console
************************************************** *******************/
#include "udf.h"
#include "sg_mphase.h"
DEFINE_ADJUST(my_adjust,d)
{
Thread *t;
/*VOF sum. */
real sum_vof=0.;
cell_t c;
thread_loop_c(t,d)
{
begin_c_loop(c,t)
sum_diss += C_VOF(c,t);
end_c_loop(c,t)
}
printf("VOF summation : %g\n", sum_vof);
}
I think that you did not determine variable thread "t".
if you use C_VOF(c,t), the "t" should primary_phase or second_phase, not the mixture_phase. but when you hooking the udf, "t" was mixture_phase.
Hershey likes this.
frode is offline   Reply With Quote

Old   May 26, 2014, 10:27
Default
  #7
Senior Member
 
François Grégoire
Join Date: Jan 2010
Location: Canada
Posts: 392
Rep Power: 17
macfly is on a distinguished road
Hi malay,

As DaddySpeleo pointed out, sum_diss is not defined before the loop. (your answer to him looks like you may not have modified this problem)
macfly is offline   Reply With Quote

Old   May 26, 2014, 13:48
Default
  #8
Senior Member
 
ahmad
Join Date: Feb 2012
Posts: 101
Rep Power: 14
malay is on a distinguished road
Quote:
Originally Posted by macfly View Post
Hi malay,

As DaddySpeleo pointed out, sum_diss is not defined before the loop. (your answer to him looks like you may not have modified this problem)
how can i put sum_diss=0 inside loop !! it should out loop , is it ?
malay is offline   Reply With Quote

Old   May 26, 2014, 14:10
Default
  #9
Senior Member
 
François Grégoire
Join Date: Jan 2010
Location: Canada
Posts: 392
Rep Power: 17
macfly is on a distinguished road
Yes, at the same place where you define sum_vof.

You talked about a condition [C_VOF (c,t)>0.5 && C_VOF(c,t) <1.0] and it looks like it's not included in your udf.

Maybe you should start over with a summation example from the UDF Manual, make sure a copy-pasted example works with no error in your model, and then modify it gradually.
macfly is offline   Reply With Quote

Old   May 26, 2014, 14:13
Default
  #10
Senior Member
 
ahmad
Join Date: Feb 2012
Posts: 101
Rep Power: 14
malay is on a distinguished road
Quote:
Originally Posted by macfly View Post
Yes, at the same place where you define sum_vof.

You talked about a condition [C_VOF (c,t)>0.5 && C_VOF(c,t) <1.0] and it looks like it's not included in your udf.

Maybe you should start over with a summation example from the UDF Manual, make sure a copy-pasted example works with no error in your model, and then modify it gradually.
t here is it mix or vap phase ? if vap phase , how can i make a loop for vap phase ?

thanks
malay 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
VOF UDF unsteady inlet/outlet danielvhm Fluent Multiphase 1 January 30, 2014 11:32
VOF condensation udf foolstop Fluent UDF and Scheme Programming 0 May 8, 2012 10:15
Convert VOF droplet to DPM particle via UDF TedBrogan Fluent UDF and Scheme Programming 1 May 1, 2012 12:01
Vof, udf and mass transfer panel Jay FLUENT 1 March 15, 2005 01:29
UDF sourse term for VOF equation ROOZBEH FLUENT 5 April 22, 2003 07:56


All times are GMT -4. The time now is 15:08.