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

help needed for accessing previous step values

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 23, 2016, 12:44
Question help needed for accessing previous step values
  #1
New Member
 
louis
Join Date: Aug 2016
Posts: 3
Rep Power: 10
weirdsda is on a distinguished road
Hi all:
I have been frustrated for a long time to try to make a UDF with a previous step variable.
I would like to access the previous step value of C_STRAIN_RATE_MAG(c,tc), for the current calculation. I tried UDMI and UDSI_M1 but I could not get it right.

I would really appreciate if anyone knows how to do it?
weirdsda is offline   Reply With Quote

Old   April 6, 2017, 15:42
Default I am facing problem with previous time step macros
  #2
New Member
 
Karthikeyan
Join Date: Nov 2016
Posts: 14
Rep Power: 10
kar1209 is on a distinguished road
I want to provide convective boundary condition at my domain outlet and I am trying to do that by relating the current time step U velocity for the cells in the cell thread on the outlet face with the U velocity of the cells from the previous time step. I tried using the F_U_M1 macro. But I am getting "segmentation error". Can anybody help me?
kar1209 is offline   Reply With Quote

Old   April 7, 2017, 05:22
Default
  #3
Senior Member
 
sbaffini's Avatar
 
Paolo Lampitella
Join Date: Mar 2009
Location: Italy
Posts: 2,192
Blog Entries: 29
Rep Power: 39
sbaffini will become famous soon enoughsbaffini will become famous soon enough
Send a message via Skype™ to sbaffini
Pretty sure that M1 and M2 variables only exist for cell values, not face ones. You need to save current face variables in a F_UDMI and access at the next time step before updating them. There is a post hanging around about this very specific task (using UDMI to store variables from previous time steps).
sbaffini is offline   Reply With Quote

Old   April 7, 2017, 09:17
Default Accessing previous time step values
  #4
New Member
 
Karthikeyan
Join Date: Nov 2016
Posts: 14
Rep Power: 10
kar1209 is on a distinguished road
Thank you so much. I was able to find the thread regarding using UDMs for accessing variable values at previous time steps.

Previous time step variable to be used in UDF

I have one more doubt. I see that in all programs, F_UDMI is used inside the begin_f_loop(). In that case can a UDM location store multiple values corresponding to multiple faces in a face thread?
kar1209 is offline   Reply With Quote

Old   April 7, 2017, 09:46
Default
  #5
Senior Member
 
sbaffini's Avatar
 
Paolo Lampitella
Join Date: Mar 2009
Location: Italy
Posts: 2,192
Blog Entries: 29
Rep Power: 39
sbaffini will become famous soon enoughsbaffini will become famous soon enough
Send a message via Skype™ to sbaffini
Yes, note that this:

F_UDMI(f,t,i)

is the way F_UDMI is accessed, where f is the local face index, t is the face thread and i is the (i-1)-th F_UDMI variable (i starts at 0).
sbaffini is offline   Reply With Quote

Old   April 7, 2017, 09:58
Default
  #6
New Member
 
Karthikeyan
Join Date: Nov 2016
Posts: 14
Rep Power: 10
kar1209 is on a distinguished road
Quote:
Originally Posted by kar1209 View Post
Thank you so much. I was able to find the thread regarding using UDMs for accessing variable values at previous time steps.

Previous time step variable to be used in UDF

I have one more doubt. I see that in all programs, F_UDMI is used inside the begin_f_loop(). In that case can a UDM location store multiple values corresponding to multiple faces in a face thread?
What I meant to say is that if I want to calculate the value at current time step using value at previous time step and then assign it to the faces using F_PROFILE(), can I use 2 different looping macros - one for calculating the next time step value in the current time step and another looping macro for assigning the values in the next time step?

for example:
Code:
/*for specifying u velocity*/

begin_f_loop(f,t)
{
F_PROFILE(f,t,i) = F_UDMI(1); /*values to be assigned to boundary face in the next time step*/
}
end_f_loop(f,t)
begin_f_loop(f,t)
{
F_UDMI(1) = (.....) + F_U(f,t); /*calculation in the current time step*/
}
end_f_loop(f,t)
The above code is valid only if UDM can store multiple values. Otherwise how do I go around this? Please help.
kar1209 is offline   Reply With Quote

Reply

Tags
udf, udmi, udsi


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
Transient simulation not converging skabilan OpenFOAM Running, Solving & CFD 14 December 17, 2019 00:12
Micro Scale Pore, icoFoam gooya_kabir OpenFOAM Running, Solving & CFD 2 November 2, 2013 14:58
AMI interDyMFoam for mixer nu problem danny123 OpenFOAM Programming & Development 8 September 6, 2013 03:34
same geometry,structured and unstructured mesh,different behaviour. sharonyue OpenFOAM Running, Solving & CFD 13 January 2, 2013 23:40
UDF and previous time step macros Aleex FLUENT 2 January 23, 2011 10:39


All times are GMT -4. The time now is 01:48.