diff --git a/applications/solvers/solidMechanics/elasticSolidFoam/calculateDivSigmaExp.H b/applications/solvers/solidMechanics/elasticSolidFoam/calculateDivSigmaExp.H index 80484efd4..6a1f33e1b 100644 --- a/applications/solvers/solidMechanics/elasticSolidFoam/calculateDivSigmaExp.H +++ b/applications/solvers/solidMechanics/elasticSolidFoam/calculateDivSigmaExp.H @@ -1,4 +1,4 @@ -if(divSigmaExpMethod == "standard") +if (divSigmaExpMethod == "standard") { divSigmaExp = fvc::div ( diff --git a/applications/solvers/solidMechanics/elasticSolidFoam/elasticSolidFoam.C b/applications/solvers/solidMechanics/elasticSolidFoam/elasticSolidFoam.C index f6f7200b9..57a29688d 100644 --- a/applications/solvers/solidMechanics/elasticSolidFoam/elasticSolidFoam.C +++ b/applications/solvers/solidMechanics/elasticSolidFoam/elasticSolidFoam.C @@ -52,6 +52,7 @@ int main(int argc, char *argv[]) # include "setRootCase.H" # include "createTime.H" # include "createMesh.H" +# include "readGravitationalAcceleration.H" # include "createFields.H" # include "createHistory.H" # include "readDivSigmaExpMethod.H" @@ -61,7 +62,7 @@ int main(int argc, char *argv[]) Info<< "\nStarting time loop\n" << endl; - while(runTime.loop()) + while(runTime.loop()) { Info<< "Time = " << runTime.timeName() << nl << endl; @@ -71,7 +72,7 @@ int main(int argc, char *argv[]) lduMatrix::solverPerformance solverPerf; scalar initialResidual = 1.0; scalar relativeResidual = 1.0; - lduMatrix::debug = 0; +// lduMatrix::debug = 0; if (predictor) { @@ -95,6 +96,7 @@ int main(int argc, char *argv[]) == fvm::laplacian(2*muf + lambdaf, U, "laplacian(DU,U)") + divSigmaExp + + rho*g ); if (solidInterfaceCorr) diff --git a/applications/solvers/solidMechanics/elasticSolidFoam/writeFields.H b/applications/solvers/solidMechanics/elasticSolidFoam/writeFields.H index 01a86a134..890023447 100644 --- a/applications/solvers/solidMechanics/elasticSolidFoam/writeFields.H +++ b/applications/solvers/solidMechanics/elasticSolidFoam/writeFields.H @@ -1,110 +1,36 @@ if (runTime.outputTime()) - { +{ volScalarField epsilonEq - ( - IOobject - ( - "epsilonEq", - runTime.timeName(), - mesh, - IOobject::NO_READ, - IOobject::AUTO_WRITE - ), - sqrt((2.0/3.0)*magSqr(dev(epsilon))) - ); + ( + IOobject + ( + "epsilonEq", + runTime.timeName(), + mesh, + IOobject::NO_READ, + IOobject::AUTO_WRITE + ), + sqrt((2.0/3.0)*magSqr(dev(epsilon))) + ); Info<< "Max epsilonEq = " << max(epsilonEq).value() - << endl; + << endl; volScalarField sigmaEq - ( - IOobject - ( - "sigmaEq", - runTime.timeName(), - mesh, - IOobject::NO_READ, - IOobject::AUTO_WRITE - ), - sqrt((3.0/2.0)*magSqr(dev(sigma))) - ); + ( + IOobject + ( + "sigmaEq", + runTime.timeName(), + mesh, + IOobject::NO_READ, + IOobject::AUTO_WRITE + ), + sqrt((3.0/2.0)*magSqr(dev(sigma))) + ); Info<< "Max sigmaEq = " << max(sigmaEq).value() - << endl; - - //- boundary traction - // volVectorField traction - // ( - // IOobject - // ( - // "traction", - // runTime.timeName(), - // mesh, - // IOobject::NO_READ, - // IOobject::AUTO_WRITE - // ), - // mesh, - // dimensionedVector("zero", dimForce/dimArea, vector::zero) - // ); - // forAll(traction.boundaryField(), patchi) - // { - // traction.boundaryField()[patchi] = - // n.boundaryField()[patchi] & sigma.boundaryField()[patchi]; - // } - - // contact fields - // if(contactBoundaries) - // { - // volScalarField stickSlipFaces - // ( - // IOobject - // ( - // "stickSlipFaces", - // runTime.timeName(), - // mesh, - // IOobject::NO_READ, - // IOobject::AUTO_WRITE - // ), - // mesh, - // dimensionedScalar("zero", dimless, 0.0) - // ); - // forAll(stickSlipFaces.boundaryField(), patchi) - // { - // if(U.boundaryField()[patchi].type() - // == - // solidContactFvPatchVectorField::typeName) - // { - // const solidContactFvPatchVectorField& Upatch = - // refCast - // (U.boundaryField()[patchi]); - - // if(!Upatch.master()) - // { - // stickSlipFaces.boundaryField()[patchi] = - // Upatch.frictionContactModelPtr()->stickSlipFaces(); - // } - // } - // } - // stickSlipFaces.write(); - // } - - - //- boundary forces -// Info << nl; -// forAll(mesh.boundary(), patchi) -// { -// Info << "Patch " << mesh.boundary()[patchi].name() << endl; -// vectorField totalForce = mesh.Sf().boundaryField()[patchi] & sigma.boundaryField()[patchi]; - -// vector force = sum( totalForce ); -// Info << "\ttotal force is " << force << " N" << endl; - -// const vectorField& nb = n.boundaryField()[patchi]; -// scalar normalForce = sum( nb & totalForce ); -// Info << "\tnormal force is " << normalForce << " N" << endl; -// scalar shearForce = mag(sum( (I - sqr(nb)) & totalForce )); -// Info << "\tshear force is " << shearForce << " N" << endl; -// } + << endl; runTime.write(); - } +}