Merge branch 'master' of ssh://git.code.sf.net/p/foam-extend/foam-extend-3.2
[foam-extend-3.2.git] / applications / solvers / solidMechanics / deprecatedSolvers / contactStressFoam / calculateStress.H
blob152bf41de0ee474ce7221aecc7ecb219a992a681
1     if (runTime.outputTime())
2     {
3         volTensorField sigma =
4             rho*
5             (
6                 mu*(gradU + gradU.T())
7               + I*
8                 (
9                     lambda*tr(gradU)
10                 )
11             );
14         volScalarField sigmaEq
15         (
16             IOobject
17             (
18                 "sigmaEq",
19                 runTime.timeName(),
20                 mesh,
21                 IOobject::NO_READ,
22                 IOobject::AUTO_WRITE
23             ),
24             sqrt((3.0/2.0)*magSqr(dev(sigma)))
25         );
27         volScalarField sigmaxx
28         (
29             IOobject
30             (
31                 "sigmaxx",
32                 runTime.timeName(),
33                 mesh,
34                 IOobject::NO_READ,
35                 IOobject::AUTO_WRITE
36             ),
37             sigma.component(tensor::XX)
38         );
40         volScalarField sigmayy
41         (
42             IOobject
43             (
44                 "sigmayy",
45                 runTime.timeName(),
46                 mesh,
47                 IOobject::NO_READ,
48                 IOobject::AUTO_WRITE
49             ),
50             sigma.component(tensor::YY)
51         );
53         volScalarField sigmazz
54         (
55             IOobject
56             (
57                 "sigmazz",
58                 runTime.timeName(),
59                 mesh,
60                 IOobject::NO_READ,
61                 IOobject::AUTO_WRITE
62             ),
63             sigma.component(tensor::ZZ)
64         );
66         volScalarField sigmaxy
67         (
68             IOobject
69             (
70                 "sigmaxy",
71                 runTime.timeName(),
72                 mesh,
73                 IOobject::NO_READ,
74                 IOobject::AUTO_WRITE
75             ),
76             sigma.component(tensor::XY)
77         );
79         volScalarField sigmaxz
80         (
81             IOobject
82             (
83                 "sigmaxz",
84                 runTime.timeName(),
85                 mesh,
86                 IOobject::NO_READ,
87                 IOobject::AUTO_WRITE
88             ),
89             sigma.component(tensor::XZ)
90         );
92         volScalarField sigmayz
93         (
94             IOobject
95             (
96                 "sigmayz",
97                 runTime.timeName(),
98                 mesh,
99                 IOobject::NO_READ,
100                 IOobject::AUTO_WRITE
101             ),
102             sigma.component(tensor::YZ)
103         );
105         runTime.write();
106     }