ENH: support direct lookup of solver controls

OLD:
        pEqn.solve(mesh.solver(p.select(piso.finalInnerIter())));
        pEqn.solve(mesh.solver("Yi"));

    NEW:
        pEqn.solve(p.select(piso.finalInnerIter()));
        pEqn.solve("Yi");
This commit is contained in:
Mark Olesen 2023-11-23 16:25:38 +01:00
parent 30a7c22563
commit ef44df91f2
93 changed files with 295 additions and 154 deletions

View File

@ -118,7 +118,7 @@ int main(int argc, char *argv[])
fvm::laplacian(rAUf, p) == fvc::div(phiHbyA)
);
pEqn.solve(mesh.solver(p.select(piso.finalInnerIter())));
pEqn.solve(p.select(piso.finalInnerIter()));
phi = phiHbyA - pEqn.flux();

View File

@ -27,7 +27,7 @@ if (pimple.transonic())
betav*fvOptions(psi, p, rho.name())
);
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
pEqn.solve(p.select(pimple.finalInnerIter()));
if (pimple.finalNonOrthogonalIter())
{
@ -57,7 +57,7 @@ else
betav*fvOptions(psi, p, rho.name())
);
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
pEqn.solve(p.select(pimple.finalInnerIter()));
if (pimple.finalNonOrthogonalIter())
{

View File

@ -30,7 +30,7 @@ if (pimple.transonic())
fvOptions(psi, p, rho.name())
);
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
pEqn.solve(p.select(pimple.finalInnerIter()));
if (pimple.finalNonOrthogonalIter())
{
@ -66,7 +66,7 @@ else
fvOptions(psi, p, rho.name())
);
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
pEqn.solve(p.select(pimple.finalInnerIter()));
if (pimple.finalNonOrthogonalIter())
{

View File

@ -35,7 +35,7 @@ if (pimple.transonic())
fvOptions(psi, p, rho.name())
);
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
pEqn.solve(p.select(pimple.finalInnerIter()));
if (pimple.finalNonOrthogonalIter())
{
@ -71,7 +71,7 @@ else
fvOptions(psi, p, rho.name())
);
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
pEqn.solve(p.select(pimple.finalInnerIter()));
if (pimple.finalNonOrthogonalIter())
{

View File

@ -29,7 +29,7 @@ if (pimple.transonic())
fvOptions(psi, p, rho.name())
);
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
pEqn.solve(p.select(pimple.finalInnerIter()));
if (pimple.finalNonOrthogonalIter())
{
@ -64,7 +64,7 @@ else
fvOptions(psi, p, rho.name())
);
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
pEqn.solve(p.select(pimple.finalInnerIter()));
if (pimple.finalNonOrthogonalIter())
{

View File

@ -6,7 +6,7 @@
solve
(
fvm::ddt(rho, Yi) - chemistry.RR(specieI),
mesh.solver("Yi")
"Yi"
);
}
}

View File

@ -35,7 +35,7 @@ tmp<fv::convectionScheme<scalar>> mvConvection
fvOptions.constrain(YiEqn);
YiEqn.solve(mesh.solver("Yi"));
YiEqn.solve("Yi");
fvOptions.correct(Yi);

View File

@ -36,7 +36,7 @@ while (pimple.correctNonOrthogonal())
+ fvOptions(psi, p_rgh, rho.name())
);
p_rghEqn.solve(mesh.solver(p_rgh.select(pimple.finalInnerIter())));
p_rghEqn.solve(p_rgh.select(pimple.finalInnerIter()));
if (pimple.finalNonOrthogonalIter())
{

View File

@ -34,7 +34,7 @@ tmp<fv::convectionScheme<scalar>> mvConvection
fvOptions.constrain(YiEqn);
YiEqn.solve(mesh.solver("Yi"));
YiEqn.solve("Yi");
fvOptions.correct(Yi);

View File

@ -37,7 +37,7 @@ if (pimple.transonic())
fvOptions(psi, p, rho.name())
);
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
pEqn.solve(p.select(pimple.finalInnerIter()));
if (pimple.finalNonOrthogonalIter())
{
@ -72,7 +72,7 @@ else
fvOptions(psi, p, rho.name())
);
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
pEqn.solve(p.select(pimple.finalInnerIter()));
if (pimple.finalNonOrthogonalIter())
{

View File

@ -49,7 +49,7 @@ if (pimple.transonic())
fvOptions(psi, p, rho.name())
);
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
pEqn.solve(p.select(pimple.finalInnerIter()));
if (pimple.finalNonOrthogonalIter())
{
@ -89,7 +89,7 @@ else
fvOptions(psi, p, rho.name())
);
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
pEqn.solve(p.select(pimple.finalInnerIter()));
if (pimple.finalNonOrthogonalIter())
{

View File

@ -41,7 +41,7 @@ while (pimple.correctNonOrthogonal())
- fvm::laplacian(rhorAUf, p_rgh)
);
p_rghEqn.solve(mesh.solver(p_rgh.select(pimple.finalInnerIter())));
p_rghEqn.solve(p_rgh.select(pimple.finalInnerIter()));
if (pimple.finalNonOrthogonalIter())
{

View File

@ -63,7 +63,7 @@
fvOptions(psi, p, rho.name())
);
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
pEqn.solve(p.select(pimple.finalInnerIter()));
// Rhie & Chow interpolation (part 2)
if (pimple.finalNonOrthogonalIter())

