user expression- value from previous time step
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? |
Over time? Monitor it?
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. |
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. |
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.
|
Quote:
|
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. |
accumated addition of an user expression
Quote:
Quote:
|
Quote:
|
All times are GMT -4. The time now is 21:35. |