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 Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 30, 2020, 07:47
Default UDF - Population Balance - Breakage Frequency
  #1
New Member
 
Join Date: Nov 2011
Posts: 21
Rep Power: 10
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, 10:05
Default Write your code
  #2
Senior Member
 
vinerm's Avatar
 
Vinerm
Join Date: Jun 2009
Location: Nederland
Posts: 539
Rep Power: 16
vinerm is on a distinguished road
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

PMs only for private content
vinerm is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 06:31
Problems when using Population balance model with Boiling model luliqiang FLUENT 0 May 28, 2013 06:22
UDF for the population balance model Hossam Fluent UDF and Scheme Programming 0 March 27, 2009 03:46
Incremental Frequency UDF Sham FLUENT 0 May 12, 2008 23:43
Harmonic Balance (Frequency Domain) Euler CFD Manish Main CFD Forum 11 December 1, 2005 19:20


All times are GMT -4. The time now is 09:21.