|
[Sponsors] |
June 23, 2009, 14:26 |
help with UDSI_G
|
#1 |
Member
Akour
Join Date: May 2009
Posts: 79
Rep Power: 17 |
hi,
Could anyone please tell me if there is a better way to calculate a user defined scalar gradient other than C_UDSI_G(c,t,i)...whenever I introduce this function my solution diverges very fast...even with residuals under 0.05! basically, I have 2 udfs, a poisson equation for voltage, and a ion transport equation. One of the sources appearing in the ion transport equation is the (gradient of the voltage*gradient of the charge...which are both UDSs)...the UDFs for the source terms are below, I read something about UDMIs maybe helping but im not quite sure how to implement these properly.please someone help! Thanks a lot! ak charge sources: DEFINE_SOURCE(spcharge_lin,c,t,dS,eqn) { real source,source_a,source_b; static real kappa = .00000000882; source_a = C_R(c,t)*kappa*C_UDSI_G(c,t,0)[0]*C_UDSI_G(c,t,1)[0]; source_b = C_R(c,t)*kappa*C_UDSI_G(c,t,0)[1]*C_UDSI_G(c,t,1)[1]; source=source_a+source_b; dS[eqn] = 0; return source; } voltage equation: DEFINE_SOURCE(electric_source,c,t,dS,eqn) { dS[eqn] = 0; return (C_R(c,t)*C_UDSI(c,t,1)/epsilon); } DEFINE_DIFFUSIVITY(electric_diff, c, t, i) { return 3.54; } |
|
|
|