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

How to determine some calculations in UDS function

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 13, 2007, 14:25
Default How to determine some calculations in UDS function
  #1
Le
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+(1-alpha)*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,
  Reply With Quote

Old   January 14, 2007, 13:46
Default Re: How to determine some calculations in UDS func
  #2
Sujith S Nair
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
  Reply With Quote

Old   January 14, 2007, 17:15
Default Re: How to determine some calculations in UDS func
  #3
Le
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*(1-alpha) 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

  Reply With Quote

Old   January 15, 2007, 10:06
Default Re: How to determine some calculations in UDS func
  #4
Sujith
Guest
 
Posts: n/a
I was not suggesting UDS, It is UDM , user defiend memory. define->user-defined->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= UDS2-UDS1, you can define a custom field function and monitor it.

  Reply With Quote

Old   January 15, 2007, 16:52
Default Re: How to determine some calculations in UDS func
  #5
Le
Guest
 
Posts: n/a
Thanks. It seems to be right what you was talking about. It is very useful for me.

Regards,
  Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
LiencubiclowRemodel nzy102 OpenFOAM Bugs 14 January 10, 2012 08:53
Problems in compiling paraview in Suse 10.3 platform chiven OpenFOAM Installation 3 December 1, 2009 07: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 06:51
REAL GAS UDF brian FLUENT 6 September 11, 2006 08:23


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