
[Sponsors] 
January 13, 2007, 15:25 
How to determine some calculations in UDS function

#1 
Guest
Posts: n/a

I would like to know how to calculate some cases as follows: 1. In unsteady state, we can calculate the previous time step value by using C_UDSI_M1(c,t,i). But for steady state, if I want to calculate the new value of UDS by using the old value (it means the value in previous iteration). How can I determine the old value? For example, I want to have: C_UDSI(c,t,i)_new = anpha*C_UDSI(c,t,i)new+(1alpha)*C_UDSI_M1(c,t,i)old.
2. If I have two values of UDS like C_UDSI(c,t,1) and C_UDSI(c,t,2). I want to compare two value by using a subtract, for example e = C_UDSI(c,t,1)  C_UDSI(c,t,2) If e is smaller than a given value, then the program will stop (condition statement). How can I implement the condition? (Actually, I want to know where I write some statements for this). I highly appreciate your help. Thank, 

January 14, 2007, 14:46 
Re: How to determine some calculations in UDS func

#2 
Guest
Posts: n/a

I hope this will work. Activate 2 user defined memories, UDM. Use the macro Define_Adjust, first assign UDM2= UDM1, then assign udm 1 with uds. Define adjust is called at every iterations. So in the previous iteration result will be available at udm2.
best wishes, Sujith S Nair 

January 14, 2007, 18:15 
Re: How to determine some calculations in UDS func

#3 
Guest
Posts: n/a

Thank for your idea. I did like that. I use two UDS functions which are defined the same. For example: UDS1= a+b UDS2= (a+b)*alpha+UDS1*(1alpha) Run two UDS every iteration, with alpha is relaxation factor (alpha < 1). Then for new iteration, UDS2 is new value and UDS1 is old value. But when I run the program, it showed me that the number is NOT available (floating point). Could you tell me more obviously about what you are talking about. Thanks


January 15, 2007, 11:06 
Re: How to determine some calculations in UDS func

#4 
Guest
Posts: n/a

I was not suggesting UDS, It is UDM , user defiend memory. define>userdefined>Memory. activate 2 udms. You can get the value of UDS at previous iteration using a DEFINE_EXECUTE_AT_END macro. Inside the DEFINE_EXECUTE_AT_END macro do the following operations in the same order. 1.UDM0= UDM1. 2. UDM1= UDS0. Now you have the value of UDS present iteration in UDM1 and previous iteration in UDM0. 3. The value of the UDS0 can be modified UDS0 = F( UDM0, UDM1) 4. Assign the new UDS0 value to the UDM1.
second qn regarding e= UDS2UDS1, you can define a custom field function and monitor it. 

January 15, 2007, 17:52 
Re: How to determine some calculations in UDS func

#5 
Guest
Posts: n/a

Thanks. It seems to be right what you was talking about. It is very useful for me.
Regards, 

Thread Tools  
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
LiencubiclowRemodel  nzy102  OpenFOAM Bugs  14  January 10, 2012 09:53 
Problems in compiling paraview in Suse 10.3 platform  chiven  OpenFOAM Installation  3  December 1, 2009 08:21 
Installation 1.5 as a user of server (New bird)  chiven  OpenFOAM Installation  15  April 26, 2009 22:33 
Problem with rhoSimpleFoam  matteo_gautero  OpenFOAM Running, Solving & CFD  0  February 28, 2008 07:51 
REAL GAS UDF  brian  FLUENT  6  September 11, 2006 08:23 