Fixing indentation in applications/solvers/solidMechanics
[foam-extend-3.2.git] / applications / solvers / solidMechanics / elasticPlasticSolidFoam / createFields.H
blob012f92e1c73e0c9e35ddb2fb9cf6eafec3cbf4c8
1     Info<< "Reading displacement increment 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<< "Creating 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     volSymmTensorField DEpsilon
33     (
34         IOobject
35         (
36             "DEpsilon",
37             runTime.timeName(),
38             mesh,
39             IOobject::READ_IF_PRESENT,
40             IOobject::AUTO_WRITE
41         ),
42         mesh,
43         dimensionedSymmTensor("zero", dimless, symmTensor::zero)
44     );
46     volSymmTensorField DSigma
47     (
48         IOobject
49         (
50             "DSigma",
51             runTime.timeName(),
52             mesh,
53             IOobject::READ_IF_PRESENT,
54             IOobject::AUTO_WRITE
55         ),
56         mesh,
57         dimensionedSymmTensor("zero", dimForce/dimArea, symmTensor::zero)
58     );
60     volSymmTensorField sigma
61     (
62         IOobject
63         (
64             "sigma",
65             runTime.timeName(),
66             mesh,
67             IOobject::READ_IF_PRESENT,
68             IOobject::AUTO_WRITE
69         ),
70         mesh,
71         dimensionedSymmTensor("zero", dimForce/dimArea, symmTensor::zero)
72     );
74     volSymmTensorField epsilon
75     (
76         IOobject
77         (
78             "epsilon",
79             runTime.timeName(),
80             mesh,
81             IOobject::READ_IF_PRESENT,
82             IOobject::AUTO_WRITE
83         ),
84         mesh,
85         dimensionedSymmTensor("zero", dimless, symmTensor::zero)
86     );
88     volSymmTensorField epsilonP
89     (
90         IOobject
91         (
92             "epsilonP",
93             runTime.timeName(),
94             mesh,
95             IOobject::READ_IF_PRESENT,
96             IOobject::AUTO_WRITE
97         ),
98         mesh,
99         dimensionedSymmTensor("zero", dimless, symmTensor::zero)
100     );
103     volVectorField divDSigmaExp
104     (
105         IOobject
106         (
107             "divDSigmaExp",
108             runTime.timeName(),
109             mesh,
110             IOobject::NO_READ,
111             IOobject::NO_WRITE
112         ),
113         mesh,
114         dimensionedVector("zero", dimensionSet(1,-2,-2,0,0,0,0), vector::zero)
115     );
117     constitutiveModel rheology(sigma, DU);
119     volScalarField rho = rheology.rho();
120     volScalarField mu = rheology.mu();
121     volScalarField lambda = rheology.lambda();
122     surfaceScalarField muf = fvc::interpolate(mu, "mu");
123     surfaceScalarField lambdaf = fvc::interpolate(lambda, "lambda");
125     surfaceVectorField n = mesh.Sf()/mesh.magSf();
127    // plastic strain increment
128    const volSymmTensorField& DEpsilonP = rheology.DEpsilonP();
130     // for aitken relaxation
131     volVectorField aitkenDelta
132     (
133         IOobject
134         (
135             "aitkenDelta",
136             runTime.timeName(),
137             mesh,
138             IOobject::NO_READ,
139             IOobject::NO_WRITE
140         ),
141         mesh,
142         dimensionedVector("zero", dimLength, vector::zero)
143    );
145    scalar aitkenInitialRes = 1.0;
146    scalar aitkenTheta = 0.1;