Replace tabs by 4 spaces in applications/solvers/solidMechanics

This commit is contained in:
Henrik Rusche 2015-05-17 17:11:30 +02:00
parent 82a0e1e7df
commit b46695ce1e
123 changed files with 1883 additions and 1883 deletions

View file

@ -16,9 +16,9 @@ if(iCorr == 0)
scalar sumMagB = gSum(magSqr(b)); scalar sumMagB = gSum(magSqr(b));
if(sumMagB < SMALL) if(sumMagB < SMALL)
{ {
//Warning << "Aitken under-relaxation: denominator less then SMALL" //Warning << "Aitken under-relaxation: denominator less then SMALL"
// << endl; // << endl;
sumMagB += SMALL; sumMagB += SMALL;
} }
aitkenTheta = -aitkenTheta* aitkenTheta = -aitkenTheta*

View file

@ -10,10 +10,10 @@ if(divSigmaExpMethod == "standard")
{ {
divSigmaExp = fvc::div divSigmaExp = fvc::div
( (
muf*(mesh.Sf() & fvc::interpolate(gradU.T())) muf*(mesh.Sf() & fvc::interpolate(gradU.T()))
+ lambdaf*(mesh.Sf() & I*fvc::interpolate(tr(gradU))) + lambdaf*(mesh.Sf() & I*fvc::interpolate(tr(gradU)))
- (muf + lambdaf)*(mesh.Sf() & fvc::interpolate(gradU)) - (muf + lambdaf)*(mesh.Sf() & fvc::interpolate(gradU))
); );
} }
else if(divSigmaExpMethod == "decompose") else if(divSigmaExpMethod == "decompose")
{ {
@ -24,13 +24,13 @@ if(divSigmaExpMethod == "standard")
divSigmaExp = fvc::div divSigmaExp = fvc::div
( (
mesh.magSf() mesh.magSf()
*( *(
- (muf + lambdaf)*(snGradU&(I - n*n)) - (muf + lambdaf)*(snGradU&(I - n*n))
+ lambdaf*tr(shearGradU&(I - n*n))*n + lambdaf*tr(shearGradU&(I - n*n))*n
+ muf*(shearGradU&n) + muf*(shearGradU&n)
) )
); );
} }
else if(divSigmaExpMethod == "expLaplacian") else if(divSigmaExpMethod == "expLaplacian")
{ {
@ -38,10 +38,10 @@ if(divSigmaExpMethod == "standard")
- fvc::laplacian(mu + lambda, U, "laplacian(DU,U)") - fvc::laplacian(mu + lambda, U, "laplacian(DU,U)")
+ fvc::div + fvc::div
( (
mu*gradU.T() mu*gradU.T()
+ lambda*(I*tr(gradU)), + lambda*(I*tr(gradU)),
"div(sigma)" "div(sigma)"
); );
} }
else else
{ {

View file

@ -6,14 +6,14 @@
forAll(mesh.boundary(), patchi) forAll(mesh.boundary(), patchi)
{ {
netForce += netForce +=
sum( sum(
mesh.Sf().boundaryField()[patchi] mesh.Sf().boundaryField()[patchi]
& &
( (
2*mu.boundaryField()[patchi]*symm(gradU.boundaryField()[patchi]) 2*mu.boundaryField()[patchi]*symm(gradU.boundaryField()[patchi])
+ lambda*tr(gradU.boundaryField()[patchi])*I + lambda*tr(gradU.boundaryField()[patchi])*I
) )
); );
} }
forceResidual = mag(netForce); forceResidual = mag(netForce);
} }

View file

@ -28,14 +28,14 @@
// forAll(traction.boundaryField(), patchi) // forAll(traction.boundaryField(), patchi)
// { // {
// if (mesh.boundary()[patchi].type() == "cohesive") // if (mesh.boundary()[patchi].type() == "cohesive")
// { // {
// forAll(traction.boundaryField()[patchi], facei) // forAll(traction.boundaryField()[patchi], facei)
// { // {
// Pout << "face " << facei << " with traction magnitude " // Pout << "face " << facei << " with traction magnitude "
// << mag(traction.boundaryField()[patchi][facei])/1e6 << " MPa and traction " // << mag(traction.boundaryField()[patchi][facei])/1e6 << " MPa and traction "
// << traction.boundaryField()[patchi][facei]/1e6 << " MPa" << endl; // << traction.boundaryField()[patchi][facei]/1e6 << " MPa" << endl;
// } // }
// } // }
// } // }
} }

View file

@ -7,40 +7,40 @@
{ {
if (isA<solidCohesiveFvPatchVectorField>(U.boundaryField()[patchI])) if (isA<solidCohesiveFvPatchVectorField>(U.boundaryField()[patchI]))
{ {
cohesivePatchID = patchI; cohesivePatchID = patchI;
cohesivePatchUPtr = cohesivePatchUPtr =
&refCast<solidCohesiveFvPatchVectorField> &refCast<solidCohesiveFvPatchVectorField>
( (
U.boundaryField()[cohesivePatchID] U.boundaryField()[cohesivePatchID]
); );
break; break;
} }
else if (isA<solidCohesiveFixedModeMixFvPatchVectorField>(U.boundaryField()[patchI])) else if (isA<solidCohesiveFixedModeMixFvPatchVectorField>(U.boundaryField()[patchI]))
{ {
cohesivePatchID = patchI; cohesivePatchID = patchI;
cohesivePatchUFixedModePtr = cohesivePatchUFixedModePtr =
&refCast<solidCohesiveFixedModeMixFvPatchVectorField> &refCast<solidCohesiveFixedModeMixFvPatchVectorField>
( (
U.boundaryField()[cohesivePatchID] U.boundaryField()[cohesivePatchID]
); );
break; break;
} }
} }
if(cohesivePatchID == -1) if(cohesivePatchID == -1)
{ {
FatalErrorIn(args.executable()) FatalErrorIn(args.executable())
<< "Can't find cohesiveLawFvPatch" << nl << "Can't find cohesiveLawFvPatch" << nl
<< "One of the boundary patches in " << U.name() << ".boundaryField() " << "One of the boundary patches in " << U.name() << ".boundaryField() "
<< "should be of type " << solidCohesiveFvPatchVectorField::typeName << "should be of type " << solidCohesiveFvPatchVectorField::typeName
<< "or " << solidCohesiveFixedModeMixFvPatchVectorField::typeName << "or " << solidCohesiveFixedModeMixFvPatchVectorField::typeName
<< abort(FatalError); << abort(FatalError);
} }
// solidCohesiveFvPatchVectorField& cohesivePatchU = // solidCohesiveFvPatchVectorField& cohesivePatchU =
// refCast<solidCohesiveFvPatchVectorField> // refCast<solidCohesiveFvPatchVectorField>
// ( // (
// U.boundaryField()[cohesivePatchID] // U.boundaryField()[cohesivePatchID]
// ); // );
// philipc: I have moved cohesive stuff to constitutiveModel // philipc: I have moved cohesive stuff to constitutiveModel
@ -66,82 +66,82 @@
// limit crack to specified boxes // limit crack to specified boxes
{ {
const dictionary& stressControl = const dictionary& stressControl =
mesh.solutionDict().subDict("solidMechanics"); mesh.solutionDict().subDict("solidMechanics");
List<boundBox> userBoxes(stressControl.lookup("crackLimitingBoxes")); List<boundBox> userBoxes(stressControl.lookup("crackLimitingBoxes"));
const surfaceVectorField& Cf = mesh.Cf(); const surfaceVectorField& Cf = mesh.Cf();
forAll(cohesiveZone.internalField(), faceI) forAll(cohesiveZone.internalField(), faceI)
{ {
bool faceInsideBox = false; bool faceInsideBox = false;
forAll(userBoxes, boxi) forAll(userBoxes, boxi)
{ {
if(userBoxes[boxi].contains(Cf.internalField()[faceI])) faceInsideBox = true; if(userBoxes[boxi].contains(Cf.internalField()[faceI])) faceInsideBox = true;
} }
if(faceInsideBox) if(faceInsideBox)
{ {
cohesiveZone.internalField()[faceI] = 1.0; cohesiveZone.internalField()[faceI] = 1.0;
} }
} }
forAll(cohesiveZone.boundaryField(), patchI) forAll(cohesiveZone.boundaryField(), patchI)
{ {
// cracks may go along proc boundaries // cracks may go along proc boundaries
if(mesh.boundaryMesh()[patchI].type() == processorPolyPatch::typeName) if(mesh.boundaryMesh()[patchI].type() == processorPolyPatch::typeName)
{ {
forAll(cohesiveZone.boundaryField()[patchI], faceI) forAll(cohesiveZone.boundaryField()[patchI], faceI)
{ {
bool faceInsideBox = false; bool faceInsideBox = false;
forAll(userBoxes, boxi) forAll(userBoxes, boxi)
{ {
if(userBoxes[boxi].contains(Cf.boundaryField()[patchI][faceI])) faceInsideBox = true; if(userBoxes[boxi].contains(Cf.boundaryField()[patchI][faceI])) faceInsideBox = true;
} }
if(faceInsideBox) if(faceInsideBox)
{ {
cohesiveZone.boundaryField()[patchI][faceI] = 1.0; cohesiveZone.boundaryField()[patchI][faceI] = 1.0;
} }
} }
} }
} }
Info << "\nThere are " << gSum(cohesiveZone.internalField()) << " potential internal crack faces" << nl << endl; Info << "\nThere are " << gSum(cohesiveZone.internalField()) << " potential internal crack faces" << nl << endl;
Info << "\nThere are " << gSum(cohesiveZone.boundaryField())/2 << " potential coupled boundary crack faces" << nl << endl; Info << "\nThere are " << gSum(cohesiveZone.boundaryField())/2 << " potential coupled boundary crack faces" << nl << endl;
// write field for visualisation // write field for visualisation
volScalarField cohesiveZoneVol volScalarField cohesiveZoneVol
( (
IOobject IOobject
( (
"cohesiveZoneVol", "cohesiveZoneVol",
runTime.timeName(), runTime.timeName(),
mesh, mesh,
IOobject::NO_READ, IOobject::NO_READ,
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
mesh, mesh,
dimensionedScalar("zero", dimless, 0.0) dimensionedScalar("zero", dimless, 0.0)
); );
forAll(cohesiveZone.internalField(), facei) forAll(cohesiveZone.internalField(), facei)
{ {
if(cohesiveZone.internalField()[facei]) if(cohesiveZone.internalField()[facei])
{ {
cohesiveZoneVol.internalField()[mesh.owner()[facei]] = 1.0; cohesiveZoneVol.internalField()[mesh.owner()[facei]] = 1.0;
cohesiveZoneVol.internalField()[mesh.neighbour()[facei]] = 1.0; cohesiveZoneVol.internalField()[mesh.neighbour()[facei]] = 1.0;
} }
} }
forAll(cohesiveZone.boundaryField(), patchi) forAll(cohesiveZone.boundaryField(), patchi)
{ {
forAll(cohesiveZone.boundaryField()[patchi], facei) forAll(cohesiveZone.boundaryField()[patchi], facei)
{ {
if(cohesiveZone.boundaryField()[patchi][facei] > 0.0) if(cohesiveZone.boundaryField()[patchi][facei] > 0.0)
{ {
cohesiveZoneVol.boundaryField()[patchi][facei] = 1.0; cohesiveZoneVol.boundaryField()[patchi][facei] = 1.0;
} }
} }
} }
Info << "Writing cohesiveZone field" << endl; Info << "Writing cohesiveZone field" << endl;
cohesiveZoneVol.write(); cohesiveZoneVol.write();
} }

View file

@ -35,8 +35,8 @@
IOobject::NO_READ, IOobject::NO_READ,
IOobject::NO_WRITE IOobject::NO_WRITE
), ),
mesh, mesh,
dimensionedVector("zero", dimless, vector::zero) dimensionedVector("zero", dimless, vector::zero)
); );
volVectorField V volVectorField V
@ -122,7 +122,7 @@
IOobject::NO_WRITE IOobject::NO_WRITE
), ),
mesh, mesh,
dimensionedVector("zero", dimLength, vector::zero) dimensionedVector("zero", dimLength, vector::zero)
); );
// aitken relaxation factor // aitken relaxation factor
scalar aitkenInitialRes = 1.0; scalar aitkenInitialRes = 1.0;
@ -140,5 +140,5 @@ scalar aitkenTheta = 0.1;
// IOobject::AUTO_WRITE // IOobject::AUTO_WRITE
// ), // ),
// mesh, // mesh,
// dimensionedVector("zero", dimless, vector::zero) // dimensionedVector("zero", dimless, vector::zero)
// ); // );

View file

@ -4,14 +4,14 @@ label historyPatchID = mesh.boundaryMesh().findPatchID(historyPatchName);
if(historyPatchID == -1) if(historyPatchID == -1)
{ {
Warning << "history patch " << historyPatchName Warning << "history patch " << historyPatchName
<< " not found. Force-displacement will not be written" << " not found. Force-displacement will not be written"
<< endl; << endl;
} }
else if(Pstream::master()) else if(Pstream::master())
{ {
Info << "Force-displacement for patch " << historyPatchName Info << "Force-displacement for patch " << historyPatchName
<< " will be written to forceDisp.dat" << " will be written to forceDisp.dat"
<< endl; << endl;
word hisDirName("history"); word hisDirName("history");
mkDir(hisDirName); mkDir(hisDirName);
filePtr = new OFstream(hisDirName/historyPatchName+"forceDisp.dat"); filePtr = new OFstream(hisDirName/historyPatchName+"forceDisp.dat");

View file

@ -4,6 +4,6 @@ Info << "Selecting divSigmaExp calculation method " << divSigmaExpMethod << end
if(divSigmaExpMethod != "standard" && divSigmaExpMethod != "surface" && divSigmaExpMethod != "decompose" && divSigmaExpMethod != "laplacian") if(divSigmaExpMethod != "standard" && divSigmaExpMethod != "surface" && divSigmaExpMethod != "decompose" && divSigmaExpMethod != "laplacian")
{ {
FatalError << "divSigmaExp method " << divSigmaExpMethod << " not found!" << nl FatalError << "divSigmaExp method " << divSigmaExpMethod << " not found!" << nl
<< "valid methods are:\nstandard\nsurface\ndecompose\nlaplacian" << "valid methods are:\nstandard\nsurface\ndecompose\nlaplacian"
<< exit(FatalError); << exit(FatalError);
} }

View file

@ -15,16 +15,16 @@ if (dynamicTimeStep && runTime.value() > dynamicTimeStepActivation)
scalar newDeltaT = deltaTmin; scalar newDeltaT = deltaTmin;
if (newDeltaT/runTime.deltaT().value() < 0.5) if (newDeltaT/runTime.deltaT().value() < 0.5)
{ {
newDeltaT = 0.5*runTime.deltaT().value(); newDeltaT = 0.5*runTime.deltaT().value();
Info << "Reducing time step" << nl; Info << "Reducing time step" << nl;
} }
runTime.setDeltaT(newDeltaT); runTime.setDeltaT(newDeltaT);
} }
Pout << "Current time step size: " Pout << "Current time step size: "
<< runTime.deltaT().value() << " s" << endl; << runTime.deltaT().value() << " s" << endl;
scalar maxDT = runTime.deltaT().value(); scalar maxDT = runTime.deltaT().value();

View file

@ -100,7 +100,7 @@ nCoupledFacesToBreak = 0;
} }
// Check if maximum is present on more then one processors // Check if maximum is present on more then one processors
label procID = Pstream::nProcs(); label procID = Pstream::nProcs();
if (procHasFaceToBreak) if (procHasFaceToBreak)
{ {
procID = Pstream::myProcNo(); procID = Pstream::myProcNo();
@ -125,46 +125,46 @@ nCoupledFacesToBreak = 0;
if (mesh.boundary()[patchI].coupled()) if (mesh.boundary()[patchI].coupled())
{ {
// scalarField pEffTraction = // scalarField pEffTraction =
// cohesiveZone.boundaryField()[patchI] * // cohesiveZone.boundaryField()[patchI] *
// mag(traction.boundaryField()[patchI]); // mag(traction.boundaryField()[patchI]);
// scalarField pEffTractionFraction = pEffTraction/sigmaMax.boundaryField()[patchI]; // scalarField pEffTractionFraction = pEffTraction/sigmaMax.boundaryField()[patchI];
scalarField pNormalTraction = scalarField pNormalTraction =
cohesiveZone.boundaryField()[patchI] * cohesiveZone.boundaryField()[patchI] *
( n.boundaryField()[patchI] & traction.boundaryField()[patchI] ); ( n.boundaryField()[patchI] & traction.boundaryField()[patchI] );
pNormalTraction = max(pNormalTraction, scalar(0)); // only consider tensile tractions pNormalTraction = max(pNormalTraction, scalar(0)); // only consider tensile tractions
scalarField pShearTraction = scalarField pShearTraction =
cohesiveZone.boundaryField()[patchI] * cohesiveZone.boundaryField()[patchI] *
mag( (I - Foam::sqr(n.boundaryField()[patchI])) & traction.boundaryField()[patchI] ); mag( (I - Foam::sqr(n.boundaryField()[patchI])) & traction.boundaryField()[patchI] );
// the traction fraction is monitored to decide which faces to break: // the traction fraction is monitored to decide which faces to break:
// ie (tN/tNC)^2 + (tS/tSC)^2 >1 to crack a face // ie (tN/tNC)^2 + (tS/tSC)^2 >1 to crack a face
const scalarField& pSigmaMax = sigmaMax.boundaryField()[patchI]; const scalarField& pSigmaMax = sigmaMax.boundaryField()[patchI];
const scalarField& pTauMax = tauMax.boundaryField()[patchI]; const scalarField& pTauMax = tauMax.boundaryField()[patchI];
scalarField pEffTractionFraction(pNormalTraction.size(), 0.0); scalarField pEffTractionFraction(pNormalTraction.size(), 0.0);
if(cohesivePatchUPtr) if(cohesivePatchUPtr)
{ {
pEffTractionFraction = pEffTractionFraction =
(pNormalTraction/pSigmaMax)*(pNormalTraction/pSigmaMax) + (pShearTraction/pTauMax)*(pShearTraction/pTauMax); (pNormalTraction/pSigmaMax)*(pNormalTraction/pSigmaMax) + (pShearTraction/pTauMax)*(pShearTraction/pTauMax);
} }
else else
{ {
// solidCohesiveFixedModeMix only uses sigmaMax // solidCohesiveFixedModeMix only uses sigmaMax
pEffTractionFraction = pEffTractionFraction =
(pNormalTraction/pSigmaMax)*(pNormalTraction/pSigmaMax) + (pShearTraction/pSigmaMax)*(pShearTraction/pSigmaMax); (pNormalTraction/pSigmaMax)*(pNormalTraction/pSigmaMax) + (pShearTraction/pSigmaMax)*(pShearTraction/pSigmaMax);
} }
label start = mesh.boundaryMesh()[patchI].start(); label start = mesh.boundaryMesh()[patchI].start();
forAll(pEffTractionFraction, faceI) forAll(pEffTractionFraction, faceI)
{ {
if (pEffTractionFraction[faceI] > maxEffTractionFraction) if (pEffTractionFraction[faceI] > maxEffTractionFraction)
{ {
maxEffTractionFraction = pEffTractionFraction[faceI]; maxEffTractionFraction = pEffTractionFraction[faceI];
} }
if (pEffTractionFraction[faceI] > 1.0) if (pEffTractionFraction[faceI] > 1.0)
{ {
coupledFacesToBreakList.insert(start + faceI); coupledFacesToBreakList.insert(start + faceI);
coupledFacesToBreakEffTractionFractionList.insert coupledFacesToBreakEffTractionFractionList.insert
@ -260,7 +260,7 @@ nCoupledFacesToBreak = 0;
if (nCoupledFacesToBreak) if (nCoupledFacesToBreak)
{ {
label patchID = label patchID =
mesh.boundaryMesh().whichPatch(coupledFaceToBreakIndex); mesh.boundaryMesh().whichPatch(coupledFaceToBreakIndex);
label start = mesh.boundaryMesh()[patchID].start(); label start = mesh.boundaryMesh()[patchID].start();
label localIndex = coupledFaceToBreakIndex - start; label localIndex = coupledFaceToBreakIndex - start;
@ -325,31 +325,31 @@ nCoupledFacesToBreak = 0;
faceToBreakNormal = n.internalField()[faceToBreakIndex]; faceToBreakNormal = n.internalField()[faceToBreakIndex];
// Scale broken face traction // Scale broken face traction
faceToBreakSigmaMax = sigmaMaxI[faceToBreakIndex]; faceToBreakSigmaMax = sigmaMaxI[faceToBreakIndex];
faceToBreakTauMax = tauMaxI[faceToBreakIndex]; faceToBreakTauMax = tauMaxI[faceToBreakIndex];
scalar normalTrac = faceToBreakNormal & faceToBreakTraction; scalar normalTrac = faceToBreakNormal & faceToBreakTraction;
normalTrac = max(normalTrac, 0.0); normalTrac = max(normalTrac, 0.0);
scalar shearTrac = mag( (I - sqr(faceToBreakNormal)) & faceToBreakTraction ); scalar shearTrac = mag( (I - sqr(faceToBreakNormal)) & faceToBreakTraction );
scalar scaleFactor = 1; scalar scaleFactor = 1;
if(cohesivePatchUPtr) if(cohesivePatchUPtr)
{ {
scaleFactor = scaleFactor =
::sqrt(1 / ( ::sqrt(1 / (
(normalTrac/faceToBreakSigmaMax)*(normalTrac/faceToBreakSigmaMax) (normalTrac/faceToBreakSigmaMax)*(normalTrac/faceToBreakSigmaMax)
+ (shearTrac/faceToBreakTauMax)*(shearTrac/faceToBreakTauMax) + (shearTrac/faceToBreakTauMax)*(shearTrac/faceToBreakTauMax)
) ); ) );
} }
else else
{ {
// solidCohesiveFixedModeMix only uses sigmaMax // solidCohesiveFixedModeMix only uses sigmaMax
scaleFactor = scaleFactor =
::sqrt(1 / ( ::sqrt(1 / (
(normalTrac/faceToBreakSigmaMax)*(normalTrac/faceToBreakSigmaMax) (normalTrac/faceToBreakSigmaMax)*(normalTrac/faceToBreakSigmaMax)
+ (shearTrac/faceToBreakSigmaMax)*(shearTrac/faceToBreakSigmaMax) + (shearTrac/faceToBreakSigmaMax)*(shearTrac/faceToBreakSigmaMax)
) ); ) );
} }
faceToBreakTraction *= scaleFactor; faceToBreakTraction *= scaleFactor;
topoChange = true; topoChange = true;
} }
@ -364,29 +364,29 @@ nCoupledFacesToBreak = 0;
faceToBreakNormal = n.boundaryField()[patchID][localIndex]; faceToBreakNormal = n.boundaryField()[patchID][localIndex];
// Scale broken face traction // Scale broken face traction
faceToBreakSigmaMax = sigmaMax.boundaryField()[patchID][localIndex]; faceToBreakSigmaMax = sigmaMax.boundaryField()[patchID][localIndex];
faceToBreakTauMax = tauMax.boundaryField()[patchID][localIndex]; faceToBreakTauMax = tauMax.boundaryField()[patchID][localIndex];
scalar normalTrac = faceToBreakNormal & faceToBreakTraction; scalar normalTrac = faceToBreakNormal & faceToBreakTraction;
normalTrac = max(normalTrac, 0.0); normalTrac = max(normalTrac, 0.0);
scalar shearTrac = mag( (I - sqr(faceToBreakNormal)) & faceToBreakTraction ); scalar shearTrac = mag( (I - sqr(faceToBreakNormal)) & faceToBreakTraction );
scalar scaleFactor = 1; scalar scaleFactor = 1;
if(cohesivePatchUPtr) if(cohesivePatchUPtr)
{ {
scaleFactor = scaleFactor =
::sqrt(1 / ( ::sqrt(1 / (
(normalTrac/faceToBreakSigmaMax)*(normalTrac/faceToBreakSigmaMax) (normalTrac/faceToBreakSigmaMax)*(normalTrac/faceToBreakSigmaMax)
+ (shearTrac/faceToBreakTauMax)*(shearTrac/faceToBreakTauMax) + (shearTrac/faceToBreakTauMax)*(shearTrac/faceToBreakTauMax)
) ); ) );
} }
else else
{ {
// solidCohesiveFixedModeMix only uses sigmaMax // solidCohesiveFixedModeMix only uses sigmaMax
scaleFactor = scaleFactor =
::sqrt(1 / ( ::sqrt(1 / (
(normalTrac/faceToBreakSigmaMax)*(normalTrac/faceToBreakSigmaMax) (normalTrac/faceToBreakSigmaMax)*(normalTrac/faceToBreakSigmaMax)
+ (shearTrac/faceToBreakSigmaMax)*(shearTrac/faceToBreakSigmaMax) + (shearTrac/faceToBreakSigmaMax)*(shearTrac/faceToBreakSigmaMax)
) ); ) );
} }
faceToBreakTraction *= scaleFactor; faceToBreakTraction *= scaleFactor;
@ -422,20 +422,20 @@ nCoupledFacesToBreak = 0;
muf = fvc::interpolate(mu); muf = fvc::interpolate(mu);
lambdaf = fvc::interpolate(lambda); lambdaf = fvc::interpolate(lambda);
// we need to modify propertiess after cracking otherwise momentum equation is wrong // we need to modify propertiess after cracking otherwise momentum equation is wrong
// but solidInterface seems to hold some information about old mesh // but solidInterface seems to hold some information about old mesh
// so we will delete it and make another // so we will delete it and make another
// we could probably add a public clearout function // we could probably add a public clearout function
// create new solidInterface // create new solidInterface
//Pout << "Creating new solidInterface" << endl; //Pout << "Creating new solidInterface" << endl;
//delete solidInterfacePtr; //delete solidInterfacePtr;
//solidInterfacePtr = new solidInterface(mesh, rheology); //solidInterfacePtr = new solidInterface(mesh, rheology);
// delete demand driven data as the mesh has changed // delete demand driven data as the mesh has changed
if(rheology.solidInterfaceActive()) if(rheology.solidInterfaceActive())
{ {
rheology.solInterface().clearOut(); rheology.solInterface().clearOut();
solidInterfacePtr->modifyProperties(muf, lambdaf); solidInterfacePtr->modifyProperties(muf, lambdaf);
} }
// Local crack displacement // Local crack displacement
vectorField UpI = vectorField UpI =
@ -447,21 +447,21 @@ nCoupledFacesToBreak = 0;
vectorField globalUpI = mesh.globalCrackField(UpI); vectorField globalUpI = mesh.globalCrackField(UpI);
vectorField globalOldUpI = mesh.globalCrackField(oldUpI); vectorField globalOldUpI = mesh.globalCrackField(oldUpI);
// mu and lambda field on new crack faces must be updated // mu and lambda field on new crack faces must be updated
scalarField muPI = mu.boundaryField()[cohesivePatchID].patchInternalField(); scalarField muPI = mu.boundaryField()[cohesivePatchID].patchInternalField();
scalarField lambdaPI = lambda.boundaryField()[cohesivePatchID].patchInternalField(); scalarField lambdaPI = lambda.boundaryField()[cohesivePatchID].patchInternalField();
scalarField globalMuPI = mesh.globalCrackField(muPI); scalarField globalMuPI = mesh.globalCrackField(muPI);
scalarField globalLambdaPI = mesh.globalCrackField(lambdaPI); scalarField globalLambdaPI = mesh.globalCrackField(lambdaPI);
// cohesivePatchU.size() // cohesivePatchU.size()
int cohesivePatchSize(cohesivePatchUPtr ? cohesivePatchUPtr->size() : cohesivePatchUFixedModePtr->size()); int cohesivePatchSize(cohesivePatchUPtr ? cohesivePatchUPtr->size() : cohesivePatchUFixedModePtr->size());
// Initialise U for new cohesive face // Initialise U for new cohesive face
const labelList& gcfa = mesh.globalCrackFaceAddressing(); const labelList& gcfa = mesh.globalCrackFaceAddressing();
label globalIndex = mesh.localCrackStart(); label globalIndex = mesh.localCrackStart();
// for (label i=0; i<cohesivePatchU.size(); i++) // for (label i=0; i<cohesivePatchU.size(); i++)
for (label i=0; i<cohesivePatchSize; i++) for (label i=0; i<cohesivePatchSize; i++)
{ {
label oldFaceIndex = faceMap[start+i]; label oldFaceIndex = faceMap[start+i];
// If new face // If new face
@ -480,10 +480,10 @@ nCoupledFacesToBreak = 0;
+ globalOldUpI[gcfa[globalIndex]] + globalOldUpI[gcfa[globalIndex]]
); );
// initialise mu and lambda on new faces // initialise mu and lambda on new faces
// set new face value to value of internal cell // set new face value to value of internal cell
muf.boundaryField()[cohesivePatchID][i] = globalMuPI[globalIndex]; muf.boundaryField()[cohesivePatchID][i] = globalMuPI[globalIndex];
lambdaf.boundaryField()[cohesivePatchID][i] = globalLambdaPI[globalIndex]; lambdaf.boundaryField()[cohesivePatchID][i] = globalLambdaPI[globalIndex];
globalIndex++; globalIndex++;
} }
@ -494,24 +494,24 @@ nCoupledFacesToBreak = 0;
} }
// we must calculate grad using interface // we must calculate grad using interface
// U at the interface has not been calculated yet as interface.correct() // U at the interface has not been calculated yet as interface.correct()
// has not been called yet // has not been called yet
// not really a problem as gradU is correct in second outer iteration // not really a problem as gradU is correct in second outer iteration
// as long as this does not cause convergence problems for the first iterations. // as long as this does not cause convergence problems for the first iterations.
// we should be able to calculate the interface displacements without // we should be able to calculate the interface displacements without
// having to call interface.correct() // having to call interface.correct()
// todo: add calculateInterfaceU() function // todo: add calculateInterfaceU() function
// interface grad uses Gauss, we need least squares // interface grad uses Gauss, we need least squares
//gradU = solidInterfacePtr->grad(U); //gradU = solidInterfacePtr->grad(U);
gradU = fvc::grad(U); // leastSquaresSolidInterface grad scheme gradU = fvc::grad(U); // leastSquaresSolidInterface grad scheme
//snGradU = fvc::snGrad(U); //snGradU = fvc::snGrad(U);
# include "calculateTraction.H" # include "calculateTraction.H"
//if (nFacesToBreak || nCoupledFacesToBreak) mesh.write(); traction.write(); //if (nFacesToBreak || nCoupledFacesToBreak) mesh.write(); traction.write();
// Initialise initiation traction for new cohesive patch face // Initialise initiation traction for new cohesive patch face
// for (label i=0; i<cohesivePatchU.size(); i++) // for (label i=0; i<cohesivePatchU.size(); i++)
for (label i=0; i<cohesivePatchSize; i++) for (label i=0; i<cohesivePatchSize; i++)
{ {
label oldFaceIndex = faceMap[start+i]; label oldFaceIndex = faceMap[start+i];
@ -529,46 +529,46 @@ nCoupledFacesToBreak = 0;
if ((n0&faceToBreakNormal) > SMALL) if ((n0&faceToBreakNormal) > SMALL)
{ {
traction.boundaryField()[cohesivePatchID][i] = traction.boundaryField()[cohesivePatchID][i] =
faceToBreakTraction; faceToBreakTraction;
traction.oldTime().boundaryField()[cohesivePatchID][i] = traction.oldTime().boundaryField()[cohesivePatchID][i] =
faceToBreakTraction; faceToBreakTraction;
if(cohesivePatchUPtr) if(cohesivePatchUPtr)
{ {
cohesivePatchUPtr->traction()[i] = faceToBreakTraction; cohesivePatchUPtr->traction()[i] = faceToBreakTraction;
} }
else else
{ {
cohesivePatchUFixedModePtr->traction()[i] = faceToBreakTraction; cohesivePatchUFixedModePtr->traction()[i] = faceToBreakTraction;
cohesivePatchUFixedModePtr->initiationTraction()[i] = faceToBreakTraction; cohesivePatchUFixedModePtr->initiationTraction()[i] = faceToBreakTraction;
} }
} }
else else
{ {
traction.boundaryField()[cohesivePatchID][i] = traction.boundaryField()[cohesivePatchID][i] =
-faceToBreakTraction; -faceToBreakTraction;
traction.oldTime().boundaryField()[cohesivePatchID][i] = traction.oldTime().boundaryField()[cohesivePatchID][i] =
-faceToBreakTraction; -faceToBreakTraction;
//cohesivePatchU.traction()[i] = -faceToBreakTraction; //cohesivePatchU.traction()[i] = -faceToBreakTraction;
if(cohesivePatchUPtr) if(cohesivePatchUPtr)
{ {
cohesivePatchUPtr->traction()[i] = -faceToBreakTraction; cohesivePatchUPtr->traction()[i] = -faceToBreakTraction;
} }
else else
{ {
cohesivePatchUFixedModePtr->traction()[i] = -faceToBreakTraction; cohesivePatchUFixedModePtr->traction()[i] = -faceToBreakTraction;
cohesivePatchUFixedModePtr->initiationTraction()[i] = -faceToBreakTraction; cohesivePatchUFixedModePtr->initiationTraction()[i] = -faceToBreakTraction;
} }
} }
} }
} }
// hmmnn we only need a reference for very small groups of cells // hmmnn we only need a reference for very small groups of cells
// turn off for now // turn off for now
//# include "updateReference.H" //# include "updateReference.H"
} }
} }

