CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   p_rgh residuals (https://www.cfd-online.com/Forums/openfoam-solving/126071-p_rgh-residuals.html)

fee November 7, 2013 10:01

p_rgh residuals
 
Hi,
I have a problem with compressibleInterFoam (probably also with the other solvers).
In my case I have a rectangular mesh and set all fields to fixedValue (U to zero, p_rgh to 1e5, alpha to 1) on the boundary (same as internal value), such that actually each solver has nothing to do. However the output looks like

MULES: Solving for alpha1
Liquid phase volume fraction = 1 Min(alpha1) = 1 Min(alpha2) = 0
diagonal: Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0
DILUPBiCG: Solving for T, Initial residual = 0.2561283, Final residual = 6.2762823e-15, No Iterations 1
GAMG: Solving for p_rgh, Initial residual = 0.61205684, Final residual = 0.64939008, No Iterations 1000
max(U) 1.6479872e-15
min(p_rgh) 100000
GAMGPCG: Solving for p_rgh, Initial residual = 0.48389343, Final residual = 1.2801586e-08, No Iterations 7
max(U) 2.6078623e-15
min(p_rgh) 100000
ExecutionTime = 1.97 s ClockTime = 2 s


If I look into the solution for each time step, the values actually do not change.
Except for the velocity, which looks like random noise with amplitude of 1e-13.
When I change the solver from

p_rgh
{
solver GAMG;
tolerance 1e-07;
relTol 0;
smoother DIC;
nPreSweeps 0;
nPostSweeps 2;
nFinestSweeps 2;
cacheAgglomeration true;
nCellsInCoarsestLevel 10;
agglomerator faceAreaPair;
mergeLevels 1;
}

to

p_rgh
{
solver PCG;
preconditioner
{
preconditioner GAMG;
tolerance 1e-07;
relTol 0;
nVcycles 2;
smoother DICGaussSeidel;
nPreSweeps 2;
nPostSweeps 2;
nFinestSweeps 2;
cacheAgglomeration true;
nCellsInCoarsestLevel 10;
agglomerator faceAreaPair;
mergeLevels 1;
}
tolerance 1e-07;
relTol 0;
maxIter 20;
}

i get now

MULES: Solving for alpha1
Liquid phase volume fraction = 1 Min(alpha1) = 1 Min(alpha2) = 0
diagonal: Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0
DILUPBiCG: Solving for T, Initial residual = 0.2561283, Final residual = 6.2762823e-15, No Iterations 1
GAMGPCG: Solving for p_rgh, Initial residual = 0.61205684, Final residual = 8.4709971e-08, No Iterations 5
max(U) 1.8399522e-15
min(p_rgh) 100000
GAMGPCG: Solving for p_rgh, Initial residual = 0.48273501, Final residual = 1.2982136e-08, No Iterations 7
max(U) 2.4301619e-15
min(p_rgh) 100000
ExecutionTime = 0.34 s ClockTime = 0 s

Does anybody know why the "Initial residual" is always so large and why are so many iterations are required to basically do nothing?
How are residuals computed and how to avoid this behavior?

mm66 September 10, 2019 13:46

Quote:

Originally Posted by fee (Post 461029)
Hi,
I have a problem with compressibleInterFoam (probably also with the other solvers).
In my case I have a rectangular mesh and set all fields to fixedValue (U to zero, p_rgh to 1e5, alpha to 1) on the boundary (same as internal value), such that actually each solver has nothing to do. However the output looks like

MULES: Solving for alpha1
Liquid phase volume fraction = 1 Min(alpha1) = 1 Min(alpha2) = 0
diagonal: Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0
DILUPBiCG: Solving for T, Initial residual = 0.2561283, Final residual = 6.2762823e-15, No Iterations 1
GAMG: Solving for p_rgh, Initial residual = 0.61205684, Final residual = 0.64939008, No Iterations 1000
max(U) 1.6479872e-15
min(p_rgh) 100000
GAMGPCG: Solving for p_rgh, Initial residual = 0.48389343, Final residual = 1.2801586e-08, No Iterations 7
max(U) 2.6078623e-15
min(p_rgh) 100000
ExecutionTime = 1.97 s ClockTime = 2 s


If I look into the solution for each time step, the values actually do not change.
Except for the velocity, which looks like random noise with amplitude of 1e-13.
When I change the solver from

p_rgh
{
solver GAMG;
tolerance 1e-07;
relTol 0;
smoother DIC;
nPreSweeps 0;
nPostSweeps 2;
nFinestSweeps 2;
cacheAgglomeration true;
nCellsInCoarsestLevel 10;
agglomerator faceAreaPair;
mergeLevels 1;
}

to

p_rgh
{
solver PCG;
preconditioner
{
preconditioner GAMG;
tolerance 1e-07;
relTol 0;
nVcycles 2;
smoother DICGaussSeidel;
nPreSweeps 2;
nPostSweeps 2;
nFinestSweeps 2;
cacheAgglomeration true;
nCellsInCoarsestLevel 10;
agglomerator faceAreaPair;
mergeLevels 1;
}
tolerance 1e-07;
relTol 0;
maxIter 20;
}

i get now

MULES: Solving for alpha1
Liquid phase volume fraction = 1 Min(alpha1) = 1 Min(alpha2) = 0
diagonal: Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0
DILUPBiCG: Solving for T, Initial residual = 0.2561283, Final residual = 6.2762823e-15, No Iterations 1
GAMGPCG: Solving for p_rgh, Initial residual = 0.61205684, Final residual = 8.4709971e-08, No Iterations 5
max(U) 1.8399522e-15
min(p_rgh) 100000
GAMGPCG: Solving for p_rgh, Initial residual = 0.48273501, Final residual = 1.2982136e-08, No Iterations 7
max(U) 2.4301619e-15
min(p_rgh) 100000
ExecutionTime = 0.34 s ClockTime = 0 s

Does anybody know why the "Initial residual" is always so large and why are so many iterations are required to basically do nothing?
How are residuals computed and how to avoid this behavior?

After 6 years of this post I am facing the same problem using chtMultiRegionSimpleFoam solver. Any recommendations?

KKlee December 7, 2021 03:32

Another two years later, I also face the same problem as the former encountered. Any idea? thanks.

mm66 December 7, 2021 10:55

Quote:

Originally Posted by KKlee (Post 818038)
Another two years later, I also face the same problem as the former encountered. Any idea? thanks.

Hi,

Please make sure of a good mesh quality. If no help, then try something like:

Code:

    p_rgh
    {
        solver          PCG;
        preconditioner
        {
                preconditioner  GAMG;
                smoother        DICGaussSeidel;
                tolerance      1e-6;
        }
        tolerance      1e-6;
    }

Let me know if it worked :)

Cheers,
MJ

KKlee December 9, 2021 07:36

Quote:

Originally Posted by mm66 (Post 818090)
Hi,

Please make sure of a good mesh quality. If no help, then try something like:

Code:

    p_rgh
    {
        solver          PCG;
        preconditioner
        {
                preconditioner  GAMG;
                smoother        DICGaussSeidel;
                tolerance      1e-6;
        }
        tolerance      1e-6;
    }

Let me know if it worked :)

Cheers,
MJ

Hi, MJ,
thanks for your help, it works well when I changed the solver as you mentioned, but the simulation runs slower than before, can you tell me why if you do not mind.


All times are GMT -4. The time now is 18:32.