View File

@ -72,7 +72,7 @@ if (mesh.changing())
divrhoU()
);
pcorrEqn.solve(mesh.solver(pcorr.select(pimple.finalInnerIter())));
pcorrEqn.solve(pcorr.select(pimple.finalInnerIter()));
//Bypass virtual layer
//mesh.fvMesh::solve(pcorrEqn, d);

View File

@ -56,7 +56,7 @@ if (pimple.transonic())
// Relax the pressure equation to ensure diagonal-dominance
pEqn.relax();
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
pEqn.solve(p.select(pimple.finalInnerIter()));
if (pimple.finalNonOrthogonalIter())
{
@ -78,7 +78,7 @@ else
{
fvScalarMatrix pEqn(pDDtEqn - fvm::laplacian(rhorAUf, p));
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
pEqn.solve(p.select(pimple.finalInnerIter()));
if (pimple.finalNonOrthogonalIter())
{

View File

@ -54,7 +54,7 @@ if (pimple.transonic())
// Relax the pressure equation to ensure diagonal-dominance
pEqn.relax();
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
pEqn.solve(p.select(pimple.finalInnerIter()));
if (pimple.finalNonOrthogonalIter())
{
@ -76,7 +76,7 @@ else
{
fvScalarMatrix pEqn(pDDtEqn - fvm::laplacian(rhorAUf, p));
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
pEqn.solve(p.select(pimple.finalInnerIter()));
if (pimple.finalNonOrthogonalIter())
{

View File

@ -65,7 +65,7 @@ if (pimple.transonic())
// Relax the pressure equation to ensure diagonal-dominance
pEqn.relax();
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
pEqn.solve(p.select(pimple.finalInnerIter()));
if (pimple.finalNonOrthogonalIter())
{
@ -90,7 +90,7 @@ else
{
fvScalarMatrix pEqn(pDDtEqn - fvm::laplacian(rhorAtU, p));
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
pEqn.solve(p.select(pimple.finalInnerIter()));
if (pimple.finalNonOrthogonalIter())
{

View File

@ -127,7 +127,7 @@ int main(int argc, char *argv[])
);
pEqn.setReference(pRefCell, pRefValue);
pEqn.solve(mesh.solver(p.select(piso.finalInnerIter())));
pEqn.solve(p.select(piso.finalInnerIter()));
if (piso.finalNonOrthogonalIter())
{
@ -167,7 +167,7 @@ int main(int argc, char *argv[])
fvm::laplacian(rABf, pB) == fvc::div(phiB)
);
pBEqn.solve(mesh.solver(pB.select(bpiso.finalInnerIter())));
pBEqn.solve(pB.select(bpiso.finalInnerIter()));
if (bpiso.finalNonOrthogonalIter())
{

View File

@ -27,7 +27,7 @@
p_rghEqn.setReference(pRefCell, getRefCellValue(p_rgh, pRefCell));
p_rghEqn.solve(mesh.solver(p_rgh.select(pimple.finalInnerIter())));
p_rghEqn.solve(p_rgh.select(pimple.finalInnerIter()));
if (pimple.finalNonOrthogonalIter())
{

View File

@ -72,7 +72,7 @@ if (mesh.changing())
divrhoU()
);
//pcorrEqn.solve(mesh.solver(pcorr.select(pimple.finalInnerIter())));
//pcorrEqn.solve(pcorr.select(pimple.finalInnerIter()));
//Bypass virtual layer
const dictionary& d = mesh.solver
(

View File

@ -50,7 +50,7 @@ while (pimple.correctNonOrthogonal())
- fvm::laplacian(rhorAUf, p_rgh)
);
p_rghEqn.solve(mesh.solver(p_rgh.select(pimple.finalInnerIter())));
p_rghEqn.solve(p_rgh.select(pimple.finalInnerIter()));
if (pimple.finalNonOrthogonalIter())
{

View File

@ -52,7 +52,7 @@ while (pimple.correctNonOrthogonal())
compressible ? getRefCellValue(p_rgh, pRefCell) : pRefValue
);
p_rghEqn.solve(mesh.solver(p_rgh.select(pimple.finalInnerIter())));
p_rghEqn.solve(p_rgh.select(pimple.finalInnerIter()));
if (pimple.finalNonOrthogonalIter())
{

View File

@ -22,7 +22,7 @@ if (finalIter)
fvOptions.constrain(hEqn);
hEqn.solve(mesh.solver(h.select(finalIter)));
hEqn.solve(h.select(finalIter));
fvOptions.correct(h);
}

View File

@ -33,7 +33,7 @@
}
else
{
EEqn.solve(mesh.solver(he.select(finalIter)));
EEqn.solve(he.select(finalIter));
fvOptions.correct(he);
thermo.correct();

View File

@ -28,7 +28,7 @@
- fvc::snGrad(p_rgh)
)*mesh.magSf()
),
mesh.solver(U.select(finalIter))
U.select(finalIter)
);
fvOptions.correct(U);

View File

@ -44,7 +44,7 @@ if (Y.size())
fvOptions.constrain(YiEqn);
YiEqn.solve(mesh.solver("Yi"));
YiEqn.solve("Yi");
fvOptions.correct(Yi);

View File

@ -52,15 +52,12 @@ constrainPressure(p_rgh, rho, U, phiHbyA, rhorAUf, MRF);
p_rghEqn.solve
(
mesh.solver
p_rgh.select
(
p_rgh.select
(
(
oCorr == nOuterCorr-1
&& corr == nCorr-1
&& nonOrth == nNonOrthCorr
)
oCorr == nOuterCorr-1
&& corr == nCorr-1
&& nonOrth == nNonOrthCorr
)
)
);

View File

@ -28,7 +28,7 @@
mesh.data().setFinalIteration(true);
}
hEqn.solve(mesh.solver(h.select(finalIter)));
hEqn.solve(h.select(finalIter));
fvOptions.correct(h);

View File

@ -141,7 +141,7 @@ int main(int argc, char *argv[])
pEqn.setReference(pRefCell, pRefValue);
pEqn.solve(mesh.solver(p.select(piso.finalInnerIter())));
pEqn.solve(p.select(piso.finalInnerIter()));
if (piso.finalNonOrthogonalIter())
{

View File

@ -114,7 +114,7 @@ int main(int argc, char *argv[])
pEqn.setReference(pRefCell, pRefValue);
pEqn.solve(mesh.solver(p.select(piso.finalInnerIter())));
pEqn.solve(p.select(piso.finalInnerIter()));
if (piso.finalNonOrthogonalIter())
{

View File

@ -40,7 +40,7 @@ while (pimple.correctNonOrthogonal())
pEqn.setReference(pRefCell, pRefValue);
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
pEqn.solve(p.select(pimple.finalInnerIter()));
if (pimple.finalNonOrthogonalIter())
{

View File

@ -32,7 +32,7 @@ while (pimple.correctNonOrthogonal())
pEqn.setReference(pRefCell, pRefValue);
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
pEqn.solve(p.select(pimple.finalInnerIter()));
if (pimple.finalNonOrthogonalIter())
{

View File

@ -45,7 +45,7 @@ while (pimple.correctNonOrthogonal())
pEqn.setReference(pRefCell, pRefValue);
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
pEqn.solve(p.select(pimple.finalInnerIter()));
if (pimple.finalNonOrthogonalIter())
{

View File

@ -26,7 +26,7 @@ while (piso.correctNonOrthogonal())
pEqn.setReference(pRefCell, pRefValue);
pEqn.solve(mesh.solver(p.select(piso.finalInnerIter())));
pEqn.solve(p.select(piso.finalInnerIter()));
if (piso.finalNonOrthogonalIter())
{

View File

@ -135,7 +135,7 @@ int main(int argc, char *argv[])
- fvm::laplacian(ghrAUf, h)
);
hEqn.solve(mesh.solver(h.select(pimple.finalInnerIter())));
hEqn.solve(h.select(pimple.finalInnerIter()));
if (pimple.finalNonOrthogonalIter())
{

View File

@ -34,7 +34,7 @@
pEqn.setReference(pRefCell, pRefValue);
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
pEqn.solve(p.select(pimple.finalInnerIter()));
if (pimple.finalNonOrthogonalIter())
{

View File

@ -32,7 +32,7 @@
pEqn.setReference(pRefCell, pRefValue);
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
pEqn.solve(p.select(pimple.finalInnerIter()));
if (pimple.finalNonOrthogonalIter())
{

View File

@ -36,7 +36,7 @@ tmp<fv::convectionScheme<scalar>> mvConvection
fvOptions.constrain(YiEqn);
YiEqn.solve(mesh.solver("Yi"));
YiEqn.solve("Yi");
fvOptions.correct(Yi);

View File

@ -33,7 +33,7 @@ if (pimple.transonic())
+ fvOptions(psi, p, rho.name())
);
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
pEqn.solve(p.select(pimple.finalInnerIter()));
if (pimple.finalNonOrthogonalIter())
{
@ -69,7 +69,7 @@ else
+ fvOptions(psi, p, rho.name())
);
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
pEqn.solve(p.select(pimple.finalInnerIter()));
if (pimple.finalNonOrthogonalIter())
{

View File

@ -34,7 +34,7 @@ while (pimple.correctNonOrthogonal())
pEqn.setReference(pRefCell, pRefValue);
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
pEqn.solve(p.select(pimple.finalInnerIter()));
if (pimple.finalNonOrthogonalIter())
{

View File

@ -37,7 +37,7 @@ tmp<fv::convectionScheme<scalar>> mvConvection
fvOptions.constrain(YEqn);
YEqn.solve(mesh.solver("Yi"));
YEqn.solve("Yi");
fvOptions.correct(Yi);

View File

@ -47,7 +47,7 @@ while (pimple.correctNonOrthogonal())
- fvm::laplacian(rhorAUf, p_rgh)
);
p_rghEqn.solve(mesh.solver(p_rgh.select(pimple.finalInnerIter())));
p_rghEqn.solve(p_rgh.select(pimple.finalInnerIter()));
if (pimple.finalNonOrthogonalIter())
{

View File

@ -34,7 +34,7 @@ tmp<fv::convectionScheme<scalar>> mvConvection
fvOptions.constrain(YEqn);
YEqn.solve(mesh.solver("Yi"));
YEqn.solve("Yi");
fvOptions.correct(Yi);

View File

@ -34,7 +34,7 @@ tmp<fv::convectionScheme<scalar>> mvConvection
fvOptions.constrain(YEqn);
YEqn.solve(mesh.solver("Yi"));
YEqn.solve("Yi");
fvOptions.correct(Yi);

View File

@ -35,7 +35,7 @@ tmp<fv::convectionScheme<scalar>> mvConvection
fvOptions.constrain(YEqn);
YEqn.solve(mesh.solver("Yi"));
YEqn.solve("Yi");
fvOptions.correct(Yi);

View File

@ -41,7 +41,7 @@ if (pimple.transonic())
+ fvOptions(psi, p, rho.name())
);
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
pEqn.solve(p.select(pimple.finalInnerIter()));
if (pimple.finalNonOrthogonalIter())
{
@ -77,7 +77,7 @@ else
+ fvOptions(psi, p, rho.name())
);
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
pEqn.solve(p.select(pimple.finalInnerIter()));
if (pimple.finalNonOrthogonalIter())
{

View File

@ -42,7 +42,7 @@ if (pimple.transonic())
+ fvOptions(psi, p, rho.name())
);
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
pEqn.solve(p.select(pimple.finalInnerIter()));
if (pimple.finalNonOrthogonalIter())
{
@ -77,7 +77,7 @@ else
+ fvOptions(psi, p, rho.name())
);
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
pEqn.solve(p.select(pimple.finalInnerIter()));
if (pimple.finalNonOrthogonalIter())
{

View File

@ -38,7 +38,7 @@
p_rghEqn.setReference(pRefCell, getRefCellValue(p_rgh, pRefCell));
p_rghEqn.solve(mesh.solver(p_rgh.select(pimple.finalInnerIter())));
p_rghEqn.solve(p_rgh.select(pimple.finalInnerIter()));
if (pimple.finalNonOrthogonalIter())
{

View File

@ -36,7 +36,7 @@
- fvm::laplacian(rhorAUf, p)
);
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
pEqn.solve(p.select(pimple.finalInnerIter()));
if (pimple.finalNonOrthogonalIter())
{

View File

@ -33,7 +33,7 @@
- fvm::laplacian(rhorAUf, p)
);
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
pEqn.solve(p.select(pimple.finalInnerIter()));
if (pimple.finalNonOrthogonalIter())
{

View File

@ -99,7 +99,7 @@
+ (max(alpha2, scalar(0))/rho2)*p_rghEqnComp2()
)
+ p_rghEqnIncomp,
mesh.solver(p_rgh.select(pimple.finalInnerIter()))
p_rgh.select(pimple.finalInnerIter())
);
if (pimple.finalNonOrthogonalIter())

View File

@ -108,7 +108,7 @@
solve
(
p_rghEqnComp1() + p_rghEqnComp2() + p_rghEqnIncomp,
mesh.solver(p_rgh.select(pimple.finalInnerIter()))
p_rgh.select(pimple.finalInnerIter())
);
if (pimple.finalNonOrthogonalIter())

View File

@ -124,7 +124,7 @@
solve
(
p_rghEqnComp1() + p_rghEqnComp2() + p_rghEqnIncomp,
mesh.solver(p_rgh.select(pimple.finalInnerIter()))
p_rgh.select(pimple.finalInnerIter())
);
if (pimple.finalNonOrthogonalIter())

View File

@ -110,7 +110,7 @@
solve
(
p_rghEqnComp1() + p_rghEqnComp2() + p_rghEqnIncomp,
mesh.solver(p_rgh.select(pimple.finalInnerIter()))
p_rgh.select(pimple.finalInnerIter())
);
if (pimple.finalNonOrthogonalIter())

View File

@ -108,7 +108,7 @@
solve
(
p_rghEqnComp1() + p_rghEqnComp2() + p_rghEqnIncomp,
mesh.solver(p_rgh.select(pimple.finalInnerIter()))
p_rgh.select(pimple.finalInnerIter())
);
if (pimple.finalNonOrthogonalIter())

View File

@ -80,7 +80,7 @@
(
p_rghEqnComp
+ p_rghEqnIncomp,
mesh.solver(p_rgh.select(pimple.finalInnerIter()))
p_rgh.select(pimple.finalInnerIter())
);
if (pimple.finalNonOrthogonalIter())

View File

@ -54,7 +54,7 @@
- fvm::laplacian(turbulence->nut(), alpha1)
);
alpha1Eqn.solve(mesh.solver("alpha1Diffusion"));
alpha1Eqn.solve("alpha1Diffusion");
alphaPhi += alpha1Eqn.flux();
alpha2 = 1.0 - alpha1;

View File

@ -32,7 +32,7 @@
p_rghEqn.setReference(pRefCell, getRefCellValue(p_rgh, pRefCell));
p_rghEqn.solve(mesh.solver(p_rgh.select(pimple.finalInnerIter())));
p_rghEqn.solve(p_rgh.select(pimple.finalInnerIter()));
if (pimple.finalNonOrthogonalIter())
{

View File

@ -56,7 +56,7 @@
p_rghEqn.setReference(pRefCell, pRefValue);
p_rghEqn.solve(mesh.solver(p_rgh.select(pimple.finalInnerIter())));
p_rghEqn.solve(p_rgh.select(pimple.finalInnerIter()));
if (pimple.finalNonOrthogonalIter())
{

View File

@ -39,7 +39,7 @@
p_rghEqn.setReference(pRefCell, pRefValue);
p_rghEqn.solve(mesh.solver(p_rgh.select(pimple.finalInnerIter())));
p_rghEqn.solve(p_rgh.select(pimple.finalInnerIter()));
if (pimple.finalNonOrthogonalIter())
{

View File

@ -40,7 +40,7 @@
p_rghEqn.setReference(pRefCell, getRefCellValue(p_rgh, pRefCell));
p_rghEqn.solve(mesh.solver(p_rgh.select(pimple.finalInnerIter())));
p_rghEqn.solve(p_rgh.select(pimple.finalInnerIter()));
if (pimple.finalNonOrthogonalIter())
{

View File

@ -47,7 +47,7 @@
p_rghEqn.setReference(pRefCell, getRefCellValue(p_rgh, pRefCell));
p_rghEqn.solve(mesh.solver(p_rgh.select(pimple.finalInnerIter())));
p_rghEqn.solve(p_rgh.select(pimple.finalInnerIter()));
if (pimple.finalNonOrthogonalIter())
{

View File

@ -44,7 +44,7 @@
p_rghEqn.setReference(pRefCell, pRefValue);
p_rghEqn.solve(mesh.solver(p_rgh.select(pimple.finalInnerIter())));
p_rghEqn.solve(p_rgh.select(pimple.finalInnerIter()));
if (pimple.finalNonOrthogonalIter())
{

View File

@ -45,7 +45,7 @@
//p_rghEqn.setReference(pRefCell, pRefValue);
p_rghEqn.setReference(pRefCell, getRefCellValue(p_rgh, pRefCell));
p_rghEqn.solve(mesh.solver(p_rgh.select(pimple.finalInnerIter())));
p_rghEqn.solve(p_rgh.select(pimple.finalInnerIter()));
if (pimple.finalNonOrthogonalIter())
{

View File

@ -38,7 +38,7 @@
p_rghEqn.setReference(pRefCell, pRefValue);
p_rghEqn.solve(mesh.solver(p_rgh.select(pimple.finalInnerIter())));
p_rghEqn.solve(p_rgh.select(pimple.finalInnerIter()));
if (pimple.finalNonOrthogonalIter())
{

View File

@ -223,7 +223,7 @@
// + (alpha2/rho2)*pEqnComp2()
// ) +
pEqnIncomp,
mesh.solver(p_rgh.select(pimple.finalInnerIter()))
p_rgh.select(pimple.finalInnerIter())
);
if (pimple.finalNonOrthogonalIter())

View File

@ -30,7 +30,7 @@ while (pimple.correctNonOrthogonal())
p_ghEqn.setReference(p_ghRefCell, p_ghRefValue);
p_ghEqn.solve(mesh.solver(p_gh.select(pimple.finalInnerIter())));
p_ghEqn.solve(p_gh.select(pimple.finalInnerIter()));
if (pimple.finalNonOrthogonalIter())
{

View File

@ -37,7 +37,7 @@
p_ghEqn.setReference(p_ghRefCell, p_ghRefValue);
p_ghEqn.solve(mesh.solver(p_gh.select(pimple.finalInnerIter())));
p_ghEqn.solve(p_gh.select(pimple.finalInnerIter()));
if (pimple.finalNonOrthogonalIter())
{

View File

@ -24,7 +24,7 @@
);
YiEqn.relax();
YiEqn.solve(mesh.solver("Yi"));
YiEqn.solve("Yi");
}
}
}

View File

@ -370,11 +370,7 @@ while (pimple.correct())
}
}
solve
(
pEqn,
mesh.solver(p_rgh.select(pimple.finalInnerIter()))
);
pEqn.solve(p_rgh.select(pimple.finalInnerIter()));
}
// Correct fluxes and velocities on last non-orthogonal iteration

View File

@ -358,11 +358,7 @@ while (pimple.correct())
}
}
solve
(
pEqn,
mesh.solver(p_rgh.select(pimple.finalInnerIter()))
);
pEqn.solve(p_rgh.select(pimple.finalInnerIter()));
}
// Correct fluxes and velocities on last non-orthogonal iteration

View File

@ -20,7 +20,7 @@
);
Y1iEqn.relax();
Y1iEqn.solve(mesh.solver("Yi"));
Y1iEqn.solve("Yi");
}
}
@ -39,7 +39,7 @@
);
Y2iEqn.relax();
Y2iEqn.solve(mesh.solver("Yi"));
Y2iEqn.solve("Yi");
}
}
}

View File

@ -341,11 +341,7 @@ while (pimple.correct())
pEqn += pEqnComp2();
}
solve
(
pEqn,
mesh.solver(p_rgh.select(pimple.finalInnerIter()))
);
pEqn.solve(p_rgh.select(pimple.finalInnerIter()));
}
if (pimple.finalNonOrthogonalIter())

View File

@ -29,7 +29,7 @@
p_rghEqn.setReference(pRefCell, getRefCellValue(p_rgh, pRefCell));
p_rghEqn.solve(mesh.solver(p_rgh.select(pimple.finalInnerIter())));
p_rghEqn.solve(p_rgh.select(pimple.finalInnerIter()));
if (pimple.finalNonOrthogonalIter())
{

View File

@ -312,7 +312,7 @@ while (pimple.correct())
solve
(
pEqnComp1() + pEqnComp2() + pEqnIncomp,
mesh.solver(p_rgh.select(pimple.finalInnerIter()))
p_rgh.select(pimple.finalInnerIter())
);
// Correct fluxes and velocities on last non-orthogonal iteration

View File

@ -291,7 +291,7 @@ while (pimple.correct())
solve
(
pEqnComp1() + pEqnComp2() + pEqnIncomp,
mesh.solver(p_rgh.select(pimple.finalInnerIter()))
p_rgh.select(pimple.finalInnerIter())
);
if (pimple.finalNonOrthogonalIter())

View File

@ -743,6 +743,26 @@ Foam::faMatrix<Type>::flux() const
}
template<class Type>
const Foam::dictionary& Foam::faMatrix<Type>::solverDict
(
const word& name
) const
{
return psi_.mesh().solverDict(name);
}
template<class Type>
const Foam::dictionary& Foam::faMatrix<Type>::solverDict() const
{
return psi_.mesh().solverDict
(
psi_.name()
);
}
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
template<class Type>
@ -1110,11 +1130,11 @@ void Foam::checkMethod
template<class Type>
Foam::SolverPerformance<Type> Foam::solve
(
faMatrix<Type>& fam,
faMatrix<Type>& mat,
const dictionary& solverControls
)
{
return fam.solve(solverControls);
return mat.solve(solverControls);
}
@ -1134,9 +1154,35 @@ Foam::SolverPerformance<Type> Foam::solve
template<class Type>
Foam::SolverPerformance<Type> Foam::solve(faMatrix<Type>& fam)
Foam::SolverPerformance<Type> Foam::solve
(
faMatrix<Type>& mat,
const word& name
)
{
return fam.solve();
return mat.solve(name);
}
template<class Type>
Foam::SolverPerformance<Type> Foam::solve
(
const tmp<faMatrix<Type>>& tmat,
const word& name
)
{
SolverPerformance<Type> solverPerf(tmat.constCast().solve(name));
tmat.clear();
return solverPerf;
}
template<class Type>
Foam::SolverPerformance<Type> Foam::solve(faMatrix<Type>& mat)
{
return mat.solve();
}

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2016-2017 Wikki Ltd
Copyright (C) 2020-2022 OpenCFD Ltd.
Copyright (C) 2020-2023 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -448,6 +448,10 @@ public:
// Use the given solver controls
SolverPerformance<Type> solve(const dictionary&);
//- Solve returning the solution statistics.
// Uses \p name solver controls from faSolution
SolverPerformance<Type> solve(const word& name);
//- Solve returning the solution statistics.
// Solver controls read from faSolution
SolverPerformance<Type> solve();
@ -467,6 +471,12 @@ public:
//- Return the face-flux field from the matrix
tmp<GeometricField<Type, faePatchField, edgeMesh>> flux() const;
//- Return the solver dictionary (from faSolution) for \p name
const dictionary& solverDict(const word& name) const;
//- Return the solver dictionary for psi
const dictionary& solverDict() const;
// Member Operators
@ -578,27 +588,45 @@ void checkMethod
//- Solve returning the solution statistics given convergence tolerance
// Use the given solver controls
// Use the given solver controls
template<class Type>
SolverPerformance<Type> solve(faMatrix<Type>&, const dictionary&);
SolverPerformance<Type> solve
(
faMatrix<Type>&,
const dictionary& solverControls
);
//- Solve returning the solution statistics given convergence tolerance,
//- deleting temporary matrix after solution.
// Use the given solver controls
// Use the given solver controls
template<class Type>
SolverPerformance<Type> solve(const tmp<faMatrix<Type>>&, const dictionary&);
SolverPerformance<Type> solve
(
const tmp<faMatrix<Type>>&,
const dictionary& solverControls
);
//- Solve returning the solution statistics given convergence tolerance
// Solver controls read faSolution
// Uses \p name solver controls from faSolution
template<class Type>
SolverPerformance<Type> solve(faMatrix<Type>&);
SolverPerformance<Type> solve(faMatrix<Type>&, const word& name);
//- Solve returning the solution statistics given convergence tolerance,
//- deleting temporary matrix after solution.
// Solver controls read faSolution
// Uses \p name solver controls from faSolution
template<class Type>
SolverPerformance<Type> solve(const tmp<faMatrix<Type>>&, const word& name);
//- Solve returning the solution statistics given convergence tolerance
// Uses solver controls from faSolution
template<class Type>
SolverPerformance<Type> solve(faMatrix<Type>&);
//- Solve returning the solution statistics given convergence tolerance,
//- deleting temporary matrix after solution.
// Uses solver controls from faSolution
template<class Type>
SolverPerformance<Type> solve(const tmp<faMatrix<Type>>&);

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2016-2017 Wikki Ltd
Copyright (C) 2019-2021 OpenCFD Ltd.
Copyright (C) 2019-2023 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -171,14 +171,21 @@ Foam::SolverPerformance<Type> Foam::faMatrix<Type>::solve
template<class Type>
Foam::SolverPerformance<Type> Foam::faMatrix<Type>::faSolver::solve()
{
return solve(faMat_.psi().mesh().solverDict(faMat_.psi().name()));
return solve(faMat_.solverDict());
}
template<class Type>
Foam::SolverPerformance<Type> Foam::faMatrix<Type>::solve(const word& name)
{
return this->solve(solverDict(name));
}
template<class Type>
Foam::SolverPerformance<Type> Foam::faMatrix<Type>::solve()
{
return solve(this->psi().mesh().solverDict(this->psi().name()));
return this->solve(solverDict());
}

View File

@ -107,7 +107,7 @@ void Foam::CorrectPhi
pcorrEqn.solve
(
mesh.solver(pcorr.select(pimple.finalNonOrthogonalIter()))
pcorr.select(pimple.finalNonOrthogonalIter())
);
if (pimple.finalNonOrthogonalIter())
@ -182,7 +182,7 @@ void Foam::CorrectPhi
pcorrEqn.solve
(
mesh.solver(pcorr.select(pimple.finalNonOrthogonalIter()))
pcorr.select(pimple.finalNonOrthogonalIter())
);
if (pimple.finalNonOrthogonalIter())

View File

@ -1528,6 +1528,16 @@ flux() const
}
template<class Type>
const Foam::dictionary& Foam::fvMatrix<Type>::solverDict
(
const word& name
) const
{
return psi_.mesh().solverDict(name);
}
template<class Type>
const Foam::dictionary& Foam::fvMatrix<Type>::solverDict() const
{
@ -1918,11 +1928,11 @@ void Foam::checkMethod
template<class Type>
Foam::SolverPerformance<Type> Foam::solve
(
fvMatrix<Type>& fvm,
fvMatrix<Type>& mat,
const dictionary& solverControls
)
{
return fvm.solve(solverControls);
return mat.solve(solverControls);
}
template<class Type>
@ -1941,9 +1951,34 @@ Foam::SolverPerformance<Type> Foam::solve
template<class Type>
Foam::SolverPerformance<Type> Foam::solve(fvMatrix<Type>& fvm)
Foam::SolverPerformance<Type> Foam::solve
(
fvMatrix<Type>& mat,
const word& name
)
{
return fvm.solve();
return mat.solve(name);
}
template<class Type>
Foam::SolverPerformance<Type> Foam::solve
(
const tmp<fvMatrix<Type>>& tmat,
const word& name
)
{
SolverPerformance<Type> solverPerf(tmat.constCast().solve(name));
tmat.clear();
return solverPerf;
}
template<class Type>
Foam::SolverPerformance<Type> Foam::solve(fvMatrix<Type>& mat)
{
return mat.solve();
}
template<class Type>

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2016-2022 OpenCFD Ltd.
Copyright (C) 2016-2023 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -603,6 +603,10 @@ public:
// Use the given solver controls
SolverPerformance<Type> solveSegregatedOrCoupled(const dictionary&);
//- Solve segregated or coupled returning the solution statistics.
// Solver controls read from fvSolution
SolverPerformance<Type> solveSegregatedOrCoupled();
//- Solve segregated returning the solution statistics.
// Use the given solver controls
SolverPerformance<Type> solveSegregated(const dictionary&);
@ -615,6 +619,10 @@ public:
// Use the given solver controls
SolverPerformance<Type> solve(const dictionary&);
//- Solve returning the solution statistics.
// Uses \p name solver controls from fvSolution
SolverPerformance<Type> solve(const word& name);
//- Solve returning the solution statistics.
// Solver controls read from fvSolution
SolverPerformance<Type> solve();
@ -641,7 +649,11 @@ public:
tmp<GeometricField<Type, fvsPatchField, surfaceMesh>>
flux() const;
//- Return the solver dictionary taking into account finalIteration
//- Return the solver dictionary (from fvSolution) for \p name
const dictionary& solverDict(const word& name) const;
//- Return the solver dictionary for psi,
//- taking into account finalIteration
const dictionary& solverDict() const;
@ -757,8 +769,11 @@ void checkMethod
//- Solve returning the solution statistics given convergence tolerance
// Use the given solver controls
template<class Type>
SolverPerformance<Type> solve(fvMatrix<Type>&, const dictionary&);
SolverPerformance<Type> solve
(
fvMatrix<Type>&,
const dictionary& solverControls
);
//- Solve returning the solution statistics given convergence tolerance,
//- deleting temporary matrix after solution.
@ -767,19 +782,30 @@ template<class Type>
SolverPerformance<Type> solve
(
const tmp<fvMatrix<Type>>&,
const dictionary&
const dictionary& solverControls
);
//- Solve returning the solution statistics given convergence tolerance
// Solver controls read fvSolution
// Uses \p name solver controls from fvSolution
template<class Type>
SolverPerformance<Type> solve(fvMatrix<Type>&);
SolverPerformance<Type> solve(fvMatrix<Type>&, const word& name);
//- Solve returning the solution statistics given convergence tolerance,
//- deleting temporary matrix after solution.
// Solver controls read fvSolution
// Uses \p name solver controls from fvSolution
template<class Type>
SolverPerformance<Type> solve(const tmp<fvMatrix<Type>>&, const word& name);
//- Solve returning the solution statistics given convergence tolerance
// Uses solver controls from fvSolution
template<class Type>
SolverPerformance<Type> solve(fvMatrix<Type>&);
//- Solve returning the solution statistics given convergence tolerance,
//- deleting temporary matrix after solution.
// Uses solver controls from fvSolution
template<class Type>
SolverPerformance<Type> solve(const tmp<fvMatrix<Type>>&);

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2016-2021 OpenCFD Ltd.
Copyright (C) 2016-2023 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -314,6 +314,13 @@ Foam::SolverPerformance<Type> Foam::fvMatrix<Type>::solveCoupled
}
template<class Type>
Foam::SolverPerformance<Type> Foam::fvMatrix<Type>::solveSegregatedOrCoupled()
{
return this->solveSegregatedOrCoupled(solverDict());
}
template<class Type>
Foam::SolverPerformance<Type> Foam::fvMatrix<Type>::solve
(
@ -339,6 +346,13 @@ Foam::SolverPerformance<Type> Foam::fvMatrix<Type>::fvSolver::solve()
}
template<class Type>
Foam::SolverPerformance<Type> Foam::fvMatrix<Type>::solve(const word& name)
{
return this->solve(solverDict(name));
}
template<class Type>
Foam::SolverPerformance<Type> Foam::fvMatrix<Type>::solve()
{

View File

@ -395,7 +395,7 @@ bool Foam::functionObjects::energyTransport::execute()
fvOptions_.constrain(sEqn);
sEqn.solve(mesh_.solverDict(schemesField_));
sEqn.solve(schemesField_);
}
}
else if (phi.dimensions() == dimVolume/dimTime)
@ -433,7 +433,7 @@ bool Foam::functionObjects::energyTransport::execute()
fvOptions_.constrain(sEqn);
sEqn.solve(mesh_.solverDict(schemesField_));
sEqn.solve(schemesField_);
}
}
else

