CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

Accessing the residuals from the solver

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 1, 2008, 08:01
Default Hi, I'm working on a modifi
  #1
Member
 
Juho Peltola
Join Date: Mar 2009
Location: Finland
Posts: 89
Rep Power: 17
juho is on a distinguished road
Hi,

I'm working on a modified version of the twoPhaseEulerFoam and I would like to make the number of PISO loops (or iterations within the timestep) adaptive.

ie. the solver would vary the number of loops based on the convergence.

How could I access the initial residual or the number of iterations of the pressure solver?



I see that the lduMatrix.H includes a member function initialResidual()

which I tried to use to access the residual with a command

pEqn.initialResidual()

This however resulted in an error message by the compiler:

"Foam::fvScalarMatrix has no member named 'initialResidual'"

This obviously isn't the right way to do it and no such functions can be found in the scalarMatrix.H

Any help or tips would be appreciated!
juho is offline   Reply With Quote

Old   July 1, 2008, 08:23
Default You could try something like t
  #2
Senior Member
 
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,715
Rep Power: 40
olesen has a spectacular aura aboutolesen has a spectacular aura about
You could try something like this:

// retain the residual from the first iteration
if (nonOrth == 0)
{
eqnResidual = pEqn.solve().initialResidual();
maxResidual = max(eqnResidual, maxResidual);
}

Where maxResidual has been initialized elsewhere ...
olesen is offline   Reply With Quote

Old   July 1, 2008, 08:35
Default Hi Juho! Every call to solv
  #3
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Hi Juho!

Every call to solve returns such an object:
http://foam.sourceforge.net/doc/Doxygen/html/classFoam_1_1lduMatrix_1_1solverPer formance.html

This object contains all the information that you need

Bernhard
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request
gschaider is offline   Reply With Quote

Old   July 1, 2008, 08:49
Default Thank you very much! Just what
  #4
Member
 
Juho Peltola
Join Date: Mar 2009
Location: Finland
Posts: 89
Rep Power: 17
juho is on a distinguished road
Thank you very much! Just what I needed!
juho 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
accessing solver data with UDF macros Dushan FLUENT 1 April 22, 2017 22:05
Residuals in CFX-Solver Andy CFX 3 July 18, 2012 17:40
Accessing Solver Variable for UDF CFDtoy FLUENT 0 May 9, 2006 20:29
Accessing Solver data for UDF CFDtoy FLUENT 7 April 13, 2006 17:52
Accessing a specific solver data Paul FLUENT 0 November 19, 2003 15:51


All times are GMT -4. The time now is 13:21.