|
[Sponsors] |
user expression- value from previous time step |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
November 27, 2017, 13:16 |
user expression- value from previous time step
|
#1 |
Member
VB
Join Date: Jul 2016
Posts: 35
Rep Power: 10 |
Hello all,
I have created a user expression, net energy = inlet energy - outlet energy. and defined this in solver monitor. I need to calculate the accumulated value of net energy over the solver run. I introduced a dummy variable D where D = net energy, so that net energy = (inlet energy - outlet energy)+D; It calculates 2 times the net energy by this expression. I believed the expression will work in step by step in the order defined like in C++ or matlab but it dose'nt work like the way. Any suggestions on how to access the previous timestep of user defined variable? |
|
November 27, 2017, 19:06 |
Over time? Monitor it?
|
#2 |
Senior Member
Svetlana Tkachenko
Join Date: Oct 2013
Location: Australia, Sydney
Posts: 416
Rep Power: 15 |
Do you want to integrate this variable over time? I would suggest to add a monitor point for it. After the run is complete, export the monitor point plot data to another program such as GNU Octave to perform the integration.
https://www.gnu.org/software/octave/...f-One-Variable has details on the numerical integration function that I would use. |
|
November 28, 2017, 02:43 |
|
#3 | |
Member
VB
Join Date: Jul 2016
Posts: 35
Rep Power: 10 |
Quote:
I do not want to integrate it. I want to store an expression in the current time step and need to use in the next time step and it goes on like that.because from timestep number 1 i need to use a expression value which is calculated fron the previous time step. |
||
November 28, 2017, 05:04 |
|
#4 |
Super Moderator
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,854
Rep Power: 144 |
The recommended way of doing this is with user fortran. There is a work-around using the TRANS_LOOP variables (do a search of the forum to get more information on it) but it is not supported and definitely use at your own risk.
|
|
November 28, 2017, 05:30 |
|
#5 |
Senior Member
Mr CFD
Join Date: Jun 2012
Location: Britain
Posts: 361
Rep Power: 15 |
I tried that approach a few times and it's unstable at the best of times.
|
|
November 28, 2017, 10:17 |
|
#6 |
Senior Member
Join Date: Jun 2009
Posts: 1,873
Rep Power: 33 |
In your example, are "inlet energy" and "outlet energy" singled valued quantities?
If so, you can benefit from the monitor Expression features which includes a few additional operations in time for the underlying expression. |
|
November 28, 2017, 12:55 |
accumated addition of an user expression
|
#7 | |
Member
VB
Join Date: Jul 2016
Posts: 35
Rep Power: 10 |
Quote:
are you mentioning Monitor statistics check box under the monitor tab in Output control? If so, what is the interval option(and Statistics list) and Interval definition(and time)? |
||
November 28, 2017, 12:56 |
|
#8 |
Member
VB
Join Date: Jul 2016
Posts: 35
Rep Power: 10 |
Thank you for the suggestion. I will try to read about Trans_loop and get back.
|
|
Tags |
cfx, previous timestep, transient simulations, user defined expression |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
time step continuity problem in VAWT simulation | lpz_michele | OpenFOAM Running, Solving & CFD | 5 | February 22, 2018 20:50 |
Extrusion with OpenFoam problem No. Iterations 0 | Lord Kelvin | OpenFOAM Running, Solving & CFD | 8 | March 28, 2016 12:08 |
mixerVesselAMI2D's mass is not balancing | sharonyue | OpenFOAM Running, Solving & CFD | 6 | June 10, 2013 10:34 |
plot over time | fferroni | OpenFOAM Post-Processing | 7 | June 8, 2012 08:56 |
Could anybody help me see this error and give help | liugx212 | OpenFOAM Running, Solving & CFD | 3 | January 4, 2006 19:07 |