joule heating
Model joule heating in a curved rod UDF Written Sample case and data files are available from ww /* UDF to compute heat source from joule heating of solid by Sreekanth Surapaneni modified by William Wangard, Ph.D. Fluent, Inc. does not assume liability for the rigor of this UDF. The solid is modeled as a fluid with thermal/physical properties of the solid material. UDS Diffusivity must be scaled by the density. rho UDS_Diffusivity = elec_cond Thus, if rho = 8e3, elec_cond = 1e4, then UDS_Diff = 8e7 */ DEFINE_EXECUTE_AT_END(compute_current_flux) { Domain *d = Get_Domain(1); cell_t c; Thread *t; int i; real source; real e_conductivity, e_resistivity; /* CURRENT FLUX */ thread_loop_c(t,d) { begin_c_loop(c, t) { for(i=0; i<ND_ND; i++) { e_conductivity = C_UDSI_DIFF(c,t,0) / C_R(c,t); C_UDMI(c,t,i) = - e_conductivity * C_UDSI_G(c,t,0)[i]; } } end_c_loop(c, t); } /* HEAT GENERATION */ thread_loop_c(t,d) { begin_c_loop(c, t) { e_resistivity = C_R(c,t) / C_UDSI_DIFF(c,t,0); source = 0.; for(i=0; i<ND_ND; i++) { source += C_UDMI(c,t,i) * C_UDMI(c,t,i); } source *= e_resistivity; C_UDMI(c,t,ND_ND) = source; } end_c_loop(c, t); } } DEFINE_SOURCE(joule_heat, c, t, dS, eqn) { float source = 0.; int i; if (!Data_Valid_P()) return 0.0; /* HEAT GENERATION */ source = C_UDMI(c,t,ND_ND); dS[eqn]=0.0; return source; } /* END OF UDF */ |
||
![]()
|