1 if (runTime.outputTime())
3 volScalarField epsilonEq
13 sqrt((2.0/3.0)*magSqr(dev(epsilon)))
16 Info<< "Max epsilonEq = " << max(epsilonEq).value()
19 volScalarField sigmaEq
29 sqrt((3.0/2.0)*magSqr(dev(sigma)))
32 Info<< "Max sigmaEq = " << max(sigmaEq).value()
35 //- Calculate Cauchy stress
36 volTensorField F = I + gradU;
37 volScalarField J = det(F);
42 volSymmTensorField sigmaCauchy
52 (1/J) * symm(F.T() & sigma & F)
55 //- Cauchy von Mises stress
56 volScalarField sigmaCauchyEq
66 sqrt((3.0/2.0)*magSqr(dev(sigmaCauchy)))
69 Info<< "Max sigmaCauchyEq = " << max(sigmaCauchyEq).value()
73 volTensorField Finv = inv(F);
74 volSymmTensorField epsilonAlmansi
84 symm(Finv & epsilon & Finv.T())
87 // volVectorField traction
92 // runTime.timeName(),
95 // IOobject::AUTO_WRITE
98 // dimensionedVector("zero", dimForce/dimArea, vector::zero),
99 // calculatedFvPatchVectorField::typeName
101 // forAll(traction.boundaryField(), patchi)
103 // const tensorField& Fbinv = Finv.boundaryField()[patchi];
104 // vectorField nCurrent = Fbinv & n.boundaryField()[patchi];
105 // traction.boundaryField()[patchi] =
106 // nCurrent & sigmaCauchy.boundaryField()[patchi];
109 // //- write boundary forces
110 // //- integrate (sigma2PK & F) over reference area
111 // //- which is equivalent to integrating sigmaCauchy
112 // //- over the deformed area
114 // forAll(mesh.boundary(), patchi)
116 // Info << "Patch " << mesh.boundary()[patchi].name() << endl;
117 // const tensorField& Fb = F.boundaryField()[patchi];
118 // vectorField totalForce = mesh.Sf().boundaryField()[patchi] & (sigma.boundaryField()[patchi] & Fb);
119 // //vectorField totalForce2 = Sf.boundaryField()[patchi] & (sigmaCauchy.boundaryField()[patchi]);
121 // vector force = sum( totalForce );
122 // //vector force2 = sum( totalForce2 );
123 // Info << "\ttotal force is " << force << " N" << endl;
124 // //Info << "\ttotal force2 is " << force2 << " N" << endl;
126 // const tensorField& Fbinv = Finv.boundaryField()[patchi];
127 // vectorField nCurrent = Fbinv & n.boundaryField()[patchi];
128 // nCurrent /= mag(nCurrent);
129 // scalar normalForce = sum( nCurrent & totalForce );
130 // Info << "\tnormal force is " << normalForce << " N" << endl;
131 // scalar shearForce = mag(sum( (I - sqr(nCurrent)) & totalForce ));
132 // Info << "\tshear force is " << shearForce << " N" << endl;
134 //if(mesh.boundary()[patchi].name() == "right")
136 //const vectorField& nOrig = n.boundaryField()[patchi];
137 //Info << "\tNormal force on right is " << (nCurrent & totalForce) << nl << endl;
138 //Info << "\tShear force on right is " << ((I - sqr(nCurrent)) & totalForce) << nl << endl;
139 //Info << "\tpatch gradient is " << U.boundaryField()[patchi].snGrad() << endl;
140 //Info << "\tpatch gradient (norm) is " << (nCurrent & U.boundaryField()[patchi].snGrad()) << endl;
141 //Info << "\tpatch gradient (shear) is " << ((I - sqr(nCurrent)) & U.boundaryField()[patchi].snGrad()) << endl;
142 //Info << "\tpatch Almansi (normal) is " << (nCurrent & (nCurrent & epsilonAlmansi.boundaryField()[patchi])) << endl;
143 //Info << "\tpatch Almansi (shear) is " << ( (I - sqr(nCurrent)) & (nCurrent & epsilonAlmansi.boundaryField()[patchi])) << endl;
144 //Info << "\tpatch Green (normal) is " << (nOrig & (nOrig & epsilon.boundaryField()[patchi])) << endl;
145 //Info << "\tpatch Green (shear) is " << ( (I - sqr(nOrig)) & (nOrig & epsilon.boundaryField()[patchi])) << endl;
146 //Info << "\tpatch Cauchy stress (normal) is " << (nCurrent & (nCurrent & sigmaCauchy.boundaryField()[patchi])) << endl;
149 // if(mesh.boundary()[patchi].type() != "empty")
151 // vector Sf0 = Sf.boundaryField()[patchi][0];
152 // symmTensor sigma0 = sigmaCauchy.boundaryField()[patchi][0];
153 // Info << "sigmab[0] is " << sigma0 << nl
154 // << "Sfb is " << Sf0 << nl
155 // << "force is " << (Sf.boundaryField()[patchi][0]&sigma.boundaryField()[patchi][0]) << nl
156 // << "Sfx*sigmaxx " << (Sf0[vector::X]*sigma0[symmTensor::XX]) <<nl
157 // << "Sfy*sigmaxy " << (Sf0[vector::Y]*sigma0[symmTensor::XY]) << nl
158 // << "Sfx*sigmayx " << (Sf0[vector::X]*sigma0[symmTensor::XY]) << nl
159 // << "Sfy*sigmayy " << (Sf0[vector::Y]*sigma0[symmTensor::YY]) << nl