Merge branch 'master' of ssh://git.code.sf.net/p/foam-extend/foam-extend-3.2
[foam-extend-3.2.git] / applications / solvers / solidMechanics / elasticPlasticNonLinTLSolidFoam / calculateDivDSigmaExp.H
blob626b915e648911d4c1f938ebabfb7e57bda6c851
1 if(divDSigmaExpMethod == "standard")
3     divDSigmaExp = fvc::div
4     (
5         mu*gradDU.T() + lambda*(I*tr(gradDU)) - (mu + lambda)*gradDU,
6         "div(sigma)"
7     );
9 else if(divDSigmaExpMethod == "surface")
11     divDSigmaExp = fvc::div
12     (
13         mesh.magSf()*
14         (
15             muf*(n & fvc::interpolate(gradDU.T()))
16           + lambdaf*tr(fvc::interpolate(gradDU))*n
17           - (muf + lambdaf)*(n & fvc::interpolate(gradDU))
18         )
19     );
21      // divDSigmaExp = fvc::div
22      // (
23      //     muf*(mesh.Sf() & fvc::interpolate(gradDU.T()))
24      //   + lambdaf*(mesh.Sf() & I*fvc::interpolate(tr(gradDU)))
25      //   - (muf + lambdaf)*(mesh.Sf() & fvc::interpolate(gradDU))
26      //  );
28 else if(divDSigmaExpMethod == "decompose")
30     surfaceTensorField shearGradDU((I - n*n) & fvc::interpolate(gradDU));
32     divDSigmaExp = fvc::div
33     (
34         mesh.magSf()*
35         (
36           - (muf + lambdaf)*(fvc::snGrad(DU) & (I - n*n))
37           + lambdaf*tr(shearGradDU & (I - n*n))*n
38           + muf*(shearGradDU & n)
39         )
40     );
42      // divDSigmaExp = fvc::div
43      // (
44      //     mesh.magSf()*
45      //     (
46      //       - (muf + lambdaf)*(fvc::snGrad(DU)&(I - n*n))
47      //       + lambdaf*tr(shearGradDU&(I - n*n))*n
48      //       + muf*(shearGradDU&n)
49      //     )
50      // );
52 else if(divDSigmaExpMethod == "laplacian")
54     divDSigmaExp =
55       - fvc::laplacian(mu + lambda, DU, "laplacian(DDU,DU)")
56       + fvc::div(mu*gradDU.T() + lambda*(I*tr(gradDU)), "div(sigma)");
58 else
60     FatalErrorIn(args.executable())
61         << "divDSigmaExp method " << divDSigmaExpMethod << " not found!"
62         << abort(FatalError);