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

user expression- value from previous time step

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

Like Tree1Likes
  • 1 Post By Vishnu_bharathi

Reply
 
LinkBack Thread Tools Display Modes
Old   November 27, 2017, 12:16
Default user expression- value from previous time step
  #1
Member
 
VB
Join Date: Jul 2016
Posts: 35
Rep Power: 4
Vishnu_bharathi is on a distinguished road
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?
Светлана likes this.
Vishnu_bharathi is offline   Reply With Quote

Old   November 27, 2017, 18:06
Default Over time? Monitor it?
  #2
Senior Member
 
Svetlana Tkachenko
Join Date: Oct 2013
Location: Australia
Posts: 154
Rep Power: 6
Светлана is on a distinguished road
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.
Светлана is offline   Reply With Quote

Old   November 28, 2017, 01:43
Default
  #3
Member
 
VB
Join Date: Jul 2016
Posts: 35
Rep Power: 4
Vishnu_bharathi is on a distinguished road
Quote:
Originally Posted by Светлана View Post
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.
Thankyou for your reply
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.
Vishnu_bharathi is offline   Reply With Quote

Old   November 28, 2017, 04:04
Default
  #4
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 15,063
Rep Power: 115
ghorrocks is a jewel in the roughghorrocks is a jewel in the roughghorrocks is a jewel in the roughghorrocks is a jewel in the rough
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.
ghorrocks is offline   Reply With Quote

Old   November 28, 2017, 04:30
Default
  #5
Senior Member
 
JuPa's Avatar
 
Mr CFD
Join Date: Jun 2012
Location: Britain
Posts: 353
Rep Power: 9
JuPa is on a distinguished road
Quote:
Originally Posted by ghorrocks View Post
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.
I tried that approach a few times and it's unstable at the best of times.
JuPa is offline   Reply With Quote

Old   November 28, 2017, 09:17
Default
  #6
Senior Member
 
Join Date: Jun 2009
Posts: 826
Rep Power: 17
Opaque is on a distinguished road
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.
Opaque is offline   Reply With Quote

Old   November 28, 2017, 11:55
Default accumated addition of an user expression
  #7
Member
 
VB
Join Date: Jul 2016
Posts: 35
Rep Power: 4
Vishnu_bharathi is on a distinguished road
Quote:
Originally Posted by Opaque View Post
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.
Thank you for the reply. What do you mean by singled value quantities? I calculate inlet energy as = (mass flow@inlet* Total enthalpy@inlet) and similarly for outlet energy.

Quote:
Originally Posted by Opaque View Post
few additional operations in time for the underlying expression.
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)?
Vishnu_bharathi is offline   Reply With Quote

Old   November 28, 2017, 11:56
Default
  #8
Member
 
VB
Join Date: Jul 2016
Posts: 35
Rep Power: 4
Vishnu_bharathi is on a distinguished road
Quote:
Originally Posted by ghorrocks View Post
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.
Thank you for the suggestion. I will try to read about Trans_loop and get back.
Vishnu_bharathi is offline   Reply With Quote

Reply

Tags
cfx, previous timestep, transient simulations, user defined expression

Thread Tools
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 On
Pingbacks are On
Refbacks are On


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 19:50
Extrusion with OpenFoam problem No. Iterations 0 Lord Kelvin OpenFOAM Running, Solving & CFD 8 March 28, 2016 11:08
mixerVesselAMI2D's mass is not balancing sharonyue OpenFOAM Running, Solving & CFD 6 June 10, 2013 09:34
plot over time fferroni OpenFOAM Post-Processing 7 June 8, 2012 07:56
Could anybody help me see this error and give help liugx212 OpenFOAM Running, Solving & CFD 3 January 4, 2006 18:07


All times are GMT -4. The time now is 23:07.