# Nonlinear Inner Iterations Not Using Updated Values

 User Name Remember Me Password
 Register Blogs Members List Search Today's Posts Mark Forums Read

 July 24, 2012, 10:32 Nonlinear Inner Iterations Not Using Updated Values #1 New Member   Tyler V Join Date: Jul 2012 Posts: 24 Rep Power: 7 I am trying to solve a problem which has a nonlinear source term. For simplicity in this example I am not linearizing it. I have defined a function to calculate the explicit source term as Code: ```tmp fSu(volScalarField& y) { return y + y*y + y*y*y; }``` and I perform inner iterations (within the time loop) as Code: ```while( yRes > resmin ) { volScalarField Su = fSu(y); fvScalarMatrix yEqn ( fvm::ddt(y) == fvm::laplacian(y) + Su ); Info<<"Before solve: " << average(y) << endl; yEqn.relax(); lduMatrix::solverPerformance sp = yEqn.solve(); Info<<"After solve: " << average(y) << endl; yRes = sp.initialResidual(); }``` The problem I am having is that the value of y does not seem to update as this iterates. The output of this solve (shown below) seems to use the same value of y to calculate Su each time, rather than using an updated value Code: ```Before solve: average(y) [0 0 0 0 0 0 0] 0.0445286 GAMG: Solving for y, Initial residual = 0.433038, Final residual = 0.0109313, No Iterations 3 After solve: average(y) [0 0 0 0 0 0 0] 0.0444641 Before solve: average(y) [0 0 0 0 0 0 0] 0.0445286 GAMG: Solving for y, Initial residual = 0.433038, Final residual = 0.0109313, No Iterations 3 After solve: average(y) [0 0 0 0 0 0 0] 0.0444641 (... dozens more times ...) Before solve: average(y) [0 0 0 0 0 0 0] 0.0445286 GAMG: Solving for y, Initial residual = 0.433038, Final residual = 0.0109313, No Iterations 3 After solve: average(y) [0 0 0 0 0 0 0] 0.0444641``` How can I make the value of the source term be recalculated with the updated values of y? Is there a problem with the way I have defined the source term function?

 Tags nonlinear iterations, openfoam

 Thread Tools Display Modes Linear Mode

 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 OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post lordvon OpenFOAM Running, Solving & CFD 15 October 19, 2015 13:52 Unseen OpenFOAM Running, Solving & CFD 7 April 16, 2014 03:38 nileshjrane OpenFOAM Running, Solving & CFD 4 February 25, 2013 05:13 cyberbrain OpenFOAM 4 March 16, 2011 10:20 renyun0511 OpenFOAM Running, Solving & CFD 0 November 19, 2009 03:11

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

 Contact Us - CFD Online - Privacy Statement - Top