Merge branch 'master' of ssh://git.code.sf.net/p/foam-extend/foam-extend-3.2
[foam-extend-3.2.git] / applications / solvers / solidMechanics / icoFsiElasticNonLinULSolidFoam / solveFluid.H
blob0364805a5483fa7c776814dcce044222a436e658
2         if(mesh.moving())
3         {
4             // Make the fluxes relative
5             phi -= fvc::meshPhi(U);
6         }
8 #       include "CourantNo.H"
10         fvVectorMatrix UEqn
11         (
12             fvm::ddt(U)
13           + fvm::div(phi, U)
14           - fvm::laplacian(nu, U)
15         );
17         solve(UEqn == -fvc::grad(p));
19         // --- PISO loop
20         volScalarField rUA = 1.0/UEqn.A();
22         for (int corr=0; corr<nCorr; corr++)
23         {
24             U = rUA*UEqn.H();
25             phi = (fvc::interpolate(U) & mesh.Sf());
27             adjustPhi(phi, U, p);
29             for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
30             {
31                 fvScalarMatrix pEqn
32                 (
33                     fvm::laplacian(rUA, p)
34                  == fvc::div(phi)
35                 );
37                 pEqn.setReference(pRefCell, pRefValue);
38                 pEqn.solve();
40                 if (nonOrth == nNonOrthCorr)
41                 {
42                     phi -= pEqn.flux();
43                 }
44             }
46 #           include "continuityErrs.H"
48             U -= rUA*fvc::grad(p);
49             U.correctBoundaryConditions();
50         }