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

C_STORAGE_R and SV_UDSI_M1

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 11, 2014, 01:48
Default C_STORAGE_R and SV_UDSI_M1
  #1
Senior Member
 
François Grégoire
Join Date: Jan 2010
Location: Canada
Posts: 392
Rep Power: 17
macfly is on a distinguished road
In UDF Manual 15.0 example 2.7.4.3 there is a line to retrieve the value of a scalar at previous time step:
Code:
phi_old = C_STORAGE_R(c,t,SV_UDSI_M1(i));
Couldn't we just do this instead:
Code:
phi_old = C_UDSI_M1(c,t,i);
macfly is offline   Reply With Quote

Old   May 20, 2015, 05:06
Default exactly my question
  #2
New Member
 
Franz Roman
Join Date: Jun 2009
Posts: 28
Rep Power: 17
franzdrs is on a distinguished road
Hi,
I am wondering exactly the same. Did you found out if both options are equivalent?

Thanks

Franz

Quote:
Originally Posted by macfly View Post
In UDF Manual 15.0 example 2.7.4.3 there is a line to retrieve the value of a scalar at previous time step:
Code:
phi_old = C_STORAGE_R(c,t,SV_UDSI_M1(i));
Couldn't we just do this instead:
Code:
phi_old = C_UDSI_M1(c,t,i);
franzdrs is offline   Reply With Quote

Old   May 20, 2015, 07:32
Default
  #3
Senior Member
 
François Grégoire
Join Date: Jan 2010
Location: Canada
Posts: 392
Rep Power: 17
macfly is on a distinguished road
In the end I didn't use any previous time step macro. Instead I preferred to store variables in user defined memories (C_UDMI), an alternative way to compare with previous time step(s).
macfly is offline   Reply With Quote

Old   May 20, 2015, 10:21
Default
  #4
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27
pakk will become famous soon enough
In mem.h, the following line is found:
Code:
#define C_UDSI_M1(c,t,i)C_STORAGE_R(c,t,SV_UDSI_M1(i))
This shows that

Code:
phi_old = C_UDSI_M1(c,t,i);
is the same as

Code:
phi_old = C_STORAGE_R(c,t,SV_UDSI_M1(i));
So both options seem to be exactly the same. Until Fluent decides in a newer version to change the definition of C_UDSI_M1.
pakk is offline   Reply With Quote

Old   April 13, 2017, 05:59
Default
  #5
New Member
 
saeed
Join Date: Mar 2017
Posts: 2
Rep Power: 0
saeed676 is on a distinguished road
Quote:
Originally Posted by macfly View Post
In UDF Manual 15.0 example 2.7.4.3 there is a line to retrieve the value of a scalar at previous time step:
Code:
phi_old = C_STORAGE_R(c,t,SV_UDSI_M1(i));
Couldn't we just do this instead:
Code:
phi_old = C_UDSI_M1(c,t,i);
Hi, I am beginner at using UDFs but I wonder maybe why not straight forward use this macro to calculate old value at previous timestep, suppose it's phi_old = temperature variable
phi_old = C_T_M1(c, t)

Thanks
saeed676 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



All times are GMT -4. The time now is 21:43.