|
[Sponsors] |
March 28, 2005, 12:21 |
Plot UDF functions
|
#1 |
Guest
Posts: n/a
|
Hi, everyone
I am trying to use a UDF to add source terms in momentum equation, however I want to check the plot of the source terms in the flow domain. I find I have no way to do this in FLUENT, until I write the plot file in UDF itself. Does anyone find an easy way to plot the UDF functions, thanks very much. |
|
March 28, 2005, 13:15 |
Re: Plot UDF functions
|
#2 |
Guest
Posts: n/a
|
hi if you want to do this you must put this source term in either user define scalar or user define memory.
Please ask if you have more questions |
|
March 28, 2005, 19:46 |
Re: Plot UDF functions
|
#3 |
Guest
Posts: n/a
|
Thanks, Z, I have no problem in imposing this udf sourse term, it is just the matter of ploting it. You mean if i set it as user define scalar, I will be able to plot it, right? Which menu is used to plot this user define scalar? Thanks again.
|
|
March 29, 2005, 02:58 |
Re: Plot UDF functions
|
#4 |
Guest
Posts: n/a
|
let us say you define this source in DEFINE_SOURCE() {
source =blah*blah; C_UDMI(c,t,0)=source; /* This is UD memory*/ return source, } Before compiling this code make sure that memory =1 (this is defined in DEFINED memory) Now after running this code in Visualisation panel you should be able to see USER DEFINE memory along with other post processing variables like pressure, velocity etc I hope this is clear for you. |
|
March 29, 2005, 18:22 |
Re: Plot UDF functions
|
#5 |
Guest
Posts: n/a
|
hi, SS
I get your point, I will try and lot of thanks for your help. |
|
March 29, 2005, 20:30 |
Re: Plot UDF functions
|
#6 |
Guest
Posts: n/a
|
Thanks, it works fine, thanks a lot again.
|
|
September 11, 2010, 22:47 |
|
#7 | |
New Member
Antonio
Join Date: Aug 2010
Posts: 19
Rep Power: 16 |
Hi there
I'm trying exactly the same thing, a contour plot of my source term to verify that is being read correctly. My udf looks as follows: DEFINE_SOURCE(tube,c,t,dS,eqn) { real x[ND_ND]; real source,a; tiempo=RP_Get_Real("flow-time"); C_CENTROID(x,c,t); fscanf(A,"%f",&source); C_UDMI(c,t,0)=source; return C_UDMI(c,t,0); } And I'm reading from A that has the source terms. I have also set memory=1. The problem is that no matter what I do, when I plot USER DEFINED MEMORY, is all equal to 0. The weird thing is that if I set C_UDMI(c,t,0) to, let's say, 10, then it plots correctly. This makes me think that perhaps is not even reading the file properly which is even more confusing since result seem to make sense. You folks have any idea of what's going on? Many thanks Quote:
|
||
September 14, 2010, 08:30 |
|
#8 |
Member
Byron Smith R J
Join Date: Mar 2009
Location: India
Posts: 46
Rep Power: 17 |
hai
from wat u have posted, it seems that u r reading the source from a file and the variable a is defined as small letter in real and caps is used in the program. check whether the program is free of compilation error. then try printing the source term and see if it is being read correctly |
|
October 20, 2010, 18:00 |
Plot source term
|
#9 | |
New Member
Antonio
Join Date: Aug 2010
Posts: 19
Rep Power: 16 |
Hi there,
How would you do this (plotting a source term) with ANSYS12/CFX? Many thanks Quote:
|
||
October 14, 2014, 01:12 |
hi
|
#10 |
Member
Qureshi M Z I
Join Date: Sep 2013
Posts: 81
Rep Power: 13 |
hi,
my UDF of source term is showing zero output. here is my Udf , if anybody know the problem please help me . DEFINE_SOURCE(xmom,c,t,dS,eqn) { real x[ND_ND]; real source,ve; C_CENTROID(x,c,t); ve=sqrt((pow(C_U(c,t),2.0)+pow(C_V(c,t),2.0)+pow(C _W(c,t),2.0))); source =-1.225*0.2*0.55* C_U(c,t)*ve; C_UDMI(c,t,0)=source; return source; } thanks |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
UDF Wall functions. ANY EXPERTS? | syler3321 | FLUENT | 1 | November 9, 2014 23:15 |
UDF Wall functions conundrum | syler3321 | FLUENT | 0 | June 18, 2011 20:25 |
functions in UDF | Lucy | FLUENT | 4 | April 14, 2011 17:41 |
compiling my UDF | Seyed Farid Hosseinizadeh | FLUENT | 22 | February 14, 2006 11:19 |
DEFINE_GEOM UDF Problems | Pat | FLUENT | 0 | August 14, 2003 14:16 |