displacementSBRStressFvMotionSolver.C
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #include "displacementSBRStressFvMotionSolver.H"
00028 #include "motionDiffusivity.H"
00029 #include "fvmLaplacian.H"
00030 #include "addToRunTimeSelectionTable.H"
00031 #include "fvcDiv.H"
00032 #include "fvcGrad.H"
00033 #include "surfaceInterpolate.H"
00034 #include "fvcLaplacian.H"
00035 #include "mapPolyMesh.H"
00036 #include "volPointInterpolation.H"
00037
00038
00039
00040 namespace Foam
00041 {
00042 defineTypeNameAndDebug(displacementSBRStressFvMotionSolver, 0);
00043
00044 addToRunTimeSelectionTable
00045 (
00046 fvMotionSolver,
00047 displacementSBRStressFvMotionSolver,
00048 dictionary
00049 );
00050 }
00051
00052
00053
00054
00055 Foam::displacementSBRStressFvMotionSolver::displacementSBRStressFvMotionSolver
00056 (
00057 const polyMesh& mesh,
00058 Istream& is
00059 )
00060 :
00061 displacementFvMotionSolver(mesh, is),
00062 pointDisplacement_
00063 (
00064 IOobject
00065 (
00066 "pointDisplacement",
00067 fvMesh_.time().timeName(),
00068 fvMesh_,
00069 IOobject::MUST_READ,
00070 IOobject::AUTO_WRITE
00071 ),
00072 pointMesh::New(fvMesh_)
00073 ),
00074 cellDisplacement_
00075 (
00076 IOobject
00077 (
00078 "cellDisplacement",
00079 mesh.time().timeName(),
00080 mesh,
00081 IOobject::READ_IF_PRESENT,
00082 IOobject::AUTO_WRITE
00083 ),
00084 fvMesh_,
00085 dimensionedVector
00086 (
00087 "cellDisplacement",
00088 pointDisplacement_.dimensions(),
00089 vector::zero
00090 ),
00091 cellMotionBoundaryTypes<vector>(pointDisplacement_.boundaryField())
00092 ),
00093 diffusivityPtr_
00094 (
00095 motionDiffusivity::New(*this, lookup("diffusivity"))
00096 )
00097 {}
00098
00099
00100
00101
00102 Foam::displacementSBRStressFvMotionSolver::
00103 ~displacementSBRStressFvMotionSolver()
00104 {}
00105
00106
00107
00108
00109 Foam::tmp<Foam::pointField>
00110 Foam::displacementSBRStressFvMotionSolver::curPoints() const
00111 {
00112 volPointInterpolation::New(fvMesh_).interpolate
00113 (
00114 cellDisplacement_,
00115 pointDisplacement_
00116 );
00117
00118 tmp<pointField> tcurPoints
00119 (
00120 points0() + pointDisplacement_.internalField()
00121 );
00122
00123 twoDCorrectPoints(tcurPoints());
00124
00125 return tcurPoints;
00126 }
00127
00128
00129 void Foam::displacementSBRStressFvMotionSolver::solve()
00130 {
00131
00132
00133 movePoints(fvMesh_.points());
00134
00135 diffusivityPtr_->correct();
00136 pointDisplacement_.boundaryField().updateCoeffs();
00137
00138 surfaceScalarField Df = diffusivityPtr_->operator()();
00139
00140 volTensorField gradCd = fvc::grad(cellDisplacement_);
00141
00142 Foam::solve
00143 (
00144 fvm::laplacian
00145 (
00146 2*Df,
00147 cellDisplacement_,
00148 "laplacian(diffusivity,cellDisplacement)"
00149 )
00150
00151 + fvc::div
00152 (
00153 Df
00154 *(
00155 (
00156 cellDisplacement_.mesh().Sf()
00157 & fvc::interpolate(gradCd.T() - gradCd)
00158 )
00159
00160
00161 - cellDisplacement_.mesh().Sf()*fvc::interpolate(tr(gradCd))
00162 )
00163 )
00164
00165
00166
00167
00168
00169
00170
00171
00172
00173
00174
00175
00176
00177
00178
00179
00180
00181
00182
00183
00184
00185
00186
00187 );
00188 }
00189
00190
00191 void Foam::displacementSBRStressFvMotionSolver::updateMesh
00192 (
00193 const mapPolyMesh& mpm
00194 )
00195 {
00196 displacementFvMotionSolver::updateMesh(mpm);
00197
00198
00199
00200 diffusivityPtr_.reset(NULL);
00201 diffusivityPtr_ = motionDiffusivity::New(*this, lookup("diffusivity"));
00202 }
00203
00204
00205
Copyright © 2000-2009 OpenCFD Ltd