|
[Sponsors] |
DEFINE_VR_RATE does not provide any change of product concentration |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
November 2, 2022, 11:04 |
DEFINE_VR_RATE does not provide any change of product concentration
|
#1 |
New Member
Romain Million
Join Date: Nov 2022
Location: Saint Nazaire, France
Posts: 4
Rep Power: 4 |
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 :
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. |
|
January 10, 2023, 05:48 |
Solution
|
#2 |
New Member
Romain Million
Join Date: Nov 2022
Location: Saint Nazaire, France
Posts: 4
Rep Power: 4 |
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. |
|
Tags |
define_vr_rate |
|
|
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 |