Merge branch 'master' of /home/dm4/OpenFOAM/OpenFOAM-dev

This commit is contained in:
mattijs
2012-03-14 09:36:25 +00:00
4 changed files with 31 additions and 14 deletions

View File

@ -35,7 +35,6 @@
{
phaseModel& phase = iter();
phase.phi().oldTime();
mrfZones.absoluteFlux(phase.phi().oldTime());
mrfZones.absoluteFlux(phase.phi());
@ -173,7 +172,6 @@
phase.phi() =
phiHbyAs[phasei]
+ rAlphaAUfs[phasei]*mSfGradp/phase.rho();
mrfZones.relativeFlux(phase.phi());
mrfZones.relativeFlux(phase.phi().oldTime());
phi += alphafs[phasei]*phase.phi();
@ -206,7 +204,7 @@
+ rAlphaAUfs[phasei]*mSfGradp/phase.rho()
);
phase.U() = fvc::reconstruct(phase.phi());
// phase.U() = fvc::reconstruct(phase.phi());
phase.U().correctBoundaryConditions();
U += alpha*phase.U();

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -126,7 +126,8 @@ Foam::pimpleControl::pimpleControl(fvMesh& mesh)
nCorrPIMPLE_(0),
nCorrPISO_(0),
corrPISO_(0),
turbOnFinalIterOnly_(true)
turbOnFinalIterOnly_(true),
converged_(false)
{
read();
@ -194,12 +195,27 @@ bool Foam::pimpleControl::loop()
}
bool completed = false;
if (criteriaSatisfied())
if (converged_ || criteriaSatisfied())
{
Info<< algorithmName_ << ": converged in " << corr_ - 1 << " iterations"
<< endl;
completed = true;
corr_ = 0;
if (converged_)
{
Info<< algorithmName_ << ": converged in " << corr_ - 1
<< " iterations" << endl;
mesh_.data::remove("finalIteration");
corr_ = 0;
converged_ = false;
completed = true;
}
else
{
Info<< algorithmName_ << ": iteration " << corr_ << endl;
storePrevIterFields();
mesh_.data::add("finalIteration", true);
converged_ = true;
}
}
else
{

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -66,6 +66,9 @@ protected:
//- Flag to indicate whether to only solve turbulence on final iter
bool turbOnFinalIterOnly_;
//- Converged flag
bool converged_;
// Protected Member Functions

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -73,14 +73,14 @@ inline bool Foam::pimpleControl::storeInitialResiduals() const
inline bool Foam::pimpleControl::finalIter() const
{
return corr_ == nCorrPIMPLE_;
return converged_ || (corr_ == nCorrPIMPLE_);
}
inline bool Foam::pimpleControl::finalInnerIter() const
{
return
corr_ == nCorrPIMPLE_
finalIter()
&& corrPISO_ == nCorrPISO_
&& corrNonOrtho_ == nNonOrthCorr_ + 1;
}