calling result of a UDF into current time step
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:
As this variable depends on its own value at time t-dt, 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 t-dt, 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.
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)
else if (some other condition)
acc=pow(C_UDMI(c,t,0),2)*some constants and variables
x = C_UDMI(c,t,0)+acc*dt
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 clear-in 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.
|All times are GMT -4. The time now is 22:33.|