-
-
October 22, 2020 at 1:40 pm
Vikas_Vashisth
SubscriberFollowing errors are being faced during the compiling the UDF in Fluent even already available UDF in fluent user manuals for break-up frequencynn# Generating udf_names.c because of makefile freq1.objnudf_names.cnudf_names.c(: error C2065: 'break_up_freq_tav:undeclared identifiernudf_names.c(: warning C4312: 'type cast:conversion from 'int' to 'void (*)(void)' of greater sizenudf_names.c(: error C2065: 'UDF_TYPE_PB_BREAKUP_RATE_FREQ:undeclared identifiernudf_names.c(: error C2099: initializer is not a constantnnPlease suggest a solution.nnRegardsnVikasn -
October 22, 2020 at 1:41 pm
Vikas_Vashisth
SubscriberThe UDF is as followsnn/************************************************************************nUDF that computes the particle breakage frequencyn*************************************************************************/nn#include udf.hn#include sg_pb.hn#include sg_mphase.hnnDEFINE_PB_BREAKUP_RATE_FREQ(break_up_freq_tav, cell, thread, d_1)n{nreal epsi, alpha, f1, f2, rho_d;nreal C1 = 0.00481, C2 = 0.08, sigma = 0.07;n/* Thread *tm = THREAD_SUPER_THREAD(thread); /*passed thread is phase*/Â nepsi = 0.5;n/* alpha = C_VOF(cell, thread); */nalpha = 0.12;nrho_d = 1000;nf1 = pow(epsi, 1./3.)/((1.+epsi)*pow(d_1, 2./3.));nf2 = -(C2*sigma*(1.+epsi)*(1.+epsi))/(rho_d*pow(epsi,2./3.)*pow(d_1, 5./3.));nreturn C1*f1*exp(f2);n}nn -
October 22, 2020 at 5:08 pm
Amine Ben Hadj Ali
Ansys EmployeeEnsure that DEFINE macro is in the same line and no line breaks there. Which version are you using?n -
October 23, 2020 at 9:56 am
Vikas_Vashisth
SubscriberAnsys 19.2n -
October 23, 2020 at 10:12 am
Vikas_Vashisth
SubscriberAbove macro is from the fluent user guide and we are using the same without any change, even now I got the same errors.n -
October 23, 2020 at 10:58 am
Rob
Forum ModeratorYou've commented out the line /* Thread *tm = THREAD_SUPER_THREAD(thread); /*passed thread is phase*/ so there's no definition for Thread *tm but you're also not using it. Did you copy any of it out of the manual (eg CTRL+C) or type from scratch? For the former check for white space characters. -
October 23, 2020 at 11:02 am
Vikas_Vashisth
SubscriberYes, I copied (CTRL+C) it from the manual of Ansys and trying to compile it in Ansys 19.2.n -
October 23, 2020 at 11:12 am
Rob
Forum ModeratorUse an editor that you can show command/white space characters and delete the ones that aren't supposed to be there. n -
October 23, 2020 at 11:18 am
-
October 23, 2020 at 11:30 am
Rob
Forum ModeratorPlease show the white space characters as asked. n -
October 23, 2020 at 12:10 pm
Amine Ben Hadj Ali
Ansys EmployeeAlso with just copying the code and compiling it: no issues.nCheck the white spaces mentioned by nI do not have 19.2 anymore on my windows machine and is anyway not supported anymore. n -
October 23, 2020 at 12:23 pm
-
October 23, 2020 at 12:30 pm
Amine Ben Hadj Ali
Ansys EmployeeLooks okay.nnPlease go to udf_names.c on line 6, 7 and 8 what do you see? or post it the whole content.n -
October 23, 2020 at 12:38 pm
Vikas_Vashisth
Subscriber****************************************************************************n****************************************************************************n** WARNING: Automatically switched to run in parallel -t1 mode. **n** Detected non-parallelized UDF usage, enabling parallel usage. **n** If you encounter any issues, please re-run with -t0 flag. **n****************************************************************************n****************************************************************************user_nt.udf file is outdated. So, recreating the file for 3ddp_node ...n(chdir libudf\win64\3ddp_node)(system copy C:\PROGRA~1\ANSYSI~1\v192\fluent\fluent19.2.0\src\udf\makefile_nt.udf libudf\win64\3ddp_node\makefile )n1 file(s) copied.n(chdir libudf)(chdir win64\3ddp_node)# Generating ud_io1.hnfreq1.cn# Generating udf_names.c because of makefile freq1.objnudf_names.cnudf_names.c: error C2065: 'break_up_freq_tav:undeclared identifiernudf_names.c: warning C4312: 'type cast:conversion from 'int' to 'void (*)(void)' of greater sizenudf_names.c: error C2065: 'UDF_TYPE_PB_BREAKUP_RATE_FREQ:undeclared identifiernudf_names.c: error C2099: initializer is not a constantnnDone.n -
October 23, 2020 at 1:50 pm
Amine Ben Hadj Ali
Ansys EmployeeI said content of udf_names.c Check your working directory.n -
October 23, 2020 at 1:56 pm
Vikas_Vashisth
Subscriber/* This file generated automatically. */Â n/* Do not modify. */Â n#include "udf.h"Â n#include "prop.h"Â n#include "dpm.h"Â nextern DEFINE_PB_BREAKUP_RATE_FREQ(break_up_freq_tav, cell, thread, d_1);n__declspec(dllexport) UDF_Data udf_data[] = {Â n{"break_up_freq_tav", (void (*)(void))break_up_freq_tav, UDF_TYPE_PB_BREAKUP_RATE_FREQ},n};Â n__declspec(dllexport) int n_udf_data = sizeof(udf_data)/sizeof(UDF_Data);Â n#include "version.h"Â n__declspec(dllexport) void UDF_Inquire_Release(int *major, int *minor, int *revision)Â n{Â n*major = RampantReleaseMajor;Â n*minor = RampantReleaseMinor;Â n*revision = RampantReleaseRevision;Â n}Â nyou are asking for this? -
October 23, 2020 at 2:02 pm
Amine Ben Hadj Ali
Ansys EmployeeYes. Asking for this and it looks okay. I do not see an issue here. nIs it possible to launch Fluent in other directory, and just compile again. You do not require a case.n -
October 23, 2020 at 2:09 pm
Vikas_Vashisth
SubscriberCompiled the same UDF without case in different directory but still getting the same error.nn# Generating udf_names.c because of makefile freq1.objnudf_names.cnudf_names.c(: error C2065: 'break_up_freq_tav:undeclared identifiernudf_names.c(: warning C4312: 'type cast:conversion from 'int' to 'void (*)(void)' of greater sizenudf_names.c(: error C2065: 'UDF_TYPE_PB_BREAKUP_RATE_FREQ:undeclared identifiernudf_names.c(: error C2099: initializer is not a constantnnDone.nn -
October 23, 2020 at 2:12 pm
Amine Ben Hadj Ali
Ansys EmployeePlease attach the udf you are compiling. I have a feeling that is related to your system /compiler.n -
October 23, 2020 at 2:34 pm
Amine Ben Hadj Ali
Ansys EmployeeI was asking for the C file and not for a word document. Can you just try compiling a dummy UDF likenn#include udf.hnDEFINE_ON_DEMAND(dummy)n{nMessage0(Testing
);n}nIs it possible that you use one of the last versions?n -
October 23, 2020 at 2:38 pm
Vikas_Vashisth
SubscriberDummy version is working fine.nnvik.cn# Generating udf_names.c because of makefile vik.objnudf_names.cn# Linking libudf.dll because of makefile user_nt.udf udf_names.obj vik.objnMicrosoft (R) Incremental Linker Version 14.16.27043.0nCopyright (C) Microsoft Corporation. All rights reserved.nnCreating library libudf.lib and object libudf.expnnDone.nnOpening library \\libudf...nLibrary \\libudf\win64\3ddp_host\libudf.dll openednOpening library \\libudf...nLibrary \\libudf\win64\3ddp_node\libudf.dll openedndummynDone.n -
October 23, 2020 at 2:39 pm
Vikas_Vashisth
SubscriberThis is my casenn/************************************************************************nUDF that computes the particle breakage frequencyn*************************************************************************/nn#include udf.hn#include sg_pb.hn#include sg_mphase.hnnDEFINE_PB_BREAKUP_RATE_FREQ(break_up_freq_tav, cell, thread, d_1)n{nreal epsi, alpha, f1, f2, rho_d;nreal C1 = 0.00481, C2 = 0.08, sigma = 0.07;n/* Thread *tm = THREAD_SUPER_THREAD(thread); /*passed thread is phase*/Â nepsi = 0.5;n/* alpha = C_VOF(cell, thread); */nalpha = 0.12;nrho_d = 1000;nf1 = pow(epsi, 1./3.)/((1.+epsi)*pow(d_1, 2./3.));nf2 = -(C2*sigma*(1.+epsi)*(1.+epsi))/(rho_d*pow(epsi,2./3.)*pow(d_1, 5./3.));nreturn C1*f1*exp(f2);n}n -
October 23, 2020 at 2:43 pm
Vikas_Vashisth
SubscriberI am not able to attached the C file here, here is the text file for same UDFnnn -
October 23, 2020 at 2:43 pm
Rob
Forum ModeratorI can see the dots for spaces in your code, but not the carriage return symbols (looks like backwards P| ) .n -
October 23, 2020 at 2:57 pm
Vikas_Vashisth
SubscriberWhat should I do now?n -
October 23, 2020 at 3:48 pm
Amine Ben Hadj Ali
Ansys EmployeeIt is working for me on with 19 2 but Linux. Please try using a short name like nDEFINE_PB_BREAKUP_RATE_FREQ(dummy, cell, thread, d_1)nnAnd remove all content and let it return 1.0nn -
October 23, 2020 at 4:11 pm
Vikas_Vashisth
SubscriberStill not working!n -
October 23, 2020 at 4:35 pm
Amine Ben Hadj Ali
Ansys EmployeeOkay. There is no issue with the release and with your compiler. The only test I was not doing was with old version on Windows. I cannot do that. Try compiling another define pbe macro from the manual on your machine and let us know.n -
October 23, 2020 at 5:01 pm
Vikas_Vashisth
SubscriberUDF for breakup rate pdf (used from user manual)nn/************************************************************************nUDF that computes the particle breakage PDFn*************************************************************************/nn#include udf.hn#include sg_pb.hn#include sg_mphase.hnnDEFINE_PB_BREAKUP_RATE_PDF(break_up_pdf_par, cell, thread, d_1, d_2)n{nreal pdf;nreal kv = M_PI/6.;nnreal C = 1.0;nnreal f_2, f_3, f_4;nreal V_prime = kv*pow(d_1,3.);nreal V = kv*pow(d_2,3.);nnf_2 = 24.*pow(V/V_prime,2.);nf_3 = -24.*(V/V_prime);nf_4 = 6.;nnpdf = (C/V_prime) + ((1.-C/2.)/V_prime)*(f_2 + f_3 + f_4);n  nreturn 0.5*pdf;n}Same errornn# Generating udf_names.c because of makefile pdf.objnudf_names.cnudf_names.c: error C2065: 'break_up_pdf_par:undeclared identifiernudf_names.c: warning C4312: 'type cast:conversion from 'int' to 'void (*)(void)' of greater sizenudf_names.c: error C2065: 'UDF_TYPE_PB_BREAKUP_RATE_PDF:undeclared identifiernudf_names.c: error C2099: initializer is not a constantnnDone.n -
October 26, 2020 at 7:37 am
Amine Ben Hadj Ali
Ansys EmployeeI recommend two things:n1/To test on another computer and another platform.n2/To test with newer versionsnnOut tests are showing that with the release you are using no issues are occurring.n -
October 26, 2020 at 11:27 am
Rob
Forum ModeratorWhich suggests something screwy in the UDF you copied. Open the UDF in Word, turn on the paragraph makes (CTRL+ *) and post a screen grab.As a programming tip, if you define a number as real always add a decimal place, so nrho_d = 1000. and not rho_d = 1000 nIt may not cause a problem with more modern compilers (I learnt programming with Visual Basic and FORTRAN 77) but it won't hurt. n -
October 26, 2020 at 12:21 pm
-
October 28, 2020 at 10:02 am
Vikas_Vashisth
SubscriberAs per comment I may not be needed an test file to compile the UDF in Fluent!nPlease suggest, which compiler should I try other than Visual Studio for Fluent 19.2.0?n -
October 28, 2020 at 10:07 am
Amine Ben Hadj Ali
Ansys EmployeeWe do not support any other compiler on Windows. With release 2020R2 no compiler is required anymore on Windows.nYou might try another version of Visual Studio (2015) or retry installing the VS Studio version you are now using.nn -
October 28, 2020 at 10:08 am
Amine Ben Hadj Ali
Ansys EmployeeI would like that you look ino the header file sg_pb.h and check if you find the DEFINE PB related macros there. Check that file please.nn -
October 28, 2020 at 10:13 am
-
October 28, 2020 at 10:40 am
Rob
Forum ModeratorLooks fine, but as some UDFs work and others don't the environment must be OK. I assume all the files are in the same location?n -
October 28, 2020 at 12:44 pm
Amine Ben Hadj Ali
Ansys EmployeeLooks okay. Test with 2020R2 built-in compiler. Are you using university licences?n -
October 28, 2020 at 2:09 pm
Vikas_Vashisth
SubscriberYes, we have research license at the university!n -
October 29, 2020 at 9:08 am
Vikas_Vashisth
SubscriberCompiled the UDF in 2020R2 and still same errornnnFiles udf_names.c and user_nt.udf in 3ddp_host are up-to-date.n(system copy C:\PROGRA~1\ANSYSI~1\v202\fluent\fluent20.2.0\src\udf\makefile_nt.udf libudf\win64\3ddp_host\makefile )n1 file(s) copied.n(chdir libudf)(chdir win64\3ddp_host)udf_names.cnudf_names.c: error C2065: 'break_up_freq_tav:undeclared identifiernudf_names.c: warning C4312: 'type cast:conversion from 'int' to 'void (*)(void)' of greater sizenudf_names.c: error C2065: 'UDF_TYPE_PB_BREAKUP_RATE_FREQ:undeclared identifiernudf_names.c: error C2099: initializer is not a constantnFiles udf_names.c and user_nt.udf in 3ddp_node are up-to-date.n(system copy C:\PROGRA~1\ANSYSI~1\v202\fluent\fluent20.2.0\src\udf\makefile_nt.udf libudf\win64\3ddp_node\makefile )n1 file(s) copied.n(chdir libudf)(chdir win64\3ddp_node)udf_names.cnudf_names.c: error C2065: 'break_up_freq_tav:undeclared identifiernudf_names.c: warning C4312: 'type cast:conversion from 'int' to 'void (*)(void)' of greater sizenudf_names.c: error C2065: 'UDF_TYPE_PB_BREAKUP_RATE_FREQ:undeclared identifiernudf_names.c: error C2099: initializer is not a constantnnDone.n -
October 29, 2020 at 9:35 am
Amine Ben Hadj Ali
Ansys EmployeeCan you please use the built-in compiler? n -
October 29, 2020 at 9:40 am
Vikas_Vashisth
SubscriberI used the built-in compiler n -
October 29, 2020 at 9:52 am
Amine Ben Hadj Ali
Ansys EmployeeThings getting weird. You can imagine that it is hard for us now to debug further. Either there is an issue on your computer which is not allowing to compile this simple kind of UDF's or the compiler installation you have is spoiling everything.nMy last comment here is to uninstall VS Studio (not required with 20R2), clean-up everything, verify if the sg_pb contains the required macros and try again.n -
October 29, 2020 at 10:24 am
Vikas_Vashisth
SubscriberI tried to run other UDF (my previous work) and its working fine in the same system with 19.2 and 2020R2 bothn -
October 29, 2020 at 10:26 am
Vikas_Vashisth
SubscriberSee, everything seems fine here for another UDF for multiphase systemnnuser_nt.udf file is outdated. So, recreating the file for 3ddp_node ...n(chdir libudf\win64\3ddp_node)(system copy C:\PROGRA~1\ANSYSI~1\v202\fluent\fluent20.2.0\src\udf\makefile_nt.udf libudf\win64\3ddp_node\makefile )n1 file(s) copied.n(chdir libudf)(chdir win64\3ddp_node)# Generating ud_io1.hnGLdrag.cn# Generating udf_names.c because of makefile GLdrag.objnudf_names.cn# Linking libudf.dll because of makefile user_nt.udf udf_names.obj GLdrag.objnMicrosoft (R) Incremental Linker Version 14.16.27043.0nCopyright (C) Microsoft Corporation. All rights reserved.nnCreating library libudf.lib and object libudf.expnnDone.nn -
October 29, 2020 at 12:56 pm
Amine Ben Hadj Ali
Ansys EmployeeYes that is fine but it working on our side for the PB macros. Trust us!nDid you check the sg_pb header file? Can you see the macros there? n -
October 29, 2020 at 4:05 pm
Rob
Forum ModeratorCan you compile the code on a colleague's computer? I suppose you could have a corrupted header file somehow. n -
October 29, 2020 at 5:56 pm
Vikas_Vashisth
SubscriberI have compiled the these UDFs on same computer and different computers. nWhat should I do if header file got corrupt?n -
October 30, 2020 at 7:33 am
Amine Ben Hadj Ali
Ansys Employeeeither you re-install properly (unisntall, install with admin rights) or check the header file in question vs the one of a computer with same release version and compare both.n
-
Viewing 48 reply threads
- The topic ‘UDF error in population balance modeling’ is closed to new replies.
Ansys Innovation Space
Trending discussions
- How do I get my hands on Ansys Rocky DEM
- Non-Intersected faces found for matching interface periodic-walls
- Unburnt Hydrocarbons contour in ANSYS FORTE for sector mesh
- Help: About the expression of turbulent viscosity in Realizable k-e model
- Script Error
- Mass Conservation Issue in Methane Pyrolysis Shock Tube Simulation
- Facing trouble regarding setting up boundary conditions for SOEC Modeling
- convergence issue for transonic flow
- Running ANSYS Fluent on a HPC Cluster
- Point exception in erosion calculation
Top Contributors
-
1927
-
823
-
599
-
591
-
366
Top Rated Tags
© 2025 Copyright ANSYS, Inc. All rights reserved.
Ansys does not support the usage of unauthorized Ansys software. Please visit www.ansys.com to obtain an official distribution.