Fixed URL for libccmio-2.6.1 (bug report #5 by Thomas Oliveira)
[foam-extend-3.2.git] / applications / solvers / solidMechanics / elasticThermalSolidFoam / createFields.H
blob0ab66ab7e9e7730ae32326f0a1fe30aed7ebfe78
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     volSymmTensorField epsilon
44     (
45         IOobject
46         (
47             "epsilon",
48             runTime.timeName(),
49             mesh,
50             IOobject::READ_IF_PRESENT,
51             IOobject::AUTO_WRITE
52         ),
53         mesh,
54         dimensionedSymmTensor("zero", dimless, symmTensor::zero)
55     );
57     Info<< "Reading field T\n" << endl;
58     volScalarField T
59     (
60         IOobject
61         (
62             "T",
63             runTime.timeName(),
64             mesh,
65             IOobject::MUST_READ,
66             IOobject::AUTO_WRITE
67         ),
68         mesh
69     );
71     volSymmTensorField sigma
72     (
73         IOobject
74         (
75             "sigma",
76             runTime.timeName(),
77             mesh,
78             IOobject::READ_IF_PRESENT,
79             IOobject::AUTO_WRITE
80         ),
81         mesh,
82         dimensionedSymmTensor("zero", dimForce/dimArea, symmTensor::zero)
83     );
85     volVectorField divSigmaExp
86     (
87         IOobject
88         (
89             "divSigmaExp",
90             runTime.timeName(),
91             mesh,
92             IOobject::NO_READ,
93             IOobject::NO_WRITE
94         ),
95         mesh,
96         dimensionedVector("zero", dimensionSet(1,-2,-2,0,0,0,0), vector::zero)
97     );
99     surfaceVectorField n = mesh.Sf()/mesh.magSf();
101     // mechanical properties
102     constitutiveModel rheology(sigma, U);
104     volScalarField rho = rheology.rho();
106     volScalarField mu = rheology.mu();
107     volScalarField lambda = rheology.lambda();
108     surfaceScalarField muf = fvc::interpolate(mu, "mu");
109     surfaceScalarField lambdaf = fvc::interpolate(lambda, "lambda");
112     // thermal properties
113     Info<< "Reading thermal model\n" << endl;
114     thermalModel thermal(T);
116     volScalarField C = thermal.C();
117     volScalarField k
118     (
119         "DT",
120         thermal.k()
121     );
122     volScalarField threeKalpha = rheology.threeK()*rho*thermal.alpha();
123     surfaceScalarField threeKalphaf =
124         fvc::interpolate(threeKalpha, "threeKalpha");
125     volScalarField T0 = thermal.T0();
126     volScalarField rhoC = rho*C;
129     // for aitken relaxation
130     volVectorField aitkenDelta
131     (
132         IOobject
133         (
134          "aitkenDelta",
135          runTime.timeName(),
136          mesh,
137          IOobject::NO_READ,
138          IOobject::NO_WRITE
139          ),
140         mesh,
141         dimensionedVector("zero", dimLength, vector::zero)
142     );
144     // aitken relaxation factor
145     scalar aitkenInitialRes = 1.0;
146     scalar aitkenTheta = 0.01;