CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (https://www.cfd-online.com/Forums/fluent-udf/)
-   -   C_STORAGE_R and SV_UDSI_M1 (https://www.cfd-online.com/Forums/fluent-udf/145722-c_storage_r-sv_udsi_m1.html)

macfly December 11, 2014 00:48

C_STORAGE_R and SV_UDSI_M1
 
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 May 20, 2015 04:06

exactly my question
 
Hi,
I am wondering exactly the same. Did you found out if both options are equivalent?

Thanks

Franz

Quote:

Originally Posted by macfly (Post 523396)
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 May 20, 2015 06:32

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).

pakk May 20, 2015 09:21

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.

saeed676 April 13, 2017 04:59

Quote:

Originally Posted by macfly (Post 523396)
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


All times are GMT -4. The time now is 03:59.