Fixing indentation in applications/solvers/solidMechanics
[foam-extend-3.2.git] / applications / solvers / solidMechanics / elasticPlasticNonLinULSolidFoam / createFields.H
blobc7605dc96a83501c2eda2767cdcec57522642321
1     Info<< "Reading incremental displacement field DU\n" << endl;
2     volVectorField DU
3     (
4         IOobject
5         (
6             "DU",
7             runTime.timeName(),
8             mesh,
9             IOobject::MUST_READ,
10             IOobject::AUTO_WRITE
11         ),
12         mesh
13     );
15     volTensorField gradDU = fvc::grad(DU);
17     Info<< "Reading accumulated displacement field U\n" << endl;
18     volVectorField U
19     (
20         IOobject
21         (
22             "U",
23             runTime.timeName(),
24             mesh,
25             IOobject::READ_IF_PRESENT,
26             IOobject::AUTO_WRITE
27         ),
28         mesh,
29         dimensionedVector("zero", dimLength, vector::zero)
30     );
32     Info << "Reading accumulated strain field epsilon\n" << endl;
33     volSymmTensorField epsilon
34     (
35         IOobject
36         (
37             "epsilon",
38             runTime.timeName(),
39             mesh,
40             IOobject::READ_IF_PRESENT,
41             IOobject::AUTO_WRITE
42         ),
43         mesh,
44         dimensionedSymmTensor("zero", dimless, symmTensor::zero)
45     );
47     // total plastic strain
48     volSymmTensorField epsilonP
49     (
50         IOobject
51         (
52             "epsilonP",
53             runTime.timeName(),
54             mesh,
55             IOobject::READ_IF_PRESENT,
56             IOobject::AUTO_WRITE
57         ),
58         mesh,
59         dimensionedSymmTensor("zero", dimless, symmTensor::zero)
60     );
62     volSymmTensorField DEpsilon
63     (
64         IOobject
65         (
66             "DEpsilon",
67             runTime.timeName(),
68             mesh,
69             IOobject::READ_IF_PRESENT,
70             IOobject::AUTO_WRITE
71         ),
72         mesh,
73         dimensionedSymmTensor("zero", dimless, symmTensor::zero)
74     );
76     Info << "Reading accumulated stress field sigma\n" << endl;
77     volSymmTensorField sigma
78     (
79         IOobject
80         (
81             "sigma",
82             runTime.timeName(),
83             mesh,
84             IOobject::READ_IF_PRESENT,
85             IOobject::AUTO_WRITE
86         ),
87         mesh,
88         dimensionedSymmTensor("zero", dimForce/dimArea, symmTensor::zero)
89     );
92     Info << "Reading incremental stress field DSigma\n" << endl;
93     volSymmTensorField DSigma
94     (
95         IOobject
96         (
97             "DSigma",
98             runTime.timeName(),
99             mesh,
100             IOobject::READ_IF_PRESENT,
101             IOobject::AUTO_WRITE
102         ),
103         mesh,
104         dimensionedSymmTensor("zero", dimForce/dimArea, symmTensor::zero)
105     );
107     //- explicit terms in the momentum equation
108     volVectorField divDSigmaExp
109     (
110         IOobject
111         (
112             "divDSigmaExp",
113             runTime.timeName(),
114             mesh,
115             IOobject::NO_READ,
116             IOobject::NO_WRITE
117         ),
118         mesh,
119         dimensionedVector("zero", dimensionSet(1, -2, -2, 0, 0, 0, 0), vector::zero)
120     );
122     volVectorField divDSigmaNonLinExp
123     (
124         IOobject
125         (
126             "divDSigmaNonLinExp",
127             runTime.timeName(),
128             mesh,
129             IOobject::NO_READ,
130             IOobject::NO_WRITE
131         ),
132         mesh,
133         dimensionedVector("zero", dimensionSet(1,-2,-2,0,0,0,0), vector::zero)
134     );
136     constitutiveModel rheology(sigma, DU);
138     volScalarField rho = rheology.rho();
139     volScalarField mu = rheology.mu();
140     volScalarField lambda = rheology.lambda();
141     surfaceScalarField muf = fvc::interpolate(rheology.mu());
142     surfaceScalarField lambdaf = fvc::interpolate(rheology.lambda());
144     surfaceVectorField n = mesh.Sf()/mesh.magSf();
146     // plastic strain increment
147     const volSymmTensorField& DEpsilonP = rheology.DEpsilonP();
149     // for aitken relaxation
150     volVectorField aitkenDelta
151     (
152         IOobject
153         (
154             "aitkenDelta",
155             runTime.timeName(),
156             mesh,
157             IOobject::NO_READ,
158             IOobject::NO_WRITE
159         ),
160         mesh,
161         dimensionedVector("zero", dimLength, vector::zero)
162     );
164     // aitken relaxation factor
165     scalar aitkenInitialRes = 1.0;
166     scalar aitkenTheta = 0.1;
168 //    volVectorField resid
169 //    (
170 //        IOobject
171 //        (
172 //            "resid",
173 //            runTime.timeName(),
174 //            mesh,
175 //            IOobject::NO_READ,
176 //            IOobject::AUTO_WRITE
177 //        ),
178 //        mesh,
179 //        dimensionedVector("zero", dimless, vector::zero)
180 //    );