|
[Sponsors] |
Outer Correctors Residual Control for PIMPLE algorithm |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
May 15, 2018, 03:17 |
Outer Correctors Residual Control for PIMPLE algorithm
|
#1 |
New Member
Ed Barry
Join Date: May 2018
Posts: 4
Rep Power: 8 |
Hi All,
I have tried specifying in my fvSolution a subdict in PIMPLE controls called Code:
nOuterCorrectorsResidualControl OpenFOAM-dev/src/finiteVolume/cfdTools/general/solutionControl/convergenceControl/singleRegionConvergenceControl/singleRegionConvergenceControl.C Code:
if (iter().isDict()) { FatalErrorInFunction << "Solution convergence criteria specified in " << control_.algorithmName() << '.' << residualDict.dictName() << " must be given as single values. Corrector loop " << "convergence criteria, if appropriate, are specified as " << "dictionaries in " << control_.algorithmName() << ".<loopName>ResidualControl." << exit(FatalError); } Any help would be appreciated. Ed Last edited by ed_bar; May 15, 2018 at 19:26. |
|
June 4, 2018, 15:42 |
|
#2 |
Senior Member
Join Date: Aug 2015
Posts: 494
Rep Power: 15 |
You've almost got it -- try using outerCorrectorResidualControl for the name of the dict, as in this tutorial : https://github.com/OpenFOAM/OpenFOAM...tem/fvSolution.
Caelan |
|
February 27, 2019, 04:26 |
|
#3 | |
Member
Dongxu Wang
Join Date: Sep 2018
Location: China
Posts: 33
Rep Power: 8 |
Quote:
I am reading PIMPLE algorithm recently and I have some questions. Firstly, I find that if we use the PIMPLE algorithm in OpenFOAM v6, the class which controls the residuals of outer loop will only be the "singleRegionCorrectorConvergenceControl". In other words, the subDict with the name of "outerCorrectorResidualControl" in "fvSolution.PIMPLE" is valid rather that the "residualControl" in the previous version. The "residualControl" will only be valid if we use SIMPLE algorithm. Am I right? Secondly, I cannot understand how the words defined in the subDict work. For example, in the judgement function named "convergence.corrCriteriaSatisfied()": Code:
bool Foam::singleRegionCorrectorConvergenceControl:: corrCriteriaSatisfied() const { if (!hasCorrResidualControls()) { return false; } bool achieved = true; bool checked = false; // ensure that some checks were actually performed if (control_.debug) { Info<< control_.algorithmName() << ": Correction residuals" << endl; } // Here I don't understand. What is this "mesh_.solverPerformanceDict()"? const dictionary& solverDict = mesh_.solverPerformanceDict(); forAllConstIter(dictionary, solverDict, iter) { const word& variableName = iter().keyword(); const label fieldi = convergenceControl::residualControlIndex ( variableName, corrResidualControl_ ); if (fieldi != -1) { scalar firstResidual, residual; convergenceControl::getInitialResiduals ( mesh_, variableName, corrResidualControl_[fieldi].solveIndex, iter().stream(), firstResidual, residual ); const scalar relativeResidual = residual/(firstResidual + ROOTVSMALL); const bool absCheck = residual < corrResidualControl_[fieldi].absTol; const bool relCheck = relativeResidual < corrResidualControl_[fieldi].relTol; checked = true; achieved = achieved && (absCheck || relCheck); if (control_.debug) { Info<< control_.algorithmSpace() << " " << variableName << ": tolerance " << residual << " (" << corrResidualControl_[fieldi].absTol << ")" << ", relTol " << relativeResidual << " (" << corrResidualControl_[fieldi].relTol << ")" << (absCheck || relCheck ? " CONVERGED" : "") << endl; } } } return checked && achieved; } Code:
{ pcorr ; p_rgh ; } Code:
PIMPLE { // other words ... // subDict in OF v6 for residual control outerCorrectorResidualControl { p_rgh // valid { tolerance 1e-8; relTol 1e-6; } U // invalid { tolerance 1e-8; relTol 1e-6; } } } Any suggestion will be appreciated. Thank you very much! wdx |
||
February 27, 2019, 12:07 |
|
#4 |
Senior Member
Join Date: Aug 2015
Posts: 494
Rep Power: 15 |
Not too much time to go into this, but lets see...
You are right about outerCorrector... vs residualControl -- at least from memory. I hardly use any of the SIMPLE algorithms, but this sounds right. As for the dictionary question, it looks like a series of dictionaries are stored (as a list? someone can be more technically correct here, I'm sure) in solverDict, which we then loop through. I am not sure what you are printing (or from where), so I cannot answer that question. However, if you check out the tutorial I linked to previously you'll see that a series of fields are checked -- take a look at the tutorial to see how. Caelan |
|
February 27, 2019, 21:58 |
|
#5 | |
Member
Dongxu Wang
Join Date: Sep 2018
Location: China
Posts: 33
Rep Power: 8 |
Quote:
Thank you for your reply! According to your advice, I think I have totally understood how this function works. I will try my best to depict it clearly and I hope one day it maybe useful for someone else. Firstly, my print function is added as: Code:
// ... forAllConstIter(dictionary, solverDict, iter) { const word& variableName = iter().keyword(); // newly added to print the solverDict Info << "solverDict = " << solverDict << endl; const label fieldi = convergenceControl::residualControlIndex ( variableName, corrResidualControl_ ); // ... When using interFOAM, the solverDict is read as: Code:
solverDict = { pcorr 1 ( ( GAMGPCG pcorr 1 1.12278473072e-09 9 1 ( 0 ) ) ); p_rgh 2 ( ( GAMG p_rgh 1 0.00354306144809 1 1 ( 0 ) ) ( GAMGPCG p_rgh 0.0151588085227 2.81533804904e-09 5 1 ( 0 ) ) ); } Code:
solverDict = { U 1 ( ( smoothSolver U ( 1 1 1 ) ( 0.076108 0.0914346 0.059271 ) ( 5 4 5 ) 0 3 { 0 } ) ); e 1 ( ( smoothSolver e 1 0.0730702 2 1 ( 0 ) ) ); p 1 ( ( DICPCG p 1 9.44311e-08 115 1 ( 0 ) ) ); rho 1 ( ( diagonal rho 0 0 0 1 ( 0 ) ) ); epsilon 1 ( ( smoothSolver epsilon 0.983447 0.0191881 2 1 ( 0 ) ) ); k 1 ( ( smoothSolver k 1 0.00447597 1 1 ( 0 ) ) ); } wdx |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Problem with chtMultiregionFoam radiation boundary condition | baran_foam | OpenFOAM Running, Solving & CFD | 10 | December 17, 2019 18:36 |
Suppress twoPhaseEulerFoam energy | AlmostSurelyRob | OpenFOAM Running, Solving & CFD | 33 | September 25, 2018 18:45 |
Compressor Simulation using rhoPimpleDyMFoam | Jetfire | OpenFOAM Running, Solving & CFD | 107 | December 9, 2014 14:38 |
Unstabil Simulation with chtMultiRegionFoam | mbay101 | OpenFOAM Running, Solving & CFD | 13 | December 28, 2013 14:12 |
calculation stops after few time steps | sivakumar | OpenFOAM Running, Solving & CFD | 7 | March 17, 2013 07:37 |