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 elasticNonLinULSolidFoam
28 Finite volume structural solver employing a incremental strain updated
31 Valid for small strains, finite displacements and finite rotations.
36 \*---------------------------------------------------------------------------*/
39 #include "constitutiveModel.H"
40 #include "solidInterface.H"
41 #include "volPointInterpolation.H"
42 #include "pointPatchInterpolation.H"
43 #include "primitivePatchInterpolation.H"
44 #include "pointFields.H"
45 #include "twoDPointCorrector.H"
46 #include "leastSquaresVolPointInterpolation.H"
47 #include "processorFvPatchFields.H"
48 #include "transformGeometricField.H"
49 #include "symmetryPolyPatch.H"
51 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
53 int main(int argc, char *argv[])
55 # include "setRootCase.H"
56 # include "createTime.H"
57 # include "createMesh.H"
58 # include "createFields.H"
59 # include "readDivDSigmaExpMethod.H"
60 # include "readDivDSigmaLargeStrainExpMethod.H"
61 # include "readMoveMeshMethod.H"
62 # include "createSolidInterfaceNonLin.H"
63 # include "findGlobalFaceZones.H"
65 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
67 Info<< "\nStarting time loop\n" << endl;
71 Info<< "Time = " << runTime.timeName() << nl << endl;
73 # include "readSolidMechanicsControls.H"
76 lduMatrix::solverPerformance solverPerf;
77 scalar initialResidual = 1.0;
78 scalar relativeResidual = 1.0;
85 # include "calculateDivDSigmaExp.H"
86 # include "calculateDivDSigmaLargeStrainExp.H"
88 //- Updated lagrangian momentum equation
93 fvm::laplacian(2*muf + lambdaf, DU, "laplacian(DDU,DU)")
95 + divDSigmaLargeStrainExp
98 if (solidInterfaceCorr)
100 solidInterfacePtr->correct(DUEqn);
103 solverPerf = DUEqn.solve();
107 initialResidual = solverPerf.initialResidual();
112 gradDU = fvc::grad(DU);
114 # include "calculateDEpsilonDSigma.H"
115 # include "calculateRelativeResidual.H"
117 Info<< "\tTime " << runTime.value()
118 << ", Corrector " << iCorr
119 << ", Solving for " << DU.name()
120 << " using " << solverPerf.solverName()
121 << ", res = " << solverPerf.initialResidual()
122 << ", rel res = " << relativeResidual
123 << ", inner iters " << solverPerf.nIterations() << endl;
127 //solverPerf.initialResidual() > convergenceTolerance
128 relativeResidual > convergenceTolerance
132 Info << nl << "Time " << runTime.value() << ", Solving for " << DU.name()
133 << ", Initial residual = " << initialResidual
134 << ", Final residual = " << solverPerf.initialResidual()
135 << ", No outer iterations " << iCorr << endl;
137 # include "moveMesh.H"
138 # include "rotateFields.H"
139 # include "writeFields.H"
141 Info<< nl << "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
142 << " ClockTime = " << runTime.elapsedClockTime() << " s"
146 Info<< "End\n" << endl;
152 // ************************************************************************* //