View File

@ -295,7 +295,7 @@ bool Foam::functionObjects::scalarTransport::execute()
sEqn.relax(relaxCoeff);
fvOptions_.constrain(sEqn);
sEqn.solve(mesh_.solverDict(schemesField_));
sEqn.solve(schemesField_);
tTPhiUD = sEqn.flux();
}
@ -333,7 +333,7 @@ bool Foam::functionObjects::scalarTransport::execute()
fvOptions_.constrain(sEqn);
sEqn.solve(mesh_.solverDict(schemesField_));
sEqn.solve(schemesField_);
}
}
else if (phi.dimensions() == dimVolume/dimTime)
@ -353,7 +353,7 @@ bool Foam::functionObjects::scalarTransport::execute()
fvOptions_.constrain(sEqn);
sEqn.solve(mesh_.solverDict(schemesField_));
sEqn.solve(schemesField_);
}
}
else

View File

@ -242,7 +242,7 @@ void Foam::displacementComponentLaplacianFvMotionSolver::solve()
);
fvOptions.constrain(TEqn);
TEqn.solveSegregatedOrCoupled(TEqn.solverDict());
TEqn.solveSegregatedOrCoupled();
fvOptions.correct(cellDisplacement_);
}

View File

@ -146,7 +146,7 @@ void Foam::velocityComponentLaplacianFvMotionSolver::solve()
);
fvOptions.constrain(TEqn);
TEqn.solveSegregatedOrCoupled(TEqn.solverDict());
TEqn.solveSegregatedOrCoupled();
fvOptions.correct(cellMotionU_);
}

