|
[Sponsors] | |||||
|
|
|
#1 |
|
New Member
CFD-user
Join Date: Jul 2012
Posts: 5
Rep Power: 2 ![]() |
Hi,
I am writing an UDF, in which I would like to use the previous time step data. Although, in FLUENT we can access previous time step data for many variables with '_M1', I would need user defined variables previous timestep rather than the standard variables. For e.g. m(t+dt) = m(t) + ............... so to solve the above equation for the new time step I will be needing m(t) i.e., previous time step data. I have been keep on trying this from last few days, but could not crack. It will be appreciated, if you can throw some light on it. Regards... |
|
|
|
|
|
|
|
|
#3 |
|
New Member
CFD-user
Join Date: Jul 2012
Posts: 5
Rep Power: 2 ![]() |
||
|
|
|
|
|
|
|
#4 | |
|
Senior Member
|
Quote:
Bests,
__________________
Amir |
||
|
|
|
||
|
|
|
#5 |
|
Senior Member
Paolo Lampitella
Join Date: Mar 2009
Location: Italy
Posts: 261
Rep Power: 12 ![]() |
What Amir meant to say is that you can save your current time variable in some UDMI and the older one in another UDMI and basically keep updating them as the time passes. In this case you will never need the old time values as you will always reference current time variables
|
|
|
|
|
|
|
|
|
#6 |
|
New Member
CFD-user
Join Date: Jul 2012
Posts: 5
Rep Power: 2 ![]() |
||
|
|
|
|
|
|
|
#7 | |
|
New Member
CFD-user
Join Date: Jul 2012
Posts: 5
Rep Power: 2 ![]() |
Quote:
|
||
|
|
|
||
|
|
|
#8 |
|
Senior Member
|
Consider for example 2 UDMs at first: UDM0, UDM1 and initialize them.
Then in your desired define-macro which does a process in each time step you have e.g.: DEFINE_X(.....) { C_UDMI(...,1)=f(....)+C_UDMI(...,0); //here UDM0 refers to previous time step . . . // At last you have: C_UDMI(...,0)=C_UDMI(...,1); // prepare UDM0 for the next time step } Just note to provide these commands each time steps not each iteration; i.e., if your macro executes each iteration, you need to use a if-clause to restrict the commands for each time step. Bests,
__________________
Amir |
|
|
|
|
|
|
|
|
#9 | |
|
New Member
CFD-user
Join Date: Jul 2012
Posts: 5
Rep Power: 2 ![]() |
Quote:
I have following doubts: 1. For the first time step what would be the value of C_UDMI(...,0) 2. Suppose even if you include it in 'if-else loop' i.e., say for the first time step I will initialise C_UDMI(...,0) in 'if' loop. And subsequently I would use this in else loop. I think I have tried this without inlcuding the if loop for each time step and did not work. I would try for each time-step instead of each iteration and come to you. Thank you again. |
||
|
|
|
||
|
|
|
#10 | ||
|
Senior Member
|
Quote:
Quote:
Bests,
__________________
Amir |
|||
|
|
|
|||
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Multiple floating objects | CKH | OpenFOAM | 10 | September 21, 2011 23:13 |
| Problems with simulating TurbFOAM | barath.ezhilan | OpenFOAM | 13 | July 16, 2009 05:55 |
| Modeling in micron scale using icoFoam | m9819348 | OpenFOAM Running, Solving & CFD | 7 | October 27, 2007 00:36 |
| Transient simulation not converging | skabilan | OpenFOAM Running, Solving & CFD | 12 | September 17, 2007 17:48 |
| Accessing previous time step temperature in UDF | Sam Bennett | FLUENT | 0 | February 27, 2006 10:46 |