processorFvPatch.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 "processorFvPatch.H"
00028 #include "addToRunTimeSelectionTable.H"
00029 #include "transformField.H"
00030
00031
00032
00033 namespace Foam
00034 {
00035
00036
00037
00038 defineTypeNameAndDebug(processorFvPatch, 0);
00039 addToRunTimeSelectionTable(fvPatch, processorFvPatch, polyPatch);
00040
00041
00042
00043
00044 void processorFvPatch::makeWeights(scalarField& w) const
00045 {
00046 if (Pstream::parRun())
00047 {
00048
00049 scalarField neighbFaceCentresCn
00050 (
00051 (
00052 procPolyPatch_.neighbFaceAreas()
00053 /(mag(procPolyPatch_.neighbFaceAreas()) + VSMALL)
00054 )
00055 & (
00056 procPolyPatch_.neighbFaceCentres()
00057 - procPolyPatch_.neighbFaceCellCentres())
00058 );
00059
00060 w = neighbFaceCentresCn/((nf()&fvPatch::delta()) + neighbFaceCentresCn);
00061 }
00062 else
00063 {
00064 w = 1.0;
00065 }
00066 }
00067
00068
00069 void processorFvPatch::makeDeltaCoeffs(scalarField& dc) const
00070 {
00071 if (Pstream::parRun())
00072 {
00073 dc = (1.0 - weights())/(nf() & fvPatch::delta());
00074 }
00075 else
00076 {
00077 dc = 1.0/(nf() & fvPatch::delta());
00078 }
00079 }
00080
00081
00082 tmp<vectorField> processorFvPatch::delta() const
00083 {
00084 if (Pstream::parRun())
00085 {
00086
00087 if (parallel())
00088 {
00089 return
00090 fvPatch::delta()
00091 - (
00092 procPolyPatch_.neighbFaceCentres()
00093 - procPolyPatch_.neighbFaceCellCentres()
00094 );
00095 }
00096 else
00097 {
00098 return
00099 fvPatch::delta()
00100 - transform
00101 (
00102 forwardT(),
00103 (
00104 procPolyPatch_.neighbFaceCentres()
00105 - procPolyPatch_.neighbFaceCellCentres()
00106 )
00107 );
00108 }
00109 }
00110 else
00111 {
00112 return fvPatch::delta();
00113 }
00114 }
00115
00116
00117 tmp<labelField> processorFvPatch::interfaceInternalField
00118 (
00119 const unallocLabelList& internalData
00120 ) const
00121 {
00122 return patchInternalField(internalData);
00123 }
00124
00125
00126 void processorFvPatch::initTransfer
00127 (
00128 const Pstream::commsTypes commsType,
00129 const unallocLabelList& interfaceData
00130 ) const
00131 {
00132 send(commsType, interfaceData);
00133 }
00134
00135
00136 tmp<labelField> processorFvPatch::transfer
00137 (
00138 const Pstream::commsTypes commsType,
00139 const unallocLabelList&
00140 ) const
00141 {
00142 return receive<label>(commsType, this->size());
00143 }
00144
00145
00146 void processorFvPatch::initInternalFieldTransfer
00147 (
00148 const Pstream::commsTypes commsType,
00149 const unallocLabelList& iF
00150 ) const
00151 {
00152 send(commsType, patchInternalField(iF)());
00153 }
00154
00155
00156 tmp<labelField> processorFvPatch::internalFieldTransfer
00157 (
00158 const Pstream::commsTypes commsType,
00159 const unallocLabelList&
00160 ) const
00161 {
00162 return receive<label>(commsType, this->size());
00163 }
00164
00165
00166
00167
00168 }
00169
00170
Copyright © 2000-2009 OpenCFD Ltd