velocityLaplacianFvMotionSolver.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 "velocityLaplacianFvMotionSolver.H"
00028 #include "motionDiffusivity.H"
00029 #include "fvmLaplacian.H"
00030 #include "addToRunTimeSelectionTable.H"
00031 #include "volPointInterpolation.H"
00032
00033
00034
00035 namespace Foam
00036 {
00037 defineTypeNameAndDebug(velocityLaplacianFvMotionSolver, 0);
00038
00039 addToRunTimeSelectionTable
00040 (
00041 fvMotionSolver,
00042 velocityLaplacianFvMotionSolver,
00043 dictionary
00044 );
00045 }
00046
00047
00048
00049
00050 Foam::velocityLaplacianFvMotionSolver::velocityLaplacianFvMotionSolver
00051 (
00052 const polyMesh& mesh,
00053 Istream&
00054 )
00055 :
00056 fvMotionSolver(mesh),
00057 pointMotionU_
00058 (
00059 IOobject
00060 (
00061 "pointMotionU",
00062 fvMesh_.time().timeName(),
00063 fvMesh_,
00064 IOobject::MUST_READ,
00065 IOobject::AUTO_WRITE
00066 ),
00067 pointMesh::New(fvMesh_)
00068 ),
00069 cellMotionU_
00070 (
00071 IOobject
00072 (
00073 "cellMotionU",
00074 mesh.time().timeName(),
00075 mesh,
00076 IOobject::READ_IF_PRESENT,
00077 IOobject::AUTO_WRITE
00078 ),
00079 fvMesh_,
00080 dimensionedVector
00081 (
00082 "cellMotionU",
00083 pointMotionU_.dimensions(),
00084 vector::zero
00085 ),
00086 cellMotionBoundaryTypes<vector>(pointMotionU_.boundaryField())
00087 ),
00088 diffusivityPtr_
00089 (
00090 motionDiffusivity::New(*this, lookup("diffusivity"))
00091 )
00092 {}
00093
00094
00095
00096
00097 Foam::velocityLaplacianFvMotionSolver::~velocityLaplacianFvMotionSolver()
00098 {}
00099
00100
00101
00102
00103 Foam::tmp<Foam::pointField>
00104 Foam::velocityLaplacianFvMotionSolver::curPoints() const
00105 {
00106 volPointInterpolation::New(fvMesh_).interpolate
00107 (
00108 cellMotionU_,
00109 pointMotionU_
00110 );
00111
00112 tmp<pointField> tcurPoints
00113 (
00114 fvMesh_.points()
00115 + fvMesh_.time().deltaT().value()*pointMotionU_.internalField()
00116 );
00117
00118 twoDCorrectPoints(tcurPoints());
00119
00120 return tcurPoints;
00121 }
00122
00123
00124 void Foam::velocityLaplacianFvMotionSolver::solve()
00125 {
00126
00127
00128 movePoints(fvMesh_.points());
00129
00130 diffusivityPtr_->correct();
00131 pointMotionU_.boundaryField().updateCoeffs();
00132
00133 Foam::solve
00134 (
00135 fvm::laplacian
00136 (
00137 diffusivityPtr_->operator()(),
00138 cellMotionU_,
00139 "laplacian(diffusivity,cellMotionU)"
00140 )
00141 );
00142 }
00143
00144
00145 void Foam::velocityLaplacianFvMotionSolver::updateMesh
00146 (
00147 const mapPolyMesh& mpm
00148 )
00149 {
00150 fvMotionSolver::updateMesh(mpm);
00151
00152
00153
00154 diffusivityPtr_.reset(NULL);
00155 diffusivityPtr_ = motionDiffusivity::New(*this, lookup("diffusivity"));
00156 }
00157
00158
00159
Copyright © 2000-2009 OpenCFD Ltd