1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | foam-extend: Open Source CFD
4 \\ / O peration | Version: 3.2
5 \\ / A nd | Web: http://www.foam-extend.org
6 \\/ M anipulation | For copyright notice see file Copyright
7 -------------------------------------------------------------------------------
9 This file is part of foam-extend.
11 foam-extend is free software: you can redistribute it and/or modify it
12 under the terms of the GNU General Public License as published by the
13 Free Software Foundation, either version 3 of the License, or (at your
14 option) any later version.
16 foam-extend is distributed in the hope that it will be useful, but
17 WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 General Public License for more details.
21 You should have received a copy of the GNU General Public License
22 along with foam-extend. If not, see <http://www.gnu.org/licenses/>.
25 elasticPlasticNonLinULSolidFoam
28 Finite volume structural solver employing a incremental strain updated
31 Valid for small strains, finite displacements and finite rotations.
33 Note: the reason the solver is not strictly valid for large strains is
34 because the constitutive stiffness tensor is not rotated.
35 For an updated Lagrangian solver which does rotate the stiffness tensor, and
36 hence is strictly Valid for large strains, use
37 elasticOrthoNonLinULSolidFoam.
41 Aitken relaxation by T. Tang DTU
43 \*---------------------------------------------------------------------------*/
46 #include "constitutiveModel.H"
47 #include "volPointInterpolation.H"
48 #include "pointPatchInterpolation.H"
49 #include "primitivePatchInterpolation.H"
50 #include "pointFields.H"
51 #include "twoDPointCorrector.H"
52 #include "leastSquaresVolPointInterpolation.H"
53 #include "transformGeometricField.H"
54 #include "solidContactFvPatchVectorField.H"
55 #include "pointMesh.H"
56 #include "symmetryPolyPatch.H"
58 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
60 int main(int argc, char *argv[])
62 # include "setRootCase.H"
63 # include "createTime.H"
64 # include "createMesh.H"
65 # include "createFields.H"
66 # include "createHistory.H"
67 # include "readDivDSigmaExpMethod.H"
68 # include "readDivDSigmaNonLinExpMethod.H"
69 # include "readMoveMeshMethod.H"
70 # include "findGlobalFaceZones.H"
72 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
74 Info<< "\nStarting time loop\n" << endl;
78 Info<< "Time = " << runTime.timeName() << nl << endl;
80 # include "readSolidMechanicsControls.H"
83 lduMatrix::solverPerformance solverPerf;
84 scalar initialResidual = 0;
85 scalar relativeResidual = 1.0;
93 # include "calculateDivDSigmaExp.H"
94 # include "calculateDivDSigmaNonLinExp.H"
96 // Updated lagrangian large strain momentum equation
101 fvm::laplacian(2*muf + lambdaf, DU, "laplacian(DDU,DU)")
104 //- fvc::div(2*mu*DEpsilonP, "div(sigma)")
105 - fvc::div(2*muf*( mesh.Sf() & fvc::interpolate(DEpsilonP)) )
108 if(nonLinearSemiImplicit)
111 // we can treat the nonlinear term (gradDU & gradDU.T()) in a
112 // semi-implicit over-relaxed manner
113 // this should improve convergence when gradDU is large
114 // but maybe not execution time
118 (2*mu + lambda)*gradDU, DU, "laplacian(DDU,DU)"
120 - fvc::div( (2*mu + lambda)*(gradDU&gradDU), "div(sigma)");
123 solverPerf = DUEqn.solve();
127 initialResidual = solverPerf.initialResidual();
132 # include "aitkenRelaxation.H"
139 gradDU = fvc::grad(DU);
141 // correct plasticty term
144 // correct elastic properties
145 // for nonlinear elastic materials
146 //mu = rheology.newMu();
147 //lambda = rheology.newLambda();
148 //muf = fvc::interpolate(mu);
149 //lambdaf = fvc::interpolate(lambda);
151 # include "calculateDEpsilonDSigma.H"
152 # include "calculateRelativeResidual.H"
154 if(iCorr % infoFrequency == 0)
156 Info<< "\tTime " << runTime.value()
157 << ", Corrector " << iCorr
158 << ", Solving for " << DU.name()
159 << " using " << solverPerf.solverName()
160 << ", res = " << solverPerf.initialResidual()
161 << ", rel res = " << relativeResidual;
164 Info<< ", aitken = " << aitkenTheta;
166 Info<< ", iters = " << solverPerf.nIterations() << endl;
174 //solverPerf.initialResidual() > convergenceTolerance
175 relativeResidual > convergenceTolerance
180 Info<< nl << "Time " << runTime.value() << ", Solving for " << DU.name()
181 << ", Initial residual = " << initialResidual
182 << ", Final residual = " << solverPerf.initialResidual()
183 << ", Final rel residual = " << relativeResidual
184 << ", No outer iterations " << iCorr << endl;
186 rheology.updateYieldStress();
190 epsilonP += DEpsilonP;
193 # include "moveMesh.H"
194 # include "rotateFields.H"
195 # include "writeFields.H"
196 # include "writeHistory.H"
198 Info<< nl << "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
199 << " ClockTime = " << runTime.elapsedClockTime() << " s"
203 Info<< "End\n" << endl;
209 // ************************************************************************* //