|
[Sponsors] |
April 9, 2016, 02:47 |
Why the initial residual is not zero?
|
#1 |
New Member
Zhanchao Hu
Join Date: Apr 2016
Posts: 8
Rep Power: 10 |
Hi All:
I 'm trying to solve transient buoyant-driven flow in a 2D cavity by my own solver. What makes me confused is when temperature field is uniform, the initial residual of temperature is not zero, which equals to 0.000188696! The temperature of top and bottom wall are set equal to internal field, and the two side wall are zeroGradient. Besides, phi is zero, lambda and cv are dimensionedscalar (constant). Any suggestion will be appreciated. Code:
fvScalarMatrix TEqn ( fvm::ddt(rho, T) + fvm::div(phi, T) - fvm::laplacian(lambda/cv, T) ); |
|
April 12, 2016, 06:39 |
|
#2 |
Super Moderator
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52 |
Hi,
we are doing iterative modeling. Think about that. You get numerical errors, discretization errors, interpolation errors and much more. Also if we simulate a flow in a simple pipe with inlet outlet and converged solution we could obtain p in the last iteration like 1e-4 that is actually not even zero too. In your case it is clear for us that it should be zero but in the numerical point of view not really. Normally if you did everything correct you should get 0 of course (hex mesh and everything is well done). You can check that out with scalarTransportFoam. If you set U to zero -> phi = 0, set T initial and boundary to the same value you will get: Code:
DILUPBiCG: Solving for S, Initial residual = 0, Final residual = 0, No Iterations 0 Time = 0.0002 Code:
solve ( fvm::ddt(S) + fvm::div(phi, S) - fvm::laplacian(DT, S) == fvOptions(S) ); Rho is calculated by thermodynamics and could return numerical errors. That would be the reason in your case. You can try to fix rho to a const value. Then each term should vanish and you should end up with zero.
__________________
Keep foaming, Tobias Holzmann |
|
April 24, 2016, 11:45 |
|
#3 |
New Member
Zhanchao Hu
Join Date: Apr 2016
Posts: 8
Rep Power: 10 |
Quote:
|
|
July 4, 2016, 09:51 |
|
#4 |
Super Moderator
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52 |
Dear all,
to clear the topic... the above equation is only valid if we solve explicit. As we can see from the implementation, we solve implicit. That means that we create a matrix that has to be solved. Solving the algebraic set of equations will result in numerical errors that would lead to the initial error here (:
__________________
Keep foaming, Tobias Holzmann |
|
November 22, 2017, 10:49 |
|
#5 |
Member
Join Date: May 2017
Posts: 44
Rep Power: 9 |
Dear Foamers,
I am facing the same problem in different solvers. The density is not the reason as I tried to remove density from the equation and the same thing happened. Using relative parameter (e.g. zero instead of 300K for temperature) solved the issue. My problem is if I have some variation in my system, even if when my temperature become steady, I have some initial residual and my simulation is not speeding up. Any idea? |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
simpleFoam error - "Floating point exception" | mbcx4jc2 | OpenFOAM Running, Solving & CFD | 12 | August 4, 2015 03:20 |
Unstabil Simulation with chtMultiRegionFoam | mbay101 | OpenFOAM Running, Solving & CFD | 13 | December 28, 2013 14:12 |
pimpleFoam: turbulence->correct(); is not executed when using residualControl | hfs | OpenFOAM Running, Solving & CFD | 3 | October 29, 2013 09:35 |
calculation stops after few time steps | sivakumar | OpenFOAM Running, Solving & CFD | 7 | March 17, 2013 07:37 |
Orifice Plate with a fully developed flow - Problems with convergence | jonmec | OpenFOAM Running, Solving & CFD | 3 | July 28, 2011 06:24 |