Added rescue procedure on block solver divergence. Experimental
This commit is contained in:
parent
e98722db65
commit
6c01d9a6a8
2 changed files with 32 additions and 8 deletions
|
@ -81,8 +81,30 @@ int main(int argc, char *argv[])
|
||||||
# include "couplingTerms.H"
|
# include "couplingTerms.H"
|
||||||
|
|
||||||
// Solve the block matrix
|
// Solve the block matrix
|
||||||
maxResidual = cmptMax(UpEqn.solve().initialResidual());
|
residual = UpEqn.solve();
|
||||||
|
maxResidual = cmptMax(residual.initialResidual());
|
||||||
|
|
||||||
|
// Check for divergence
|
||||||
|
if (mag(residual.finalResidual() - residual.initialResidual()) > 1)
|
||||||
|
{
|
||||||
|
Info<< "DIVERGENCE: rescue step" << endl;
|
||||||
|
|
||||||
|
// Solving potential flow equation and correcting velocities
|
||||||
|
phi = (fvc::interpolate(U) & mesh.Sf());
|
||||||
|
|
||||||
|
solve
|
||||||
|
(
|
||||||
|
tpEqn
|
||||||
|
==
|
||||||
|
- fvc::div(U)
|
||||||
|
);
|
||||||
|
|
||||||
|
phi += tpEqn().flux() + tpresSource;
|
||||||
|
|
||||||
|
U = fvc::reconstruct(phi);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
// Retrieve solution
|
// Retrieve solution
|
||||||
UpEqn.retrieveSolution(0, U.internalField());
|
UpEqn.retrieveSolution(0, U.internalField());
|
||||||
UpEqn.retrieveSolution(3, p.internalField());
|
UpEqn.retrieveSolution(3, p.internalField());
|
||||||
|
@ -91,6 +113,7 @@ int main(int argc, char *argv[])
|
||||||
p.correctBoundaryConditions();
|
p.correctBoundaryConditions();
|
||||||
|
|
||||||
phi = (fvc::interpolate(U) & mesh.Sf()) + tpEqn().flux() + tpresSource;
|
phi = (fvc::interpolate(U) & mesh.Sf()) + tpEqn().flux() + tpresSource;
|
||||||
|
}
|
||||||
|
|
||||||
// Make flux relative in rotating zones
|
// Make flux relative in rotating zones
|
||||||
mrfZones.relativeFlux(phi);
|
mrfZones.relativeFlux(phi);
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
// initialize values for convergence checks
|
// initialize values for convergence checks
|
||||||
|
BlockSolverPerformance<vector4> residual;
|
||||||
|
|
||||||
scalar maxResidual = 0;
|
scalar maxResidual = 0;
|
||||||
scalar convergenceCriterion = 0;
|
scalar convergenceCriterion = 0;
|
||||||
|
|
Reference in a new issue