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

UDF for Cp of mixtures

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 23, 2018, 15:34
Default UDF for Cp of mixtures
  #1
Member
 
Anshuman Sinha
Join Date: Oct 2018
Posts: 70
Rep Power: 8
Anshs is on a distinguished road
I am doing a combustion analysis of Carbon monoxide gas, here I have defined my mixture template as Carbon di-oxide , Carbon monoxide and oxygen.

I have defined the cp of individual species as udf given below :

Code:
#include "udf.h"
DEFINE_SPECIFIC_HEAT(my_user_cp_o2, T) 
{ 
	real cp;
	real x= T;

	
		cp = 1000* ( -2e-15*(pow(x,4.) ) + 3e-11*(pow(x,3.)) - 1e-07*(pow(x,2.) ) + 0.0004*x + 0.8287 );

	return cp; 
}

DEFINE_SPECIFIC_HEAT(my_user_cp_co2, T) 
{ 
	real cp;
	real x= T;


		cp = 1000*(-7e-15*(pow(x,4.) )+ 1e-10*(pow(x,3.) )- 5e-07*(pow(x,2.) )+ 0.001*x + 0.5775 );

	return cp; 
}

DEFINE_SPECIFIC_HEAT(my_user_cp, T) 
{ 
	real cp;
	real x= T;

		cp = 1000*(-3e-16*(pow(x,4.) )+ 9e-12*(pow(x,3.) )- 8e-08*(pow(x,2.) )+ 0.0003*x + 0.9586) ;

	return cp; 
}
the result say invalid cp value for temp = -607.9 K


I have set the individual cp's for CO,CO2 and O2 through the udf in the materials section under mixture materials.

Now in the cp of mixture ( when we click edit on mixture template). I know I have to define cp wrt. composition like y[co2]*cp[co2]+y[o2]*cp[o2] + ...
But how will it be done ?

Will law of mixing do it for me ? or shall I write a new udf for it ? If new udf is to be written then how ?


Why am I getting an error for temp = -602K, as temp less than 0K is not possible.
Anshs is offline   Reply With Quote

Reply

Tags
combustion, udf code


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
udf for one dimensional linear motion based on force maccheese Fluent UDF and Scheme Programming 2 September 1, 2019 03:18
can anyone help me about the udf of dynamic contact angle in FLUENT? Albert Lee FLUENT 0 July 1, 2018 09:21
Save output of udf in another udf! JuanJoMex FLUENT 0 February 8, 2018 13:43
UDF Compilation Error - Loading Library - COMMON Problem! Help! robtheslob Fluent UDF and Scheme Programming 8 July 24, 2015 01:53
UDF, UDF, UDF, UDF Luc SEMINEL Main CFD Forum 0 November 25, 2002 05:01


All times are GMT -4. The time now is 18:15.