2 Info << "\nCalculate total stress" << endl;
4 scalar t = runTime.value();
5 scalar tNext = t + runTime.deltaT().value();
7 instantList Times = runTime.times();
9 // Info << "Number of times: " << Times.size() << endl;
11 sigma = dimensionedSymmTensor("zero", dimForce/dimArea, symmTensor::zero);
20 for (label i=1; i<Times.size(); i++)
22 runTime.setTime(Times[i], i);
24 if(runTime.timeIndex() != i)
26 FatalErrorIn(args.executable())
27 << "The strain increment Depsilon must be stored for "
28 << "each calculated time step. "
32 IOobject DepsilonHeader
40 // Check Depsilon exists
41 if (DepsilonHeader.headerOk())
43 volSymmTensorField DepsilonOld(DepsilonHeader, mesh);
45 scalar tau = runTime.value() - m*runTime.deltaT().value();
49 sigma += 2.0*rheology.mu(t)*DepsilonOld
50 + rheology.lambda(t)*(I*tr(DepsilonOld));
52 DSigmaCorr += 2.0*rheology.mu(tNext)*DepsilonOld
53 + rheology.lambda(tNext)*(I*tr(DepsilonOld));
57 sigma += 2.0*rheology.mu(t - tau)*DepsilonOld
58 + rheology.lambda(t - tau)*(I*tr(DepsilonOld));
60 DSigmaCorr += 2.0*rheology.mu(tNext - tau)*DepsilonOld
61 + rheology.lambda(tNext - tau)*(I*tr(DepsilonOld));
66 Info << "No Depsilon" << endl;
75 scalar tau = runTime.value() - m*runTime.deltaT().value();
77 sigma += 2.0*rheology.mu(t - tau)*Depsilon
78 + rheology.lambda(t - tau)*(I*tr(Depsilon));
80 DSigmaCorr += 2.0*rheology.mu(tNext - tau)*Depsilon
81 + rheology.lambda(tNext - tau)*(I*tr(Depsilon));
85 //Info << "Current time = " << runTime.timeName() << endl;