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/>.
28 Transient/steady-state segregated finite-volume solver for small strain
31 Displacement Increment field DU is solved for using a incremental total
33 also generating the strain tensor field epsilon and stress tensor
36 With optional multi-material solid interface correction ensuring
37 correct tractions on multi-material interfaces
41 multi-material by Tukovic et al. 2012
43 \*---------------------------------------------------------------------------*/
46 #include "constitutiveModel.H"
47 #include "solidInterface.H"
49 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
51 int main(int argc, char *argv[])
53 # include "setRootCase.H"
54 # include "createTime.H"
55 # include "createMesh.H"
56 # include "createFields.H"
57 # include "readDivDSigmaExpMethod.H"
58 # include "createSolidInterfaceIncr.H"
60 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
62 Info<< "\nStarting time loop\n" << endl;
66 Info<< "Time = " << runTime.timeName() << nl << endl;
68 # include "readSolidMechanicsControls.H"
71 scalar initialResidual = 0;
72 scalar relativeResidual = 1.0;
73 lduMatrix::solverPerformance solverPerf;
80 # include "calculateDivDSigmaExp.H"
82 // Linear momentum equation
87 fvm::laplacian(2*muf + lambdaf, DU, "laplacian(DDU,DU)")
91 if (solidInterfaceCorr)
93 solidInterfacePtr->correct(DUEqn);
96 solverPerf = DUEqn.solve();
100 // initialResidual = solverPerf.initialResidual();
101 // force at least two outer correctors
102 initialResidual = 1.0;
107 //gradDU = solidInterfacePtr->grad(DU);
108 gradDU = fvc::grad(DU);
110 # include "calculateRelativeResidual.H"
112 if (iCorr % infoFrequency == 0)
114 Info<< "\tTime " << runTime.value()
115 << ", Corrector " << iCorr
116 << ", Solving for " << U.name()
117 << " using " << solverPerf.solverName()
118 << ", res = " << solverPerf.initialResidual()
119 << ", rel res = " << relativeResidual
120 << ", inner iters = " << solverPerf.nIterations() << endl;
125 solverPerf.initialResidual() > convergenceTolerance
126 //relativeResidual > convergenceTolerance
130 Info<< nl << "Time " << runTime.value()
131 << ", Solving for " << DU.name()
132 << ", Initial residual = " << initialResidual
133 << ", Final residual = " << solverPerf.initialResidual()
134 << ", Relative residual = " << relativeResidual
135 << ", No outer iterations " << iCorr
136 << nl << "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
137 << " ClockTime = " << runTime.elapsedClockTime() << " s"
140 # include "calculateDEpsilonDSigma.H"
146 # include "writeFields.H"
148 Info<< "ExecutionTime = "
149 << runTime.elapsedCpuTime()
153 Info<< "End\n" << endl;
159 // ************************************************************************* //