Plot UDF functions
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. |
Re: Plot UDF functions
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 |
Re: Plot UDF functions
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.
|
Re: Plot UDF functions
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. |
Re: Plot UDF functions
hi, SS
I get your point, I will try and lot of thanks for your help. |
Re: Plot UDF functions
Thanks, it works fine, thanks a lot again.
|
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:
|
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 |
Plot source term
Hi there,
How would you do this (plotting a source term) with ANSYS12/CFX? Many thanks Quote:
|
hi
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 |
All times are GMT -4. The time now is 04:05. |