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 solidWallHeatFluxTemperatureFvPatchScalarField 00026 00027 Description 00028 Heat flux boundary condition for temperature on solid region 00029 00030 Example usage: 00031 myWallPatch 00032 { 00033 type solidWallHeatFluxTemperature; 00034 K K; // Name of K field 00035 q uniform 1000; // Heat flux / [W/m2] 00036 value uniform 300.0; // Initial temperature / [K] 00037 gradient uniform 0.0; // Initial gradient / [K/m] 00038 } 00039 00040 00041 SourceFiles 00042 solidWallHeatFluxTemperatureFvPatchScalarField.C 00043 00044 \*---------------------------------------------------------------------------*/ 00045 00046 #ifndef solidWallHeatFluxTemperatureFvPatchScalarField_H 00047 #define solidWallHeatFluxTemperatureFvPatchScalarField_H 00048 00049 #include <finiteVolume/fixedGradientFvPatchFields.H> 00050 00051 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00052 00053 namespace Foam 00054 { 00055 00056 /*---------------------------------------------------------------------------*\ 00057 Class solidWallHeatFluxTemperatureFvPatchScalarField Declaration 00058 \*---------------------------------------------------------------------------*/ 00059 00060 class solidWallHeatFluxTemperatureFvPatchScalarField 00061 : 00062 public fixedGradientFvPatchScalarField 00063 { 00064 // Private data 00065 00066 //- Heat flux / [W/m2] 00067 scalarField q_; 00068 00069 //- Name of thermal conductivity field 00070 word KName_; 00071 00072 00073 public: 00074 00075 //- Runtime type information 00076 TypeName("solidWallHeatFluxTemperature"); 00077 00078 00079 // Constructors 00080 00081 //- Construct from patch and internal field 00082 solidWallHeatFluxTemperatureFvPatchScalarField 00083 ( 00084 const fvPatch&, 00085 const DimensionedField<scalar, volMesh>& 00086 ); 00087 00088 //- Construct from patch, internal field and dictionary 00089 solidWallHeatFluxTemperatureFvPatchScalarField 00090 ( 00091 const fvPatch&, 00092 const DimensionedField<scalar, volMesh>&, 00093 const dictionary& 00094 ); 00095 00096 //- Construct by mapping given 00097 // solidWallHeatFluxTemperatureFvPatchScalarField 00098 // onto a new patch 00099 solidWallHeatFluxTemperatureFvPatchScalarField 00100 ( 00101 const solidWallHeatFluxTemperatureFvPatchScalarField&, 00102 const fvPatch&, 00103 const DimensionedField<scalar, volMesh>&, 00104 const fvPatchFieldMapper& 00105 ); 00106 00107 //- Construct as copy 00108 solidWallHeatFluxTemperatureFvPatchScalarField 00109 ( 00110 const solidWallHeatFluxTemperatureFvPatchScalarField& 00111 ); 00112 00113 //- Construct and return a clone 00114 virtual tmp<fvPatchScalarField> clone() const 00115 { 00116 return tmp<fvPatchScalarField> 00117 ( 00118 new solidWallHeatFluxTemperatureFvPatchScalarField(*this) 00119 ); 00120 } 00121 00122 //- Construct as copy setting internal field reference 00123 solidWallHeatFluxTemperatureFvPatchScalarField 00124 ( 00125 const solidWallHeatFluxTemperatureFvPatchScalarField&, 00126 const DimensionedField<scalar, volMesh>& 00127 ); 00128 00129 //- Construct and return a clone setting internal field reference 00130 virtual tmp<fvPatchScalarField> clone 00131 ( 00132 const DimensionedField<scalar, volMesh>& iF 00133 ) const 00134 { 00135 return tmp<fvPatchScalarField> 00136 ( 00137 new solidWallHeatFluxTemperatureFvPatchScalarField(*this, iF) 00138 ); 00139 } 00140 00141 00142 // Member functions 00143 00144 // Helper 00145 00146 //- Get K field on this patch 00147 tmp<scalarField> K() const; 00148 00149 // Evaluation functions 00150 00151 //- Update the coefficients associated with the patch field 00152 virtual void updateCoeffs(); 00153 00154 00155 // Mapping functions 00156 00157 //- Map (and resize as needed) from self given a mapping object 00158 virtual void autoMap 00159 ( 00160 const fvPatchFieldMapper& 00161 ); 00162 00163 //- Reverse map the given fvPatchField onto this fvPatchField 00164 virtual void rmap 00165 ( 00166 const fvPatchScalarField&, 00167 const labelList& 00168 ); 00169 00170 00171 // I-O 00172 00173 //- Write 00174 void write(Ostream&) const; 00175 }; 00176 00177 00178 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00179 00180 } // End namespace Foam 00181 00182 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00183 00184 #endif 00185 00186 // ************************ vim: set sw=4 sts=4 et: ************************ //