2012-09-11 15:42:55 +00:00
|
|
|
/*---------------------------------------------------------------------------*\
|
|
|
|
========= |
|
2013-12-11 16:09:41 +00:00
|
|
|
\\ / F ield | foam-extend: Open Source CFD
|
2016-06-20 15:00:40 +00:00
|
|
|
\\ / O peration | Version: 4.0
|
2015-05-17 13:32:07 +00:00
|
|
|
\\ / A nd | Web: http://www.foam-extend.org
|
|
|
|
\\/ M anipulation | For copyright notice see file Copyright
|
2012-09-11 15:42:55 +00:00
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
License
|
2013-12-11 16:09:41 +00:00
|
|
|
This file is part of foam-extend.
|
2012-09-11 15:42:55 +00:00
|
|
|
|
2013-12-11 16:09:41 +00:00
|
|
|
foam-extend is free software: you can redistribute it and/or modify it
|
2012-09-11 15:42:55 +00:00
|
|
|
under the terms of the GNU General Public License as published by the
|
2013-12-11 16:09:41 +00:00
|
|
|
Free Software Foundation, either version 3 of the License, or (at your
|
2012-09-11 15:42:55 +00:00
|
|
|
option) any later version.
|
|
|
|
|
2013-12-11 16:09:41 +00:00
|
|
|
foam-extend is distributed in the hope that it will be useful, but
|
|
|
|
WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
General Public License for more details.
|
2012-09-11 15:42:55 +00:00
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
2013-12-11 16:09:41 +00:00
|
|
|
along with foam-extend. If not, see <http://www.gnu.org/licenses/>.
|
2012-09-11 15:42:55 +00:00
|
|
|
|
|
|
|
Description
|
|
|
|
Generate analytical solution for a infinite plaste with a circular
|
|
|
|
hole.
|
|
|
|
Stress field sigma is generated.
|
2013-07-18 01:02:34 +00:00
|
|
|
Based on solution outlined in Timoshenko, Theory of Elasticity.
|
2012-09-11 15:42:55 +00:00
|
|
|
|
|
|
|
Author
|
|
|
|
plateHoleSolution function by Z. Tukovic
|
|
|
|
utility assembled by P. Cardiff
|
|
|
|
|
|
|
|
\*---------------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
#include "fvCFD.H"
|
|
|
|
#include "volFields.H"
|
|
|
|
#include "fvc.H"
|
|
|
|
#include "fixedValueFvPatchFields.H"
|
|
|
|
#include "coordinateSystem.H"
|
|
|
|
|
|
|
|
symmTensor plateHoleSolution(const vector& C);
|
|
|
|
|
|
|
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
|
|
|
|
|
|
int main(int argc, char *argv[])
|
|
|
|
{
|
|
|
|
# include "setRootCase.H"
|
|
|
|
# include "createTime.H"
|
|
|
|
# include "createMesh.H"
|
|
|
|
|
2013-07-18 01:43:15 +00:00
|
|
|
runTime++;
|
2012-09-11 15:42:55 +00:00
|
|
|
|
2013-07-18 01:43:15 +00:00
|
|
|
Info << "Writing analytical solution for an infinite plate with a circular hole,\nwhere"
|
|
|
|
<< "\n\tradius = 0.5"
|
|
|
|
<< "\n\tdistant traction = (10,000 0 0 )"
|
|
|
|
<< nl << endl;
|
2013-07-18 01:02:34 +00:00
|
|
|
|
2013-07-18 01:43:15 +00:00
|
|
|
volSymmTensorField sigma
|
2012-09-11 15:42:55 +00:00
|
|
|
(
|
2013-07-18 01:43:15 +00:00
|
|
|
IOobject
|
|
|
|
(
|
2013-10-14 08:26:40 +00:00
|
|
|
"sigmaAnalyticalCylin",
|
2013-07-18 01:43:15 +00:00
|
|
|
runTime.timeName(),
|
|
|
|
mesh,
|
|
|
|
IOobject::NO_READ,
|
|
|
|
IOobject::AUTO_WRITE
|
|
|
|
),
|
|
|
|
mesh,
|
|
|
|
dimensionedSymmTensor("zero", dimForce/dimArea, symmTensor::zero)
|
|
|
|
);
|
|
|
|
|
|
|
|
const volVectorField& C = mesh.C();
|
|
|
|
|
|
|
|
forAll(sigma.internalField(), celli)
|
2012-09-11 15:42:55 +00:00
|
|
|
{
|
2013-07-18 01:43:15 +00:00
|
|
|
vector curR = vector(C[celli].x(), C[celli].y(), 0);
|
2012-09-11 15:42:55 +00:00
|
|
|
|
2013-07-18 01:43:15 +00:00
|
|
|
sigma.internalField()[celli] = plateHoleSolution(curR);
|
2012-09-11 15:42:55 +00:00
|
|
|
}
|
|
|
|
|
2013-07-18 01:43:15 +00:00
|
|
|
forAll(sigma.boundaryField(), patchi)
|
2012-09-11 15:42:55 +00:00
|
|
|
{
|
2013-07-18 01:43:15 +00:00
|
|
|
forAll(sigma.boundaryField()[patchi], facei)
|
|
|
|
{
|
|
|
|
vector curR = vector(C.boundaryField()[patchi][facei].x(), C.boundaryField()[patchi][facei].y(), 0);
|
2012-09-11 15:42:55 +00:00
|
|
|
|
2013-07-18 01:43:15 +00:00
|
|
|
sigma.boundaryField()[patchi][facei] = plateHoleSolution(curR);
|
|
|
|
}
|
2012-09-11 15:42:55 +00:00
|
|
|
}
|
|
|
|
|
2013-07-18 01:43:15 +00:00
|
|
|
Info << "Writing analytical sigma tensor" << endl;
|
|
|
|
sigma.write();
|
2012-09-11 15:42:55 +00:00
|
|
|
|
2013-07-18 01:43:15 +00:00
|
|
|
Info << nl << "End" << endl;
|
2013-07-18 01:02:34 +00:00
|
|
|
|
2013-07-18 01:43:15 +00:00
|
|
|
return 0;
|
2012-09-11 15:42:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// ************************************************************************* //
|
|
|
|
|
|
|
|
|
|
|
|
symmTensor plateHoleSolution(const vector& C)
|
|
|
|
{
|
|
|
|
tensor sigma = tensor::zero;
|
|
|
|
|
|
|
|
scalar T = 10000;
|
|
|
|
scalar a = 0.5;
|
|
|
|
|
|
|
|
scalar r = ::sqrt(sqr(C.x()) + sqr(C.y()));
|
|
|
|
scalar theta = Foam::atan2(C.y(), C.x());
|
|
|
|
|
|
|
|
coordinateSystem cs("polarCS", C, vector(0, 0, 1), C/mag(C));
|
|
|
|
|
|
|
|
sigma.xx() =
|
2013-07-18 01:02:34 +00:00
|
|
|
T*(1 - sqr(a)/sqr(r))/2
|
2012-09-11 15:42:55 +00:00
|
|
|
+ T*(1 + 3*pow(a,4)/pow(r,4) - 4*sqr(a)/sqr(r))*::cos(2*theta)/2;
|
|
|
|
|
|
|
|
sigma.xy() =
|
|
|
|
- T*(1 - 3*pow(a,4)/pow(r,4) + 2*sqr(a)/sqr(r))*::sin(2*theta)/2;
|
|
|
|
|
|
|
|
sigma.yx() = sigma.xy();
|
|
|
|
|
|
|
|
sigma.yy() =
|
2013-07-18 01:02:34 +00:00
|
|
|
T*(1 + sqr(a)/sqr(r))/2
|
2012-09-11 15:42:55 +00:00
|
|
|
- T*(1 + 3*pow(a,4)/pow(r,4))*::cos(2*theta)/2;
|
|
|
|
|
|
|
|
|
|
|
|
// Transformation to global coordinate system
|
|
|
|
sigma = ((cs.R()&sigma)&cs.R().T());
|
|
|
|
|
|
|
|
symmTensor S = symmTensor::zero;
|
|
|
|
|
|
|
|
S.xx() = sigma.xx();
|
|
|
|
S.xy() = sigma.xy();
|
|
|
|
S.yy() = sigma.yy();
|
2013-07-18 01:02:34 +00:00
|
|
|
|
2012-09-11 15:42:55 +00:00
|
|
|
return S;
|
|
|
|
}
|