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

Change accumulated time step

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 21, 2015, 04:00
Default Change accumulated time step
  #1
New Member
 
Join Date: Apr 2015
Posts: 16
Rep Power: 10
boubou is on a distinguished road
Hi,

In a junction box called at the end of each coefficient loop, i have to change the accumulated time step when i reach 50 iterations :

IF (ATSTEP.EQ.10) THEN
CALL MESAGE('WRITE','ATTENTION')
CALL PSHDIR ('/FLOW/SOLUTION', 'STOP', CRESLT)
CALL POKEI ('ATSTEP', IONE, 100, 'STOP', CRESLT, IZ)
CALL POPDIR ('STOP', CRESLT)
END IF

At the 101 iteration, i have an error message :

Error detected by routine PSHDRH
CDRNAM = /FLOW/MESH/TSTEP100 /LAST
CRESLT = NONE

Do you know why ?

Thanks
boubou is offline   Reply With Quote

Old   April 21, 2015, 07:54
Default
  #2
Senior Member
 
Join Date: Jun 2009
Posts: 1,788
Rep Power: 31
Opaque will become famous soon enough
The accumulated time step is an internal feature of the software, and overriding w/o updating any related variables and/or data structures is ill-advised.

What are you trying to achieve by faking the accumulated timestep instead of ?
Opaque is offline   Reply With Quote

Old   April 21, 2015, 08:35
Default
  #3
New Member
 
Join Date: Apr 2015
Posts: 16
Rep Power: 10
boubou is on a distinguished road
Thanks for your answer.
I agree, in fact i don't know to solve my problem.

- I have a Mass Flow Rate of 0.5 [kg/s] in my input section.
- I wrote a junction box which stops the calculation when I reach a convergence criterion.

The problem is : I want to change the Mass Flow Rate to 0.3 [kg/s] when the convergence criterion is reached.

In the expression of the mass flow rate i wrote a USER CEL Function but in this function, I can't read the convergence criterion of my junction box. I have an error of type : Error detected by routine PSHDIR.
boubou is offline   Reply With Quote

Old   April 21, 2015, 08:48
Default
  #4
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,665
Rep Power: 143
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
So why not do a simulation at 0.5 kg/s and let it reach the convergence criteria. Then a second simulation uses the first as an initial condition but with 0.3 kg/s mass flow rate.

This can be automated with a shell/batch file or in workbench. No fortran or user CEL is required.

And why do you need to use a junction box routine to find convergence? Are the built in convergence tests inadequate? Can't you just set the maximum number of iterations in the CFX-Pre GUI?
ghorrocks is offline   Reply With Quote

Old   April 21, 2015, 10:34
Default
  #5
New Member
 
Join Date: Apr 2015
Posts: 16
Rep Power: 10
boubou is on a distinguished road
Thanks for your reply. No because the goal of my work is to have in the same graph the different steps. I use this convergence criteria :

CONV=(MAXU-MINU)*2.0/(MAXU+MINU)*100.0

Where MAXU et MINU are the max and the min of my user point on the previous 40 iterations.
boubou is offline   Reply With Quote

Old   April 21, 2015, 10:49
Default
  #6
Senior Member
 
Join Date: Jun 2009
Posts: 1,788
Rep Power: 31
Opaque will become famous soon enough
Not sure why you would like to measure convergence in such manner.

Regardless of whatever formula you want to use, you must be very careful the standard convergence criteria are fairly satisfied.

A global quantity, or local such a monitor point may falsely converge (region of small changes during convergence), and you will obtain the wrong overall results.
Opaque is offline   Reply With Quote

Old   April 21, 2015, 11:17
Default
  #7
New Member
 
Join Date: Apr 2015
Posts: 16
Rep Power: 10
boubou is on a distinguished road
Ok I can change the criteria but it doesn't solve my problem...
Maybe I can write the criteria with CEL expressions but is it possible to access to the value of U of the previous time step ?
boubou is offline   Reply With Quote

Old   April 21, 2015, 12:38
Default
  #8
Senior Member
 
Join Date: Jun 2009
Posts: 1,788
Rep Power: 31
Opaque will become famous soon enough
Accessing the previous timestep value is not trivial. Such topic has been discussed in the past, and you can search through the forum for the latest description.

As an advice, you should not compare values between iterations to determine convergence regardless of the metric used. How do you remove the influence of under-relaxation out of the behavior between two consecutive iterations ? That is, if you set a criteria and a threshold to be satisfied, I could under-relax the solution to 0.1 (for example), and the solution may stop earlier than expected. Similarly, someone could inadvertently reduce the physical timescale and the software stop earlier than it should.

Your new convergence criteria must be independent of chosen under-relaxation factor, physical timescale, or timestep so you can be sure the solution is unique given the threshold chosen.

If you need the solutions for different mass flows on the same plot, I would follow Glenn's suggestions of running separate runs, export the plots and stitch them in Excel or the spreadsheet of your choice.
Opaque is offline   Reply With Quote

Old   April 22, 2015, 07:33
Default
  #9
New Member
 
Join Date: Apr 2015
Posts: 16
Rep Power: 10
boubou is on a distinguished road
Thanks Opale for your reply, I will work on that.

I have just another question : is it possible in a User CEL Function to retain a variable ?

Ex : - iteration N, X = expression
- iteration N+1, Y = X² with X the value at the iteration N

Thanks
boubou is offline   Reply With Quote

Reply

Tags
accumulated time step, atstep, junction box, pshdrh, user fortran

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
simpleFoam error - "Floating point exception" mbcx4jc2 OpenFOAM Running, Solving & CFD 12 August 4, 2015 03:20
Help for the small implementation in turbulence model shipman OpenFOAM Programming & Development 25 March 19, 2014 11:08
Unstabil Simulation with chtMultiRegionFoam mbay101 OpenFOAM Running, Solving & CFD 13 December 28, 2013 14:12
mixerVesselAMI2D's mass is not balancing sharonyue OpenFOAM Running, Solving & CFD 6 June 10, 2013 10:34
Could anybody help me see this error and give help liugx212 OpenFOAM Running, Solving & CFD 3 January 4, 2006 19:07


All times are GMT -4. The time now is 08:06.