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
00032
00033
00034
00035 #ifndef NVDVTVDV_H
00036 #define NVDVTVDV_H
00037
00038
00039
00040 namespace Foam
00041 {
00042
00043
00044
00045
00046
00047 class NVDVTVDV
00048 {
00049
00050 public:
00051
00052 typedef vector phiType;
00053 typedef tensor gradPhiType;
00054
00055
00056
00057 NVDVTVDV()
00058 {}
00059
00060
00061
00062
00063 scalar phict
00064 (
00065 const scalar cdWeight,
00066 const scalar faceFlux,
00067 const vector& phiP,
00068 const vector& phiN,
00069 const tensor& gradcP,
00070 const tensor& gradcN,
00071 const vector& d
00072 ) const
00073 {
00074 vector gradfV = phiN - phiP;
00075 scalar gradf = gradfV & gradfV;
00076
00077 scalar gradcf;
00078
00079 if (faceFlux > 0)
00080 {
00081 gradcf = gradfV & (d & gradcP);
00082 }
00083 else
00084 {
00085 gradcf = gradfV & (d & gradcN);
00086 }
00087
00088
00089 gradcf = stabilise(gradcf, VSMALL);
00090
00091 return 1 - 0.5*gradf/gradcf;
00092 }
00093
00094
00095 scalar r
00096 (
00097 const scalar cdWeight,
00098 const scalar faceFlux,
00099 const vector& phiP,
00100 const vector& phiN,
00101 const tensor& gradcP,
00102 const tensor& gradcN,
00103 const vector& d
00104 ) const
00105 {
00106 vector gradfV = phiN - phiP;
00107 scalar gradf = gradfV & gradfV;
00108
00109 scalar gradcf;
00110
00111 if (faceFlux > 0)
00112 {
00113 gradcf = gradfV & (d & gradcP);
00114 }
00115 else
00116 {
00117 gradcf = gradfV & (d & gradcN);
00118 }
00119
00120
00121 gradf = stabilise(gradf, VSMALL);
00122
00123 return 2*(gradcf/gradf) - 1;
00124 }
00125 };
00126
00127
00128
00129
00130 }
00131
00132
00133
00134 #endif
00135
00136