
[Sponsors] 
May 19, 2011, 07:14 
Define_source for UDS equation source term

#1 
Member
john
Join Date: Nov 2010
Posts: 50
Rep Power: 7 
Hi All,
I am writing a simple udf to solve electric field. I have two UDS transport equations in the problem. when i run my udf in fluent 6.3.26 i am getting error in this particular source function. it is saying "FLOATING POINT ERROR: Invaled number". Could anynody please tell me where i went wrong. E_vec is defined as C_UDSI_G(c,t,0) DEFINE_SOURCE(ion_source,c,t,dS,eqn) { face_t f; Thread *tf; int n; double NV_VEC(E_vec), NV_VEC(A); double source; source=0.0; c_face_loop(c,t,n) { f=C_FACE(c,t,n); tf=C_FACE_THREAD(c,t,n); F_AREA(A,f,tf); NV_D(E_vec,=, E_X(c,t), E_Y(c,t), E_Z(c,t)); if(THREAD_TYPE(tf)==THREAD_F_WALL) { source=NV_DOT(E_vec,A)*ionmob/NV_MAG(A); } } if( C_UDSI(c,t,0) <0) source=0.0; else source = source; dS[eqn]=source; source*=C_UDSI(c,t,0); return source; } 

May 19, 2011, 22:38 

#3 
Member
john
Join Date: Nov 2010
Posts: 50
Rep Power: 7 
Hi,
I am already saving the gradient data in user memory using C_UDMI. But still it has problem 

May 20, 2011, 01:50 

#4 
Senior Member

from UDF manual:
you can prevent the solver from freeing up memory by issuing the text command solve/set/expert and then answering yes to the question Keep temporary solver memory from being freed?. Note that when you do this, all of the gradient data is retained, but the calculation requires more memory to run. 

May 23, 2011, 05:08 

#5 
Member
john
Join Date: Nov 2010
Posts: 50
Rep Power: 7 
The UDF is working as it is when i hook the source term after one iteration.


June 22, 2011, 07:32 

#6 
Member
john
Join Date: Nov 2010
Posts: 50
Rep Power: 7 
Hi All,
When i run the simulation with UDS for nagative ions, i am getting negative values in the contour plots. I checked source and flux term for each cell they are all positive values. How come i am getting negative values in the domain? I guess i am getting nagative values at the nodes?. how to recify it. Please help John 

Thread Tools  
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
Source Term on Scalar Transport Equation  alessio.nz  OpenFOAM Programming & Development  9  January 31, 2011 08:56 
gradient source term UDF  ak6g08  Fluent UDF and Scheme Programming  0  July 9, 2009 06:37 
Stokes equation with source term  dak81  OpenFOAM Running, Solving & CFD  0  March 12, 2008 09:41 
Source term in the mass balance equation  Mehdi BEN HAJ  Phoenics  0  January 31, 2007 17:30 
UDFs for Scalar Eqn  Fluid/Solid HT  Greg Perkins  FLUENT  0  October 11, 2000 03:43 