velocityComponentLaplacianFvMotionSolver.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 "velocityComponentLaplacianFvMotionSolver.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(velocityComponentLaplacianFvMotionSolver, 0);
00038
00039 addToRunTimeSelectionTable
00040 (
00041 fvMotionSolver,
00042 velocityComponentLaplacianFvMotionSolver,
00043 dictionary
00044 );
00045 }
00046
00047
00048
00049
00050 Foam::velocityComponentLaplacianFvMotionSolver::
00051 velocityComponentLaplacianFvMotionSolver
00052 (
00053 const polyMesh& mesh,
00054 Istream& msData
00055 )
00056 :
00057 fvMotionSolver(mesh),
00058 cmptName_(msData),
00059 cmpt_(0),
00060 pointMotionU_
00061 (
00062 IOobject
00063 (
00064 "pointMotionU" + cmptName_,
00065 fvMesh_.time().timeName(),
00066 fvMesh_,
00067 IOobject::MUST_READ,
00068 IOobject::AUTO_WRITE
00069 ),
00070 pointMesh::New(fvMesh_)
00071 ),
00072 cellMotionU_
00073 (
00074 IOobject
00075 (
00076 "cellMotionU" + cmptName_,
00077 mesh.time().timeName(),
00078 mesh,
00079 IOobject::READ_IF_PRESENT,
00080 IOobject::AUTO_WRITE
00081 ),
00082 fvMesh_,
00083 dimensionedScalar
00084 (
00085 "cellMotionU",
00086 pointMotionU_.dimensions(),
00087 0
00088 ),
00089 cellMotionBoundaryTypes<scalar>(pointMotionU_.boundaryField())
00090 ),
00091 diffusivityPtr_
00092 (
00093 motionDiffusivity::New(*this, lookup("diffusivity"))
00094 )
00095 {
00096 if (cmptName_ == "x")
00097 {
00098 cmpt_ = vector::X;
00099 }
00100 else if (cmptName_ == "y")
00101 {
00102 cmpt_ = vector::Y;
00103 }
00104 else if (cmptName_ == "z")
00105 {
00106 cmpt_ = vector::Z;
00107 }
00108 else
00109 {
00110 FatalErrorIn
00111 (
00112 "velocityComponentLaplacianFvMotionSolver::"
00113 "velocityComponentLaplacianFvMotionSolver"
00114 "(const polyMesh& mesh, Istream& msData)"
00115 ) << "Given component name " << cmptName_ << " should be x, y or z"
00116 << exit(FatalError);
00117 }
00118 }
00119
00120
00121
00122
00123 Foam::velocityComponentLaplacianFvMotionSolver::
00124 ~velocityComponentLaplacianFvMotionSolver()
00125 {}
00126
00127
00128
00129
00130 Foam::tmp<Foam::pointField>
00131 Foam::velocityComponentLaplacianFvMotionSolver::curPoints() const
00132 {
00133 volPointInterpolation::New(fvMesh_).interpolate
00134 (
00135 cellMotionU_,
00136 pointMotionU_
00137 );
00138
00139 tmp<pointField> tcurPoints(new pointField(fvMesh_.points()));
00140
00141 tcurPoints().replace
00142 (
00143 cmpt_,
00144 tcurPoints().component(cmpt_)
00145 + fvMesh_.time().deltaT().value()*pointMotionU_.internalField()
00146 );
00147
00148 twoDCorrectPoints(tcurPoints());
00149
00150 return tcurPoints;
00151 }
00152
00153
00154 void Foam::velocityComponentLaplacianFvMotionSolver::solve()
00155 {
00156
00157
00158 movePoints(fvMesh_.points());
00159
00160 diffusivityPtr_->correct();
00161 pointMotionU_.boundaryField().updateCoeffs();
00162
00163 Foam::solve
00164 (
00165 fvm::laplacian
00166 (
00167 diffusivityPtr_->operator()(),
00168 cellMotionU_,
00169 "laplacian(diffusivity,cellMotionU)"
00170 )
00171 );
00172 }
00173
00174
00175 void Foam::velocityComponentLaplacianFvMotionSolver::updateMesh
00176 (
00177 const mapPolyMesh& mpm
00178 )
00179 {
00180 fvMotionSolver::updateMesh(mpm);
00181
00182
00183
00184 diffusivityPtr_.reset(NULL);
00185 diffusivityPtr_ = motionDiffusivity::New(*this, lookup("diffusivity"));
00186 }
00187
00188
00189
Copyright © 2000-2009 OpenCFD Ltd