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

UDS for chemical reaction.

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By Laexzzz

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 1, 2014, 05:53
Default UDS for chemical reaction.
  #1
New Member
 
Alexey
Join Date: Jan 2014
Posts: 18
Rep Power: 12
Laexzzz is on a distinguished road
I want to use UDS for my simulation.

My reaction

A => B

So, i want to compare results of Fluent reaction module and results of UDS transport equation.

UDS depends of concentration A.

Source equation is S = Kd*[A] (k - is a reaction rate constant and [A] is a molar concentration)

Finally, the concentration of reactant B and UDP should be identical but it is not the case

My code

#include "udf.h"
#define kd0 1.58e+15

DEFINE_SOURCE(UDS0_source,c,t,dS,eqn)
{
real UDS0_source;
real temp = C_T(c,t);
real Dens = C_R(c,t);
real kd = kd0*exp(-15500/temp);
real IniMC1;
real UDSMC_source;

AMC = (C_YI(c,t,0)*Dens) / 164;
UDSMC_source = kd*AMC;
UDS0_source = UDSMC_source*164;
dS[eqn] = 0;
return UDS0_source;
}

May be somebody have any example with reaction and UDS? Or somebody can give any advice in that domain?

Alexey
ramakant likes this.
Laexzzz is offline   Reply With Quote

Old   April 2, 2014, 16:30
Default
  #2
New Member
 
Bill Wangard
Join Date: Jan 2011
Posts: 21
Rep Power: 0
billwangard is on a distinguished road
Hi,

You will need one sink and one source.

The sink is for A and the source is for B.

if your reaction is

rA = - k * [A],

additionally, rB = -rA, and the net mass source has to be zero.

and [A] = D * Y(0), where D is a constant (dens/164).

Thus, rA = -k * D * Y(0)
and

d(rA)/dY = dS[eqn] = -k * D

In your UDF, the Jacobian was 0... This is incorrect.

Also rB = -rA, and d(rB)/dY(0) = k * D.

Thus, you should have two DEFINE_SOURCE routines, one for each of your scalars. There should be no MASS SOURCE, since mass is not destroyed in the conversion of single molecule A to single molecule B.

Good Luck,
Bill
billwangard is offline   Reply With Quote

Old   April 3, 2014, 00:48
Default
  #3
New Member
 
Alexey
Join Date: Jan 2014
Posts: 18
Rep Power: 12
Laexzzz is on a distinguished road
Quote:
Originally Posted by billwangard View Post
Hi,

You will need one sink and one source.

The sink is for A and the source is for B.

if your reaction is

rA = - k * [A],

additionally, rB = -rA, and the net mass source has to be zero.

and [A] = D * Y(0), where D is a constant (dens/164).

Thus, rA = -k * D * Y(0)
and

d(rA)/dY = dS[eqn] = -k * D

In your UDF, the Jacobian was 0... This is incorrect.

Also rB = -rA, and d(rB)/dY(0) = k * D.

Thus, you should have two DEFINE_SOURCE routines, one for each of your scalars. There should be no MASS SOURCE, since mass is not destroyed in the conversion of single molecule A to single molecule B.

Good Luck,
Bill

Thank you for your response!
Then another question.

Scalar must move with the flow.
Now I try to explain what I want to do. I want to create scalar. Its source term depend on the concentration of the material component of the mixture. Scalar moves with the flow.

So I should set flow function of scalar "mass flow rate"? But flow rate of scalar is 0 at time = 0. Transient and dif members of transport equation should be 0?
Laexzzz is offline   Reply With Quote

Old   April 7, 2014, 01:18
Default
  #4
New Member
 
Alexey
Join Date: Jan 2014
Posts: 18
Rep Power: 12
Laexzzz is on a distinguished road
Guys, some ideas? I'm seriously stuck at this moment
Laexzzz 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
Having problems setting up surface reaction, catalyst, adsorption and desorption Juun FLUENT 12 February 8, 2017 11:03
PaSR + infinite reaction rate in reactingFoam --> no reactions occurring tatu OpenFOAM Running, Solving & CFD 2 November 24, 2016 18:34
Defining reaction rate with multiple surface reaction Fred Marias FLUENT 1 September 12, 2013 04:56
Segmentation fault in running alternateSteadyReactingFoam,why? NewKid OpenFOAM 18 January 20, 2011 16:55
chemical reaction - decompostition La S. Hyuck CFX 1 May 23, 2001 00:07


All times are GMT -4. The time now is 13:51.