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

DEFINE_VR_RATE does not provide any change of product concentration

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 2, 2022, 11:04
Question DEFINE_VR_RATE does not provide any change of product concentration
  #1
Nia
New Member
 
Romain Million
Join Date: Nov 2022
Location: Saint Nazaire, France
Posts: 4
Rep Power: 4
Nia is on a distinguished road
Hello everybody,

I am currently trying to use the DEFINE_VR_RATE to simulate CO2 dissociation in water, but it does not seem to work.

I have a 2D eulerian simulation with :
  • (CO2+air) mixture velocity inlet that provide gazeous co2 as secondary phase;
  • (H2O(l) + CO2(l) + H+ + HCO3-) mixture as primary phase;
  • A non-linearized mass transfer UDF adapted from DEFINE_MASS_TRANSFER (which is working) to input the co2 transfer from gas phase to liquid phase respecting the Higbie model.
The next step of my simulation is to describe the dissociation of CO2 (aq) to H+ and HCO3-. I tried to realize this step with the DEFINE_VR_RATE as follow :



Code:
DEFINE_VR_RATE(CO2_reaction2, c, t, r, mole_weight, species_mf, rate, rr_t)
{

real yco2  = species_mf[0];        /*  molar fraction of CO2     */
real yHCO3 = species_mf[1];     /*  molar fraction of HCO3- */
real yH    = species_mf[2];       /*  molar fraction of H+      */

real Mco2  = mole_weight[0];     /*  molar mass of CO2        */
real MHCO3 = mole_weight[1];  /*  molar mass of HCO3-    */
real MH    = mole_weight[2];    /*  molar mass of H+         */

real Kco2, Kd, a; 
real vofl= C_VOF(c,t); 
real vofg=1-vofl;
 
Kco2   = 3.665e-02; 
Kd     = 74866.11;

a =(C_R(c,t)*yH/MH)*gamma;   /*  activity of H+  */  

  	
*rate = Kco2*C_R(c,t)*yco2/Mco2 - Kd*a*(C_R(c,t)*yHCO3/MHCO3);

*rr_t = *rate; 

  
}


The problem is that the H+ and HCO3- concentrations do not vary over time when this udf is compiled, even from visual studio prompt.

Maybe my mistake is my understanding of this function, and maybe it should be coupled with the DEFINE_SOURCE function?

If any one have any idea..

Thank you.

Last edited by Nia; November 3, 2022 at 07:03.
Nia is offline   Reply With Quote

Old   January 10, 2023, 05:48
Lightbulb Solution
  #2
Nia
New Member
 
Romain Million
Join Date: Nov 2022
Location: Saint Nazaire, France
Posts: 4
Rep Power: 4
Nia is on a distinguished road
Hi everybody,

In case this situation would happen again, here is the error in my simulation: the mixtures were based on "inert mixture" rather than on "template mixture", which prevented the reaction from taking place. The latter having been renamed since, the error was not obvious...
Hopefully this will help other people.
Nia is offline   Reply With Quote

Reply

Tags
define_vr_rate


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
The different among the Pitch options MNMK CFX 2 November 12, 2020 04:27
DPM Steady Local Collection Efficiency and Concentration Cells Error Manathan Fluent UDF and Scheme Programming 0 April 8, 2015 13:06
get unlogic profil of reactant and product concentration in combustion reaction nay robin Main CFD Forum 1 June 26, 2013 05:57
Concentration Scale Data Interpretation usker Siemens 4 October 23, 2007 21:30
initial concentration in multicomponent mixtures isidro Siemens 0 April 26, 2004 08:40


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