View file

@ -13,11 +13,11 @@
// with a processor boundary // with a processor boundary
//if (U.boundaryField()[patchI].fixesValue()) //if (U.boundaryField()[patchI].fixesValue())
if ( if (
U.boundaryField()[patchI].fixesValue() U.boundaryField()[patchI].fixesValue()
|| ||
mesh.boundaryMesh()[patchI].type() mesh.boundaryMesh()[patchI].type()
== processorPolyPatch::typeName == processorPolyPatch::typeName
) )
{ {
const unallocLabelList& curFaceCells = const unallocLabelList& curFaceCells =
mesh.boundary()[patchI].faceCells(); mesh.boundary()[patchI].faceCells();

View file

@ -88,12 +88,12 @@ if (runTime.outputTime() || topoChange)
( (
IOobject IOobject
( (
"damageAndCracks", "damageAndCracks",
runTime.timeName(), runTime.timeName(),
mesh, mesh,
IOobject::NO_READ, IOobject::NO_READ,
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
mesh, mesh,
dimensionedScalar("zero", dimless, 0.0), dimensionedScalar("zero", dimless, 0.0),
calculatedFvPatchVectorField::typeName calculatedFvPatchVectorField::typeName
@ -102,12 +102,12 @@ if (runTime.outputTime() || topoChange)
( (
IOobject IOobject
( (
"GI", "GI",
runTime.timeName(), runTime.timeName(),
mesh, mesh,
IOobject::NO_READ, IOobject::NO_READ,
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
mesh, mesh,
dimensionedScalar("zero", dimless, 0.0), dimensionedScalar("zero", dimless, 0.0),
calculatedFvPatchVectorField::typeName calculatedFvPatchVectorField::typeName
@ -116,30 +116,30 @@ if (runTime.outputTime() || topoChange)
( (
IOobject IOobject
( (
"GII", "GII",
runTime.timeName(), runTime.timeName(),
mesh, mesh,
IOobject::NO_READ, IOobject::NO_READ,
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
mesh, mesh,
dimensionedScalar("zero", dimless, 0.0), dimensionedScalar("zero", dimless, 0.0),
calculatedFvPatchVectorField::typeName calculatedFvPatchVectorField::typeName
); );
forAll(U.boundaryField(), patchi) forAll(U.boundaryField(), patchi)
{ {
// if(U.boundaryField()[patchi].type() == cohesiveLawMultiMatFvPatchVectorField::typeName) // if(U.boundaryField()[patchi].type() == cohesiveLawMultiMatFvPatchVectorField::typeName)
if(U.boundaryField()[patchi].type() == solidCohesiveFvPatchVectorField::typeName) if(U.boundaryField()[patchi].type() == solidCohesiveFvPatchVectorField::typeName)
{ {
// cohesiveLawMultiMatFvPatchVectorField& Upatch = // cohesiveLawMultiMatFvPatchVectorField& Upatch =
// refCast<cohesiveLawMultiMatFvPatchVectorField>(U.boundaryField()[patchi]); // refCast<cohesiveLawMultiMatFvPatchVectorField>(U.boundaryField()[patchi]);
solidCohesiveFvPatchVectorField& Upatch = solidCohesiveFvPatchVectorField& Upatch =
refCast<solidCohesiveFvPatchVectorField>(U.boundaryField()[patchi]); refCast<solidCohesiveFvPatchVectorField>(U.boundaryField()[patchi]);
GI.boundaryField()[patchi] = Upatch.GI(); GI.boundaryField()[patchi] = Upatch.GI();
GII.boundaryField()[patchi] = Upatch.GII(); GII.boundaryField()[patchi] = Upatch.GII();
damageAndCracks.boundaryField()[patchi] = Upatch.crackingAndDamage(); damageAndCracks.boundaryField()[patchi] = Upatch.crackingAndDamage();
} }
} }
volScalarField GTotal("GTotal", GI + GII); volScalarField GTotal("GTotal", GI + GII);
GTotal.write(); GTotal.write();

View file

@ -2,7 +2,7 @@
if(historyPatchID != -1) if(historyPatchID != -1)
{ {
Info << "Writing disp and force of patch "<<historyPatchName<<" to file" Info << "Writing disp and force of patch "<<historyPatchName<<" to file"
<< endl; << endl;
//- for small strain or moving mesh //- for small strain or moving mesh
vector force = gSum(mesh.boundary()[historyPatchID].Sf() & sigma.boundaryField()[historyPatchID]); vector force = gSum(mesh.boundary()[historyPatchID].Sf() & sigma.boundaryField()[historyPatchID]);
@ -19,17 +19,17 @@ if(historyPatchID != -1)
//- be dotted with the surface normal to give the actual traction/force //- be dotted with the surface normal to give the actual traction/force
//- you cannot just take the component of the sigma tensor //- you cannot just take the component of the sigma tensor
//scalar forcePatchIntegrateMethod = gSum( //scalar forcePatchIntegrateMethod = gSum(
// mesh.magSf().boundaryField()[historyPatchID] // mesh.magSf().boundaryField()[historyPatchID]
// *sigma.boundaryField()[historyPatchID].component(symmTensor::XY) // *sigma.boundaryField()[historyPatchID].component(symmTensor::XY)
// ); // );
vector avDisp = gAverage(U.boundaryField()[historyPatchID]); vector avDisp = gAverage(U.boundaryField()[historyPatchID]);
//- write to file //- write to file
if(Pstream::master()) if(Pstream::master())
{ {
OFstream& forceDispFile = *filePtr; OFstream& forceDispFile = *filePtr;
forceDispFile << avDisp.x() << " " << avDisp.y() << " " << avDisp.z() << " " forceDispFile << avDisp.x() << " " << avDisp.y() << " " << avDisp.z() << " "
<< force.x() << " " << force.y() << " " << force.z() << endl; << force.x() << " " << force.y() << " " << force.z() << endl;
} }
} }

View file

@ -16,9 +16,9 @@ if(iCorr == 0)
scalar sumMagB = gSum(magSqr(b)); scalar sumMagB = gSum(magSqr(b));
if(sumMagB < SMALL) if(sumMagB < SMALL)
{ {
//Warning << "Aitken under-relaxation: denominator less then SMALL" //Warning << "Aitken under-relaxation: denominator less then SMALL"
// << endl; // << endl;
sumMagB += SMALL; sumMagB += SMALL;
} }
aitkenTheta = -aitkenTheta* aitkenTheta = -aitkenTheta*

View file

@ -10,10 +10,10 @@ if(divDSigmaExpMethod == "standard")
{ {
divDSigmaExp = fvc::div divDSigmaExp = fvc::div
( (
muf*(mesh.Sf() & fvc::interpolate(gradDU.T())) muf*(mesh.Sf() & fvc::interpolate(gradDU.T()))
+ lambdaf*(mesh.Sf() & I*fvc::interpolate(tr(gradDU))) + lambdaf*(mesh.Sf() & I*fvc::interpolate(tr(gradDU)))
- (muf + lambdaf)*(mesh.Sf() & fvc::interpolate(gradDU)) - (muf + lambdaf)*(mesh.Sf() & fvc::interpolate(gradDU))
); );
} }
else if(divDSigmaExpMethod == "decompose") else if(divDSigmaExpMethod == "decompose")
{ {
@ -24,13 +24,13 @@ if(divDSigmaExpMethod == "standard")
divDSigmaExp = fvc::div divDSigmaExp = fvc::div
( (
mesh.magSf() mesh.magSf()
*( *(
- (muf + lambdaf)*(snGradDU&(I - n*n)) - (muf + lambdaf)*(snGradDU&(I - n*n))
+ lambdaf*tr(shearGradDU&(I - n*n))*n + lambdaf*tr(shearGradDU&(I - n*n))*n
+ muf*(shearGradDU&n) + muf*(shearGradDU&n)
) )
); );
} }
else if(divDSigmaExpMethod == "expLaplacian") else if(divDSigmaExpMethod == "expLaplacian")
{ {
@ -38,10 +38,10 @@ if(divDSigmaExpMethod == "standard")
- fvc::laplacian(mu + lambda, DU, "laplacian(DDU,DU)") - fvc::laplacian(mu + lambda, DU, "laplacian(DDU,DU)")
+ fvc::div + fvc::div
( (
mu*gradDU.T() mu*gradDU.T()
+ lambda*(I*tr(gradDU)), + lambda*(I*tr(gradDU)),
"div(sigma)" "div(sigma)"
); );
} }
else else
{ {

View file

@ -6,14 +6,14 @@
forAll(mesh.boundary(), patchi) forAll(mesh.boundary(), patchi)
{ {
netForce += netForce +=
sum( sum(
mesh.Sf().boundaryField()[patchi] mesh.Sf().boundaryField()[patchi]
& &
( (
2*mu.boundaryField()[patchi]*symm(gradU.boundaryField()[patchi]) 2*mu.boundaryField()[patchi]*symm(gradU.boundaryField()[patchi])
+ lambda*tr(gradU.boundaryField()[patchi])*I + lambda*tr(gradU.boundaryField()[patchi])*I
) )
); );
} }
forceResidual = mag(netForce); forceResidual = mag(netForce);
} }

View file

@ -28,14 +28,14 @@
// forAll(traction.boundaryField(), patchi) // forAll(traction.boundaryField(), patchi)
// { // {
// if (mesh.boundary()[patchi].type() == "cohesive") // if (mesh.boundary()[patchi].type() == "cohesive")
// { // {
// forAll(traction.boundaryField()[patchi], facei) // forAll(traction.boundaryField()[patchi], facei)
// { // {
// Pout << "face " << facei << " with traction magnitude " // Pout << "face " << facei << " with traction magnitude "
// << mag(traction.boundaryField()[patchi][facei])/1e6 << " MPa and traction " // << mag(traction.boundaryField()[patchi][facei])/1e6 << " MPa and traction "
// << traction.boundaryField()[patchi][facei]/1e6 << " MPa" << endl; // << traction.boundaryField()[patchi][facei]/1e6 << " MPa" << endl;
// } // }
// } // }
// } // }
} }

View file

@ -7,40 +7,40 @@
{ {
if (isA<solidCohesiveFvPatchVectorField>(DU.boundaryField()[patchI])) if (isA<solidCohesiveFvPatchVectorField>(DU.boundaryField()[patchI]))
{ {
cohesivePatchID = patchI; cohesivePatchID = patchI;
cohesivePatchDUPtr = cohesivePatchDUPtr =
&refCast<solidCohesiveFvPatchVectorField> &refCast<solidCohesiveFvPatchVectorField>
( (
DU.boundaryField()[cohesivePatchID] DU.boundaryField()[cohesivePatchID]
); );
break; break;
} }
else if (isA<solidCohesiveFixedModeMixFvPatchVectorField>(DU.boundaryField()[patchI])) else if (isA<solidCohesiveFixedModeMixFvPatchVectorField>(DU.boundaryField()[patchI]))
{ {
cohesivePatchID = patchI; cohesivePatchID = patchI;
cohesivePatchDUFixedModePtr = cohesivePatchDUFixedModePtr =
&refCast<solidCohesiveFixedModeMixFvPatchVectorField> &refCast<solidCohesiveFixedModeMixFvPatchVectorField>
( (
DU.boundaryField()[cohesivePatchID] DU.boundaryField()[cohesivePatchID]
); );
break; break;
} }
} }
if(cohesivePatchID == -1) if(cohesivePatchID == -1)
{ {
FatalErrorIn(args.executable()) FatalErrorIn(args.executable())
<< "Can't find cohesiveLawFvPatch" << nl << "Can't find cohesiveLawFvPatch" << nl
<< "One of the boundary patches in " << DU.name() << ".boundaryField() " << "One of the boundary patches in " << DU.name() << ".boundaryField() "
<< "should be of type " << solidCohesiveFvPatchVectorField::typeName << "should be of type " << solidCohesiveFvPatchVectorField::typeName
<< "or " << solidCohesiveFixedModeMixFvPatchVectorField::typeName << "or " << solidCohesiveFixedModeMixFvPatchVectorField::typeName
<< abort(FatalError); << abort(FatalError);
} }
// solidCohesiveFvPatchVectorField& cohesivePatchDU = // solidCohesiveFvPatchVectorField& cohesivePatchDU =
// refCast<solidCohesiveFvPatchVectorField> // refCast<solidCohesiveFvPatchVectorField>
// ( // (
// DU.boundaryField()[cohesivePatchID] // DU.boundaryField()[cohesivePatchID]
// ); // );
// philipc: I have moved cohesive stuff to constitutiveModel // philipc: I have moved cohesive stuff to constitutiveModel
@ -66,64 +66,64 @@
// limit crack to specified boxes // limit crack to specified boxes
{ {
const dictionary& stressControl = const dictionary& stressControl =
mesh.solutionDict().subDict("solidMechanics"); mesh.solutionDict().subDict("solidMechanics");
List<boundBox> userBoxes(stressControl.lookup("crackLimitingBoxes")); List<boundBox> userBoxes(stressControl.lookup("crackLimitingBoxes"));
const surfaceVectorField& Cf = mesh.Cf(); const surfaceVectorField& Cf = mesh.Cf();
//int numPossibleCrackFaces = 0; //int numPossibleCrackFaces = 0;
forAll(cohesiveZone.internalField(), faceI) forAll(cohesiveZone.internalField(), faceI)
{ {
bool faceInsideBox = false; bool faceInsideBox = false;
forAll(userBoxes, boxi) forAll(userBoxes, boxi)
{ {
if(userBoxes[boxi].contains(Cf.internalField()[faceI])) faceInsideBox = true; if(userBoxes[boxi].contains(Cf.internalField()[faceI])) faceInsideBox = true;
} }
if(faceInsideBox) if(faceInsideBox)
{ {
cohesiveZone.internalField()[faceI] = 1.0; cohesiveZone.internalField()[faceI] = 1.0;
//numPossibleCrackFaces++; //numPossibleCrackFaces++;
} }
} }
//reduce(numPossibleCrackFaces, sumOp<int>()); //reduce(numPossibleCrackFaces, sumOp<int>());
forAll(cohesiveZone.boundaryField(), patchI) forAll(cohesiveZone.boundaryField(), patchI)
{ {
// cracks may go along proc boundaries // cracks may go along proc boundaries
if(mesh.boundaryMesh()[patchI].type() == processorPolyPatch::typeName) if(mesh.boundaryMesh()[patchI].type() == processorPolyPatch::typeName)
{ {
forAll(cohesiveZone.boundaryField()[patchI], faceI) forAll(cohesiveZone.boundaryField()[patchI], faceI)
{ {
bool faceInsideBox = false; bool faceInsideBox = false;
forAll(userBoxes, boxi) forAll(userBoxes, boxi)
{ {
if(userBoxes[boxi].contains(Cf.boundaryField()[patchI][faceI])) faceInsideBox = true; if(userBoxes[boxi].contains(Cf.boundaryField()[patchI][faceI])) faceInsideBox = true;
} }
if(faceInsideBox) if(faceInsideBox)
{ {
cohesiveZone.boundaryField()[patchI][faceI] = 1.0; cohesiveZone.boundaryField()[patchI][faceI] = 1.0;
} }
} }
// numPossibleCrackFaces += int(sum(cohesiveZone.boundaryField()[patchI])); // numPossibleCrackFaces += int(sum(cohesiveZone.boundaryField()[patchI]));
// philipc multiMat cracks not working on proc boundaries yet... disable for now // philipc multiMat cracks not working on proc boundaries yet... disable for now
// found the problem: solidInterface needs to know about mesh changes so // found the problem: solidInterface needs to know about mesh changes so
// I make a new one each time there is a crack // I make a new one each time there is a crack
// int numProcFaces = int(sum(cohesiveZone.boundaryField()[patchI])); // int numProcFaces = int(sum(cohesiveZone.boundaryField()[patchI]));
// if(numProcFaces > 0) // if(numProcFaces > 0)
// { // {
// cohesiveZone.boundaryField()[patchI] = 0.0; // cohesiveZone.boundaryField()[patchI] = 0.0;
// Warning << "Processor boundary cracking is " // Warning << "Processor boundary cracking is "
// << "disabled because it is not working yet for multi-materials." << nl // << "disabled because it is not working yet for multi-materials." << nl
// << "There are " << numProcFaces << " possible cracks " // << "There are " << numProcFaces << " possible cracks "
// << "faces on processor boundary " << mesh.boundary()[patchI].name() // << "faces on processor boundary " << mesh.boundary()[patchI].name()
// << ", which are not allowed to crack." << endl; // << ", which are not allowed to crack." << endl;
// } // }
} }
} }
// Info << "\nNumber of possible cracking faces is " << numPossibleCrackFaces << endl; // Info << "\nNumber of possible cracking faces is " << numPossibleCrackFaces << endl;
Info << "\nThere are " << gSum(cohesiveZone.internalField()) << " potential internal crack faces" << nl << endl; Info << "\nThere are " << gSum(cohesiveZone.internalField()) << " potential internal crack faces" << nl << endl;
@ -131,36 +131,36 @@
// write field for visualisation // write field for visualisation
volScalarField cohesiveZoneVol volScalarField cohesiveZoneVol
( (
IOobject IOobject
( (
"cohesiveZoneVol", "cohesiveZoneVol",
runTime.timeName(), runTime.timeName(),
mesh, mesh,
IOobject::NO_READ, IOobject::NO_READ,
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
mesh, mesh,
dimensionedScalar("zero", dimless, 0.0) dimensionedScalar("zero", dimless, 0.0)
); );
forAll(cohesiveZone.internalField(), facei) forAll(cohesiveZone.internalField(), facei)
{ {
if(cohesiveZone.internalField()[facei]) if(cohesiveZone.internalField()[facei])
{ {
cohesiveZoneVol.internalField()[mesh.owner()[facei]] = 1.0; cohesiveZoneVol.internalField()[mesh.owner()[facei]] = 1.0;
cohesiveZoneVol.internalField()[mesh.neighbour()[facei]] = 1.0; cohesiveZoneVol.internalField()[mesh.neighbour()[facei]] = 1.0;
} }
} }
forAll(cohesiveZone.boundaryField(), patchi) forAll(cohesiveZone.boundaryField(), patchi)
{ {
forAll(cohesiveZone.boundaryField()[patchi], facei) forAll(cohesiveZone.boundaryField()[patchi], facei)
{ {
if(cohesiveZone.boundaryField()[patchi][facei]) if(cohesiveZone.boundaryField()[patchi][facei])
{ {
cohesiveZoneVol.boundaryField()[patchi][facei] = 1.0; cohesiveZoneVol.boundaryField()[patchi][facei] = 1.0;
} }
} }
} }
Info << "Writing cohesiveZone field" << endl; Info << "Writing cohesiveZone field" << endl;
cohesiveZoneVol.write(); cohesiveZoneVol.write();
} }

View file

@ -36,8 +36,8 @@
IOobject::NO_READ, IOobject::NO_READ,
IOobject::NO_WRITE IOobject::NO_WRITE
), ),
mesh, mesh,
dimensionedVector("zero", dimless, vector::zero) dimensionedVector("zero", dimless, vector::zero)
); );
Info<< "Creating field U\n" << endl; Info<< "Creating field U\n" << endl;
@ -59,12 +59,12 @@
( (
IOobject IOobject
( (
"DEpsilon", "DEpsilon",
runTime.timeName(), runTime.timeName(),
mesh, mesh,
IOobject::READ_IF_PRESENT, IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
mesh, mesh,
dimensionedSymmTensor("zero", dimless, symmTensor::zero) dimensionedSymmTensor("zero", dimless, symmTensor::zero)
); );
@ -155,7 +155,7 @@ constitutiveModel rheology(sigma, DU);
IOobject::NO_WRITE IOobject::NO_WRITE
), ),
mesh, mesh,
dimensionedVector("zero", dimLength, vector::zero) dimensionedVector("zero", dimLength, vector::zero)
); );
// aitken relaxation factor // aitken relaxation factor
scalar aitkenInitialRes = 1.0; scalar aitkenInitialRes = 1.0;

View file

@ -4,14 +4,14 @@ label historyPatchID = mesh.boundaryMesh().findPatchID(historyPatchName);
if(historyPatchID == -1) if(historyPatchID == -1)
{ {
Warning << "history patch " << historyPatchName Warning << "history patch " << historyPatchName
<< " not found. Force-displacement will not be written" << " not found. Force-displacement will not be written"
<< endl; << endl;
} }
else if(Pstream::master()) else if(Pstream::master())
{ {
Info << "Force-displacement for patch " << historyPatchName Info << "Force-displacement for patch " << historyPatchName
<< " will be written to forceDisp.dat" << " will be written to forceDisp.dat"
<< endl; << endl;
filePtr = new OFstream("forceDisp.dat"); filePtr = new OFstream("forceDisp.dat");
OFstream& forceDispFile = *filePtr; OFstream& forceDispFile = *filePtr;
forceDispFile << "#Disp(mm)\tForce(N)" << endl; forceDispFile << "#Disp(mm)\tForce(N)" << endl;

View file

@ -4,6 +4,6 @@ Info << "Selecting divDSigmaExp calculation method " << divDSigmaExpMethod << e
if(divDSigmaExpMethod != "standard" && divDSigmaExpMethod != "surface" && divDSigmaExpMethod != "decompose" && divDSigmaExpMethod != "laplacian") if(divDSigmaExpMethod != "standard" && divDSigmaExpMethod != "surface" && divDSigmaExpMethod != "decompose" && divDSigmaExpMethod != "laplacian")
{ {
FatalError << "divDSigmaExp method " << divDSigmaExpMethod << " not found!" << nl FatalError << "divDSigmaExp method " << divDSigmaExpMethod << " not found!" << nl
<< "valid methods are:\nstandard\nsurface\ndecompose\nlaplacian" << "valid methods are:\nstandard\nsurface\ndecompose\nlaplacian"
<< exit(FatalError); << exit(FatalError);
} }

View file

@ -15,16 +15,16 @@ if (dynamicTimeStep)
scalar newDeltaT = deltaTmin; scalar newDeltaT = deltaTmin;
if (newDeltaT/runTime.deltaT().value() < 0.5) if (newDeltaT/runTime.deltaT().value() < 0.5)
{ {
newDeltaT = 0.5*runTime.deltaT().value(); newDeltaT = 0.5*runTime.deltaT().value();
Info << "Reducing time step" << nl; Info << "Reducing time step" << nl;
} }
runTime.setDeltaT(newDeltaT); runTime.setDeltaT(newDeltaT);
} }
Pout << "Current time step size: " Pout << "Current time step size: "
<< runTime.deltaT().value() << " s" << endl; << runTime.deltaT().value() << " s" << endl;
scalar maxDT = runTime.deltaT().value(); scalar maxDT = runTime.deltaT().value();

View file

@ -138,39 +138,39 @@ nCoupledFacesToBreak = 0;
if (mesh.boundary()[patchI].coupled()) if (mesh.boundary()[patchI].coupled())
{ {
// scalarField pEffTraction = // scalarField pEffTraction =
// cohesiveZone.boundaryField()[patchI] * // cohesiveZone.boundaryField()[patchI] *
// mag(traction.boundaryField()[patchI]); // mag(traction.boundaryField()[patchI]);
// scalarField pEffTractionFraction = pEffTraction/sigmaMax.boundaryField()[patchI]; // scalarField pEffTractionFraction = pEffTraction/sigmaMax.boundaryField()[patchI];
scalarField pNormalTraction = scalarField pNormalTraction =
cohesiveZone.boundaryField()[patchI]* cohesiveZone.boundaryField()[patchI]*
( n.boundaryField()[patchI] & traction.boundaryField()[patchI] ); ( n.boundaryField()[patchI] & traction.boundaryField()[patchI] );
// only consider tensile tractions // only consider tensile tractions
pNormalTraction = max(pNormalTraction, scalar(0)); pNormalTraction = max(pNormalTraction, scalar(0));
scalarField pShearTraction = scalarField pShearTraction =
cohesiveZone.boundaryField()[patchI] * cohesiveZone.boundaryField()[patchI] *
mag( (I - Foam::sqr(n.boundaryField()[patchI])) & traction.boundaryField()[patchI] ); mag( (I - Foam::sqr(n.boundaryField()[patchI])) & traction.boundaryField()[patchI] );
// the traction fraction is monitored to decide which faces to break: // the traction fraction is monitored to decide which faces to break:
// ie (tN/tNC)^2 + (tS/tSC)^2 >1 to crack a face // ie (tN/tNC)^2 + (tS/tSC)^2 >1 to crack a face
const scalarField& pSigmaMax = sigmaMax.boundaryField()[patchI]; const scalarField& pSigmaMax = sigmaMax.boundaryField()[patchI];
const scalarField& pTauMax = tauMax.boundaryField()[patchI]; const scalarField& pTauMax = tauMax.boundaryField()[patchI];
// scalarField pEffTractionFraction = // scalarField pEffTractionFraction =
// (pNormalTraction/pSigmaMax)*(pNormalTraction/pSigmaMax) + (pShearTraction/pTauMax)*(pShearTraction/pTauMax); // (pNormalTraction/pSigmaMax)*(pNormalTraction/pSigmaMax) + (pShearTraction/pTauMax)*(pShearTraction/pTauMax);
scalarField pEffTractionFraction(pNormalTraction.size(), 0.0); scalarField pEffTractionFraction(pNormalTraction.size(), 0.0);
if(cohesivePatchDUPtr) if(cohesivePatchDUPtr)
{ {
pEffTractionFraction = pEffTractionFraction =
(pNormalTraction/pSigmaMax)*(pNormalTraction/pSigmaMax) + (pShearTraction/pTauMax)*(pShearTraction/pTauMax); (pNormalTraction/pSigmaMax)*(pNormalTraction/pSigmaMax) + (pShearTraction/pTauMax)*(pShearTraction/pTauMax);
} }
else else
{ {
// solidCohesiveFixedModeMix only uses sigmaMax // solidCohesiveFixedModeMix only uses sigmaMax
pEffTractionFraction = pEffTractionFraction =
(pNormalTraction/pSigmaMax)*(pNormalTraction/pSigmaMax) + (pShearTraction/pSigmaMax)*(pShearTraction/pSigmaMax); (pNormalTraction/pSigmaMax)*(pNormalTraction/pSigmaMax) + (pShearTraction/pSigmaMax)*(pShearTraction/pSigmaMax);
} }
label start = mesh.boundaryMesh()[patchI].start(); label start = mesh.boundaryMesh()[patchI].start();
@ -182,9 +182,9 @@ nCoupledFacesToBreak = 0;
maxEffTractionFraction = pEffTractionFraction[faceI]; maxEffTractionFraction = pEffTractionFraction[faceI];
} }
if (pEffTractionFraction[faceI] > 1.0) if (pEffTractionFraction[faceI] > 1.0)
{ {
//Pout << "coupled face to break " << faceI << endl; //Pout << "coupled face to break " << faceI << endl;
coupledFacesToBreakList.insert(start + faceI); coupledFacesToBreakList.insert(start + faceI);
coupledFacesToBreakEffTractionFractionList.insert coupledFacesToBreakEffTractionFractionList.insert
( (
@ -347,31 +347,31 @@ nCoupledFacesToBreak = 0;
faceToBreakNormal = n.internalField()[faceToBreakIndex]; faceToBreakNormal = n.internalField()[faceToBreakIndex];
// Scale broken face traction // Scale broken face traction
// The scale factor is derived by solving the following eqn for alpha: // The scale factor is derived by solving the following eqn for alpha:
// (alpha*tN/tNC)^2 + (alpha*tS/tSC)^2 = 1 // (alpha*tN/tNC)^2 + (alpha*tS/tSC)^2 = 1
faceToBreakSigmaMax = sigmaMaxI[faceToBreakIndex]; faceToBreakSigmaMax = sigmaMaxI[faceToBreakIndex];
faceToBreakTauMax = tauMaxI[faceToBreakIndex]; faceToBreakTauMax = tauMaxI[faceToBreakIndex];
scalar normalTrac = faceToBreakNormal & faceToBreakTraction; scalar normalTrac = faceToBreakNormal & faceToBreakTraction;
normalTrac = max(normalTrac, 0.0); normalTrac = max(normalTrac, 0.0);
scalar shearTrac = mag( (I - sqr(faceToBreakNormal)) & faceToBreakTraction ); scalar shearTrac = mag( (I - sqr(faceToBreakNormal)) & faceToBreakTraction );
scalar scaleFactor = 1; scalar scaleFactor = 1;
if(cohesivePatchDUPtr) if(cohesivePatchDUPtr)
{ {
scaleFactor = scaleFactor =
::sqrt(1 / ( ::sqrt(1 / (
(normalTrac/faceToBreakSigmaMax)*(normalTrac/faceToBreakSigmaMax) (normalTrac/faceToBreakSigmaMax)*(normalTrac/faceToBreakSigmaMax)
+ (shearTrac/faceToBreakTauMax)*(shearTrac/faceToBreakTauMax) + (shearTrac/faceToBreakTauMax)*(shearTrac/faceToBreakTauMax)
) ); ) );
} }
else else
{ {
// solidCohesiveFixedModeMix only uses sigmaMax // solidCohesiveFixedModeMix only uses sigmaMax
scaleFactor = scaleFactor =
::sqrt(1 / ( ::sqrt(1 / (
(normalTrac/faceToBreakSigmaMax)*(normalTrac/faceToBreakSigmaMax) (normalTrac/faceToBreakSigmaMax)*(normalTrac/faceToBreakSigmaMax)
+ (shearTrac/faceToBreakSigmaMax)*(shearTrac/faceToBreakSigmaMax) + (shearTrac/faceToBreakSigmaMax)*(shearTrac/faceToBreakSigmaMax)
) ); ) );
} }
faceToBreakTraction *= scaleFactor; faceToBreakTraction *= scaleFactor;
@ -388,15 +388,15 @@ nCoupledFacesToBreak = 0;
faceToBreakNormal = n.boundaryField()[patchID][localIndex]; faceToBreakNormal = n.boundaryField()[patchID][localIndex];
// Scale broken face traction // Scale broken face traction
faceToBreakSigmaMax = sigmaMax.boundaryField()[patchID][localIndex]; faceToBreakSigmaMax = sigmaMax.boundaryField()[patchID][localIndex];
faceToBreakTauMax = tauMax.boundaryField()[patchID][localIndex]; faceToBreakTauMax = tauMax.boundaryField()[patchID][localIndex];
scalar normalTrac = faceToBreakNormal & faceToBreakTraction; scalar normalTrac = faceToBreakNormal & faceToBreakTraction;
normalTrac = max(normalTrac, scalar(0)); normalTrac = max(normalTrac, scalar(0));
scalar shearTrac = mag( (I - sqr(faceToBreakNormal)) & faceToBreakTraction ); scalar shearTrac = mag( (I - sqr(faceToBreakNormal)) & faceToBreakTraction );
scalar scaleFactor = 1; scalar scaleFactor = 1;
if(cohesivePatchDUPtr) if(cohesivePatchDUPtr)
{ {
scaleFactor = scaleFactor =
Foam::sqrt Foam::sqrt
( (
1/ 1/
@ -407,10 +407,10 @@ nCoupledFacesToBreak = 0;
) )
); );
} }
else else
{ {
// solidCohesiveFixedModeMix only uses sigmaMax // solidCohesiveFixedModeMix only uses sigmaMax
scaleFactor = scaleFactor =
Foam::sqrt Foam::sqrt
( (
1/ 1/
@ -447,7 +447,7 @@ nCoupledFacesToBreak = 0;
Pout << "Coupled face to break: " << coupledFaceToBreak << endl; Pout << "Coupled face to break: " << coupledFaceToBreak << endl;
mesh.setBreak(faceToBreak, faceToBreakFlip, coupledFaceToBreak); mesh.setBreak(faceToBreak, faceToBreakFlip, coupledFaceToBreak);
mesh.update(); mesh.update();
const labelList& faceMap = mesh.topoChangeMap().faceMap(); const labelList& faceMap = mesh.topoChangeMap().faceMap();
label start = mesh.boundaryMesh()[cohesivePatchID].start(); label start = mesh.boundaryMesh()[cohesivePatchID].start();
@ -457,19 +457,19 @@ nCoupledFacesToBreak = 0;
muf = fvc::interpolate(mu); muf = fvc::interpolate(mu);
lambdaf = fvc::interpolate(lambda); lambdaf = fvc::interpolate(lambda);
// we need to modify propertiess after cracking otherwise momentum equation is wrong // we need to modify propertiess after cracking otherwise momentum equation is wrong
// but solidInterface seems to hold some information about old mesh // but solidInterface seems to hold some information about old mesh
// so we will delete it and make another // so we will delete it and make another
// we could probably add a public clearout function // we could probably add a public clearout function
// create new solidInterface // create new solidInterface
if(rheology.solidInterfaceActive()) if(rheology.solidInterfaceActive())
{ {
rheology.solInterface().clearOut(); rheology.solInterface().clearOut();
solidInterfacePtr->modifyProperties(muf, lambdaf); solidInterfacePtr->modifyProperties(muf, lambdaf);
} }
// All values on the new crack faces get set to zero // All values on the new crack faces get set to zero
// so we must manually correct them // so we must manually correct them
const vectorField DUpI = const vectorField DUpI =
DU.boundaryField()[cohesivePatchID].patchInternalField(); DU.boundaryField()[cohesivePatchID].patchInternalField();
const vectorField oldDUpI = const vectorField oldDUpI =
@ -492,8 +492,8 @@ nCoupledFacesToBreak = 0;
const scalarField globalMuPI = mesh.globalCrackField(muPI); const scalarField globalMuPI = mesh.globalCrackField(muPI);
const scalarField globalLambdaPI = mesh.globalCrackField(lambdaPI); const scalarField globalLambdaPI = mesh.globalCrackField(lambdaPI);
// cohesivePatchU.size() // cohesivePatchU.size()
int cohesivePatchSize(cohesivePatchDUPtr ? cohesivePatchDUPtr->size() : cohesivePatchDUFixedModePtr->size()); int cohesivePatchSize(cohesivePatchDUPtr ? cohesivePatchDUPtr->size() : cohesivePatchDUFixedModePtr->size());
// Initialise fields for new cohesive face // Initialise fields for new cohesive face
const labelList& gcfa = mesh.globalCrackFaceAddressing(); const labelList& gcfa = mesh.globalCrackFaceAddressing();
@ -506,9 +506,9 @@ nCoupledFacesToBreak = 0;
// If new face // If new face
if (oldFaceIndex == faceToBreakIndex) if (oldFaceIndex == faceToBreakIndex)
{ {
// set to average of old cell centres // set to average of old cell centres
// hmnnn it would be better to interpolate // hmnnn it would be better to interpolate
// using weights... OK for now: future work // using weights... OK for now: future work
DU.boundaryField()[cohesivePatchID][i] = DU.boundaryField()[cohesivePatchID][i] =
0.5 0.5
*( *(
@ -540,10 +540,10 @@ nCoupledFacesToBreak = 0;
+ globalsigmapI[gcfa[globalIndex]] + globalsigmapI[gcfa[globalIndex]]
); );
// initialise mu and lambda on new faces // initialise mu and lambda on new faces
// set new face value to value of internal cell // set new face value to value of internal cell
muf.boundaryField()[cohesivePatchID][i] = globalMuPI[globalIndex]; muf.boundaryField()[cohesivePatchID][i] = globalMuPI[globalIndex];
lambdaf.boundaryField()[cohesivePatchID][i] = globalLambdaPI[globalIndex]; lambdaf.boundaryField()[cohesivePatchID][i] = globalLambdaPI[globalIndex];
globalIndex++; globalIndex++;
} }
@ -554,24 +554,24 @@ nCoupledFacesToBreak = 0;
} }
// we must calculate grad using interface // we must calculate grad using interface
// DU at the interface has not been calculated yet as interface.correct() // DU at the interface has not been calculated yet as interface.correct()
// has not been called yet // has not been called yet
// not really a problem as gradDU is correct in second outer iteration // not really a problem as gradDU is correct in second outer iteration
// as long as this does not cause convergence problems for the first iterations. // as long as this does not cause convergence problems for the first iterations.
// we should be able to calculate the interface displacements without // we should be able to calculate the interface displacements without
// having to call interface.correct() // having to call interface.correct()
// todo: add calculateInterfaceDU() function // todo: add calculateInterfaceDU() function
// interface grad uses Gauss, we need least squares // interface grad uses Gauss, we need least squares
gradDU = fvc::grad(DU); // leastSquaresSolidInterface grad scheme gradDU = fvc::grad(DU); // leastSquaresSolidInterface grad scheme
//gradDU = solidInterfacePtr->grad(DU); //gradDU = solidInterfacePtr->grad(DU);
//snGradDU = fvc::snGrad(DU); //snGradDU = fvc::snGrad(DU);
# include "calculateTraction.H" # include "calculateTraction.H"
//if (nFacesToBreak || nCoupledFacesToBreak) mesh.write(); traction.write(); //if (nFacesToBreak || nCoupledFacesToBreak) mesh.write(); traction.write();
// Initialise initiation traction for new cohesive patch face // Initialise initiation traction for new cohesive patch face
// we also need to update the traction_ field in the crack boundary condition // we also need to update the traction_ field in the crack boundary condition
// this is because it cannot set itself during mapping. // this is because it cannot set itself during mapping.
//for (label i=0; i<cohesivePatchDU.size(); i++) //for (label i=0; i<cohesivePatchDU.size(); i++)
for (label i=0; i<cohesivePatchSize; i++) for (label i=0; i<cohesivePatchSize; i++)
{ {
@ -591,49 +591,49 @@ nCoupledFacesToBreak = 0;
if ((n0&faceToBreakNormal) > SMALL) if ((n0&faceToBreakNormal) > SMALL)
{ {
traction.boundaryField()[cohesivePatchID][i] = traction.boundaryField()[cohesivePatchID][i] =
faceToBreakTraction; faceToBreakTraction;
traction.oldTime().boundaryField()[cohesivePatchID][i] = traction.oldTime().boundaryField()[cohesivePatchID][i] =
faceToBreakTraction; faceToBreakTraction;
// this seems to slow convergence in some simple test cases... // this seems to slow convergence in some simple test cases...
// but surely it should be better update it // but surely it should be better update it
//cohesivePatchDU.traction()[i] = faceToBreakTraction; //cohesivePatchDU.traction()[i] = faceToBreakTraction;
if(cohesivePatchDUPtr) if(cohesivePatchDUPtr)
{ {
cohesivePatchDUPtr->traction()[i] = faceToBreakTraction; cohesivePatchDUPtr->traction()[i] = faceToBreakTraction;
} }
else else
{ {
cohesivePatchDUFixedModePtr->traction()[i] = faceToBreakTraction; cohesivePatchDUFixedModePtr->traction()[i] = faceToBreakTraction;
cohesivePatchDUFixedModePtr->initiationTraction()[i] = faceToBreakTraction; cohesivePatchDUFixedModePtr->initiationTraction()[i] = faceToBreakTraction;
} }
} }
else else
{ {
traction.boundaryField()[cohesivePatchID][i] = traction.boundaryField()[cohesivePatchID][i] =
-faceToBreakTraction; -faceToBreakTraction;
traction.oldTime().boundaryField()[cohesivePatchID][i] = traction.oldTime().boundaryField()[cohesivePatchID][i] =
-faceToBreakTraction; -faceToBreakTraction;
//cohesivePatchDU.traction()[i] = -faceToBreakTraction; //cohesivePatchDU.traction()[i] = -faceToBreakTraction;
if(cohesivePatchDUPtr) if(cohesivePatchDUPtr)
{ {
cohesivePatchDUPtr->traction()[i] = -faceToBreakTraction; cohesivePatchDUPtr->traction()[i] = -faceToBreakTraction;
} }
else else
{ {
cohesivePatchDUFixedModePtr->traction()[i] = -faceToBreakTraction; cohesivePatchDUFixedModePtr->traction()[i] = -faceToBreakTraction;
cohesivePatchDUFixedModePtr->initiationTraction()[i] = -faceToBreakTraction; cohesivePatchDUFixedModePtr->initiationTraction()[i] = -faceToBreakTraction;
} }
} }
} }
} }
// hmmnn we only need a reference for very small groups of cells // hmmnn we only need a reference for very small groups of cells
// turn off for now // turn off for now
//# include "updateReference.H" //# include "updateReference.H"
} }
} }

View file

@ -13,11 +13,11 @@
// with a processor boundary // with a processor boundary
//if (U.boundaryField()[patchI].fixesValue()) //if (U.boundaryField()[patchI].fixesValue())
if ( if (
U.boundaryField()[patchI].fixesValue() U.boundaryField()[patchI].fixesValue()
|| ||
mesh.boundaryMesh()[patchI].type() mesh.boundaryMesh()[patchI].type()
== processorPolyPatch::typeName == processorPolyPatch::typeName
) )
{ {
const unallocLabelList& curFaceCells = const unallocLabelList& curFaceCells =
mesh.boundary()[patchI].faceCells(); mesh.boundary()[patchI].faceCells();

View file

@ -88,23 +88,23 @@ if (runTime.outputTime() || topoChange)
// ( // (
// IOobject // IOobject
// ( // (
// "tractionBoundary", // "tractionBoundary",
// runTime.timeName(), // runTime.timeName(),
// mesh, // mesh,
// IOobject::NO_READ, // IOobject::NO_READ,
// IOobject::AUTO_WRITE // IOobject::AUTO_WRITE
// ), // ),
// mesh, // mesh,
// dimensionedVector("zero", dimForce/dimArea, vector::zero) // dimensionedVector("zero", dimForce/dimArea, vector::zero)
// ); // );
// surfaceVectorField n = mesh.Sf()/mesh.magSf(); // surfaceVectorField n = mesh.Sf()/mesh.magSf();
// forAll(tractionBoundary.boundaryField(), patchi) // forAll(tractionBoundary.boundaryField(), patchi)
// { // {
// if(mesh.boundaryMesh()[patchi].type() != processorPolyPatch::typeName) // if(mesh.boundaryMesh()[patchi].type() != processorPolyPatch::typeName)
// { // {
// tractionBoundary.boundaryField()[patchi] = // tractionBoundary.boundaryField()[patchi] =
// n.boundaryField()[patchi] & sigma.boundaryField()[patchi]; // n.boundaryField()[patchi] & sigma.boundaryField()[patchi];
// } // }
// } // }
@ -113,12 +113,12 @@ if (runTime.outputTime() || topoChange)
( (
IOobject IOobject
( (
"damageAndCracks", "damageAndCracks",
runTime.timeName(), runTime.timeName(),
mesh, mesh,
IOobject::NO_READ, IOobject::NO_READ,
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
mesh, mesh,
dimensionedScalar("zero", dimless, 0.0), dimensionedScalar("zero", dimless, 0.0),
calculatedFvPatchVectorField::typeName calculatedFvPatchVectorField::typeName
@ -127,12 +127,12 @@ if (runTime.outputTime() || topoChange)
( (
IOobject IOobject
( (
"GI", "GI",
runTime.timeName(), runTime.timeName(),
mesh, mesh,
IOobject::NO_READ, IOobject::NO_READ,
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
mesh, mesh,
dimensionedScalar("zero", dimless, 0.0), dimensionedScalar("zero", dimless, 0.0),
calculatedFvPatchVectorField::typeName calculatedFvPatchVectorField::typeName
@ -141,30 +141,30 @@ if (runTime.outputTime() || topoChange)
( (
IOobject IOobject
( (
"GII", "GII",
runTime.timeName(), runTime.timeName(),
mesh, mesh,
IOobject::NO_READ, IOobject::NO_READ,
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
mesh, mesh,
dimensionedScalar("zero", dimless, 0.0), dimensionedScalar("zero", dimless, 0.0),
calculatedFvPatchVectorField::typeName calculatedFvPatchVectorField::typeName
); );
forAll(DU.boundaryField(), patchi) forAll(DU.boundaryField(), patchi)
{ {
// if(DU.boundaryField()[patchi].type() == cohesiveLawMultiMatFvPatchVectorField::typeName) // if(DU.boundaryField()[patchi].type() == cohesiveLawMultiMatFvPatchVectorField::typeName)
if(DU.boundaryField()[patchi].type() == solidCohesiveFvPatchVectorField::typeName) if(DU.boundaryField()[patchi].type() == solidCohesiveFvPatchVectorField::typeName)
{ {
// cohesiveLawMultiMatFvPatchVectorField& DUpatch = // cohesiveLawMultiMatFvPatchVectorField& DUpatch =
// refCast<cohesiveLawMultiMatFvPatchVectorField>(DU.boundaryField()[patchi]); // refCast<cohesiveLawMultiMatFvPatchVectorField>(DU.boundaryField()[patchi]);
solidCohesiveFvPatchVectorField& DUpatch = solidCohesiveFvPatchVectorField& DUpatch =
refCast<solidCohesiveFvPatchVectorField>(DU.boundaryField()[patchi]); refCast<solidCohesiveFvPatchVectorField>(DU.boundaryField()[patchi]);
GI.boundaryField()[patchi] = DUpatch.GI(); GI.boundaryField()[patchi] = DUpatch.GI();
GII.boundaryField()[patchi] = DUpatch.GII(); GII.boundaryField()[patchi] = DUpatch.GII();
damageAndCracks.boundaryField()[patchi] = DUpatch.crackingAndDamage(); damageAndCracks.boundaryField()[patchi] = DUpatch.crackingAndDamage();
} }
} }
//Info << "done" << endl; //Info << "done" << endl;

View file

@ -2,16 +2,16 @@
if(historyPatchID != -1) if(historyPatchID != -1)
{ {
Info << "Found patch "<<historyPatchName<<", writing y force and displacement to file" Info << "Found patch "<<historyPatchName<<", writing y force and displacement to file"
<< endl; << endl;
//- calculate force in specified direction on topClamp patch //- calculate force in specified direction on topClamp patch
vector direction(0, 1, 0); vector direction(0, 1, 0);
//- for small strain or moving mesh //- for small strain or moving mesh
scalar force = gSum( scalar force = gSum(
direction & direction &
(mesh.boundary()[historyPatchID].Sf() & sigma.boundaryField()[historyPatchID]) (mesh.boundary()[historyPatchID].Sf() & sigma.boundaryField()[historyPatchID])
); );
//- for large strain total lagrangian //- for large strain total lagrangian
// tensorField F = I + gradU.boundaryField()[historyPatchID]; // tensorField F = I + gradU.boundaryField()[historyPatchID];
@ -25,16 +25,16 @@ if(historyPatchID != -1)
//- be dotted with the surface normal to give the actual traction/force //- be dotted with the surface normal to give the actual traction/force
//- you cannot just take the component of the sigma tensor //- you cannot just take the component of the sigma tensor
//scalar forcePatchIntegrateMethod = gSum( //scalar forcePatchIntegrateMethod = gSum(
// mesh.magSf().boundaryField()[historyPatchID] // mesh.magSf().boundaryField()[historyPatchID]
// *sigma.boundaryField()[historyPatchID].component(symmTensor::XY) // *sigma.boundaryField()[historyPatchID].component(symmTensor::XY)
// ); // );
scalar disp = max(U.boundaryField()[historyPatchID].component(vector::Y)); scalar disp = max(U.boundaryField()[historyPatchID].component(vector::Y));
//- write to file //- write to file
if(Pstream::master()) if(Pstream::master())
{ {
OFstream& forceDispFile = *filePtr; OFstream& forceDispFile = *filePtr;
forceDispFile << disp << "\t" << force << endl; forceDispFile << disp << "\t" << force << endl;
} }
} }

View file

@ -13,7 +13,7 @@ else if(divDSigmaExpMethod == "surface")
muf*(mesh.Sf() & fvc::interpolate(gradDU.T())) muf*(mesh.Sf() & fvc::interpolate(gradDU.T()))
+ lambdaf*(mesh.Sf() & I*fvc::interpolate(tr(gradDU))) + lambdaf*(mesh.Sf() & I*fvc::interpolate(tr(gradDU)))
- (muf + lambdaf)*(mesh.Sf() & fvc::interpolate(gradDU)) - (muf + lambdaf)*(mesh.Sf() & fvc::interpolate(gradDU))
); );
} }
else if(divDSigmaExpMethod == "decompose") else if(divDSigmaExpMethod == "decompose")
{ {

View file

@ -17,6 +17,6 @@
{ {
FatalErrorIn(args.executable()) FatalErrorIn(args.executable())
<< "divSigmaExp method " << divDSigmaExpMethod << " not found! " << "divSigmaExp method " << divDSigmaExpMethod << " not found! "
<< "valid methods are:\nstandard\nsurface\ndecompose\nlaplacian" << "valid methods are:\nstandard\nsurface\ndecompose\nlaplacian"
<< exit(FatalError); << exit(FatalError);
} }

View file

@ -8,17 +8,17 @@ if(leftPatchID == -1)
//- calculate force in x direction on leftClamp patch //- calculate force in x direction on leftClamp patch
scalar leftForce = gSum( scalar leftForce = gSum(
vector(1, 0, 0) & vector(1, 0, 0) &
(mesh.boundary()[leftPatchID].Sf() & sigma.boundaryField()[leftPatchID]) (mesh.boundary()[leftPatchID].Sf() & sigma.boundaryField()[leftPatchID])
); );
//- patchIntegrate utility integrates it this way but this is worng because the sigma tensor should //- patchIntegrate utility integrates it this way but this is worng because the sigma tensor should
//- be dotted with the surface normal to give the actual traction/force //- be dotted with the surface normal to give the actual traction/force
//- you cannot just take the component of the sigma tensor //- you cannot just take the component of the sigma tensor
//scalar leftForcePatchIntegrateMethod = gSum( //scalar leftForcePatchIntegrateMethod = gSum(
// mesh.magSf().boundaryField()[leftPatchID] // mesh.magSf().boundaryField()[leftPatchID]
// *sigma.boundaryField()[leftPatchID].component(symmTensor::XY) // *sigma.boundaryField()[leftPatchID].component(symmTensor::XY)
// ); // );
vector gaugeU1 = vector::zero; vector gaugeU1 = vector::zero;
vector gaugeU2 = vector::zero; vector gaugeU2 = vector::zero;

View file

@ -24,8 +24,8 @@
IOobject::READ_IF_PRESENT, IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
mesh, mesh,
dimensionedVector("zero", dimLength, vector::zero) dimensionedVector("zero", dimLength, vector::zero)
); );
volTensorField gradU volTensorField gradU
@ -38,8 +38,8 @@
IOobject::READ_IF_PRESENT, IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
mesh, mesh,
dimensionedTensor("zero", dimless, tensor::zero) dimensionedTensor("zero", dimless, tensor::zero)
); );
//- increment of Green finite strain tensor //- increment of Green finite strain tensor
@ -53,8 +53,8 @@
IOobject::READ_IF_PRESENT, IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
mesh, mesh,
dimensionedSymmTensor("zero", dimless, symmTensor::zero) dimensionedSymmTensor("zero", dimless, symmTensor::zero)
); );
//- Green strain tensor //- Green strain tensor
@ -68,8 +68,8 @@
IOobject::READ_IF_PRESENT, IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
mesh, mesh,
dimensionedSymmTensor("zero", dimless, symmTensor::zero) dimensionedSymmTensor("zero", dimless, symmTensor::zero)
); );
@ -99,8 +99,8 @@
IOobject::READ_IF_PRESENT, IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
mesh, mesh,
dimensionedSymmTensor("zero", dimForce/dimArea, symmTensor::zero) dimensionedSymmTensor("zero", dimForce/dimArea, symmTensor::zero)
); );
constitutiveModel rheology(sigma, DU); constitutiveModel rheology(sigma, DU);

View file

@ -4,33 +4,33 @@ if (runTime.outputTime())
( (
IOobject IOobject
( (
"epsilonEq", "epsilonEq",
runTime.timeName(), runTime.timeName(),
mesh, mesh,
IOobject::NO_READ, IOobject::NO_READ,
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
sqrt((2.0/3.0)*magSqr(dev(epsilon))) sqrt((2.0/3.0)*magSqr(dev(epsilon)))
); );
Info<< "Max epsilonEq = " << max(epsilonEq).value() Info<< "Max epsilonEq = " << max(epsilonEq).value()
<< endl; << endl;
volScalarField sigmaEq volScalarField sigmaEq
( (
IOobject IOobject
( (
"sigmaEq", "sigmaEq",
runTime.timeName(), runTime.timeName(),
mesh, mesh,
IOobject::NO_READ, IOobject::NO_READ,
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
sqrt((3.0/2.0)*magSqr(dev(sigma))) sqrt((3.0/2.0)*magSqr(dev(sigma)))
); );
Info<< "Max sigmaEq = " << max(sigmaEq).value() Info<< "Max sigmaEq = " << max(sigmaEq).value()
<< endl; << endl;
//- Calculate Cauchy stress //- Calculate Cauchy stress
volTensorField F = I + gradU; volTensorField F = I + gradU;
@ -43,12 +43,12 @@ if (runTime.outputTime())
( (
IOobject IOobject
( (
"sigmaCauchy", "sigmaCauchy",
runTime.timeName(), runTime.timeName(),
mesh, mesh,
IOobject::NO_READ, IOobject::NO_READ,
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
(1/J) * symm(F.T() & sigma & F) (1/J) * symm(F.T() & sigma & F)
); );
@ -57,29 +57,29 @@ if (runTime.outputTime())
( (
IOobject IOobject
( (
"sigmaCauchyEq", "sigmaCauchyEq",
runTime.timeName(), runTime.timeName(),
mesh, mesh,
IOobject::NO_READ, IOobject::NO_READ,
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
sqrt((3.0/2.0)*magSqr(dev(sigmaCauchy))) sqrt((3.0/2.0)*magSqr(dev(sigmaCauchy)))
); );
Info<< "Max sigmaCauchyEq = " << max(sigmaCauchyEq).value() Info<< "Max sigmaCauchyEq = " << max(sigmaCauchyEq).value()
<< endl; << endl;
volTensorField Finv = inv(F); volTensorField Finv = inv(F);
volSymmTensorField epsilonAlmansi volSymmTensorField epsilonAlmansi
( (
IOobject IOobject
( (
"epsilonAlmansi", "epsilonAlmansi",
runTime.timeName(), runTime.timeName(),
mesh, mesh,
IOobject::NO_READ, IOobject::NO_READ,
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
symm(Finv & epsilon & Finv.T()) symm(Finv & epsilon & Finv.T())
); );
@ -88,21 +88,21 @@ if (runTime.outputTime())
( (
IOobject IOobject
( (
"tractionCauchy", "tractionCauchy",
runTime.timeName(), runTime.timeName(),
mesh, mesh,
IOobject::NO_READ, IOobject::NO_READ,
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
mesh, mesh,
dimensionedVector("zero", dimForce/dimArea, vector::zero) dimensionedVector("zero", dimForce/dimArea, vector::zero)
); );
forAll(traction.boundaryField(), patchi) forAll(traction.boundaryField(), patchi)
{ {
tensorField Fpatch = I + gradU.boundaryField()[patchi]; tensorField Fpatch = I + gradU.boundaryField()[patchi];
traction.boundaryField()[patchi] = traction.boundaryField()[patchi] =
n.boundaryField()[patchi] & (sigma.boundaryField()[patchi] & Fpatch); n.boundaryField()[patchi] & (sigma.boundaryField()[patchi] & Fpatch);
} }
runTime.write(); runTime.write();

View file

@ -2,32 +2,32 @@
forAll(mesh.boundary(), patchID) forAll(mesh.boundary(), patchID)
{ {
if(U.boundaryField()[patchID].type() if(U.boundaryField()[patchID].type()
== solidDirectionMixedFvPatchVectorField::typeName == solidDirectionMixedFvPatchVectorField::typeName
) )
{ {
solidDirectionMixedFvPatchVectorField& loadingPatch = solidDirectionMixedFvPatchVectorField& loadingPatch =
refCast<solidDirectionMixedFvPatchVectorField> refCast<solidDirectionMixedFvPatchVectorField>
( (
U.boundaryField()[patchID] U.boundaryField()[patchID]
); );
tensorField Finv = inv(I + gradU); tensorField Finv = inv(I + gradU);
vectorField newN = Finv & n.boundaryField()[patchID]; vectorField newN = Finv & n.boundaryField()[patchID];
newN /= mag(newN); newN /= mag(newN);
loadingPatch.valueFraction() = sqr(newN); loadingPatch.valueFraction() = sqr(newN);
//- set gradient //- set gradient
loadingPatch.refGrad() = loadingPatch.refGrad() =
( (
//Traction //Traction
( (mu.boundaryField()[patchID] + lambda.boundaryField()[patchID]) * (n.boundaryField()[patchID] & gradU.boundaryField()[patchID]) ) ( (mu.boundaryField()[patchID] + lambda.boundaryField()[patchID]) * (n.boundaryField()[patchID] & gradU.boundaryField()[patchID]) )
- ( mu.boundaryField()[patchID] * (n.boundaryField()[patchID] & gradU.boundaryField()[patchID].T()) ) - ( mu.boundaryField()[patchID] * (n.boundaryField()[patchID] & gradU.boundaryField()[patchID].T()) )
- ( mu.boundaryField()[patchID] * ( n.boundaryField()[patchID] & (gradU.boundaryField()[patchID] & gradU.boundaryField()[patchID].T()) ) ) - ( mu.boundaryField()[patchID] * ( n.boundaryField()[patchID] & (gradU.boundaryField()[patchID] & gradU.boundaryField()[patchID].T()) ) )
- ( lambda.boundaryField()[patchID] * tr(gradU.boundaryField()[patchID]) * n.boundaryField()[patchID] ) - ( lambda.boundaryField()[patchID] * tr(gradU.boundaryField()[patchID]) * n.boundaryField()[patchID] )
- ( 0.5 * lambda.boundaryField()[patchID] * tr(gradU.boundaryField()[patchID] & gradU.boundaryField()[patchID].T()) * n.boundaryField()[patchID] ) - ( 0.5 * lambda.boundaryField()[patchID] * tr(gradU.boundaryField()[patchID] & gradU.boundaryField()[patchID].T()) * n.boundaryField()[patchID] )
) )
/ /
(2.0*mu.boundaryField()[patchID] + lambda.boundaryField()[patchID]); (2.0*mu.boundaryField()[patchID] + lambda.boundaryField()[patchID]);
} }
} }
} }

View file

@ -11,11 +11,11 @@ if(solidInterfaceCorr)
// if(divDSigmaExpMethod != "surface" && divDSigmaExpMethod != "decompose") // if(divDSigmaExpMethod != "surface" && divDSigmaExpMethod != "decompose")
// { // {
// FatalError << "divDSigmaExp must be decompose or surface when solidInterface is on" // FatalError << "divDSigmaExp must be decompose or surface when solidInterface is on"
// << exit(FatalError); // << exit(FatalError);
// } // }
// if(divDSigmaLargeStrainExpMethod != "surface") // if(divDSigmaLargeStrainExpMethod != "surface")
// { // {
// FatalError << "divDSigmaLargeStrainExp must be surface when solidInterface is on" // FatalError << "divDSigmaLargeStrainExp must be surface when solidInterface is on"
// << exit(FatalError); // << exit(FatalError);
// } // }
} }

View file

@ -51,6 +51,6 @@ if(min(J.internalField()) > 0)
else else
{ {
FatalErrorIn(args.executable()) FatalErrorIn(args.executable())
<< "Negative Jacobian" << "Negative Jacobian"
<< exit(FatalError); << exit(FatalError);
} }

View file

@ -4,33 +4,33 @@ if (runTime.outputTime())
( (
IOobject IOobject
( (
"epsilonEq", "epsilonEq",
runTime.timeName(), runTime.timeName(),
mesh, mesh,
IOobject::NO_READ, IOobject::NO_READ,
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
sqrt((2.0/3.0)*magSqr(dev(epsilon))) sqrt((2.0/3.0)*magSqr(dev(epsilon)))
); );
Info<< "Max epsilonEq = " << max(epsilonEq).value() Info<< "Max epsilonEq = " << max(epsilonEq).value()
<< endl; << endl;
volScalarField sigmaEq volScalarField sigmaEq
( (
IOobject IOobject
( (
"sigmaEq", "sigmaEq",
runTime.timeName(), runTime.timeName(),
mesh, mesh,
IOobject::NO_READ, IOobject::NO_READ,
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
sqrt((3.0/2.0)*magSqr(dev(sigma))) sqrt((3.0/2.0)*magSqr(dev(sigma)))
); );
Info<< "Max sigmaEq = " << max(sigmaEq).value() Info<< "Max sigmaEq = " << max(sigmaEq).value()
<< endl; << endl;
//- Calculate Cauchy stress //- Calculate Cauchy stress
volTensorField F = I + gradU; volTensorField F = I + gradU;
@ -43,12 +43,12 @@ if (runTime.outputTime())
( (
IOobject IOobject
( (
"sigmaCauchy", "sigmaCauchy",
runTime.timeName(), runTime.timeName(),
mesh, mesh,
IOobject::NO_READ, IOobject::NO_READ,
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
(1/J) * symm(F.T() & sigma & F) (1/J) * symm(F.T() & sigma & F)
); );
@ -57,17 +57,17 @@ if (runTime.outputTime())
( (
IOobject IOobject
( (
"sigmaCauchyEq", "sigmaCauchyEq",
runTime.timeName(), runTime.timeName(),
mesh, mesh,
IOobject::NO_READ, IOobject::NO_READ,
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
sqrt((3.0/2.0)*magSqr(dev(sigmaCauchy))) sqrt((3.0/2.0)*magSqr(dev(sigmaCauchy)))
); );
Info<< "Max sigmaCauchyEq = " << max(sigmaCauchyEq).value() Info<< "Max sigmaCauchyEq = " << max(sigmaCauchyEq).value()
<< endl; << endl;
volTensorField Finv = inv(F); volTensorField Finv = inv(F);
@ -75,12 +75,12 @@ if (runTime.outputTime())
( (
IOobject IOobject
( (
"epsilonAlmansi", "epsilonAlmansi",
runTime.timeName(), runTime.timeName(),
mesh, mesh,
IOobject::NO_READ, IOobject::NO_READ,
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
symm(Finv & epsilon & Finv.T()) symm(Finv & epsilon & Finv.T())
); );
@ -88,22 +88,22 @@ if (runTime.outputTime())
// ( // (
// IOobject // IOobject
// ( // (
// "traction", // "traction",
// runTime.timeName(), // runTime.timeName(),
// mesh, // mesh,
// IOobject::NO_READ, // IOobject::NO_READ,
// IOobject::AUTO_WRITE // IOobject::AUTO_WRITE
// ), // ),
// mesh, // mesh,
// dimensionedVector("zero", dimForce/dimArea, vector::zero), // dimensionedVector("zero", dimForce/dimArea, vector::zero),
// calculatedFvPatchVectorField::typeName // calculatedFvPatchVectorField::typeName
// ); // );
// forAll(traction.boundaryField(), patchi) // forAll(traction.boundaryField(), patchi)
// { // {
// const tensorField& Fbinv = Finv.boundaryField()[patchi]; // const tensorField& Fbinv = Finv.boundaryField()[patchi];
// vectorField nCurrent = Fbinv & n.boundaryField()[patchi]; // vectorField nCurrent = Fbinv & n.boundaryField()[patchi];
// traction.boundaryField()[patchi] = // traction.boundaryField()[patchi] =
// nCurrent & sigmaCauchy.boundaryField()[patchi]; // nCurrent & sigmaCauchy.boundaryField()[patchi];
// } // }
// //- write boundary forces // //- write boundary forces
@ -113,53 +113,53 @@ if (runTime.outputTime())
// Info << nl; // Info << nl;
// forAll(mesh.boundary(), patchi) // forAll(mesh.boundary(), patchi)
// { // {
// Info << "Patch " << mesh.boundary()[patchi].name() << endl; // Info << "Patch " << mesh.boundary()[patchi].name() << endl;
// const tensorField& Fb = F.boundaryField()[patchi]; // const tensorField& Fb = F.boundaryField()[patchi];
// vectorField totalForce = mesh.Sf().boundaryField()[patchi] & (sigma.boundaryField()[patchi] & Fb); // vectorField totalForce = mesh.Sf().boundaryField()[patchi] & (sigma.boundaryField()[patchi] & Fb);
// //vectorField totalForce2 = Sf.boundaryField()[patchi] & (sigmaCauchy.boundaryField()[patchi]); // //vectorField totalForce2 = Sf.boundaryField()[patchi] & (sigmaCauchy.boundaryField()[patchi]);
// vector force = sum( totalForce ); // vector force = sum( totalForce );
// //vector force2 = sum( totalForce2 ); // //vector force2 = sum( totalForce2 );
// Info << "\ttotal force is " << force << " N" << endl; // Info << "\ttotal force is " << force << " N" << endl;
// //Info << "\ttotal force2 is " << force2 << " N" << endl; // //Info << "\ttotal force2 is " << force2 << " N" << endl;
// const tensorField& Fbinv = Finv.boundaryField()[patchi]; // const tensorField& Fbinv = Finv.boundaryField()[patchi];
// vectorField nCurrent = Fbinv & n.boundaryField()[patchi]; // vectorField nCurrent = Fbinv & n.boundaryField()[patchi];
// nCurrent /= mag(nCurrent); // nCurrent /= mag(nCurrent);
// scalar normalForce = sum( nCurrent & totalForce ); // scalar normalForce = sum( nCurrent & totalForce );
// Info << "\tnormal force is " << normalForce << " N" << endl; // Info << "\tnormal force is " << normalForce << " N" << endl;
// scalar shearForce = mag(sum( (I - sqr(nCurrent)) & totalForce )); // scalar shearForce = mag(sum( (I - sqr(nCurrent)) & totalForce ));
// Info << "\tshear force is " << shearForce << " N" << endl; // Info << "\tshear force is " << shearForce << " N" << endl;
//if(mesh.boundary()[patchi].name() == "right") //if(mesh.boundary()[patchi].name() == "right")
//{ //{
//const vectorField& nOrig = n.boundaryField()[patchi]; //const vectorField& nOrig = n.boundaryField()[patchi];
//Info << "\tNormal force on right is " << (nCurrent & totalForce) << nl << endl; //Info << "\tNormal force on right is " << (nCurrent & totalForce) << nl << endl;
//Info << "\tShear force on right is " << ((I - sqr(nCurrent)) & totalForce) << nl << endl; //Info << "\tShear force on right is " << ((I - sqr(nCurrent)) & totalForce) << nl << endl;
//Info << "\tpatch gradient is " << U.boundaryField()[patchi].snGrad() << endl; //Info << "\tpatch gradient is " << U.boundaryField()[patchi].snGrad() << endl;
//Info << "\tpatch gradient (norm) is " << (nCurrent & U.boundaryField()[patchi].snGrad()) << endl; //Info << "\tpatch gradient (norm) is " << (nCurrent & U.boundaryField()[patchi].snGrad()) << endl;
//Info << "\tpatch gradient (shear) is " << ((I - sqr(nCurrent)) & U.boundaryField()[patchi].snGrad()) << endl; //Info << "\tpatch gradient (shear) is " << ((I - sqr(nCurrent)) & U.boundaryField()[patchi].snGrad()) << endl;
//Info << "\tpatch Almansi (normal) is " << (nCurrent & (nCurrent & epsilonAlmansi.boundaryField()[patchi])) << endl; //Info << "\tpatch Almansi (normal) is " << (nCurrent & (nCurrent & epsilonAlmansi.boundaryField()[patchi])) << endl;
//Info << "\tpatch Almansi (shear) is " << ( (I - sqr(nCurrent)) & (nCurrent & epsilonAlmansi.boundaryField()[patchi])) << endl; //Info << "\tpatch Almansi (shear) is " << ( (I - sqr(nCurrent)) & (nCurrent & epsilonAlmansi.boundaryField()[patchi])) << endl;
//Info << "\tpatch Green (normal) is " << (nOrig & (nOrig & epsilon.boundaryField()[patchi])) << endl; //Info << "\tpatch Green (normal) is " << (nOrig & (nOrig & epsilon.boundaryField()[patchi])) << endl;
//Info << "\tpatch Green (shear) is " << ( (I - sqr(nOrig)) & (nOrig & epsilon.boundaryField()[patchi])) << endl; //Info << "\tpatch Green (shear) is " << ( (I - sqr(nOrig)) & (nOrig & epsilon.boundaryField()[patchi])) << endl;
//Info << "\tpatch Cauchy stress (normal) is " << (nCurrent & (nCurrent & sigmaCauchy.boundaryField()[patchi])) << endl; //Info << "\tpatch Cauchy stress (normal) is " << (nCurrent & (nCurrent & sigmaCauchy.boundaryField()[patchi])) << endl;
//} //}
// if(mesh.boundary()[patchi].type() != "empty") // if(mesh.boundary()[patchi].type() != "empty")
// { // {
// vector Sf0 = Sf.boundaryField()[patchi][0]; // vector Sf0 = Sf.boundaryField()[patchi][0];
// symmTensor sigma0 = sigmaCauchy.boundaryField()[patchi][0]; // symmTensor sigma0 = sigmaCauchy.boundaryField()[patchi][0];
// Info << "sigmab[0] is " << sigma0 << nl // Info << "sigmab[0] is " << sigma0 << nl
// << "Sfb is " << Sf0 << nl // << "Sfb is " << Sf0 << nl
// << "force is " << (Sf.boundaryField()[patchi][0]&sigma.boundaryField()[patchi][0]) << nl // << "force is " << (Sf.boundaryField()[patchi][0]&sigma.boundaryField()[patchi][0]) << nl
// << "Sfx*sigmaxx " << (Sf0[vector::X]*sigma0[symmTensor::XX]) <<nl // << "Sfx*sigmaxx " << (Sf0[vector::X]*sigma0[symmTensor::XX]) <<nl
// << "Sfy*sigmaxy " << (Sf0[vector::Y]*sigma0[symmTensor::XY]) << nl // << "Sfy*sigmaxy " << (Sf0[vector::Y]*sigma0[symmTensor::XY]) << nl
// << "Sfx*sigmayx " << (Sf0[vector::X]*sigma0[symmTensor::XY]) << nl // << "Sfx*sigmayx " << (Sf0[vector::X]*sigma0[symmTensor::XY]) << nl
// << "Sfy*sigmayy " << (Sf0[vector::Y]*sigma0[symmTensor::YY]) << nl // << "Sfy*sigmayy " << (Sf0[vector::Y]*sigma0[symmTensor::YY]) << nl
// << endl; // << endl;
// } // }
// Info << endl; // Info << endl;
// } // }
runTime.write(); runTime.write();

View file

@ -10,10 +10,10 @@ if(divDSigmaExpMethod == "standard")
{ {
divDSigmaExp = fvc::div divDSigmaExp = fvc::div
( (
muf*(mesh.Sf() & fvc::interpolate(gradDU.T())) muf*(mesh.Sf() & fvc::interpolate(gradDU.T()))
+ lambdaf*(mesh.Sf() & I*fvc::interpolate(tr(gradDU))) + lambdaf*(mesh.Sf() & I*fvc::interpolate(tr(gradDU)))
- (muf + lambdaf)*(mesh.Sf() & fvc::interpolate(gradDU)) - (muf + lambdaf)*(mesh.Sf() & fvc::interpolate(gradDU))
); );
} }
else if(divDSigmaExpMethod == "decompose") else if(divDSigmaExpMethod == "decompose")
{ {
@ -22,13 +22,13 @@ if(divDSigmaExpMethod == "standard")
divDSigmaExp = fvc::div divDSigmaExp = fvc::div
( (
mesh.magSf() mesh.magSf()
*( *(
- (muf + lambdaf)*(fvc::snGrad(DU)&(I - n*n)) - (muf + lambdaf)*(fvc::snGrad(DU)&(I - n*n))
+ lambdaf*tr(shearGradDU&(I - n*n))*n + lambdaf*tr(shearGradDU&(I - n*n))*n
+ muf*(shearGradDU&n) + muf*(shearGradDU&n)
) )
); );
} }
else if(divDSigmaExpMethod == "laplacian") else if(divDSigmaExpMethod == "laplacian")
{ {
@ -36,10 +36,10 @@ if(divDSigmaExpMethod == "standard")
- fvc::laplacian(mu + lambda, DU, "laplacian(DDU,DU)") - fvc::laplacian(mu + lambda, DU, "laplacian(DDU,DU)")
+ fvc::div + fvc::div
( (
mu*gradDU.T() mu*gradDU.T()
+ lambda*(I*tr(gradDU)), + lambda*(I*tr(gradDU)),
"div(sigma)" "div(sigma)"
); );
} }
else else
{ {

View file

@ -18,10 +18,10 @@ if(divDSigmaLargeStrainExpMethod == "standard")
divDSigmaLargeStrainExp = divDSigmaLargeStrainExp =
fvc::div fvc::div
( (
muf * (mesh.Sf() & fvc::interpolate(gradDU & gradDU.T())) muf * (mesh.Sf() & fvc::interpolate(gradDU & gradDU.T()))
+ 0.5*lambdaf * (mesh.Sf() & (fvc::interpolate(gradDU && gradDU)*I)) + 0.5*lambdaf * (mesh.Sf() & (fvc::interpolate(gradDU && gradDU)*I))
+ (mesh.Sf() & fvc::interpolate( (sigma + DSigma) & gradDU )) + (mesh.Sf() & fvc::interpolate( (sigma + DSigma) & gradDU ))
); );
} }
else else
{ {

View file

@ -30,9 +30,9 @@ FieldField<Field, vector> extraVecs(ptc.size());
// extraVecs.hook(new vectorField(curFaces.size())); //- no hook function // extraVecs.hook(new vectorField(curFaces.size())); //- no hook function
extraVecs.set extraVecs.set
( (
pointI, pointI,
new vectorField(curFaces.size()) new vectorField(curFaces.size())
); );
vectorField& curExtraVectors = extraVecs[pointI]; vectorField& curExtraVectors = extraVecs[pointI];
@ -42,30 +42,30 @@ FieldField<Field, vector> extraVecs(ptc.size());
// Go through all the faces // Go through all the faces
forAll (curFaces, faceI) forAll (curFaces, faceI)
{ {
if (!mesh.isInternalFace(curFaces[faceI])) if (!mesh.isInternalFace(curFaces[faceI]))
{ {
// This is a boundary face. If not in the empty patch // This is a boundary face. If not in the empty patch
// or coupled calculate the extrapolation vector // or coupled calculate the extrapolation vector
label patchID = label patchID =
mesh.boundaryMesh().whichPatch(curFaces[faceI]); mesh.boundaryMesh().whichPatch(curFaces[faceI]);
if if
( (
!isA<emptyFvPatch>(bm[patchID]) !isA<emptyFvPatch>(bm[patchID])
&& !bm[patchID].coupled() && !bm[patchID].coupled()
) )
{ {
// Found a face for extrapolation // Found a face for extrapolation
curExtraVectors[nFacesAroundPoint] = curExtraVectors[nFacesAroundPoint] =
pointLoc pointLoc
- centres.boundaryField()[patchID] - centres.boundaryField()[patchID]
[bm[patchID].patch().whichFace(curFaces[faceI])]; [bm[patchID].patch().whichFace(curFaces[faceI])];
nFacesAroundPoint++; nFacesAroundPoint++;
} }
} }
} }
curExtraVectors.setSize(nFacesAroundPoint); curExtraVectors.setSize(nFacesAroundPoint);
} }

View file

@ -35,9 +35,9 @@ FieldField<Field, scalar> w(ptc.size());
//w.hook(new scalarField(curFaces.size())); //philipc no hook function //w.hook(new scalarField(curFaces.size())); //philipc no hook function
w.set w.set
( (
pointI, pointI,
new scalarField(curFaces.size()) new scalarField(curFaces.size())
); );
scalarField& curWeights = w[pointI]; scalarField& curWeights = w[pointI];
@ -47,38 +47,38 @@ FieldField<Field, scalar> w(ptc.size());
// Go through all the faces // Go through all the faces
forAll (curFaces, faceI) forAll (curFaces, faceI)
{ {
if (!mesh.isInternalFace(curFaces[faceI])) if (!mesh.isInternalFace(curFaces[faceI]))
{ {
// This is a boundary face. If not in the empty patch // This is a boundary face. If not in the empty patch
// or coupled calculate the extrapolation vector // or coupled calculate the extrapolation vector
label patchID = label patchID =
mesh.boundaryMesh().whichPatch(curFaces[faceI]); mesh.boundaryMesh().whichPatch(curFaces[faceI]);
if if
( (
!isA<emptyFvPatch>(bm[patchID]) !isA<emptyFvPatch>(bm[patchID])
&& !( && !(
bm[patchID].coupled() bm[patchID].coupled()
//&& Pstream::parRun() //&& Pstream::parRun()
//&& !mesh.parallelData().cyclicParallel() //&& !mesh.parallelData().cyclicParallel()
) )
) )
{ {
curWeights[nFacesAroundPoint] = curWeights[nFacesAroundPoint] =
1.0/mag 1.0/mag
( (
pointLoc pointLoc
- centres.boundaryField()[patchID] - centres.boundaryField()[patchID]
[ [
bm[patchID].patch().whichFace(curFaces[faceI]) bm[patchID].patch().whichFace(curFaces[faceI])
] ]
); );
nFacesAroundPoint++; nFacesAroundPoint++;
} }
} }
} }
// Reset the sizes of the local weights // Reset the sizes of the local weights
curWeights.setSize(nFacesAroundPoint); curWeights.setSize(nFacesAroundPoint);

View file

@ -91,32 +91,32 @@
//- explicit terms in the momentum equation //- explicit terms in the momentum equation
volVectorField divDSigmaExp volVectorField divDSigmaExp
( (
IOobject IOobject
( (
"divDSigmaExp", "divDSigmaExp",
runTime.timeName(), runTime.timeName(),
mesh, mesh,
IOobject::NO_READ, IOobject::NO_READ,
IOobject::NO_WRITE IOobject::NO_WRITE
), ),
mesh, mesh,
dimensionedVector("zero", dimensionSet(1, -2, -2, 0, 0, 0, 0), vector::zero) dimensionedVector("zero", dimensionSet(1, -2, -2, 0, 0, 0, 0), vector::zero)
); );
volVectorField divDSigmaLargeStrainExp volVectorField divDSigmaLargeStrainExp
( (
IOobject IOobject
( (
"divDSigmaLargeStrainExp", "divDSigmaLargeStrainExp",
runTime.timeName(), runTime.timeName(),
mesh, mesh,
IOobject::NO_READ, IOobject::NO_READ,
IOobject::NO_WRITE IOobject::NO_WRITE
), ),
mesh, mesh,
dimensionedVector("zero", dimensionSet(1, -2, -2, 0, 0, 0, 0), vector::zero) dimensionedVector("zero", dimensionSet(1, -2, -2, 0, 0, 0, 0), vector::zero)
); );
constitutiveModel rheology(sigma, DU); constitutiveModel rheology(sigma, DU);

View file

@ -10,20 +10,20 @@ solidInterface* solidInterfacePtr(NULL);
if(solidInterfaceCorr) if(solidInterfaceCorr)
{ {
Info << "Creating solid interface correction" << endl; Info << "Creating solid interface correction" << endl;
solidInterfacePtr = new solidInterface(mesh, rheology); solidInterfacePtr = new solidInterface(mesh, rheology);
solidInterfacePtr->modifyProperties(muf, lambdaf); solidInterfacePtr->modifyProperties(muf, lambdaf);
//- solidInterface needs muf and lambdaf to be used for divDSigmaExp //- solidInterface needs muf and lambdaf to be used for divDSigmaExp
if(divDSigmaExpMethod != "surface" && divDSigmaExpMethod != "decompose") if(divDSigmaExpMethod != "surface" && divDSigmaExpMethod != "decompose")
{ {
FatalError << "divDSigmaExp must be decompose or surface when solidInterface is on" FatalError << "divDSigmaExp must be decompose or surface when solidInterface is on"
<< exit(FatalError); << exit(FatalError);
} }
if(divDSigmaLargeStrainExpMethod == "surface") if(divDSigmaLargeStrainExpMethod == "surface")
{ {
FatalError << "divDSigmaLargeStrainExp must be surface when solidInterface is on" FatalError << "divDSigmaLargeStrainExp must be surface when solidInterface is on"
<< exit(FatalError); << exit(FatalError);
} }
} }
} }

View file

@ -10,13 +10,13 @@ if(solidInterfaceCorr)
//- solidInterface needs muf and lambdaf to be used for divDSigmaExp //- solidInterface needs muf and lambdaf to be used for divDSigmaExp
if(divDSigmaExpMethod != "surface" && divDSigmaExpMethod != "decompose") if(divDSigmaExpMethod != "surface" && divDSigmaExpMethod != "decompose")
{ {
FatalError << "divDSigmaExp must be decompose or surface when solidInterface is on" FatalError << "divDSigmaExp must be decompose or surface when solidInterface is on"
<< exit(FatalError); << exit(FatalError);
} }
if(divDSigmaLargeStrainExpMethod != "surface") if(divDSigmaLargeStrainExpMethod != "surface")
{ {
FatalError << "divDSigmaLargeStrainExp must be surface when solidInterface is on" FatalError << "divDSigmaLargeStrainExp must be surface when solidInterface is on"
<< exit(FatalError); << exit(FatalError);
} }
} }

View file

@ -14,10 +14,10 @@ forAll (bm, patchI)
( (
!isA<emptyFvPatch>(bm[patchI]) !isA<emptyFvPatch>(bm[patchI])
&& !( && !(
bm[patchI].coupled() bm[patchI].coupled()
//&& Pstream::parRun() //&& Pstream::parRun()
//&& !mesh.parallelData().cyclicParallel() //&& !mesh.parallelData().cyclicParallel()
) )
) )
{ {
const labelList& bp = bm[patchI].patch().boundaryPoints(); const labelList& bp = bm[patchI].patch().boundaryPoints();
@ -25,9 +25,9 @@ forAll (bm, patchI)
const labelList& meshPoints = bm[patchI].patch().meshPoints(); const labelList& meshPoints = bm[patchI].patch().meshPoints();
forAll (bp, pointI) forAll (bp, pointI)
{ {
pointsCorrectionMap.insert(meshPoints[bp[pointI]]); pointsCorrectionMap.insert(meshPoints[bp[pointI]]);
} }
} }
} }

View file

@ -10,7 +10,7 @@ else
{ {
FatalErrorIn(args.executable()) FatalErrorIn(args.executable())
<< "move mesh method " << moveMeshMethod << " not recognised" << nl << "move mesh method " << moveMeshMethod << " not recognised" << nl
<< "available methods are:" << nl << "available methods are:" << nl
<< "inverseDistance" << nl << "inverseDistance" << nl
<< "leastSquares" << exit(FatalError); << "leastSquares" << exit(FatalError);
} }

View file

@ -21,10 +21,10 @@
( (
IOobject IOobject
( (
"pointDU", "pointDU",
runTime.timeName(), runTime.timeName(),
mesh mesh
), ),
pMesh, pMesh,
dimensionedVector("zero", dimLength, vector::zero), dimensionedVector("zero", dimLength, vector::zero),
types types
@ -48,7 +48,7 @@
forAll (pointDUI, pointI) forAll (pointDUI, pointI)
{ {
newPoints[pointI] += pointDUI[pointI]; newPoints[pointI] += pointDUI[pointI];
} }
twoDPointCorrector twoDCorrector(mesh); twoDPointCorrector twoDCorrector(mesh);
@ -60,6 +60,6 @@
// else // else
// { // {
// FatalErrorIn(args.executable()) // FatalErrorIn(args.executable())
// << "Negative Jacobian" // << "Negative Jacobian"
// << exit(FatalError); // << exit(FatalError);
// } // }

View file

@ -67,31 +67,31 @@ forAll (ptc, pointI)
forAll (curFaces, faceI) forAll (curFaces, faceI)
{ {
if (!mesh.isInternalFace(curFaces[faceI])) if (!mesh.isInternalFace(curFaces[faceI]))
{ {
// This is a boundary face. If not in the empty patch // This is a boundary face. If not in the empty patch
// or coupled calculate the extrapolation vector // or coupled calculate the extrapolation vector
label patchID = label patchID =
mesh.boundaryMesh().whichPatch(curFaces[faceI]); mesh.boundaryMesh().whichPatch(curFaces[faceI]);
if if
( (
!isA<emptyFvPatch>(mesh.boundary()[patchID]) !isA<emptyFvPatch>(mesh.boundary()[patchID])
&& !mesh.boundary()[patchID].coupled() && !mesh.boundary()[patchID].coupled()
) )
{ {
label faceInPatchID = label faceInPatchID =
bm[patchID].patch().whichFace(curFaces[faceI]); bm[patchID].patch().whichFace(curFaces[faceI]);
pfCorr[curPoint] += pfCorr[curPoint] +=
w[pointI][fI]* w[pointI][fI]*
( (
extraVecs[pointI][fI] extraVecs[pointI][fI]
& gradDU.boundaryField()[patchID][faceInPatchID] & gradDU.boundaryField()[patchID][faceInPatchID]
); );
fI++; fI++;
} }
} }
} }
} }

View file

@ -4,33 +4,33 @@ if (runTime.outputTime())
( (
IOobject IOobject
( (
"epsilonEq", "epsilonEq",
runTime.timeName(), runTime.timeName(),
mesh, mesh,
IOobject::NO_READ, IOobject::NO_READ,
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
sqrt((2.0/3.0)*magSqr(dev(epsilon))) sqrt((2.0/3.0)*magSqr(dev(epsilon)))
); );
Info<< "Max epsilonEq = " << max(epsilonEq).value() Info<< "Max epsilonEq = " << max(epsilonEq).value()
<< endl; << endl;
volScalarField sigmaEq volScalarField sigmaEq
( (
IOobject IOobject
( (
"sigmaEq", "sigmaEq",
runTime.timeName(), runTime.timeName(),
mesh, mesh,
IOobject::NO_READ, IOobject::NO_READ,
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
sqrt((3.0/2.0)*magSqr(dev(sigma))) sqrt((3.0/2.0)*magSqr(dev(sigma)))
); );
Info<< "Max sigmaEq = " << max(sigmaEq).value() Info<< "Max sigmaEq = " << max(sigmaEq).value()
<< endl; << endl;
runTime.write(); runTime.write();
} }

View file

@ -16,9 +16,9 @@ if(iCorr == 0)
scalar sumMagB = gSum(magSqr(b)); scalar sumMagB = gSum(magSqr(b));
if(sumMagB < SMALL) if(sumMagB < SMALL)
{ {
//Warning << "Aitken under-relaxation: denominator less then SMALL" //Warning << "Aitken under-relaxation: denominator less then SMALL"
// << endl; // << endl;
sumMagB += SMALL; sumMagB += SMALL;
} }
aitkenTheta = -aitkenTheta* aitkenTheta = -aitkenTheta*

View file

@ -8,11 +8,11 @@ if(divSigmaExpMethod == "standard")
//- this form seems to have the best convergence //- this form seems to have the best convergence
divSigmaExp = divSigmaExp =
fvc::div(mesh.magSf()* fvc::div(mesh.magSf()*
( (
(n&(Cf && fvc::interpolate(symm(gradU)))) (n&(Cf && fvc::interpolate(symm(gradU))))
- (n&(Kf & fvc::interpolate(gradU))) - (n&(Kf & fvc::interpolate(gradU)))
) )
); );
} }
else if(divSigmaExpMethod == "laplacian") else if(divSigmaExpMethod == "laplacian")
{ {

View file

@ -6,14 +6,14 @@
forAll(mesh.boundary(), patchi) forAll(mesh.boundary(), patchi)
{ {
netForce += netForce +=
sum( sum(
mesh.Sf().boundaryField()[patchi] mesh.Sf().boundaryField()[patchi]
& &
( (
2*mu.boundaryField()[patchi]*symm(gradU.boundaryField()[patchi]) 2*mu.boundaryField()[patchi]*symm(gradU.boundaryField()[patchi])
+ lambda*tr(gradU.boundaryField()[patchi])*I + lambda*tr(gradU.boundaryField()[patchi])*I
) )
); );
} }
forceResidual = mag(netForce); forceResidual = mag(netForce);
} }

View file

@ -28,14 +28,14 @@
// forAll(traction.boundaryField(), patchi) // forAll(traction.boundaryField(), patchi)
// { // {
// if (mesh.boundary()[patchi].type() == "cohesive") // if (mesh.boundary()[patchi].type() == "cohesive")
// { // {
// forAll(traction.boundaryField()[patchi], facei) // forAll(traction.boundaryField()[patchi], facei)
// { // {
// Pout << "face " << facei << " with traction magnitude " // Pout << "face " << facei << " with traction magnitude "
// << mag(traction.boundaryField()[patchi][facei])/1e6 << " MPa and traction " // << mag(traction.boundaryField()[patchi][facei])/1e6 << " MPa and traction "
// << traction.boundaryField()[patchi][facei]/1e6 << " MPa" << endl; // << traction.boundaryField()[patchi][facei]/1e6 << " MPa" << endl;
// } // }
// } // }
// } // }
} }

View file

@ -7,40 +7,40 @@
{ {
if (isA<solidCohesiveFvPatchVectorField>(U.boundaryField()[patchI])) if (isA<solidCohesiveFvPatchVectorField>(U.boundaryField()[patchI]))
{ {
cohesivePatchID = patchI; cohesivePatchID = patchI;
cohesivePatchUPtr = cohesivePatchUPtr =
&refCast<solidCohesiveFvPatchVectorField> &refCast<solidCohesiveFvPatchVectorField>
( (
U.boundaryField()[cohesivePatchID] U.boundaryField()[cohesivePatchID]
); );
break; break;
} }
else if (isA<solidCohesiveFixedModeMixFvPatchVectorField>(U.boundaryField()[patchI])) else if (isA<solidCohesiveFixedModeMixFvPatchVectorField>(U.boundaryField()[patchI]))
{ {
cohesivePatchID = patchI; cohesivePatchID = patchI;
cohesivePatchUFixedModePtr = cohesivePatchUFixedModePtr =
&refCast<solidCohesiveFixedModeMixFvPatchVectorField> &refCast<solidCohesiveFixedModeMixFvPatchVectorField>
( (
U.boundaryField()[cohesivePatchID] U.boundaryField()[cohesivePatchID]
); );
break; break;
} }
} }
if(cohesivePatchID == -1) if(cohesivePatchID == -1)
{ {
FatalErrorIn(args.executable()) FatalErrorIn(args.executable())
<< "Can't find cohesiveLawFvPatch" << nl << "Can't find cohesiveLawFvPatch" << nl
<< "One of the boundary patches in " << U.name() << ".boundaryField() " << "One of the boundary patches in " << U.name() << ".boundaryField() "
<< "should be of type " << solidCohesiveFvPatchVectorField::typeName << "should be of type " << solidCohesiveFvPatchVectorField::typeName
<< "or " << solidCohesiveFixedModeMixFvPatchVectorField::typeName << "or " << solidCohesiveFixedModeMixFvPatchVectorField::typeName
<< abort(FatalError); << abort(FatalError);
} }
// solidCohesiveFvPatchVectorField& cohesivePatchU = // solidCohesiveFvPatchVectorField& cohesivePatchU =
// refCast<solidCohesiveFvPatchVectorField> // refCast<solidCohesiveFvPatchVectorField>
// ( // (
// U.boundaryField()[cohesivePatchID] // U.boundaryField()[cohesivePatchID]
// ); // );
// philipc: I have moved cohesive stuff to constitutiveModel // philipc: I have moved cohesive stuff to constitutiveModel
@ -65,82 +65,82 @@
// limit crack to specified boxes // limit crack to specified boxes
{ {
const dictionary& stressControl = const dictionary& stressControl =
mesh.solutionDict().subDict("solidMechanics"); mesh.solutionDict().subDict("solidMechanics");
List<boundBox> userBoxes(stressControl.lookup("crackLimitingBoxes")); List<boundBox> userBoxes(stressControl.lookup("crackLimitingBoxes"));
const surfaceVectorField& Cf = mesh.Cf(); const surfaceVectorField& Cf = mesh.Cf();
forAll(cohesiveZone.internalField(), faceI) forAll(cohesiveZone.internalField(), faceI)
{ {
bool faceInsideBox = false; bool faceInsideBox = false;
forAll(userBoxes, boxi) forAll(userBoxes, boxi)
{ {
if(userBoxes[boxi].contains(Cf.internalField()[faceI])) faceInsideBox = true; if(userBoxes[boxi].contains(Cf.internalField()[faceI])) faceInsideBox = true;
} }
if(faceInsideBox) if(faceInsideBox)
{ {
cohesiveZone.internalField()[faceI] = 1.0; cohesiveZone.internalField()[faceI] = 1.0;
} }
} }
forAll(cohesiveZone.boundaryField(), patchI) forAll(cohesiveZone.boundaryField(), patchI)
{ {
// cracks may go along proc boundaries // cracks may go along proc boundaries
if(mesh.boundaryMesh()[patchI].type() == processorPolyPatch::typeName) if(mesh.boundaryMesh()[patchI].type() == processorPolyPatch::typeName)
{ {
forAll(cohesiveZone.boundaryField()[patchI], faceI) forAll(cohesiveZone.boundaryField()[patchI], faceI)
{ {
bool faceInsideBox = false; bool faceInsideBox = false;
forAll(userBoxes, boxi) forAll(userBoxes, boxi)
{ {
if(userBoxes[boxi].contains(Cf.boundaryField()[patchI][faceI])) faceInsideBox = true; if(userBoxes[boxi].contains(Cf.boundaryField()[patchI][faceI])) faceInsideBox = true;
} }
if(faceInsideBox) if(faceInsideBox)
{ {
cohesiveZone.boundaryField()[patchI][faceI] = 1.0; cohesiveZone.boundaryField()[patchI][faceI] = 1.0;
} }
} }
} }
} }
Info << "\nThere are " << gSum(cohesiveZone.internalField()) << " potential internal crack faces" << nl << endl; Info << "\nThere are " << gSum(cohesiveZone.internalField()) << " potential internal crack faces" << nl << endl;
Info << "\nThere are " << gSum(cohesiveZone.boundaryField())/2 << " potential coupled boundary crack faces" << nl << endl; Info << "\nThere are " << gSum(cohesiveZone.boundaryField())/2 << " potential coupled boundary crack faces" << nl << endl;
// write field for visualisation // write field for visualisation
volScalarField cohesiveZoneVol volScalarField cohesiveZoneVol
( (
IOobject IOobject
( (
"cohesiveZoneVol", "cohesiveZoneVol",
runTime.timeName(), runTime.timeName(),
mesh, mesh,
IOobject::NO_READ, IOobject::NO_READ,
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
mesh, mesh,
dimensionedScalar("zero", dimless, 0.0) dimensionedScalar("zero", dimless, 0.0)
); );
forAll(cohesiveZone.internalField(), facei) forAll(cohesiveZone.internalField(), facei)
{ {
if(cohesiveZone.internalField()[facei]) if(cohesiveZone.internalField()[facei])
{ {
cohesiveZoneVol.internalField()[mesh.owner()[facei]] = 1.0; cohesiveZoneVol.internalField()[mesh.owner()[facei]] = 1.0;
cohesiveZoneVol.internalField()[mesh.neighbour()[facei]] = 1.0; cohesiveZoneVol.internalField()[mesh.neighbour()[facei]] = 1.0;
} }
} }
forAll(cohesiveZone.boundaryField(), patchi) forAll(cohesiveZone.boundaryField(), patchi)
{ {
forAll(cohesiveZone.boundaryField()[patchi], facei) forAll(cohesiveZone.boundaryField()[patchi], facei)
{ {
if(cohesiveZone.boundaryField()[patchi][facei] > 0.0) if(cohesiveZone.boundaryField()[patchi][facei] > 0.0)
{ {
cohesiveZoneVol.boundaryField()[patchi][facei] = 1.0; cohesiveZoneVol.boundaryField()[patchi][facei] = 1.0;
} }
} }
} }
Info << "Writing cohesiveZone field" << endl; Info << "Writing cohesiveZone field" << endl;
cohesiveZoneVol.write(); cohesiveZoneVol.write();
} }

View file

@ -35,8 +35,8 @@
IOobject::NO_READ, IOobject::NO_READ,
IOobject::NO_WRITE IOobject::NO_WRITE
), ),
mesh, mesh,
dimensionedVector("zero", dimless, vector::zero) dimensionedVector("zero", dimless, vector::zero)
); );
volVectorField V volVectorField V
@ -122,7 +122,7 @@
IOobject::NO_WRITE IOobject::NO_WRITE
), ),
mesh, mesh,
dimensionedVector("zero", dimLength, vector::zero) dimensionedVector("zero", dimLength, vector::zero)
); );
// aitken relaxation factor // aitken relaxation factor
scalar aitkenInitialRes = 1.0; scalar aitkenInitialRes = 1.0;
@ -139,5 +139,5 @@ scalar aitkenTheta = 0.1;
// IOobject::AUTO_WRITE // IOobject::AUTO_WRITE
// ), // ),
// mesh, // mesh,
// dimensionedVector("zero", dimless, vector::zero) // dimensionedVector("zero", dimless, vector::zero)
// ); // );

View file

@ -4,14 +4,14 @@ label historyPatchID = mesh.boundaryMesh().findPatchID(historyPatchName);
if(historyPatchID == -1) if(historyPatchID == -1)
{ {
Warning << "history patch " << historyPatchName Warning << "history patch " << historyPatchName
<< " not found. Force-displacement will not be written" << " not found. Force-displacement will not be written"
<< endl; << endl;
} }
else if(Pstream::master()) else if(Pstream::master())
{ {
Info << "Force-displacement for patch " << historyPatchName Info << "Force-displacement for patch " << historyPatchName
<< " will be written to forceDisp.dat" << " will be written to forceDisp.dat"
<< endl; << endl;
word hisDirName("history"); word hisDirName("history");
mkDir(hisDirName); mkDir(hisDirName);
filePtr = new OFstream(hisDirName/historyPatchName+"forceDisp.dat"); filePtr = new OFstream(hisDirName/historyPatchName+"forceDisp.dat");

View file

@ -5,6 +5,6 @@ Info << "Selecting divSigmaExp calculation method " << divSigmaExpMethod << end
if(divSigmaExpMethod != "standard" && divSigmaExpMethod != "surface" && divSigmaExpMethod != "laplacian") if(divSigmaExpMethod != "standard" && divSigmaExpMethod != "surface" && divSigmaExpMethod != "laplacian")
{ {
FatalError << "divSigmaExp method " << divSigmaExpMethod << " not found!" << nl FatalError << "divSigmaExp method " << divSigmaExpMethod << " not found!" << nl
<< "valid methods are:\nstandard\nsurface\nlaplacian" << "valid methods are:\nstandard\nsurface\nlaplacian"
<< exit(FatalError); << exit(FatalError);
} }

View file

@ -14,5 +14,5 @@ Switch relaxEqn(stressControl.lookup("relaxEqn"));
if(relaxEqn && solidInterfaceCorr) if(relaxEqn && solidInterfaceCorr)
{ {
FatalError << "relaxEqn and solidInterface may not be used concurrently" FatalError << "relaxEqn and solidInterface may not be used concurrently"
<< exit(FatalError); << exit(FatalError);
} }

View file

@ -15,16 +15,16 @@ if (dynamicTimeStep)
scalar newDeltaT = deltaTmin; scalar newDeltaT = deltaTmin;
if (newDeltaT/runTime.deltaT().value() < 0.5) if (newDeltaT/runTime.deltaT().value() < 0.5)
{ {
newDeltaT = 0.5*runTime.deltaT().value(); newDeltaT = 0.5*runTime.deltaT().value();
Info << "Reducing time step" << nl; Info << "Reducing time step" << nl;
} }
runTime.setDeltaT(newDeltaT); runTime.setDeltaT(newDeltaT);
} }
Pout << "Current time step size: " Pout << "Current time step size: "
<< runTime.deltaT().value() << " s" << endl; << runTime.deltaT().value() << " s" << endl;
scalar maxDT = runTime.deltaT().value(); scalar maxDT = runTime.deltaT().value();

View file

@ -13,11 +13,11 @@
// with a processor boundary // with a processor boundary
//if (U.boundaryField()[patchI].fixesValue()) //if (U.boundaryField()[patchI].fixesValue())
if ( if (
U.boundaryField()[patchI].fixesValue() U.boundaryField()[patchI].fixesValue()
|| ||
mesh.boundaryMesh()[patchI].type() mesh.boundaryMesh()[patchI].type()
== processorPolyPatch::typeName == processorPolyPatch::typeName
) )
{ {
const unallocLabelList& curFaceCells = const unallocLabelList& curFaceCells =
mesh.boundary()[patchI].faceCells(); mesh.boundary()[patchI].faceCells();

View file

@ -88,12 +88,12 @@ if (runTime.outputTime() || topoChange)
( (
IOobject IOobject
( (
"damageAndCracks", "damageAndCracks",
runTime.timeName(), runTime.timeName(),
mesh, mesh,
IOobject::NO_READ, IOobject::NO_READ,
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
mesh, mesh,
dimensionedScalar("zero", dimless, 0.0), dimensionedScalar("zero", dimless, 0.0),
calculatedFvPatchVectorField::typeName calculatedFvPatchVectorField::typeName
@ -102,12 +102,12 @@ if (runTime.outputTime() || topoChange)
( (
IOobject IOobject
( (
"GI", "GI",
runTime.timeName(), runTime.timeName(),
mesh, mesh,
IOobject::NO_READ, IOobject::NO_READ,
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
mesh, mesh,
dimensionedScalar("zero", dimless, 0.0), dimensionedScalar("zero", dimless, 0.0),
calculatedFvPatchVectorField::typeName calculatedFvPatchVectorField::typeName
@ -116,30 +116,30 @@ if (runTime.outputTime() || topoChange)
( (
IOobject IOobject
( (
"GII", "GII",
runTime.timeName(), runTime.timeName(),
mesh, mesh,
IOobject::NO_READ, IOobject::NO_READ,
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
mesh, mesh,
dimensionedScalar("zero", dimless, 0.0), dimensionedScalar("zero", dimless, 0.0),
calculatedFvPatchVectorField::typeName calculatedFvPatchVectorField::typeName
); );
forAll(U.boundaryField(), patchi) forAll(U.boundaryField(), patchi)
{ {
// if(U.boundaryField()[patchi].type() == cohesiveLawMultiMatFvPatchVectorField::typeName) // if(U.boundaryField()[patchi].type() == cohesiveLawMultiMatFvPatchVectorField::typeName)
if(U.boundaryField()[patchi].type() == solidCohesiveFvPatchVectorField::typeName) if(U.boundaryField()[patchi].type() == solidCohesiveFvPatchVectorField::typeName)
{ {
// cohesiveLawMultiMatFvPatchVectorField& Upatch = // cohesiveLawMultiMatFvPatchVectorField& Upatch =
// refCast<cohesiveLawMultiMatFvPatchVectorField>(U.boundaryField()[patchi]); // refCast<cohesiveLawMultiMatFvPatchVectorField>(U.boundaryField()[patchi]);
solidCohesiveFvPatchVectorField& Upatch = solidCohesiveFvPatchVectorField& Upatch =
refCast<solidCohesiveFvPatchVectorField>(U.boundaryField()[patchi]); refCast<solidCohesiveFvPatchVectorField>(U.boundaryField()[patchi]);
GI.boundaryField()[patchi] = Upatch.GI(); GI.boundaryField()[patchi] = Upatch.GI();
GII.boundaryField()[patchi] = Upatch.GII(); GII.boundaryField()[patchi] = Upatch.GII();
damageAndCracks.boundaryField()[patchi] = Upatch.crackingAndDamage(); damageAndCracks.boundaryField()[patchi] = Upatch.crackingAndDamage();
} }
} }
volScalarField GTotal("GTotal", GI + GII); volScalarField GTotal("GTotal", GI + GII);
GTotal.write(); GTotal.write();

View file

@ -2,7 +2,7 @@
if(historyPatchID != -1) if(historyPatchID != -1)
{ {
Info << "Found patch "<<historyPatchName<<", writing y force and displacement to file" Info << "Found patch "<<historyPatchName<<", writing y force and displacement to file"
<< endl; << endl;
//- for small strain or moving mesh //- for small strain or moving mesh
vector force = gSum(mesh.boundary()[historyPatchID].Sf() & sigma.boundaryField()[historyPatchID]); vector force = gSum(mesh.boundary()[historyPatchID].Sf() & sigma.boundaryField()[historyPatchID]);
@ -12,8 +12,8 @@ if(historyPatchID != -1)
//- write to file //- write to file
if(Pstream::master()) if(Pstream::master())
{ {
OFstream& forceDispFile = *filePtr; OFstream& forceDispFile = *filePtr;
forceDispFile << avDisp.x() << " " << avDisp.y() << " " << avDisp.z() << " " forceDispFile << avDisp.x() << " " << avDisp.y() << " " << avDisp.z() << " "
<< force.x() << " " << force.y() << " " << force.z() << endl; << force.x() << " " << force.y() << " " << force.z() << endl;
} }
} }

View file

@ -5,23 +5,23 @@ if(rheology.planeStress())
forAll(gradDU.internalField(), celli) forAll(gradDU.internalField(), celli)
{ {
gradDU.internalField()[celli][tensor::ZZ] = gradDU.internalField()[celli][tensor::ZZ] =
((-C.internalField()[celli][symmTensor4thOrder::XXZZ]*DEpsilon.internalField()[celli][symmTensor::XX] ((-C.internalField()[celli][symmTensor4thOrder::XXZZ]*DEpsilon.internalField()[celli][symmTensor::XX]
- C.internalField()[celli][symmTensor4thOrder::YYZZ]*DEpsilon.internalField()[celli][symmTensor::YY]) - C.internalField()[celli][symmTensor4thOrder::YYZZ]*DEpsilon.internalField()[celli][symmTensor::YY])
/ /
C.internalField()[celli][symmTensor4thOrder::ZZZZ]) C.internalField()[celli][symmTensor4thOrder::ZZZZ])
-higherTerms.internalField()[celli]; -higherTerms.internalField()[celli];
} }
forAll(gradDU.boundaryField(), patchi) forAll(gradDU.boundaryField(), patchi)
{ {
forAll(gradDU.boundaryField()[patchi], facei) forAll(gradDU.boundaryField()[patchi], facei)
{ {
gradDU.boundaryField()[patchi][facei][tensor::ZZ] = gradDU.boundaryField()[patchi][facei][tensor::ZZ] =
((-C.boundaryField()[patchi][facei][symmTensor4thOrder::XXZZ]*DEpsilon.boundaryField()[patchi][facei][symmTensor::XX] ((-C.boundaryField()[patchi][facei][symmTensor4thOrder::XXZZ]*DEpsilon.boundaryField()[patchi][facei][symmTensor::XX]
- C.boundaryField()[patchi][facei][symmTensor4thOrder::YYZZ]*DEpsilon.boundaryField()[patchi][facei][symmTensor::YY]) - C.boundaryField()[patchi][facei][symmTensor4thOrder::YYZZ]*DEpsilon.boundaryField()[patchi][facei][symmTensor::YY])
/ /
C.boundaryField()[patchi][facei][symmTensor4thOrder::ZZZZ]) C.boundaryField()[patchi][facei][symmTensor4thOrder::ZZZZ])
- higherTerms.boundaryField()[patchi][facei]; - higherTerms.boundaryField()[patchi][facei];
} }
} }
} }

View file

@ -111,5 +111,5 @@
// if(rheology.planeStress()) // if(rheology.planeStress())
// { // {
// Info << nl << "Plane stress is set to yes -> the zz stress will be zero" << nl << endl; // Info << nl << "Plane stress is set to yes -> the zz stress will be zero" << nl << endl;
// } // }

View file

@ -51,6 +51,6 @@
// else // else
// { // {
// FatalErrorIn(args.executable()) // FatalErrorIn(args.executable())
// << "Negative Jacobian" // << "Negative Jacobian"
// << exit(FatalError); // << exit(FatalError);
// } // }

View file

@ -18,8 +18,8 @@
if(min(J.internalField()) < 0) if(min(J.internalField()) < 0)
{ {
FatalErrorIn(args.executable()) FatalErrorIn(args.executable())
<< "Negative Jacobian - a cell volume has become negative!" << "Negative Jacobian - a cell volume has become negative!"
<< exit(FatalError); << exit(FatalError);
} }
rho = rho/J; rho = rho/J;

View file

@ -6,51 +6,51 @@ if (runTime.outputTime())
( (
IOobject IOobject
( (
"epsilonEq", "epsilonEq",
runTime.timeName(), runTime.timeName(),
mesh, mesh,
IOobject::NO_READ, IOobject::NO_READ,
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
sqrt((2.0/3.0)*magSqr(dev(epsilon))) sqrt((2.0/3.0)*magSqr(dev(epsilon)))
); );
Info<< "Max epsilonEq = " << max(epsilonEq).value() Info<< "Max epsilonEq = " << max(epsilonEq).value()
<< endl; << endl;
volScalarField sigmaEq volScalarField sigmaEq
( (
IOobject IOobject
( (
"sigmaEq", "sigmaEq",
runTime.timeName(), runTime.timeName(),
mesh, mesh,
IOobject::NO_READ, IOobject::NO_READ,
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
sqrt((3.0/2.0)*magSqr(dev(sigma))) sqrt((3.0/2.0)*magSqr(dev(sigma)))
); );
Info<< "Max sigmaEq = " << max(sigmaEq).value() Info<< "Max sigmaEq = " << max(sigmaEq).value()
<< endl; << endl;
// volVectorField traction // volVectorField traction
// ( // (
// IOobject // IOobject
// ( // (
// "traction", // "traction",
// runTime.timeName(), // runTime.timeName(),
// mesh, // mesh,
// IOobject::NO_READ, // IOobject::NO_READ,
// IOobject::AUTO_WRITE // IOobject::AUTO_WRITE
// ), // ),
// mesh, // mesh,
// dimensionedVector("zero", dimForce/dimArea, vector::zero) // dimensionedVector("zero", dimForce/dimArea, vector::zero)
// ); // );
// forAll(mesh.boundary(), patchi) // forAll(mesh.boundary(), patchi)
// { // {
// traction.boundaryField()[patchi] = // traction.boundaryField()[patchi] =
// n.boundaryField()[patchi] & sigma.boundaryField()[patchi]; // n.boundaryField()[patchi] & sigma.boundaryField()[patchi];
// } // }
// //- patch forces // //- patch forces
@ -60,7 +60,7 @@ if (runTime.outputTime())
// vectorField totalForce = mesh.Sf().boundaryField()[patchi] & sigma.boundaryField()[patchi]; // vectorField totalForce = mesh.Sf().boundaryField()[patchi] & sigma.boundaryField()[patchi];
// vector force = sum( totalForce ); // vector force = sum( totalForce );
// Info << "\ttotal force is " << force << " N" << endl; // Info << "\ttotal force is " << force << " N" << endl;
// tensorField F = I + gradDU.boundaryField()[patchi]; // tensorField F = I + gradDU.boundaryField()[patchi];
// tensorField Finv = inv(F); // tensorField Finv = inv(F);
// scalar normalForce = sum( n.boundaryField()[patchi] & totalForce ); // scalar normalForce = sum( n.boundaryField()[patchi] & totalForce );
// Info << "\tnormal force is " << normalForce << " N" << endl; // Info << "\tnormal force is " << normalForce << " N" << endl;

View file

@ -3,21 +3,21 @@ if(divSigmaExpMethod == "standard")
//- calculating the full gradient has good convergence and no high freq oscillations //- calculating the full gradient has good convergence and no high freq oscillations
divSigmaExp = divSigmaExp =
fvc::div( fvc::div(
(C && symm(gradU)) (C && symm(gradU))
- (K & gradU), - (K & gradU),
"div(sigma)" "div(sigma)"
); );
} }
else if(divSigmaExpMethod == "surface") else if(divSigmaExpMethod == "surface")
{ {
//- this form seems to have the best convergence //- this form seems to have the best convergence
divSigmaExp = divSigmaExp =
fvc::div(mesh.magSf()* fvc::div(mesh.magSf()*
( (
(n&(Cf && fvc::interpolate(symm(gradU)))) (n&(Cf && fvc::interpolate(symm(gradU))))
- (n&(Kf & fvc::interpolate(gradU))) - (n&(Kf & fvc::interpolate(gradU)))
) )
); );
} }
else if(divSigmaExpMethod == "laplacian") else if(divSigmaExpMethod == "laplacian")
{ {

View file

@ -4,14 +4,14 @@ label historyPatchID = mesh.boundaryMesh().findPatchID(historyPatchName);
if(historyPatchID == -1) if(historyPatchID == -1)
{ {
Warning << "history patch " << historyPatchName Warning << "history patch " << historyPatchName
<< " not found. Force-displacement will not be written" << " not found. Force-displacement will not be written"
<< endl; << endl;
} }
else if(Pstream::master()) else if(Pstream::master())
{ {
Info << "Force-displacement for patch " << historyPatchName Info << "Force-displacement for patch " << historyPatchName
<< " will be written to forceDisp.dat" << " will be written to forceDisp.dat"
<< endl; << endl;
word hisDirName("history"); word hisDirName("history");
mkDir(hisDirName); mkDir(hisDirName);
filePtr = new OFstream(hisDirName/historyPatchName+"forceDisp.dat"); filePtr = new OFstream(hisDirName/historyPatchName+"forceDisp.dat");

View file

@ -4,6 +4,6 @@ Info << "Calculation of divSigmaExp Method: " << divSigmaExpMethod << endl;
if(divSigmaExpMethod != "standard" && divSigmaExpMethod != "surface" && divSigmaExpMethod != "laplacian") if(divSigmaExpMethod != "standard" && divSigmaExpMethod != "surface" && divSigmaExpMethod != "laplacian")
{ {
FatalError << "divSigmaExp method " << divSigmaExpMethod << " not found!" << nl FatalError << "divSigmaExp method " << divSigmaExpMethod << " not found!" << nl
<< "valid methods are:\nstandard\nsurface\nlaplacian" << "valid methods are:\nstandard\nsurface\nlaplacian"
<< exit(FatalError); << exit(FatalError);
} }

View file

@ -1,13 +1,13 @@
//- set gradU.zz() for plane stress //- set gradU.zz() for plane stress
if(rheology.planeStress()) if(rheology.planeStress())
{ {
forAll(gradU.internalField(), celli) forAll(gradU.internalField(), celli)
{ {
gradU.internalField()[celli].zz() = gradU.internalField()[celli].zz() =
(-C.internalField()[celli].xxzz()*epsilon.internalField()[celli].xx() (-C.internalField()[celli].xxzz()*epsilon.internalField()[celli].xx()
- C.internalField()[celli].yyzz()*epsilon.internalField()[celli].yy()) - C.internalField()[celli].yyzz()*epsilon.internalField()[celli].yy())
/ /
C.internalField()[celli].zzzz(); C.internalField()[celli].zzzz();
} }
gradU.correctBoundaryConditions(); gradU.correctBoundaryConditions();
} }

View file

@ -6,33 +6,33 @@ if (runTime.outputTime())
( (
IOobject IOobject
( (
"epsilonEq", "epsilonEq",
runTime.timeName(), runTime.timeName(),
mesh, mesh,
IOobject::NO_READ, IOobject::NO_READ,
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
sqrt((2.0/3.0)*magSqr(dev(epsilon))) sqrt((2.0/3.0)*magSqr(dev(epsilon)))
); );
Info<< "Max epsilonEq = " << max(epsilonEq).value() Info<< "Max epsilonEq = " << max(epsilonEq).value()
<< endl; << endl;
volScalarField sigmaEq volScalarField sigmaEq
( (
IOobject IOobject
( (
"sigmaEq", "sigmaEq",
runTime.timeName(), runTime.timeName(),
mesh, mesh,
IOobject::NO_READ, IOobject::NO_READ,
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
sqrt((3.0/2.0)*magSqr(dev(sigma))) sqrt((3.0/2.0)*magSqr(dev(sigma)))
); );
Info<< "Max sigmaEq = " << max(sigmaEq).value() Info<< "Max sigmaEq = " << max(sigmaEq).value()
<< endl; << endl;
runTime.write(); runTime.write();
} }

View file

@ -2,7 +2,7 @@
if(historyPatchID != -1) if(historyPatchID != -1)
{ {
Info << "Writing disp and force of patch "<<historyPatchName<<" to file" Info << "Writing disp and force of patch "<<historyPatchName<<" to file"
<< endl; << endl;
//- for small strain or moving mesh //- for small strain or moving mesh
vector force = gSum(mesh.boundary()[historyPatchID].Sf() & sigma.boundaryField()[historyPatchID]); vector force = gSum(mesh.boundary()[historyPatchID].Sf() & sigma.boundaryField()[historyPatchID]);
@ -12,8 +12,8 @@ if(historyPatchID != -1)
//- write to file //- write to file
if(Pstream::master()) if(Pstream::master())
{ {
OFstream& forceDispFile = *filePtr; OFstream& forceDispFile = *filePtr;
forceDispFile << avDisp.x() << " " << avDisp.y() << " " << avDisp.z() << " " forceDispFile << avDisp.x() << " " << avDisp.y() << " " << avDisp.z() << " "
<< force.x() << " " << force.y() << " " << force.z() << endl; << force.x() << " " << force.y() << " " << force.z() << endl;
} }
} }

View file

@ -21,9 +21,9 @@ if(iCorr == 0)
scalar sumMagB = gSum(magSqr(b)); scalar sumMagB = gSum(magSqr(b));
if(sumMagB < SMALL) if(sumMagB < SMALL)
{ {
//Warning << "Aitken under-relaxation: denominator less then SMALL" //Warning << "Aitken under-relaxation: denominator less then SMALL"
// << endl; // << endl;
sumMagB += SMALL; sumMagB += SMALL;
} }
aitkenTheta = -aitkenTheta* aitkenTheta = -aitkenTheta*

View file

@ -22,10 +22,10 @@ else if(divDSigmaExpMethod == "surface")
// divDSigmaExp = fvc::div // divDSigmaExp = fvc::div
// ( // (
// muf*(mesh.Sf() & fvc::interpolate(gradDU.T())) // muf*(mesh.Sf() & fvc::interpolate(gradDU.T()))
// + lambdaf*(mesh.Sf() & I*fvc::interpolate(tr(gradDU))) // + lambdaf*(mesh.Sf() & I*fvc::interpolate(tr(gradDU)))
// - (muf + lambdaf)*(mesh.Sf() & fvc::interpolate(gradDU)) // - (muf + lambdaf)*(mesh.Sf() & fvc::interpolate(gradDU))
// ); // );
} }
else if(divDSigmaExpMethod == "decompose") else if(divDSigmaExpMethod == "decompose")
{ {
@ -33,23 +33,23 @@ else if(divDSigmaExpMethod == "decompose")
divDSigmaExp = fvc::div divDSigmaExp = fvc::div
( (
mesh.magSf()* mesh.magSf()*
( (
- (muf + lambdaf)*(fvc::snGrad(DU) & (I - n*n)) - (muf + lambdaf)*(fvc::snGrad(DU) & (I - n*n))
+ lambdaf*tr(shearGradDU & (I - n*n))*n + lambdaf*tr(shearGradDU & (I - n*n))*n
+ muf*(shearGradDU & n) + muf*(shearGradDU & n)
) )
); );
// divDSigmaExp = fvc::div // divDSigmaExp = fvc::div
// ( // (
// mesh.magSf() // mesh.magSf()
// *( // *(
// - (muf + lambdaf)*(fvc::snGrad(DU)&(I - n*n)) // - (muf + lambdaf)*(fvc::snGrad(DU)&(I - n*n))
// + lambdaf*tr(shearGradDU&(I - n*n))*n // + lambdaf*tr(shearGradDU&(I - n*n))*n
// + muf*(shearGradDU&n) // + muf*(shearGradDU&n)
// ) // )
// ); // );
} }
else if(divDSigmaExpMethod == "laplacian") else if(divDSigmaExpMethod == "laplacian")
{ {

View file

@ -8,7 +8,7 @@ if(divDSigmaNonLinExpMethod == "standard")
(gradDU & gradU.T()) (gradDU & gradU.T())
+ (gradU & gradDU.T()) + (gradU & gradDU.T())
+ (gradDU & gradDU.T()) + (gradDU & gradDU.T())
) )
) )
+ ( + (
0.5*lambda* 0.5*lambda*
@ -68,23 +68,23 @@ else if(divDSigmaNonLinExpMethod == "surface")
// divDSigmaNonLinExp = // divDSigmaNonLinExp =
// fvc::div // fvc::div
// ( // (
// ( muf * mesh.Sf() // ( muf * mesh.Sf()
// & fvc::interpolate( // & fvc::interpolate(
// (gradDU & gradU.T()) // (gradDU & gradU.T())
// + (gradU & gradDU.T()) // + (gradU & gradDU.T())
// + (gradDU & gradDU.T()) // + (gradDU & gradDU.T())
// ) ) // ) )
// + ( lambdaf * 0.5* tr( // + ( lambdaf * 0.5* tr(
// fvc::interpolate( // fvc::interpolate(
// (gradDU & gradU.T()) // (gradDU & gradU.T())
// + (gradU & gradDU.T()) // + (gradU & gradDU.T())
// + (gradDU & gradDU.T()) // + (gradDU & gradDU.T())
// ) // )
// ) * mesh.Sf() ) // ) * mesh.Sf() )
// + (mesh.Sf() & fvc::interpolate( (DSigma & gradU ) // + (mesh.Sf() & fvc::interpolate( (DSigma & gradU )
// + ( (sigma + DSigma) & gradDU ) // + ( (sigma + DSigma) & gradDU )
// ) ) // ) )
// ); // );
} }
else else
{ {

View file

@ -199,33 +199,33 @@ forAll(extrapGradDU.internalField(), facei)
tensor deltaOwnDotgradGradDUOwn = tensor deltaOwnDotgradGradDUOwn =
tensor( tensor(
deltaOwn.x()*gradGradDUXXXOwn + deltaOwn.y()*gradGradDUYXXOwn + deltaOwn.z()*gradGradDUZXXOwn, deltaOwn.x()*gradGradDUXXXOwn + deltaOwn.y()*gradGradDUYXXOwn + deltaOwn.z()*gradGradDUZXXOwn,
deltaOwn.x()*gradGradDUXXYOwn + deltaOwn.y()*gradGradDUYXYOwn + deltaOwn.z()*gradGradDUZXYOwn, deltaOwn.x()*gradGradDUXXYOwn + deltaOwn.y()*gradGradDUYXYOwn + deltaOwn.z()*gradGradDUZXYOwn,
deltaOwn.x()*gradGradDUXXZOwn + deltaOwn.y()*gradGradDUYXZOwn + deltaOwn.z()*gradGradDUZXZOwn, deltaOwn.x()*gradGradDUXXZOwn + deltaOwn.y()*gradGradDUYXZOwn + deltaOwn.z()*gradGradDUZXZOwn,
deltaOwn.x()*gradGradDUXYXOwn + deltaOwn.y()*gradGradDUYYXOwn + deltaOwn.z()*gradGradDUZYXOwn, deltaOwn.x()*gradGradDUXYXOwn + deltaOwn.y()*gradGradDUYYXOwn + deltaOwn.z()*gradGradDUZYXOwn,
deltaOwn.x()*gradGradDUXYYOwn + deltaOwn.y()*gradGradDUYYYOwn + deltaOwn.z()*gradGradDUZYYOwn, deltaOwn.x()*gradGradDUXYYOwn + deltaOwn.y()*gradGradDUYYYOwn + deltaOwn.z()*gradGradDUZYYOwn,
deltaOwn.x()*gradGradDUXYZOwn + deltaOwn.y()*gradGradDUYYZOwn + deltaOwn.z()*gradGradDUZYZOwn, deltaOwn.x()*gradGradDUXYZOwn + deltaOwn.y()*gradGradDUYYZOwn + deltaOwn.z()*gradGradDUZYZOwn,
deltaOwn.x()*gradGradDUXZXOwn + deltaOwn.y()*gradGradDUYZXOwn + deltaOwn.z()*gradGradDUZZXOwn, deltaOwn.x()*gradGradDUXZXOwn + deltaOwn.y()*gradGradDUYZXOwn + deltaOwn.z()*gradGradDUZZXOwn,
deltaOwn.x()*gradGradDUXZYOwn + deltaOwn.y()*gradGradDUYZYOwn + deltaOwn.z()*gradGradDUZZYOwn, deltaOwn.x()*gradGradDUXZYOwn + deltaOwn.y()*gradGradDUYZYOwn + deltaOwn.z()*gradGradDUZZYOwn,
deltaOwn.x()*gradGradDUXZZOwn + deltaOwn.y()*gradGradDUYZZOwn + deltaOwn.z()*gradGradDUZZZOwn deltaOwn.x()*gradGradDUXZZOwn + deltaOwn.y()*gradGradDUYZZOwn + deltaOwn.z()*gradGradDUZZZOwn
); );
tensor deltaNeiDotgradGradDUNei = tensor deltaNeiDotgradGradDUNei =
tensor( tensor(
deltaNei.x()*gradGradDUXXXNei + deltaNei.y()*gradGradDUYXXNei + deltaNei.z()*gradGradDUZXXNei, deltaNei.x()*gradGradDUXXXNei + deltaNei.y()*gradGradDUYXXNei + deltaNei.z()*gradGradDUZXXNei,
deltaNei.x()*gradGradDUXXYNei + deltaNei.y()*gradGradDUYXYNei + deltaNei.z()*gradGradDUZXYNei, deltaNei.x()*gradGradDUXXYNei + deltaNei.y()*gradGradDUYXYNei + deltaNei.z()*gradGradDUZXYNei,
deltaNei.x()*gradGradDUXXZNei + deltaNei.y()*gradGradDUYXZNei + deltaNei.z()*gradGradDUZXZNei, deltaNei.x()*gradGradDUXXZNei + deltaNei.y()*gradGradDUYXZNei + deltaNei.z()*gradGradDUZXZNei,
deltaNei.x()*gradGradDUXYXNei + deltaNei.y()*gradGradDUYYXNei + deltaNei.z()*gradGradDUZYXNei, deltaNei.x()*gradGradDUXYXNei + deltaNei.y()*gradGradDUYYXNei + deltaNei.z()*gradGradDUZYXNei,
deltaNei.x()*gradGradDUXYYNei + deltaNei.y()*gradGradDUYYYNei + deltaNei.z()*gradGradDUZYYNei, deltaNei.x()*gradGradDUXYYNei + deltaNei.y()*gradGradDUYYYNei + deltaNei.z()*gradGradDUZYYNei,
deltaNei.x()*gradGradDUXYZNei + deltaNei.y()*gradGradDUYYZNei + deltaNei.z()*gradGradDUZYZNei, deltaNei.x()*gradGradDUXYZNei + deltaNei.y()*gradGradDUYYZNei + deltaNei.z()*gradGradDUZYZNei,
deltaNei.x()*gradGradDUXZXNei + deltaNei.y()*gradGradDUYZXNei + deltaNei.z()*gradGradDUZZXNei, deltaNei.x()*gradGradDUXZXNei + deltaNei.y()*gradGradDUYZXNei + deltaNei.z()*gradGradDUZZXNei,
deltaNei.x()*gradGradDUXZYNei + deltaNei.y()*gradGradDUYZYNei + deltaNei.z()*gradGradDUZZYNei, deltaNei.x()*gradGradDUXZYNei + deltaNei.y()*gradGradDUYZYNei + deltaNei.z()*gradGradDUZZYNei,
deltaNei.x()*gradGradDUXZZNei + deltaNei.y()*gradGradDUYZZNei + deltaNei.z()*gradGradDUZZZNei deltaNei.x()*gradGradDUXZZNei + deltaNei.y()*gradGradDUYZZNei + deltaNei.z()*gradGradDUZZZNei
); );
// get average of extrapolated values // get average of extrapolated values
@ -250,12 +250,12 @@ forAll(extrapGradDU.boundaryField(), patchi)
// calculate thirdOrderTerm // calculate thirdOrderTerm
volVectorField divThirdOrderTerm ( volVectorField divThirdOrderTerm (
"thirdOrderTerm", "thirdOrderTerm",
fvc::div( fvc::div(
(2*muf+lambdaf)*mesh.Sf() (2*muf+lambdaf)*mesh.Sf()
& (extrapGradDU - averageGradDU) & (extrapGradDU - averageGradDU)
) )
); );
// if(runTime.outputTime()) // if(runTime.outputTime())
// { // {

View file

@ -24,20 +24,20 @@
IOobject::READ_IF_PRESENT, IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
mesh, mesh,
dimensionedVector("zero", dimLength, vector::zero) dimensionedVector("zero", dimLength, vector::zero)
); );
volTensorField gradU volTensorField gradU
( (
IOobject IOobject
( (
"grad(U)", "grad(U)",
runTime.timeName(), runTime.timeName(),
mesh, mesh,
IOobject::READ_IF_PRESENT, IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
mesh, mesh,
dimensionedTensor("zero", dimless, tensor::zero) dimensionedTensor("zero", dimless, tensor::zero)
); );
@ -53,8 +53,8 @@
IOobject::READ_IF_PRESENT, IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
mesh, mesh,
dimensionedSymmTensor("zero", dimless, symmTensor::zero) dimensionedSymmTensor("zero", dimless, symmTensor::zero)
); );
volSymmTensorField epsilon volSymmTensorField epsilon
@ -67,8 +67,8 @@
IOobject::READ_IF_PRESENT, IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
mesh, mesh,
dimensionedSymmTensor("zero", dimless, symmTensor::zero) dimensionedSymmTensor("zero", dimless, symmTensor::zero)
); );
//- plastic strain //- plastic strain
@ -113,20 +113,20 @@
IOobject::READ_IF_PRESENT, IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
mesh, mesh,
dimensionedSymmTensor("zero", dimForce/dimArea, symmTensor::zero) dimensionedSymmTensor("zero", dimForce/dimArea, symmTensor::zero)
); );
volVectorField divDSigmaExp volVectorField divDSigmaExp
( (
IOobject IOobject
( (
"divDSigmaExp", "divDSigmaExp",
runTime.timeName(), runTime.timeName(),
mesh, mesh,
IOobject::NO_READ, IOobject::NO_READ,
IOobject::NO_WRITE IOobject::NO_WRITE
), ),
mesh, mesh,
dimensionedVector("zero", dimensionSet(1,-2,-2,0,0,0,0), vector::zero) dimensionedVector("zero", dimensionSet(1,-2,-2,0,0,0,0), vector::zero)
); );
@ -135,12 +135,12 @@
( (
IOobject IOobject
( (
"divDSigmaNonLinExp", "divDSigmaNonLinExp",
runTime.timeName(), runTime.timeName(),
mesh, mesh,
IOobject::NO_READ, IOobject::NO_READ,
IOobject::NO_WRITE IOobject::NO_WRITE
), ),
mesh, mesh,
dimensionedVector("zero", dimensionSet(1,-2,-2,0,0,0,0), vector::zero) dimensionedVector("zero", dimensionSet(1,-2,-2,0,0,0,0), vector::zero)
); );
@ -171,7 +171,7 @@
IOobject::NO_WRITE IOobject::NO_WRITE
), ),
mesh, mesh,
dimensionedVector("zero", dimLength, vector::zero) dimensionedVector("zero", dimLength, vector::zero)
); );
// aitken relaxation factor // aitken relaxation factor
scalar aitkenInitialRes = 1.0; scalar aitkenInitialRes = 1.0;

View file

@ -5,8 +5,8 @@ label historyPatchID = mesh.boundaryMesh().findPatchID(historyPatchName);
if(historyPatchID == -1) if(historyPatchID == -1)
{ {
Warning << "history patch " << historyPatchName Warning << "history patch " << historyPatchName
<< " not found. Force-displacement will not be written" << " not found. Force-displacement will not be written"
<< endl; << endl;
} }
else if(Pstream::master()) else if(Pstream::master())
{ {
@ -16,8 +16,8 @@ if(historyPatchID == -1)
{ {
fileName forceFileName(historyDir/"forceDisp_"+historyPatchName+".dat"); fileName forceFileName(historyDir/"forceDisp_"+historyPatchName+".dat");
Info << "\nForce-displacement for patch " << historyPatchName Info << "\nForce-displacement for patch " << historyPatchName
<< " will be written to " << forceFileName << " will be written to " << forceFileName
<< endl; << endl;
forceFilePtr = new OFstream(forceFileName); forceFilePtr = new OFstream(forceFileName);
OFstream& forceDispFile = *forceFilePtr; OFstream& forceDispFile = *forceFilePtr;
forceDispFile << "#Disp(mm)\tForce(N)" << endl; forceDispFile << "#Disp(mm)\tForce(N)" << endl;
@ -26,9 +26,9 @@ if(historyPatchID == -1)
{ {
fileName stressFileName(historyDir/"stressStrain_"+historyPatchName+".dat"); fileName stressFileName(historyDir/"stressStrain_"+historyPatchName+".dat");
Info << "\nStress(2nd Piola-Kirchoff)-strain(Green) for patch " Info << "\nStress(2nd Piola-Kirchoff)-strain(Green) for patch "
<< historyPatchName << historyPatchName
<< " will be written to " << stressFileName << " will be written to " << stressFileName
<< endl; << endl;
stressFilePtr = new OFstream(stressFileName); stressFilePtr = new OFstream(stressFileName);
OFstream& stressStrainFile = *stressFilePtr; OFstream& stressStrainFile = *stressFilePtr;
stressStrainFile << "#Strain(-)\tStress(Pa)" << endl; stressStrainFile << "#Strain(-)\tStress(Pa)" << endl;

View file

@ -4,6 +4,6 @@ Info << "divSigmaNonLinExp method " << divDSigmaNonLinExpMethod << endl;
if(divDSigmaNonLinExpMethod != "standard" && divDSigmaNonLinExpMethod != "surface") if(divDSigmaNonLinExpMethod != "standard" && divDSigmaNonLinExpMethod != "surface")
{ {
FatalError << "divSigmaNonLinExp method " << divDSigmaNonLinExpMethod << " not found!" << nl FatalError << "divSigmaNonLinExp method " << divDSigmaNonLinExpMethod << " not found!" << nl
<< "valid methods are:\nstandard\nsurface" << "valid methods are:\nstandard\nsurface"
<< exit(FatalError); << exit(FatalError);
} }

View file

@ -2,13 +2,13 @@
if(historyPatchID != -1) if(historyPatchID != -1)
{ {
Info << "Writing disp-force to file for patch " << historyPatchName Info << "Writing disp-force to file for patch " << historyPatchName
<< endl; << endl;
//- for small strain or moving mesh //- for small strain or moving mesh
//scalar force = gSum( //scalar force = gSum(
// direction & // direction &
// (mesh.boundary()[historyPatchID].Sf() & sigma.boundaryField()[historyPatchID]) // (mesh.boundary()[historyPatchID].Sf() & sigma.boundaryField()[historyPatchID])
// ); // );
//- for large strain total lagrangian //- for large strain total lagrangian
tensorField F = I + gradU.boundaryField()[historyPatchID]; tensorField F = I + gradU.boundaryField()[historyPatchID];
@ -17,7 +17,7 @@ if(historyPatchID != -1)
Info << "Writing strain-stress to file for patch " << historyPatchName Info << "Writing strain-stress to file for patch " << historyPatchName
<< endl; << endl;
// avaerage stress strain // avaerage stress strain
symmTensor stress = gAverage(sigma.boundaryField()[historyPatchID]); symmTensor stress = gAverage(sigma.boundaryField()[historyPatchID]);
@ -27,19 +27,19 @@ if(historyPatchID != -1)
// write to file // write to file
if(Pstream::master()) if(Pstream::master())
{ {
OFstream& forceDispFile = *forceFilePtr; OFstream& forceDispFile = *forceFilePtr;
label width = 20; label width = 20;
forceDispFile << disp.x() << " " << disp.y() << " " << disp.z(); forceDispFile << disp.x() << " " << disp.y() << " " << disp.z();
forceDispFile.width(width); forceDispFile.width(width);
forceDispFile << force.x() << " " << force.y() << " " << force.z() forceDispFile << force.x() << " " << force.y() << " " << force.z()
<< endl; << endl;
OFstream& stressStrainFile = *stressFilePtr; OFstream& stressStrainFile = *stressFilePtr;
stressStrainFile << strain.xx() << " " << strain.xy() << " " << strain.xz() << " " stressStrainFile << strain.xx() << " " << strain.xy() << " " << strain.xz() << " "
<< strain.yy() << " " << strain.yz() << " " << strain.zz(); << strain.yy() << " " << strain.yz() << " " << strain.zz();
stressStrainFile.width(width); stressStrainFile.width(width);
stressStrainFile << stress.xx() << " " << stress.xy() << " " << stress.xz() << " " stressStrainFile << stress.xx() << " " << stress.xy() << " " << stress.xz() << " "
<< stress.yy() << " " << stress.yz() << " " << stress.zz() << stress.yy() << " " << stress.yz() << " " << stress.zz()
<< endl; << endl;
} }
} }

View file

@ -21,9 +21,9 @@ if(iCorr == 0)
scalar sumMagB = gSum(magSqr(b)); scalar sumMagB = gSum(magSqr(b));
if(sumMagB < SMALL) if(sumMagB < SMALL)
{ {
//Warning << "Aitken under-relaxation: denominator less then SMALL" //Warning << "Aitken under-relaxation: denominator less then SMALL"
// << endl; // << endl;
sumMagB += SMALL; sumMagB += SMALL;
} }
aitkenTheta = -aitkenTheta* aitkenTheta = -aitkenTheta*

View file

@ -10,10 +10,10 @@ if(divDSigmaExpMethod == "standard")
{ {
divDSigmaExp = fvc::div divDSigmaExp = fvc::div
( (
muf*(mesh.Sf() & fvc::interpolate(gradDU.T())) muf*(mesh.Sf() & fvc::interpolate(gradDU.T()))
+ lambdaf*(mesh.Sf() & I*fvc::interpolate(tr(gradDU))) + lambdaf*(mesh.Sf() & I*fvc::interpolate(tr(gradDU)))
- (muf + lambdaf)*(mesh.Sf() & fvc::interpolate(gradDU)) - (muf + lambdaf)*(mesh.Sf() & fvc::interpolate(gradDU))
); );
} }
else if(divDSigmaExpMethod == "decompose") else if(divDSigmaExpMethod == "decompose")
{ {
@ -22,13 +22,13 @@ if(divDSigmaExpMethod == "standard")
divDSigmaExp = fvc::div divDSigmaExp = fvc::div
( (
mesh.magSf() mesh.magSf()
*( *(
- (muf + lambdaf)*(fvc::snGrad(DU)&(I - n*n)) - (muf + lambdaf)*(fvc::snGrad(DU)&(I - n*n))
+ lambdaf*tr(shearGradDU&(I - n*n))*n + lambdaf*tr(shearGradDU&(I - n*n))*n
+ muf*(shearGradDU&n) + muf*(shearGradDU&n)
) )
); );
} }
else if(divDSigmaExpMethod == "laplacian") else if(divDSigmaExpMethod == "laplacian")
{ {
@ -36,10 +36,10 @@ if(divDSigmaExpMethod == "standard")
- fvc::laplacian(mu + lambda, DU, "laplacian(DDU,DU)") - fvc::laplacian(mu + lambda, DU, "laplacian(DDU,DU)")
+ fvc::div + fvc::div
( (
mu*gradDU.T() mu*gradDU.T()
+ lambda*(I*tr(gradDU)), + lambda*(I*tr(gradDU)),
"div(sigma)" "div(sigma)"
); );
} }
else else
{ {

View file

@ -12,13 +12,13 @@ if(divDSigmaNonLinExpMethod == "standard")
{ {
divDSigmaNonLinExp = divDSigmaNonLinExp =
fvc::div( fvc::div(
mesh.magSf() mesh.magSf()
*( *(
( muf * (n & fvc::interpolate( gradDU & gradDU.T() )) ) ( muf * (n & fvc::interpolate( gradDU & gradDU.T() )) )
+ ( 0.5*lambdaf * (n * tr(fvc::interpolate( gradDU & gradDU.T() ))) ) + ( 0.5*lambdaf * (n * tr(fvc::interpolate( gradDU & gradDU.T() ))) )
+ (n & fvc::interpolate( (sigma + DSigma) & gradDU )) + (n & fvc::interpolate( (sigma + DSigma) & gradDU ))
) )
); );
} }
else else
{ {

View file

@ -30,9 +30,9 @@ FieldField<Field, vector> extraVecs(ptc.size());
// extraVecs.hook(new vectorField(curFaces.size())); //- no hook function // extraVecs.hook(new vectorField(curFaces.size())); //- no hook function
extraVecs.set extraVecs.set
( (
pointI, pointI,
new vectorField(curFaces.size()) new vectorField(curFaces.size())
); );
vectorField& curExtraVectors = extraVecs[pointI]; vectorField& curExtraVectors = extraVecs[pointI];
@ -42,30 +42,30 @@ FieldField<Field, vector> extraVecs(ptc.size());
// Go through all the faces // Go through all the faces
forAll (curFaces, faceI) forAll (curFaces, faceI)
{ {
if (!mesh.isInternalFace(curFaces[faceI])) if (!mesh.isInternalFace(curFaces[faceI]))
{ {
// This is a boundary face. If not in the empty patch // This is a boundary face. If not in the empty patch
// or coupled calculate the extrapolation vector // or coupled calculate the extrapolation vector
label patchID = label patchID =
mesh.boundaryMesh().whichPatch(curFaces[faceI]); mesh.boundaryMesh().whichPatch(curFaces[faceI]);
if if
( (
!isA<emptyFvPatch>(bm[patchID]) !isA<emptyFvPatch>(bm[patchID])
&& !bm[patchID].coupled() && !bm[patchID].coupled()
) )
{ {
// Found a face for extrapolation // Found a face for extrapolation
curExtraVectors[nFacesAroundPoint] = curExtraVectors[nFacesAroundPoint] =
pointLoc pointLoc
- centres.boundaryField()[patchID] - centres.boundaryField()[patchID]
[bm[patchID].patch().whichFace(curFaces[faceI])]; [bm[patchID].patch().whichFace(curFaces[faceI])];
nFacesAroundPoint++; nFacesAroundPoint++;
} }
} }
} }
curExtraVectors.setSize(nFacesAroundPoint); curExtraVectors.setSize(nFacesAroundPoint);
} }

View file

@ -35,9 +35,9 @@ FieldField<Field, scalar> w(ptc.size());
//w.hook(new scalarField(curFaces.size())); //philipc no hook function //w.hook(new scalarField(curFaces.size())); //philipc no hook function
w.set w.set
( (
pointI, pointI,
new scalarField(curFaces.size()) new scalarField(curFaces.size())
); );
scalarField& curWeights = w[pointI]; scalarField& curWeights = w[pointI];
@ -47,38 +47,38 @@ FieldField<Field, scalar> w(ptc.size());
// Go through all the faces // Go through all the faces
forAll (curFaces, faceI) forAll (curFaces, faceI)
{ {
if (!mesh.isInternalFace(curFaces[faceI])) if (!mesh.isInternalFace(curFaces[faceI]))
{ {
// This is a boundary face. If not in the empty patch // This is a boundary face. If not in the empty patch
// or coupled calculate the extrapolation vector // or coupled calculate the extrapolation vector
label patchID = label patchID =
mesh.boundaryMesh().whichPatch(curFaces[faceI]); mesh.boundaryMesh().whichPatch(curFaces[faceI]);
if if
( (
!isA<emptyFvPatch>(bm[patchID]) !isA<emptyFvPatch>(bm[patchID])
&& !( && !(
bm[patchID].coupled() bm[patchID].coupled()
//&& Pstream::parRun() //&& Pstream::parRun()
//&& !mesh.parallelData().cyclicParallel() //&& !mesh.parallelData().cyclicParallel()
) )
) )
{ {
curWeights[nFacesAroundPoint] = curWeights[nFacesAroundPoint] =
1.0/mag 1.0/mag
( (
pointLoc pointLoc
- centres.boundaryField()[patchID] - centres.boundaryField()[patchID]
[ [
bm[patchID].patch().whichFace(curFaces[faceI]) bm[patchID].patch().whichFace(curFaces[faceI])
] ]
); );
nFacesAroundPoint++; nFacesAroundPoint++;
} }
} }
} }
// Reset the sizes of the local weights // Reset the sizes of the local weights
curWeights.setSize(nFacesAroundPoint); curWeights.setSize(nFacesAroundPoint);

View file

@ -106,29 +106,29 @@
//- explicit terms in the momentum equation //- explicit terms in the momentum equation
volVectorField divDSigmaExp volVectorField divDSigmaExp
( (
IOobject IOobject
( (
"divDSigmaExp", "divDSigmaExp",
runTime.timeName(), runTime.timeName(),
mesh, mesh,
IOobject::NO_READ, IOobject::NO_READ,
IOobject::NO_WRITE IOobject::NO_WRITE
), ),
mesh, mesh,
dimensionedVector("zero", dimensionSet(1, -2, -2, 0, 0, 0, 0), vector::zero) dimensionedVector("zero", dimensionSet(1, -2, -2, 0, 0, 0, 0), vector::zero)
); );
volVectorField divDSigmaNonLinExp volVectorField divDSigmaNonLinExp
( (
IOobject IOobject
( (
"divDSigmaNonLinExp", "divDSigmaNonLinExp",
runTime.timeName(), runTime.timeName(),
mesh, mesh,
IOobject::NO_READ, IOobject::NO_READ,
IOobject::NO_WRITE IOobject::NO_WRITE
), ),
mesh, mesh,
dimensionedVector("zero", dimensionSet(1,-2,-2,0,0,0,0), vector::zero) dimensionedVector("zero", dimensionSet(1,-2,-2,0,0,0,0), vector::zero)
); );
@ -152,15 +152,15 @@
( (
IOobject IOobject
( (
"aitkenDelta", "aitkenDelta",
runTime.timeName(), runTime.timeName(),
mesh, mesh,
IOobject::NO_READ, IOobject::NO_READ,
IOobject::NO_WRITE IOobject::NO_WRITE
), ),
mesh, mesh,
dimensionedVector("zero", dimLength, vector::zero) dimensionedVector("zero", dimLength, vector::zero)
); );
// aitken relaxation factor // aitken relaxation factor
scalar aitkenInitialRes = 1.0; scalar aitkenInitialRes = 1.0;
scalar aitkenTheta = 0.1; scalar aitkenTheta = 0.1;
@ -169,12 +169,12 @@ scalar aitkenTheta = 0.1;
// ( // (
// IOobject // IOobject
// ( // (
// "resid", // "resid",
// runTime.timeName(), // runTime.timeName(),
// mesh, // mesh,
// IOobject::NO_READ, // IOobject::NO_READ,
// IOobject::AUTO_WRITE // IOobject::AUTO_WRITE
// ), // ),
// mesh, // mesh,
// dimensionedVector("zero", dimless, vector::zero) // dimensionedVector("zero", dimless, vector::zero)
// ); // );

View file

@ -5,8 +5,8 @@ label historyPatchID = mesh.boundaryMesh().findPatchID(historyPatchName);
if(historyPatchID == -1) if(historyPatchID == -1)
{ {
Warning << "history patch " << historyPatchName Warning << "history patch " << historyPatchName
<< " not found. Force-displacement will not be written" << " not found. Force-displacement will not be written"
<< endl; << endl;
} }
else if(Pstream::master()) else if(Pstream::master())
{ {
@ -16,8 +16,8 @@ if(historyPatchID == -1)
{ {
fileName forceFileName(historyDir/"forceDisp_"+historyPatchName+".dat"); fileName forceFileName(historyDir/"forceDisp_"+historyPatchName+".dat");
Info << "\nForce-displacement for patch " << historyPatchName Info << "\nForce-displacement for patch " << historyPatchName
<< " will be written to " << forceFileName << " will be written to " << forceFileName
<< endl; << endl;
forceFilePtr = new OFstream(forceFileName); forceFilePtr = new OFstream(forceFileName);
OFstream& forceDispFile = *forceFilePtr; OFstream& forceDispFile = *forceFilePtr;
forceDispFile << "#Disp(mm)\tForce(N)" << endl; forceDispFile << "#Disp(mm)\tForce(N)" << endl;
@ -26,9 +26,9 @@ if(historyPatchID == -1)
{ {
fileName stressFileName(historyDir/"stressStrain_"+historyPatchName+".dat"); fileName stressFileName(historyDir/"stressStrain_"+historyPatchName+".dat");
Info << "\nCauchy Stress vs. Almansi Strain for patch " Info << "\nCauchy Stress vs. Almansi Strain for patch "
<< historyPatchName << historyPatchName
<< " will be written to " << stressFileName << " will be written to " << stressFileName
<< endl; << endl;
stressFilePtr = new OFstream(stressFileName); stressFilePtr = new OFstream(stressFileName);
OFstream& stressStrainFile = *stressFilePtr; OFstream& stressStrainFile = *stressFilePtr;
stressStrainFile << "#Strain(-)\tStress(Pa)" << endl; stressStrainFile << "#Strain(-)\tStress(Pa)" << endl;

View file

@ -10,20 +10,20 @@ solidInterface* solidInterfacePtr(NULL);
if(solidInterfaceCorr) if(solidInterfaceCorr)
{ {
Info << "Creating solid interface correction" << endl; Info << "Creating solid interface correction" << endl;
solidInterfacePtr = new solidInterface(mesh, rheology); solidInterfacePtr = new solidInterface(mesh, rheology);
solidInterfacePtr->modifyProperties(muf, lambdaf); solidInterfacePtr->modifyProperties(muf, lambdaf);
//- solidInterface needs muf and lambdaf to be used for divDSigmaExp //- solidInterface needs muf and lambdaf to be used for divDSigmaExp
if(divDSigmaExpMethod != "surface" && divDSigmaExpMethod != "decompose") if(divDSigmaExpMethod != "surface" && divDSigmaExpMethod != "decompose")
{ {
FatalError << "divDSigmaExp must be decompose or surface when solidInterface is on" FatalError << "divDSigmaExp must be decompose or surface when solidInterface is on"
<< exit(FatalError); << exit(FatalError);
} }
if(divDSigmaLargeStrainExpMethod == "surface") if(divDSigmaLargeStrainExpMethod == "surface")
{ {
FatalError << "divDSigmaLargeStrainExp must be surface when solidInterface is on" FatalError << "divDSigmaLargeStrainExp must be surface when solidInterface is on"
<< exit(FatalError); << exit(FatalError);
} }
} }
} }

View file

@ -10,20 +10,20 @@ solidInterfaceNonLin* solidInterfacePtr(NULL);
if(solidInterfaceCorr) if(solidInterfaceCorr)
{ {
Info << "Creating solid interface nonlinear correction" << endl; Info << "Creating solid interface nonlinear correction" << endl;
solidInterfacePtr = new solidInterfaceNonLin(mesh, rheology); solidInterfacePtr = new solidInterfaceNonLin(mesh, rheology);
solidInterfacePtr->modifyProperties(muf, lambdaf); solidInterfacePtr->modifyProperties(muf, lambdaf);
//- solidInterface needs muf and lambdaf to be used for divDSigmaExp //- solidInterface needs muf and lambdaf to be used for divDSigmaExp
if(divDSigmaExpMethod != "surface" && divDSigmaExpMethod != "decompose") if(divDSigmaExpMethod != "surface" && divDSigmaExpMethod != "decompose")
{ {
FatalError << "divDSigmaExp must be decompose or surface when solidInterface is on" FatalError << "divDSigmaExp must be decompose or surface when solidInterface is on"
<< exit(FatalError); << exit(FatalError);
} }
if(divDSigmaLargeStrainExpMethod != "surface") if(divDSigmaLargeStrainExpMethod != "surface")
{ {
FatalError << "divDSigmaLargeStrainExp must be surface when solidInterface is on" FatalError << "divDSigmaLargeStrainExp must be surface when solidInterface is on"
<< exit(FatalError); << exit(FatalError);
} }
} }
} }

View file

@ -14,10 +14,10 @@ forAll (bm, patchI)
( (
!isA<emptyFvPatch>(bm[patchI]) !isA<emptyFvPatch>(bm[patchI])
&& !( && !(
bm[patchI].coupled() bm[patchI].coupled()
//&& Pstream::parRun() //&& Pstream::parRun()
//&& !mesh.parallelData().cyclicParallel() //&& !mesh.parallelData().cyclicParallel()
) )
) )
{ {
const labelList& bp = bm[patchI].patch().boundaryPoints(); const labelList& bp = bm[patchI].patch().boundaryPoints();
@ -25,9 +25,9 @@ forAll (bm, patchI)
const labelList& meshPoints = bm[patchI].patch().meshPoints(); const labelList& meshPoints = bm[patchI].patch().meshPoints();
forAll (bp, pointI) forAll (bp, pointI)
{ {
pointsCorrectionMap.insert(meshPoints[bp[pointI]]); pointsCorrectionMap.insert(meshPoints[bp[pointI]]);
} }
} }
} }

View file

@ -9,7 +9,7 @@ if(moveMeshMethod == "inverseDistance")
else else
{ {
FatalError << "move mesh method " << moveMeshMethod << " not recognised" << nl FatalError << "move mesh method " << moveMeshMethod << " not recognised" << nl
<< "available methods are:" << nl << "available methods are:" << nl
<< "inverseDistance" << nl << "inverseDistance" << nl
<< "leastSquares" << exit(FatalError); << "leastSquares" << exit(FatalError);
} }

View file

@ -21,10 +21,10 @@
( (
IOobject IOobject
( (
"pointDU", "pointDU",
runTime.timeName(), runTime.timeName(),
mesh mesh
), ),
pMesh, pMesh,
dimensionedVector("zero", dimLength, vector::zero), dimensionedVector("zero", dimLength, vector::zero),
types types
@ -48,7 +48,7 @@
forAll (pointDUI, pointI) forAll (pointDUI, pointI)
{ {
newPoints[pointI] += pointDUI[pointI]; newPoints[pointI] += pointDUI[pointI];
} }
twoDPointCorrector twoDCorrector(mesh); twoDPointCorrector twoDCorrector(mesh);
@ -60,6 +60,6 @@
// else // else
// { // {
// FatalErrorIn(args.executable()) // FatalErrorIn(args.executable())
// << "Negative Jacobian" // << "Negative Jacobian"
// << exit(FatalError); // << exit(FatalError);
// } // }

View file

@ -67,31 +67,31 @@ forAll (ptc, pointI)
forAll (curFaces, faceI) forAll (curFaces, faceI)
{ {
if (!mesh.isInternalFace(curFaces[faceI])) if (!mesh.isInternalFace(curFaces[faceI]))
{ {
// This is a boundary face. If not in the empty patch // This is a boundary face. If not in the empty patch
// or coupled calculate the extrapolation vector // or coupled calculate the extrapolation vector
label patchID = label patchID =
mesh.boundaryMesh().whichPatch(curFaces[faceI]); mesh.boundaryMesh().whichPatch(curFaces[faceI]);
if if
( (
!isA<emptyFvPatch>(mesh.boundary()[patchID]) !isA<emptyFvPatch>(mesh.boundary()[patchID])
&& !mesh.boundary()[patchID].coupled() && !mesh.boundary()[patchID].coupled()
) )
{ {
label faceInPatchID = label faceInPatchID =
bm[patchID].patch().whichFace(curFaces[faceI]); bm[patchID].patch().whichFace(curFaces[faceI]);
pfCorr[curPoint] += pfCorr[curPoint] +=
w[pointI][fI]* w[pointI][fI]*
( (
extraVecs[pointI][fI] extraVecs[pointI][fI]
& gradDU.boundaryField()[patchID][faceInPatchID] & gradDU.boundaryField()[patchID][faceInPatchID]
); );
fI++; fI++;
} }
} }
} }
} }

View file

@ -4,6 +4,6 @@ Info << "divSigmaNonLinExp method " << divDSigmaNonLinExpMethod << endl;
if(divDSigmaNonLinExpMethod != "standard" && divDSigmaNonLinExpMethod != "surface") if(divDSigmaNonLinExpMethod != "standard" && divDSigmaNonLinExpMethod != "surface")
{ {
FatalError << "divSigmaNonLinExp method " << divDSigmaNonLinExpMethod << " not found!" << nl FatalError << "divSigmaNonLinExp method " << divDSigmaNonLinExpMethod << " not found!" << nl
<< "valid methods are:\nstandard\nsurface" << "valid methods are:\nstandard\nsurface"
<< exit(FatalError); << exit(FatalError);
} }

View file

@ -4,67 +4,67 @@ if (runTime.outputTime())
( (
IOobject IOobject
( (
"epsilonEq", "epsilonEq",
runTime.timeName(), runTime.timeName(),
mesh, mesh,
IOobject::NO_READ, IOobject::NO_READ,
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
sqrt((2.0/3.0)*magSqr(dev(epsilon))) sqrt((2.0/3.0)*magSqr(dev(epsilon)))
); );
Info<< "Max epsilonEq = " << max(epsilonEq).value() Info<< "Max epsilonEq = " << max(epsilonEq).value()
<< endl; << endl;
volScalarField sigmaEq volScalarField sigmaEq
( (
IOobject IOobject
( (
"sigmaEq", "sigmaEq",
runTime.timeName(), runTime.timeName(),
mesh, mesh,
IOobject::NO_READ, IOobject::NO_READ,
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
sqrt((3.0/2.0)*magSqr(dev(sigma))) sqrt((3.0/2.0)*magSqr(dev(sigma)))
); );
Info<< "Max sigmaEq = " << max(sigmaEq).value() Info<< "Max sigmaEq = " << max(sigmaEq).value()
<< endl; << endl;
pointMesh pMesh(mesh); pointMesh pMesh(mesh);
pointScalarField contactPointGap pointScalarField contactPointGap
( (
IOobject IOobject
( (
"contactPointGap", "contactPointGap",
runTime.timeName(), runTime.timeName(),
mesh, mesh,
IOobject::NO_READ, IOobject::NO_READ,
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
pMesh, pMesh,
dimensionedScalar("zero", dimless, 0.0) dimensionedScalar("zero", dimless, 0.0)
); );
forAll(mesh.boundary(), patchi) forAll(mesh.boundary(), patchi)
{ {
if(DU.boundaryField()[patchi].type() == solidContactFvPatchVectorField::typeName) if(DU.boundaryField()[patchi].type() == solidContactFvPatchVectorField::typeName)
{ {
const solidContactFvPatchVectorField& DUpatch = const solidContactFvPatchVectorField& DUpatch =
refCast<const solidContactFvPatchVectorField> refCast<const solidContactFvPatchVectorField>
(DU.boundaryField()[patchi]); (DU.boundaryField()[patchi]);
if(!DUpatch.master()) if(!DUpatch.master())
{ {
const labelList& meshPoints = mesh.boundaryMesh()[patchi].meshPoints(); const labelList& meshPoints = mesh.boundaryMesh()[patchi].meshPoints();
const scalarField gap = DUpatch.normalContactModelPtr()->slaveContactPointGap(); const scalarField gap = DUpatch.normalContactModelPtr()->slaveContactPointGap();
forAll(meshPoints, pointi) forAll(meshPoints, pointi)
{ {
contactPointGap[meshPoints[pointi]] = gap[pointi]; contactPointGap[meshPoints[pointi]] = gap[pointi];
} }
} }
} }
} }
@ -74,10 +74,10 @@ if (runTime.outputTime())
Info << "Patch " << mesh.boundary()[patchi].name() << endl; Info << "Patch " << mesh.boundary()[patchi].name() << endl;
vectorField totalForce = mesh.Sf().boundaryField()[patchi] & sigma.boundaryField()[patchi]; vectorField totalForce = mesh.Sf().boundaryField()[patchi] & sigma.boundaryField()[patchi];
vector force = sum( totalForce ); vector force = sum( totalForce );
Info << "\ttotal force is " << force << " N" << endl; Info << "\ttotal force is " << force << " N" << endl;
tensorField F = I + gradDU.boundaryField()[patchi]; tensorField F = I + gradDU.boundaryField()[patchi];
tensorField Finv = inv(F); tensorField Finv = inv(F);
//vectorField nCurrent = Finv & n.boundaryField()[patchi]; //vectorField nCurrent = Finv & n.boundaryField()[patchi];
//nCurrent /= mag(nCurrent); //nCurrent /= mag(nCurrent);
@ -90,25 +90,25 @@ if (runTime.outputTime())
// if(mesh.boundary()[patchi].type() != "empty") // if(mesh.boundary()[patchi].type() != "empty")
// { // {
// vector Sf0 = Sf.boundaryField()[patchi][0]; // vector Sf0 = Sf.boundaryField()[patchi][0];
// symmTensor sigma0 = sigma.boundaryField()[patchi][0]; // symmTensor sigma0 = sigma.boundaryField()[patchi][0];
// Info << "sigmab[0] is " << sigma0 << nl // Info << "sigmab[0] is " << sigma0 << nl
// << "Sfb is " << Sf0 << nl // << "Sfb is " << Sf0 << nl
// << "force is " << (Sf.boundaryField()[patchi][0]&sigma.boundaryField()[patchi][0]) << nl // << "force is " << (Sf.boundaryField()[patchi][0]&sigma.boundaryField()[patchi][0]) << nl
// << "Sfx*sigmaxx " << (Sf0[vector::X]*sigma0[symmTensor::XX]) << nl // << "Sfx*sigmaxx " << (Sf0[vector::X]*sigma0[symmTensor::XX]) << nl
// << "Sfy*sigmaxy " << (Sf0[vector::Y]*sigma0[symmTensor::XY]) << nl // << "Sfy*sigmaxy " << (Sf0[vector::Y]*sigma0[symmTensor::XY]) << nl
// << "Sfx*sigmayx " << (Sf0[vector::X]*sigma0[symmTensor::XY]) << nl // << "Sfx*sigmayx " << (Sf0[vector::X]*sigma0[symmTensor::XY]) << nl
// << "Sfy*sigmayy " << (Sf0[vector::Y]*sigma0[symmTensor::YY]) << nl // << "Sfy*sigmayy " << (Sf0[vector::Y]*sigma0[symmTensor::YY]) << nl
// << endl; // << endl;
//vector SfTL(-0.000137451, 0.00383599, -4.76878e-20); //vector SfTL(-0.000137451, 0.00383599, -4.76878e-20);
// vector SfTL = Finv[0] & vector(0,0.004,0); // vector SfTL = Finv[0] & vector(0,0.004,0);
// Info << "SfTLx*sigmaxx " << (SfTL[vector::X]*sigma0[symmTensor::XX]) << nl // Info << "SfTLx*sigmaxx " << (SfTL[vector::X]*sigma0[symmTensor::XX]) << nl
// << "SfTLy*sigmaxy " << (SfTL[vector::Y]*sigma0[symmTensor::XY]) << nl // << "SfTLy*sigmaxy " << (SfTL[vector::Y]*sigma0[symmTensor::XY]) << nl
// << "SfTLx*sigmayx " << (SfTL[vector::X]*sigma0[symmTensor::XY]) << nl // << "SfTLx*sigmayx " << (SfTL[vector::X]*sigma0[symmTensor::XY]) << nl
// << "SfTLy*sigmayy " << (SfTL[vector::Y]*sigma0[symmTensor::YY]) << nl // << "SfTLy*sigmayy " << (SfTL[vector::Y]*sigma0[symmTensor::YY]) << nl
// << endl; // << endl;
// } // }
}*/ }*/
runTime.write(); runTime.write();
} }

View file

@ -2,13 +2,13 @@
if(historyPatchID != -1) if(historyPatchID != -1)
{ {
Info << "Writing disp-force to file for patch " << historyPatchName Info << "Writing disp-force to file for patch " << historyPatchName
<< endl; << endl;
//- for small strain or moving mesh //- for small strain or moving mesh
//scalar force = gSum( //scalar force = gSum(
// direction & // direction &
// (mesh.boundary()[historyPatchID].Sf() & sigma.boundaryField()[historyPatchID]) // (mesh.boundary()[historyPatchID].Sf() & sigma.boundaryField()[historyPatchID])
// ); // );
//- for large strain total lagrangian //- for large strain total lagrangian
//tensorField F = I + gradU.boundaryField()[historyPatchID]; //tensorField F = I + gradU.boundaryField()[historyPatchID];
@ -21,7 +21,7 @@ if(historyPatchID != -1)
Info << "Writing strain-stress to file for patch " << historyPatchName Info << "Writing strain-stress to file for patch " << historyPatchName
<< endl; << endl;
// avaerage stress strain // avaerage stress strain
symmTensor stress = gAverage(sigma.boundaryField()[historyPatchID]); symmTensor stress = gAverage(sigma.boundaryField()[historyPatchID]);
@ -31,19 +31,19 @@ if(historyPatchID != -1)
// write to file // write to file
if(Pstream::master()) if(Pstream::master())
{ {
OFstream& forceDispFile = *forceFilePtr; OFstream& forceDispFile = *forceFilePtr;
label width = 20; label width = 20;
forceDispFile << disp.x() << " " << disp.y() << " " << disp.z(); forceDispFile << disp.x() << " " << disp.y() << " " << disp.z();
forceDispFile.width(width); forceDispFile.width(width);
forceDispFile << force.x() << " " << force.y() << " " << force.z() forceDispFile << force.x() << " " << force.y() << " " << force.z()
<< endl; << endl;
OFstream& stressStrainFile = *stressFilePtr; OFstream& stressStrainFile = *stressFilePtr;
stressStrainFile << strain.xx() << " " << strain.xy() << " " << strain.xz() << " " stressStrainFile << strain.xx() << " " << strain.xy() << " " << strain.xz() << " "
<< strain.yy() << " " << strain.yz() << " " << strain.zz(); << strain.yy() << " " << strain.yz() << " " << strain.zz();
stressStrainFile.width(width); stressStrainFile.width(width);
stressStrainFile << stress.xx() << " " << stress.xy() << " " << stress.xz() << " " stressStrainFile << stress.xx() << " " << stress.xy() << " " << stress.xz() << " "
<< stress.yy() << " " << stress.yz() << " " << stress.zz() << stress.yy() << " " << stress.yz() << " " << stress.zz()
<< endl; << endl;
} }
} }

View file

@ -21,9 +21,9 @@ if(iCorr == 0)
scalar sumMagB = gSum(magSqr(b)); scalar sumMagB = gSum(magSqr(b));
if(sumMagB < SMALL) if(sumMagB < SMALL)
{ {
//Warning << "Aitken under-relaxation: denominator less then SMALL" //Warning << "Aitken under-relaxation: denominator less then SMALL"
// << endl; // << endl;
sumMagB += SMALL; sumMagB += SMALL;
} }
aitkenTheta = -aitkenTheta* aitkenTheta = -aitkenTheta*

View file

@ -21,10 +21,10 @@ if(divDSigmaExpMethod == "standard")
); );
// divDSigmaExp = fvc::div // divDSigmaExp = fvc::div
// ( // (
// muf*(mesh.Sf() & fvc::interpolate(gradDU.T())) // muf*(mesh.Sf() & fvc::interpolate(gradDU.T()))
// + lambdaf*(mesh.Sf() & I*fvc::interpolate(tr(gradDU))) // + lambdaf*(mesh.Sf() & I*fvc::interpolate(tr(gradDU)))
// - (muf + lambdaf)*(mesh.Sf() & fvc::interpolate(gradDU)) // - (muf + lambdaf)*(mesh.Sf() & fvc::interpolate(gradDU))
// ); // );
} }
else if(divDSigmaExpMethod == "decompose") else if(divDSigmaExpMethod == "decompose")
{ {
@ -33,13 +33,13 @@ if(divDSigmaExpMethod == "standard")
divDSigmaExp = fvc::div divDSigmaExp = fvc::div
( (
mesh.magSf() mesh.magSf()
*( *(
- (muf + lambdaf)*(fvc::snGrad(DU)&(I - n*n)) - (muf + lambdaf)*(fvc::snGrad(DU)&(I - n*n))
+ lambdaf*tr(shearGradDU&(I - n*n))*n + lambdaf*tr(shearGradDU&(I - n*n))*n
+ muf*(shearGradDU&n) + muf*(shearGradDU&n)
) )
); );
} }
else if(divDSigmaExpMethod == "laplacian") else if(divDSigmaExpMethod == "laplacian")
{ {
@ -47,10 +47,10 @@ if(divDSigmaExpMethod == "standard")
- fvc::laplacian(mu + lambda, DU, "laplacian(DDU,DU)") - fvc::laplacian(mu + lambda, DU, "laplacian(DDU,DU)")
+ fvc::div + fvc::div
( (
mu*gradDU.T() mu*gradDU.T()
+ lambda*(I*tr(gradDU)), + lambda*(I*tr(gradDU)),
"div(sigma)" "div(sigma)"
); );
} }
else else
{ {

View file

@ -33,12 +33,12 @@
( (
IOobject IOobject
( (
"DEpsilon", "DEpsilon",
runTime.timeName(), runTime.timeName(),
mesh, mesh,
IOobject::READ_IF_PRESENT, IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
mesh, mesh,
dimensionedSymmTensor("zero", dimless, symmTensor::zero) dimensionedSymmTensor("zero", dimless, symmTensor::zero)
); );
@ -104,12 +104,12 @@
( (
IOobject IOobject
( (
"divDSigmaExp", "divDSigmaExp",
runTime.timeName(), runTime.timeName(),
mesh, mesh,
IOobject::NO_READ, IOobject::NO_READ,
IOobject::NO_WRITE IOobject::NO_WRITE
), ),
mesh, mesh,
dimensionedVector("zero", dimensionSet(1,-2,-2,0,0,0,0), vector::zero) dimensionedVector("zero", dimensionSet(1,-2,-2,0,0,0,0), vector::zero)
); );
@ -139,7 +139,7 @@
IOobject::NO_WRITE IOobject::NO_WRITE
), ),
mesh, mesh,
dimensionedVector("zero", dimLength, vector::zero) dimensionedVector("zero", dimLength, vector::zero)
); );
scalar aitkenInitialRes = 1.0; scalar aitkenInitialRes = 1.0;
scalar aitkenTheta = 0.1; scalar aitkenTheta = 0.1;

View file

@ -5,8 +5,8 @@ label historyPatchID = mesh.boundaryMesh().findPatchID(historyPatchName);
if(historyPatchID == -1) if(historyPatchID == -1)
{ {
Warning << "history patch " << historyPatchName Warning << "history patch " << historyPatchName
<< " not found. Force-displacement will not be written" << " not found. Force-displacement will not be written"
<< endl; << endl;
} }
else if(Pstream::master()) else if(Pstream::master())
{ {
@ -16,8 +16,8 @@ if(historyPatchID == -1)
{ {
fileName forceFileName(historyDir/"forceDisp_"+historyPatchName+".dat"); fileName forceFileName(historyDir/"forceDisp_"+historyPatchName+".dat");
Info << "\nForce-displacement for patch " << historyPatchName Info << "\nForce-displacement for patch " << historyPatchName
<< " will be written to " << forceFileName << " will be written to " << forceFileName
<< endl; << endl;
forceFilePtr = new OFstream(forceFileName); forceFilePtr = new OFstream(forceFileName);
OFstream& forceDispFile = *forceFilePtr; OFstream& forceDispFile = *forceFilePtr;
forceDispFile << "#Disp(mm)\tForce(N)" << endl; forceDispFile << "#Disp(mm)\tForce(N)" << endl;
@ -26,9 +26,9 @@ if(historyPatchID == -1)
{ {
fileName stressFileName(historyDir/"stressStrain_"+historyPatchName+".dat"); fileName stressFileName(historyDir/"stressStrain_"+historyPatchName+".dat");
Info << "\nStress(Engineering Small Stress)-strain(Engineering Small Strain) for patch " Info << "\nStress(Engineering Small Stress)-strain(Engineering Small Strain) for patch "
<< historyPatchName << historyPatchName
<< " will be written to " << stressFileName << " will be written to " << stressFileName
<< endl; << endl;
stressFilePtr = new OFstream(stressFileName); stressFilePtr = new OFstream(stressFileName);
OFstream& stressStrainFile = *stressFilePtr; OFstream& stressStrainFile = *stressFilePtr;
stressStrainFile << "#Strain(-)\tStress(Pa)" << endl; stressStrainFile << "#Strain(-)\tStress(Pa)" << endl;

View file

@ -10,15 +10,15 @@ solidInterface* solidInterfacePtr(NULL);
if(solidInterfaceCorr) if(solidInterfaceCorr)
{ {
Info << "Creating solid interface correction" << endl; Info << "Creating solid interface correction" << endl;
solidInterfacePtr = new solidInterface(mesh, rheology); solidInterfacePtr = new solidInterface(mesh, rheology);
solidInterfacePtr->modifyProperties(muf, lambdaf); solidInterfacePtr->modifyProperties(muf, lambdaf);
//- solidInterface needs muf and lambdaf to be used for divDSigmaExp //- solidInterface needs muf and lambdaf to be used for divDSigmaExp
if(divDSigmaExpMethod != "surface" && divDSigmaExpMethod != "decompose") if(divDSigmaExpMethod != "surface" && divDSigmaExpMethod != "decompose")
{ {
FatalError << "divDSigmaExp must be decompose or surface when solidInterface is on" FatalError << "divDSigmaExp must be decompose or surface when solidInterface is on"
<< exit(FatalError); << exit(FatalError);
} }
} }
} }

Some files were not shown because too many files have changed in this diff Show more