2012-09-11 15:42:55 +00:00
|
|
|
{
|
|
|
|
scalar t = runTime.value();
|
|
|
|
scalar tNext = t + runTime.deltaT().value();
|
2013-07-18 01:02:34 +00:00
|
|
|
|
2012-09-11 15:42:55 +00:00
|
|
|
instantList Times = runTime.times();
|
2013-07-18 01:02:34 +00:00
|
|
|
|
2012-09-11 15:42:55 +00:00
|
|
|
sigma = dimensionedSymmTensor("zero", dimForce/dimArea, symmTensor::zero);
|
2013-07-18 01:02:34 +00:00
|
|
|
DSigmaCorr =
|
2012-09-11 15:42:55 +00:00
|
|
|
dimensionedSymmTensor
|
|
|
|
(
|
2013-07-18 01:02:34 +00:00
|
|
|
"zero",
|
|
|
|
dimForce/dimArea,
|
2012-09-11 15:42:55 +00:00
|
|
|
symmTensor::zero
|
|
|
|
);
|
2013-07-18 01:02:34 +00:00
|
|
|
|
2012-09-11 15:42:55 +00:00
|
|
|
for (label i=1; i<Times.size(); i++)
|
|
|
|
{
|
|
|
|
runTime.setTime(Times[i], i);
|
2013-07-18 01:02:34 +00:00
|
|
|
|
2012-09-11 15:42:55 +00:00
|
|
|
if(runTime.timeIndex() != i)
|
|
|
|
{
|
|
|
|
FatalErrorIn(args.executable())
|
|
|
|
<< "The strain increment DEpsilon must be stored for "
|
|
|
|
<< "each calculated time step. "
|
|
|
|
<< exit(FatalError);
|
|
|
|
}
|
2013-07-18 01:02:34 +00:00
|
|
|
|
2012-09-11 15:42:55 +00:00
|
|
|
IOobject DEpsilonHeader
|
|
|
|
(
|
|
|
|
"DEpsilon",
|
|
|
|
runTime.timeName(),
|
|
|
|
mesh,
|
|
|
|
IOobject::MUST_READ
|
|
|
|
);
|
2013-07-18 01:02:34 +00:00
|
|
|
|
2012-09-11 15:42:55 +00:00
|
|
|
// Check DEpsilon exists
|
|
|
|
if (DEpsilonHeader.headerOk())
|
|
|
|
{
|
|
|
|
volSymmTensorField DEpsilonOld(DEpsilonHeader, mesh);
|
2013-07-18 01:02:34 +00:00
|
|
|
|
2012-09-11 15:42:55 +00:00
|
|
|
scalar tau = runTime.value() - m*runTime.deltaT().value();
|
2013-07-18 01:02:34 +00:00
|
|
|
|
2012-09-11 15:42:55 +00:00
|
|
|
if(tau < 0)
|
|
|
|
{
|
2013-07-18 01:02:34 +00:00
|
|
|
sigma += 2.0*rheology.mu(t)*DEpsilonOld
|
2012-09-11 15:42:55 +00:00
|
|
|
+ rheology.lambda(t)*(I*tr(DEpsilonOld));
|
2013-07-18 01:02:34 +00:00
|
|
|
|
2012-09-11 15:42:55 +00:00
|
|
|
DSigmaCorr += 2.0*rheology.mu(tNext)*DEpsilonOld
|
|
|
|
+ rheology.lambda(tNext)*(I*tr(DEpsilonOld));
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2013-07-18 01:02:34 +00:00
|
|
|
sigma += 2.0*rheology.mu(t - tau)*DEpsilonOld
|
2012-09-11 15:42:55 +00:00
|
|
|
+ rheology.lambda(t - tau)*(I*tr(DEpsilonOld));
|
2013-07-18 01:02:34 +00:00
|
|
|
|
2012-09-11 15:42:55 +00:00
|
|
|
DSigmaCorr += 2.0*rheology.mu(tNext - tau)*DEpsilonOld
|
|
|
|
+ rheology.lambda(tNext - tau)*(I*tr(DEpsilonOld));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
Info << "No DEpsilon" << endl;
|
|
|
|
}
|
|
|
|
}
|
2013-07-18 01:02:34 +00:00
|
|
|
|
2012-09-11 15:42:55 +00:00
|
|
|
if(Times.size()>=2)
|
|
|
|
{
|
|
|
|
runTime++;
|
|
|
|
}
|
2013-07-18 01:02:34 +00:00
|
|
|
|
2012-09-11 15:42:55 +00:00
|
|
|
scalar tau = runTime.value() - m*runTime.deltaT().value();
|
2013-07-18 01:02:34 +00:00
|
|
|
|
2012-09-11 15:42:55 +00:00
|
|
|
sigma += 2.0*rheology.mu(t - tau)*DEpsilon
|
|
|
|
+ rheology.lambda(t - tau)*(I*tr(DEpsilon));
|
2013-07-18 01:02:34 +00:00
|
|
|
|
2012-09-11 15:42:55 +00:00
|
|
|
DSigmaCorr += 2.0*rheology.mu(tNext - tau)*DEpsilon
|
|
|
|
+ rheology.lambda(tNext - tau)*(I*tr(DEpsilon));
|
2013-07-18 01:02:34 +00:00
|
|
|
|
2012-09-11 15:42:55 +00:00
|
|
|
DSigmaCorr -= sigma;
|
2013-07-18 01:02:34 +00:00
|
|
|
}
|
2012-09-11 15:42:55 +00:00
|
|
|
|