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

Getting an error while compiling UDF code

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 6, 2023, 03:01
Default Getting an error while compiling UDF code
  #1
New Member
 
Sohrab S
Join Date: Aug 2022
Posts: 2
Rep Power: 0
Sohrabs is on a distinguished road
Hello everyone,
I am trying to use a user defined function that receives the pressure of a specific area as input and changes the air density in that area. The relevant thermodynamic equations are visible within the code. Problem is, when I try to compile the code, I receive the following error: "The UDF library you are trying to load (libudf) is not compiled for parallel use on the current platform (win64)".
Could you please take a look at my code and see what is wrong with it?

The code I am using is:

#include "udf.h"

DEFINE_PROPERTY(Density, c, t)
{
real RHOat; /* air density in the atmosphere */
real rho; /* air density inside the Chamber */
real Pch; /* pressure inside the Chamber */
real Pat; /* Atmospheric pressure */
Pat = 101325;
RHOat = 1.225;
Pch = C_P(c, t);
if (Pch >= Pat)
rho = (Pat * RHOat) / (Pat + Pch);
else
rho = (RHOat * (Pat + Pch)) / Pat;
return rho;
}
Sohrabs is offline   Reply With Quote

Old   June 6, 2023, 03:20
Default
  #2
New Member
 
Damir
Join Date: Apr 2023
Posts: 7
Rep Power: 3
salkynbekov is on a distinguished road
Try to use visual studio for compilation.
Also try to run without parallel computing.

Last edited by salkynbekov; June 7, 2023 at 03:39.
salkynbekov is offline   Reply With Quote

Old   June 6, 2023, 07:22
Default
  #3
New Member
 
Sohrab S
Join Date: Aug 2022
Posts: 2
Rep Power: 0
Sohrabs is on a distinguished road
Quote:
Originally Posted by salkynbekov View Post
1st use curly brackets for if-statement



Try to use visual studio for compilation.
Also try to run without parallel computing.
Thanks for the reply, I use Visual Studio 2010 for compiling and I have tried to run the simulation without parallel computing, same error appears!
Sohrabs is offline   Reply With Quote

Reply

Tags
cfd, density change, udf code, udf compile


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
Compiling my own source code: 'libNULL.so' is up to date MrNinainaidi OpenFOAM Programming & Development 1 November 30, 2020 05:27
Compiling the customized UDF code for PEMFC dmfo Fluent UDF and Scheme Programming 2 October 1, 2017 18:30
write code UDF Fluent solve kinetic reaction rate equation palm oil zirkov FLUENT 0 February 13, 2017 10:16
something wrong when compiling udf, however the code is correct when interpreting richard ben Fluent UDF and Scheme Programming 7 May 11, 2013 07:36
ERROR in compiling UDF stefanos Fluent UDF and Scheme Programming 1 April 25, 2012 07:37


All times are GMT -4. The time now is 06:26.