1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | foam-extend: Open Source CFD
5 \\ / A nd | 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 elasticNonLinTLSolidFoam
28 Finite volume structural solver employing a total strain total
31 Valid for finite strains, finite displacements and finite rotations.
37 \*---------------------------------------------------------------------------*/
40 #include "constitutiveModel.H"
41 #include "solidInterface.H"
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 int main(int argc, char *argv[])
47 # include "setRootCase.H"
48 # include "createTime.H"
49 # include "createMesh.H"
50 # include "createFields.H"
51 # include "createSolidInterfaceNonLin.H"
53 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
55 Info<< "\nStarting time loop\n" << endl;
59 Info<< "Time: " << runTime.timeName() << nl << endl;
61 # include "readSolidMechanicsControls.H"
64 scalar initialResidual = 0;
65 lduMatrix::solverPerformance solverPerf;
66 scalar relativeResidual = 1.0;
73 surfaceTensorField shearGradU
76 (I - sqr(n)) & fvc::interpolate(gradU)
83 fvm::laplacian(2*muf + lambdaf, U, "laplacian(DU,U)")
86 // -(mu + lambda)*gradU
88 // + mu*(gradU & gradU.T())
89 // + lambda*tr(gradU)*I
90 // + 0.5*lambda*tr(gradU & gradU.T())*I
98 - (muf + lambdaf)*(fvc::snGrad(U) & (I - n*n))
99 + lambdaf*tr(shearGradU & (I - n*n))*n
100 + muf*(shearGradU & n)
101 + muf*(n & fvc::interpolate(gradU & gradU.T()))
102 + 0.5*lambdaf*(n*tr(fvc::interpolate(gradU & gradU.T())))
103 + (n & fvc::interpolate(sigma & gradU))
108 if (solidInterfaceCorr)
110 solidInterfacePtr->correct(UEqn);
113 solverPerf = UEqn.solve();
117 initialResidual = solverPerf.initialResidual();
122 //gradU = solidInterfacePtr->grad(U);
123 gradU = fvc::grad(U);
125 # include "calculateEpsilonSigma.H"
126 # include "calculateRelativeResidual.H"
128 Info<< "\tTime " << runTime.value()
129 << ", Corrector " << iCorr
130 << ", Solving for " << U.name()
131 << " using " << solverPerf.solverName()
132 << ", residual = " << solverPerf.initialResidual()
133 << ", relative residual = " << relativeResidual
134 << ", inner iterations " << solverPerf.nIterations() << endl;
138 solverPerf.initialResidual() > convergenceTolerance
139 //relativeResidual > convergenceTolerance
144 Info<< nl << "Time " << runTime.value() << ", Solving for " << U.name()
145 << ", Initial residual = " << initialResidual
146 << ", Final residual = " << solverPerf.initialResidual()
147 << ", Relative residual = " << relativeResidual
148 << ", No outer iterations " << iCorr
149 << nl << "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
150 << " ClockTime = " << runTime.elapsedClockTime() << " s"
153 # include "writeFields.H"
155 Info<< "ExecutionTime = "
156 << runTime.elapsedCpuTime()
160 Info<< "End\n" << endl;
166 // ************************************************************************* //