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

UDF - define_init & restart problem

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 3, 2012, 17:27
Question UDF - define_init & restart problem
  #1
New Member
 
Ján
Join Date: Mar 2010
Location: Slovakia
Posts: 24
Rep Power: 16
argeus is on a distinguished road
Dear friends,
There is one thing I cant figure out. I interpreted my UDF which was made as follows:
Define_init function. Is to examine the geometry parameters, to simplify it, it returns the total volume (c_tot variable) of the cells.
Define_source (whatever define macro), uses this value, such as x/c_tot. Everything works fine, until I end the calculation, write a .dat file and restart the calculation without initialization. Seems to be (and Im pretty sure), that Fluent does not store the c_tot value, in general any value, obtained from define_init once the calculation is over and then restarted. I really dont want to use a define_adjust (it will uselessly slow down my calculation), or define_on_demand (want to keep it to be performed automatically). Is there any way to store that value for the next usage?
Thank you in advance.
j.
argeus is offline   Reply With Quote

Old   December 4, 2012, 12:19
Default
  #2
New Member
 
Ján
Join Date: Mar 2010
Location: Slovakia
Posts: 24
Rep Power: 16
argeus is on a distinguished road
Hi again,
so it seems to be that I moved on a bit.
I found out that use of C_UDMI could be suitable for this kind of problem, anyway there is still an issue I cant pass through.
To explain it more closely:

Code:
DEFINE_INIT (init, domain)
{
  real ...
  thread_loop_c(t, domain);
      {
      begin_c_loop(c, tc)
        if (sth)
        {
        C_UDMI(c, tc, 0)+=C_VOLUME(c, tc);
        }
      end_c_loop(c, tc)
      }
}

and then

DEFINE_SOURCE(energy, c, thread, dS, eqn)
{
   real ...
   var1=var2/C_UDMI(c, tc, 0)
   source=var3; 
   dS[eqn]=var4;
   return source;
}
Please have a look on that. Problem is, that C_UDMI is returning zero value (as an output from ini function), and I dont have a clue why.
Maybe I just dont understand how C_UDMI is working.
The second question is - Will be the C_UDMI value stored after I re-interpret my UDF, or restart the calculation from a .dat file? (Will be this value written into a .dat file?).
For now, Im using on demand macro, but it is not so pretty as I would like to..
Thank you in advance.
Regards

Last edited by argeus; December 4, 2012 at 14:03.
argeus is offline   Reply With Quote

Reply

Tags
.dat, define_init, restart, udf


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
ATTN ALL: SOLUTON TO UDF COMPILE PROBLEM Rizwan Fluent UDF and Scheme Programming 40 March 18, 2018 07:05
UDF Problem ozgur Fluent UDF and Scheme Programming 18 January 17, 2016 15:40
Problem with my udf july Fluent UDF and Scheme Programming 3 June 20, 2010 07:56
fluent udf problem for 3d case srsahu Fluent UDF and Scheme Programming 0 July 28, 2009 08:25
UDF variables F1, y / problem with UDF Fabian FLUENT 6 June 2, 2003 11:22


All times are GMT -4. The time now is 20:38.