|
[Sponsors] |
June 12, 2007, 08:32 |
about linearization of source term(udf)
|
#1 |
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, 15:25 |
Re: about linearization of source term(udf)
|
#2 |
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, 15:23 |
source term(udf)+two phase flow+urgent
|
#3 |
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, 04:53 |
|
#4 |
New Member
maziyar ghanikolahloo
Join Date: Jan 2017
Posts: 5
Rep Power: 9 |
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? |
|
|
|
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 |