2013-10-11 13:31:14 +00:00
|
|
|
|
|
|
|
if (runTime.outputTime() || topoChange)
|
|
|
|
{
|
|
|
|
volScalarField sigmaEq
|
|
|
|
(
|
|
|
|
IOobject
|
|
|
|
(
|
|
|
|
"sigmaEq",
|
|
|
|
runTime.timeName(),
|
|
|
|
mesh,
|
|
|
|
IOobject::NO_READ,
|
|
|
|
IOobject::AUTO_WRITE
|
|
|
|
),
|
|
|
|
sqrt((3.0/2.0)*magSqr(dev(sigma)))
|
|
|
|
);
|
|
|
|
|
|
|
|
Info<< "Max sigmaEq = " << max(sigmaEq).value()
|
|
|
|
<< endl;
|
|
|
|
|
|
|
|
volScalarField epsilonEq
|
|
|
|
(
|
|
|
|
IOobject
|
|
|
|
(
|
|
|
|
"epsilonEq",
|
|
|
|
runTime.timeName(),
|
|
|
|
mesh,
|
|
|
|
IOobject::NO_READ,
|
|
|
|
IOobject::AUTO_WRITE
|
|
|
|
),
|
|
|
|
sqrt((2.0/3.0)*magSqr(dev(epsilon)))
|
|
|
|
);
|
|
|
|
|
|
|
|
Info<< "Max epsilonEq = " << max(epsilonEq).value()
|
|
|
|
<< endl;
|
|
|
|
|
|
|
|
// Info << "\nCalculate maximal principal stress ..." << flush;
|
|
|
|
// // Principal stresses
|
|
|
|
// volVectorField sigmaMax
|
|
|
|
// (
|
|
|
|
// IOobject
|
|
|
|
// (
|
|
|
|
// "sigmaMax",
|
|
|
|
// runTime.timeName(),
|
|
|
|
// mesh,
|
|
|
|
// IOobject::NO_READ,
|
|
|
|
// IOobject::AUTO_WRITE
|
|
|
|
// ),
|
|
|
|
// mesh,
|
|
|
|
// dimensionedVector("sigmaMax", dimPressure, vector::zero)
|
|
|
|
// );
|
|
|
|
// vectorField& sigmaMaxI = sigmaMax.internalField();
|
|
|
|
|
|
|
|
// forAll (sigmaMaxI, cellI)
|
|
|
|
// {
|
|
|
|
// vector eValues = eigenValues(sigma.internalField()[cellI]);
|
|
|
|
// tensor eVectors = eigenVectors(sigma.internalField()[cellI]);
|
|
|
|
|
|
|
|
// scalar maxEValue = 0;
|
|
|
|
// label iMax = -1;
|
|
|
|
// forAll(eValues, i)
|
|
|
|
// {
|
|
|
|
// if (eValues[i] > maxEValue)
|
|
|
|
// {
|
|
|
|
// maxEValue = eValues[i];
|
|
|
|
// iMax = i;
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
|
|
|
|
// if (iMax != -1)
|
|
|
|
// {
|
|
|
|
// if (iMax == 0)
|
|
|
|
// {
|
|
|
|
// sigmaMaxI[cellI] = eVectors.x()*eValues.x();
|
|
|
|
// }
|
|
|
|
// else if (iMax == 1)
|
|
|
|
// {
|
|
|
|
// sigmaMaxI[cellI] = eVectors.y()*eValues.y();
|
|
|
|
// }
|
|
|
|
// else if (iMax == 2)
|
|
|
|
// {
|
|
|
|
// sigmaMaxI[cellI] = eVectors.z()*eValues.z();
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
|
|
|
|
// //- boundary traction
|
|
|
|
// volVectorField tractionBoundary
|
2015-05-17 14:25:35 +00:00
|
|
|
// (
|
|
|
|
// IOobject
|
|
|
|
// (
|
|
|
|
// "tractionBoundary",
|
|
|
|
// runTime.timeName(),
|
|
|
|
// mesh,
|
|
|
|
// IOobject::NO_READ,
|
|
|
|
// IOobject::AUTO_WRITE
|
|
|
|
// ),
|
|
|
|
// mesh,
|
|
|
|
// dimensionedVector("zero", dimForce/dimArea, vector::zero)
|
|
|
|
// );
|
2013-10-11 13:31:14 +00:00
|
|
|
// surfaceVectorField n = mesh.Sf()/mesh.magSf();
|
|
|
|
// forAll(tractionBoundary.boundaryField(), patchi)
|
2015-05-17 14:25:35 +00:00
|
|
|
// {
|
2015-05-17 15:11:30 +00:00
|
|
|
// if(mesh.boundaryMesh()[patchi].type() != processorPolyPatch::typeName)
|
2015-05-17 14:25:35 +00:00
|
|
|
// {
|
2015-05-17 15:11:30 +00:00
|
|
|
// tractionBoundary.boundaryField()[patchi] =
|
2015-05-17 14:25:35 +00:00
|
|
|
// n.boundaryField()[patchi] & sigma.boundaryField()[patchi];
|
|
|
|
// }
|
|
|
|
// }
|
2013-10-11 13:31:14 +00:00
|
|
|
|
|
|
|
|
|
|
|
//- cohesive damage and cracking, and GII and GII
|
|
|
|
volScalarField damageAndCracks
|
2015-05-17 14:25:35 +00:00
|
|
|
(
|
|
|
|
IOobject
|
|
|
|
(
|
|
|
|
"damageAndCracks",
|
|
|
|
runTime.timeName(),
|
|
|
|
mesh,
|
|
|
|
IOobject::NO_READ,
|
|
|
|
IOobject::AUTO_WRITE
|
|
|
|
),
|
|
|
|
mesh,
|
|
|
|
dimensionedScalar("zero", dimless, 0.0),
|
|
|
|
calculatedFvPatchVectorField::typeName
|
|
|
|
);
|
|
|
|
|
2013-10-11 13:31:14 +00:00
|
|
|
volScalarField GI
|
2015-05-17 14:25:35 +00:00
|
|
|
(
|
|
|
|
IOobject
|
|
|
|
(
|
|
|
|
"GI",
|
|
|
|
runTime.timeName(),
|
|
|
|
mesh,
|
|
|
|
IOobject::NO_READ,
|
|
|
|
IOobject::AUTO_WRITE
|
|
|
|
),
|
2013-10-11 13:31:14 +00:00
|
|
|
mesh,
|
|
|
|
dimensionedScalar("zero", dimless, 0.0),
|
|
|
|
calculatedFvPatchVectorField::typeName
|
2015-05-17 14:25:35 +00:00
|
|
|
);
|
|
|
|
|
2013-10-11 13:31:14 +00:00
|
|
|
volScalarField GII
|
2015-05-17 14:25:35 +00:00
|
|
|
(
|
|
|
|
IOobject
|
|
|
|
(
|
|
|
|
"GII",
|
|
|
|
runTime.timeName(),
|
|
|
|
mesh,
|
|
|
|
IOobject::NO_READ,
|
|
|
|
IOobject::AUTO_WRITE
|
|
|
|
),
|
|
|
|
mesh,
|
|
|
|
dimensionedScalar("zero", dimless, 0.0),
|
|
|
|
calculatedFvPatchVectorField::typeName
|
|
|
|
);
|
|
|
|
|
2013-10-11 13:31:14 +00:00
|
|
|
forAll(DU.boundaryField(), patchi)
|
2015-05-17 14:25:35 +00:00
|
|
|
{
|
|
|
|
// if(DU.boundaryField()[patchi].type() == cohesiveLawMultiMatFvPatchVectorField::typeName)
|
|
|
|
if(DU.boundaryField()[patchi].type() == solidCohesiveFvPatchVectorField::typeName)
|
|
|
|
{
|
|
|
|
// cohesiveLawMultiMatFvPatchVectorField& DUpatch =
|
|
|
|
// refCast<cohesiveLawMultiMatFvPatchVectorField>(DU.boundaryField()[patchi]);
|
|
|
|
solidCohesiveFvPatchVectorField& DUpatch =
|
|
|
|
refCast<solidCohesiveFvPatchVectorField>(DU.boundaryField()[patchi]);
|
|
|
|
|
|
|
|
GI.boundaryField()[patchi] = DUpatch.GI();
|
|
|
|
GII.boundaryField()[patchi] = DUpatch.GII();
|
|
|
|
damageAndCracks.boundaryField()[patchi] = DUpatch.crackingAndDamage();
|
|
|
|
}
|
|
|
|
}
|
2013-10-11 13:31:14 +00:00
|
|
|
|
|
|
|
//Info << "done" << endl;
|
|
|
|
|
|
|
|
runTime.writeNow();
|
|
|
|
}
|