Removed unneeded lib dependency from mdInitialise
[foam-extend-3.2.git] / applications / solvers / solidMechanics / elasticSolidFoam / createFields.H
blob9e916fb4442cde95453b868c94c37365ef0df8e8
1     Info<< "Reading field U\n" << endl;
2     volVectorField U
3     (
4         IOobject
5         (
6             "U",
7             runTime.timeName(),
8             mesh,
9             IOobject::MUST_READ,
10             IOobject::AUTO_WRITE
11         ),
12         mesh
13     );
15     //     volTensorField gradU = fvc::grad(U);
16     volTensorField gradU
17     (
18         IOobject
19         (
20          "grad(U)",
21          runTime.timeName(),
22          mesh,
23          IOobject::NO_READ,
24          IOobject::NO_WRITE
25          ),
26         mesh,
27         dimensionedTensor("zero", dimless, tensor::zero)
28      );
29     //surfaceVectorField snGradU = fvc::snGrad(U);
30     surfaceVectorField snGradU
31     (
32         IOobject
33         (
34             "snGrad(U)",
35             runTime.timeName(),
36             mesh,
37             IOobject::NO_READ,
38             IOobject::NO_WRITE
39         ),
40         mesh,
41         dimensionedVector("zero", dimless, vector::zero)
42     );
44     volVectorField V
45     (
46         IOobject
47         (
48             "V",
49             runTime.timeName(),
50             mesh,
51             IOobject::READ_IF_PRESENT,
52             IOobject::AUTO_WRITE
53         ),
54         fvc::ddt(U)
55     );
57    volTensorField gradV = fvc::ddt(gradU);
58    surfaceVectorField snGradV = (snGradU - snGradU.oldTime())/runTime.deltaT();
60     volSymmTensorField epsilon
61     (
62         IOobject
63         (
64             "epsilon",
65             runTime.timeName(),
66             mesh,
67             IOobject::READ_IF_PRESENT,
68             IOobject::AUTO_WRITE
69         ),
70         mesh,
71         dimensionedSymmTensor("zero", dimless, symmTensor::zero)
72     );
74     volSymmTensorField sigma
75     (
76         IOobject
77         (
78             "sigma",
79             runTime.timeName(),
80             mesh,
81             IOobject::READ_IF_PRESENT,
82             IOobject::AUTO_WRITE
83         ),
84         mesh,
85         dimensionedSymmTensor("zero", dimForce/dimArea, symmTensor::zero)
86     );
88       volVectorField divSigmaExp
89       (
90         IOobject
91         (
92          "divSigmaExp",
93          runTime.timeName(),
94          mesh,
95          IOobject::NO_READ,
96          IOobject::NO_WRITE
97          ),
98         mesh,
99         dimensionedVector("zero", dimForce/dimVolume, vector::zero)
100        );
102     constitutiveModel rheology(sigma, U);
104     volScalarField rho = rheology.rho();
105     volScalarField mu = rheology.mu();
106     volScalarField lambda = rheology.lambda();
107     surfaceScalarField muf = rheology.muf();
108     surfaceScalarField lambdaf = rheology.lambdaf();
110     surfaceVectorField n = mesh.Sf()/mesh.magSf();
112 // check if there are contact boundaries to know
113 // if contact fields should be written for visualisation
114 // note: this is just for visualisation
115 // bool contactBoundaries = false;
116 // forAll(U.boundaryField(), patchi)
117 // {
118 //   if(U.boundaryField()[patchi].type()
119 //      ==
120 //      solidContactFvPatchVectorField::typeName)
121 //     {
122 //       contactBoundaries = true;
123 //       break;
124 //     }
125 // }
128    // for aitken relaxation
129    volVectorField aitkenDelta
130     (
131         IOobject
132         (
133             "aitkenDelta",
134             runTime.timeName(),
135             mesh,
136             IOobject::NO_READ,
137             IOobject::NO_WRITE
138         ),
139         mesh,
140         dimensionedVector("zero", dimLength, vector::zero)
141     );
142 // aitken relaxation factor
143 scalar aitkenInitialRes = 1.0;
144 scalar aitkenTheta = 0.1;