# about linearization of source term(udf)

 User Name Remember Me Password
 Register Blogs Members List Search Today's Posts Mark Forums Read

 June 12, 2007, 07:32 about linearization of source term(udf) #1 Rebecca Guest   Posts: n/a hello,friends,are you familiar with the user defined sources? i have a questions about linearization of the source: if the source term is caculated by values which are already known, it is the same as a constant, isn't it? so ds=0?

 June 12, 2007, 14:25 Re: about linearization of source term(udf) #2 Diego Guest   Posts: n/a Hi Rebecca. Supose you want to include a source in the equation of a property called "x" (temperature, velocity or any UDS). Your source may or not depend on x. Supose your source is: S = 2 * x^3; You evaluate this value for the current iteration (the value that Fluent already has in memory), getting: S = 2 * (x0) ^3 , where x0 is the current value of x. But you can give Fluent more information, you can tell him what is the value of the derivative of S respect to x in the current iteration: dS = 2 * 3 * x0^2 Fluent will evaluate if using this new information boosts the convergence or not, and will use it or not. You can always give the value dS = 0, but if you give him the derivative you can enhance the convergence. **** You can also use this to avoid negative values of the variable x. For this purpose you must have an always negative derivative which becomes zero when x = 0. If the variable in question is volume fraction or mass in a multiphase analysis, I think you cannot pass the value of the derivative to the solver, the treatment of this equation is diferent from the others. Greetings! Diego, at Uvigo

 June 20, 2007, 14:23 source term(udf)+two phase flow+urgent #3 sara Guest   Posts: n/a I have a two phase problem "one phase is air and the other phase is water", and I want to add source term in continuity equation of air, I wrote bellow udf and I add it to my case, Although there is not any error during interpret of udf, but the flow field doesn't change. I've attached the udf. I'm looking forward to hearing from you. Thank you In Advance sara #include "udf.h" #define C2 .0009672 DEFINE_SOURCE(mass_source,c,t,dS,eqn) { real xc[ND_ND]; real source, vf, vol, den; vf = C_VOF(c,t); vol = C_VOLUME(c,t); den = C_R(c,t); source = -1*C2*den*(pow(vf,0.6667)/pow(vol,0.333)); dS[eqn] = 0.0; C_CENTROID(xc,c,t); if (xc[1] == 0.84) source =source+80.84; else source =source+0.0; return source; }

 September 15, 2017, 03:53 #4 New Member   maziyar ghanikolahloo Join Date: Jan 2017 Posts: 5 Rep Power: 2 Hello I want to write a negative source term or heat flux UDF which has a linear relation with temperature I am very beginner in UDF could you help me?

 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 GGerber OpenFOAM Installation 54 April 24, 2015 16:02 mksca OpenFOAM Programming & Development 13 August 18, 2014 22:26 Greg Givogue OpenFOAM Programming & Development 3 March 4, 2011 18:18 hjasak OpenFOAM Post-Processing 69 April 24, 2008 01:24 jens_klostermann OpenFOAM Bugs 11 June 28, 2007 17:51

All times are GMT -4. The time now is 14:39.

 Contact Us - CFD Online - Privacy Statement - Top