00001 /*---------------------------------------------------------------------------*\ 00002 ========= | 00003 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox 00004 \\ / O peration | 00005 \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. 00006 \\/ M anipulation | 00007 ------------------------------------------------------------------------------- 00008 License 00009 This file is part of OpenFOAM. 00010 00011 OpenFOAM is free software: you can redistribute it and/or modify it 00012 under the terms of the GNU General Public License as published by 00013 the Free Software Foundation, either version 3 of the License, or 00014 (at your option) any later version. 00015 00016 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT 00017 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 00018 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 00019 for more details. 00020 00021 You should have received a copy of the GNU General Public License 00022 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. 00023 00024 Class 00025 turbulentTemperatureCoupledBaffleFvPatchScalarField 00026 00027 Description 00028 Harmonic fixed value boundary condition for temperature, to be used 00029 for heat-transfer on back-to-back baffles. 00030 00031 If my temperature is T1, heat conductivity K1 and neighbour is T2,K2 00032 00033 both sides get fixedValue (K1/dx1*T1 + K2/dx2*T2)/(K1/dx1+K2/dx2) 00034 00035 Example usage: 00036 myInterfacePatchName 00037 { 00038 type compressible::turbulentTemperatureCoupledBaffle; 00039 neighbourFieldName T; 00040 K K; // or none 00041 value uniform 300; 00042 } 00043 00044 Needs to be on underlying directMapped(Wall)FvPatch. 00045 00046 Note: if K is "none" looks up RASModel and basicThermo, otherwise expects 00047 the solver to calculate a 'K' field. 00048 00049 Note: runs in parallel with arbitrary decomposition. Uses directMapped 00050 functionality to calculate exchange. 00051 00052 Note: lags interface data so both sides use same data. 00053 - problem: schedule to calculate average would interfere 00054 with standard processor swaps. 00055 - so: updateCoeffs sets both to same Twall. Only need to do 00056 this for last outer iteration but don't have access to this. 00057 00058 SourceFiles 00059 turbulentTemperatureCoupledBaffleFvPatchScalarField.C 00060 00061 \*---------------------------------------------------------------------------*/ 00062 00063 #ifndef turbulentTemperatureCoupledBaffleFvPatchScalarField_H 00064 #define turbulentTemperatureCoupledBaffleFvPatchScalarField_H 00065 00066 #include <finiteVolume/fixedValueFvPatchFields.H> 00067 00068 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00069 00070 namespace Foam 00071 { 00072 00073 /*---------------------------------------------------------------------------*\ 00074 Class turbulentTemperatureCoupledBaffleFvPatchScalarField Declaration 00075 \*---------------------------------------------------------------------------*/ 00076 00077 class turbulentTemperatureCoupledBaffleFvPatchScalarField 00078 : 00079 public fixedValueFvPatchScalarField 00080 { 00081 // Private data 00082 00083 //- Name of field on the neighbour region 00084 const word neighbourFieldName_; 00085 00086 //- Name of thermal conductivity field 00087 const word KName_; 00088 00089 00090 // Private Member Functions 00091 00092 //- Am I or neighbour owner of interface 00093 bool interfaceOwner(const polyMesh&, const polyPatch&) const; 00094 00095 00096 public: 00097 00098 //- Runtime type information 00099 TypeName("compressible::turbulentTemperatureCoupledBaffle"); 00100 00101 00102 // Constructors 00103 00104 //- Construct from patch and internal field 00105 turbulentTemperatureCoupledBaffleFvPatchScalarField 00106 ( 00107 const fvPatch&, 00108 const DimensionedField<scalar, volMesh>& 00109 ); 00110 00111 //- Construct from patch, internal field and dictionary 00112 turbulentTemperatureCoupledBaffleFvPatchScalarField 00113 ( 00114 const fvPatch&, 00115 const DimensionedField<scalar, volMesh>&, 00116 const dictionary& 00117 ); 00118 00119 //- Construct by mapping given 00120 // turbulentTemperatureCoupledBaffleFvPatchScalarField onto a new patch 00121 turbulentTemperatureCoupledBaffleFvPatchScalarField 00122 ( 00123 const turbulentTemperatureCoupledBaffleFvPatchScalarField&, 00124 const fvPatch&, 00125 const DimensionedField<scalar, volMesh>&, 00126 const fvPatchFieldMapper& 00127 ); 00128 00129 //- Construct and return a clone 00130 virtual tmp<fvPatchScalarField> clone() const 00131 { 00132 return tmp<fvPatchScalarField> 00133 ( 00134 new turbulentTemperatureCoupledBaffleFvPatchScalarField(*this) 00135 ); 00136 } 00137 00138 //- Construct as copy setting internal field reference 00139 turbulentTemperatureCoupledBaffleFvPatchScalarField 00140 ( 00141 const turbulentTemperatureCoupledBaffleFvPatchScalarField&, 00142 const DimensionedField<scalar, volMesh>& 00143 ); 00144 00145 //- Construct and return a clone setting internal field reference 00146 virtual tmp<fvPatchScalarField> clone 00147 ( 00148 const DimensionedField<scalar, volMesh>& iF 00149 ) const 00150 { 00151 return tmp<fvPatchScalarField> 00152 ( 00153 new turbulentTemperatureCoupledBaffleFvPatchScalarField 00154 ( 00155 *this, 00156 iF 00157 ) 00158 ); 00159 } 00160 00161 00162 // Member functions 00163 00164 //- Get corresponding K field 00165 tmp<scalarField> K() const; 00166 00167 //- Update the coefficients associated with the patch field 00168 virtual void updateCoeffs(); 00169 00170 //- Write 00171 virtual void write(Ostream&) const; 00172 }; 00173 00174 00175 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00176 00177 } // End namespace Foam 00178 00179 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00180 00181 #endif 00182 00183 // ************************************************************************* //