|
[Sponsors] |
March 14, 2012, 13:26 |
DEFINE_ADJUST for limiting values of UDS
|
#1 |
New Member
Toni Pujol
Join Date: Jun 2009
Posts: 6
Rep Power: 17 |
Hi everybody,
I am simulating a system that includes a user defined scalar that is bounded (it cannot be higher than 1). Therefore, I have written the following DEFINE_ADJUST code, compiled (built and loaded) and hooked. No error is given. However, it does not work (the result is the same as with no DEFINE_ADJUST source code). I am using Fluent 13.0. I would appreciate your help. #include "udf.h" DEFINE_ADJUST(limit_UDS,d) { Thread *t; cell_t c; { begin_c_loop_c(t,d) if(C_UDSI(c,t,0)>1.) C_UDSI(c,t,0)=1. end_c_loop(c,t) } } |
|
March 14, 2012, 23:08 |
|
#2 | |
Senior Member
Join Date: Feb 2010
Posts: 164
Rep Power: 17 |
Quote:
Therefore, forcing a UDS value in adjust function only should be used to rule temporary value which is unreasonable, like upper temperature limit 5000K in Fluent. You can't alway force the UDS to your value during the whole iteration. I mean you should force UDS value only when the value is out of reasonable range. |
||
March 15, 2012, 04:27 |
How to limit the value of a UDS (like temperature)
|
#3 |
New Member
Toni Pujol
Join Date: Jun 2009
Posts: 6
Rep Power: 17 |
So, is there any way to limit the value of a UDS like temperature in the "limits" option in the "run calculation" dialog box?
|
|
March 15, 2012, 20:29 |
|
#4 | |
Senior Member
Join Date: Feb 2010
Posts: 164
Rep Power: 17 |
Quote:
#include "udf.h" DEFINE_ADJUST(limit_UDS,d) { Thread *t; cell_t c; thread_loop_c(t, d) /*loops over all cell threads in domain*/ { begin_c_loop(c, t) /* loops over cells in a cell thread */ { if(C_UDSI(c,t,0)>1.) { C_UDSI(c,t,0)=1. } } end_c_loop(c, t) } } |
||
March 16, 2012, 10:09 |
|
#5 |
New Member
Toni Pujol
Join Date: Jun 2009
Posts: 6
Rep Power: 17 |
I am sorry but I forgot to write the
thread_loop_c(t, d) line in my first message. So, my define_adjust is equal to yours but simply does not work. In any case, thank you for your replies. |
|
March 18, 2012, 07:13 |
|
#6 |
Senior Member
Join Date: Feb 2010
Posts: 164
Rep Power: 17 |
||
August 20, 2012, 21:30 |
|
#7 |
New Member
Pablo Cornejo Olivares
Join Date: Mar 2009
Location: Concepción, Chile
Posts: 5
Rep Power: 17 |
Have the same problem.
Did you find some solution? Do not why hooking define_adjust doesn't work. I appreciate whatever clue to solve this... best regards |
|
August 24, 2012, 06:35 |
|
#8 |
New Member
Toni Pujol
Join Date: Jun 2009
Posts: 6
Rep Power: 17 |
No, I did not find the solution.
|
|
August 27, 2012, 08:58 |
|
#9 |
New Member
Anton Khokhlov
Join Date: Aug 2012
Location: Moscow
Posts: 4
Rep Power: 14 |
Maybe it is not too straightforward, but consider the following:
1) If the scheme for transport equation is monotonous, the solution should be within limits set by boundary conditions, if we disregard the source term. 2) Accordingly, it is much better to formulate the source term in such a manner that it will preserve the solution within the necessary limits (or decrease the iteration parameter/time step). 3) If you adjust the solution, it will go out of limits upon the next iteration in a most unpleasant manner anyway due to (2). Just take a look at http://www.cfd-online.com/Forums/flu...ds-values.html Last edited by antonk67; August 28, 2012 at 02:24. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Preventing negative scalar (UDS) values?? | Matthew Brannock | FLUENT | 5 | September 1, 2020 13:32 |
UDS stored to UDM do not show the same values | swati_mohanty | FLUENT | 0 | December 3, 2010 04:46 |
Doubts UDS Flux, UDS Unsteady for VOF model | kel85uk | FLUENT | 0 | March 17, 2010 09:53 |
strange node values @ solid/fluid interface - help | JB | FLUENT | 2 | November 1, 2008 13:04 |
Setting fixed values with UDS | Andrew Garrard | FLUENT | 3 | February 2, 2004 11:00 |