
[Sponsors] 
March 30, 2012, 16:19 
calling result of a UDF into current time step

#1 
Member
Join Date: Sep 2011
Posts: 40
Rep Power: 6 
Hi guys,
I would appreciate if anyone could give me just a hint or where to look for how to do the following: I want to have a UDF, which calculates at time t value of a variable x. The equation is in the following form: x(t)=x(tdt)+dx/dt*dt As this variable depends on its own value at time tdt, I need to somehow store it in a way that i can later call it. In time t I only need the value of x at time tdt, not the values of x at all times. so, is it possible to store a variable calculated with udf for just one time step and then, how to call it into your udf? I've looked into udf manual and did a little search on the internet, there are ways of storing udf results but I haven't come across anything really useful for me. 

April 1, 2012, 19:53 

#2 
Member
Join Date: Sep 2011
Posts: 40
Rep Power: 6 
Hi again,
I found C_UDMI macro, which is supposed to be used when one wants to store different values from UDF/fluent into memory and use them again. I used this macro in my udf, but when I check the values of this macro (it is possible to check them under contours dialog box) I can see that the value this macro is giving me for every critical place(where I need it in the calculations) is ()infinite. now, I used this macro in the following way: if (some condition, true at the beggining of simulation) x=0 else if (some other condition) x=0 else acc=pow(C_UDMI(c,t,0),2)*some constants and variables x = C_UDMI(c,t,0)+acc*dt C_UDMI(c,t,0)=x this is it, there are no definitions of what C_UDMI should be at the beggining of simulation, at the very first time step. which bothers me a bit, although C_UDMI cannot be used at the start of simulation because the condition in which it is used is not fulfilled. therefore I would really appreciate if someone would give me a bit of insight if the above use is ok and what might cause such a problem. just to make it clearin acc there are no chances of getting a 0 into a denominator or other values which would go into infinitive and then cause C_UDMI go into inf. 

Thread Tools  
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
High Courant Number @ icoFoam  Artex85  OpenFOAM Running, Solving & CFD  9  January 3, 2012 09:06 
directMapped problem  panda60  OpenFOAM Bugs  4  July 8, 2010 10:23 
Changing deltaT of current time step  olwi  OpenFOAM Running, Solving & CFD  1  April 30, 2009 04:55 
udf  iteration number within one time step?!  Mira  FLUENT  1  January 23, 2008 04:16 
Transient simulation not converging  skabilan  OpenFOAM Running, Solving & CFD  12  September 17, 2007 17:48 