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

DEFINE_CHEM_STEP reaction heat

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 2, 2019, 08:46
Default DEFINE_CHEM_STEP reaction heat
  #1
New Member
 
Join Date: May 2018
Posts: 29
Rep Power: 8
CFDJonas is on a distinguished road
Hello everyone,

I finally managed to get my reaction system going with the DEFINE_CHEM_STEP macro (see below). Although the mass fractions of the species are correct, I no longer see a generation of heat. The temperature profile of a converged simulation states a constant temperature of e.g. 500 K. Although my mixture has indeed different enthalpys set for the species (which are produced/consumed). Where/How do I handle reaction enthalpies when dealing with DEFINE_CHEM_STEP?

I'm using Fluent 19.2 with some other custom udf (viscosity, heat capacity, thermal conductivity and density of the mixture, although these are throughly tested).

Code:
DEFINE_CHEM_STEP(chem_steps, c, t, p, num_p, n_spe, dt, pres, temp, yk)
{
	real ck[N_COMP];
	real rates[N_COMP];
	real pres_bar = *pres / 1e5; // bar
	real rho = C_R(c, t);

	// Get concentrations from mass fractions
	for (i = 0; i < N_COMP; i++)
	{
		ck[i] = rho * yk[i] / M_i[i];
	}
	
	// Calculate the rates
	rates[i_example_species] = -k_exp * ck[i_example_species];
        // etc.

	for (i = 0; i < N_COMP; i++)
	{
		ck[i] += rates[i] * *dt;
		yk[i] = ck[i] * M_i[i] / rho;
		// Message("\n Specie %d = %f \t TimeStep = %e", i, yk[i], *dt);
	}
}
Thanks in advance!
CFDJonas is offline   Reply With Quote

Old   May 2, 2020, 12:13
Default
  #2
Member
 
Di Cheng
Join Date: May 2010
Location: Beijing, China
Posts: 47
Rep Power: 16
chengdi is on a distinguished road
Did you enabled the energy equation?
chengdi is offline   Reply With Quote

Old   December 15, 2021, 05:01
Default
  #3
New Member
 
Jinshan Yi
Join Date: Dec 2021
Posts: 7
Rep Power: 5
study_CFD is on a distinguished road
I also encountered the same problem. Have you solved it?
study_CFD is offline   Reply With Quote

Reply


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
Interphase mass transfer of a reaction cfx_ws1992 Main CFD Forum 0 May 15, 2017 22:42
UDF to access quantity of heat absorbed by one phase in Multi phase reaction process Yuting FLUENT 0 March 15, 2017 23:52
Error - Solar absorber - Solar Thermal Radiation MichaelK CFX 12 September 1, 2016 06:15
Reaction heat Laci FLUENT 2 July 23, 2009 03:03
heat of reaction Paul FLUENT 4 August 7, 2003 12:58


All times are GMT -4. The time now is 20:52.