initialization species UDF
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) } } |
It needs modifications
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:
/////////////////////////////////////////// |
Hi Dragos Moroianu
Thank you for your relpy, exactely with this UDF, i receive message error "segmentation violation". |
I have just the density of species, how i can calculate mass fraction, have you any idea?
thank you |
Hello Louiza,
The udf I posted should not crash if you have defined 5 species! density = mass/volume => mass = density*volume Dragos |
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:) |
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 |
Hi Dragos
Thank you for your answer. Good day louiza |
All times are GMT -4. The time now is 11:40. |