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

Iteration control

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

Reply
 
LinkBack Thread Tools Display Modes
Old   September 20, 2007, 15:50
Default Is there a way to force solver
  #1
Member
 
Ken Darcovich
Join Date: Mar 2009
Location: Ottawa, Canada
Posts: 30
Rep Power: 8
kdarc is on a distinguished road
Is there a way to force solvers to perform just ONE iteration at a time??

I am trying to work with a highly coupled system of equations and want to use the "solve" structures since they handle all the boundary conditions and can apply relaxation factors. I would have to set up my own kind of convergence control, but would be happy to get on with doing that if I could solve each equation one at a time.

thanks.
kdarc is offline   Reply With Quote

Old   September 21, 2007, 08:48
Default Come on people, this is critic
  #2
Member
 
Ken Darcovich
Join Date: Mar 2009
Location: Ottawa, Canada
Posts: 30
Rep Power: 8
kdarc is on a distinguished road
Come on people, this is critical!!

I see that in the file lduMatrix.H, there is some code:

00206 //- Abstract base-class for lduMatrix solvers
00207 class solver
00208 {
00209 protected:
00210
00211 // Protected data
00212
00213 word fieldName_;
00214 const lduMatrix& matrix_;
00215 const FieldField<field,>& interfaceBouCoeffs_;
00216 const FieldField<field,>& interfaceIntCoeffs_;
00217 lduInterfaceFieldPtrsList interfaces_;
00218
00219 //- dictionary of controls
00220 dictionary controlDict_;
00221
00222 //- Maximum number of iterations in the solver
00223 label maxIter_;
00224
00225 //- Final convergence tolerance
00226 scalar tolerance_;
00227
00228 //- Convergence tolerance relative to the initial
00229 scalar relTol_;


there is a label maxIter_ referred to.

Does anyone know how/what/where to use this to chnage the maximum number of solver iterations from what seems to be 5001, to just 1.

thanks.
kdarc is offline   Reply With Quote

Old   September 21, 2007, 09:14
Default Okay Ken, you now have our att
  #3
Senior Member
 
Mark Olesen
Join Date: Mar 2009
Location: http://olesenm.github.io/
Posts: 777
Rep Power: 18
olesen will become famous soon enough
Okay Ken, you now have our attention.

I can't see where the '5001' is coming from either. The constructor in lduMatrix/lduMatrixSolver.C is using 1000.

From your demand for help, I assume that the maxIter in the fvSolution isn't being respected?
I guess this is critical - ie, a bug or a problem with your installation.

eg,
k smoothSolver
{
smoother GaussSeidel;
nSweeps 2;
tolerance 1e-7;
relTol 0.1;
maxIter 1;
};

/mark
olesen is offline   Reply With Quote

Old   September 21, 2007, 12:05
Default thanks for the reply Mark.
  #4
Member
 
Ken Darcovich
Join Date: Mar 2009
Location: Ottawa, Canada
Posts: 30
Rep Power: 8
kdarc is on a distinguished road
thanks for the reply Mark.

I still can't figure out how to implement what you're suggesting.

what I want, is to solve for variable phi_SR1 with solver ICCG to tol of 1e-6 relTol 0 (really tol and relTol are irrelevant for 1 iteration...) with iterMax = 1. your example showed:

k smoothSolver
{
smoother GaussSeidel;
nSweeps 2;
tolerance 1e-7;
relTol 0.1;
maxIter 1;
};

presumably this is in fvSolution?
in your case, is k the variable to be solved?

if I imitate with

phi_SR1 solver or smoothSolver, I get an error.

putting maxIter 1; anywhere seems to have no effect.

how/where would you code what I'm trying to accomplish?

thanks.
kdarc is offline   Reply With Quote

Old   September 24, 2007, 04:10
Default Hi Ken, Yes, you should be
  #5
Senior Member
 
Mark Olesen
Join Date: Mar 2009
Location: http://olesenm.github.io/
Posts: 777
Rep Power: 18
olesen will become famous soon enough
Hi Ken,

Yes, you should be adding your solver parameters into system/fvSolution. If you get an error with using phi_SRI smoothSolver { .... };
There is something else wrong (eg, you are not using a fv method, etc.).
If this is not working properly, you can't place maxIter within the braces.

After you get this sorted out, you might even try just using relTol=1 (or 0.999). I would think that this should give a similar result as limiting the maxIter explicitly.
olesen is offline   Reply With Quote

Old   September 24, 2007, 11:27
Default Ok thanks! it's working as
  #6
Member
 
Ken Darcovich
Join Date: Mar 2009
Location: Ottawa, Canada
Posts: 30
Rep Power: 8
kdarc is on a distinguished road
Ok thanks!

it's working as required, one hitch was that I am using subdomains and in our recently implemented v1.4, it wasn't obvious that additional fvSolution files are now required subdomain system directories...

blood pressure now returning to normal level....
kdarc 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
Iteration kospan FLUENT 0 October 18, 2008 17:13
PLEASE HELP FOR UDF ITERATION!!!! AdN FLUENT 0 May 19, 2006 04:21
iteration Loh FLUENT 0 February 12, 2006 03:09
Iteration Joung Ae FLUENT 0 September 16, 2005 10:11
DPM iteration Marie FLUENT 1 November 5, 2003 11:14


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