CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT > Fluent UDF and Scheme Programming

calling result of a UDF into current time step

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 30, 2012, 17:19
Default calling result of a UDF into current time step
  #1
Member
 
Join Date: Sep 2011
Posts: 43
Rep Power: 15
Komon is on a distinguished road
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(t-dt)+dx/dt*dt

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.
Komon is offline   Reply With Quote

Old   April 1, 2012, 20:53
Default
  #2
Member
 
Join Date: Sep 2011
Posts: 43
Rep Power: 15
Komon is on a distinguished road
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 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.
Komon is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Transient simulation not converging skabilan OpenFOAM Running, Solving & CFD 14 December 17, 2019 00:12
High Courant Number @ icoFoam Artex85 OpenFOAM Running, Solving & CFD 11 February 16, 2017 14:40
directMapped problem panda60 OpenFOAM Bugs 4 July 8, 2010 11:23
Changing deltaT of current time step olwi OpenFOAM Running, Solving & CFD 1 April 30, 2009 05:55
udf - iteration number within one time step?! Mira FLUENT 1 January 23, 2008 04:16


All times are GMT -4. The time now is 18:25.