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

UDF - Population Balance - Breakage Frequency

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 30, 2020, 06:47
Default UDF - Population Balance - Breakage Frequency
  #1
Member
 
Join Date: Nov 2011
Posts: 30
Rep Power: 14
Gimlas is on a distinguished road
dear colleagues
I have a basic issue with udfs dedicated to the breakage frequency in the Population Balance Equations. I have created a very simple code:

#include "udf.h."
#include "sg_pb.h"
#include "sg_mphase.h"

DEFINE_PB_BREAKUP_RATE_FREQ(break_up_freq_pow, cell, thread_1, d_1)
{
real f1;
real kv = M_PI/6.;
real C1 = 150000.;
real V_prime = kv*pow(d_1,3.);

f1 = pow(V_prime,1./3.);
return C1*f1;
};





But it generates the following error message:

************************************************** **************************

************************************************** **************************

** WARNING: Automatically switched to run in parallel -t1 mode. **

** Detected non-parallelized UDF usage, enabling parallel usage. **

** If you encounter any issues, please re-run with -t0 flag. **

************************************************** **************************

************************************************** **************************Creating user_nt.udf file for 3ddp_host ...

(system "copy "C:\PROGRA~1\ANSYSI~1\v193\fluent"\fluent19.3.0\sr c\udf\makefile_nt.udf "libudf\win64\3ddp_host\makefile" ")

1 file(s) copied.

(chdir "libudf")(chdir "win64\3ddp_host")# Generating ud_io1.h

BRK.c

# Generating udf_names.c because of makefile BRK.obj

udf_names.c

udf_names.c(8): error C2065: "break_up_freq_pow": niezadeklarowany identyfikator (undeclared identifier)

udf_names.c(8): warning C4312: "typ rzutowania": konwersja z "int" na "void (*)(void)" jest wi�kszej wielko�ci ("cast type": conversion of "int" into "void(*)(void)" is higher value)

udf_names.c(8): error C2065: "UDF_TYPE_PB_BREAKUP_RATE_FREQ": niezadeklarowany identyfikator (undecllared identifier)

udf_names.c(8): error C2099: inicjator nie jest sta�� (initiator is not ...)


************************************************** **************************

************************************************** **************************

** WARNING: Automatically switched to run in parallel -t1 mode. **

** Detected non-parallelized UDF usage, enabling parallel usage. **

** If you encounter any issues, please re-run with -t0 flag. **

************************************************** **************************

************************************************** **************************Creating user_nt.udf file for 3ddp_node ...

(system "copy "C:\PROGRA~1\ANSYSI~1\v193\fluent"\fluent19.3.0\sr c\udf\makefile_nt.udf "libudf\win64\3ddp_node\makefile" ")

1 file(s) copied.

(chdir "libudf")(chdir "win64\3ddp_node")# Generating ud_io1.h

BRK.c

# Generating udf_names.c because of makefile BRK.obj

udf_names.c

udf_names.c(8): error C2065: "break_up_freq_pow": niezadeklarowany identyfikator

udf_names.c(8): warning C4312: "typ rzutowania": konwersja z "int" na "void (*)(void)" jest wi�kszej wielko�ci

udf_names.c(8): error C2065: "UDF_TYPE_PB_BREAKUP_RATE_FREQ": niezadeklarowany identyfikator

udf_names.c(8): error C2099: inicjator nie jest sta��


Done.



So I have decided to run the example given in the Fluent's manual:

#include "udf.h"
#include "sg_pb.h"
#include "sg_mphase.h"

DEFINE_PB_BREAKUP_RATE_FREQ(break_up_freq_tav, cell, thread, d_1)
{
real epsi, alpha, f1, f2, rho_d;
real C1 = 0.00481, C2 = 0.08, sigma = 0.07;
Thread *tm = THREAD_SUPER_THREAD(thread);/*passed thread is phase*/
epsi = C_D(cell, tm);
alpha = C_VOF(cell, thread);
rho_d = C_R(cell, thread);
f1 = pow(epsi, 1./3.)/((1.+epsi)*pow(d_1, 2./3.));
f2 = -(C2*sigma*(1.+epsi)*(1.+epsi))/(rho_d*pow(epsi,2./3.)*pow(d_1, 5./3.));
return C1*f1*exp(f2);
}

But it generates even more errors... I am working on Ansys Fluent 2019R1 version of the software.

I would be obliged if you could help me.

Best regards
Gimlas is offline   Reply With Quote

Old   January 30, 2020, 09:05
Default Write your code
  #2
Senior Member
 
vinerm's Avatar
 
Vinerm
Join Date: Jun 2009
Location: Nederland
Posts: 2,946
Blog Entries: 1
Rep Power: 35
vinerm will become famous soon enough
The problem appears to be that you copied the code from the manual and modified it. You have to open a new file, write the code yourself, and then compile it.
__________________
Regards,
Vinerm

PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority.
vinerm 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
some problem about population balance model (DQMOM) sola86 Fluent UDF and Scheme Programming 0 September 22, 2015 05:31
Problems when using Population balance model with Boiling model luliqiang FLUENT 0 May 28, 2013 05:22
UDF for the population balance model Hossam Fluent UDF and Scheme Programming 0 March 27, 2009 02:46
Incremental Frequency UDF Sham FLUENT 0 May 12, 2008 22:43
Harmonic Balance (Frequency Domain) Euler CFD Manish Main CFD Forum 11 December 1, 2005 18:20


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