CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT

about linearization of source term(udf)

Register Blogs Community New Posts Updated Threads Search

Like Tree3Likes
  • 3 Post By Diego

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 12, 2007, 08:32
Default 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?

  Reply With Quote

Old   June 12, 2007, 15:25
Default 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
  Reply With Quote

Old   June 20, 2007, 15:23
Default 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; }
  Reply With Quote

Old   September 15, 2017, 04:53
Default
  #4
New Member
 
maziyar ghanikolahloo
Join Date: Jan 2017
Posts: 5
Rep Power: 9
maziyarghani is on a distinguished road
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?
maziyarghani is offline   Reply With Quote

Reply


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 Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
wmake compiling new solver mksca OpenFOAM Programming & Development 14 June 22, 2018 07:29
[swak4Foam] swak4foam building problem GGerber OpenFOAM Community Contributions 54 April 24, 2015 17:02
pisoFoam compiling error with OF 1.7.1 on MAC OSX Greg Givogue OpenFOAM Programming & Development 3 March 4, 2011 18:18
DxFoam reader update hjasak OpenFOAM Post-Processing 69 April 24, 2008 02:24
DecomposePar links against liblamso0 with OpenMPI jens_klostermann OpenFOAM Bugs 11 June 28, 2007 18:51


All times are GMT -4. The time now is 01:48.