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 solver for solid bodies in contact.
30 Solves for the displacement vector field U, also generating the
31 stress tensor field sigma.
33 \*---------------------------------------------------------------------------*/
36 #include "rheologyModel.H"
37 #include "contactProblem.H"
38 #include "componentReferenceList.H"
40 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 int main(int argc, char *argv[])
45 # include "setRootCase.H"
47 # include "createTime.H"
48 # include "createMesh.H"
49 # include "createFields.H"
51 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
53 Info<< "\nCalculating displacement field\n" << endl;
55 volScalarField rho = rheology.rho();
57 // Force n-sqaured projection
58 // polyPatch::setNSquaredProjection(true);
60 while (runTime.loop())
62 Info<< "Iteration: " << runTime.timeName() << nl << endl;
64 # include "readStressedFoamControls.H"
66 volScalarField mu = rheology.mu();
67 volScalarField lambda = rheology.lambda();
70 scalar initialResidual=0;
80 fvm::laplacian(2*mu + lambda, U, "laplacian(DU,U)")
84 mu*gradU.T() + lambda*(I*tr(gradU)) - (mu + lambda)*gradU,
89 # include "setComponentReference.H"
91 initialResidual = UEqn.solve().initialResidual();
95 # include "calculateSigma.H"
101 lambda = rheology.lambda();
103 } while (initialResidual > convergenceTolerance && ++iCorr < nCorr);
105 # include "calculateStress.H"
106 # include "calculateContactArea.H"
108 Info<< "ExecutionTime = "
109 << runTime.elapsedCpuTime()
113 Info<< "End\n" << endl;
119 // ************************************************************************* //