This repository has been archived on 2023-11-20. You can view files and clone it, but cannot push or open issues or pull requests.
foam-extend4.1-coherent-io/applications/solvers/solidMechanics/icoFsiElasticNonLinULSolidFoam/solveFluid.H

51 lines
1.1 KiB
C
Raw Normal View History

2012-09-11 15:42:55 +00:00
if(mesh.moving())
{
// Make the fluxes relative
phi -= fvc::meshPhi(U);
}
# include "CourantNo.H"
fvVectorMatrix UEqn
(
fvm::ddt(U)
+ fvm::div(phi, U)
- fvm::laplacian(nu, U)
);
solve(UEqn == -fvc::grad(p));
// --- PISO loop
volScalarField rUA = 1.0/UEqn.A();
while (piso.correct())
2012-09-11 15:42:55 +00:00
{
U = rUA*UEqn.H();
phi = (fvc::interpolate(U) & mesh.Sf());
adjustPhi(phi, U, p);
while (piso.correctNonOrthogonal())
2012-09-11 15:42:55 +00:00
{
fvScalarMatrix pEqn
(
fvm::laplacian(rUA, p)
== fvc::div(phi)
);
pEqn.setReference(pRefCell, pRefValue);
pEqn.solve();
if (piso.finalNonOrthogonalIter())
2012-09-11 15:42:55 +00:00
{
phi -= pEqn.flux();
}
}
# include "continuityErrs.H"
U -= rUA*fvc::grad(p);
U.correctBoundaryConditions();
}