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

UDF for specific heat as function of pressure

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes

 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old   February 24, 2014, 13:02
Default UDF for specific heat as function of pressure
  #1
New Member
 
Gustavo
Join Date: Jun 2013
Posts: 26
Rep Power: 12
ghobold is on a distinguished road
Hello,

I am trying to make an UDF to obtain specific heat as a function of temperature and other state variable (either pressure or density, hopefully). The problem is that the default macro for specific heat DEFINE_SPECIFIC_HEAT passes only temperature as a state variable and does not inform on the cell or thread. This is what I have tried to do in order to obtain the pressure in the cell:

Code:
#include "udf.h"

const char* FLUID = "CarbonDioxide";
const real gauge = 101325; //operating pressure in pascal (as defined in fluent)

double Props (char*, char, double, char, double, char*);

/* other macros here */

DEFINE_SPECIFIC_HEAT(cell_specificHeat, temperature, Tref, enthalpy, yi)
{	 
	real pressure;
	 
	 Domain *domain = Get_Domain(1);
	 Thread *t;
	 cell_t c;
	 thread_loop_c(t, domain)
	 {
	 	begin_c_loop(c, t)
	 	{
	 		pressure = C_P(c, t);
	 	}end_c_loop(c, t)
	 }
	
	real specificHeat;
	
	specificHeat = Props((char*)"C",'T', temperature, 'P', pressure, (char*)FLUID)*1000;
	*enthalpy = specificHeat*(temperature-Tref);
	return specificHeat;
}
Props(), in this case, is a function from a loaded library Coolprop (Coolprop works fine with Fluent, by the way, I'm using it to obtain other real gas properties and it works just fine). Whenever I initialize a solution using the code above, the following error pops up:

Code:
/home/ansys_inc/v145/fluent/fluent14.5.7/lnamd64/2ddp_node/fluent_mpi.14.5.7: symbol lookup error: libudf/lnamd64/2ddp_node/libudf.so: undefined symbol: _Z10Get_Domaini
/home/ansys_inc/v145/fluent/fluent14.5.7/lnamd64/2ddp_node/fluent_mpi.14.5.7: symbol lookup error: libudf/lnamd64/2ddp_node/libudf.so: undefined symbol: _Z10Get_Domaini
/home/ansys_inc/v145/fluent/fluent14.5.7/lnamd64/2ddp_node/fluent_mpi.14.5.7: symbol lookup error: libudf/lnamd64/2ddp_node/libudf.so: undefined symbol: _Z10Get_Domaini
/home/ansys_inc/v145/fluent/fluent14.5.7/lnamd64/2ddp_node/fluent_mpi.14.5.7: symbol lookup error: libudf/lnamd64/2ddp_node/libudf.so: undefined symbol: _Z10Get_Domaini
/home/ansys_inc/v145/fluent/fluent14.5.7/lnamd64/2ddp_node/fluent_mpi.14.5.7: symbol lookup error: libudf/lnamd64/2ddp_node/libudf.so: undefined symbol: _Z10Get_Domaini
/home/ansys_inc/v145/fluent/fluent14.5.7/lnamd64/2ddp_node/fluent_mpi.14.5.7: symbol lookup error: libudf/lnamd64/2ddp_node/libudf.so: undefined symbol: _Z10Get_Domaini
MPI Application rank 1 exited before MPI_Finalize() with status 127

999999 (../../src/mpsystem.c@1172): mpt_read: failed: errno = 104

999999: mpt_read: error: read failed trying to read 4 bytes: Connection reset by peer
 The fluent process could not be started.
It seems like the UDF does not recognize the function Get_Domain() and is trying to look for it in the compiled Coolprop library instead of the default Fluent library. Am I doing something wrong or is there another (and hopefully faster, computational time wise) way to do this?

I'm running Fluent 14.5.7 on Fedora 19, in case that's relevant.
ghost82 likes this.
ghobold is offline   Reply With Quote

 

Tags
coolprop, fluent, pressure, specific heat, udf


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
Question about heat transfer coefficient setting for CFX Anna Tian CFX 1 June 16, 2013 06:28
[blockMesh] non-orthogonal faces and incorrect orientation? nennbs OpenFOAM Meshing & Mesh Conversion 7 April 17, 2013 05:42
UDF parallel error: chip-exec: function not found????? shankara.2 Fluent UDF and Scheme Programming 1 January 16, 2012 22:14
[blockMesh] BlockMesh FOAM warning gaottino OpenFOAM Meshing & Mesh Conversion 7 July 19, 2010 14:11
Convective Heat Transfer - Heat Exchanger Mark CFX 6 November 15, 2004 15:55


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