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 elasticOrthoAcpSolidFoam
28 Arbitrary crack propagation (ACP) solver
29 allowing orthotropic material properties.
32 Cardiff P, Karac A & Ivankovic A, A Large Strain Finite Volume Method for
33 Orthotropic Bodies with General Material Orientations, Computer Methods
34 in Applied Mechanics & Engineering, Sep 2013,
35 http://dx.doi.org/10.1016/j.cma.2013.09.008.
37 Carolan D, Tuković Z, Murphy N, Ivankovic A, Arbitrary crack propagation
38 in multi-phase materials using the finite volume method, Computational
39 Materials Science, 2013, http://dx.doi.org/10.1016/j.commatsci.2012.11.049.
43 ACP by Tukovic FSB and Carolan UCD
45 \*---------------------------------------------------------------------------*/
48 #include "constitutiveModel.H"
49 //#include "componentReferenceList.H"
50 #include "crackerFvMesh.H"
51 #include "processorPolyPatch.H"
52 #include "SortableList.H"
53 #include "solidInterface.H"
54 #include "solidCohesiveFvPatchVectorField.H"
55 #include "solidCohesiveFixedModeMixFvPatchVectorField.H"
57 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
59 int main(int argc, char *argv[])
61 # include "setRootCase.H"
62 # include "createTime.H"
63 # include "createCrackerMesh.H"
64 # include "createFields.H"
65 # include "createCrack.H"
66 //# include "createReference.H"
67 # include "createHistory.H"
68 # include "readDivSigmaExpMethod.H"
69 # include "createSolidInterfaceNoModify.H"
71 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
73 Info<< "\nStarting time loop\n" << endl;
77 scalar maxEffTractionFraction = 0;
79 // time rates for predictor
80 volTensorField gradV = fvc::ddt(gradU);
81 surfaceVectorField snGradV =
82 (snGradU - snGradU.oldTime())/runTime.deltaT();
84 //# include "initialiseSolution.H"
88 # include "readSolidMechanicsControls.H"
89 # include "setDeltaT.H"
93 Info<< "\nTime = " << runTime.timeName() << " s\n" << endl;
95 volScalarField rho = rheology.rho();
96 volDiagTensorField K = rheology.K();
97 surfaceDiagTensorField Kf = fvc::interpolate(K, "K");
98 volSymmTensor4thOrderField C = rheology.C();
99 surfaceSymmTensor4thOrderField Cf = fvc::interpolate(C, "C");
101 solidInterfacePtr->modifyProperties(Cf, Kf);
103 //# include "waveCourantNo.H"
106 lduMatrix::solverPerformance solverPerf;
107 scalar initialResidual = 0;
108 scalar relativeResidual = 1;
109 //scalar forceResidual = 1;
110 label nFacesToBreak = 0;
111 label nCoupledFacesToBreak = 0;
112 bool topoChange = false;
114 //bool noMoreCracks = false;
116 // Predictor step using time rates
119 Info<< "Predicting U, gradU and snGradU using velocity"
121 U += V*runTime.deltaT();
122 gradU += gradV*runTime.deltaT();
123 snGradU += snGradV*runTime.deltaT();
128 surfaceVectorField n = mesh.Sf()/mesh.magSf();
133 # include "calculateDivSigmaExp.H"
139 fvm::laplacian(Kf, U, "laplacian(K,U)")
143 //# include "setReference.H"
145 if(solidInterfacePtr)
147 solidInterfacePtr->correct(UEqn);
155 solverPerf = UEqn.solve();
159 # include "aitkenRelaxation.H"
168 initialResidual = solverPerf.initialResidual();
169 aitkenInitialRes = gMax(mag(U.internalField()));
172 //gradU = solidInterfacePtr->grad(U);
173 // use leastSquaresSolidInterface grad scheme
174 gradU = fvc::grad(U);
176 # include "calculateRelativeResidual.H"
178 if (iCorr % infoFrequency == 0)
180 Info<< "\tTime " << runTime.value()
181 << ", Corr " << iCorr
182 << ", Solving for " << U.name()
183 << " using " << solverPerf.solverName()
184 << ", res = " << solverPerf.initialResidual()
185 << ", rel res = " << relativeResidual;
188 Info << ", aitken = " << aitkenTheta;
190 Info << ", inner iters " << solverPerf.nIterations() << endl;
199 //solverPerf.initialResidual() > convergenceTolerance
200 relativeResidual > convergenceTolerance
205 Info<< "Solving for " << U.name() << " using "
206 << solverPerf.solverName()
207 << ", Initial residual = " << initialResidual
208 << ", Final residual = " << solverPerf.initialResidual()
209 << ", No outer iterations " << iCorr
210 << ", Relative residual " << relativeResidual << endl;
212 # include "calculateTraction.H"
213 # include "updateCrack.H"
215 Info<< "Max effective traction fraction: "
216 << maxEffTractionFraction << endl;
218 // reset counter if faces want to crack
219 if ((nFacesToBreak > 0) || (nCoupledFacesToBreak > 0)) iCorr = 0;
221 while( (nFacesToBreak > 0) || (nCoupledFacesToBreak > 0));
223 if (cohesivePatchUPtr)
225 if (returnReduce(cohesivePatchUPtr->size(), sumOp<label>()))
227 cohesivePatchUPtr->cracking();
236 cohesivePatchUFixedModePtr->size(),
241 Pout << "Number of faces in crack: "
242 << cohesivePatchUFixedModePtr->size() << endl;
243 cohesivePatchUFixedModePtr->relativeSeparationDistance();
247 // update time rates for predictor
251 gradV = fvc::ddt(gradU);
252 snGradV = (snGradU - snGradU.oldTime())/runTime.deltaT();
255 # include "calculateEpsilonSigma.H"
256 # include "writeFields.H"
257 # include "writeHistory.H"
259 Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
260 << " ClockTime = " << runTime.elapsedClockTime() << " s\n\n"
264 Info<< "End\n" << endl;
270 // ************************************************************************* //