|
[Sponsors] |
March 9, 2018, 17:11 |
Define_Source and C_YI(c,t,i)
|
#1 |
New Member
Aureliano Sancho
Join Date: May 2013
Location: Salvador-Ba-Brasil
Posts: 26
Rep Power: 13 |
Hi everyone, I have a mixture flow of the salt water (water, cl- and Na+) and I've a potential in the wall on the cylinder. My problem is that I want to calculate the different force for each specie, for example, to especie Cl- the force will be positive and to Na+ negative, but I don't know how to say specify the specie in udf.
For example, it's my udf define_source DEFINE_SOURCE(EGL,cell,thread,dS,eqn) { double source2; double k; real xc[ND_ND]; C_CENTROID(xc,cell,thread); k = (1/pow(((ee*Kb*T)/(2*NA*pow(el,2)*ninf)),0.5)); source2 = -ee*U0*pow(k,2)*Ex; dS[eqn] = 0.0; return source2; } But I want to read the kind of specie and to choose which source to use. Can I write this way? DEFINE_SOURCE(EGL,cell,thread,dS,eqn) { if (C_YI(c,t,2)) { double source2; double k; real xc[ND_ND]; C_CENTROID(xc,cell,thread); k = (1/pow(((ee*Kb*T)/(2*NA*pow(el,2)*ninf)),0.5)); source2 = ee*U0*pow(k,2)*Ex; dS[eqn] = 0.0; return source2; } if (C_YI(c,t,3)) { double source2; double k; real xc[ND_ND]; C_CENTROID(xc,cell,thread); k = (1/pow(((ee*Kb*T)/(2*NA*pow(el,2)*ninf)),0.5)); source2 = -ee*U0*pow(k,2)*Ex; dS[eqn] = 0.0; return source2; } } Where, C_YI(c,t,3) is the specie Cl and C_YI(c,t,2) is Na. Thanks |
|
Tags |
macroc_yi, source, species |
|
|