Implicit treatment of coupled boundary conditions

This commit is contained in:
Sergio Ferraris
2021-08-03 20:08:49 +00:00
committed by Andrew Heather
parent 11e0db96d3
commit 53af23b9fb
308 changed files with 12354 additions and 527 deletions

View File

@ -1,39 +1,45 @@
if (finalIter)
{
mesh.data::add("finalIteration", true);
}
fvScalarMatrix hEqn
(
fvm::ddt(betav*rho, h)
- (
thermo.isotropic()
? fvm::laplacian(betav*thermo.alpha(), h, "laplacian(alpha,h)")
: fvm::laplacian(betav*taniAlpha(), h, "laplacian(alpha,h)")
)
==
fvOptions(rho, h)
);
{
for (int nonOrth=0; nonOrth<=nNonOrthCorr; ++nonOrth)
hEqn.relax();
fvOptions.constrain(hEqn);
if (coupled)
{
fvScalarMatrix hEqn
(
fvm::ddt(betav*rho, h)
- (
thermo.isotropic()
? fvm::laplacian(betav*thermo.alpha(), h, "laplacian(alpha,h)")
: fvm::laplacian(betav*taniAlpha(), h, "laplacian(alpha,h)")
)
==
fvOptions(rho, h)
);
fvMatrixAssemblyPtr->addFvMatrix(hEqn);
}
else
{
Info<< "\nSolving for solid region "<< solidRegions[i].name() << endl;
hEqn.relax();
fvOptions.constrain(hEqn);
if (finalIter)
{
mesh.data::add("finalIteration", true);
}
hEqn.solve(mesh.solver(h.select(finalIter)));
fvOptions.correct(h);
thermo.correct();
Info<< "Min/max T:" << min(thermo.T()).value() << ' '
<< max(thermo.T()).value() << endl;
if (finalIter)
{
mesh.data::remove("finalIteration");
}
}
thermo.correct();
Info<< "Min/max T:" << min(thermo.T()).value() << ' '
<< max(thermo.T()).value() << endl;
}
if (finalIter)
{
mesh.data::remove("finalIteration");
}