Replace tabs by 4 spaces in applications/solvers/solidMechanics
[foam-extend-3.2.git] / applications / solvers / solidMechanics / elasticSolidFoam / createFields.H
blobc268272275539186701bfff5aa6a264dbc5b453d
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
16     (
17         IOobject
18         (
19             "grad(U)",
20             runTime.timeName(),
21             mesh,
22             IOobject::NO_READ,
23             IOobject::NO_WRITE
24         ),
25         mesh,
26         dimensionedTensor("zero", dimless, tensor::zero)
27     );
29     surfaceVectorField snGradU
30     (
31         IOobject
32         (
33             "snGrad(U)",
34             runTime.timeName(),
35             mesh,
36             IOobject::NO_READ,
37             IOobject::NO_WRITE
38         ),
39         mesh,
40         dimensionedVector("zero", dimless, vector::zero)
41     );
43     volVectorField V
44     (
45         IOobject
46         (
47             "V",
48             runTime.timeName(),
49             mesh,
50             IOobject::READ_IF_PRESENT,
51             IOobject::AUTO_WRITE
52         ),
53         fvc::ddt(U)
54     );
56    volTensorField gradV = fvc::ddt(gradU);
57    surfaceVectorField snGradV = (snGradU - snGradU.oldTime())/runTime.deltaT();
59     volSymmTensorField epsilon
60     (
61         IOobject
62         (
63             "epsilon",
64             runTime.timeName(),
65             mesh,
66             IOobject::READ_IF_PRESENT,
67             IOobject::AUTO_WRITE
68         ),
69         mesh,
70         dimensionedSymmTensor("zero", dimless, symmTensor::zero)
71     );
73     volSymmTensorField sigma
74     (
75         IOobject
76         (
77             "sigma",
78             runTime.timeName(),
79             mesh,
80             IOobject::READ_IF_PRESENT,
81             IOobject::AUTO_WRITE
82         ),
83         mesh,
84         dimensionedSymmTensor("zero", dimForce/dimArea, symmTensor::zero)
85     );
87     volVectorField divSigmaExp
88     (
89         IOobject
90         (
91             "divSigmaExp",
92             runTime.timeName(),
93             mesh,
94             IOobject::NO_READ,
95             IOobject::NO_WRITE
96         ),
97         mesh,
98         dimensionedVector("zero", dimForce/dimVolume, vector::zero)
99     );
101     constitutiveModel rheology(sigma, U);
103     volScalarField rho = rheology.rho();
104     volScalarField mu = rheology.mu();
105     volScalarField lambda = rheology.lambda();
106     surfaceScalarField muf = rheology.muf();
107     surfaceScalarField lambdaf = rheology.lambdaf();
109     surfaceVectorField n = mesh.Sf()/mesh.magSf();
111 // check if there are contact boundaries to know
112 // if contact fields should be written for visualisation
113 // note: this is just for visualisation
114 // bool contactBoundaries = false;
115 // forAll(U.boundaryField(), patchi)
116 // {
117 //   if(U.boundaryField()[patchi].type()
118 //      ==
119 //      solidContactFvPatchVectorField::typeName)
120 //     {
121 //       contactBoundaries = true;
122 //       break;
123 //     }
124 // }
127    // for aitken relaxation
128    volVectorField aitkenDelta
129    (
130        IOobject
131        (
132            "aitkenDelta",
133            runTime.timeName(),
134            mesh,
135            IOobject::NO_READ,
136            IOobject::NO_WRITE
137        ),
138        mesh,
139        dimensionedVector("zero", dimLength, vector::zero)
140    );
143 // aitken relaxation factor
144 scalar aitkenInitialRes = 1.0;
145 scalar aitkenTheta = 0.1;