July 24, 2012, 11:32
|
Nonlinear Inner Iterations Not Using Updated Values
|
#1
|
New Member
Tyler V
Join Date: Jul 2012
Posts: 24
Rep Power: 14
|
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<volScalarField> 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?
|
|
|