Merge solution control backport. Auther: Vanja Skuric & FSB team. Merge: Henrik Rusche
This commit is contained in:
commit
78ad89f025
88 changed files with 974 additions and 937 deletions
|
@ -10,9 +10,4 @@
|
|||
|
||||
UEqn.relax();
|
||||
|
||||
eqnResidual = solve
|
||||
(
|
||||
UEqn == -fvc::grad(p)
|
||||
).initialResidual();
|
||||
|
||||
maxResidual = max(eqnResidual, maxResidual);
|
||||
solve(UEqn == -fvc::grad(p));
|
||||
|
|
|
@ -1,9 +0,0 @@
|
|||
// check convergence
|
||||
|
||||
if (maxResidual < convergenceCriterion)
|
||||
{
|
||||
Info<< "reached convergence criterion: " << convergenceCriterion << endl;
|
||||
runTime.writeAndEnd();
|
||||
Info<< "latestTime = " << runTime.timeName() << endl;
|
||||
}
|
||||
|
|
@ -39,3 +39,5 @@
|
|||
thermo
|
||||
)
|
||||
);
|
||||
|
||||
mesh.schemesDict().setFluxRequired(p.name());
|
||||
|
|
|
@ -23,8 +23,7 @@
|
|||
|
||||
hEqn.relax();
|
||||
|
||||
eqnResidual = hEqn.solve().initialResidual();
|
||||
maxResidual = max(eqnResidual, maxResidual);
|
||||
hEqn.solve();
|
||||
|
||||
// Bounding of enthalpy taken out
|
||||
thermo.correct();
|
||||
|
|
|
@ -1,7 +0,0 @@
|
|||
// initialize values for convergence checks
|
||||
|
||||
scalar eqnResidual = 1, maxResidual = 0;
|
||||
scalar convergenceCriterion = 0;
|
||||
|
||||
pimple.readIfPresent("convergence", convergenceCriterion);
|
||||
|
|
@ -7,7 +7,7 @@
|
|||
// Needs to be outside of loop since p is changing, but psi and rho are not
|
||||
surfaceScalarField rhoReff = rhof - psisf*fvc::interpolate(p);
|
||||
|
||||
for (int corr = 0; corr < nCorr; corr++)
|
||||
while (pimple.correct())
|
||||
{
|
||||
U = rUA*UEqn.H();
|
||||
|
||||
|
@ -20,7 +20,7 @@
|
|||
|
||||
p.storePrevIter();
|
||||
|
||||
for (int nonOrth = 0; nonOrth <= nNonOrthCorr; nonOrth++)
|
||||
while (pimple.correctNonOrthogonal())
|
||||
{
|
||||
fvScalarMatrix pEqn
|
||||
(
|
||||
|
@ -30,16 +30,10 @@
|
|||
- fvm::laplacian(rho*rUA, p)
|
||||
);
|
||||
|
||||
// Retain the residual from the first pressure solution
|
||||
eqnResidual = pEqn.solve().initialResidual();
|
||||
|
||||
if (corr == 0 && nonOrth == 0)
|
||||
{
|
||||
maxResidual = max(eqnResidual, maxResidual);
|
||||
}
|
||||
pEqn.solve();
|
||||
|
||||
// Calculate the flux
|
||||
if (nonOrth == nNonOrthCorr)
|
||||
if (pimple.finalNonOrthogonalIter())
|
||||
{
|
||||
phi = phid2 + pEqn.flux();
|
||||
}
|
||||
|
|
|
@ -36,6 +36,7 @@ Author
|
|||
#include "basicPsiThermo.H"
|
||||
#include "basicRhoThermo.H"
|
||||
#include "RASModel.H"
|
||||
#include "pimpleControl.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
|
@ -46,9 +47,11 @@ int main(int argc, char *argv[])
|
|||
|
||||
# include "createTime.H"
|
||||
# include "createMesh.H"
|
||||
|
||||
pimpleControl pimple(mesh);
|
||||
|
||||
# include "createThermo.H"
|
||||
# include "createFields.H"
|
||||
# include "readPIMPLEControls.H"
|
||||
# include "initContinuityErrs.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
@ -59,11 +62,8 @@ int main(int argc, char *argv[])
|
|||
{
|
||||
Info<< "Time = " << runTime.timeName() << nl << endl;
|
||||
|
||||
# include "readPIMPLEControls.H"
|
||||
# include "readFieldBounds.H"
|
||||
|
||||
# include "initConvergenceCheck.H"
|
||||
|
||||
# include "UEqn.H"
|
||||
# include "pEqn.H"
|
||||
|
||||
|
@ -79,8 +79,6 @@ int main(int argc, char *argv[])
|
|||
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
|
||||
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
|
||||
<< nl << endl;
|
||||
|
||||
# include "convergenceCheck.H"
|
||||
}
|
||||
|
||||
# include "clearThermo.H"
|
||||
|
|
|
@ -13,9 +13,4 @@
|
|||
|
||||
UEqn.relax();
|
||||
|
||||
eqnResidual = solve
|
||||
(
|
||||
UEqn == -fvc::grad(p)
|
||||
).initialResidual();
|
||||
|
||||
maxResidual = max(eqnResidual, maxResidual);
|
||||
solve(UEqn == -fvc::grad(p));
|
||||
|
|
|
@ -1,9 +0,0 @@
|
|||
// check convergence
|
||||
|
||||
if (maxResidual < convergenceCriterion)
|
||||
{
|
||||
Info<< "reached convergence criterion: " << convergenceCriterion << endl;
|
||||
runTime.writeAndEnd();
|
||||
Info<< "latestTime = " << runTime.timeName() << endl;
|
||||
}
|
||||
|
|
@ -80,3 +80,5 @@
|
|||
mesh
|
||||
);
|
||||
i == h - 0.5*(magSqr(Urot) - magSqr(Urel));
|
||||
|
||||
mesh.schemesDict().setFluxRequired(p.name());
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
Urot == U - Urel;
|
||||
|
||||
fvScalarMatrix iEqn
|
||||
(
|
||||
(
|
||||
fvm::ddt(rho, i)
|
||||
+ fvm::div(phi, i)
|
||||
- fvm::laplacian(turbulence->alphaEff(), i)
|
||||
|
@ -18,8 +18,7 @@
|
|||
|
||||
iEqn.relax();
|
||||
|
||||
eqnResidual = iEqn.solve().initialResidual();
|
||||
maxResidual = max(eqnResidual, maxResidual);
|
||||
iEqn.solve();
|
||||
|
||||
// From rothalpy, calculate enthalpy after solution of rothalpy equation
|
||||
h = i + 0.5*(magSqr(Urot) - magSqr(Urel));
|
||||
|
|
|
@ -1,7 +0,0 @@
|
|||
// initialize values for convergence checks
|
||||
|
||||
scalar eqnResidual = 1, maxResidual = 0;
|
||||
scalar convergenceCriterion = 0;
|
||||
|
||||
pimple.readIfPresent("convergence", convergenceCriterion);
|
||||
|
|
@ -7,7 +7,7 @@
|
|||
// Needs to be outside of loop since p is changing, but psi and rho are not
|
||||
surfaceScalarField rhoReff = rhof - psisf*fvc::interpolate(p);
|
||||
|
||||
for (int corr = 0; corr < nCorr; corr++)
|
||||
while (pimple.correct())
|
||||
{
|
||||
U = rUA*UEqn.H();
|
||||
|
||||
|
@ -20,7 +20,7 @@
|
|||
|
||||
p.storePrevIter();
|
||||
|
||||
for (int nonOrth = 0; nonOrth <= nNonOrthCorr; nonOrth++)
|
||||
while (pimple.correctNonOrthogonal())
|
||||
{
|
||||
fvScalarMatrix pEqn
|
||||
(
|
||||
|
@ -30,16 +30,10 @@
|
|||
- fvm::laplacian(rho*rUA, p)
|
||||
);
|
||||
|
||||
// Retain the residual from the first pressure solution
|
||||
eqnResidual = pEqn.solve().initialResidual();
|
||||
|
||||
if (corr == 0 && nonOrth == 0)
|
||||
{
|
||||
maxResidual = max(eqnResidual, maxResidual);
|
||||
}
|
||||
pEqn.solve();
|
||||
|
||||
// Calculate the flux
|
||||
if (nonOrth == nNonOrthCorr)
|
||||
if (pimple.finalNonOrthogonalIter())
|
||||
{
|
||||
phi = phid2 + pEqn.flux();
|
||||
}
|
||||
|
|
|
@ -43,6 +43,7 @@ GE CONFIDENTIAL INFORMATION 2016 General Electric Company. All Rights Reserved
|
|||
#include "basicRhoThermo.H"
|
||||
#include "RASModel.H"
|
||||
#include "MRFZones.H"
|
||||
#include "pimpleControl.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
|
@ -53,9 +54,11 @@ int main(int argc, char *argv[])
|
|||
|
||||
# include "createTime.H"
|
||||
# include "createMesh.H"
|
||||
|
||||
pimpleControl pimple(mesh);
|
||||
|
||||
# include "createThermo.H"
|
||||
# include "createFields.H"
|
||||
# include "readPIMPLEControls.H"
|
||||
# include "initContinuityErrs.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
@ -66,11 +69,8 @@ int main(int argc, char *argv[])
|
|||
{
|
||||
Info<< "Time = " << runTime.timeName() << nl << endl;
|
||||
|
||||
# include "readPIMPLEControls.H"
|
||||
# include "readFieldBounds.H"
|
||||
|
||||
# include "initConvergenceCheck.H"
|
||||
|
||||
# include "UEqn.H"
|
||||
# include "pEqn.H"
|
||||
|
||||
|
@ -86,8 +86,6 @@ int main(int argc, char *argv[])
|
|||
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
|
||||
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
|
||||
<< nl << endl;
|
||||
|
||||
# include "convergenceCheck.H"
|
||||
}
|
||||
|
||||
# include "clearThermo.H"
|
||||
|
|
|
@ -154,3 +154,5 @@
|
|||
aMesh,
|
||||
dimensionedScalar("one", dimless, 0.01)
|
||||
);
|
||||
|
||||
aMesh.schemesDict().setFluxRequired("h");
|
||||
|
|
|
@ -125,6 +125,7 @@ Foam::multiphaseMixture::multiphaseMixture
|
|||
forAllIter(PtrDictionary<phase>, phases_, iter)
|
||||
{
|
||||
alphaTable_.add(iter());
|
||||
mesh_.schemesDict().setFluxRequired(iter().volScalarField::name());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -102,7 +102,7 @@ int main(int argc, char *argv[])
|
|||
//# include "waveCourantNo.H"
|
||||
|
||||
int iCorr = 0;
|
||||
lduMatrix::solverPerformance solverPerf;
|
||||
lduSolverPerformance solverPerf;
|
||||
scalar initialResidual = 0;
|
||||
scalar relativeResidual = 1;
|
||||
//scalar forceResidual = 1;
|
||||
|
|
|
@ -86,7 +86,7 @@ int main(int argc, char *argv[])
|
|||
//# include "waveCourantNo.H"
|
||||
|
||||
int iCorr = 0;
|
||||
lduMatrix::solverPerformance solverPerf;
|
||||
lduSolverPerformance solverPerf;
|
||||
scalar initialResidual = 0;
|
||||
scalar relativeResidual = 1;
|
||||
//scalar forceResidual = 1;
|
||||
|
|
|
@ -70,7 +70,7 @@ int main(int argc, char *argv[])
|
|||
int iCorr = 0;
|
||||
scalar initialResidual = 0;
|
||||
scalar relativeResidual = 1.0;
|
||||
lduMatrix::solverPerformance solverPerf;
|
||||
lduSolverPerformance solverPerf;
|
||||
lduMatrix::debug = 0;
|
||||
|
||||
do
|
||||
|
|
|
@ -60,7 +60,7 @@ int main(int argc, char *argv[])
|
|||
|
||||
int iCorr = 0;
|
||||
scalar initialResidual = 0;
|
||||
lduMatrix::solverPerformance solverPerf;
|
||||
lduSolverPerformance solverPerf;
|
||||
scalar relativeResidual = 1.0;
|
||||
lduMatrix::debug=0;
|
||||
|
||||
|
|
|
@ -62,7 +62,7 @@ int main(int argc, char *argv[])
|
|||
|
||||
int iCorr = 0;
|
||||
scalar initialResidual = 0;
|
||||
lduMatrix::solverPerformance solverPerf;
|
||||
lduSolverPerformance solverPerf;
|
||||
scalar relativeResidual = 1.0;
|
||||
lduMatrix::debug = 0;
|
||||
|
||||
|
|
|
@ -73,7 +73,7 @@ int main(int argc, char *argv[])
|
|||
# include "readSolidMechanicsControls.H"
|
||||
|
||||
int iCorr = 0;
|
||||
lduMatrix::solverPerformance solverPerf;
|
||||
lduSolverPerformance solverPerf;
|
||||
scalar initialResidual = 1.0;
|
||||
scalar relativeResidual = 1.0;
|
||||
lduMatrix::debug = 0;
|
||||
|
|
|
@ -103,7 +103,7 @@ int main(int argc, char *argv[])
|
|||
//# include "waveCourantNo.H"
|
||||
|
||||
int iCorr = 0;
|
||||
lduMatrix::solverPerformance solverPerf;
|
||||
lduSolverPerformance solverPerf;
|
||||
scalar initialResidual = 0;
|
||||
scalar relativeResidual = 1;
|
||||
//scalar forceResidual = 1;
|
||||
|
|
|
@ -78,7 +78,7 @@ int main(int argc, char *argv[])
|
|||
# include "readSolidMechanicsControls.H"
|
||||
|
||||
int iCorr = 0;
|
||||
lduMatrix::solverPerformance solverPerf;
|
||||
lduSolverPerformance solverPerf;
|
||||
scalar initialResidual = 1.0;
|
||||
lduMatrix::debug = 0;
|
||||
|
||||
|
|
|
@ -67,7 +67,7 @@ int main(int argc, char *argv[])
|
|||
# include "readSolidMechanicsControls.H"
|
||||
|
||||
int iCorr = 0;
|
||||
lduMatrix::solverPerformance solverPerf;
|
||||
lduSolverPerformance solverPerf;
|
||||
scalar initialResidual = 1.0;
|
||||
scalar relativeResidual = 1.0;
|
||||
lduMatrix::debug = 0;
|
||||
|
|
|
@ -64,7 +64,7 @@ int main(int argc, char *argv[])
|
|||
|
||||
int iCorr = 0;
|
||||
scalar initialResidual = 0;
|
||||
lduMatrix::solverPerformance solverPerf;
|
||||
lduSolverPerformance solverPerf;
|
||||
scalar relativeResidual = GREAT;
|
||||
lduMatrix::debug = 0;
|
||||
|
||||
|
|
|
@ -80,7 +80,7 @@ int main(int argc, char *argv[])
|
|||
# include "readSolidMechanicsControls.H"
|
||||
|
||||
int iCorr = 0;
|
||||
lduMatrix::solverPerformance solverPerf;
|
||||
lduSolverPerformance solverPerf;
|
||||
scalar initialResidual = 0;
|
||||
scalar relativeResidual = 1.0;
|
||||
lduMatrix::debug = 0;
|
||||
|
|
|
@ -65,7 +65,7 @@ int main(int argc, char *argv[])
|
|||
# include "readSolidMechanicsControls.H"
|
||||
|
||||
int iCorr = 0;
|
||||
lduMatrix::solverPerformance solverPerf;
|
||||
lduSolverPerformance solverPerf;
|
||||
scalar initialResidual = 1.0;
|
||||
scalar relativeResidual = 1.0;
|
||||
scalar plasticResidual = 1.0;
|
||||
|
|
|
@ -69,7 +69,7 @@ int main(int argc, char *argv[])
|
|||
# include "readSolidMechanicsControls.H"
|
||||
|
||||
int iCorr = 0;
|
||||
lduMatrix::solverPerformance solverPerf;
|
||||
lduSolverPerformance solverPerf;
|
||||
scalar initialResidual = 1.0;
|
||||
scalar relativeResidual = 1.0;
|
||||
// lduMatrix::debug = 0;
|
||||
|
|
|
@ -66,8 +66,8 @@ int main(int argc, char *argv[])
|
|||
scalar initialResidual = 1.0;
|
||||
scalar relResT = 1.0;
|
||||
scalar relResU = 1.0;
|
||||
lduMatrix::solverPerformance solverPerfU;
|
||||
lduMatrix::solverPerformance solverPerfT;
|
||||
lduSolverPerformance solverPerfU;
|
||||
lduSolverPerformance solverPerfT;
|
||||
lduMatrix::debug = 0;
|
||||
|
||||
// solve energy equation for temperature
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
# include "readSolidMechanicsControls.H"
|
||||
|
||||
int iCorr = 0;
|
||||
lduMatrix::solverPerformance solverPerf;
|
||||
lduSolverPerformance solverPerf;
|
||||
scalar initialResidual = 0;
|
||||
|
||||
lduMatrix::debug = 0;
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
# include "readSolidMechanicsControls.H"
|
||||
|
||||
int iCorr = 0;
|
||||
lduMatrix::solverPerformance solverPerf;
|
||||
lduSolverPerformance solverPerf;
|
||||
scalar initialResidual = 0;
|
||||
|
||||
lduMatrix::debug = 0;
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
Info << "lambda = " << average(lambda.internalField()) << endl;
|
||||
|
||||
int iCorr = 0;
|
||||
lduMatrix::solverPerformance solverPerf;
|
||||
lduSolverPerformance solverPerf;
|
||||
scalar initialResidual = 0;
|
||||
scalar err = GREAT;
|
||||
|
||||
|
|
|
@ -73,7 +73,7 @@ int main(int argc, char *argv[])
|
|||
Info << "average lambda = " << average(lambdaf.internalField()) << endl;
|
||||
|
||||
int iCorr = 0;
|
||||
lduMatrix::solverPerformance solverPerf;
|
||||
lduSolverPerformance solverPerf;
|
||||
scalar initialResidual = 1.0;
|
||||
scalar residual = 1.0;
|
||||
surfaceSymmTensorField DSigmaCorrf = fvc::interpolate(DSigmaCorr);
|
||||
|
|
|
@ -61,27 +61,87 @@ void faMeshDecomposition::distributeFaces()
|
|||
)
|
||||
);
|
||||
|
||||
labelHashSet faceProcAddressingHash
|
||||
(
|
||||
labelIOList
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"faceProcAddressing",
|
||||
"constant",
|
||||
procMesh.meshSubDir,
|
||||
procMesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::NO_WRITE
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
forAll (faceLabels(), faceI)
|
||||
// If faMesh's fvPatch is a part of the global face zones, faces of that
|
||||
// patch will be present on all processors. Because of that, looping
|
||||
// through faceProcAddressing will decompose global faMesh faces to the
|
||||
// very last processor regardless of where fvPatch is really decomposed.
|
||||
// Since global faces which do not belong to specific processor are
|
||||
// located at the end of the faceProcAddressing, cutting it at
|
||||
// i = owner.size() will correctly decompose faMesh faces.
|
||||
// Vanja Skuric, 2016-04-21
|
||||
if (decompositionDict_.found("globalFaceZones"))
|
||||
{
|
||||
if (faceProcAddressingHash.found(faceLabels()[faceI] + 1))
|
||||
labelList faceProcAddressing
|
||||
(
|
||||
labelIOList
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"faceProcAddressing",
|
||||
"constant",
|
||||
procMesh.meshSubDir,
|
||||
procMesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::NO_WRITE
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
const label ownerSize =
|
||||
(
|
||||
labelIOList
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"owner",
|
||||
"constant",
|
||||
procMesh.meshSubDir,
|
||||
procMesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::NO_WRITE
|
||||
)
|
||||
)
|
||||
).size();
|
||||
|
||||
labelHashSet faceProcAddressingHash(ownerSize);
|
||||
|
||||
for (int i = 0; i < ownerSize; ++i)
|
||||
{
|
||||
faceToProc_[faceI] = procI;
|
||||
faceProcAddressingHash.insert(faceProcAddressing[i]);
|
||||
}
|
||||
|
||||
forAll (faceLabels(), faceI)
|
||||
{
|
||||
if (faceProcAddressingHash.found(faceLabels()[faceI] + 1))
|
||||
{
|
||||
faceToProc_[faceI] = procI;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
labelHashSet faceProcAddressingHash
|
||||
(
|
||||
labelIOList
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"faceProcAddressing",
|
||||
"constant",
|
||||
procMesh.meshSubDir,
|
||||
procMesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::NO_WRITE
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
forAll (faceLabels(), faceI)
|
||||
{
|
||||
if (faceProcAddressingHash.found(faceLabels()[faceI] + 1))
|
||||
{
|
||||
faceToProc_[faceI] = procI;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -93,7 +93,7 @@ protected:
|
|||
}
|
||||
|
||||
// Holds recent solver performance
|
||||
lduMatrix::solverPerformance solverPerf_;
|
||||
lduSolverPerformance solverPerf_;
|
||||
|
||||
|
||||
public:
|
||||
|
@ -125,7 +125,7 @@ public:
|
|||
virtual void updateMesh(const mapPolyMesh&);
|
||||
|
||||
//- Return recent solver performance
|
||||
const lduMatrix::solverPerformance& solverPerformance() const
|
||||
const lduSolverPerformance& solverPerformance() const
|
||||
{
|
||||
return solverPerf_;
|
||||
}
|
||||
|
|
|
@ -21,31 +21,45 @@ License
|
|||
You should have received a copy of the GNU General Public License
|
||||
along with foam-extend. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Description
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "error.H"
|
||||
#include "objectRegistry.H"
|
||||
#include "foamTime.H"
|
||||
#include "faSchemes.H"
|
||||
#include "objectRegistry.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
Foam::debug::debugSwitch
|
||||
faSchemes::debug
|
||||
Foam::faSchemes::debug
|
||||
(
|
||||
"faSchemes",
|
||||
false
|
||||
);
|
||||
|
||||
// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * //
|
||||
|
||||
void Foam::faSchemes::clear()
|
||||
{
|
||||
ddtSchemes_.clear();
|
||||
defaultDdtScheme_.clear();
|
||||
d2dt2Schemes_.clear();
|
||||
defaultD2dt2Scheme_.clear();
|
||||
interpolationSchemes_.clear();
|
||||
defaultInterpolationScheme_.clear();
|
||||
divSchemes_.clear(); // optional
|
||||
defaultDivScheme_.clear();
|
||||
gradSchemes_.clear(); // optional
|
||||
defaultGradScheme_.clear();
|
||||
lnGradSchemes_.clear();
|
||||
defaultLnGradScheme_.clear();
|
||||
laplacianSchemes_.clear(); // optional
|
||||
defaultLaplacianScheme_.clear();
|
||||
fluxRequired_.clear();
|
||||
defaultFluxRequired_ = false;
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
faSchemes::faSchemes(const objectRegistry& obr)
|
||||
Foam::faSchemes::faSchemes(const objectRegistry& obr)
|
||||
:
|
||||
IOdictionary
|
||||
(
|
||||
|
@ -59,21 +73,106 @@ faSchemes::faSchemes(const objectRegistry& obr)
|
|||
IOobject::NO_WRITE
|
||||
)
|
||||
),
|
||||
ddtSchemes_(ITstream("ddtSchemes", tokenList())()),
|
||||
defaultDdtScheme_("default", tokenList()),
|
||||
d2dt2Schemes_(ITstream("d2dt2Schemes", tokenList())()),
|
||||
defaultD2dt2Scheme_("default", tokenList()),
|
||||
interpolationSchemes_(ITstream("interpolationSchemes", tokenList())()),
|
||||
defaultInterpolationScheme_("default", tokenList()),
|
||||
divSchemes_(ITstream("divSchemes", tokenList())()),
|
||||
defaultDivScheme_("default", tokenList()),
|
||||
gradSchemes_(ITstream("gradSchemes", tokenList())()),
|
||||
defaultGradScheme_("default", tokenList()),
|
||||
lnGradSchemes_(ITstream("lnGradSchemes", tokenList())()),
|
||||
defaultLnGradScheme_("default", tokenList()),
|
||||
laplacianSchemes_(ITstream("laplacianSchemes", tokenList())()),
|
||||
defaultLaplacianScheme_("default", tokenList()),
|
||||
fluxRequired_(ITstream("fluxRequired", tokenList())())
|
||||
ddtSchemes_
|
||||
(
|
||||
ITstream
|
||||
(
|
||||
objectPath() + "::ddtSchemes",
|
||||
tokenList()
|
||||
)()
|
||||
),
|
||||
defaultDdtScheme_
|
||||
(
|
||||
ddtSchemes_.name() + "::default",
|
||||
tokenList()
|
||||
),
|
||||
d2dt2Schemes_
|
||||
(
|
||||
ITstream
|
||||
(
|
||||
objectPath() + "::d2dt2Schemes",
|
||||
tokenList()
|
||||
)()
|
||||
),
|
||||
defaultD2dt2Scheme_
|
||||
(
|
||||
d2dt2Schemes_.name() + "::default",
|
||||
tokenList()
|
||||
),
|
||||
interpolationSchemes_
|
||||
(
|
||||
ITstream
|
||||
(
|
||||
objectPath() + "::interpolationSchemes",
|
||||
tokenList()
|
||||
)()
|
||||
),
|
||||
defaultInterpolationScheme_
|
||||
(
|
||||
interpolationSchemes_.name() + "::default",
|
||||
tokenList()
|
||||
),
|
||||
divSchemes_
|
||||
(
|
||||
ITstream
|
||||
(
|
||||
objectPath() + "::divSchemes",
|
||||
tokenList()
|
||||
)()
|
||||
),
|
||||
defaultDivScheme_
|
||||
(
|
||||
divSchemes_.name() + "::default",
|
||||
tokenList()
|
||||
),
|
||||
gradSchemes_
|
||||
(
|
||||
ITstream
|
||||
(
|
||||
objectPath() + "::gradSchemes",
|
||||
tokenList()
|
||||
)()
|
||||
),
|
||||
defaultGradScheme_
|
||||
(
|
||||
gradSchemes_.name() + "::default",
|
||||
tokenList()
|
||||
),
|
||||
lnGradSchemes_
|
||||
(
|
||||
ITstream
|
||||
(
|
||||
objectPath() + "::snGradSchemes",
|
||||
tokenList()
|
||||
)()
|
||||
),
|
||||
defaultLnGradScheme_
|
||||
(
|
||||
lnGradSchemes_.name() + "::default",
|
||||
tokenList()
|
||||
),
|
||||
laplacianSchemes_
|
||||
(
|
||||
ITstream
|
||||
(
|
||||
objectPath() + "::laplacianSchemes",
|
||||
tokenList()
|
||||
)()
|
||||
),
|
||||
defaultLaplacianScheme_
|
||||
(
|
||||
laplacianSchemes_.name() + "::default",
|
||||
tokenList()
|
||||
),
|
||||
fluxRequired_
|
||||
(
|
||||
ITstream
|
||||
(
|
||||
objectPath() + "::fluxRequired",
|
||||
tokenList()
|
||||
)()
|
||||
),
|
||||
defaultFluxRequired_(false)
|
||||
{
|
||||
if (!headerOk())
|
||||
{
|
||||
|
@ -85,6 +184,8 @@ faSchemes::faSchemes(const objectRegistry& obr)
|
|||
) << "faSchemes dictionary not found. Creating default."
|
||||
<< endl;
|
||||
}
|
||||
|
||||
regIOobject::write();
|
||||
}
|
||||
|
||||
read();
|
||||
|
@ -93,27 +194,58 @@ faSchemes::faSchemes(const objectRegistry& obr)
|
|||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
bool faSchemes::read()
|
||||
bool Foam::faSchemes::read()
|
||||
{
|
||||
bool readOk = false;
|
||||
|
||||
if (headerOk())
|
||||
{
|
||||
readOk = regIOobject::read();
|
||||
}
|
||||
|
||||
if (readOk)
|
||||
if (regIOobject::read())
|
||||
{
|
||||
const dictionary& dict = schemesDict();
|
||||
|
||||
// ddt Schemes
|
||||
// persistent settings across reads is incorrect
|
||||
clear();
|
||||
|
||||
if (dict.found("ddtSchemes"))
|
||||
{
|
||||
ddtSchemes_ = dict.subDict("ddtSchemes");
|
||||
}
|
||||
else if (dict.found("timeScheme"))
|
||||
{
|
||||
// For backward compatibility.
|
||||
// The timeScheme will be deprecated with warning or removed
|
||||
WarningIn("fvSchemes::read()")
|
||||
<< "Using deprecated 'timeScheme' instead of 'ddtSchemes'"
|
||||
<< nl << endl;
|
||||
|
||||
word schemeName(dict.lookup("timeScheme"));
|
||||
|
||||
if (schemeName == "EulerImplicit")
|
||||
{
|
||||
schemeName = "Euler";
|
||||
}
|
||||
else if (schemeName == "BackwardDifferencing")
|
||||
{
|
||||
schemeName = "backward";
|
||||
}
|
||||
else if (schemeName == "SteadyState")
|
||||
{
|
||||
schemeName = "steadyState";
|
||||
}
|
||||
else
|
||||
{
|
||||
FatalIOErrorIn("fvSchemes::read()", dict.lookup("timeScheme"))
|
||||
<< "\n Only EulerImplicit, BackwardDifferencing and "
|
||||
"SteadyState\n are supported by the old timeScheme "
|
||||
"specification.\n Please use ddtSchemes instead."
|
||||
<< exit(FatalIOError);
|
||||
}
|
||||
|
||||
ddtSchemes_.set("default", schemeName);
|
||||
|
||||
ddtSchemes_.lookup("default")[0].lineNumber() =
|
||||
dict.lookup("timeScheme").lineNumber();
|
||||
}
|
||||
else
|
||||
{
|
||||
ddtSchemes_.add("default", "none");
|
||||
ddtSchemes_.set("default", "none");
|
||||
}
|
||||
|
||||
if
|
||||
|
@ -126,7 +258,6 @@ bool faSchemes::read()
|
|||
}
|
||||
|
||||
|
||||
// d2dt2 schemes
|
||||
if (dict.found("d2dt2Schemes"))
|
||||
{
|
||||
d2dt2Schemes_ = dict.subDict("d2dt2Schemes");
|
||||
|
@ -134,29 +265,30 @@ bool faSchemes::read()
|
|||
else if (dict.found("timeScheme"))
|
||||
{
|
||||
// For backward compatibility.
|
||||
// The timeScheme will be deprecated with warning or removed in 2.4.
|
||||
// The timeScheme will be deprecated with warning or removed
|
||||
WarningIn("fvSchemes::read()")
|
||||
<< "Using deprecated 'timeScheme' instead of 'd2dt2Schemes'"
|
||||
<< nl << endl;
|
||||
|
||||
word timeSchemeName(dict.lookup("timeScheme"));
|
||||
word schemeName(dict.lookup("timeScheme"));
|
||||
|
||||
if (timeSchemeName == "EulerImplicit")
|
||||
if (schemeName == "EulerImplicit")
|
||||
{
|
||||
timeSchemeName = "Euler";
|
||||
schemeName = "Euler";
|
||||
}
|
||||
else if (timeSchemeName == "SteadyState")
|
||||
else if (schemeName == "SteadyState")
|
||||
{
|
||||
timeSchemeName = "steadyState";
|
||||
schemeName = "steadyState";
|
||||
}
|
||||
|
||||
if (d2dt2Schemes_.found("default"))
|
||||
{
|
||||
d2dt2Schemes_.remove("default");
|
||||
}
|
||||
d2dt2Schemes_.set("default", schemeName);
|
||||
|
||||
d2dt2Schemes_.add("default", timeSchemeName);
|
||||
d2dt2Schemes_.lookup("default")[0].lineNumber() =
|
||||
dict.lookup("timeScheme").lineNumber();
|
||||
}
|
||||
else
|
||||
{
|
||||
d2dt2Schemes_.add("default", "none");
|
||||
d2dt2Schemes_.set("default", "none");
|
||||
}
|
||||
|
||||
if
|
||||
|
@ -169,7 +301,6 @@ bool faSchemes::read()
|
|||
}
|
||||
|
||||
|
||||
// Interpolation schemes
|
||||
if (dict.found("interpolationSchemes"))
|
||||
{
|
||||
interpolationSchemes_ = dict.subDict("interpolationSchemes");
|
||||
|
@ -190,15 +321,9 @@ bool faSchemes::read()
|
|||
}
|
||||
|
||||
|
||||
// Div schemes
|
||||
if (dict.found("divSchemes"))
|
||||
{
|
||||
divSchemes_ = dict.subDict("divSchemes");
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
divSchemes_.add("default", "none");
|
||||
}
|
||||
|
||||
if
|
||||
|
@ -210,16 +335,9 @@ bool faSchemes::read()
|
|||
defaultDivScheme_ = divSchemes_.lookup("default");
|
||||
}
|
||||
|
||||
|
||||
// Grad schemes
|
||||
if (dict.found("gradSchemes"))
|
||||
{
|
||||
gradSchemes_ = dict.subDict("gradSchemes");
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
gradSchemes_.add("default", "none");
|
||||
}
|
||||
|
||||
if
|
||||
|
@ -232,12 +350,11 @@ bool faSchemes::read()
|
|||
}
|
||||
|
||||
|
||||
// lnGrad schemes
|
||||
if (dict.found("lnGradSchemes"))
|
||||
{
|
||||
lnGradSchemes_ = dict.subDict("lnGradSchemes");
|
||||
}
|
||||
else
|
||||
else if (!lnGradSchemes_.found("default"))
|
||||
{
|
||||
lnGradSchemes_.add("default", "corrected");
|
||||
}
|
||||
|
@ -252,15 +369,9 @@ bool faSchemes::read()
|
|||
}
|
||||
|
||||
|
||||
// laplacian schemes
|
||||
if (dict.found("laplacianSchemes"))
|
||||
{
|
||||
laplacianSchemes_ = dict.subDict("laplacianSchemes");
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
laplacianSchemes_.add("default", "none");
|
||||
}
|
||||
|
||||
if
|
||||
|
@ -273,18 +384,30 @@ bool faSchemes::read()
|
|||
}
|
||||
|
||||
|
||||
// Flux required
|
||||
if (dict.found("fluxRequired"))
|
||||
{
|
||||
fluxRequired_ = dict.subDict("fluxRequired");
|
||||
}
|
||||
}
|
||||
|
||||
return readOk;
|
||||
if
|
||||
(
|
||||
fluxRequired_.found("default")
|
||||
&& word(fluxRequired_.lookup("default")) != "none"
|
||||
)
|
||||
{
|
||||
defaultFluxRequired_ = Switch(fluxRequired_.lookup("default"));
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
const dictionary& faSchemes::schemesDict() const
|
||||
const Foam::dictionary& Foam::faSchemes::schemesDict() const
|
||||
{
|
||||
if (found("select"))
|
||||
{
|
||||
|
@ -297,18 +420,14 @@ const dictionary& faSchemes::schemesDict() const
|
|||
}
|
||||
|
||||
|
||||
ITstream& faSchemes::ddtScheme(const word& name) const
|
||||
Foam::ITstream& Foam::faSchemes::ddtScheme(const word& name) const
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
Info<< "Lookup ddtScheme for " << name << endl;
|
||||
}
|
||||
|
||||
if
|
||||
(
|
||||
ddtSchemes_.found(name)
|
||||
|| !defaultDdtScheme_.size()
|
||||
)
|
||||
if (ddtSchemes_.found(name) || defaultDdtScheme_.empty())
|
||||
{
|
||||
return ddtSchemes_.lookup(name);
|
||||
}
|
||||
|
@ -320,18 +439,14 @@ ITstream& faSchemes::ddtScheme(const word& name) const
|
|||
}
|
||||
|
||||
|
||||
ITstream& faSchemes::d2dt2Scheme(const word& name) const
|
||||
Foam::ITstream& Foam::faSchemes::d2dt2Scheme(const word& name) const
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
Info<< "Lookup d2dt2Scheme for " << name << endl;
|
||||
}
|
||||
|
||||
if
|
||||
(
|
||||
d2dt2Schemes_.found(name)
|
||||
|| !defaultD2dt2Scheme_.size()
|
||||
)
|
||||
if (d2dt2Schemes_.found(name) || defaultD2dt2Scheme_.empty())
|
||||
{
|
||||
return d2dt2Schemes_.lookup(name);
|
||||
}
|
||||
|
@ -343,12 +458,17 @@ ITstream& faSchemes::d2dt2Scheme(const word& name) const
|
|||
}
|
||||
|
||||
|
||||
ITstream& faSchemes::interpolationScheme(const word& name) const
|
||||
Foam::ITstream& Foam::faSchemes::interpolationScheme(const word& name) const
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
Info<< "Lookup interpolationScheme for " << name << endl;
|
||||
}
|
||||
|
||||
if
|
||||
(
|
||||
interpolationSchemes_.found(name)
|
||||
|| !defaultInterpolationScheme_.size()
|
||||
|| defaultInterpolationScheme_.empty()
|
||||
)
|
||||
{
|
||||
return interpolationSchemes_.lookup(name);
|
||||
|
@ -361,9 +481,14 @@ ITstream& faSchemes::interpolationScheme(const word& name) const
|
|||
}
|
||||
|
||||
|
||||
ITstream& faSchemes::divScheme(const word& name) const
|
||||
Foam::ITstream& Foam::faSchemes::divScheme(const word& name) const
|
||||
{
|
||||
if (divSchemes_.found(name) || !defaultDivScheme_.size())
|
||||
if (debug)
|
||||
{
|
||||
Info<< "Lookup divScheme for " << name << endl;
|
||||
}
|
||||
|
||||
if (divSchemes_.found(name) || defaultDivScheme_.empty())
|
||||
{
|
||||
return divSchemes_.lookup(name);
|
||||
}
|
||||
|
@ -375,9 +500,14 @@ ITstream& faSchemes::divScheme(const word& name) const
|
|||
}
|
||||
|
||||
|
||||
ITstream& faSchemes::gradScheme(const word& name) const
|
||||
Foam::ITstream& Foam::faSchemes::gradScheme(const word& name) const
|
||||
{
|
||||
if (gradSchemes_.found(name) || !defaultGradScheme_.size())
|
||||
if (debug)
|
||||
{
|
||||
Info<< "Lookup gradScheme for " << name << endl;
|
||||
}
|
||||
|
||||
if (gradSchemes_.found(name) || defaultGradScheme_.empty())
|
||||
{
|
||||
return gradSchemes_.lookup(name);
|
||||
}
|
||||
|
@ -389,9 +519,14 @@ ITstream& faSchemes::gradScheme(const word& name) const
|
|||
}
|
||||
|
||||
|
||||
ITstream& faSchemes::lnGradScheme(const word& name) const
|
||||
Foam::ITstream& Foam::faSchemes::lnGradScheme(const word& name) const
|
||||
{
|
||||
if (lnGradSchemes_.found(name) || !defaultLnGradScheme_.size())
|
||||
if (debug)
|
||||
{
|
||||
Info<< "Lookup snGradScheme for " << name << endl;
|
||||
}
|
||||
|
||||
if (lnGradSchemes_.found(name) || defaultLnGradScheme_.empty())
|
||||
{
|
||||
return lnGradSchemes_.lookup(name);
|
||||
}
|
||||
|
@ -403,9 +538,14 @@ ITstream& faSchemes::lnGradScheme(const word& name) const
|
|||
}
|
||||
|
||||
|
||||
ITstream& faSchemes::laplacianScheme(const word& name) const
|
||||
Foam::ITstream& Foam::faSchemes::laplacianScheme(const word& name) const
|
||||
{
|
||||
if (laplacianSchemes_.found(name) || !defaultLaplacianScheme_.size())
|
||||
if (debug)
|
||||
{
|
||||
Info<< "Lookup laplacianScheme for " << name << endl;
|
||||
}
|
||||
|
||||
if (laplacianSchemes_.found(name) || defaultLaplacianScheme_.empty())
|
||||
{
|
||||
return laplacianSchemes_.lookup(name);
|
||||
}
|
||||
|
@ -417,13 +557,24 @@ ITstream& faSchemes::laplacianScheme(const word& name) const
|
|||
}
|
||||
|
||||
|
||||
bool faSchemes::fluxRequired(const word& name) const
|
||||
void Foam::faSchemes::setFluxRequired(const word& name) const
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
Info<< "Setting fluxRequired for " << name << endl;
|
||||
}
|
||||
|
||||
fluxRequired_.add(name, true, true);
|
||||
}
|
||||
|
||||
|
||||
bool Foam::faSchemes::fluxRequired(const word& name) const
|
||||
{
|
||||
return fluxRequired_.found(name);
|
||||
}
|
||||
|
||||
|
||||
bool faSchemes::writeData(Ostream& os) const
|
||||
bool Foam::faSchemes::writeData(Ostream& os) const
|
||||
{
|
||||
// Write dictionaries
|
||||
os << nl << "ddtSchemes";
|
||||
|
@ -454,8 +605,4 @@ bool faSchemes::writeData(Ostream& os) const
|
|||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// ************************************************************************* //
|
||||
|
|
|
@ -53,8 +53,6 @@ class faSchemes
|
|||
:
|
||||
public IOdictionary
|
||||
{
|
||||
private:
|
||||
|
||||
// Private data
|
||||
|
||||
dictionary ddtSchemes_;
|
||||
|
@ -78,13 +76,19 @@ private:
|
|||
dictionary laplacianSchemes_;
|
||||
ITstream defaultLaplacianScheme_;
|
||||
|
||||
dictionary fluxRequired_;
|
||||
mutable dictionary fluxRequired_;
|
||||
bool defaultFluxRequired_;
|
||||
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
//- Disallow default bitwise copy construct and assignment
|
||||
//- Clear the dictionaries and streams before reading
|
||||
void clear();
|
||||
|
||||
//- Disallow default bitwise copy construct
|
||||
faSchemes(const faSchemes&);
|
||||
|
||||
//- Disallow default bitwise assignment
|
||||
void operator=(const faSchemes&);
|
||||
|
||||
|
||||
|
@ -120,6 +124,8 @@ public:
|
|||
|
||||
ITstream& laplacianScheme(const word& name) const;
|
||||
|
||||
void setFluxRequired(const word& name) const;
|
||||
|
||||
bool fluxRequired(const word& name) const;
|
||||
|
||||
|
||||
|
|
|
@ -329,6 +329,40 @@ laplacian
|
|||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
tmp<faMatrix<Type> >
|
||||
laplacian
|
||||
(
|
||||
const edgeTensorField& gamma,
|
||||
const GeometricField<Type, faPatchField, areaMesh>& vf,
|
||||
const word& name
|
||||
)
|
||||
{
|
||||
const faMesh& mesh = vf.mesh();
|
||||
|
||||
return fam::laplacian
|
||||
(
|
||||
(mesh.Le() & gamma & mesh.Le())/sqr(mesh.magLe()),
|
||||
vf,
|
||||
name
|
||||
);
|
||||
}
|
||||
|
||||
template<class Type>
|
||||
tmp<faMatrix<Type> >
|
||||
laplacian
|
||||
(
|
||||
const tmp<edgeTensorField>& tgamma,
|
||||
const GeometricField<Type, faPatchField, areaMesh>& vf,
|
||||
const word& name
|
||||
)
|
||||
{
|
||||
tmp<faMatrix<Type> > Laplacian = fam::laplacian(tgamma(), vf, name);
|
||||
tgamma.clear();
|
||||
return Laplacian;
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace fam
|
||||
|
|
|
@ -180,6 +180,23 @@ namespace fam
|
|||
const tmp<edgeTensorField>&,
|
||||
const GeometricField<Type, faPatchField, areaMesh>&
|
||||
);
|
||||
|
||||
|
||||
template<class Type>
|
||||
tmp<faMatrix<Type> > laplacian
|
||||
(
|
||||
const edgeTensorField&,
|
||||
const GeometricField<Type, faPatchField, areaMesh>&,
|
||||
const word& name
|
||||
);
|
||||
|
||||
template<class Type>
|
||||
tmp<faMatrix<Type> > laplacian
|
||||
(
|
||||
const tmp<edgeTensorField>&,
|
||||
const GeometricField<Type, faPatchField, areaMesh>&,
|
||||
const word& name
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -63,7 +63,7 @@ bool Foam::pimpleControl::criteriaSatisfied()
|
|||
bool achieved = true;
|
||||
bool checked = false; // safety that some checks were indeed performed
|
||||
|
||||
const dictionary& solverDict = mesh_.solverPerformanceDict();
|
||||
const dictionary& solverDict = mesh_.solutionDict().solverPerformanceDict();
|
||||
forAllConstIter(dictionary, solverDict, iter)
|
||||
{
|
||||
const word& variableName = iter().keyword();
|
||||
|
@ -190,7 +190,7 @@ bool Foam::pimpleControl::loop()
|
|||
}
|
||||
|
||||
corr_ = 0;
|
||||
mesh_.data::remove("finalIteration");
|
||||
mesh_.solutionDict().remove("finalIteration");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -202,7 +202,7 @@ bool Foam::pimpleControl::loop()
|
|||
Info<< algorithmName_ << ": converged in " << corr_ - 1
|
||||
<< " iterations" << endl;
|
||||
|
||||
mesh_.data::remove("finalIteration");
|
||||
mesh_.solutionDict().remove("finalIteration");
|
||||
corr_ = 0;
|
||||
converged_ = false;
|
||||
|
||||
|
@ -213,7 +213,7 @@ bool Foam::pimpleControl::loop()
|
|||
Info<< algorithmName_ << ": iteration " << corr_ << endl;
|
||||
storePrevIterFields();
|
||||
|
||||
mesh_.data::add("finalIteration", true);
|
||||
mesh_.solutionDict().add("finalIteration", true);
|
||||
converged_ = true;
|
||||
}
|
||||
}
|
||||
|
@ -221,7 +221,7 @@ bool Foam::pimpleControl::loop()
|
|||
{
|
||||
if (finalIter())
|
||||
{
|
||||
mesh_.data::add("finalIteration", true);
|
||||
mesh_.solutionDict().add("finalIteration", true);
|
||||
}
|
||||
|
||||
if (corr_ <= nCorrPIMPLE_)
|
||||
|
|
|
@ -52,7 +52,7 @@ bool Foam::simpleControl::criteriaSatisfied()
|
|||
bool achieved = true;
|
||||
bool checked = false; // safety that some checks were indeed performed
|
||||
|
||||
const dictionary& solverDict = mesh_.solverPerformanceDict();
|
||||
const dictionary& solverDict = mesh_.solutionDict().solverPerformanceDict();
|
||||
forAllConstIter(dictionary, solverDict, iter)
|
||||
{
|
||||
const word& variableName = iter().keyword();
|
||||
|
|
|
@ -28,7 +28,6 @@ License
|
|||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
Foam::debug::debugSwitch
|
||||
Foam::fvSchemes::debug
|
||||
(
|
||||
|
@ -586,5 +585,35 @@ bool Foam::fvSchemes::fluxRequired(const word& name) const
|
|||
}
|
||||
}
|
||||
|
||||
bool Foam::fvSchemes::writeData(Ostream& os) const
|
||||
{
|
||||
// Write dictionaries
|
||||
os << nl << "ddtSchemes";
|
||||
ddtSchemes_.write(os, true);
|
||||
|
||||
os << nl << "d2dt2Schemes";
|
||||
d2dt2Schemes_.write(os, true);
|
||||
|
||||
os << nl << "interpolationSchemes";
|
||||
interpolationSchemes_.write(os, true);
|
||||
|
||||
os << nl << "divSchemes";
|
||||
divSchemes_.write(os, true);
|
||||
|
||||
os << nl << "gradSchemes";
|
||||
gradSchemes_.write(os, true);
|
||||
|
||||
os << nl << "snGradSchemes";
|
||||
snGradSchemes_.write(os, true);
|
||||
|
||||
os << nl << "laplacianSchemes";
|
||||
laplacianSchemes_.write(os, true);
|
||||
|
||||
os << nl << "fluxRequired";
|
||||
fluxRequired_.write(os, true);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
|
|
|
@ -95,7 +95,7 @@ class fvSchemes
|
|||
public:
|
||||
|
||||
//- Debug switch
|
||||
static debug::debugSwitch debug;
|
||||
static debug::debugSwitch debug;
|
||||
|
||||
|
||||
// Constructors
|
||||
|
@ -184,6 +184,12 @@ public:
|
|||
|
||||
//- Read the fvSchemes
|
||||
bool read();
|
||||
|
||||
|
||||
// Write
|
||||
|
||||
//- WriteData function required for regIOobject write operation
|
||||
virtual bool writeData(Ostream&) const;
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -1390,7 +1390,7 @@ Foam::tmp<Foam::fvMatrix<Type> > Foam::relax(const fvMatrix<Type>& m)
|
|||
|
||||
|
||||
template<class Type>
|
||||
Foam::lduMatrix::solverPerformance Foam::solve
|
||||
Foam::lduSolverPerformance Foam::solve
|
||||
(
|
||||
fvMatrix<Type>& fvm,
|
||||
const dictionary& solverControls
|
||||
|
@ -1400,13 +1400,13 @@ Foam::lduMatrix::solverPerformance Foam::solve
|
|||
}
|
||||
|
||||
template<class Type>
|
||||
Foam::lduMatrix::solverPerformance Foam::solve
|
||||
Foam::lduSolverPerformance Foam::solve
|
||||
(
|
||||
const tmp<fvMatrix<Type> >& tfvm,
|
||||
const dictionary& solverControls
|
||||
)
|
||||
{
|
||||
lduMatrix::solverPerformance solverPerf =
|
||||
lduSolverPerformance solverPerf =
|
||||
const_cast<fvMatrix<Type>&>(tfvm()).solve(solverControls);
|
||||
|
||||
tfvm.clear();
|
||||
|
@ -1416,18 +1416,18 @@ Foam::lduMatrix::solverPerformance Foam::solve
|
|||
|
||||
|
||||
template<class Type>
|
||||
Foam::lduMatrix::solverPerformance Foam::solve(fvMatrix<Type>& fvm)
|
||||
Foam::lduSolverPerformance Foam::solve(fvMatrix<Type>& fvm)
|
||||
{
|
||||
return fvm.solve();
|
||||
}
|
||||
|
||||
template<class Type>
|
||||
Foam::lduMatrix::solverPerformance Foam::solve
|
||||
Foam::lduSolverPerformance Foam::solve
|
||||
(
|
||||
const tmp<fvMatrix<Type> >& tfvm
|
||||
)
|
||||
{
|
||||
lduMatrix::solverPerformance solverPerf =
|
||||
lduSolverPerformance solverPerf =
|
||||
const_cast<fvMatrix<Type>&>(tfvm()).solve();
|
||||
|
||||
tfvm.clear();
|
||||
|
|
|
@ -363,7 +363,7 @@ public:
|
|||
|
||||
//- Solve returning the solution statistics.
|
||||
// Use the given solver controls
|
||||
lduMatrix::solverPerformance solve(const dictionary&);
|
||||
lduSolverPerformance solve(const dictionary&);
|
||||
|
||||
//- Solve returning the solution statistics.
|
||||
// Solver controls read from fvSolution
|
||||
|
|
|
@ -52,7 +52,7 @@ void Foam::fvMatrix<Type>::setComponentReference
|
|||
|
||||
|
||||
template<class Type>
|
||||
Foam::lduMatrix::solverPerformance Foam::fvMatrix<Type>::solve
|
||||
Foam::lduSolverPerformance Foam::fvMatrix<Type>::solve
|
||||
(
|
||||
const dictionary& solverControls
|
||||
)
|
||||
|
@ -140,7 +140,7 @@ Foam::lduMatrix::solverPerformance Foam::fvMatrix<Type>::solve
|
|||
cmpt
|
||||
);
|
||||
|
||||
lduMatrix::solverPerformance solverPerf;
|
||||
lduSolverPerformance solverPerf;
|
||||
|
||||
// Solver call
|
||||
solverPerf = lduMatrix::solver::New
|
||||
|
@ -170,14 +170,14 @@ Foam::lduMatrix::solverPerformance Foam::fvMatrix<Type>::solve
|
|||
|
||||
psi.correctBoundaryConditions();
|
||||
|
||||
psi_.mesh().setSolverPerformance(psi_.name(), solverPerfVec);
|
||||
psi_.mesh().solutionDict().setSolverPerformance(psi_.name(), solverPerfVec);
|
||||
|
||||
return solverPerfVec;
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::lduMatrix::solverPerformance Foam::fvMatrix<Type>::solve()
|
||||
Foam::lduSolverPerformance Foam::fvMatrix<Type>::solve()
|
||||
{
|
||||
return solve(psi_.mesh().solutionDict().solverDict(psi_.name()));
|
||||
}
|
||||
|
|
|
@ -55,7 +55,7 @@ void Foam::fvMatrix<Foam::scalar>::setComponentReference
|
|||
|
||||
|
||||
template<>
|
||||
Foam::lduMatrix::solverPerformance Foam::fvMatrix<Foam::scalar>::solve
|
||||
Foam::lduSolverPerformance Foam::fvMatrix<Foam::scalar>::solve
|
||||
(
|
||||
const dictionary& solverControls
|
||||
)
|
||||
|
@ -104,7 +104,7 @@ Foam::lduMatrix::solverPerformance Foam::fvMatrix<Foam::scalar>::solve
|
|||
|
||||
psi.correctBoundaryConditions();
|
||||
|
||||
psi_.mesh().setSolverPerformance(psi_.name(), solverPerf);
|
||||
psi_.mesh().solutionDict().setSolverPerformance(psi_.name(), solverPerf);
|
||||
|
||||
return solverPerf;
|
||||
}
|
||||
|
|
|
@ -56,7 +56,7 @@ void fvMatrix<scalar>::setComponentReference
|
|||
);
|
||||
|
||||
template<>
|
||||
lduMatrix::solverPerformance fvMatrix<scalar>::solve
|
||||
lduSolverPerformance fvMatrix<scalar>::solve
|
||||
(
|
||||
const dictionary&
|
||||
);
|
||||
|
|
|
@ -103,7 +103,6 @@ Foam::fvMesh::fvMesh(const IOobject& io)
|
|||
:
|
||||
polyMesh(io),
|
||||
surfaceInterpolation(*this),
|
||||
data(static_cast<const objectRegistry&>(*this)),
|
||||
boundary_(*this, boundaryMesh()),
|
||||
lduPtr_(NULL),
|
||||
curTimeIndex_(time().timeIndex()),
|
||||
|
@ -206,7 +205,6 @@ Foam::fvMesh::fvMesh
|
|||
:
|
||||
polyMesh(io, points, faces, allOwner, allNeighbour, syncPar),
|
||||
surfaceInterpolation(*this),
|
||||
data(static_cast<const objectRegistry&>(*this)),
|
||||
boundary_(*this),
|
||||
lduPtr_(NULL),
|
||||
curTimeIndex_(time().timeIndex()),
|
||||
|
@ -237,7 +235,6 @@ Foam::fvMesh::fvMesh
|
|||
:
|
||||
polyMesh(io, points, faces, cells, syncPar),
|
||||
surfaceInterpolation(*this),
|
||||
data(static_cast<const objectRegistry&>(*this)),
|
||||
boundary_(*this),
|
||||
lduPtr_(NULL),
|
||||
curTimeIndex_(time().timeIndex()),
|
||||
|
@ -285,7 +282,6 @@ Foam::fvMesh::fvMesh
|
|||
syncPar
|
||||
),
|
||||
surfaceInterpolation(*this),
|
||||
data(static_cast<const objectRegistry&>(*this)),
|
||||
boundary_(*this),
|
||||
lduPtr_(NULL),
|
||||
curTimeIndex_(time().timeIndex()),
|
||||
|
|
|
@ -52,7 +52,6 @@ SourceFiles
|
|||
#include "primitiveMesh.H"
|
||||
#include "fvBoundaryMesh.H"
|
||||
#include "surfaceInterpolation.H"
|
||||
#include "data.H"
|
||||
#include "DimensionedField.H"
|
||||
#include "volFieldsFwd.H"
|
||||
#include "surfaceFieldsFwd.H"
|
||||
|
@ -77,8 +76,7 @@ class fvMesh
|
|||
:
|
||||
public polyMesh,
|
||||
public lduMesh,
|
||||
public surfaceInterpolation,
|
||||
public data
|
||||
public surfaceInterpolation
|
||||
{
|
||||
// Private data
|
||||
|
||||
|
|
|
@ -242,7 +242,6 @@ lduMatrix = matrices/lduMatrix
|
|||
$(lduMatrix)/lduMatrix/lduMatrix.C
|
||||
$(lduMatrix)/lduMatrix/lduMatrixOperations.C
|
||||
$(lduMatrix)/lduMatrix/lduMatrixATmul.C
|
||||
$(lduMatrix)/lduMatrix/lduMatrixTests.C
|
||||
$(lduMatrix)/lduMatrix/lduMatrixUpdateMatrixInterfaces.C
|
||||
$(lduMatrix)/lduMatrix/lduMatrixSolver.C
|
||||
$(lduMatrix)/lduMatrix/lduMatrixSmoother.C
|
||||
|
@ -641,8 +640,6 @@ $(writers)/gnuplotGraph/gnuplotGraph.C
|
|||
$(writers)/xmgrGraph/xmgrGraph.C
|
||||
$(writers)/jplotGraph/jplotGraph.C
|
||||
|
||||
meshes/data/data.C
|
||||
|
||||
primitives/BlockCoeff/blockCoeffBase.C
|
||||
primitives/BlockCoeff/scalarBlockCoeff.C
|
||||
primitives/BlockCoeff/sphericalTensorBlockCoeff.C
|
||||
|
@ -733,6 +730,8 @@ $(BlockLduSmoothers)/BlockILUCpSmoother/blockILUCpSmoothers.C
|
|||
BlockLduSolvers = matrices/blockLduMatrix/BlockLduSolvers
|
||||
$(BlockLduSolvers)/blockVectorNSolvers.C
|
||||
$(BlockLduSolvers)/BlockLduSolver/blockLduSolvers.C
|
||||
$(BlockLduSolvers)/BlockLduSolver/BlockSolverPerformances.C
|
||||
$(BlockLduSolvers)/BlockLduSolver/BlockSolverPerformanceVectorN.C
|
||||
$(BlockLduSolvers)/BlockDiagonal/blockDiagonalSolvers.C
|
||||
$(BlockLduSolvers)/BlockGaussSeidel/blockGaussSeidelSolvers.C
|
||||
$(BlockLduSolvers)/BlockCG/blockCGSolvers.C
|
||||
|
|
|
@ -27,7 +27,6 @@ License
|
|||
#include "foamTime.H"
|
||||
#include "demandDrivenData.H"
|
||||
#include "dictionary.H"
|
||||
#include "data.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@ bool Foam::BlockSolverPerformance<Type>::checkConvergence
|
|||
const scalar RelTolerance
|
||||
)
|
||||
{
|
||||
if (BlockLduMatrix<Type>::debug >= 2)
|
||||
if (debug >= 2)
|
||||
{
|
||||
Info<< solverName_
|
||||
<< ": Iteration " << nIterations_
|
||||
|
@ -92,7 +92,7 @@ bool Foam::BlockSolverPerformance<Type>::checkSingularity
|
|||
template<class Type>
|
||||
void Foam::BlockSolverPerformance<Type>::print() const
|
||||
{
|
||||
if (BlockLduMatrix<Type>::debug)
|
||||
if (debug)
|
||||
{
|
||||
Info<< solverName_ << ": Solving for " << fieldName_;
|
||||
|
||||
|
@ -111,4 +111,65 @@ void Foam::BlockSolverPerformance<Type>::print() const
|
|||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
bool Foam::BlockSolverPerformance<Type>::operator!=
|
||||
(
|
||||
const BlockSolverPerformance<Type>& bsp
|
||||
) const
|
||||
{
|
||||
return
|
||||
(
|
||||
solverName() != bsp.solverName()
|
||||
|| fieldName() != bsp.fieldName()
|
||||
|| initialResidual() != bsp.initialResidual()
|
||||
|| finalResidual() != bsp.finalResidual()
|
||||
|| nIterations() != bsp.nIterations()
|
||||
|| converged() != bsp.converged()
|
||||
|| singular() != bsp.singular()
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::Istream& Foam::operator>>
|
||||
(
|
||||
Istream& is,
|
||||
typename Foam::BlockSolverPerformance<Type>& bsp
|
||||
)
|
||||
{
|
||||
is.readBeginList("BlockSolverPerformance<Type>");
|
||||
is >> bsp.solverName_
|
||||
>> bsp.fieldName_
|
||||
>> bsp.initialResidual_
|
||||
>> bsp.finalResidual_
|
||||
>> bsp.nIterations_
|
||||
>> bsp.converged_
|
||||
>> bsp.singular_;
|
||||
is.readEndList("BlockSolverPerformance<Type>");
|
||||
|
||||
return is;
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::Ostream& Foam::operator<<
|
||||
(
|
||||
Ostream& os,
|
||||
const typename Foam::BlockSolverPerformance<Type>& bsp
|
||||
)
|
||||
{
|
||||
os << token::BEGIN_LIST
|
||||
<< bsp.solverName_ << token::SPACE
|
||||
<< bsp.fieldName_ << token::SPACE
|
||||
<< bsp.initialResidual_ << token::SPACE
|
||||
<< bsp.finalResidual_ << token::SPACE
|
||||
<< bsp.nIterations_ << token::SPACE
|
||||
<< bsp.converged_ << token::SPACE
|
||||
<< bsp.singular_ << token::SPACE
|
||||
<< token::END_LIST;
|
||||
|
||||
return os;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
|
|
|
@ -51,6 +51,9 @@ namespace Foam
|
|||
template<class Type>
|
||||
class BlockSolverPerformance;
|
||||
|
||||
template<class Type>
|
||||
Istream& operator>>(Istream&, BlockSolverPerformance<Type>&);
|
||||
|
||||
template<class Type>
|
||||
Ostream& operator<<(Ostream&, const BlockSolverPerformance<Type>&);
|
||||
|
||||
|
@ -88,8 +91,24 @@ class BlockSolverPerformance
|
|||
|
||||
public:
|
||||
|
||||
// Static data
|
||||
|
||||
// Declare name of the class and its debug switch
|
||||
ClassName("BlockSolverPerformance");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct without solver and field name
|
||||
BlockSolverPerformance()
|
||||
:
|
||||
initialResidual_(pTraits<Type>::zero),
|
||||
finalResidual_(pTraits<Type>::zero),
|
||||
nIterations_(0),
|
||||
converged_(false),
|
||||
singular_(false)
|
||||
{}
|
||||
|
||||
//- Construct with solver and field name
|
||||
BlockSolverPerformance
|
||||
(
|
||||
|
@ -120,6 +139,18 @@ public:
|
|||
return solverName_;
|
||||
}
|
||||
|
||||
//- Return solver name
|
||||
word& solverName()
|
||||
{
|
||||
return solverName_;
|
||||
}
|
||||
|
||||
//- Return field name
|
||||
const word& fieldName() const
|
||||
{
|
||||
return fieldName_;
|
||||
}
|
||||
|
||||
//- Return initial residual
|
||||
const Type& initialResidual() const
|
||||
{
|
||||
|
@ -192,6 +223,26 @@ public:
|
|||
|
||||
//- Print summary of solver performance
|
||||
void print() const;
|
||||
|
||||
|
||||
// Member Operators
|
||||
|
||||
bool operator!=(const BlockSolverPerformance<Type>&) const;
|
||||
|
||||
|
||||
// Friend functions
|
||||
|
||||
friend Istream& operator>> <Type>
|
||||
(
|
||||
Istream&,
|
||||
BlockSolverPerformance<Type>&
|
||||
);
|
||||
|
||||
friend Ostream& operator<< <Type>
|
||||
(
|
||||
Ostream&,
|
||||
const BlockSolverPerformance<Type>&
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -0,0 +1,53 @@
|
|||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | foam-extend: Open Source CFD
|
||||
\\ / O peration |
|
||||
\\ / A nd | For copyright notice see file Copyright
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of foam-extend.
|
||||
|
||||
foam-extend is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation, either version 3 of the License, or (at your
|
||||
option) any later version.
|
||||
|
||||
foam-extend is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with foam-extend. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Description
|
||||
BlockSolverPerformance static data members
|
||||
|
||||
Author
|
||||
Vanja Skuric, FMENA Zagreb. All rights reserved.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "coeffFields.H"
|
||||
#include "BlockSolverPerformanceVectorN.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
#define makeNamedTemplateTypeNameAndDebug(type, Type, args...) \
|
||||
defineNamedTemplateTypeNameAndDebug(BlockSolverPerformance##Type, 1);
|
||||
|
||||
forAllVectorNTypes(makeNamedTemplateTypeNameAndDebug);
|
||||
|
||||
#undef makeNamedTemplateTypeNameAndDebug
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// ************************************************************************* //
|
|
@ -0,0 +1,66 @@
|
|||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | foam-extend: Open Source CFD
|
||||
\\ / O peration |
|
||||
\\ / A nd | For copyright notice see file Copyright
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of foam-extend.
|
||||
|
||||
foam-extend is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation, either version 3 of the License, or (at your
|
||||
option) any later version.
|
||||
|
||||
foam-extend is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with foam-extend. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
BlockSolverPerformance
|
||||
|
||||
Description
|
||||
Typedefs for BlockSolverPerformance
|
||||
|
||||
Author
|
||||
Vanja Skuric, FMENA Zagreb. All rights reserved.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef BlockSolverPerformanceVectorN_H
|
||||
#define BlockSolverPerformanceVectorN_H
|
||||
|
||||
#include "BlockSolverPerformances.H"
|
||||
#include "VectorTensorNFieldsFwd.H"
|
||||
#include "ExpandTensorNField.H"
|
||||
#include "VectorNFieldTypes.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#define makeTypedef(type, Type, args...) \
|
||||
typedef BlockSolverPerformance<type> BlockSolverPerformance##Type;
|
||||
|
||||
forAllVectorNTypes(makeTypedef)
|
||||
|
||||
#undef makeTypedef
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
|
@ -0,0 +1,52 @@
|
|||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | foam-extend: Open Source CFD
|
||||
\\ / O peration |
|
||||
\\ / A nd | For copyright notice see file Copyright
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of foam-extend.
|
||||
|
||||
foam-extend is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation, either version 3 of the License, or (at your
|
||||
option) any later version.
|
||||
|
||||
foam-extend is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with foam-extend. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Description
|
||||
BlockSolverPerformance static data members
|
||||
|
||||
Author
|
||||
Vanja Skuric, FMENA Zagreb. All rights reserved.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "BlockSolverPerformances.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
defineNamedTemplateTypeNameAndDebug(BlockSolverPerformanceScalar, 1);
|
||||
defineNamedTemplateTypeNameAndDebug(BlockSolverPerformanceVector, 1);
|
||||
defineNamedTemplateTypeNameAndDebug(BlockSolverPerformanceSphericalTensor, 1);
|
||||
defineNamedTemplateTypeNameAndDebug(BlockSolverPerformanceSymmTensor, 1);
|
||||
defineNamedTemplateTypeNameAndDebug(BlockSolverPerformanceTensor, 1);
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// ************************************************************************* //
|
|
@ -0,0 +1,64 @@
|
|||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | foam-extend: Open Source CFD
|
||||
\\ / O peration |
|
||||
\\ / A nd | For copyright notice see file Copyright
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of foam-extend.
|
||||
|
||||
foam-extend is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation, either version 3 of the License, or (at your
|
||||
option) any later version.
|
||||
|
||||
foam-extend is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with foam-extend. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
BlockSolverPerformance
|
||||
|
||||
Description
|
||||
Typedefs for BlockSolverPerformance
|
||||
|
||||
Author
|
||||
Vanja Skuric, FMENA Zagreb. All rights reserved.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef BlockSolverPerformances_H
|
||||
#define BlockSolverPerformances_H
|
||||
|
||||
#include "BlockSolverPerformance.H"
|
||||
#include "fieldTypes.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
typedef BlockSolverPerformance<scalar> BlockSolverPerformanceScalar;
|
||||
typedef BlockSolverPerformance<vector> BlockSolverPerformanceVector;
|
||||
typedef BlockSolverPerformance<sphericalTensor>
|
||||
BlockSolverPerformanceSphericalTensor;
|
||||
typedef BlockSolverPerformance<symmTensor> BlockSolverPerformanceSymmTensor;
|
||||
typedef BlockSolverPerformance<tensor> BlockSolverPerformanceTensor;
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
|
@ -42,7 +42,6 @@ SourceFiles
|
|||
lduMatrixOperations.C
|
||||
lduMatrixSolver.C
|
||||
lduMatrixPreconditioner.C
|
||||
lduMatrixTests.C
|
||||
lduMatrixUpdateMatrixInterfaces.C
|
||||
lduMatrixBufferedUpdateMatrixInterfaces.C
|
||||
|
||||
|
@ -60,6 +59,7 @@ SourceFiles
|
|||
#include "autoPtr.H"
|
||||
#include "runTimeSelectionTables.H"
|
||||
#include "profilingTrigger.H"
|
||||
#include "lduSolverPerformance.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
|
@ -93,181 +93,6 @@ class lduMatrix
|
|||
|
||||
public:
|
||||
|
||||
//- Class returned by the solver, containing performance statistics
|
||||
class solverPerformance
|
||||
{
|
||||
// Private Data
|
||||
|
||||
//- Name of solver
|
||||
word solverName_;
|
||||
|
||||
//- Name of field
|
||||
word fieldName_;
|
||||
|
||||
//- Initial residual
|
||||
scalar initialResidual_;
|
||||
|
||||
//- Final residual
|
||||
scalar finalResidual_;
|
||||
|
||||
//- Number of iterations
|
||||
label noIterations_;
|
||||
|
||||
//- Has the solver converged?
|
||||
bool converged_;
|
||||
|
||||
//- Has the solver indicated a singular matrix?
|
||||
bool singular_;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct null
|
||||
solverPerformance()
|
||||
:
|
||||
initialResidual_(0),
|
||||
finalResidual_(0),
|
||||
noIterations_(0),
|
||||
converged_(false),
|
||||
singular_(false)
|
||||
{}
|
||||
|
||||
|
||||
//- Construct from components
|
||||
solverPerformance
|
||||
(
|
||||
const word& solverName,
|
||||
const word& fieldName,
|
||||
const scalar iRes = 0,
|
||||
const scalar fRes = 0,
|
||||
const label nIter = 0,
|
||||
const bool converged = false,
|
||||
const bool singular = false
|
||||
)
|
||||
:
|
||||
solverName_(solverName),
|
||||
fieldName_(fieldName),
|
||||
initialResidual_(iRes),
|
||||
finalResidual_(fRes),
|
||||
noIterations_(nIter),
|
||||
converged_(converged),
|
||||
singular_(singular)
|
||||
{}
|
||||
|
||||
|
||||
// Member functions
|
||||
|
||||
//- Return solver name
|
||||
const word& solverName() const
|
||||
{
|
||||
return solverName_;
|
||||
}
|
||||
|
||||
//- Return access to solver name
|
||||
word& solverName()
|
||||
{
|
||||
return solverName_;
|
||||
}
|
||||
|
||||
//- Return field name
|
||||
const word& fieldName() const
|
||||
{
|
||||
return fieldName_;
|
||||
}
|
||||
|
||||
//- Return access to field name
|
||||
word& fieldName()
|
||||
{
|
||||
return fieldName_;
|
||||
}
|
||||
|
||||
//- Return initial residual
|
||||
scalar initialResidual() const
|
||||
{
|
||||
return initialResidual_;
|
||||
}
|
||||
|
||||
//- Return initial residual
|
||||
scalar& initialResidual()
|
||||
{
|
||||
return initialResidual_;
|
||||
}
|
||||
|
||||
|
||||
//- Return final residual
|
||||
scalar finalResidual() const
|
||||
{
|
||||
return finalResidual_;
|
||||
}
|
||||
|
||||
//- Return final residual
|
||||
scalar& finalResidual()
|
||||
{
|
||||
return finalResidual_;
|
||||
}
|
||||
|
||||
|
||||
//- Return number of iterations
|
||||
label nIterations() const
|
||||
{
|
||||
return noIterations_;
|
||||
}
|
||||
|
||||
//- Return number of iterations
|
||||
label& nIterations()
|
||||
{
|
||||
return noIterations_;
|
||||
}
|
||||
|
||||
|
||||
//- Has the solver converged?
|
||||
bool converged() const
|
||||
{
|
||||
return converged_;
|
||||
}
|
||||
|
||||
//- Is the matrix singular?
|
||||
bool singular() const
|
||||
{
|
||||
return singular_;
|
||||
}
|
||||
|
||||
//- Convergence test
|
||||
bool checkConvergence
|
||||
(
|
||||
const scalar tolerance,
|
||||
const scalar relTolerance
|
||||
);
|
||||
|
||||
//- Singularity test
|
||||
bool checkSingularity(const scalar residual);
|
||||
|
||||
//- Print summary of solver performance
|
||||
void print() const;
|
||||
|
||||
// Member Operators
|
||||
|
||||
bool operator!=(const solverPerformance&) const;
|
||||
|
||||
// Ostream Operator
|
||||
|
||||
friend Istream& operator>>
|
||||
(
|
||||
Istream&,
|
||||
solverPerformance&
|
||||
);
|
||||
|
||||
friend Ostream& operator<<
|
||||
(
|
||||
Ostream&,
|
||||
const solverPerformance&
|
||||
);
|
||||
|
||||
};
|
||||
|
||||
|
||||
//- Abstract base-class for lduMatrix solvers
|
||||
class solver
|
||||
{
|
||||
|
@ -322,10 +147,10 @@ public:
|
|||
}
|
||||
|
||||
//- Is the stop criterion reached
|
||||
bool stop(lduMatrix::solverPerformance& solverPerf) const;
|
||||
bool stop(lduSolverPerformance& solverPerf) const;
|
||||
|
||||
//- Is the converrgence criterion reached
|
||||
bool converged(lduMatrix::solverPerformance& solverPerf) const;
|
||||
bool converged(lduSolverPerformance& solverPerf) const;
|
||||
|
||||
//- Read the control parameters from the dictionary
|
||||
virtual void readControls();
|
||||
|
@ -491,7 +316,7 @@ public:
|
|||
//- Read and reset the solver parameters from the given stream
|
||||
virtual void read(const dictionary&);
|
||||
|
||||
virtual solverPerformance solve
|
||||
virtual lduSolverPerformance solve
|
||||
(
|
||||
scalarField& x,
|
||||
const scalarField& b,
|
||||
|
@ -1048,7 +873,6 @@ public:
|
|||
|
||||
// Helper typedefs
|
||||
typedef lduMatrix::solver lduSolver;
|
||||
typedef lduMatrix::solverPerformance lduSolverPerformance;
|
||||
typedef lduMatrix::preconditioner lduPreconditioner;
|
||||
typedef lduMatrix::smoother lduSmoother;
|
||||
|
||||
|
|
|
@ -207,7 +207,7 @@ Foam::scalar Foam::lduMatrix::solver::normFactor
|
|||
|
||||
bool Foam::lduMatrix::solver::stop
|
||||
(
|
||||
lduMatrix::solverPerformance& solverPerf
|
||||
lduSolverPerformance& solverPerf
|
||||
) const
|
||||
{
|
||||
if (solverPerf.nIterations() < minIter_)
|
||||
|
@ -221,7 +221,7 @@ bool Foam::lduMatrix::solver::stop
|
|||
|
||||
bool Foam::lduMatrix::solver::converged
|
||||
(
|
||||
lduMatrix::solverPerformance& solverPerf
|
||||
lduSolverPerformance& solverPerf
|
||||
) const
|
||||
{
|
||||
if
|
||||
|
|
|
@ -1,165 +0,0 @@
|
|||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | foam-extend: Open Source CFD
|
||||
\\ / O peration | Version: 3.2
|
||||
\\ / A nd | Web: http://www.foam-extend.org
|
||||
\\/ M anipulation | For copyright notice see file Copyright
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of foam-extend.
|
||||
|
||||
foam-extend is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation, either version 3 of the License, or (at your
|
||||
option) any later version.
|
||||
|
||||
foam-extend is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with foam-extend. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Description
|
||||
Convergence and singularity tests for solvers.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "lduMatrix.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
bool Foam::lduMatrix::solverPerformance::checkConvergence
|
||||
(
|
||||
const scalar Tolerance,
|
||||
const scalar RelTolerance
|
||||
)
|
||||
{
|
||||
if (debug >= 2)
|
||||
{
|
||||
Info<< solverName_
|
||||
<< ": Iteration " << noIterations_
|
||||
<< " residual = " << finalResidual_
|
||||
<< endl;
|
||||
}
|
||||
|
||||
if
|
||||
(
|
||||
finalResidual_ < Tolerance // Abs. tolerance
|
||||
|| (
|
||||
RelTolerance > SMALL
|
||||
&& finalResidual_ <= RelTolerance*initialResidual_ // Rel. tolerance
|
||||
)
|
||||
// || (solverName == "symSolve" && iter == 0)
|
||||
)
|
||||
{
|
||||
converged_ = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
converged_ = false;
|
||||
}
|
||||
|
||||
return converged_;
|
||||
}
|
||||
|
||||
|
||||
bool Foam::lduMatrix::solverPerformance::checkSingularity
|
||||
(
|
||||
const scalar residual
|
||||
)
|
||||
{
|
||||
if (residual > VSMALL)
|
||||
{
|
||||
singular_ = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
singular_ = true;
|
||||
}
|
||||
|
||||
return singular_;
|
||||
}
|
||||
|
||||
|
||||
void Foam::lduMatrix::solverPerformance::print() const
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
Info<< solverName_ << ": Solving for " << fieldName_;
|
||||
|
||||
if (singular())
|
||||
{
|
||||
Info<< ": solution singularity" << endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
Info<< ", Initial residual = " << initialResidual_
|
||||
<< ", Final residual = " << finalResidual_
|
||||
<< ", No Iterations " << noIterations_
|
||||
<< endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool Foam::lduSolverPerformance::operator!=
|
||||
(
|
||||
const lduSolverPerformance& sp
|
||||
) const
|
||||
{
|
||||
return
|
||||
(
|
||||
solverName() != sp.solverName()
|
||||
|| fieldName() != sp.fieldName()
|
||||
|| initialResidual() != sp.initialResidual()
|
||||
|| finalResidual() != sp.finalResidual()
|
||||
|| nIterations() != sp.nIterations()
|
||||
|| converged() != sp.converged()
|
||||
|| singular() != sp.singular()
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Foam::Istream& Foam::operator>>
|
||||
(
|
||||
Istream& is,
|
||||
lduSolverPerformance& sp
|
||||
)
|
||||
{
|
||||
is.readBeginList("SolverPerformance<Type>");
|
||||
is >> sp.solverName_
|
||||
>> sp.fieldName_
|
||||
>> sp.initialResidual_
|
||||
>> sp.finalResidual_
|
||||
>> sp.noIterations_
|
||||
>> sp.converged_
|
||||
>> sp.singular_;
|
||||
is.readEndList("SolverPerformance<Type>");
|
||||
|
||||
return is;
|
||||
}
|
||||
|
||||
|
||||
Foam::Ostream& Foam::operator<<
|
||||
(
|
||||
Ostream& os,
|
||||
const lduSolverPerformance& sp
|
||||
)
|
||||
{
|
||||
os << token::BEGIN_LIST
|
||||
<< sp.solverName_ << token::SPACE
|
||||
<< sp.fieldName_ << token::SPACE
|
||||
<< sp.initialResidual_ << token::SPACE
|
||||
<< sp.finalResidual_ << token::SPACE
|
||||
<< sp.noIterations_ << token::SPACE
|
||||
<< sp.converged_ << token::SPACE
|
||||
<< sp.singular_ << token::SPACE
|
||||
<< token::END_LIST;
|
||||
|
||||
return os;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
49
src/foam/matrices/lduMatrix/lduMatrix/lduSolverPerformance.H
Normal file
49
src/foam/matrices/lduMatrix/lduMatrix/lduSolverPerformance.H
Normal file
|
@ -0,0 +1,49 @@
|
|||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | foam-extend: Open Source CFD
|
||||
\\ / O peration | Version: 3.2
|
||||
\\ / A nd | Web: http://www.foam-extend.org
|
||||
\\/ M anipulation | For copyright notice see file Copyright
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of foam-extend.
|
||||
|
||||
foam-extend is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation, either version 3 of the License, or (at your
|
||||
option) any later version.
|
||||
|
||||
foam-extend is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with foam-extend. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Typedef
|
||||
Foam::lduSolverPerformance
|
||||
|
||||
Description
|
||||
BlockSolverPerformance instantiated for a scalar and lduMatrix
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef lduSolverPerformance_H
|
||||
#define lduSolverPerformance_H
|
||||
|
||||
#include "BlockSolverPerformance.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
typedef BlockSolverPerformance<scalar> lduSolverPerformance;
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
|
@ -30,7 +30,7 @@ License
|
|||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
Foam::lduMatrix::solverPerformance Foam::GAMGSolver::solve
|
||||
Foam::lduSolverPerformance Foam::GAMGSolver::solve
|
||||
(
|
||||
scalarField& x,
|
||||
const scalarField& b,
|
||||
|
|
|
@ -59,7 +59,7 @@ Foam::diagonalSolver::diagonalSolver
|
|||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::lduMatrix::solverPerformance Foam::diagonalSolver::solve
|
||||
Foam::lduSolverPerformance Foam::diagonalSolver::solve
|
||||
(
|
||||
scalarField& x,
|
||||
const scalarField& b,
|
||||
|
|
|
@ -146,7 +146,8 @@ Foam::solution::solution(const objectRegistry& obr, const fileName& dictName)
|
|||
eqnRelaxDict_(dictionary::null),
|
||||
fieldRelaxDefault_(0),
|
||||
eqnRelaxDefault_(0),
|
||||
solvers_(dictionary::null)
|
||||
solvers_(dictionary::null),
|
||||
prevTimeIndex_(0)
|
||||
{
|
||||
if (!headerOk())
|
||||
{
|
||||
|
@ -162,6 +163,8 @@ Foam::solution::solution(const objectRegistry& obr, const fileName& dictName)
|
|||
}
|
||||
|
||||
read(solutionDict());
|
||||
|
||||
set("solverPerformance", dictionary());
|
||||
}
|
||||
|
||||
|
||||
|
@ -408,5 +411,46 @@ bool Foam::solution::writeData(Ostream& os) const
|
|||
return true;
|
||||
}
|
||||
|
||||
const Foam::dictionary& Foam::solution::solverPerformanceDict() const
|
||||
{
|
||||
return subDict("solverPerformance");
|
||||
}
|
||||
|
||||
|
||||
void Foam::solution::setSolverPerformance
|
||||
(
|
||||
const word& name,
|
||||
const lduSolverPerformance& sp
|
||||
) const
|
||||
{
|
||||
dictionary& dict = const_cast<dictionary&>(solverPerformanceDict());
|
||||
|
||||
List<lduSolverPerformance> perfs;
|
||||
|
||||
if (prevTimeIndex_ != this->time().timeIndex())
|
||||
{
|
||||
// Reset solver performance between iterations
|
||||
prevTimeIndex_ = this->time().timeIndex();
|
||||
dict.clear();
|
||||
}
|
||||
else
|
||||
{
|
||||
dict.readIfPresent(name, perfs);
|
||||
}
|
||||
|
||||
// Append to list
|
||||
perfs.setSize(perfs.size()+1, sp);
|
||||
|
||||
dict.set(name, perfs);
|
||||
}
|
||||
|
||||
|
||||
void Foam::solution::setSolverPerformance
|
||||
(
|
||||
const lduSolverPerformance& sp
|
||||
) const
|
||||
{
|
||||
setSolverPerformance(sp.fieldName(), sp);
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
|
|
|
@ -37,6 +37,7 @@ SourceFiles
|
|||
|
||||
#include "IOdictionary.H"
|
||||
#include "debugSwitch.H"
|
||||
#include "lduSolverPerformance.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
|
@ -74,6 +75,9 @@ class solution
|
|||
//- Dictionary of solver parameters for all the fields
|
||||
dictionary solvers_;
|
||||
|
||||
//- Previously used time-index, used for reset between iterations
|
||||
mutable label prevTimeIndex_;
|
||||
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
|
@ -144,6 +148,24 @@ public:
|
|||
//- Return the solver controls dictionary for the given field
|
||||
const dictionary& solver(const word& name) const;
|
||||
|
||||
//- Return the dictionary of solver performance data
|
||||
// which includes initial and final residuals for convergence
|
||||
// checking
|
||||
const dictionary& solverPerformanceDict() const;
|
||||
|
||||
//- Add/set the solverPerformance entry for the named field
|
||||
void setSolverPerformance
|
||||
(
|
||||
const word& name,
|
||||
const lduSolverPerformance&
|
||||
) const;
|
||||
|
||||
//- Add/set the solverPerformance entry, using its fieldName
|
||||
void setSolverPerformance
|
||||
(
|
||||
const lduSolverPerformance&
|
||||
) const;
|
||||
|
||||
|
||||
// Edit
|
||||
|
||||
|
|
|
@ -1,99 +0,0 @@
|
|||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | foam-extend: Open Source CFD
|
||||
\\ / O peration | Version: 3.2
|
||||
\\ / A nd | Web: http://www.foam-extend.org
|
||||
\\/ M anipulation | For copyright notice see file Copyright
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of foam-extend.
|
||||
|
||||
foam-extend is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation, either version 3 of the License, or (at your
|
||||
option) any later version.
|
||||
|
||||
foam-extend is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with foam-extend. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "data.H"
|
||||
#include "foamTime.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
int Foam::data::debug(Foam::debug::debugSwitchFromDict("data", false));
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::data::data(const objectRegistry& obr)
|
||||
:
|
||||
IOdictionary
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"data",
|
||||
obr.time().system(),
|
||||
obr,
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
)
|
||||
),
|
||||
prevTimeIndex_(0)
|
||||
{
|
||||
set("solverPerformance", dictionary());
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
const Foam::dictionary& Foam::data::solverPerformanceDict() const
|
||||
{
|
||||
return subDict("solverPerformance");
|
||||
}
|
||||
|
||||
|
||||
void Foam::data::setSolverPerformance
|
||||
(
|
||||
const word& name,
|
||||
const lduSolverPerformance& sp
|
||||
) const
|
||||
{
|
||||
dictionary& dict = const_cast<dictionary&>(solverPerformanceDict());
|
||||
|
||||
List<lduSolverPerformance> perfs;
|
||||
|
||||
if (prevTimeIndex_ != this->time().timeIndex())
|
||||
{
|
||||
// Reset solver performance between iterations
|
||||
prevTimeIndex_ = this->time().timeIndex();
|
||||
dict.clear();
|
||||
}
|
||||
else
|
||||
{
|
||||
dict.readIfPresent(name, perfs);
|
||||
}
|
||||
|
||||
// Append to list
|
||||
perfs.setSize(perfs.size()+1, sp);
|
||||
|
||||
dict.set(name, perfs);
|
||||
}
|
||||
|
||||
|
||||
void Foam::data::setSolverPerformance
|
||||
(
|
||||
const lduSolverPerformance& sp
|
||||
) const
|
||||
{
|
||||
setSolverPerformance(sp.fieldName(), sp);
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
|
@ -1,116 +0,0 @@
|
|||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | foam-extend: Open Source CFD
|
||||
\\ / O peration | Version: 3.2
|
||||
\\ / A nd | Web: http://www.foam-extend.org
|
||||
\\/ M anipulation | For copyright notice see file Copyright
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of foam-extend.
|
||||
|
||||
foam-extend is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation, either version 3 of the License, or (at your
|
||||
option) any later version.
|
||||
|
||||
foam-extend is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with foam-extend. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
Foam::data
|
||||
|
||||
Description
|
||||
Database for solution data, solver performance and other reduced data.
|
||||
|
||||
fvMesh is derived from data so that all fields have access to the data from
|
||||
the mesh reference they hold.
|
||||
|
||||
SourceFiles
|
||||
data.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef data_H
|
||||
#define data_H
|
||||
|
||||
#include "IOdictionary.H"
|
||||
#include "lduMatrix.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class data Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class data
|
||||
:
|
||||
public IOdictionary
|
||||
{
|
||||
// Private data
|
||||
|
||||
//- Previously used time-index, used for reset between iterations
|
||||
mutable label prevTimeIndex_;
|
||||
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
//- Disallow default bitwise copy construct
|
||||
data(const data&);
|
||||
|
||||
//- Disallow default bitwise assignment
|
||||
void operator=(const data&);
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Debug switch
|
||||
static int debug;
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct for objectRegistry
|
||||
data(const objectRegistry& obr);
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
// Access
|
||||
|
||||
//- Return the dictionary of solver performance data
|
||||
// which includes initial and final residuals for convergence
|
||||
// checking
|
||||
const dictionary& solverPerformanceDict() const;
|
||||
|
||||
//- Add/set the solverPerformance entry for the named field
|
||||
void setSolverPerformance
|
||||
(
|
||||
const word& name,
|
||||
const lduSolverPerformance&
|
||||
) const;
|
||||
|
||||
//- Add/set the solverPerformance entry, using its fieldName
|
||||
void setSolverPerformance
|
||||
(
|
||||
const lduSolverPerformance&
|
||||
) const;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
|
@ -66,7 +66,6 @@ divSchemes
|
|||
laplacianSchemes { default Gauss linear corrected; }
|
||||
interpolationSchemes { default linear; }
|
||||
snGradSchemes { default corrected; }
|
||||
fluxRequired { default yes; }
|
||||
EOF
|
||||
}
|
||||
#
|
||||
|
|
|
@ -45,8 +45,4 @@ interpolationSchemes
|
|||
snGradSchemes
|
||||
{}
|
||||
|
||||
fluxRequired
|
||||
{}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
|
|
|
@ -72,12 +72,6 @@ snGradSchemes
|
|||
default limited 0.5;
|
||||
}
|
||||
|
||||
fluxRequired
|
||||
{
|
||||
default no;
|
||||
p;
|
||||
}
|
||||
|
||||
mixingPlane
|
||||
{
|
||||
default areaAveraging;
|
||||
|
@ -86,22 +80,4 @@ mixingPlane
|
|||
omega areaAveraging;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
|
|
|
@ -72,12 +72,6 @@ snGradSchemes
|
|||
default limited 0.5;
|
||||
}
|
||||
|
||||
fluxRequired
|
||||
{
|
||||
default no;
|
||||
p;
|
||||
}
|
||||
|
||||
mixingPlane
|
||||
{
|
||||
default areaAveraging;
|
||||
|
|
|
@ -52,11 +52,4 @@ snGradSchemes
|
|||
default corrected;
|
||||
}
|
||||
|
||||
fluxRequired
|
||||
{
|
||||
default no;
|
||||
p_rgh;
|
||||
p;
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
|
|
|
@ -46,9 +46,4 @@ snGradSchemes
|
|||
default uncorrected;
|
||||
}
|
||||
|
||||
fluxRequired
|
||||
{
|
||||
default no;
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
|
|
|
@ -49,10 +49,5 @@ snGradSchemes
|
|||
default corrected;
|
||||
}
|
||||
|
||||
fluxRequired
|
||||
{
|
||||
h;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
|
|
|
@ -50,9 +50,5 @@ snGradSchemes
|
|||
default corrected;
|
||||
}
|
||||
|
||||
fluxRequired
|
||||
{
|
||||
h;
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
|
|
|
@ -48,9 +48,4 @@ snGradSchemes
|
|||
default corrected;
|
||||
}
|
||||
|
||||
fluxRequired
|
||||
{
|
||||
p;
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
|
|
|
@ -48,9 +48,4 @@ snGradSchemes
|
|||
default corrected;
|
||||
}
|
||||
|
||||
fluxRequired
|
||||
{
|
||||
p;
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
|
|
|
@ -51,9 +51,4 @@ snGradSchemes
|
|||
default corrected;
|
||||
}
|
||||
|
||||
fluxRequired
|
||||
{
|
||||
p;
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
|
|
|
@ -50,11 +50,4 @@ snGradSchemes
|
|||
default corrected;
|
||||
}
|
||||
|
||||
fluxRequired
|
||||
{
|
||||
default no;
|
||||
pcorr;
|
||||
p;
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
|
|
|
@ -49,9 +49,5 @@ snGradSchemes
|
|||
default corrected;
|
||||
}
|
||||
|
||||
fluxRequired
|
||||
{
|
||||
default yes;
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
|
|
|
@ -49,9 +49,5 @@ snGradSchemes
|
|||
default corrected;
|
||||
}
|
||||
|
||||
fluxRequired
|
||||
{
|
||||
default yes;
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
|
|
|
@ -47,9 +47,4 @@ snGradSchemes
|
|||
default none;
|
||||
}
|
||||
|
||||
fluxRequired
|
||||
{
|
||||
p;
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
|
|
|
@ -44,8 +44,4 @@ snGradSchemes
|
|||
{
|
||||
}
|
||||
|
||||
fluxRequired
|
||||
{
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
|
|
|
@ -43,8 +43,4 @@ snGradSchemes
|
|||
{
|
||||
}
|
||||
|
||||
fluxRequired
|
||||
{
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
|
|
|
@ -48,8 +48,4 @@ snGradSchemes
|
|||
default none;
|
||||
}
|
||||
|
||||
fluxRequired
|
||||
{
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
|
|
|
@ -43,8 +43,4 @@ snGradSchemes
|
|||
{
|
||||
}
|
||||
|
||||
fluxRequired
|
||||
{
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
|
|
Reference in a new issue