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 "MRFZone.H"
00027 #include <finiteVolume/fvMesh.H>
00028 #include <finiteVolume/volFields.H>
00029 #include <finiteVolume/surfaceFields.H>
00030 #include <OpenFOAM/geometricOneField.H>
00031
00032
00033
00034 template<class RhoFieldType>
00035 void Foam::MRFZone::relativeRhoFlux
00036 (
00037 const RhoFieldType& rho,
00038 surfaceScalarField& phi
00039 ) const
00040 {
00041 const surfaceVectorField& Cf = mesh_.Cf();
00042 const surfaceVectorField& Sf = mesh_.Sf();
00043
00044 const vector& origin = origin_.value();
00045 const vector& Omega = Omega_.value();
00046
00047
00048 forAll(internalFaces_, i)
00049 {
00050 label facei = internalFaces_[i];
00051 phi[facei] -= rho[facei]*(Omega ^ (Cf[facei] - origin)) & Sf[facei];
00052 }
00053
00054
00055 forAll(includedFaces_, patchi)
00056 {
00057 forAll(includedFaces_[patchi], i)
00058 {
00059 label patchFacei = includedFaces_[patchi][i];
00060
00061 phi.boundaryField()[patchi][patchFacei] = 0.0;
00062 }
00063 }
00064
00065
00066 forAll(excludedFaces_, patchi)
00067 {
00068 forAll(excludedFaces_[patchi], i)
00069 {
00070 label patchFacei = excludedFaces_[patchi][i];
00071
00072 phi.boundaryField()[patchi][patchFacei] -=
00073 rho.boundaryField()[patchi][patchFacei]
00074 * (Omega ^ (Cf.boundaryField()[patchi][patchFacei] - origin))
00075 & Sf.boundaryField()[patchi][patchFacei];
00076 }
00077 }
00078 }
00079
00080
00081 template<class RhoFieldType>
00082 void Foam::MRFZone::absoluteRhoFlux
00083 (
00084 const RhoFieldType& rho,
00085 surfaceScalarField& phi
00086 ) const
00087 {
00088 const surfaceVectorField& Cf = mesh_.Cf();
00089 const surfaceVectorField& Sf = mesh_.Sf();
00090
00091 const vector& origin = origin_.value();
00092 const vector& Omega = Omega_.value();
00093
00094
00095 forAll(internalFaces_, i)
00096 {
00097 label facei = internalFaces_[i];
00098 phi[facei] += rho[facei]*(Omega ^ (Cf[facei] - origin)) & Sf[facei];
00099 }
00100
00101
00102 forAll(includedFaces_, patchi)
00103 {
00104 forAll(includedFaces_[patchi], i)
00105 {
00106 label patchFacei = includedFaces_[patchi][i];
00107
00108 phi.boundaryField()[patchi][patchFacei] +=
00109 rho.boundaryField()[patchi][patchFacei]
00110 * (Omega ^ (Cf.boundaryField()[patchi][patchFacei] - origin))
00111 & Sf.boundaryField()[patchi][patchFacei];
00112 }
00113 }
00114
00115
00116 forAll(excludedFaces_, patchi)
00117 {
00118 forAll(excludedFaces_[patchi], i)
00119 {
00120 label patchFacei = excludedFaces_[patchi][i];
00121
00122 phi.boundaryField()[patchi][patchFacei] +=
00123 rho.boundaryField()[patchi][patchFacei]
00124 * (Omega ^ (Cf.boundaryField()[patchi][patchFacei] - origin))
00125 & Sf.boundaryField()[patchi][patchFacei];
00126 }
00127 }
00128 }
00129
00130
00131