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

Accessing the residuals from the solver

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

Reply
 
LinkBack Thread Tools Display Modes
Old   July 1, 2008, 07:01
Default Hi, I'm working on a modifi
  #1
Member
 
Juho Peltola
Join Date: Mar 2009
Location: Finland
Posts: 80
Rep Power: 8
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, 07:23
Default You could try something like t
  #2
Senior Member
 
Mark Olesen
Join Date: Mar 2009
Location: http://olesenm.github.io/
Posts: 777
Rep Power: 18
olesen will become famous soon enough
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, 07:35
Default Hi Juho! Every call to solv
  #3
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,915
Rep Power: 40
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, 07:49
Default Thank you very much! Just what
  #4
Member
 
Juho Peltola
Join Date: Mar 2009
Location: Finland
Posts: 80
Rep Power: 8
juho is on a distinguished road
Thank you very much! Just what I needed!
juho is offline   Reply With Quote

Reply

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
Residuals in CFX-Solver Andy CFX 3 July 18, 2012 16:40
accessing solver data with UDF macros Dushan FLUENT 0 October 4, 2006 01:39
Accessing Solver Variable for UDF CFDtoy FLUENT 0 May 9, 2006 19:29
Accessing Solver data for UDF CFDtoy FLUENT 7 April 13, 2006 16:52
Accessing a specific solver data Paul FLUENT 0 November 19, 2003 15:51


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