CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   Linear decay - implementation and convergence issues (https://www.cfd-online.com/Forums/openfoam-programming-development/234673-linear-decay-implementation-convergence-issues.html)

Diro7 March 15, 2021 04:53

Linear decay - implementation and convergence issues
 
Hello,

one of the custom solvers I'm working on features some simple steady-state transport equations of the form

\nabla \cdot (c \mathbf{u}) = \nabla (D \nabla c) - \lambda c + S

where \lambda is a uniform linear decay constant, D is an effective diffusivity which can depend on temperature and the flow field, and S is a volumetric source term which also has a complex dependence on other fields.

The equation is simply implemented as
Code:

fvScalarMatrix cEqn
(
    fvm::div(phi, c)
  - fvm::laplacian(D, c)
  + fvm::Sp(lambda, c)
 ==
    S
);

Things seem to work as they should. I've noticed that the convergence rate strongly depends on the magnitude of the decay parameter \lambda.
In particular, physical meaning (radioactive decay) imposes very small values (e.g. of the order of 1e-5/1e-8 s^-1), for which convergence is unacceptably slow.

I recognise this can be a reasonable behaviour, but I'd like to understand a little bit more.
In particular, from the implemented equation is clear (to me) that when all other quantities reach numerical convergence, the equation becomes fully implicit in c since coupling with other equations acts only in one way. The test cases are actually simple, with fully orthogonal meshes.

Shouldn't the equation be solved "exactly" when other fields become fixed after convergence?
Or is it maybe just a matter of how residuals are defined, and the fact that residuals take forever to lower doesn't affect the actual solution?

I feel like I'm missing something, so any suggestion would be greatly appreciated :)

Andrea


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