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

Writing an expression based on residual values?

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 15, 2015, 21:58
Default Writing an expression based on residual values?
  #1
New Member
 
Andrew Norfolk
Join Date: Mar 2015
Location: Sheffield
Posts: 5
Rep Power: 11
Trev0r is on a distinguished road
I'm modelling a complicated system with various pressure feedback loops at the outlets:

Pressure@Outletx=Constant*MassFlow@Outletx

It also contains a porous domain with a directional pressure loss model.

I am really struggling to get a fast convergence, using the autotime scale option results in no convergence. I need to initially apply a very small physical timescale ~10^-5 or a local timescale factor ~0.01 to get a stable decreasing residual with each iteration. Unfortuneately these methods are taking up to 4000 iterations (24 hours) to complete!!!!!! My model contains over 2 million elements and has a very well refined mesh.

The interesting part for me was that I noticed that as the pressure residual became progressively smaller, these timescales could be increased, rapidly decreasing solution time. By manually sitting at my computer and upping the timescales over a two hour period as the pressure residual decreased I brought the total number of iterations needed for solution down from 4000 to 800!

So the next logical step would be to write an expression in CEL that defines the timescale as a function of the pressure residual. I have previously written timescale functions based on the iteration number (citern) however this is inefficient in the case of restarts and requires an assumption for how the pressure residual will decrease over time (I generally have no idea).

MyTimescale=(\frac{Constant}{Pressure Residual From Previous Iteration}^{n})

Is there anyway to do this or can anybody think of another way to lower the number of iterations I need to get a converged solution. As of now solution is 'achieved' when all RMS residuals are at 10^-6.
Trev0r is offline   Reply With Quote

Old   April 16, 2015, 03:55
Default
  #2
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,703
Rep Power: 143
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
it does not surprise me that feedback loops like this are unstable and require fine time steps, but as convergence is achieved the time step can be made larger.

You can access the residuals as CEL expressions but I am not sure it will give you the last time step value. To hold the last time step value you might need to use a user fortran routine.
ghorrocks is offline   Reply With Quote

Old   May 30, 2018, 16:12
Default
  #3
New Member
 
Cam Demler
Join Date: May 2018
Location: Ohio, USA
Posts: 1
Rep Power: 0
SGCam is on a distinguished road
On that note (and being late to the party) how does one access the current residuals via CEL? I have yet to find a variable or monitor probe that works.
SGCam is offline   Reply With Quote

Old   May 30, 2018, 20:05
Default
  #4
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,703
Rep Power: 143
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
You can add the residuals to the results file in the results file tab in CFX-Pre. Then the residuals field is available in CFD-Post and you can do operations on it there.

I recall you can access it via a CEL variable but cannot remember exactly how. Something like u vel.residual or something like that.
__________________
Note: I do not answer CFD questions by PM. CFD questions should be posted on the forum.
ghorrocks is offline   Reply With Quote

Reply


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
buoyantSimpleFoam and watertank Tobi OpenFOAM Running, Solving & CFD 100 December 18, 2022 08:15
Extrusion with OpenFoam problem No. Iterations 0 Lord Kelvin OpenFOAM Running, Solving & CFD 8 March 28, 2016 11:08
Wrong fluctuation of pressure in transient simulation caitao OpenFOAM Running, Solving & CFD 2 March 5, 2015 21:33
Simulation seems to converge but crashes suddenly xxxx OpenFOAM 16 September 12, 2014 08:07
SLTS+rhoPisoFoam: what is rDeltaT??? nileshjrane OpenFOAM Running, Solving & CFD 4 February 25, 2013 04:13


All times are GMT -4. The time now is 11:10.