Solid models update: clean-up

This commit is contained in:
Hrvoje Jasak 2014-02-23 10:54:20 +00:00
parent 3810b29f37
commit bb03a935fa
11 changed files with 224 additions and 211 deletions

View file

@ -16,7 +16,6 @@
(
DU.internalField()
- DU.prevIter().internalField()
)
/magDU
)/magDU
);
}

View file

@ -79,7 +79,7 @@ int main(int argc, char *argv[])
# include "calculateDivDSigmaExp.H"
//- linear momentum equation
// Linear momentum equation
fvVectorMatrix DUEqn
(
fvm::d2dt2(rho, DU)
@ -127,7 +127,8 @@ int main(int argc, char *argv[])
&& ++iCorr < nCorr
);
Info<< nl << "Time " << runTime.value() << ", Solving for " << DU.name()
Info<< nl << "Time " << runTime.value()
<< ", Solving for " << DU.name()
<< ", Initial residual = " << initialResidual
<< ", Final residual = " << solverPerf.initialResidual()
<< ", Relative residual = " << relativeResidual

View file

@ -1,9 +1,22 @@
//- how explicit component of sigma is to be calculated
word divDSigmaExpMethod(mesh.solutionDict().subDict("solidMechanics").lookup("divSigmaExp"));
Info << "Selecting divSigmaExp calculation method " << divDSigmaExpMethod << endl;
if(divDSigmaExpMethod != "standard" && divDSigmaExpMethod != "surface" && divDSigmaExpMethod != "decompose" && divDSigmaExpMethod != "laplacian")
const dictionary& stressControl =
mesh.solutionDict().subDict("solidMechanics");
// Read how explicit component of sigma is to be calculated
word divDSigmaExpMethod(stressControl.lookup("divSigmaExp"));
Info<< "Selecting divSigmaExp calculation method: "
<< divDSigmaExpMethod << endl;
if
(
divDSigmaExpMethod != "standard"
&& divDSigmaExpMethod != "surface"
&& divDSigmaExpMethod != "decompose"
&& divDSigmaExpMethod != "laplacian"
)
{
FatalError << "divSigmaExp method " << divDSigmaExpMethod << " not found!" << nl
FatalErrorIn(args.executable())
<< "divSigmaExp method " << divDSigmaExpMethod << " not found! "
<< "valid methods are:\nstandard\nsurface\ndecompose\nlaplacian"
<< exit(FatalError);
}

View file

@ -13,8 +13,7 @@ if (runTime.outputTime())
sqrt((2.0/3.0)*magSqr(dev(epsilon)))
);
Info<< "Max epsilonEq = " << max(epsilonEq).value()
<< endl;
Info<< "Max epsilonEq = " << max(epsilonEq).value() << endl;
volScalarField sigmaEq
(
@ -29,8 +28,7 @@ if (runTime.outputTime())
sqrt((3.0/2.0)*magSqr(dev(sigma)))
);
Info<< "Max sigmaEq = " << max(sigmaEq).value()
<< endl;
Info<< "Max sigmaEq = " << max(sigmaEq).value() << endl;
runTime.write();
}

View file

@ -29,7 +29,7 @@
dimensionedSymmTensor("zero", dimless, symmTensor::zero)
);
//- second Piola-Kirchhoff stress tensor
//- Second Piola-Kirchhoff stress tensor
volSymmTensorField sigma
(
IOobject

View file

@ -70,32 +70,36 @@ int main(int argc, char *argv[])
{
U.storePrevIter();
surfaceTensorField shearGradU =
((I - n*n)&fvc::interpolate(gradU));
surfaceTensorField shearGradU
(
"shearGradU",
(I - sqr(n)) & fvc::interpolate(gradU)
);
fvVectorMatrix UEqn
(
fvm::d2dt2(rho, U)
==
fvm::laplacian(2*muf + lambdaf, U, "laplacian(DU,U)")
// + fvc::div(
// -( (mu + lambda) * gradU )
// + ( mu * gradU.T() )
// + ( mu * (gradU & gradU.T()) )
// + ( lambda * tr(gradU) * I )
// + ( 0.5 * lambda * tr(gradU & gradU.T()) * I )
// + fvc::div
// (
// -(mu + lambda)*gradU
// + mu*gradU.T()
// + mu*(gradU & gradU.T())
// + lambda*tr(gradU)*I
// + 0.5*lambda*tr(gradU & gradU.T())*I
// + (sigma & gradU),
// "div(sigma)"
// )
+ fvc::div(
mesh.magSf()
*(
+ fvc::div
(
mesh.magSf()*
(
- (muf + lambdaf)*(fvc::snGrad(U) & (I - n*n))
+ lambdaf*tr(shearGradU & (I - n*n))*n
+ muf*(shearGradU & n)
+ muf*(n & fvc::interpolate(gradU & gradU.T()))
+ 0.5*lambdaf
*(n * tr(fvc::interpolate(gradU & gradU.T())))
+ 0.5*lambdaf*(n*tr(fvc::interpolate(gradU & gradU.T())))
+ (n & fvc::interpolate(sigma & gradU))
)
)

View file

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

View file

@ -12,8 +12,9 @@ if(iCorr == 0)
}
else
{
vectorField b = aitkenDelta.internalField() - aitkenDelta.prevIter().internalField();
// scalar sumMagB = gSum(mag(b));
vectorField b = aitkenDelta.internalField()
- aitkenDelta.prevIter().internalField();
scalar sumMagB = gSum(magSqr(b));
if(sumMagB < SMALL)
{
@ -23,8 +24,7 @@ if(iCorr == 0)
}
aitkenTheta = -aitkenTheta*
gSum(aitkenDelta.prevIter().internalField() & b)
/
gSum(aitkenDelta.prevIter().internalField() & b)/
sumMagB;
}

View file

@ -12,7 +12,6 @@
mesh
);
// volTensorField gradU = fvc::grad(U);
volTensorField gradU
(
IOobject
@ -26,7 +25,7 @@
mesh,
dimensionedTensor("zero", dimless, tensor::zero)
);
//surfaceVectorField snGradU = fvc::snGrad(U);
surfaceVectorField snGradU
(
IOobject
@ -139,6 +138,8 @@
mesh,
dimensionedVector("zero", dimLength, vector::zero)
);
// aitken relaxation factor
scalar aitkenInitialRes = 1.0;
scalar aitkenTheta = 0.1;

View file

@ -102,11 +102,6 @@ int main(int argc, char *argv[])
solidInterfacePtr->correct(UEqn);
}
// if (relaxEqn)
// {
// UEqn.relax();
// }
solverPerf = UEqn.solve();
if (iCorr == 0)
@ -136,6 +131,7 @@ int main(int argc, char *argv[])
<< " using " << solverPerf.solverName()
<< ", res = " << solverPerf.initialResidual()
<< ", rel res = " << relativeResidual;
if (aitkenRelax)
{
Info<< ", aitken = " << aitkenTheta;
@ -146,11 +142,11 @@ int main(int argc, char *argv[])
while
(
iCorr++ == 0
||
(solverPerf.initialResidual() > convergenceTolerance
|| (
solverPerf.initialResidual() > convergenceTolerance
//relativeResidual > convergenceTolerance
&&
iCorr < nCorr)
&& iCorr < nCorr
)
);
Info<< nl << "Time " << runTime.value() << ", Solving for " << U.name()