OpenFOAM logo
The Open Source CFD Toolbox
  Source Guide OpenCFD Solutions Contact OpenFOAM

solidWallMixedTemperatureCoupledFvPatchScalarField.H

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------------*\
00002   =========                 |
00003   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
00004    \\    /   O peration     |
00005     \\  /    A nd           | Copyright (C) 1991-2009 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 the
00013     Free Software Foundation; either version 2 of the License, or (at your
00014     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, write to the Free Software Foundation,
00023     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
00024 
00025 Class
00026     solidWallMixedTemperatureCoupledFvPatchScalarField
00027 
00028 Description
00029     Mixed boundary condition for temperature, to be used by the
00030     conjugate heat transfer solver.
00031     If my temperature is T1, neighbour is T2:
00032 
00033     T1 > T2: my side becomes fixedValue T2 bc, other side becomes fixedGradient.
00034     
00035 
00036     Example usage:
00037         myInterfacePatchName
00038         {
00039             type                solidWallMixedTemperatureCoupled;
00040             neighbourFieldName  T;
00041             K                   K;
00042             value               uniform 300;
00043         }
00044 
00045     Needs to be on underlying directMapped(Wall)FvPatch.
00046 
00047     Note: runs in parallel with arbitrary decomposition. Uses directMapped
00048     functionality to calculate exchange.
00049 
00050     Note: lags interface data so both sides use same data.
00051     - problem: schedule to calculate average would interfere
00052     with standard processor swaps.
00053     - so: updateCoeffs sets both to same Twall. Only need to do
00054     this for last outer iteration but don't have access to this.
00055 
00056 SourceFiles
00057     solidWallMixedTemperatureCoupledFvPatchScalarField.C
00058 
00059 \*---------------------------------------------------------------------------*/
00060 
00061 #ifndef solidWallMixedTemperatureCoupledFvPatchScalarField_H
00062 #define solidWallMixedTemperatureCoupledFvPatchScalarField_H
00063 
00064 #include "fvPatchFields.H"
00065 #include "mixedFvPatchFields.H"
00066 #include "fvPatch.H"
00067 
00068 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00069 
00070 namespace Foam
00071 {
00072 
00073 /*---------------------------------------------------------------------------*\
00074         Class solidWallMixedTemperatureCoupledFvPatchScalarField Declaration
00075 \*---------------------------------------------------------------------------*/
00076 
00077 class solidWallMixedTemperatureCoupledFvPatchScalarField
00078 :
00079     public mixedFvPatchScalarField
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         bool fixesValue_;
00090 
00091 
00092     // Private Member Functions
00093 
00094         //- Am I or neighbour owner of interface
00095         bool interfaceOwner(const polyMesh& nbrRegion) const;
00096 
00097 
00098 public:
00099 
00100     //- Runtime type information
00101     TypeName("solidWallMixedTemperatureCoupled");
00102 
00103 
00104     // Constructors
00105 
00106         //- Construct from patch and internal field
00107         solidWallMixedTemperatureCoupledFvPatchScalarField
00108         (
00109             const fvPatch&,
00110             const DimensionedField<scalar, volMesh>&
00111         );
00112 
00113         //- Construct from patch, internal field and dictionary
00114         solidWallMixedTemperatureCoupledFvPatchScalarField
00115         (
00116             const fvPatch&,
00117             const DimensionedField<scalar, volMesh>&,
00118             const dictionary&
00119         );
00120 
00121         //- Construct by mapping given
00122         //  solidWallMixedTemperatureCoupledFvPatchScalarField onto a new patch
00123         solidWallMixedTemperatureCoupledFvPatchScalarField
00124         (
00125             const solidWallMixedTemperatureCoupledFvPatchScalarField&,
00126             const fvPatch&,
00127             const DimensionedField<scalar, volMesh>&,
00128             const fvPatchFieldMapper&
00129         );
00130 
00131         //- Construct and return a clone
00132         virtual tmp<fvPatchScalarField> clone() const
00133         {
00134             return tmp<fvPatchScalarField>
00135             (
00136                 new solidWallMixedTemperatureCoupledFvPatchScalarField(*this)
00137             );
00138         }
00139 
00140         //- Construct as copy setting internal field reference
00141         solidWallMixedTemperatureCoupledFvPatchScalarField
00142         (
00143             const solidWallMixedTemperatureCoupledFvPatchScalarField&,
00144             const DimensionedField<scalar, volMesh>&
00145         );
00146 
00147         //- Construct and return a clone setting internal field reference
00148         virtual tmp<fvPatchScalarField> clone
00149         (
00150             const DimensionedField<scalar, volMesh>& iF
00151         ) const
00152         {
00153             return tmp<fvPatchScalarField>
00154             (
00155                 new solidWallMixedTemperatureCoupledFvPatchScalarField
00156                 (
00157                     *this,
00158                     iF
00159                 )
00160             );
00161         }
00162 
00163 
00164     // Member functions
00165 
00166         //- Get corresponding K field
00167         const fvPatchScalarField& K() const;
00168 
00169         //- Return true if this patch field fixes a value.
00170         //  Needed to check if a level has to be specified while solving
00171         //  Poissons equations.
00172         virtual bool fixesValue() const
00173         {
00174             return fixesValue_;
00175         }
00176 
00177         //- Update the coefficients associated with the patch field
00178         virtual void updateCoeffs();
00179 
00180         //- Write
00181         virtual void write(Ostream&) const;
00182 };
00183 
00184 
00185 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00186 
00187 } // End namespace Foam
00188 
00189 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00190 
00191 #endif
00192 
00193 // ************************************************************************* //
Copyright © 2000-2009 OpenCFD Ltd