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
00028
00029
00030
00031 namespace Foam
00032 {
00033
00034
00035
00036
00037
00038 inline bool wallPointYPlus::update
00039 (
00040 const point& pt,
00041 const wallPointYPlus& w2,
00042 const scalar tol
00043 )
00044 {
00045 scalar dist2 = magSqr(pt - w2.origin());
00046
00047 scalar diff = distSqr() - dist2;
00048
00049 if (diff < 0)
00050 {
00051
00052 return false;
00053 }
00054
00055 if ((diff < SMALL) || ((distSqr() > SMALL) && (diff/distSqr() < tol)))
00056 {
00057
00058 return false;
00059 }
00060 else
00061 {
00062
00063 scalar yPlus = Foam::sqrt(dist2)/w2.data();
00064
00065
00066 if (yPlus < yPlusCutOff)
00067 {
00068
00069 distSqr() = dist2;
00070 origin() = w2.origin();
00071 data() = w2.data();
00072
00073 return true;
00074 }
00075 else
00076 {
00077 return false;
00078 }
00079 }
00080 }
00081
00082
00083
00084
00085
00086 inline wallPointYPlus::wallPointYPlus()
00087 :
00088 wallPointData<scalar>()
00089 {
00090
00091 data() = 1.0;
00092 }
00093
00094
00095
00096 inline wallPointYPlus::wallPointYPlus
00097 (
00098 const point& origin,
00099 const scalar yStar,
00100 const scalar distSqr
00101 )
00102 :
00103 wallPointData<scalar>(origin, yStar, distSqr)
00104 {}
00105
00106
00107
00108
00109
00110 inline bool wallPointYPlus::updateCell
00111 (
00112 const polyMesh& mesh,
00113 const label thisCellI,
00114 const label neighbourFaceI,
00115 const wallPointYPlus& neighbourWallInfo,
00116 const scalar tol
00117 )
00118 {
00119 const vectorField& cellCentres = mesh.primitiveMesh::cellCentres();
00120
00121 return update
00122 (
00123 cellCentres[thisCellI],
00124 neighbourWallInfo,
00125 tol
00126 );
00127 }
00128
00129
00130
00131 inline bool wallPointYPlus::updateFace
00132 (
00133 const polyMesh& mesh,
00134 const label thisFaceI,
00135 const label neighbourCellI,
00136 const wallPointYPlus& neighbourWallInfo,
00137 const scalar tol
00138 )
00139 {
00140 const vectorField& faceCentres = mesh.faceCentres();
00141
00142 return update
00143 (
00144 faceCentres[thisFaceI],
00145 neighbourWallInfo,
00146 tol
00147 );
00148 }
00149
00150
00151
00152 inline bool wallPointYPlus::updateFace
00153 (
00154 const polyMesh& mesh,
00155 const label thisFaceI,
00156 const wallPointYPlus& neighbourWallInfo,
00157 const scalar tol
00158 )
00159 {
00160 const vectorField& faceCentres = mesh.faceCentres();
00161
00162 return update
00163 (
00164 faceCentres[thisFaceI],
00165 neighbourWallInfo,
00166 tol
00167 );
00168 }
00169
00170
00171
00172
00173 }
00174
00175