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 #include "UpwindFitData.H"
00027 #include <finiteVolume/surfaceFields.H>
00028 #include <finiteVolume/volFields.H>
00029 #include <OpenFOAM/SVD.H>
00030 #include <OpenFOAM/syncTools.H>
00031 #include <finiteVolume/extendedUpwindCellToFaceStencil.H>
00032
00033
00034
00035 template<class Polynomial>
00036 Foam::UpwindFitData<Polynomial>::UpwindFitData
00037 (
00038 const fvMesh& mesh,
00039 const extendedUpwindCellToFaceStencil& stencil,
00040 const bool linearCorrection,
00041 const scalar linearLimitFactor,
00042 const scalar centralWeight
00043 )
00044 :
00045 FitData
00046 <
00047 UpwindFitData<Polynomial>,
00048 extendedUpwindCellToFaceStencil,
00049 Polynomial
00050 >
00051 (
00052 mesh, stencil, linearCorrection, linearLimitFactor, centralWeight
00053 ),
00054 owncoeffs_(mesh.nFaces()),
00055 neicoeffs_(mesh.nFaces())
00056 {
00057 if (debug)
00058 {
00059 Info<< "Contructing UpwindFitData<Polynomial>" << endl;
00060 }
00061
00062 calcFit();
00063
00064 if (debug)
00065 {
00066 Info<< "UpwindFitData<Polynomial>::UpwindFitData() :"
00067 << "Finished constructing polynomialFit data"
00068 << endl;
00069 }
00070 }
00071
00072
00073
00074
00075 template<class Polynomial>
00076 void Foam::UpwindFitData<Polynomial>::calcFit()
00077 {
00078 const fvMesh& mesh = this->mesh();
00079
00080 const surfaceScalarField& w = mesh.surfaceInterpolation::weights();
00081 const surfaceScalarField::GeometricBoundaryField& bw = w.boundaryField();
00082
00083
00084
00085
00086
00087 List<List<point> > stencilPoints(mesh.nFaces());
00088 this->stencil().collectData
00089 (
00090 this->stencil().ownMap(),
00091 this->stencil().ownStencil(),
00092 mesh.C(),
00093 stencilPoints
00094 );
00095
00096
00097
00098
00099 for(label facei = 0; facei < mesh.nInternalFaces(); facei++)
00100 {
00101 FitData
00102 <
00103 UpwindFitData<Polynomial>,
00104 extendedUpwindCellToFaceStencil,
00105 Polynomial
00106 >::calcFit(owncoeffs_[facei], stencilPoints[facei], w[facei], facei);
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116 }
00117
00118 forAll(bw, patchi)
00119 {
00120 const fvsPatchScalarField& pw = bw[patchi];
00121
00122 if (pw.coupled())
00123 {
00124 label facei = pw.patch().patch().start();
00125
00126 forAll(pw, i)
00127 {
00128 FitData
00129 <
00130 UpwindFitData<Polynomial>,
00131 extendedUpwindCellToFaceStencil,
00132 Polynomial
00133 >::calcFit
00134 (
00135 owncoeffs_[facei], stencilPoints[facei], pw[i], facei
00136 );
00137 facei++;
00138 }
00139 }
00140 }
00141
00142
00143
00144
00145
00146
00147 this->stencil().collectData
00148 (
00149 this->stencil().neiMap(),
00150 this->stencil().neiStencil(),
00151 mesh.C(),
00152 stencilPoints
00153 );
00154
00155
00156
00157
00158 for(label facei = 0; facei < mesh.nInternalFaces(); facei++)
00159 {
00160 FitData
00161 <
00162 UpwindFitData<Polynomial>,
00163 extendedUpwindCellToFaceStencil,
00164 Polynomial
00165 >::calcFit(neicoeffs_[facei], stencilPoints[facei], w[facei], facei);
00166
00167
00168
00169
00170
00171
00172
00173
00174
00175 }
00176
00177 forAll(bw, patchi)
00178 {
00179 const fvsPatchScalarField& pw = bw[patchi];
00180
00181 if (pw.coupled())
00182 {
00183 label facei = pw.patch().patch().start();
00184
00185 forAll(pw, i)
00186 {
00187 FitData
00188 <
00189 UpwindFitData<Polynomial>,
00190 extendedUpwindCellToFaceStencil,
00191 Polynomial
00192 >::calcFit
00193 (
00194 neicoeffs_[facei], stencilPoints[facei], pw[i], facei
00195 );
00196 facei++;
00197 }
00198 }
00199 }
00200 }
00201
00202
00203