# How to define unsteady term in scaler function?

 Register Blogs Members List Search Today's Posts Mark Forums Read

 June 19, 2001, 12:04 How to define unsteady term in scaler function? #1 olivia Guest   Posts: n/a Hi: I want to define unsteady term in scaler function . But it have some error message in line 6 message is UDS:undeclared variable. Can anyone know how to solve this problem? Thanks!! #include "udf.h" DEFINE_SOURCE(usr_ensource, cell, thread, ds, eqn) { real lg,l,unst;UDS unst = DEFINE_UDS_UNSTEADY(c, t, i); l = 2440.0; lg = l * ( 1.0 + 8.31 * exp(-1.0 * 0.436 * C_UDSI(c,t,i) ) ); source = 1.0 / 0.5 * unst * lg; return source; }

 June 20, 2001, 10:54 Re: How to define unsteady term in scaler function #4 Lanre Guest   Posts: n/a I neglected to mention you have to implement the UDF as a compiled UDF. The function takes your relation to modify the time-derivative term and applies it through the unsteady UDS term macro: #include "udf.h" #include "math.h" #define rho 1000 #define l 2440.0 DEFINE_UDS_UNSTEADY(uds_unsteady, cell, thread, i, apu, su) { float time_step, vol, phi_old, phi_curr, lg, uscl,el; float A; time_step= RP_Get_Real("physical-time-step"); vol = C_VOLUME(cell,thread); el = 1.0; uscl = C_UDSI(cell,thread,i); lg = el * ( 1.0 + 8.31 * exp(-1.0 * 0.436 *uscl) ); A = 1.0/0.5*lg; *apu = -rho*vol/time_step * A; /*central coefficient part*/ phi_old = C_STORAGE_R(cell,thread,SV_UDSI_M1(i)); /*phi_curr = C_UDSI(cell,thread,i);*/ *su = rho*vol*phi_old/time_step * A; /*source term part*/ }

 October 29, 2012, 23:15 #5 New Member   vaseem akram shaik Join Date: Oct 2012 Posts: 12 Rep Power: 6 Hi everyone, I am trying to solve the Navier-Stokes equations and Continuity equation for low reynolds number flow, so i just need to neglect the advection term in Navier stokes equation, is this possible in fluent? If yes, please tell me how.

 December 3, 2012, 15:40 source term for uds #6 New Member   fariba Join Date: Oct 2011 Posts: 9 Rep Power: 7 Hi, I want to write a source tem by udf for uds,. my scalar is concentration and my source term includes concentration(uds), but i don't know how i define variable of this equation in udf! in my udf, i wrote "user scalar 0" instead of my variable , but fluent gave me an error for example my scalar is concentratin(C), and my source term is: kC^2

 Thread Tools Display Modes Linear Mode

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post aleisia FLUENT 3 March 7, 2011 23:58 Chrisi1984 OpenFOAM Installation 0 December 31, 2010 07:42 Ashi Fluent UDF and Scheme Programming 0 May 25, 2009 09:39 feng_w OpenFOAM Installation 1 January 25, 2009 07:59 Afungchui Main CFD Forum 0 March 14, 2005 12:50

All times are GMT -4. The time now is 18:35.