|
[Sponsors] |
November 25, 2009, 05:19 |
initialization species UDF
|
#1 |
New Member
hameurlaine
Join Date: Jul 2009
Posts: 27
Rep Power: 17 |
Hello everyone,
this UDF syntax of the initialization of different-density of species is it correct? thank you for your answer /////////////////////////////////////////// DEFINE_INIT(udf_init_temp, domain) { cell_t c,c0,c1,c2,c3,c4; Thread *t,*t0, *t1, *t2,*t3, *t4; real coord[ND_ND]; thread_loop_c(t,domain) { begin_c_loop_all(c,t) { C_CENTROID(coord,c,t); if (coord[1] < 0.0005) C_T(c,t) = 10000.0; C_R(c0,t0)= 1E24; /* densiy of Ar */ C_R(c1,t1)= 2E22; /* density of Ar+ */ C_R(c2,t2)= 1E2; /* density of Ar2+ */ C_R(c3,t3)= 1E2; /* density of Ar3+ */ C_R(c4,t4)= 2E22; /* density of electrons */ } end_c_loop_all(c,t) } } |
|
November 25, 2009, 07:25 |
It needs modifications
|
#2 |
Senior Member
Dragos
Join Date: Mar 2009
Posts: 648
Rep Power: 20 |
Hi Louiza,
Your udf lacks correct values for c0, c1, c2, c3, c4, t0, t1, t2, t3, t4. It should give you segmentation fault. First of all, I don't think you can set the density for species, but the mass fraction. In your case, the modification should be as following: Code:
/////////////////////////////////////////// DEFINE_INIT(udf_init_temp, domain) { cell_t c; Thread *t; real coord[ND_ND]; thread_loop_c(t,domain) { begin_c_loop_all(c,t) { C_CENTROID(coord,c,t); if (coord[1] < 0.0005) C_T(c,t) = 10000.0; C_YI(c,t,0)= 1E24; /* mass fraction of Ar */ C_YI(c,t,1)= 2E22; /* mass fraction of Ar+ */ C_YI(c,t,2)= 1E2; /* mass fraction of Ar2+ */ C_YI(c,t,3)= 1E2; /* mass fraction of Ar3+ */ C_YI(c,t,4)= 2E22; /* mass fraction of electrons */ } end_c_loop_all(c,t) } } Last edited by dmoroian; November 25, 2009 at 09:27. |
|
November 25, 2009, 09:13 |
|
#3 |
New Member
hameurlaine
Join Date: Jul 2009
Posts: 27
Rep Power: 17 |
Hi Dragos Moroianu
Thank you for your relpy, exactely with this UDF, i receive message error "segmentation violation". |
|
November 25, 2009, 09:19 |
|
#4 |
New Member
hameurlaine
Join Date: Jul 2009
Posts: 27
Rep Power: 17 |
I have just the density of species, how i can calculate mass fraction, have you any idea?
thank you |
|
November 25, 2009, 09:53 |
|
#5 |
Senior Member
Dragos
Join Date: Mar 2009
Posts: 648
Rep Power: 20 |
Hello Louiza,
The udf I posted should not crash if you have defined 5 species! density = mass/volume => mass = density*volume Dragos |
|
November 25, 2009, 10:55 |
|
#6 |
New Member
hameurlaine
Join Date: Jul 2009
Posts: 27
Rep Power: 17 |
Hi Dragos
Your UDF works fine without error, i have another question please, i need to initialize the mass fraction of species in temperature 10000 K trought UDF, and this same species in 1000 k in the pannel solve>initialize. can i initialize all species at 1000 and 10 000k througt UDF? my second question: mass=density/volume, i 'm very bad in kinetic law how a calculate a volume, can i use pv = nRT? Thank you dragos |
|
November 26, 2009, 04:05 |
|
#7 |
Senior Member
Dragos
Join Date: Mar 2009
Posts: 648
Rep Power: 20 |
Hi Louiza,
I suspect you have one number for each species, representing the average density of that species in the entire computational domain. It this is the case, then the volume we are talking about is ... the entire domain. In this approach (transport species), the temperature is defined only for the mixture, not for each species individually. Otherwise, you have to take another approach (Euler/Euler maybe). Dragos |
|
November 26, 2009, 04:56 |
|
#8 |
New Member
hameurlaine
Join Date: Jul 2009
Posts: 27
Rep Power: 17 |
Hi Dragos
Thank you for your answer. Good day louiza |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
UDF species equations | louiza | FLUENT | 4 | March 10, 2010 02:20 |
PB: Saving mass fraction of species on two points with an udf | biget.a | FLUENT | 2 | July 23, 2009 04:06 |
UDF for species mass fractions | MRR | FLUENT | 0 | December 29, 2005 08:14 |
Retrieving species in UDF | Fernando | FLUENT | 0 | September 3, 2004 09:22 |
UDF reading species data of pdf simulations | Jamiro | FLUENT | 0 | June 20, 2001 18:15 |