Convert tabs to fours spaces systematically
This commit is contained in:
parent
3241862b6c
commit
8141282b1d
321 changed files with 8612 additions and 8598 deletions
|
@ -5,33 +5,33 @@ if(divDSigmaExpMethod == "standard")
|
||||||
mu*gradDU.T() + lambda*(I*tr(gradDU)) - (mu + lambda)*gradDU,
|
mu*gradDU.T() + lambda*(I*tr(gradDU)) - (mu + lambda)*gradDU,
|
||||||
"div(sigma)"
|
"div(sigma)"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else if(divDSigmaExpMethod == "surface")
|
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")
|
||||||
{
|
{
|
||||||
surfaceTensorField shearGradDU =
|
surfaceTensorField shearGradDU = ((I - n*n)&fvc::interpolate(gradDU));
|
||||||
((I - n*n)&fvc::interpolate(gradDU));
|
|
||||||
|
|
||||||
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")
|
||||||
{
|
{
|
||||||
divDSigmaExp =
|
divDSigmaExp =
|
||||||
- fvc::laplacian(mu + lambda, DU, "laplacian(DDU,DU)")
|
- fvc::laplacian(mu + lambda, DU, "laplacian(DDU,DU)")
|
||||||
+ fvc::div
|
+ fvc::div
|
||||||
|
@ -40,8 +40,8 @@ if(divDSigmaExpMethod == "standard")
|
||||||
+ lambda*(I*tr(gradDU)),
|
+ lambda*(I*tr(gradDU)),
|
||||||
"div(sigma)"
|
"div(sigma)"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
FatalError << "divDSigmaExp method " << divDSigmaExpMethod << " not found!" << endl;
|
FatalError << "divDSigmaExp method " << divDSigmaExpMethod << " not found!" << endl;
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,7 +23,7 @@ philipc
|
||||||
|
|
||||||
//- this is only needed in a parallel runs
|
//- this is only needed in a parallel runs
|
||||||
if(Pstream::parRun())
|
if(Pstream::parRun())
|
||||||
{
|
{
|
||||||
//***** FIX INCORRECT POINT ON PATCHES WITH FACEZONE *****//
|
//***** FIX INCORRECT POINT ON PATCHES WITH FACEZONE *****//
|
||||||
contactPatchPairList& contacts = contact;
|
contactPatchPairList& contacts = contact;
|
||||||
|
|
||||||
|
@ -33,9 +33,13 @@ if(Pstream::parRun())
|
||||||
label slaveID = contacts[contactI].slavePatch().index();
|
label slaveID = contacts[contactI].slavePatch().index();
|
||||||
|
|
||||||
primitivePatchInterpolation masterInterpolator
|
primitivePatchInterpolation masterInterpolator
|
||||||
(mesh.boundaryMesh()[masterID]);
|
(
|
||||||
|
mesh.boundaryMesh()[masterID]
|
||||||
|
);
|
||||||
primitivePatchInterpolation slaveInterpolator
|
primitivePatchInterpolation slaveInterpolator
|
||||||
(mesh.boundaryMesh()[slaveID]);
|
(
|
||||||
|
mesh.boundaryMesh()[slaveID]
|
||||||
|
);
|
||||||
|
|
||||||
//- U must be interpolated to the vertices, this ignores the faceZone
|
//- U must be interpolated to the vertices, this ignores the faceZone
|
||||||
//- points with no U (unlike volPointInterpolation)
|
//- points with no U (unlike volPointInterpolation)
|
||||||
|
@ -65,23 +69,17 @@ if(Pstream::parRun())
|
||||||
{
|
{
|
||||||
label pointGlobalLabel = masterPointLabels[pointI];
|
label pointGlobalLabel = masterPointLabels[pointI];
|
||||||
newPoints[pointGlobalLabel] =
|
newPoints[pointGlobalLabel] =
|
||||||
oldMasterPoints[pointI]
|
oldMasterPoints[pointI] + correctMasterPointU[pointI];
|
||||||
+
|
|
||||||
correctMasterPointU[pointI];
|
|
||||||
}
|
}
|
||||||
forAll(slavePointLabels, pointI)
|
forAll(slavePointLabels, pointI)
|
||||||
{
|
{
|
||||||
label pointGlobalLabel = slavePointLabels[pointI];
|
label pointGlobalLabel = slavePointLabels[pointI];
|
||||||
newPoints[pointGlobalLabel] =
|
newPoints[pointGlobalLabel] =
|
||||||
oldSlavePoints[pointI]
|
oldSlavePoints[pointI] + correctSlavePointU[pointI];
|
||||||
+
|
|
||||||
correctSlavePointU[pointI];
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//***** NOW FIX AND SYNCHRONISE ALL THE FACEZONE POINTS *****//
|
//***** NOW FIX AND SYNCHRONISE ALL THE FACEZONE POINTS *****//
|
||||||
|
|
||||||
forAll(mesh.faceZones(), faceZoneI)
|
forAll(mesh.faceZones(), faceZoneI)
|
||||||
|
@ -117,8 +115,7 @@ if(Pstream::parRun())
|
||||||
{
|
{
|
||||||
label procPoint =
|
label procPoint =
|
||||||
mesh.faceZones()[faceZoneI]().meshPoints()[localPoint];
|
mesh.faceZones()[faceZoneI]().meshPoints()[localPoint];
|
||||||
globalFZnewPoints[globalPointI] =
|
globalFZnewPoints[globalPointI] = newPoints[procPoint];
|
||||||
newPoints[procPoint];
|
|
||||||
pointNumProcs[globalPointI] = 1;
|
pointNumProcs[globalPointI] = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -141,20 +138,16 @@ if(Pstream::parRun())
|
||||||
forAll(globalFZnewPoints, globalPointI)
|
forAll(globalFZnewPoints, globalPointI)
|
||||||
{
|
{
|
||||||
label localPoint = procToGlobalFZmap[faceZoneI][globalPointI];
|
label localPoint = procToGlobalFZmap[faceZoneI][globalPointI];
|
||||||
|
procFZnewPoints[localPoint] = globalFZnewPoints[globalPointI];
|
||||||
procFZnewPoints[localPoint] =
|
|
||||||
globalFZnewPoints[globalPointI];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//- now fix the newPoints points on the globalFaceZones
|
//- now fix the newPoints points on the globalFaceZones
|
||||||
labelList procFZmeshPoints =
|
labelList procFZmeshPoints = mesh.faceZones()[faceZoneI]().meshPoints();
|
||||||
mesh.faceZones()[faceZoneI]().meshPoints();
|
|
||||||
|
|
||||||
forAll(procFZmeshPoints, pointI)
|
forAll(procFZmeshPoints, pointI)
|
||||||
{
|
{
|
||||||
label procPoint = procFZmeshPoints[pointI];
|
label procPoint = procFZmeshPoints[pointI];
|
||||||
newPoints[procPoint] =
|
newPoints[procPoint] = procFZnewPoints[pointI];
|
||||||
procFZnewPoints[pointI];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -28,7 +28,7 @@ IOList<labelList> procToGlobalFZmap
|
||||||
IOobject::AUTO_WRITE
|
IOobject::AUTO_WRITE
|
||||||
),
|
),
|
||||||
mesh.faceZones().size()
|
mesh.faceZones().size()
|
||||||
);
|
);
|
||||||
|
|
||||||
IOList<labelList> pointOnLocalProcPatch
|
IOList<labelList> pointOnLocalProcPatch
|
||||||
(
|
(
|
||||||
|
@ -46,20 +46,20 @@ IOList<labelList> pointOnLocalProcPatch
|
||||||
//- if they have been read then don't recalculate it
|
//- if they have been read then don't recalculate it
|
||||||
bool globalFaceZoneMappingSet = false;
|
bool globalFaceZoneMappingSet = false;
|
||||||
if(gMax(procToGlobalFZmap[0]) > 0 && gMax(pointOnLocalProcPatch[0]) > 0)
|
if(gMax(procToGlobalFZmap[0]) > 0 && gMax(pointOnLocalProcPatch[0]) > 0)
|
||||||
{
|
{
|
||||||
Info << "Reading procToGlobalFZmap and pointOnLocalProcPatch allowing restart of contact cases"
|
Info << "Reading procToGlobalFZmap and pointOnLocalProcPatch allowing restart of contact cases"
|
||||||
<< endl;
|
<< endl;
|
||||||
globalFaceZoneMappingSet = true;
|
globalFaceZoneMappingSet = true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Info << "procToGlobalFZmap and pointOnLocalProcPatch will be calculated as it has not been found" << nl
|
Info << "procToGlobalFZmap and pointOnLocalProcPatch will be calculated as it has not been found" << nl
|
||||||
<< "this message should only appear starting a new analysis" << endl;
|
<< "this message should only appear starting a new analysis" << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
//- this is only needed in a parallel runs
|
//- this is only needed in a parallel runs
|
||||||
if(Pstream::parRun())
|
if(Pstream::parRun())
|
||||||
{
|
{
|
||||||
if(!globalFaceZoneMappingSet)
|
if(!globalFaceZoneMappingSet)
|
||||||
{
|
{
|
||||||
forAll(mesh.faceZones(), faceZoneI)
|
forAll(mesh.faceZones(), faceZoneI)
|
||||||
|
@ -70,7 +70,9 @@ if(Pstream::parRun())
|
||||||
|
|
||||||
//- set all slave points to zero because only the master order is used
|
//- set all slave points to zero because only the master order is used
|
||||||
if(!Pstream::master())
|
if(!Pstream::master())
|
||||||
|
{
|
||||||
globalFZpoints *= 0.0;
|
globalFZpoints *= 0.0;
|
||||||
|
}
|
||||||
|
|
||||||
//- pass points to all procs
|
//- pass points to all procs
|
||||||
reduce(globalFZpoints, sumOp<vectorField>());
|
reduce(globalFZpoints, sumOp<vectorField>());
|
||||||
|
@ -93,6 +95,7 @@ if(Pstream::parRun())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//- procToGlobalFZmap now contains the local FZpoint label for each
|
//- procToGlobalFZmap now contains the local FZpoint label for each
|
||||||
//- global FZ point label - for each faceZone
|
//- global FZ point label - for each faceZone
|
||||||
|
|
||||||
|
@ -123,13 +126,13 @@ if(Pstream::parRun())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} //- end if(!globalFaceZoneMappingSet)
|
} //- end if(!globalFaceZoneMappingSet)
|
||||||
}
|
}
|
||||||
|
|
||||||
//- write to disk to allow restart of cases
|
//- write to disk to allow restart of cases
|
||||||
//- because it is not possible to calculate the
|
//- because it is not possible to calculate the
|
||||||
//- mapping after the meshes have moved
|
//- mapping after the meshes have moved
|
||||||
if(!globalFaceZoneMappingSet && Pstream::parRun())
|
if(!globalFaceZoneMappingSet && Pstream::parRun())
|
||||||
{
|
{
|
||||||
procToGlobalFZmap.write();
|
procToGlobalFZmap.write();
|
||||||
pointOnLocalProcPatch.write();
|
pointOnLocalProcPatch.write();
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,7 +15,7 @@ solidInterface* solidInterfacePtr(NULL);
|
||||||
solidInterfacePtr->modifyProperties(muf, lambdaf);
|
solidInterfacePtr->modifyProperties(muf, lambdaf);
|
||||||
gradDU = solidInterfacePtr->grad(DU);
|
gradDU = solidInterfacePtr->grad(DU);
|
||||||
|
|
||||||
//- solidInterface needs muf and lambdaf to be used for divSigmaExp
|
//- 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"
|
||||||
|
|
|
@ -75,7 +75,7 @@ int main(int argc, char *argv[])
|
||||||
|
|
||||||
# include "createSolidInterface.H"
|
# include "createSolidInterface.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Info<< "\nStarting time loop\n" << endl;
|
Info<< "\nStarting time loop\n" << endl;
|
||||||
|
|
||||||
|
@ -101,7 +101,9 @@ int main(int argc, char *argv[])
|
||||||
//- reset DU to zero at the start of the time-step if
|
//- reset DU to zero at the start of the time-step if
|
||||||
//- a predictor is not required
|
//- a predictor is not required
|
||||||
if(!predictor)
|
if(!predictor)
|
||||||
|
{
|
||||||
DU = dimensionedVector("zero", dimLength, vector::zero);
|
DU = dimensionedVector("zero", dimLength, vector::zero);
|
||||||
|
}
|
||||||
|
|
||||||
do //- start of momentum loop
|
do //- start of momentum loop
|
||||||
{
|
{
|
||||||
|
@ -114,7 +116,7 @@ int main(int argc, char *argv[])
|
||||||
<< "iteration: " << iCorr
|
<< "iteration: " << iCorr
|
||||||
<< ", residual: " << residual
|
<< ", residual: " << residual
|
||||||
<< endl;
|
<< endl;
|
||||||
//# include "moveMeshLeastSquares.H"
|
//# include "moveMeshLeastSquares.H"
|
||||||
# include "moveSolidMesh.H"
|
# include "moveSolidMesh.H"
|
||||||
contact.correct();
|
contact.correct();
|
||||||
mesh.movePoints(oldMeshPoints);
|
mesh.movePoints(oldMeshPoints);
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
//- move mesh
|
//- move mesh
|
||||||
//--------------------------------------------------//
|
//--------------------------------------------------//
|
||||||
if(min(J.internalField()) > 0)
|
if(min(J.internalField()) > 0)
|
||||||
{
|
{
|
||||||
Info << "Moving mesh using least squares interpolation" << endl;
|
Info << "Moving mesh using least squares interpolation" << endl;
|
||||||
|
|
||||||
leastSquaresVolPointInterpolation pointInterpolation(mesh);
|
leastSquaresVolPointInterpolation pointInterpolation(mesh);
|
||||||
|
@ -31,8 +31,7 @@ if(min(J.internalField()) > 0)
|
||||||
|
|
||||||
pointInterpolation.interpolate(DU, pointDU);
|
pointInterpolation.interpolate(DU, pointDU);
|
||||||
|
|
||||||
const vectorField& pointDUI =
|
const vectorField& pointDUI = pointDU.internalField();
|
||||||
pointDU.internalField();
|
|
||||||
|
|
||||||
//- Move mesh
|
//- Move mesh
|
||||||
vectorField newPoints = mesh.allPoints();
|
vectorField newPoints = mesh.allPoints();
|
||||||
|
@ -47,10 +46,10 @@ if(min(J.internalField()) > 0)
|
||||||
mesh.movePoints(newPoints);
|
mesh.movePoints(newPoints);
|
||||||
mesh.V00();
|
mesh.V00();
|
||||||
mesh.moving(false);
|
mesh.moving(false);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
FatalErrorIn(args.executable())
|
FatalErrorIn(args.executable())
|
||||||
<< "Negative Jacobian"
|
<< "Negative Jacobian"
|
||||||
<< exit(FatalError);
|
<< exit(FatalError);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
if (runTime.outputTime())
|
if (runTime.outputTime())
|
||||||
{
|
{
|
||||||
// FAILS IN PARALLEL - FIX
|
// FAILS IN PARALLEL - FIX
|
||||||
// Info << "Print contact area" << endl;
|
// Info << "Print contact area" << endl;
|
||||||
//volScalarField ca = contact.contactArea();
|
//volScalarField ca = contact.contactArea();
|
||||||
|
@ -52,4 +52,4 @@ if (runTime.outputTime())
|
||||||
//- SHOULD THIS BE A REF TO A TMP...?
|
//- SHOULD THIS BE A REF TO A TMP...?
|
||||||
volScalarField cPressure = contact.contactPressure();
|
volScalarField cPressure = contact.contactPressure();
|
||||||
cPressure.write();
|
cPressure.write();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,15 @@
|
||||||
//- how explicit component of sigma is to be calculated
|
//- how explicit component of sigma is to be calculated
|
||||||
word divDSigmaExpMethod(mesh.solutionDict().subDict("stressedFoam").lookup("divDSigmaExp"));
|
word divDSigmaExpMethod(mesh.solutionDict().subDict("stressedFoam").lookup("divDSigmaExp"));
|
||||||
Info << divDSigmaExpMethod << " method chosen for calculation of sigmaExp" << endl;
|
Info << divDSigmaExpMethod << " method chosen for calculation of sigmaExp" << endl;
|
||||||
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);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
if (runTime.outputTime())
|
if (runTime.outputTime())
|
||||||
{
|
{
|
||||||
volScalarField epsilonEq
|
volScalarField epsilonEq
|
||||||
(
|
(
|
||||||
IOobject
|
IOobject
|
||||||
|
@ -44,6 +44,7 @@ if (runTime.outputTime())
|
||||||
),
|
),
|
||||||
tr(sigma)/3.0
|
tr(sigma)/3.0
|
||||||
);
|
);
|
||||||
|
|
||||||
//- boundary surface pressure
|
//- boundary surface pressure
|
||||||
forAll(pressure.boundaryField(), patchi)
|
forAll(pressure.boundaryField(), patchi)
|
||||||
{
|
{
|
||||||
|
@ -74,4 +75,4 @@ if (runTime.outputTime())
|
||||||
mesh.movePoints(oldMeshPoints);
|
mesh.movePoints(oldMeshPoints);
|
||||||
|
|
||||||
runTime.write();
|
runTime.write();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,22 +1,22 @@
|
||||||
if(divDSigmaExpMethod == "standard")
|
if(divDSigmaExpMethod == "standard")
|
||||||
{
|
{
|
||||||
divDSigmaExp = fvc::div
|
divDSigmaExp = fvc::div
|
||||||
(
|
(
|
||||||
mu*gradDU.T() + lambda*(I*tr(gradDU)) - (mu + lambda)*gradDU,
|
mu*gradDU.T() + lambda*(I*tr(gradDU)) - (mu + lambda)*gradDU,
|
||||||
"div(sigma)"
|
"div(sigma)"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else if(divDSigmaExpMethod == "surface")
|
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")
|
||||||
{
|
{
|
||||||
surfaceTensorField shearGradDU =
|
surfaceTensorField shearGradDU =
|
||||||
((I - n*n)&fvc::interpolate(gradDU));
|
((I - n*n)&fvc::interpolate(gradDU));
|
||||||
|
|
||||||
|
@ -29,9 +29,9 @@ if(divDSigmaExpMethod == "standard")
|
||||||
+ muf*(shearGradDU&n)
|
+ muf*(shearGradDU&n)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else if(divDSigmaExpMethod == "laplacian")
|
else if(divDSigmaExpMethod == "laplacian")
|
||||||
{
|
{
|
||||||
divDSigmaExp =
|
divDSigmaExp =
|
||||||
- fvc::laplacian(mu + lambda, DU, "laplacian(DDU,DU)")
|
- fvc::laplacian(mu + lambda, DU, "laplacian(DDU,DU)")
|
||||||
+ fvc::div
|
+ fvc::div
|
||||||
|
@ -40,8 +40,8 @@ if(divDSigmaExpMethod == "standard")
|
||||||
+ lambda*(I*tr(gradDU)),
|
+ lambda*(I*tr(gradDU)),
|
||||||
"div(sigma)"
|
"div(sigma)"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
FatalError << "divDSigmaExp method " << divDSigmaExpMethod << " not found!" << endl;
|
FatalError << "divDSigmaExp method " << divDSigmaExpMethod << " not found!" << endl;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
//- sigma explicit large strain explicit terms
|
//- sigma explicit large strain explicit terms
|
||||||
//----------------------------------------------------//
|
//----------------------------------------------------//
|
||||||
if(divDSigmaLargeStrainExpMethod == "standard")
|
if(divDSigmaLargeStrainExpMethod == "standard")
|
||||||
{
|
{
|
||||||
divDSigmaLargeStrainExp =
|
divDSigmaLargeStrainExp =
|
||||||
fvc::div
|
fvc::div
|
||||||
(
|
(
|
||||||
|
@ -11,9 +11,9 @@ if(divDSigmaLargeStrainExpMethod == "standard")
|
||||||
+ ((sigma + DSigma) & DF.T()),
|
+ ((sigma + DSigma) & DF.T()),
|
||||||
"div(sigma)"
|
"div(sigma)"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else if(divDSigmaLargeStrainExpMethod == "surface")
|
else if(divDSigmaLargeStrainExpMethod == "surface")
|
||||||
{
|
{
|
||||||
divDSigmaLargeStrainExp =
|
divDSigmaLargeStrainExp =
|
||||||
fvc::div
|
fvc::div
|
||||||
(
|
(
|
||||||
|
@ -22,13 +22,13 @@ if(divDSigmaLargeStrainExpMethod == "standard")
|
||||||
+ (mesh.Sf() & fvc::interpolate( sigma & DF.T() ))
|
+ (mesh.Sf() & fvc::interpolate( sigma & DF.T() ))
|
||||||
+ (mesh.Sf() & fvc::interpolate(DSigma & DF.T() ))
|
+ (mesh.Sf() & fvc::interpolate(DSigma & DF.T() ))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
FatalError
|
FatalError
|
||||||
<< "divDSigmaLargeStrainExp not found!"
|
<< "divDSigmaLargeStrainExp not found!"
|
||||||
<< exit(FatalError);
|
<< exit(FatalError);
|
||||||
}
|
}
|
||||||
|
|
||||||
//- relax large strain component
|
//- relax large strain component
|
||||||
divDSigmaLargeStrainExp.relax();
|
divDSigmaLargeStrainExp.relax();
|
||||||
|
|
|
@ -69,5 +69,4 @@ FieldField<Field, vector> extraVecs(ptc.size());
|
||||||
|
|
||||||
curExtraVectors.setSize(nFacesAroundPoint);
|
curExtraVectors.setSize(nFacesAroundPoint);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -91,7 +91,8 @@ FieldField<Field, scalar> w(ptc.size());
|
||||||
|
|
||||||
// Update coupled boundaries
|
// Update coupled boundaries
|
||||||
// Work-around for cyclic parallels.
|
// Work-around for cyclic parallels.
|
||||||
/*if (Pstream::parRun() && !mesh.parallelData().cyclicParallel())
|
/*
|
||||||
|
if (Pstream::parRun() && !mesh.parallelData().cyclicParallel())
|
||||||
{
|
{
|
||||||
forAll (volPointSumWeights.boundaryField(), patchI)
|
forAll (volPointSumWeights.boundaryField(), patchI)
|
||||||
{
|
{
|
||||||
|
@ -111,7 +112,8 @@ FieldField<Field, scalar> w(ptc.size());
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}*/
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
// Re-scale the weights for the current point
|
// Re-scale the weights for the current point
|
||||||
forAll (ptc, pointI)
|
forAll (ptc, pointI)
|
||||||
|
|
|
@ -23,7 +23,7 @@ philipc
|
||||||
|
|
||||||
//- this is only needed in a parallel runs
|
//- this is only needed in a parallel runs
|
||||||
if(Pstream::parRun())
|
if(Pstream::parRun())
|
||||||
{
|
{
|
||||||
//***** FIX INCORRECT POINT ON PATCHES WITH FACEZONE *****//
|
//***** FIX INCORRECT POINT ON PATCHES WITH FACEZONE *****//
|
||||||
contactPatchPairList& contacts = contact;
|
contactPatchPairList& contacts = contact;
|
||||||
|
|
||||||
|
@ -33,9 +33,13 @@ if(Pstream::parRun())
|
||||||
label slaveID = contacts[contactI].slavePatch().index();
|
label slaveID = contacts[contactI].slavePatch().index();
|
||||||
|
|
||||||
primitivePatchInterpolation masterInterpolator
|
primitivePatchInterpolation masterInterpolator
|
||||||
(mesh.boundaryMesh()[masterID]);
|
(
|
||||||
|
mesh.boundaryMesh()[masterID]
|
||||||
|
);
|
||||||
primitivePatchInterpolation slaveInterpolator
|
primitivePatchInterpolation slaveInterpolator
|
||||||
(mesh.boundaryMesh()[slaveID]);
|
(
|
||||||
|
mesh.boundaryMesh()[slaveID]
|
||||||
|
);
|
||||||
|
|
||||||
//- DU must be interpolated to the vertices, this ignores the faceZone
|
//- DU must be interpolated to the vertices, this ignores the faceZone
|
||||||
//- points with no DU (unlike volPointInterpolation)
|
//- points with no DU (unlike volPointInterpolation)
|
||||||
|
@ -65,23 +69,17 @@ if(Pstream::parRun())
|
||||||
{
|
{
|
||||||
label pointGlobalLabel = masterPointLabels[pointI];
|
label pointGlobalLabel = masterPointLabels[pointI];
|
||||||
newPoints[pointGlobalLabel] =
|
newPoints[pointGlobalLabel] =
|
||||||
oldMasterPoints[pointI]
|
oldMasterPoints[pointI] + correctMasterPointDU[pointI];
|
||||||
+
|
|
||||||
correctMasterPointDU[pointI];
|
|
||||||
}
|
}
|
||||||
forAll(slavePointLabels, pointI)
|
forAll(slavePointLabels, pointI)
|
||||||
{
|
{
|
||||||
label pointGlobalLabel = slavePointLabels[pointI];
|
label pointGlobalLabel = slavePointLabels[pointI];
|
||||||
newPoints[pointGlobalLabel] =
|
newPoints[pointGlobalLabel] =
|
||||||
oldSlavePoints[pointI]
|
oldSlavePoints[pointI] + correctSlavePointDU[pointI];
|
||||||
+
|
|
||||||
correctSlavePointDU[pointI];
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//***** NOW FIX AND SYNCHRONISE ALL THE FACEZONE POINTS *****//
|
//***** NOW FIX AND SYNCHRONISE ALL THE FACEZONE POINTS *****//
|
||||||
|
|
||||||
forAll(mesh.faceZones(), faceZoneI)
|
forAll(mesh.faceZones(), faceZoneI)
|
||||||
|
@ -117,8 +115,7 @@ if(Pstream::parRun())
|
||||||
{
|
{
|
||||||
label procPoint =
|
label procPoint =
|
||||||
mesh.faceZones()[faceZoneI]().meshPoints()[localPoint];
|
mesh.faceZones()[faceZoneI]().meshPoints()[localPoint];
|
||||||
globalFZnewPoints[globalPointI] =
|
globalFZnewPoints[globalPointI] = newPoints[procPoint];
|
||||||
newPoints[procPoint];
|
|
||||||
pointNumProcs[globalPointI] = 1;
|
pointNumProcs[globalPointI] = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -141,20 +138,16 @@ if(Pstream::parRun())
|
||||||
forAll(globalFZnewPoints, globalPointI)
|
forAll(globalFZnewPoints, globalPointI)
|
||||||
{
|
{
|
||||||
label localPoint = procToGlobalFZmap[faceZoneI][globalPointI];
|
label localPoint = procToGlobalFZmap[faceZoneI][globalPointI];
|
||||||
|
procFZnewPoints[localPoint] = globalFZnewPoints[globalPointI];
|
||||||
procFZnewPoints[localPoint] =
|
|
||||||
globalFZnewPoints[globalPointI];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//- now fix the newPoints points on the globalFaceZones
|
//- now fix the newPoints points on the globalFaceZones
|
||||||
labelList procFZmeshPoints =
|
labelList procFZmeshPoints = mesh.faceZones()[faceZoneI]().meshPoints();
|
||||||
mesh.faceZones()[faceZoneI]().meshPoints();
|
|
||||||
|
|
||||||
forAll(procFZmeshPoints, pointI)
|
forAll(procFZmeshPoints, pointI)
|
||||||
{
|
{
|
||||||
label procPoint = procFZmeshPoints[pointI];
|
label procPoint = procFZmeshPoints[pointI];
|
||||||
newPoints[procPoint] =
|
newPoints[procPoint] = procFZnewPoints[pointI];
|
||||||
procFZnewPoints[pointI];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -28,7 +28,7 @@ IOList<labelList> procToGlobalFZmap
|
||||||
IOobject::AUTO_WRITE
|
IOobject::AUTO_WRITE
|
||||||
),
|
),
|
||||||
mesh.faceZones().size()
|
mesh.faceZones().size()
|
||||||
);
|
);
|
||||||
|
|
||||||
IOList<labelList> pointOnLocalProcPatch
|
IOList<labelList> pointOnLocalProcPatch
|
||||||
(
|
(
|
||||||
|
@ -46,20 +46,20 @@ IOList<labelList> pointOnLocalProcPatch
|
||||||
//- if they have been read then don't recalculate it
|
//- if they have been read then don't recalculate it
|
||||||
bool globalFaceZoneMappingSet = false;
|
bool globalFaceZoneMappingSet = false;
|
||||||
if(gMax(procToGlobalFZmap[0]) > 0 && gMax(pointOnLocalProcPatch[0]) > 0)
|
if(gMax(procToGlobalFZmap[0]) > 0 && gMax(pointOnLocalProcPatch[0]) > 0)
|
||||||
{
|
{
|
||||||
Info << "Reading procToGlobalFZmap and pointOnLocalProcPatch allowing restart of contact cases"
|
Info << "Reading procToGlobalFZmap and pointOnLocalProcPatch allowing restart of contact cases"
|
||||||
<< endl;
|
<< endl;
|
||||||
globalFaceZoneMappingSet = true;
|
globalFaceZoneMappingSet = true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Info << "procToGlobalFZmap and pointOnLocalProcPatch will be calculated as it has not been found" << nl
|
Info << "procToGlobalFZmap and pointOnLocalProcPatch will be calculated as it has not been found" << nl
|
||||||
<< "this message should only appear starting a new analysis" << endl;
|
<< "this message should only appear starting a new analysis" << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
//- this is only needed in a parallel runs
|
//- this is only needed in a parallel runs
|
||||||
if(Pstream::parRun())
|
if(Pstream::parRun())
|
||||||
{
|
{
|
||||||
if(!globalFaceZoneMappingSet)
|
if(!globalFaceZoneMappingSet)
|
||||||
{
|
{
|
||||||
forAll(mesh.faceZones(), faceZoneI)
|
forAll(mesh.faceZones(), faceZoneI)
|
||||||
|
@ -70,7 +70,9 @@ if(Pstream::parRun())
|
||||||
|
|
||||||
//- set all slave points to zero because only the master order is used
|
//- set all slave points to zero because only the master order is used
|
||||||
if(!Pstream::master())
|
if(!Pstream::master())
|
||||||
|
{
|
||||||
globalFZpoints *= 0.0;
|
globalFZpoints *= 0.0;
|
||||||
|
}
|
||||||
|
|
||||||
//- pass points to all procs
|
//- pass points to all procs
|
||||||
reduce(globalFZpoints, sumOp<vectorField>());
|
reduce(globalFZpoints, sumOp<vectorField>());
|
||||||
|
@ -93,8 +95,6 @@ if(Pstream::parRun())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//- procToGlobalFZmap now contains the local FZpoint label for each
|
|
||||||
//- global FZ point label - for each faceZone
|
|
||||||
|
|
||||||
//- check what points are on the current proc patch
|
//- check what points are on the current proc patch
|
||||||
pointOnLocalProcPatch[faceZoneI].setSize(globalFZpoints.size(), 0);
|
pointOnLocalProcPatch[faceZoneI].setSize(globalFZpoints.size(), 0);
|
||||||
|
@ -123,13 +123,13 @@ if(Pstream::parRun())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} //- end if(!globalFaceZoneMappingSet)
|
} //- end if(!globalFaceZoneMappingSet)
|
||||||
}
|
}
|
||||||
|
|
||||||
//- write to disk to allow restart of cases
|
//- write to disk to allow restart of cases
|
||||||
//- because it is not possible to calculate the
|
//- because it is not possible to calculate the
|
||||||
//- mapping after the meshes have moved
|
//- mapping after the meshes have moved
|
||||||
if(!globalFaceZoneMappingSet)
|
if(!globalFaceZoneMappingSet)
|
||||||
{
|
{
|
||||||
procToGlobalFZmap.write();
|
procToGlobalFZmap.write();
|
||||||
pointOnLocalProcPatch.write();
|
pointOnLocalProcPatch.write();
|
||||||
}
|
}
|
||||||
|
|
|
@ -82,7 +82,7 @@ int main(int argc, char *argv[])
|
||||||
|
|
||||||
# include "createGlobalToLocalFaceZonePointMap.H"
|
# include "createGlobalToLocalFaceZonePointMap.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Info<< "\nStarting time loop\n" << endl;
|
Info<< "\nStarting time loop\n" << endl;
|
||||||
|
|
||||||
|
@ -118,7 +118,7 @@ int main(int argc, char *argv[])
|
||||||
<< "iteration: " << iCorr
|
<< "iteration: " << iCorr
|
||||||
<< ", residual: " << residual
|
<< ", residual: " << residual
|
||||||
<< endl;
|
<< endl;
|
||||||
//# include "moveMeshLeastSquares.H"
|
//# include "moveMeshLeastSquares.H"
|
||||||
# include "moveSolidMeshForContact.H"
|
# include "moveSolidMeshForContact.H"
|
||||||
contact.correct();
|
contact.correct();
|
||||||
mesh.movePoints(oldMeshPoints);
|
mesh.movePoints(oldMeshPoints);
|
||||||
|
@ -135,7 +135,6 @@ int main(int argc, char *argv[])
|
||||||
fvm::laplacian(2*mu + lambda, DU, "laplacian(DDU,DU)")
|
fvm::laplacian(2*mu + lambda, DU, "laplacian(DDU,DU)")
|
||||||
+ divDSigmaExp
|
+ divDSigmaExp
|
||||||
+ divDSigmaLargeStrainExp
|
+ divDSigmaLargeStrainExp
|
||||||
|
|
||||||
);
|
);
|
||||||
|
|
||||||
solverPerf = DUEqn.solve();
|
solverPerf = DUEqn.solve();
|
||||||
|
|
|
@ -1,15 +1,15 @@
|
||||||
if(moveMeshMethod == "inverseDistance")
|
if(moveMeshMethod == "inverseDistance")
|
||||||
{
|
{
|
||||||
# include "moveMeshInverseDistance.H"
|
# include "moveMeshInverseDistance.H"
|
||||||
}
|
}
|
||||||
else if(moveMeshMethod == "leastSquares")
|
else if(moveMeshMethod == "leastSquares")
|
||||||
{
|
{
|
||||||
# include "moveMeshLeastSquares.H"
|
# include "moveMeshLeastSquares.H"
|
||||||
}
|
}
|
||||||
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);
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
//- move mesh
|
//- move mesh
|
||||||
//--------------------------------------------------//
|
//--------------------------------------------------//
|
||||||
if(min(J.internalField()) > 0)
|
if(min(J.internalField()) > 0)
|
||||||
{
|
{
|
||||||
Info << "Move solid mesh using inverse distance interpolation" << endl;
|
Info << "Move solid mesh using inverse distance interpolation" << endl;
|
||||||
|
|
||||||
// Create point mesh
|
// Create point mesh
|
||||||
|
@ -41,8 +41,7 @@ if(min(J.internalField()) > 0)
|
||||||
|
|
||||||
//pointDU.write();
|
//pointDU.write();
|
||||||
|
|
||||||
const vectorField& pointDUI =
|
const vectorField& pointDUI = pointDU.internalField();
|
||||||
pointDU.internalField();
|
|
||||||
|
|
||||||
// Move mesh
|
// Move mesh
|
||||||
vectorField newPoints = mesh.allPoints();
|
vectorField newPoints = mesh.allPoints();
|
||||||
|
@ -57,10 +56,10 @@ if(min(J.internalField()) > 0)
|
||||||
mesh.movePoints(newPoints);
|
mesh.movePoints(newPoints);
|
||||||
mesh.V00();
|
mesh.V00();
|
||||||
mesh.moving(false);
|
mesh.moving(false);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
FatalErrorIn(args.executable())
|
FatalErrorIn(args.executable())
|
||||||
<< "Negative Jacobian"
|
<< "Negative Jacobian"
|
||||||
<< exit(FatalError);
|
<< exit(FatalError);
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
//- move mesh
|
//- move mesh
|
||||||
//--------------------------------------------------//
|
//--------------------------------------------------//
|
||||||
if(min(J.internalField()) > 0)
|
if(min(J.internalField()) > 0)
|
||||||
{
|
{
|
||||||
Info << "Moving mesh using least squares interpolation" << endl;
|
Info << "Moving mesh using least squares interpolation" << endl;
|
||||||
|
|
||||||
leastSquaresVolPointInterpolation pointInterpolation(mesh);
|
leastSquaresVolPointInterpolation pointInterpolation(mesh);
|
||||||
|
@ -31,8 +31,7 @@ if(min(J.internalField()) > 0)
|
||||||
|
|
||||||
pointInterpolation.interpolate(DU, pointDU);
|
pointInterpolation.interpolate(DU, pointDU);
|
||||||
|
|
||||||
const vectorField& pointDUI =
|
const vectorField& pointDUI = pointDU.internalField();
|
||||||
pointDU.internalField();
|
|
||||||
|
|
||||||
//- Move mesh
|
//- Move mesh
|
||||||
vectorField newPoints = mesh.allPoints();
|
vectorField newPoints = mesh.allPoints();
|
||||||
|
@ -47,10 +46,10 @@ if(min(J.internalField()) > 0)
|
||||||
mesh.movePoints(newPoints);
|
mesh.movePoints(newPoints);
|
||||||
mesh.V00();
|
mesh.V00();
|
||||||
mesh.moving(false);
|
mesh.moving(false);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
FatalErrorIn(args.executable())
|
FatalErrorIn(args.executable())
|
||||||
<< "Negative Jacobian"
|
<< "Negative Jacobian"
|
||||||
<< exit(FatalError);
|
<< exit(FatalError);
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,8 @@ pointVectorField& pf = pointDU;
|
||||||
|
|
||||||
// Do the correction
|
// Do the correction
|
||||||
//GeometricField<Type, pointPatchField, pointMesh> pfCorr
|
//GeometricField<Type, pointPatchField, pointMesh> pfCorr
|
||||||
/*pointVectorField pfCorr
|
/*
|
||||||
|
pointVectorField pfCorr
|
||||||
(
|
(
|
||||||
IOobject
|
IOobject
|
||||||
(
|
(
|
||||||
|
@ -23,7 +24,8 @@ pointVectorField& pf = pointDU;
|
||||||
//dimensioned<Type>("zero", pf.dimensions(), pTraits<Type>::zero),
|
//dimensioned<Type>("zero", pf.dimensions(), pTraits<Type>::zero),
|
||||||
dimensionedVector("zero", pf.dimensions(), vector::zero),
|
dimensionedVector("zero", pf.dimensions(), vector::zero),
|
||||||
pf.boundaryField().types()
|
pf.boundaryField().types()
|
||||||
);*/
|
);
|
||||||
|
*/
|
||||||
|
|
||||||
pointVectorField pfCorr
|
pointVectorField pfCorr
|
||||||
(
|
(
|
||||||
|
@ -38,7 +40,7 @@ pointVectorField pfCorr
|
||||||
pMesh,
|
pMesh,
|
||||||
dimensionedVector("vector", dimLength, vector::zero),
|
dimensionedVector("vector", dimLength, vector::zero),
|
||||||
"calculated"
|
"calculated"
|
||||||
);
|
);
|
||||||
|
|
||||||
//const labelList& ptc = boundaryPoints();
|
//const labelList& ptc = boundaryPoints();
|
||||||
#include "findBoundaryPoints.H"
|
#include "findBoundaryPoints.H"
|
||||||
|
@ -96,25 +98,29 @@ forAll (ptc, pointI)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update coupled boundaries
|
// Update coupled boundaries
|
||||||
/*forAll (pfCorr.boundaryField(), patchI)
|
/*
|
||||||
|
forAll (pfCorr.boundaryField(), patchI)
|
||||||
{
|
{
|
||||||
if (pfCorr.boundaryField()[patchI].coupled())
|
if (pfCorr.boundaryField()[patchI].coupled())
|
||||||
{
|
{
|
||||||
pfCorr.boundaryField()[patchI].initAddField();
|
pfCorr.boundaryField()[patchI].initAddField();
|
||||||
}
|
}
|
||||||
}*/
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
/*forAll (pfCorr.boundaryField(), patchI)
|
/*
|
||||||
|
forAll (pfCorr.boundaryField(), patchI)
|
||||||
{
|
{
|
||||||
if (pfCorr.boundaryField()[patchI].coupled())
|
if (pfCorr.boundaryField()[patchI].coupled())
|
||||||
{
|
{
|
||||||
pfCorr.boundaryField()[patchI].addField(pfCorr.internalField());
|
pfCorr.boundaryField()[patchI].addField(pfCorr.internalField());
|
||||||
}
|
}
|
||||||
}*/
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
//Info << "pfCorr: " << pfCorr << endl;
|
//Info << "pfCorr: " << pfCorr << endl;
|
||||||
pfCorr.correctBoundaryConditions();
|
pfCorr.correctBoundaryConditions();
|
||||||
|
|
||||||
//pfCorr.write();
|
//pfCorr.write();
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
if (runTime.outputTime())
|
if (runTime.outputTime())
|
||||||
{
|
{
|
||||||
// FAILS IN PARALLEL - FIX
|
// FAILS IN PARALLEL - FIX
|
||||||
// Info << "Print contact area" << endl;
|
// Info << "Print contact area" << endl;
|
||||||
//volScalarField ca = contact.contactArea();
|
//volScalarField ca = contact.contactArea();
|
||||||
|
@ -52,4 +52,4 @@ if (runTime.outputTime())
|
||||||
//- SHOULD THIS BE A REF TO A TMP...?
|
//- SHOULD THIS BE A REF TO A TMP...?
|
||||||
volScalarField cPressure = contact.contactPressure();
|
volScalarField cPressure = contact.contactPressure();
|
||||||
cPressure.write();
|
cPressure.write();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,15 @@
|
||||||
//- how explicit component of sigma is to be calculated
|
//- how explicit component of sigma is to be calculated
|
||||||
word divDSigmaExpMethod(mesh.solutionDict().subDict("stressedFoam").lookup("divDSigmaExp"));
|
word divDSigmaExpMethod(mesh.solutionDict().subDict("stressedFoam").lookup("divDSigmaExp"));
|
||||||
Info << divDSigmaExpMethod << " method chosen for calculation of DSigmaExp" << endl;
|
Info << divDSigmaExpMethod << " method chosen for calculation of DSigmaExp" << endl;
|
||||||
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);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
if (runTime.outputTime())
|
if (runTime.outputTime())
|
||||||
{
|
{
|
||||||
volScalarField epsilonEq
|
volScalarField epsilonEq
|
||||||
(
|
(
|
||||||
IOobject
|
IOobject
|
||||||
|
@ -33,4 +33,4 @@ if (runTime.outputTime())
|
||||||
<< endl;
|
<< endl;
|
||||||
|
|
||||||
runTime.write();
|
runTime.write();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,24 +1,23 @@
|
||||||
if(divSigmaExpMethod == "standard")
|
if(divSigmaExpMethod == "standard")
|
||||||
{
|
{
|
||||||
divSigmaExp = fvc::div
|
divSigmaExp = fvc::div
|
||||||
(
|
(
|
||||||
mu*gradU.T() + lambda*(I*tr(gradU)) - (mu + lambda)*gradU,
|
mu*gradU.T() + lambda*(I*tr(gradU)) - (mu + lambda)*gradU,
|
||||||
"div(sigma)"
|
"div(sigma)"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else if(divSigmaExpMethod == "surface")
|
else if(divSigmaExpMethod == "surface")
|
||||||
{
|
{
|
||||||
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")
|
||||||
{
|
{
|
||||||
surfaceTensorField shearGradU =
|
surfaceTensorField shearGradU = ((I - n*n)&fvc::interpolate(gradU));
|
||||||
((I - n*n)&fvc::interpolate(gradU));
|
|
||||||
|
|
||||||
divSigmaExp = fvc::div
|
divSigmaExp = fvc::div
|
||||||
(
|
(
|
||||||
|
@ -29,9 +28,9 @@ if(divSigmaExpMethod == "standard")
|
||||||
+ muf*(shearGradU&n)
|
+ muf*(shearGradU&n)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else if(divSigmaExpMethod == "expLaplacian")
|
else if(divSigmaExpMethod == "expLaplacian")
|
||||||
{
|
{
|
||||||
divSigmaExp =
|
divSigmaExp =
|
||||||
- fvc::laplacian(mu + lambda, U, "laplacian(U,U)")
|
- fvc::laplacian(mu + lambda, U, "laplacian(U,U)")
|
||||||
+ fvc::div
|
+ fvc::div
|
||||||
|
@ -40,8 +39,8 @@ if(divSigmaExpMethod == "standard")
|
||||||
+ lambda*(I*tr(gradU)),
|
+ lambda*(I*tr(gradU)),
|
||||||
"div(sigma)"
|
"div(sigma)"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
FatalError << "divSigmaExp method " << divSigmaExpMethod << " not found!" << endl;
|
FatalError << "divSigmaExp method " << divSigmaExpMethod << " not found!" << endl;
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,7 +23,7 @@ philipc
|
||||||
|
|
||||||
//- this is only needed in a parallel runs
|
//- this is only needed in a parallel runs
|
||||||
if(Pstream::parRun())
|
if(Pstream::parRun())
|
||||||
{
|
{
|
||||||
//***** FIX INCORRECT POINT ON PATCHES WITH FACEZONE *****//
|
//***** FIX INCORRECT POINT ON PATCHES WITH FACEZONE *****//
|
||||||
contactPatchPairList& contacts = contact;
|
contactPatchPairList& contacts = contact;
|
||||||
|
|
||||||
|
@ -33,9 +33,13 @@ if(Pstream::parRun())
|
||||||
label slaveID = contacts[contactI].slavePatch().index();
|
label slaveID = contacts[contactI].slavePatch().index();
|
||||||
|
|
||||||
primitivePatchInterpolation masterInterpolator
|
primitivePatchInterpolation masterInterpolator
|
||||||
(mesh.boundaryMesh()[masterID]);
|
(
|
||||||
|
mesh.boundaryMesh()[masterID]
|
||||||
|
);
|
||||||
primitivePatchInterpolation slaveInterpolator
|
primitivePatchInterpolation slaveInterpolator
|
||||||
(mesh.boundaryMesh()[slaveID]);
|
(
|
||||||
|
mesh.boundaryMesh()[slaveID]
|
||||||
|
);
|
||||||
|
|
||||||
//- U must be interpolated to the vertices, this ignores the faceZone
|
//- U must be interpolated to the vertices, this ignores the faceZone
|
||||||
//- points with no U (unlike volPointInterpolation)
|
//- points with no U (unlike volPointInterpolation)
|
||||||
|
@ -65,23 +69,17 @@ if(Pstream::parRun())
|
||||||
{
|
{
|
||||||
label pointGlobalLabel = masterPointLabels[pointI];
|
label pointGlobalLabel = masterPointLabels[pointI];
|
||||||
newPoints[pointGlobalLabel] =
|
newPoints[pointGlobalLabel] =
|
||||||
oldMasterPoints[pointI]
|
oldMasterPoints[pointI] + correctMasterPointU[pointI];
|
||||||
+
|
|
||||||
correctMasterPointU[pointI];
|
|
||||||
}
|
}
|
||||||
forAll(slavePointLabels, pointI)
|
forAll(slavePointLabels, pointI)
|
||||||
{
|
{
|
||||||
label pointGlobalLabel = slavePointLabels[pointI];
|
label pointGlobalLabel = slavePointLabels[pointI];
|
||||||
newPoints[pointGlobalLabel] =
|
newPoints[pointGlobalLabel] =
|
||||||
oldSlavePoints[pointI]
|
oldSlavePoints[pointI] + correctSlavePointU[pointI];
|
||||||
+
|
|
||||||
correctSlavePointU[pointI];
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//***** NOW FIX AND SYNCHRONISE ALL THE FACEZONE POINTS *****//
|
//***** NOW FIX AND SYNCHRONISE ALL THE FACEZONE POINTS *****//
|
||||||
|
|
||||||
forAll(mesh.faceZones(), faceZoneI)
|
forAll(mesh.faceZones(), faceZoneI)
|
||||||
|
@ -117,8 +115,7 @@ if(Pstream::parRun())
|
||||||
{
|
{
|
||||||
label procPoint =
|
label procPoint =
|
||||||
mesh.faceZones()[faceZoneI]().meshPoints()[localPoint];
|
mesh.faceZones()[faceZoneI]().meshPoints()[localPoint];
|
||||||
globalFZnewPoints[globalPointI] =
|
globalFZnewPoints[globalPointI] = newPoints[procPoint];
|
||||||
newPoints[procPoint];
|
|
||||||
pointNumProcs[globalPointI] = 1;
|
pointNumProcs[globalPointI] = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -141,20 +138,16 @@ if(Pstream::parRun())
|
||||||
forAll(globalFZnewPoints, globalPointI)
|
forAll(globalFZnewPoints, globalPointI)
|
||||||
{
|
{
|
||||||
label localPoint = procToGlobalFZmap[faceZoneI][globalPointI];
|
label localPoint = procToGlobalFZmap[faceZoneI][globalPointI];
|
||||||
|
procFZnewPoints[localPoint] = globalFZnewPoints[globalPointI];
|
||||||
procFZnewPoints[localPoint] =
|
|
||||||
globalFZnewPoints[globalPointI];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//- now fix the newPoints points on the globalFaceZones
|
//- now fix the newPoints points on the globalFaceZones
|
||||||
labelList procFZmeshPoints =
|
labelList procFZmeshPoints = mesh.faceZones()[faceZoneI]().meshPoints();
|
||||||
mesh.faceZones()[faceZoneI]().meshPoints();
|
|
||||||
|
|
||||||
forAll(procFZmeshPoints, pointI)
|
forAll(procFZmeshPoints, pointI)
|
||||||
{
|
{
|
||||||
label procPoint = procFZmeshPoints[pointI];
|
label procPoint = procFZmeshPoints[pointI];
|
||||||
newPoints[procPoint] =
|
newPoints[procPoint] = procFZnewPoints[pointI];
|
||||||
procFZnewPoints[pointI];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -28,7 +28,7 @@ IOList<labelList> procToGlobalFZmap
|
||||||
IOobject::AUTO_WRITE
|
IOobject::AUTO_WRITE
|
||||||
),
|
),
|
||||||
mesh.faceZones().size()
|
mesh.faceZones().size()
|
||||||
);
|
);
|
||||||
|
|
||||||
IOList<labelList> pointOnLocalProcPatch
|
IOList<labelList> pointOnLocalProcPatch
|
||||||
(
|
(
|
||||||
|
@ -46,20 +46,20 @@ IOList<labelList> pointOnLocalProcPatch
|
||||||
//- if they have been read then don't recalculate it
|
//- if they have been read then don't recalculate it
|
||||||
bool globalFaceZoneMappingSet = false;
|
bool globalFaceZoneMappingSet = false;
|
||||||
if(gMax(procToGlobalFZmap[0]) > 0 && gMax(pointOnLocalProcPatch[0]) > 0)
|
if(gMax(procToGlobalFZmap[0]) > 0 && gMax(pointOnLocalProcPatch[0]) > 0)
|
||||||
{
|
{
|
||||||
Info << "Reading procToGlobalFZmap and pointOnLocalProcPatch allowing restart of contact cases"
|
Info << "Reading procToGlobalFZmap and pointOnLocalProcPatch allowing restart of contact cases"
|
||||||
<< endl;
|
<< endl;
|
||||||
globalFaceZoneMappingSet = true;
|
globalFaceZoneMappingSet = true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Info << "procToGlobalFZmap and pointOnLocalProcPatch will be calculated as it has not been found" << nl
|
Info << "procToGlobalFZmap and pointOnLocalProcPatch will be calculated as it has not been found" << nl
|
||||||
<< "this message should only appear starting a new analysis" << endl;
|
<< "this message should only appear starting a new analysis" << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
//- this is only needed in a parallel runs
|
//- this is only needed in a parallel runs
|
||||||
if(Pstream::parRun())
|
if(Pstream::parRun())
|
||||||
{
|
{
|
||||||
if(!globalFaceZoneMappingSet)
|
if(!globalFaceZoneMappingSet)
|
||||||
{
|
{
|
||||||
forAll(mesh.faceZones(), faceZoneI)
|
forAll(mesh.faceZones(), faceZoneI)
|
||||||
|
@ -70,7 +70,9 @@ if(Pstream::parRun())
|
||||||
|
|
||||||
//- set all slave points to zero because only the master order is used
|
//- set all slave points to zero because only the master order is used
|
||||||
if(!Pstream::master())
|
if(!Pstream::master())
|
||||||
|
{
|
||||||
globalFZpoints *= 0.0;
|
globalFZpoints *= 0.0;
|
||||||
|
}
|
||||||
|
|
||||||
//- pass points to all procs
|
//- pass points to all procs
|
||||||
reduce(globalFZpoints, sumOp<vectorField>());
|
reduce(globalFZpoints, sumOp<vectorField>());
|
||||||
|
@ -93,8 +95,6 @@ if(Pstream::parRun())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//- procToGlobalFZmap now contains the local FZpoint label for each
|
|
||||||
//- global FZ point label - for each faceZone
|
|
||||||
|
|
||||||
//- check what points are on the current proc patch
|
//- check what points are on the current proc patch
|
||||||
pointOnLocalProcPatch[faceZoneI].setSize(globalFZpoints.size(), 0);
|
pointOnLocalProcPatch[faceZoneI].setSize(globalFZpoints.size(), 0);
|
||||||
|
@ -123,13 +123,13 @@ if(Pstream::parRun())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} //- end if(!globalFaceZoneMappingSet)
|
} //- end if(!globalFaceZoneMappingSet)
|
||||||
}
|
}
|
||||||
|
|
||||||
//- write to disk to allow restart of cases
|
//- write to disk to allow restart of cases
|
||||||
//- because it is not possible to calculate the
|
//- because it is not possible to calculate the
|
||||||
//- mapping after the meshes have moved
|
//- mapping after the meshes have moved
|
||||||
if(!globalFaceZoneMappingSet)
|
if(!globalFaceZoneMappingSet)
|
||||||
{
|
{
|
||||||
procToGlobalFZmap.write();
|
procToGlobalFZmap.write();
|
||||||
pointOnLocalProcPatch.write();
|
pointOnLocalProcPatch.write();
|
||||||
}
|
}
|
||||||
|
|
|
@ -78,7 +78,7 @@ int main(int argc, char *argv[])
|
||||||
|
|
||||||
# include "createGlobalToLocalFaceZonePointMap.H"
|
# include "createGlobalToLocalFaceZonePointMap.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Info<< "\nStarting time loop\n" << endl;
|
Info<< "\nStarting time loop\n" << endl;
|
||||||
|
|
||||||
|
@ -121,7 +121,7 @@ int main(int argc, char *argv[])
|
||||||
<< "iteration: " << iCorr
|
<< "iteration: " << iCorr
|
||||||
<< ", residual: " << residual
|
<< ", residual: " << residual
|
||||||
<< endl;
|
<< endl;
|
||||||
//# include "moveMeshLeastSquares.H"
|
//# include "moveMeshLeastSquares.H"
|
||||||
# include "moveSolidMesh.H"
|
# include "moveSolidMesh.H"
|
||||||
contact.correct();
|
contact.correct();
|
||||||
mesh.movePoints(oldMeshPoints);
|
mesh.movePoints(oldMeshPoints);
|
||||||
|
@ -187,10 +187,10 @@ int main(int argc, char *argv[])
|
||||||
|
|
||||||
# include "writeFields.H"
|
# include "writeFields.H"
|
||||||
|
|
||||||
//# include "moveMeshLeastSquares.H"
|
//# include "moveMeshLeastSquares.H"
|
||||||
//# include "moveSolidMesh.H"
|
//# include "moveSolidMesh.H"
|
||||||
//# include "printContactResults.H"
|
//# include "printContactResults.H"
|
||||||
//mesh.movePoints(oldMeshPoints);
|
// mesh.movePoints(oldMeshPoints);
|
||||||
|
|
||||||
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
|
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
|
||||||
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
|
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
//- move mesh
|
//- move mesh
|
||||||
//--------------------------------------------------//
|
//--------------------------------------------------//
|
||||||
if(min(J.internalField()) > 0)
|
if(min(J.internalField()) > 0)
|
||||||
{
|
{
|
||||||
Info << "Moving mesh using least squares interpolation" << endl;
|
Info << "Moving mesh using least squares interpolation" << endl;
|
||||||
|
|
||||||
leastSquaresVolPointInterpolation pointInterpolation(mesh);
|
leastSquaresVolPointInterpolation pointInterpolation(mesh);
|
||||||
|
@ -31,8 +31,7 @@ if(min(J.internalField()) > 0)
|
||||||
|
|
||||||
pointInterpolation.interpolate(DU, pointDU);
|
pointInterpolation.interpolate(DU, pointDU);
|
||||||
|
|
||||||
const vectorField& pointDUI =
|
const vectorField& pointDUI = pointDU.internalField();
|
||||||
pointDU.internalField();
|
|
||||||
|
|
||||||
//- Move mesh
|
//- Move mesh
|
||||||
vectorField newPoints = mesh.allPoints();
|
vectorField newPoints = mesh.allPoints();
|
||||||
|
@ -47,10 +46,10 @@ if(min(J.internalField()) > 0)
|
||||||
mesh.movePoints(newPoints);
|
mesh.movePoints(newPoints);
|
||||||
mesh.V00();
|
mesh.V00();
|
||||||
mesh.moving(false);
|
mesh.moving(false);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
FatalErrorIn(args.executable())
|
FatalErrorIn(args.executable())
|
||||||
<< "Negative Jacobian"
|
<< "Negative Jacobian"
|
||||||
<< exit(FatalError);
|
<< exit(FatalError);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
if (runTime.outputTime())
|
if (runTime.outputTime())
|
||||||
{
|
{
|
||||||
// FAILS IN PARALLEL - FIX
|
// FAILS IN PARALLEL - FIX
|
||||||
// Info << "Print contact area" << endl;
|
// Info << "Print contact area" << endl;
|
||||||
//volScalarField ca = contact.contactArea();
|
//volScalarField ca = contact.contactArea();
|
||||||
|
@ -52,4 +52,4 @@ if (runTime.outputTime())
|
||||||
//- SHOULD THIS BE A REF TO A TMP...?
|
//- SHOULD THIS BE A REF TO A TMP...?
|
||||||
volScalarField cPressure = contact.contactPressure();
|
volScalarField cPressure = contact.contactPressure();
|
||||||
cPressure.write();
|
cPressure.write();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
if (runTime.outputTime())
|
if (runTime.outputTime())
|
||||||
{
|
{
|
||||||
volScalarField epsilonEq
|
volScalarField epsilonEq
|
||||||
(
|
(
|
||||||
IOobject
|
IOobject
|
||||||
|
@ -33,4 +33,4 @@ if (runTime.outputTime())
|
||||||
<< endl;
|
<< endl;
|
||||||
|
|
||||||
runTime.write();
|
runTime.write();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,24 +1,23 @@
|
||||||
if(divSigmaExpMethod == "standard")
|
if(divSigmaExpMethod == "standard")
|
||||||
{
|
{
|
||||||
divSigmaExp = fvc::div
|
divSigmaExp = fvc::div
|
||||||
(
|
(
|
||||||
mu*gradU.T() + lambda*(I*tr(gradU)) - (mu + lambda)*gradU,
|
mu*gradU.T() + lambda*(I*tr(gradU)) - (mu + lambda)*gradU,
|
||||||
"div(sigma)"
|
"div(sigma)"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else if(divSigmaExpMethod == "surface")
|
else if(divSigmaExpMethod == "surface")
|
||||||
{
|
{
|
||||||
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")
|
||||||
{
|
{
|
||||||
surfaceTensorField shearGradU =
|
surfaceTensorField shearGradU = ((I - n*n)&fvc::interpolate(gradU));
|
||||||
((I - n*n)&fvc::interpolate(gradU));
|
|
||||||
|
|
||||||
divSigmaExp = fvc::div
|
divSigmaExp = fvc::div
|
||||||
(
|
(
|
||||||
|
@ -29,9 +28,9 @@ if(divSigmaExpMethod == "standard")
|
||||||
+ muf*(shearGradU&n)
|
+ muf*(shearGradU&n)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else if(divSigmaExpMethod == "expLaplacian")
|
else if(divSigmaExpMethod == "expLaplacian")
|
||||||
{
|
{
|
||||||
divSigmaExp =
|
divSigmaExp =
|
||||||
- fvc::laplacian(mu + lambda, U, "laplacian(DU,U)")
|
- fvc::laplacian(mu + lambda, U, "laplacian(DU,U)")
|
||||||
+ fvc::div
|
+ fvc::div
|
||||||
|
@ -40,8 +39,8 @@ if(divSigmaExpMethod == "standard")
|
||||||
+ lambda*(I*tr(gradU)),
|
+ lambda*(I*tr(gradU)),
|
||||||
"div(sigma)"
|
"div(sigma)"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
FatalError << "divSigmaExp method " << divSigmaExpMethod << " not found!" << endl;
|
FatalError << "divSigmaExp method " << divSigmaExpMethod << " not found!" << endl;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,15 @@
|
||||||
//- how explicit component of sigma is to be calculated
|
//- how explicit component of sigma is to be calculated
|
||||||
word divSigmaExpMethod(mesh.solutionDict().subDict("stressedFoam").lookup("divSigmaExp"));
|
word divSigmaExpMethod(mesh.solutionDict().subDict("stressedFoam").lookup("divSigmaExp"));
|
||||||
Info << "Selecting divSigmaExp calculation method " << divSigmaExpMethod << endl;
|
Info << "Selecting divSigmaExp calculation method " << divSigmaExpMethod << endl;
|
||||||
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);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
if (runTime.outputTime())
|
if (runTime.outputTime())
|
||||||
{
|
{
|
||||||
volScalarField epsilonEq
|
volScalarField epsilonEq
|
||||||
(
|
(
|
||||||
IOobject
|
IOobject
|
||||||
|
@ -33,4 +33,4 @@ if (runTime.outputTime())
|
||||||
<< endl;
|
<< endl;
|
||||||
|
|
||||||
runTime.write();
|
runTime.write();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,37 +1,37 @@
|
||||||
if(divDSigmaExpMethod == "standard")
|
if(divDSigmaExpMethod == "standard")
|
||||||
{
|
{
|
||||||
divDSigmaExp = fvc::div
|
divDSigmaExp = fvc::div
|
||||||
(
|
(
|
||||||
mu*gradDU.T() + lambda*(I*tr(gradDU)) - (mu + lambda)*gradDU,
|
mu*gradDU.T() + lambda*(I*tr(gradDU)) - (mu + lambda)*gradDU,
|
||||||
"div(sigma)"
|
"div(sigma)"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else if(divDSigmaExpMethod == "surface")
|
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")
|
||||||
{
|
{
|
||||||
surfaceTensorField shearGradDU =
|
surfaceTensorField shearGradDU = ((I - n*n)&fvc::interpolate(gradDU));
|
||||||
((I - n*n)&fvc::interpolate(gradDU));
|
|
||||||
|
|
||||||
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")
|
||||||
{
|
{
|
||||||
divDSigmaExp =
|
divDSigmaExp =
|
||||||
- fvc::laplacian(mu + lambda, DU, "laplacian(DDU,DU)")
|
- fvc::laplacian(mu + lambda, DU, "laplacian(DDU,DU)")
|
||||||
+ fvc::div
|
+ fvc::div
|
||||||
|
@ -40,8 +40,8 @@ if(divDSigmaExpMethod == "standard")
|
||||||
+ lambda*(I*tr(gradDU)),
|
+ lambda*(I*tr(gradDU)),
|
||||||
"div(sigma)"
|
"div(sigma)"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
FatalError << "divDSigmaExp method " << divDSigmaExpMethod << " not found!" << endl;
|
FatalError << "divDSigmaExp method " << divDSigmaExpMethod << " not found!" << endl;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,15 @@
|
||||||
//- how explicit component of sigma is to be calculated
|
//- how explicit component of sigma is to be calculated
|
||||||
word divDSigmaExpMethod(mesh.solutionDict().subDict("stressedFoam").lookup("divDSigmaExp"));
|
word divDSigmaExpMethod(mesh.solutionDict().subDict("stressedFoam").lookup("divDSigmaExp"));
|
||||||
Info << "Selecting divDSigmaExp calculation method " << divDSigmaExpMethod << endl;
|
Info << "Selecting divDSigmaExp calculation method " << divDSigmaExpMethod << endl;
|
||||||
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);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
if (runTime.outputTime())
|
if (runTime.outputTime())
|
||||||
{
|
{
|
||||||
volScalarField epsilonEq
|
volScalarField epsilonEq
|
||||||
(
|
(
|
||||||
IOobject
|
IOobject
|
||||||
|
@ -33,4 +33,4 @@ if (runTime.outputTime())
|
||||||
<< endl;
|
<< endl;
|
||||||
|
|
||||||
runTime.write();
|
runTime.write();
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,15 +2,16 @@
|
||||||
|
|
||||||
label leftPatchID = mesh.boundaryMesh().findPatchID("leftClamp");
|
label leftPatchID = mesh.boundaryMesh().findPatchID("leftClamp");
|
||||||
if(leftPatchID == -1)
|
if(leftPatchID == -1)
|
||||||
{
|
{
|
||||||
FatalError << "Cannot find patch left for calculating force" << endl;
|
FatalError << "Cannot find patch left for calculating force" << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
//- 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) &
|
(
|
||||||
(mesh.boundary()[leftPatchID].Sf() & sigma.boundaryField()[leftPatchID])
|
vector(1, 0, 0)
|
||||||
);
|
& (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
|
||||||
|
@ -23,13 +24,13 @@ scalar leftForce = gSum(
|
||||||
vector gaugeU1 = vector::zero;
|
vector gaugeU1 = vector::zero;
|
||||||
vector gaugeU2 = vector::zero;
|
vector gaugeU2 = vector::zero;
|
||||||
if(gaugeFaceID1 != -1)
|
if(gaugeFaceID1 != -1)
|
||||||
{
|
{
|
||||||
gaugeU1 = U.boundaryField()[gaugeFacePatchID1][gaugeFaceID1];
|
gaugeU1 = U.boundaryField()[gaugeFacePatchID1][gaugeFaceID1];
|
||||||
}
|
}
|
||||||
if(gaugeFaceID2 != -1)
|
if(gaugeFaceID2 != -1)
|
||||||
{
|
{
|
||||||
gaugeU2 = U.boundaryField()[gaugeFacePatchID2][gaugeFaceID2];
|
gaugeU2 = U.boundaryField()[gaugeFacePatchID2][gaugeFaceID2];
|
||||||
}
|
}
|
||||||
|
|
||||||
//- reduce across procs
|
//- reduce across procs
|
||||||
reduce(gaugeU1, sumOp<vector>());
|
reduce(gaugeU1, sumOp<vector>());
|
||||||
|
@ -42,7 +43,7 @@ scalar gaugeDisp = mag(gaugeU1 - gaugeU2);
|
||||||
|
|
||||||
//- write to file
|
//- write to file
|
||||||
if(Pstream::master())
|
if(Pstream::master())
|
||||||
{
|
{
|
||||||
OFstream& forceDispFile = *filePtr;
|
OFstream& forceDispFile = *filePtr;
|
||||||
forceDispFile << 1000*gaugeDisp << "\t" << -1*leftForce << endl;
|
forceDispFile << 1000*gaugeDisp << "\t" << -1*leftForce << endl;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,9 @@
|
||||||
{
|
{
|
||||||
forAll(mesh.boundary(), patchID)
|
forAll(mesh.boundary(), patchID)
|
||||||
{
|
{
|
||||||
if(U.boundaryField()[patchID].type()
|
if
|
||||||
|
(
|
||||||
|
U.boundaryField()[patchID].type()
|
||||||
== solidDirectionMixedFvPatchVectorField::typeName
|
== solidDirectionMixedFvPatchVectorField::typeName
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
|
|
@ -83,8 +83,9 @@ int main(int argc, char *argv[])
|
||||||
fvm::d2dt2(rho, U)
|
fvm::d2dt2(rho, U)
|
||||||
==
|
==
|
||||||
fvm::laplacian(2*mu + lambda, U, "laplacian(DU,U)")
|
fvm::laplacian(2*mu + lambda, U, "laplacian(DU,U)")
|
||||||
+ fvc::div(
|
+ fvc::div
|
||||||
-( (mu + lambda) * gradU )
|
(
|
||||||
|
- ( (mu + lambda) * gradU )
|
||||||
+ ( mu * gradU.T() )
|
+ ( mu * gradU.T() )
|
||||||
+ ( mu * (gradU & gradU.T()) )
|
+ ( mu * (gradU & gradU.T()) )
|
||||||
+ ( lambda * tr(gradU) * I )
|
+ ( lambda * tr(gradU) * I )
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
//- move mesh
|
//- move mesh
|
||||||
//--------------------------------------------------//
|
//--------------------------------------------------//
|
||||||
if(min(J.internalField()) > 0)
|
if(min(J.internalField()) > 0)
|
||||||
{
|
{
|
||||||
Info << "Moving mesh using least squares interpolation" << endl;
|
Info << "Moving mesh using least squares interpolation" << endl;
|
||||||
|
|
||||||
leastSquaresVolPointInterpolation pointInterpolation(mesh);
|
leastSquaresVolPointInterpolation pointInterpolation(mesh);
|
||||||
|
@ -31,8 +31,7 @@ if(min(J.internalField()) > 0)
|
||||||
|
|
||||||
pointInterpolation.interpolate(U, pointU);
|
pointInterpolation.interpolate(U, pointU);
|
||||||
|
|
||||||
const vectorField& pointUI =
|
const vectorField& pointUI = pointU.internalField();
|
||||||
pointU.internalField();
|
|
||||||
|
|
||||||
//- Move mesh
|
//- Move mesh
|
||||||
vectorField newPoints = mesh.allPoints();
|
vectorField newPoints = mesh.allPoints();
|
||||||
|
@ -47,10 +46,10 @@ if(min(J.internalField()) > 0)
|
||||||
mesh.movePoints(newPoints);
|
mesh.movePoints(newPoints);
|
||||||
mesh.V00();
|
mesh.V00();
|
||||||
mesh.moving(false);
|
mesh.moving(false);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
FatalErrorIn(args.executable())
|
FatalErrorIn(args.executable())
|
||||||
<< "Negative Jacobian"
|
<< "Negative Jacobian"
|
||||||
<< exit(FatalError);
|
<< exit(FatalError);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
if (runTime.outputTime())
|
if (runTime.outputTime())
|
||||||
{
|
{
|
||||||
volScalarField epsilonEq
|
volScalarField epsilonEq
|
||||||
(
|
(
|
||||||
IOobject
|
IOobject
|
||||||
|
@ -95,10 +95,10 @@ if (runTime.outputTime())
|
||||||
|
|
||||||
//- move mesh for visualisation and move it back after writing
|
//- move mesh for visualisation and move it back after writing
|
||||||
vectorField oldPoints = mesh.allPoints();
|
vectorField oldPoints = mesh.allPoints();
|
||||||
#include "moveMeshLeastSquares.H"
|
# include "moveMeshLeastSquares.H"
|
||||||
|
|
||||||
runTime.write();
|
runTime.write();
|
||||||
|
|
||||||
//- move mesh back
|
//- move mesh back
|
||||||
mesh.movePoints(oldPoints);
|
mesh.movePoints(oldPoints);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,37 +1,37 @@
|
||||||
if(divDSigmaExpMethod == "standard")
|
if(divDSigmaExpMethod == "standard")
|
||||||
{
|
{
|
||||||
divDSigmaExp = fvc::div
|
divDSigmaExp = fvc::div
|
||||||
(
|
(
|
||||||
mu*gradDU.T() + lambda*(I*tr(gradDU)) - (mu + lambda)*gradDU,
|
mu*gradDU.T() + lambda*(I*tr(gradDU)) - (mu + lambda)*gradDU,
|
||||||
"div(sigma)"
|
"div(sigma)"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else if(divDSigmaExpMethod == "surface")
|
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")
|
||||||
{
|
{
|
||||||
surfaceTensorField shearGradDU =
|
surfaceTensorField shearGradDU = ((I - n*n)&fvc::interpolate(gradDU));
|
||||||
((I - n*n)&fvc::interpolate(gradDU));
|
|
||||||
|
|
||||||
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")
|
||||||
{
|
{
|
||||||
divDSigmaExp =
|
divDSigmaExp =
|
||||||
- fvc::laplacian(mu + lambda, DU, "laplacian(DDU,DU)")
|
- fvc::laplacian(mu + lambda, DU, "laplacian(DDU,DU)")
|
||||||
+ fvc::div
|
+ fvc::div
|
||||||
|
@ -40,8 +40,8 @@ if(divDSigmaExpMethod == "standard")
|
||||||
+ lambda*(I*tr(gradDU)),
|
+ lambda*(I*tr(gradDU)),
|
||||||
"div(sigma)"
|
"div(sigma)"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
FatalError << "divDSigmaExp method " << divDSigmaExpMethod << " not found!" << endl;
|
FatalError << "divDSigmaExp method " << divDSigmaExpMethod << " not found!" << endl;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
//- sigma explicit large strain explicit terms
|
//- sigma explicit large strain explicit terms
|
||||||
//----------------------------------------------------//
|
//----------------------------------------------------//
|
||||||
if(divDSigmaLargeStrainExpMethod == "standard")
|
if(divDSigmaLargeStrainExpMethod == "standard")
|
||||||
{
|
{
|
||||||
divDSigmaLargeStrainExp =
|
divDSigmaLargeStrainExp =
|
||||||
fvc::div
|
fvc::div
|
||||||
(
|
(
|
||||||
|
@ -11,9 +11,9 @@ if(divDSigmaLargeStrainExpMethod == "standard")
|
||||||
+ ((sigma + DSigma) & gradDU),
|
+ ((sigma + DSigma) & gradDU),
|
||||||
"div(sigma)"
|
"div(sigma)"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else if(divDSigmaLargeStrainExpMethod == "surface")
|
else if(divDSigmaLargeStrainExpMethod == "surface")
|
||||||
{
|
{
|
||||||
divDSigmaLargeStrainExp =
|
divDSigmaLargeStrainExp =
|
||||||
fvc::div
|
fvc::div
|
||||||
(
|
(
|
||||||
|
@ -21,13 +21,13 @@ if(divDSigmaLargeStrainExpMethod == "standard")
|
||||||
+ 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
|
||||||
{
|
{
|
||||||
FatalError
|
FatalError
|
||||||
<< "divDSigmaLargeStrainMethod not found!"
|
<< "divDSigmaLargeStrainMethod not found!"
|
||||||
<< exit(FatalError);
|
<< exit(FatalError);
|
||||||
}
|
}
|
||||||
|
|
||||||
//- relax
|
//- relax
|
||||||
divDSigmaLargeStrainExp.relax();
|
divDSigmaLargeStrainExp.relax();
|
||||||
|
|
|
@ -69,5 +69,4 @@ FieldField<Field, vector> extraVecs(ptc.size());
|
||||||
|
|
||||||
curExtraVectors.setSize(nFacesAroundPoint);
|
curExtraVectors.setSize(nFacesAroundPoint);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -91,7 +91,8 @@ FieldField<Field, scalar> w(ptc.size());
|
||||||
|
|
||||||
// Update coupled boundaries
|
// Update coupled boundaries
|
||||||
// Work-around for cyclic parallels.
|
// Work-around for cyclic parallels.
|
||||||
/*if (Pstream::parRun() && !mesh.parallelData().cyclicParallel())
|
/*
|
||||||
|
if (Pstream::parRun() && !mesh.parallelData().cyclicParallel())
|
||||||
{
|
{
|
||||||
forAll (volPointSumWeights.boundaryField(), patchI)
|
forAll (volPointSumWeights.boundaryField(), patchI)
|
||||||
{
|
{
|
||||||
|
@ -111,7 +112,8 @@ FieldField<Field, scalar> w(ptc.size());
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}*/
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
// Re-scale the weights for the current point
|
// Re-scale the weights for the current point
|
||||||
forAll (ptc, pointI)
|
forAll (ptc, pointI)
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
if(moveMeshMethod == "inverseDistance")
|
if(moveMeshMethod == "inverseDistance")
|
||||||
{
|
{
|
||||||
# include "moveMeshInverseDistance.H"
|
# include "moveMeshInverseDistance.H"
|
||||||
}
|
}
|
||||||
else if(moveMeshMethod == "leastSquares")
|
else if(moveMeshMethod == "leastSquares")
|
||||||
{
|
{
|
||||||
# include "moveMeshLeastSquares.H"
|
# include "moveMeshLeastSquares.H"
|
||||||
}
|
}
|
||||||
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
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
//- move mesh
|
//- move mesh
|
||||||
//--------------------------------------------------//
|
//--------------------------------------------------//
|
||||||
if(min(J.internalField()) > 0)
|
if(min(J.internalField()) > 0)
|
||||||
{
|
{
|
||||||
Info << "Move solid mesh using inverse distance interpolation" << endl;
|
Info << "Move solid mesh using inverse distance interpolation" << endl;
|
||||||
|
|
||||||
// Create point mesh
|
// Create point mesh
|
||||||
|
@ -36,10 +36,9 @@ if(min(J.internalField()) > 0)
|
||||||
//- correct edge interpolation
|
//- correct edge interpolation
|
||||||
//- this is the stuff from edgeCorrectedVolPointInterpolation but
|
//- this is the stuff from edgeCorrectedVolPointInterpolation but
|
||||||
//- that class no longer works
|
//- that class no longer works
|
||||||
# include "performEdgeCorrectedVolPointInterpolation.H"
|
# include "performEdgeCorrectedVolPointInterpolation.H"
|
||||||
|
|
||||||
const vectorField& pointDUI =
|
const vectorField& pointDUI = pointDU.internalField();
|
||||||
pointDU.internalField();
|
|
||||||
|
|
||||||
//- see the effect of correctBCs
|
//- see the effect of correctBCs
|
||||||
|
|
||||||
|
@ -56,10 +55,10 @@ if(min(J.internalField()) > 0)
|
||||||
mesh.movePoints(newPoints);
|
mesh.movePoints(newPoints);
|
||||||
mesh.V00();
|
mesh.V00();
|
||||||
mesh.moving(false);
|
mesh.moving(false);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
FatalErrorIn(args.executable())
|
FatalErrorIn(args.executable())
|
||||||
<< "Negative Jacobian"
|
<< "Negative Jacobian"
|
||||||
<< exit(FatalError);
|
<< exit(FatalError);
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
//- move mesh
|
//- move mesh
|
||||||
//--------------------------------------------------//
|
//--------------------------------------------------//
|
||||||
if(min(J.internalField()) > 0)
|
if(min(J.internalField()) > 0)
|
||||||
{
|
{
|
||||||
Info << "Moving mesh using least squares interpolation" << endl;
|
Info << "Moving mesh using least squares interpolation" << endl;
|
||||||
|
|
||||||
leastSquaresVolPointInterpolation pointInterpolation(mesh);
|
leastSquaresVolPointInterpolation pointInterpolation(mesh);
|
||||||
|
@ -31,8 +31,7 @@ if(min(J.internalField()) > 0)
|
||||||
|
|
||||||
pointInterpolation.interpolate(DU, pointDU);
|
pointInterpolation.interpolate(DU, pointDU);
|
||||||
|
|
||||||
const vectorField& pointDUI =
|
const vectorField& pointDUI = pointDU.internalField();
|
||||||
pointDU.internalField();
|
|
||||||
|
|
||||||
//- Move mesh
|
//- Move mesh
|
||||||
vectorField newPoints = mesh.allPoints();
|
vectorField newPoints = mesh.allPoints();
|
||||||
|
@ -47,10 +46,10 @@ if(min(J.internalField()) > 0)
|
||||||
mesh.movePoints(newPoints);
|
mesh.movePoints(newPoints);
|
||||||
mesh.V00();
|
mesh.V00();
|
||||||
mesh.moving(false);
|
mesh.moving(false);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
FatalErrorIn(args.executable())
|
FatalErrorIn(args.executable())
|
||||||
<< "Negative Jacobian"
|
<< "Negative Jacobian"
|
||||||
<< exit(FatalError);
|
<< exit(FatalError);
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,8 @@ pointVectorField& pf = pointDU;
|
||||||
|
|
||||||
// Do the correction
|
// Do the correction
|
||||||
//GeometricField<Type, pointPatchField, pointMesh> pfCorr
|
//GeometricField<Type, pointPatchField, pointMesh> pfCorr
|
||||||
/*pointVectorField pfCorr
|
/*
|
||||||
|
pointVectorField pfCorr
|
||||||
(
|
(
|
||||||
IOobject
|
IOobject
|
||||||
(
|
(
|
||||||
|
@ -23,7 +24,8 @@ pointVectorField& pf = pointDU;
|
||||||
//dimensioned<Type>("zero", pf.dimensions(), pTraits<Type>::zero),
|
//dimensioned<Type>("zero", pf.dimensions(), pTraits<Type>::zero),
|
||||||
dimensionedVector("zero", pf.dimensions(), vector::zero),
|
dimensionedVector("zero", pf.dimensions(), vector::zero),
|
||||||
pf.boundaryField().types()
|
pf.boundaryField().types()
|
||||||
);*/
|
);
|
||||||
|
*/
|
||||||
|
|
||||||
pointVectorField pfCorr
|
pointVectorField pfCorr
|
||||||
(
|
(
|
||||||
|
@ -38,7 +40,7 @@ pointVectorField pfCorr
|
||||||
pMesh,
|
pMesh,
|
||||||
dimensionedVector("vector", dimLength, vector::zero),
|
dimensionedVector("vector", dimLength, vector::zero),
|
||||||
"calculated"
|
"calculated"
|
||||||
);
|
);
|
||||||
|
|
||||||
//const labelList& ptc = boundaryPoints();
|
//const labelList& ptc = boundaryPoints();
|
||||||
#include "findBoundaryPoints.H"
|
#include "findBoundaryPoints.H"
|
||||||
|
@ -96,25 +98,29 @@ forAll (ptc, pointI)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update coupled boundaries
|
// Update coupled boundaries
|
||||||
/*forAll (pfCorr.boundaryField(), patchI)
|
/*
|
||||||
|
forAll (pfCorr.boundaryField(), patchI)
|
||||||
{
|
{
|
||||||
if (pfCorr.boundaryField()[patchI].coupled())
|
if (pfCorr.boundaryField()[patchI].coupled())
|
||||||
{
|
{
|
||||||
pfCorr.boundaryField()[patchI].initAddField();
|
pfCorr.boundaryField()[patchI].initAddField();
|
||||||
}
|
}
|
||||||
}*/
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
/*forAll (pfCorr.boundaryField(), patchI)
|
/*
|
||||||
|
forAll (pfCorr.boundaryField(), patchI)
|
||||||
{
|
{
|
||||||
if (pfCorr.boundaryField()[patchI].coupled())
|
if (pfCorr.boundaryField()[patchI].coupled())
|
||||||
{
|
{
|
||||||
pfCorr.boundaryField()[patchI].addField(pfCorr.internalField());
|
pfCorr.boundaryField()[patchI].addField(pfCorr.internalField());
|
||||||
}
|
}
|
||||||
}*/
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
//Info << "pfCorr: " << pfCorr << endl;
|
//Info << "pfCorr: " << pfCorr << endl;
|
||||||
pfCorr.correctBoundaryConditions();
|
pfCorr.correctBoundaryConditions();
|
||||||
|
|
||||||
//pfCorr.write();
|
//pfCorr.write();
|
||||||
|
|
||||||
|
|
|
@ -1,12 +1,15 @@
|
||||||
//- the method used to calculate the explicit component of sigma
|
//- the method used to calculate the explicit component of sigma
|
||||||
word divDSigmaExpMethod(mesh.solutionDict().subDict("stressedFoam").lookup("divDSigmaExp"));
|
word divDSigmaExpMethod(mesh.solutionDict().subDict("stressedFoam").lookup("divDSigmaExp"));
|
||||||
Info << "Calculation of divDSigmaExp method: " << divDSigmaExpMethod << endl;
|
Info << "Calculation of divDSigmaExp method: " << divDSigmaExpMethod << endl;
|
||||||
if(divDSigmaExpMethod != "standard"
|
if
|
||||||
|
(
|
||||||
|
divDSigmaExpMethod != "standard"
|
||||||
&& divDSigmaExpMethod != "surface"
|
&& divDSigmaExpMethod != "surface"
|
||||||
&& divDSigmaExpMethod != "decompose"
|
&& divDSigmaExpMethod != "decompose"
|
||||||
&& divDSigmaExpMethod != "laplacian")
|
&& 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);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
if (runTime.outputTime())
|
if (runTime.outputTime())
|
||||||
{
|
{
|
||||||
volScalarField epsilonEq
|
volScalarField epsilonEq
|
||||||
(
|
(
|
||||||
IOobject
|
IOobject
|
||||||
|
@ -33,4 +33,4 @@ if (runTime.outputTime())
|
||||||
<< endl;
|
<< endl;
|
||||||
|
|
||||||
runTime.write();
|
runTime.write();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,37 +1,37 @@
|
||||||
if(divDSigmaExpMethod == "standard")
|
if(divDSigmaExpMethod == "standard")
|
||||||
{
|
{
|
||||||
divDSigmaExp = fvc::div
|
divDSigmaExp = fvc::div
|
||||||
(
|
(
|
||||||
mu*gradDU.T() + lambda*(I*tr(gradDU)) - (mu + lambda)*gradDU,
|
mu*gradDU.T() + lambda*(I*tr(gradDU)) - (mu + lambda)*gradDU,
|
||||||
"div(sigma)"
|
"div(sigma)"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else if(divDSigmaExpMethod == "surface")
|
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")
|
||||||
{
|
{
|
||||||
surfaceTensorField shearGradDU =
|
surfaceTensorField shearGradDU = ((I - n*n)&fvc::interpolate(gradDU));
|
||||||
((I - n*n)&fvc::interpolate(gradDU));
|
|
||||||
|
|
||||||
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")
|
||||||
{
|
{
|
||||||
divDSigmaExp =
|
divDSigmaExp =
|
||||||
- fvc::laplacian(mu + lambda, DU, "laplacian(DDU,DU)")
|
- fvc::laplacian(mu + lambda, DU, "laplacian(DDU,DU)")
|
||||||
+ fvc::div
|
+ fvc::div
|
||||||
|
@ -40,8 +40,8 @@ if(divDSigmaExpMethod == "standard")
|
||||||
+ lambda*(I*tr(gradDU)),
|
+ lambda*(I*tr(gradDU)),
|
||||||
"div(sigma)"
|
"div(sigma)"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
FatalError << "divDSigmaExp method " << divDSigmaExpMethod << " not found!" << endl;
|
FatalError << "divDSigmaExp method " << divDSigmaExpMethod << " not found!" << endl;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
//- sigma explicit large strain explicit terms
|
//- sigma explicit large strain explicit terms
|
||||||
//----------------------------------------------------//
|
//----------------------------------------------------//
|
||||||
if(divDSigmaLargeStrainExpMethod == "standard")
|
if(divDSigmaLargeStrainExpMethod == "standard")
|
||||||
{
|
{
|
||||||
divDSigmaLargeStrainExp =
|
divDSigmaLargeStrainExp =
|
||||||
fvc::div
|
fvc::div
|
||||||
(
|
(
|
||||||
|
@ -11,9 +11,9 @@ if(divDSigmaLargeStrainExpMethod == "standard")
|
||||||
+ ((sigma + DSigma) & DF.T()),
|
+ ((sigma + DSigma) & DF.T()),
|
||||||
"div(sigma)"
|
"div(sigma)"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else if(divDSigmaLargeStrainExpMethod == "surface")
|
else if(divDSigmaLargeStrainExpMethod == "surface")
|
||||||
{
|
{
|
||||||
divDSigmaLargeStrainExp =
|
divDSigmaLargeStrainExp =
|
||||||
fvc::div
|
fvc::div
|
||||||
(
|
(
|
||||||
|
@ -22,13 +22,13 @@ if(divDSigmaLargeStrainExpMethod == "standard")
|
||||||
+ (mesh.Sf() & fvc::interpolate( sigma & DF.T() ))
|
+ (mesh.Sf() & fvc::interpolate( sigma & DF.T() ))
|
||||||
+ (mesh.Sf() & fvc::interpolate(DSigma & DF.T() ))
|
+ (mesh.Sf() & fvc::interpolate(DSigma & DF.T() ))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
FatalError
|
FatalError
|
||||||
<< "divDSigmaLargeStrainMethod not found!"
|
<< "divDSigmaLargeStrainMethod not found!"
|
||||||
<< exit(FatalError);
|
<< exit(FatalError);
|
||||||
}
|
}
|
||||||
|
|
||||||
//- relax
|
//- relax
|
||||||
divDSigmaLargeStrainExp.relax();
|
divDSigmaLargeStrainExp.relax();
|
||||||
|
|
|
@ -69,5 +69,4 @@ FieldField<Field, vector> extraVecs(ptc.size());
|
||||||
|
|
||||||
curExtraVectors.setSize(nFacesAroundPoint);
|
curExtraVectors.setSize(nFacesAroundPoint);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -91,7 +91,8 @@ FieldField<Field, scalar> w(ptc.size());
|
||||||
|
|
||||||
// Update coupled boundaries
|
// Update coupled boundaries
|
||||||
// Work-around for cyclic parallels.
|
// Work-around for cyclic parallels.
|
||||||
/*if (Pstream::parRun() && !mesh.parallelData().cyclicParallel())
|
/*
|
||||||
|
if (Pstream::parRun() && !mesh.parallelData().cyclicParallel())
|
||||||
{
|
{
|
||||||
forAll (volPointSumWeights.boundaryField(), patchI)
|
forAll (volPointSumWeights.boundaryField(), patchI)
|
||||||
{
|
{
|
||||||
|
@ -111,7 +112,8 @@ FieldField<Field, scalar> w(ptc.size());
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}*/
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
// Re-scale the weights for the current point
|
// Re-scale the weights for the current point
|
||||||
forAll (ptc, pointI)
|
forAll (ptc, pointI)
|
||||||
|
|
|
@ -1,15 +1,15 @@
|
||||||
if(moveMeshMethod == "inverseDistance")
|
if(moveMeshMethod == "inverseDistance")
|
||||||
{
|
{
|
||||||
# include "moveMeshInverseDistance.H"
|
# include "moveMeshInverseDistance.H"
|
||||||
}
|
}
|
||||||
else if(moveMeshMethod == "leastSquares")
|
else if(moveMeshMethod == "leastSquares")
|
||||||
{
|
{
|
||||||
# include "moveMeshLeastSquares.H"
|
# include "moveMeshLeastSquares.H"
|
||||||
}
|
}
|
||||||
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);
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
//- move mesh
|
//- move mesh
|
||||||
//--------------------------------------------------//
|
//--------------------------------------------------//
|
||||||
if(min(J.internalField()) > 0)
|
if(min(J.internalField()) > 0)
|
||||||
{
|
{
|
||||||
Info << "Move solid mesh using inverse distance interpolation" << endl;
|
Info << "Move solid mesh using inverse distance interpolation" << endl;
|
||||||
|
|
||||||
// Create point mesh
|
// Create point mesh
|
||||||
|
@ -41,8 +41,7 @@ if(min(J.internalField()) > 0)
|
||||||
|
|
||||||
//pointDU.write();
|
//pointDU.write();
|
||||||
|
|
||||||
const vectorField& pointDUI =
|
const vectorField& pointDUI = pointDU.internalField();
|
||||||
pointDU.internalField();
|
|
||||||
|
|
||||||
// Move mesh
|
// Move mesh
|
||||||
vectorField newPoints = mesh.allPoints();
|
vectorField newPoints = mesh.allPoints();
|
||||||
|
@ -57,10 +56,10 @@ if(min(J.internalField()) > 0)
|
||||||
mesh.movePoints(newPoints);
|
mesh.movePoints(newPoints);
|
||||||
mesh.V00();
|
mesh.V00();
|
||||||
mesh.moving(false);
|
mesh.moving(false);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
FatalErrorIn(args.executable())
|
FatalErrorIn(args.executable())
|
||||||
<< "Negative Jacobian"
|
<< "Negative Jacobian"
|
||||||
<< exit(FatalError);
|
<< exit(FatalError);
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
//- move mesh
|
//- move mesh
|
||||||
//--------------------------------------------------//
|
//--------------------------------------------------//
|
||||||
if(min(J.internalField()) > 0)
|
if(min(J.internalField()) > 0)
|
||||||
{
|
{
|
||||||
Info << "Moving mesh using least squares interpolation" << endl;
|
Info << "Moving mesh using least squares interpolation" << endl;
|
||||||
|
|
||||||
leastSquaresVolPointInterpolation pointInterpolation(mesh);
|
leastSquaresVolPointInterpolation pointInterpolation(mesh);
|
||||||
|
@ -31,8 +31,7 @@ if(min(J.internalField()) > 0)
|
||||||
|
|
||||||
pointInterpolation.interpolate(DU, pointDU);
|
pointInterpolation.interpolate(DU, pointDU);
|
||||||
|
|
||||||
const vectorField& pointDUI =
|
const vectorField& pointDUI = pointDU.internalField();
|
||||||
pointDU.internalField();
|
|
||||||
|
|
||||||
//- Move mesh
|
//- Move mesh
|
||||||
vectorField newPoints = mesh.allPoints();
|
vectorField newPoints = mesh.allPoints();
|
||||||
|
@ -47,10 +46,10 @@ if(min(J.internalField()) > 0)
|
||||||
mesh.movePoints(newPoints);
|
mesh.movePoints(newPoints);
|
||||||
mesh.V00();
|
mesh.V00();
|
||||||
mesh.moving(false);
|
mesh.moving(false);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
FatalErrorIn(args.executable())
|
FatalErrorIn(args.executable())
|
||||||
<< "Negative Jacobian"
|
<< "Negative Jacobian"
|
||||||
<< exit(FatalError);
|
<< exit(FatalError);
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,8 @@ pointVectorField& pf = pointDU;
|
||||||
|
|
||||||
// Do the correction
|
// Do the correction
|
||||||
//GeometricField<Type, pointPatchField, pointMesh> pfCorr
|
//GeometricField<Type, pointPatchField, pointMesh> pfCorr
|
||||||
/*pointVectorField pfCorr
|
/*
|
||||||
|
pointVectorField pfCorr
|
||||||
(
|
(
|
||||||
IOobject
|
IOobject
|
||||||
(
|
(
|
||||||
|
@ -23,7 +24,8 @@ pointVectorField& pf = pointDU;
|
||||||
//dimensioned<Type>("zero", pf.dimensions(), pTraits<Type>::zero),
|
//dimensioned<Type>("zero", pf.dimensions(), pTraits<Type>::zero),
|
||||||
dimensionedVector("zero", pf.dimensions(), vector::zero),
|
dimensionedVector("zero", pf.dimensions(), vector::zero),
|
||||||
pf.boundaryField().types()
|
pf.boundaryField().types()
|
||||||
);*/
|
);
|
||||||
|
*/
|
||||||
|
|
||||||
pointVectorField pfCorr
|
pointVectorField pfCorr
|
||||||
(
|
(
|
||||||
|
@ -38,7 +40,7 @@ pointVectorField pfCorr
|
||||||
pMesh,
|
pMesh,
|
||||||
dimensionedVector("vector", dimLength, vector::zero),
|
dimensionedVector("vector", dimLength, vector::zero),
|
||||||
"calculated"
|
"calculated"
|
||||||
);
|
);
|
||||||
|
|
||||||
//const labelList& ptc = boundaryPoints();
|
//const labelList& ptc = boundaryPoints();
|
||||||
#include "findBoundaryPoints.H"
|
#include "findBoundaryPoints.H"
|
||||||
|
@ -96,25 +98,29 @@ forAll (ptc, pointI)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update coupled boundaries
|
// Update coupled boundaries
|
||||||
/*forAll (pfCorr.boundaryField(), patchI)
|
/*
|
||||||
|
forAll (pfCorr.boundaryField(), patchI)
|
||||||
{
|
{
|
||||||
if (pfCorr.boundaryField()[patchI].coupled())
|
if (pfCorr.boundaryField()[patchI].coupled())
|
||||||
{
|
{
|
||||||
pfCorr.boundaryField()[patchI].initAddField();
|
pfCorr.boundaryField()[patchI].initAddField();
|
||||||
}
|
}
|
||||||
}*/
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
/*forAll (pfCorr.boundaryField(), patchI)
|
/*
|
||||||
|
forAll (pfCorr.boundaryField(), patchI)
|
||||||
{
|
{
|
||||||
if (pfCorr.boundaryField()[patchI].coupled())
|
if (pfCorr.boundaryField()[patchI].coupled())
|
||||||
{
|
{
|
||||||
pfCorr.boundaryField()[patchI].addField(pfCorr.internalField());
|
pfCorr.boundaryField()[patchI].addField(pfCorr.internalField());
|
||||||
}
|
}
|
||||||
}*/
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
//Info << "pfCorr: " << pfCorr << endl;
|
//Info << "pfCorr: " << pfCorr << endl;
|
||||||
pfCorr.correctBoundaryConditions();
|
pfCorr.correctBoundaryConditions();
|
||||||
|
|
||||||
//pfCorr.write();
|
//pfCorr.write();
|
||||||
|
|
||||||
|
|
|
@ -1,12 +1,15 @@
|
||||||
//- the method used to calculate the explicit component of sigma
|
//- the method used to calculate the explicit component of sigma
|
||||||
word divDSigmaExpMethod(mesh.solutionDict().subDict("stressedFoam").lookup("divDSigmaExp"));
|
word divDSigmaExpMethod(mesh.solutionDict().subDict("stressedFoam").lookup("divDSigmaExp"));
|
||||||
Info << "Calculation of divDSigmaExp method: " << divDSigmaExpMethod << endl;
|
Info << "Calculation of divDSigmaExp method: " << divDSigmaExpMethod << endl;
|
||||||
if(divDSigmaExpMethod != "standard"
|
if
|
||||||
|
(
|
||||||
|
divDSigmaExpMethod != "standard"
|
||||||
&& divDSigmaExpMethod != "surface"
|
&& divDSigmaExpMethod != "surface"
|
||||||
&& divDSigmaExpMethod != "decompose"
|
&& divDSigmaExpMethod != "decompose"
|
||||||
&& divDSigmaExpMethod != "laplacian")
|
&& 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);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
if (runTime.outputTime())
|
if (runTime.outputTime())
|
||||||
{
|
{
|
||||||
volScalarField epsilonEq
|
volScalarField epsilonEq
|
||||||
(
|
(
|
||||||
IOobject
|
IOobject
|
||||||
|
@ -53,4 +53,4 @@ if (runTime.outputTime())
|
||||||
<< endl;
|
<< endl;
|
||||||
|
|
||||||
runTime.write();
|
runTime.write();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,37 +1,37 @@
|
||||||
if(divDSigmaExpMethod == "standard")
|
if(divDSigmaExpMethod == "standard")
|
||||||
{
|
{
|
||||||
divDSigmaExp = fvc::div
|
divDSigmaExp = fvc::div
|
||||||
(
|
(
|
||||||
mu*gradDU.T() + lambda*(I*tr(gradDU)) - (mu + lambda)*gradDU,
|
mu*gradDU.T() + lambda*(I*tr(gradDU)) - (mu + lambda)*gradDU,
|
||||||
"div(sigma)"
|
"div(sigma)"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else if(divDSigmaExpMethod == "surface")
|
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")
|
||||||
{
|
{
|
||||||
surfaceTensorField shearGradU =
|
surfaceTensorField shearGradU = ((I - n*n)&fvc::interpolate(gradDU));
|
||||||
((I - n*n)&fvc::interpolate(gradDU));
|
|
||||||
|
|
||||||
divDSigmaExp = fvc::div
|
divDSigmaExp = fvc::div
|
||||||
(
|
(
|
||||||
mesh.magSf()
|
mesh.magSf()
|
||||||
*(
|
*
|
||||||
|
(
|
||||||
- (muf + lambdaf)*(fvc::snGrad(U)&(I - n*n))
|
- (muf + lambdaf)*(fvc::snGrad(U)&(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(divDSigmaExpMethod == "expLaplacian")
|
else if(divDSigmaExpMethod == "expLaplacian")
|
||||||
{
|
{
|
||||||
divDSigmaExp =
|
divDSigmaExp =
|
||||||
- fvc::laplacian(mu + lambda, U, "laplacian(DU,U)")
|
- fvc::laplacian(mu + lambda, U, "laplacian(DU,U)")
|
||||||
+ fvc::div
|
+ fvc::div
|
||||||
|
@ -40,8 +40,8 @@ if(divDSigmaExpMethod == "standard")
|
||||||
+ lambda*(I*tr(gradDU)),
|
+ lambda*(I*tr(gradDU)),
|
||||||
"div(sigma)"
|
"div(sigma)"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
FatalError << "divDSigmaExp method " << divDSigmaExpMethod << " not found!" << endl;
|
FatalError << "divDSigmaExp method " << divDSigmaExpMethod << " not found!" << endl;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,15 @@
|
||||||
//- how explicit component of sigma is to be calculated
|
//- how explicit component of sigma is to be calculated
|
||||||
word divDSigmaExpMethod(mesh.solutionDict().subDict("stressedFoam").lookup("divDSigmaExp"));
|
word divDSigmaExpMethod(mesh.solutionDict().subDict("stressedFoam").lookup("divDSigmaExp"));
|
||||||
Info << "Selecting divDSigmaExp calculation method " << divDSigmaExpMethod << endl;
|
Info << "Selecting divDSigmaExp calculation method " << divDSigmaExpMethod << endl;
|
||||||
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);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
if (runTime.outputTime())
|
if (runTime.outputTime())
|
||||||
{
|
{
|
||||||
volScalarField epsilonEq
|
volScalarField epsilonEq
|
||||||
(
|
(
|
||||||
IOobject
|
IOobject
|
||||||
|
@ -53,4 +53,4 @@ if (runTime.outputTime())
|
||||||
<< endl;
|
<< endl;
|
||||||
|
|
||||||
runTime.write();
|
runTime.write();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,37 +1,37 @@
|
||||||
if(divSigmaExpMethod == "standard")
|
if(divSigmaExpMethod == "standard")
|
||||||
{
|
{
|
||||||
divSigmaExp = fvc::div
|
divSigmaExp = fvc::div
|
||||||
(
|
(
|
||||||
mu*gradU.T() + lambda*(I*tr(gradU)) - (mu + lambda)*gradU,
|
mu*gradU.T() + lambda*(I*tr(gradU)) - (mu + lambda)*gradU,
|
||||||
"div(sigma)"
|
"div(sigma)"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else if(divSigmaExpMethod == "surface")
|
else if(divSigmaExpMethod == "surface")
|
||||||
{
|
{
|
||||||
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")
|
||||||
{
|
{
|
||||||
surfaceTensorField shearGradU =
|
surfaceTensorField shearGradU = ((I - n*n)&fvc::interpolate(gradU));
|
||||||
((I - n*n)&fvc::interpolate(gradU));
|
|
||||||
|
|
||||||
divSigmaExp = fvc::div
|
divSigmaExp = fvc::div
|
||||||
(
|
(
|
||||||
mesh.magSf()
|
mesh.magSf()
|
||||||
*(
|
*
|
||||||
|
(
|
||||||
- (muf + lambdaf)*(fvc::snGrad(U)&(I - n*n))
|
- (muf + lambdaf)*(fvc::snGrad(U)&(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")
|
||||||
{
|
{
|
||||||
divSigmaExp =
|
divSigmaExp =
|
||||||
- fvc::laplacian(mu + lambda, U, "laplacian(DU,U)")
|
- fvc::laplacian(mu + lambda, U, "laplacian(DU,U)")
|
||||||
+ fvc::div
|
+ fvc::div
|
||||||
|
@ -40,8 +40,8 @@ if(divSigmaExpMethod == "standard")
|
||||||
+ lambda*(I*tr(gradU)),
|
+ lambda*(I*tr(gradU)),
|
||||||
"div(sigma)"
|
"div(sigma)"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
FatalError << "divSigmaExp method " << divSigmaExpMethod << " not found!" << endl;
|
FatalError << "divSigmaExp method " << divSigmaExpMethod << " not found!" << endl;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
if (runTime.outputTime())
|
if (runTime.outputTime())
|
||||||
{
|
{
|
||||||
volScalarField epsilonEq
|
volScalarField epsilonEq
|
||||||
(
|
(
|
||||||
IOobject
|
IOobject
|
||||||
|
@ -33,4 +33,4 @@ if (runTime.outputTime())
|
||||||
<< endl;
|
<< endl;
|
||||||
|
|
||||||
runTime.write();
|
runTime.write();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,37 +1,37 @@
|
||||||
if(sigmaExpMethod == "standard")
|
if(sigmaExpMethod == "standard")
|
||||||
{
|
{
|
||||||
sigmaExp = fvc::div
|
sigmaExp = fvc::div
|
||||||
(
|
(
|
||||||
mu*gradU.T() + lambda*(I*tr(gradU)) - (mu + lambda)*gradU,
|
mu*gradU.T() + lambda*(I*tr(gradU)) - (mu + lambda)*gradU,
|
||||||
"div(sigma)"
|
"div(sigma)"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else if(sigmaExpMethod == "surface")
|
else if(sigmaExpMethod == "surface")
|
||||||
{
|
{
|
||||||
sigmaExp = fvc::div
|
sigmaExp = 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(sigmaExpMethod == "decompose")
|
else if(sigmaExpMethod == "decompose")
|
||||||
{
|
{
|
||||||
surfaceTensorField shearGradU =
|
surfaceTensorField shearGradU = ((I - n*n)&fvc::interpolate(gradU));
|
||||||
((I - n*n)&fvc::interpolate(gradU));
|
|
||||||
|
|
||||||
sigmaExp = fvc::div
|
sigmaExp = fvc::div
|
||||||
(
|
(
|
||||||
mesh.magSf()
|
mesh.magSf()
|
||||||
*(
|
*
|
||||||
|
(
|
||||||
- (muf + lambdaf)*(fvc::snGrad(U)&(I - n*n))
|
- (muf + lambdaf)*(fvc::snGrad(U)&(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(sigmaExpMethod == "expLaplacian")
|
else if(sigmaExpMethod == "expLaplacian")
|
||||||
{
|
{
|
||||||
sigmaExp =
|
sigmaExp =
|
||||||
- fvc::laplacian(mu + lambda, U, "laplacian(DU,U)")
|
- fvc::laplacian(mu + lambda, U, "laplacian(DU,U)")
|
||||||
+ fvc::div
|
+ fvc::div
|
||||||
|
@ -40,8 +40,8 @@ if(sigmaExpMethod == "standard")
|
||||||
+ lambda*(I*tr(gradU)),
|
+ lambda*(I*tr(gradU)),
|
||||||
"div(sigma)"
|
"div(sigma)"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
FatalError << "sigmaExp method " << sigmaExpMethod << " not found!" << endl;
|
FatalError << "sigmaExp method " << sigmaExpMethod << " not found!" << endl;
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,7 +13,8 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
//- update patch
|
//- update patch
|
||||||
if(
|
if
|
||||||
|
(
|
||||||
U.boundaryField()[patchID].type()
|
U.boundaryField()[patchID].type()
|
||||||
== fixedValueFvPatchVectorField::typeName
|
== fixedValueFvPatchVectorField::typeName
|
||||||
)
|
)
|
||||||
|
@ -27,7 +28,6 @@
|
||||||
<< " to " << disp
|
<< " to " << disp
|
||||||
<< endl;
|
<< endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
SeriousError << "Loading Patch " << patchName << " is type "
|
SeriousError << "Loading Patch " << patchName << " is type "
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
if (runTime.outputTime())
|
if (runTime.outputTime())
|
||||||
{
|
{
|
||||||
volScalarField epsilonEq
|
volScalarField epsilonEq
|
||||||
(
|
(
|
||||||
IOobject
|
IOobject
|
||||||
|
@ -33,4 +33,4 @@ if (runTime.outputTime())
|
||||||
<< endl;
|
<< endl;
|
||||||
|
|
||||||
runTime.write();
|
runTime.write();
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,16 +4,16 @@ label plateID = mesh.boundaryMesh().findPatchID("plate");
|
||||||
label cylinderID = mesh.boundaryMesh().findPatchID("cylinder");
|
label cylinderID = mesh.boundaryMesh().findPatchID("cylinder");
|
||||||
|
|
||||||
if(plateID == -1 || cylinderID == -1)
|
if(plateID == -1 || cylinderID == -1)
|
||||||
{
|
{
|
||||||
FatalError << "\n Cannot find the plate patch or the cylinder"
|
FatalError << "\n Cannot find the plate patch or the cylinder"
|
||||||
<< " patch to calculate lift and drag!"
|
<< " patch to calculate lift and drag!"
|
||||||
<< exit(FatalError);
|
<< exit(FatalError);
|
||||||
}
|
}
|
||||||
|
|
||||||
scalar lift = 0;
|
scalar lift = 0;
|
||||||
scalar drag = 0;
|
scalar drag = 0;
|
||||||
|
|
||||||
const vectorField& Sfp = mesh.boundary()[plateID].Sf();
|
const vectorField& Sfp = mesh.boundary()[plateID].Sf();
|
||||||
forAll(p.boundaryField()[plateID], facei)
|
forAll(p.boundaryField()[plateID], facei)
|
||||||
{
|
{
|
||||||
vector faceForce = p.boundaryField()[plateID][facei] * Sfp[facei];
|
vector faceForce = p.boundaryField()[plateID][facei] * Sfp[facei];
|
||||||
|
@ -21,7 +21,7 @@ forAll(p.boundaryField()[plateID], facei)
|
||||||
drag += vector(1,0,0) & faceForce;
|
drag += vector(1,0,0) & faceForce;
|
||||||
}
|
}
|
||||||
|
|
||||||
const vectorField& Sfc = mesh.boundary()[cylinderID].Sf();
|
const vectorField& Sfc = mesh.boundary()[cylinderID].Sf();
|
||||||
forAll(p.boundaryField()[cylinderID], facei)
|
forAll(p.boundaryField()[cylinderID], facei)
|
||||||
{
|
{
|
||||||
vector faceForce = p.boundaryField()[cylinderID][facei] * Sfc[facei];
|
vector faceForce = p.boundaryField()[cylinderID][facei] * Sfc[facei];
|
||||||
|
@ -29,9 +29,9 @@ forAll(p.boundaryField()[cylinderID], facei)
|
||||||
drag += vector(1,0,0) & faceForce;
|
drag += vector(1,0,0) & faceForce;
|
||||||
}
|
}
|
||||||
|
|
||||||
scalar width = 0.050668;
|
scalar width = 0.050668;
|
||||||
|
|
||||||
Info << "Total lift on the cylinder and plate boundaries is " << lift << " N, per unit width is " << (lift/width) << " N\n"
|
Info << "Total lift on the cylinder and plate boundaries is " << lift << " N, per unit width is " << (lift/width) << " N\n"
|
||||||
<< "Total drag on the cylinder and plate boundaries is " << drag << " N, per unit width is " << (drag/width) << " N\n"
|
<< "Total drag on the cylinder and plate boundaries is " << drag << " N, per unit width is " << (drag/width) << " N\n"
|
||||||
<< endl;
|
<< endl;
|
||||||
}
|
}
|
||||||
|
|
|
@ -131,12 +131,12 @@ int main(int argc, char *argv[])
|
||||||
|
|
||||||
# include "rotateSolidFields.H"
|
# include "rotateSolidFields.H"
|
||||||
|
|
||||||
//# include "moveSolidMesh.H"
|
//# include "moveSolidMesh.H"
|
||||||
# include "moveSolidMeshLeastSquares.H"
|
# include "moveSolidMeshLeastSquares.H"
|
||||||
|
|
||||||
# include "calculateStress.H"
|
# include "calculateStress.H"
|
||||||
|
|
||||||
//# include "calculateLiftAndDrag.H"
|
//# include "calculateLiftAndDrag.H"
|
||||||
|
|
||||||
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
|
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
|
||||||
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
|
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
//- move mesh
|
//- move mesh
|
||||||
//--------------------------------------------------//
|
//--------------------------------------------------//
|
||||||
if(min(J.internalField()) > 0)
|
if(min(J.internalField()) > 0)
|
||||||
{
|
{
|
||||||
Info << "Moving mesh using least squares interpolation" << endl;
|
Info << "Moving mesh using least squares interpolation" << endl;
|
||||||
|
|
||||||
leastSquaresVolPointInterpolation pointInterpolation(stressMesh);
|
leastSquaresVolPointInterpolation pointInterpolation(stressMesh);
|
||||||
|
@ -31,8 +31,7 @@ if(min(J.internalField()) > 0)
|
||||||
|
|
||||||
pointInterpolation.interpolate(DU, pointDU);
|
pointInterpolation.interpolate(DU, pointDU);
|
||||||
|
|
||||||
const vectorField& pointDUI =
|
const vectorField& pointDUI = pointDU.internalField();
|
||||||
pointDU.internalField();
|
|
||||||
|
|
||||||
//- Move mesh
|
//- Move mesh
|
||||||
vectorField newPoints = stressMesh.allPoints();
|
vectorField newPoints = stressMesh.allPoints();
|
||||||
|
@ -53,4 +52,4 @@ if(min(J.internalField()) > 0)
|
||||||
FatalErrorIn(args.executable())
|
FatalErrorIn(args.executable())
|
||||||
<< "Negative Jacobian"
|
<< "Negative Jacobian"
|
||||||
<< exit(FatalError);
|
<< exit(FatalError);
|
||||||
}
|
}
|
||||||
|
|
|
@ -68,23 +68,28 @@ Foam::contactPatchPair::contactPatchPair
|
||||||
// ),
|
// ),
|
||||||
// vectorField(cp_.mesh().boundaryMesh()[slavePatch_.index()].pointNormals().size(), vector::zero)
|
// vectorField(cp_.mesh().boundaryMesh()[slavePatch_.index()].pointNormals().size(), vector::zero)
|
||||||
// ),
|
// ),
|
||||||
slavePointPenetration_(
|
slavePointPenetration_
|
||||||
|
(
|
||||||
cp_.mesh().boundaryMesh()[slavePatch_.index()].pointNormals().size(),
|
cp_.mesh().boundaryMesh()[slavePatch_.index()].pointNormals().size(),
|
||||||
0.0
|
0.0
|
||||||
),
|
),
|
||||||
masterPointPenetration_(
|
masterPointPenetration_
|
||||||
|
(
|
||||||
cp_.mesh().boundaryMesh()[masterPatch_.index()].pointNormals().size(),
|
cp_.mesh().boundaryMesh()[masterPatch_.index()].pointNormals().size(),
|
||||||
0.0
|
0.0
|
||||||
),
|
),
|
||||||
globalSlavePointPenetration_(
|
globalSlavePointPenetration_
|
||||||
|
(
|
||||||
cp_.mesh().pointZones()[cp_.mesh().faceZones().findZoneID(slaveFaceZoneName_)].size(),
|
cp_.mesh().pointZones()[cp_.mesh().faceZones().findZoneID(slaveFaceZoneName_)].size(),
|
||||||
0.0
|
0.0
|
||||||
),
|
),
|
||||||
globalMasterPointPenetration_(
|
globalMasterPointPenetration_
|
||||||
|
(
|
||||||
cp_.mesh().pointZones()[cp_.mesh().faceZones().findZoneID(masterFaceZoneName_)].size(),
|
cp_.mesh().pointZones()[cp_.mesh().faceZones().findZoneID(masterFaceZoneName_)].size(),
|
||||||
0.0
|
0.0
|
||||||
),
|
),
|
||||||
oldTotalSlavePointForce_(
|
oldTotalSlavePointForce_
|
||||||
|
(
|
||||||
cp_.mesh().boundaryMesh()[slavePatch_.index()].pointNormals().size(),
|
cp_.mesh().boundaryMesh()[slavePatch_.index()].pointNormals().size(),
|
||||||
vector::zero
|
vector::zero
|
||||||
),
|
),
|
||||||
|
@ -92,7 +97,8 @@ Foam::contactPatchPair::contactPatchPair
|
||||||
penetrationLimit_(readScalar(dict.lookup("penetrationLimit"))),
|
penetrationLimit_(readScalar(dict.lookup("penetrationLimit"))),
|
||||||
rigidMaster_(dict.lookup("rigidMaster")),
|
rigidMaster_(dict.lookup("rigidMaster")),
|
||||||
interpolationMethod_(dict.lookup("interpolationMethod")),
|
interpolationMethod_(dict.lookup("interpolationMethod")),
|
||||||
faceZoneMasterToSlaveInterpolator_(
|
faceZoneMasterToSlaveInterpolator_
|
||||||
|
(
|
||||||
cp_.mesh().faceZones()[cp_.mesh().faceZones().findZoneID(masterFaceZoneName_)](), // from
|
cp_.mesh().faceZones()[cp_.mesh().faceZones().findZoneID(masterFaceZoneName_)](), // from
|
||||||
cp_.mesh().faceZones()[cp_.mesh().faceZones().findZoneID(slaveFaceZoneName_)](), // to zone
|
cp_.mesh().faceZones()[cp_.mesh().faceZones().findZoneID(slaveFaceZoneName_)](), // to zone
|
||||||
alg_,
|
alg_,
|
||||||
|
|
|
@ -34,7 +34,6 @@ Description
|
||||||
|
|
||||||
void Foam::contactPatchPair::correct()
|
void Foam::contactPatchPair::correct()
|
||||||
{
|
{
|
||||||
|
|
||||||
//---------------------PRELIMINARIES---------------------------------//
|
//---------------------PRELIMINARIES---------------------------------//
|
||||||
const fvMesh& mesh = cp_.mesh();
|
const fvMesh& mesh = cp_.mesh();
|
||||||
const label& masterIndex = masterPatch_.index();
|
const label& masterIndex = masterPatch_.index();
|
||||||
|
@ -42,28 +41,24 @@ void Foam::contactPatchPair::correct()
|
||||||
scalar maxMagSlaveTraction = 0.0;
|
scalar maxMagSlaveTraction = 0.0;
|
||||||
contactIterNum_++;
|
contactIterNum_++;
|
||||||
|
|
||||||
|
|
||||||
//--------CALCULATE MASTER AND SLAVE PENETRATIONS----------------------//
|
//--------CALCULATE MASTER AND SLAVE PENETRATIONS----------------------//
|
||||||
scalarField& globalSlavePointPenetration = globalSlavePointPenetration_;
|
scalarField& globalSlavePointPenetration = globalSlavePointPenetration_;
|
||||||
//scalarField& globalMasterPointPenetration = globalMasterPointPenetration_;
|
//scalarField& globalMasterPointPenetration = globalMasterPointPenetration_;
|
||||||
|
|
||||||
|
|
||||||
//- tell zoneToZone that mesh has moved, so the intersection will be recalculated
|
//- tell zoneToZone that mesh has moved, so the intersection will be recalculated
|
||||||
faceZoneMasterToSlaveInterpolator_.movePoints();
|
faceZoneMasterToSlaveInterpolator_.movePoints();
|
||||||
//- calculate intersection distances
|
//- calculate intersection distances
|
||||||
//- this is the slowest part of the contact correction especially when the slavePatch
|
//- this is the slowest part of the contact correction especially when the slavePatch
|
||||||
//- has many points. parallelisation of this step should be considered.
|
//- has many points. parallelisation of this step should be considered.
|
||||||
globalSlavePointPenetration
|
globalSlavePointPenetration =
|
||||||
= faceZoneMasterToSlaveInterpolator_.pointDistanceToIntersection();
|
faceZoneMasterToSlaveInterpolator_.pointDistanceToIntersection();
|
||||||
|
|
||||||
//globalMasterPointPenetration
|
|
||||||
//= faceZoneSlaveToMasterInterpolator.pointDistanceToIntersection();
|
|
||||||
|
|
||||||
|
//globalMasterPointPenetration =
|
||||||
|
// faceZoneSlaveToMasterInterpolator.pointDistanceToIntersection();
|
||||||
|
|
||||||
scalarField& slavePointPenetration = slavePointPenetration_;
|
scalarField& slavePointPenetration = slavePointPenetration_;
|
||||||
//scalarField& masterPointPenetration = masterPointPenetration_;
|
//scalarField& masterPointPenetration = masterPointPenetration_;
|
||||||
|
|
||||||
|
|
||||||
forAll(slavePointPenetration, pointI)
|
forAll(slavePointPenetration, pointI)
|
||||||
{
|
{
|
||||||
//label pointGlobalLabel = slavePointLabels[pointI];
|
//label pointGlobalLabel = slavePointLabels[pointI];
|
||||||
|
@ -95,8 +90,6 @@ void Foam::contactPatchPair::correct()
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//------CALCULATE SLAVE VERTEX FORCES BASED ON PENETRATION-------------//
|
//------CALCULATE SLAVE VERTEX FORCES BASED ON PENETRATION-------------//
|
||||||
//- approximation of penaltyFactor
|
//- approximation of penaltyFactor
|
||||||
//- this should be automatic, these numbers don't really matter, the scaleFactor
|
//- this should be automatic, these numbers don't really matter, the scaleFactor
|
||||||
|
@ -111,9 +104,9 @@ void Foam::contactPatchPair::correct()
|
||||||
const vectorField& slavePointNormals = mesh.boundaryMesh()[slaveIndex].pointNormals();
|
const vectorField& slavePointNormals = mesh.boundaryMesh()[slaveIndex].pointNormals();
|
||||||
vectorField& totalSlavePointForce = totalSlavePointForce_;
|
vectorField& totalSlavePointForce = totalSlavePointForce_;
|
||||||
|
|
||||||
int numSlaveContactPoints = 0;
|
label numSlaveContactPoints = 0;
|
||||||
int numSlaveContactPointsReducing = 0;
|
label numSlaveContactPointsReducing = 0;
|
||||||
int numSlavesUpdated = 0;
|
label numSlavesUpdated = 0;
|
||||||
|
|
||||||
//- so the procs know the global min
|
//- so the procs know the global min
|
||||||
//scalar minSlavePointPenetration = gMin(slavePointPenetration);
|
//scalar minSlavePointPenetration = gMin(slavePointPenetration);
|
||||||
|
@ -134,7 +127,9 @@ void Foam::contactPatchPair::correct()
|
||||||
numSlavesUpdated++;
|
numSlavesUpdated++;
|
||||||
//- force is linearly dependent on penetration
|
//- force is linearly dependent on penetration
|
||||||
totalSlavePointForce[pointI] +=
|
totalSlavePointForce[pointI] +=
|
||||||
( slavePointNormals[pointI] * penaltyFactor * slavePointPenetration[pointI] );
|
(
|
||||||
|
slavePointNormals[pointI]*penaltyFactor*slavePointPenetration[pointI]
|
||||||
|
);
|
||||||
}
|
}
|
||||||
//- else if point is within contact tolerance then don't add any more force
|
//- else if point is within contact tolerance then don't add any more force
|
||||||
else if(slavePointPenetration[pointI] < 0.0)
|
else if(slavePointPenetration[pointI] < 0.0)
|
||||||
|
@ -151,7 +146,9 @@ void Foam::contactPatchPair::correct()
|
||||||
// point forces must be reduced slowly
|
// point forces must be reduced slowly
|
||||||
|
|
||||||
totalSlavePointForce[pointI] +=
|
totalSlavePointForce[pointI] +=
|
||||||
( slavePointNormals[pointI] * returnPenaltyFactor * slavePointPenetration[pointI] );
|
(
|
||||||
|
slavePointNormals[pointI]*returnPenaltyFactor*slavePointPenetration[pointI]
|
||||||
|
);
|
||||||
|
|
||||||
// if a tensile force develops
|
// if a tensile force develops
|
||||||
if((totalSlavePointForce[pointI] & slavePointNormals[pointI]) > 0.0)
|
if((totalSlavePointForce[pointI] & slavePointNormals[pointI]) > 0.0)
|
||||||
|
@ -185,10 +182,10 @@ void Foam::contactPatchPair::correct()
|
||||||
//- for a deformable master
|
//- for a deformable master
|
||||||
if(!rigidMaster_)
|
if(!rigidMaster_)
|
||||||
{
|
{
|
||||||
const label slaveFaceZoneID
|
const label slaveFaceZoneID =
|
||||||
= mesh.faceZones().findZoneID(slaveFaceZoneName_);
|
mesh.faceZones().findZoneID(slaveFaceZoneName_);
|
||||||
const label slavePatchStart
|
const label slavePatchStart =
|
||||||
= mesh.boundaryMesh()[slaveIndex].start();
|
mesh.boundaryMesh()[slaveIndex].start();
|
||||||
|
|
||||||
scalarField globalSlavePressure
|
scalarField globalSlavePressure
|
||||||
(
|
(
|
||||||
|
@ -231,14 +228,13 @@ void Foam::contactPatchPair::correct()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//- exchange parallel data
|
//- exchange parallel data
|
||||||
reduce(globalMasterPressure, maxOp<scalarField>());
|
reduce(globalMasterPressure, maxOp<scalarField>());
|
||||||
|
|
||||||
//Pout << "The max global master trac is " << max(globalMasterPressure) << endl;
|
//Pout << "The max global master trac is " << max(globalMasterPressure) << endl;
|
||||||
|
|
||||||
const label masterPatchStart
|
const label masterPatchStart =
|
||||||
= mesh.boundaryMesh()[masterIndex].start();
|
mesh.boundaryMesh()[masterIndex].start();
|
||||||
|
|
||||||
scalarField masterPressure(mesh.boundaryMesh()[masterIndex].size(), 0.0);
|
scalarField masterPressure(mesh.boundaryMesh()[masterIndex].size(), 0.0);
|
||||||
|
|
||||||
|
|
|
@ -147,8 +147,6 @@ void contactProblem::correct()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//**********************CONTACT AREA FUNCTION***********************************//
|
//**********************CONTACT AREA FUNCTION***********************************//
|
||||||
tmp<volScalarField> contactProblem::contactArea() const
|
tmp<volScalarField> contactProblem::contactArea() const
|
||||||
{
|
{
|
||||||
|
@ -189,19 +187,19 @@ tmp<volScalarField> contactProblem::contactArea() const
|
||||||
label slaveIndex = contacts[contactI].slavePatch().index();
|
label slaveIndex = contacts[contactI].slavePatch().index();
|
||||||
scalarField masterFrac = contacts[contactI].masterTouchFraction();
|
scalarField masterFrac = contacts[contactI].masterTouchFraction();
|
||||||
scalarField slaveFrac = contacts[contactI].slaveTouchFraction();
|
scalarField slaveFrac = contacts[contactI].slaveTouchFraction();
|
||||||
scalar contactAreaMaster =
|
scalar contactAreaMaster = gSum
|
||||||
gSum
|
|
||||||
(
|
(
|
||||||
masterFrac *
|
masterFrac *
|
||||||
mag(
|
mag
|
||||||
|
(
|
||||||
mesh().Sf().boundaryField()[masterIndex]
|
mesh().Sf().boundaryField()[masterIndex]
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
scalar contactAreaSlave =
|
scalar contactAreaSlave = gSum
|
||||||
gSum
|
|
||||||
(
|
(
|
||||||
slaveFrac *
|
slaveFrac *
|
||||||
mag(
|
mag
|
||||||
|
(
|
||||||
mesh().Sf().boundaryField()[slaveIndex]
|
mesh().Sf().boundaryField()[slaveIndex]
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
@ -275,8 +273,6 @@ void contactProblem::contactPointForce(pointVectorField& cPointForce)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
tmp<volScalarField> contactProblem::contactPressure() const
|
tmp<volScalarField> contactProblem::contactPressure() const
|
||||||
{
|
{
|
||||||
tmp<volScalarField> tcPress
|
tmp<volScalarField> tcPress
|
||||||
|
|
|
@ -317,11 +317,11 @@ void solidTractionFreeFvPatchVectorField::write(Ostream& os) const
|
||||||
|
|
||||||
template<>
|
template<>
|
||||||
const char* Foam::NamedEnum<Foam::solidTractionFreeFvPatchVectorField::nonLinearType, 3>::names[] =
|
const char* Foam::NamedEnum<Foam::solidTractionFreeFvPatchVectorField::nonLinearType, 3>::names[] =
|
||||||
{
|
{
|
||||||
"off",
|
"off",
|
||||||
"updatedLagrangian",
|
"updatedLagrangian",
|
||||||
"totalLagrangian"
|
"totalLagrangian"
|
||||||
};
|
};
|
||||||
|
|
||||||
const Foam::NamedEnum<Foam::solidTractionFreeFvPatchVectorField::nonLinearType, 3>
|
const Foam::NamedEnum<Foam::solidTractionFreeFvPatchVectorField::nonLinearType, 3>
|
||||||
Foam::solidTractionFreeFvPatchVectorField::nonLinearNames_;
|
Foam::solidTractionFreeFvPatchVectorField::nonLinearNames_;
|
||||||
|
|
|
@ -38,8 +38,8 @@ defineTypeNameAndDebug(leastSquaresVolPointInterpolation, 0);
|
||||||
|
|
||||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||||
|
|
||||||
void leastSquaresVolPointInterpolation::calcA(List<scalarSquareMatrix>& A) const
|
void leastSquaresVolPointInterpolation::calcA(List<scalarSquareMatrix>& A) const
|
||||||
{
|
{
|
||||||
//Info << "leastSquaresVolPointInterpolation calcA" << endl;
|
//Info << "leastSquaresVolPointInterpolation calcA" << endl;
|
||||||
|
|
||||||
const fvMesh& mesh = mesh_;
|
const fvMesh& mesh = mesh_;
|
||||||
|
@ -180,11 +180,11 @@ defineTypeNameAndDebug(leastSquaresVolPointInterpolation, 0);
|
||||||
}
|
}
|
||||||
} //- end of else
|
} //- end of else
|
||||||
} //- end of forAll boundary
|
} //- end of forAll boundary
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void leastSquaresVolPointInterpolation::calcB(List<Field<vector> >& B, const GeometricField<vector, fvPatchField, volMesh>& vf) const
|
void leastSquaresVolPointInterpolation::calcB(List<Field<vector> >& B, const GeometricField<vector, fvPatchField, volMesh>& vf) const
|
||||||
{
|
{
|
||||||
//Info << "leastSquaresVolPointInterpolation calcB" << endl;
|
//Info << "leastSquaresVolPointInterpolation calcB" << endl;
|
||||||
|
|
||||||
const fvMesh& mesh = mesh_;
|
const fvMesh& mesh = mesh_;
|
||||||
|
@ -298,15 +298,15 @@ defineTypeNameAndDebug(leastSquaresVolPointInterpolation, 0);
|
||||||
}
|
}
|
||||||
} //- end of forAll boundary
|
} //- end of forAll boundary
|
||||||
} //- end of for all components
|
} //- end of for all components
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void leastSquaresVolPointInterpolation::interpolate
|
void leastSquaresVolPointInterpolation::interpolate
|
||||||
(
|
(
|
||||||
const GeometricField<vector, fvPatchField, volMesh>& vf,
|
const GeometricField<vector, fvPatchField, volMesh>& vf,
|
||||||
GeometricField<vector, pointPatchField, pointMesh>& pf //Field<vector>& pf
|
GeometricField<vector, pointPatchField, pointMesh>& pf //Field<vector>& pf
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
//Info << "Interpolating cell to point using leastSquaresVolPointInterpolation" << endl;
|
//Info << "Interpolating cell to point using leastSquaresVolPointInterpolation" << endl;
|
||||||
|
|
||||||
const fvMesh& mesh = mesh_;
|
const fvMesh& mesh = mesh_;
|
||||||
|
@ -361,19 +361,19 @@ defineTypeNameAndDebug(leastSquaresVolPointInterpolation, 0);
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
leastSquaresVolPointInterpolation::leastSquaresVolPointInterpolation(const fvMesh& vm)
|
leastSquaresVolPointInterpolation::leastSquaresVolPointInterpolation(const fvMesh& vm)
|
||||||
:
|
:
|
||||||
mesh_(vm) //,
|
mesh_(vm) //,
|
||||||
//A_(vm.points().size(), scalarSquareMatrix(4, 0.0)),
|
//A_(vm.points().size(), scalarSquareMatrix(4, 0.0)),
|
||||||
//B_(vm.points().size(), Field<vector>(4, vector::zero))
|
//B_(vm.points().size(), Field<vector>(4, vector::zero))
|
||||||
{
|
{
|
||||||
//calcA();
|
//calcA();
|
||||||
}
|
}
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
leastSquaresVolPointInterpolation::~leastSquaresVolPointInterpolation()
|
leastSquaresVolPointInterpolation::~leastSquaresVolPointInterpolation()
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
|
@ -312,7 +312,6 @@ void plasticityModel::correct()
|
||||||
{
|
{
|
||||||
betaPatch[faceI] = 0;
|
betaPatch[faceI] = 0;
|
||||||
curDEpsEPred = DEpsilonPatch[faceI];
|
curDEpsEPred = DEpsilonPatch[faceI];
|
||||||
|
|
||||||
if
|
if
|
||||||
(
|
(
|
||||||
(DEpsilonEqPatch[faceI] >= 0)
|
(DEpsilonEqPatch[faceI] >= 0)
|
||||||
|
@ -448,7 +447,6 @@ void plasticityModel::updateYieldStress()
|
||||||
|
|
||||||
bool plasticityModel::read()
|
bool plasticityModel::read()
|
||||||
{
|
{
|
||||||
|
|
||||||
if (regIOobject::read())
|
if (regIOobject::read())
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -37,13 +37,15 @@ solvers
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* U
|
/*
|
||||||
|
U
|
||||||
{
|
{
|
||||||
solver PCG;
|
solver PCG;
|
||||||
preconditioner DIC;
|
preconditioner DIC;
|
||||||
tolerance 1e-09;
|
tolerance 1e-09;
|
||||||
relTol 0.99;
|
relTol 0.99;
|
||||||
}*/
|
}
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
stressedFoam
|
stressedFoam
|
||||||
|
|
|
@ -31,7 +31,6 @@ boundaryField
|
||||||
|
|
||||||
cohesive
|
cohesive
|
||||||
{
|
{
|
||||||
|
|
||||||
type cohesiveZone;
|
type cohesiveZone;
|
||||||
cohesiveLaw Dugdale;
|
cohesiveLaw Dugdale;
|
||||||
relaxationFactor 0.9;
|
relaxationFactor 0.9;
|
||||||
|
|
|
@ -273,6 +273,7 @@ int main(int argc, char *argv[])
|
||||||
mesh,
|
mesh,
|
||||||
dimensionedScalar("zero", dimless, 0.0)
|
dimensionedScalar("zero", dimless, 0.0)
|
||||||
);
|
);
|
||||||
|
|
||||||
forAll(theta.internalField(), celli)
|
forAll(theta.internalField(), celli)
|
||||||
{
|
{
|
||||||
const scalar& x = mesh.C().internalField()[celli][vector::X];
|
const scalar& x = mesh.C().internalField()[celli][vector::X];
|
||||||
|
@ -311,9 +312,12 @@ int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
const scalar& t = theta.internalField()[celli];
|
const scalar& t = theta.internalField()[celli];
|
||||||
|
|
||||||
rotMat.internalField()[celli] = tensor(::cos(t), ::sin(t), 0,
|
rotMat.internalField()[celli] = tensor
|
||||||
|
(
|
||||||
|
::cos(t), ::sin(t), 0,
|
||||||
-::sin(t), ::cos(t), 0,
|
-::sin(t), ::cos(t), 0,
|
||||||
0, 0, 1);
|
0, 0, 1
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
forAll(rotMat.boundaryField(), patchi)
|
forAll(rotMat.boundaryField(), patchi)
|
||||||
|
@ -322,9 +326,12 @@ int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
const scalar& t = theta.boundaryField()[patchi][facei];
|
const scalar& t = theta.boundaryField()[patchi][facei];
|
||||||
|
|
||||||
rotMat.boundaryField()[patchi][facei] = tensor(::cos(t), ::sin(t), 0,
|
rotMat.boundaryField()[patchi][facei] = tensor
|
||||||
|
(
|
||||||
|
::cos(t), ::sin(t), 0,
|
||||||
-::sin(t), ::cos(t), 0,
|
-::sin(t), ::cos(t), 0,
|
||||||
0, 0, 1);
|
0, 0, 1
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -350,18 +357,16 @@ int main(int argc, char *argv[])
|
||||||
|
|
||||||
const tensor& rot = rotMat.internalField()[celli];
|
const tensor& rot = rotMat.internalField()[celli];
|
||||||
|
|
||||||
symmTensor sigmaCart(r, 0, 0,
|
symmTensor sigmaCart(r, 0, 0, t, 0, z);
|
||||||
t, 0,
|
|
||||||
z);
|
|
||||||
|
|
||||||
sigma.internalField()[celli] =
|
sigma.internalField()[celli] =
|
||||||
symm(rot.T() & sigmaCart & rot);
|
symm(rot.T() & sigmaCart & rot);
|
||||||
|
|
||||||
//-for general 2-D plain strain problems, the axial stress is given by this:
|
//-for general 2-D plain strain problems, the axial stress is given by this:
|
||||||
//- (which is not equal to the solution by Timoshenko... hmmmnn)
|
//- (which is not equal to the solution by Timoshenko... hmmmnn)
|
||||||
// sigma.internalField()[celli][symmTensor::ZZ] =
|
// sigma.internalField()[celli][symmTensor::ZZ] =
|
||||||
// 0.3*(sigma.internalField()[celli][symmTensor::XX] + sigma.internalField()[celli][symmTensor::YY])
|
// 0.3*(sigma.internalField()[celli][symmTensor::XX] + sigma.internalField()[celli][symmTensor::YY])
|
||||||
// - E*alpha*(T.internalField()[celli]);
|
// - E*alpha*(T.internalField()[celli]);
|
||||||
}
|
}
|
||||||
|
|
||||||
forAll(sigma.boundaryField(), patchi)
|
forAll(sigma.boundaryField(), patchi)
|
||||||
|
@ -374,16 +379,12 @@ int main(int argc, char *argv[])
|
||||||
|
|
||||||
const tensor& rot = rotMat.boundaryField()[patchi][facei];
|
const tensor& rot = rotMat.boundaryField()[patchi][facei];
|
||||||
|
|
||||||
symmTensor sigmaCart(r, 0, 0,
|
symmTensor sigmaCart(r, 0, 0, t, 0, z);
|
||||||
t, 0,
|
|
||||||
z);
|
|
||||||
sigma.boundaryField()[patchi][facei] =
|
sigma.boundaryField()[patchi][facei] =
|
||||||
symm(rot.T() & sigmaCart & rot);
|
symm(rot.T() & sigmaCart & rot);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Info << "\nWriting analytical sigma tensor" << endl;
|
Info << "\nWriting analytical sigma tensor" << endl;
|
||||||
sigma.write();
|
sigma.write();
|
||||||
|
|
||||||
|
|
|
@ -110,14 +110,10 @@ int main(int argc, char *argv[])
|
||||||
label refFace = cells[celli][0];
|
label refFace = cells[celli][0];
|
||||||
|
|
||||||
//- insert first four abaqusCellPoints
|
//- insert first four abaqusCellPoints
|
||||||
abaqusCellPoints[celli][0]
|
abaqusCellPoints[celli][0] = (faces[refFace][3] + 1);
|
||||||
= (faces[refFace][3] + 1);
|
abaqusCellPoints[celli][1] = (faces[refFace][2] + 1);
|
||||||
abaqusCellPoints[celli][1]
|
abaqusCellPoints[celli][2] = (faces[refFace][1] + 1);
|
||||||
= (faces[refFace][2] + 1);
|
abaqusCellPoints[celli][3] = (faces[refFace][0] + 1);
|
||||||
abaqusCellPoints[celli][2]
|
|
||||||
= (faces[refFace][1] + 1);
|
|
||||||
abaqusCellPoints[celli][3]
|
|
||||||
= (faces[refFace][0] + 1);
|
|
||||||
|
|
||||||
//- now find the opposite face in the cell
|
//- now find the opposite face in the cell
|
||||||
//Info << "Finding oppFace" << endl << endl;
|
//Info << "Finding oppFace" << endl << endl;
|
||||||
|
@ -181,29 +177,25 @@ int main(int argc, char *argv[])
|
||||||
label globalPpi = oppFacePPs[oppFacePointi];
|
label globalPpi = oppFacePPs[oppFacePointi];
|
||||||
if(globalPpi == faces[refFace][0])
|
if(globalPpi == faces[refFace][0])
|
||||||
{
|
{
|
||||||
abaqusCellPoints[celli][7]
|
abaqusCellPoints[celli][7] = globalPointi + 1;
|
||||||
= globalPointi + 1;
|
|
||||||
ppFound = true;
|
ppFound = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
else if(globalPpi == faces[refFace][1])
|
else if(globalPpi == faces[refFace][1])
|
||||||
{
|
{
|
||||||
abaqusCellPoints[celli][6]
|
abaqusCellPoints[celli][6] = globalPointi + 1;
|
||||||
= globalPointi + 1;
|
|
||||||
ppFound = true;
|
ppFound = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
else if(globalPpi == faces[refFace][2])
|
else if(globalPpi == faces[refFace][2])
|
||||||
{
|
{
|
||||||
abaqusCellPoints[celli][5]
|
abaqusCellPoints[celli][5] = globalPointi + 1;
|
||||||
= globalPointi + 1;
|
|
||||||
ppFound = true;
|
ppFound = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
else if(globalPpi == faces[refFace][3])
|
else if(globalPpi == faces[refFace][3])
|
||||||
{
|
{
|
||||||
abaqusCellPoints[celli][4]
|
abaqusCellPoints[celli][4] = globalPointi + 1;
|
||||||
= globalPointi + 1;
|
|
||||||
ppFound = true;
|
ppFound = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -78,4 +78,3 @@
|
||||||
|
|
||||||
DSigmaCorr -= sigma;
|
DSigmaCorr -= sigma;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -110,7 +110,6 @@ int main(int argc, char *argv[])
|
||||||
gradDU = fvc::grad(DU);
|
gradDU = fvc::grad(DU);
|
||||||
|
|
||||||
# include "calculateDEpsilonDSigma.H"
|
# include "calculateDEpsilonDSigma.H"
|
||||||
|
|
||||||
}
|
}
|
||||||
while
|
while
|
||||||
(
|
(
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
if (runTime.outputTime())
|
if (runTime.outputTime())
|
||||||
{
|
{
|
||||||
volScalarField epsilonEq
|
volScalarField epsilonEq
|
||||||
(
|
(
|
||||||
IOobject
|
IOobject
|
||||||
|
@ -53,4 +53,4 @@ if (runTime.outputTime())
|
||||||
<< endl;
|
<< endl;
|
||||||
|
|
||||||
runTime.write();
|
runTime.write();
|
||||||
}
|
}
|
||||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -126,16 +126,14 @@ Foam::tmp<Foam::scalarField> Foam::cellQuality::skewness() const
|
||||||
|
|
||||||
forAll (nei, faceI)
|
forAll (nei, faceI)
|
||||||
{
|
{
|
||||||
scalar dOwn =
|
scalar dOwn = mag
|
||||||
mag
|
|
||||||
(
|
(
|
||||||
(faceCtrs[faceI] - cellCtrs[own[faceI]])
|
(faceCtrs[faceI] - cellCtrs[own[faceI]])
|
||||||
&areas[faceI]
|
&areas[faceI]
|
||||||
)
|
)
|
||||||
/mag(areas[faceI]);
|
/mag(areas[faceI]);
|
||||||
|
|
||||||
scalar dNei =
|
scalar dNei = mag
|
||||||
mag
|
|
||||||
(
|
(
|
||||||
(cellCtrs[nei[faceI]] - faceCtrs[faceI])
|
(cellCtrs[nei[faceI]] - faceCtrs[faceI])
|
||||||
&areas[faceI]
|
&areas[faceI]
|
||||||
|
@ -176,8 +174,8 @@ Foam::tmp<Foam::scalarField> Foam::cellQuality::skewness() const
|
||||||
+ ((faceCentres[faceI] - cellCtrs[faceCells[faceI]])&n)*n;
|
+ ((faceCentres[faceI] - cellCtrs[faceCells[faceI]])&n)*n;
|
||||||
|
|
||||||
scalar skewness =
|
scalar skewness =
|
||||||
mag(faceCentres[faceI] - faceIntersection)/
|
mag(faceCentres[faceI] - faceIntersection)
|
||||||
(
|
/(
|
||||||
mag(faceCentres[faceI] - cellCtrs[faceCells[faceI]])
|
mag(faceCentres[faceI] - cellCtrs[faceCells[faceI]])
|
||||||
+ VSMALL
|
+ VSMALL
|
||||||
);
|
);
|
||||||
|
@ -273,16 +271,14 @@ Foam::tmp<Foam::scalarField> Foam::cellQuality::faceSkewness() const
|
||||||
|
|
||||||
forAll (nei, faceI)
|
forAll (nei, faceI)
|
||||||
{
|
{
|
||||||
scalar dOwn =
|
scalar dOwn = mag
|
||||||
mag
|
|
||||||
(
|
(
|
||||||
(faceCtrs[faceI] - cellCtrs[own[faceI]])
|
(faceCtrs[faceI] - cellCtrs[own[faceI]])
|
||||||
&areas[faceI]
|
&areas[faceI]
|
||||||
)
|
)
|
||||||
/mag(areas[faceI]);
|
/mag(areas[faceI]);
|
||||||
|
|
||||||
scalar dNei =
|
scalar dNei = mag
|
||||||
mag
|
|
||||||
(
|
(
|
||||||
(cellCtrs[nei[faceI]] - faceCtrs[faceI])
|
(cellCtrs[nei[faceI]] - faceCtrs[faceI])
|
||||||
&areas[faceI]
|
&areas[faceI]
|
||||||
|
@ -322,8 +318,8 @@ Foam::tmp<Foam::scalarField> Foam::cellQuality::faceSkewness() const
|
||||||
+ ((faceCentres[faceI] - cellCtrs[faceCells[faceI]])&n)*n;
|
+ ((faceCentres[faceI] - cellCtrs[faceCells[faceI]])&n)*n;
|
||||||
|
|
||||||
result[globalFaceI++] =
|
result[globalFaceI++] =
|
||||||
mag(faceCentres[faceI] - faceIntersection)/
|
mag(faceCentres[faceI] - faceIntersection)
|
||||||
(
|
/(
|
||||||
mag(faceCentres[faceI] - cellCtrs[faceCells[faceI]])
|
mag(faceCentres[faceI] - cellCtrs[faceCells[faceI]])
|
||||||
+ VSMALL
|
+ VSMALL
|
||||||
);
|
);
|
||||||
|
|
|
@ -38,8 +38,8 @@ namespace Foam
|
||||||
{
|
{
|
||||||
|
|
||||||
// Temporary hack: useful for tracking balance of phi across interface
|
// Temporary hack: useful for tracking balance of phi across interface
|
||||||
void
|
void traceMixingPlaneFlux
|
||||||
traceMixingPlaneFlux(
|
(
|
||||||
volVectorField& U,
|
volVectorField& U,
|
||||||
surfaceScalarField& phi,
|
surfaceScalarField& phi,
|
||||||
scalar& masterPatchScaleFactor,
|
scalar& masterPatchScaleFactor,
|
||||||
|
@ -93,12 +93,9 @@ traceMixingPlaneFlux(
|
||||||
<< mag(phiFromU - shadowPhiFromU)/(phiFromU + SMALL)*100
|
<< mag(phiFromU - shadowPhiFromU)/(phiFromU + SMALL)*100
|
||||||
<< " %"
|
<< " %"
|
||||||
<< endl;
|
<< endl;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
../linux64Gcc/mplibSYSTEMOPENMPI
|
|
1
wmake/rules/linuxPPC64Gcc/mplibSYSTEMOPENMPI
Normal file
1
wmake/rules/linuxPPC64Gcc/mplibSYSTEMOPENMPI
Normal file
|
@ -0,0 +1 @@
|
||||||
|
PFLAGS = -DOMPI_SKIP_MPICXX
|
Reference in a new issue