View File

@ -242,7 +242,7 @@ void Foam::displacementSBRStressFvMotionSolver::solve()
);
fvOptions.constrain(TEqn);
TEqn.solveSegregatedOrCoupled(TEqn.solverDict());
TEqn.solveSegregatedOrCoupled();
fvOptions.correct(cellDisplacement_);
}

View File

@ -351,7 +351,7 @@ void Foam::displacementLaplacianFvMotionSolver::solve()
);
fvOptions.constrain(TEqn);
TEqn.solveSegregatedOrCoupled(TEqn.solverDict());
TEqn.solveSegregatedOrCoupled();
fvOptions.correct(cellDisplacement_);
}

View File

@ -359,7 +359,7 @@ void Foam::solidBodyDisplacementLaplacianFvMotionSolver::solve()
);
fvOptions.constrain(TEqn);
TEqn.solveSegregatedOrCoupled(TEqn.solverDict());
TEqn.solveSegregatedOrCoupled();
fvOptions.correct(cellDisplacement_);
}

View File

@ -423,7 +423,7 @@ void Foam::surfaceAlignedSBRStressFvMotionSolver::solve()
fvOptions.constrain(DEqn);
// Note: solve uncoupled
DEqn.solveSegregatedOrCoupled(DEqn.solverDict());
DEqn.solveSegregatedOrCoupled();
fvOptions.correct(cellDisp);
}

View File

@ -146,7 +146,7 @@ void Foam::velocityLaplacianFvMotionSolver::solve()
);
fvOptions.constrain(UEqn);
UEqn.solveSegregatedOrCoupled(UEqn.solverDict());
UEqn.solveSegregatedOrCoupled();
fvOptions.correct(cellMotionU_);
}
}

View File

@ -420,7 +420,7 @@ void Foam::MultiComponentPhaseModel<BasePhaseModel, phaseThermo>::solveYi
)
);
YiDiffEqn.solve(mesh.solver("diffusion" + Yi.name()));
YiDiffEqn.solve("diffusion" + Yi.name());
}
Yt += Yi;