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

solidWallHeatFluxTemperatureFvPatchScalarField.C

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 \*---------------------------------------------------------------------------*/
00026 
00027 #include "solidWallHeatFluxTemperatureFvPatchScalarField.H"
00028 #include "addToRunTimeSelectionTable.H"
00029 #include "fvPatchFieldMapper.H"
00030 #include "volFields.H"
00031 
00032 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
00033 
00034 Foam::solidWallHeatFluxTemperatureFvPatchScalarField::
00035 solidWallHeatFluxTemperatureFvPatchScalarField
00036 (
00037     const fvPatch& p,
00038     const DimensionedField<scalar, volMesh>& iF
00039 )
00040 :
00041     fixedValueFvPatchScalarField(p, iF),
00042     q_(p.size(), 0.0),
00043     KName_("undefined-K")
00044 {}
00045 
00046 
00047 Foam::solidWallHeatFluxTemperatureFvPatchScalarField::
00048 solidWallHeatFluxTemperatureFvPatchScalarField
00049 (
00050     const solidWallHeatFluxTemperatureFvPatchScalarField& ptf,
00051     const fvPatch& p,
00052     const DimensionedField<scalar, volMesh>& iF,
00053     const fvPatchFieldMapper& mapper
00054 )
00055 :
00056     fixedValueFvPatchScalarField(ptf, p, iF, mapper),
00057     q_(ptf.q_, mapper),
00058     KName_(ptf.KName_)
00059 {}
00060 
00061 
00062 Foam::solidWallHeatFluxTemperatureFvPatchScalarField::
00063 solidWallHeatFluxTemperatureFvPatchScalarField
00064 (
00065     const fvPatch& p,
00066     const DimensionedField<scalar, volMesh>& iF,
00067     const dictionary& dict
00068 )
00069 :
00070     fixedValueFvPatchScalarField(p, iF, dict),
00071     q_("q", dict, p.size()),
00072     KName_(dict.lookup("K"))
00073 {}
00074 
00075 
00076 Foam::solidWallHeatFluxTemperatureFvPatchScalarField::
00077 solidWallHeatFluxTemperatureFvPatchScalarField
00078 (
00079     const solidWallHeatFluxTemperatureFvPatchScalarField& tppsf
00080 )
00081 :
00082     fixedValueFvPatchScalarField(tppsf),
00083     q_(tppsf.q_),
00084     KName_(tppsf.KName_)
00085 {}
00086 
00087 
00088 Foam::solidWallHeatFluxTemperatureFvPatchScalarField::
00089 solidWallHeatFluxTemperatureFvPatchScalarField
00090 (
00091     const solidWallHeatFluxTemperatureFvPatchScalarField& tppsf,
00092     const DimensionedField<scalar, volMesh>& iF
00093 )
00094 :
00095     fixedValueFvPatchScalarField(tppsf, iF),
00096     q_(tppsf.q_),
00097     KName_(tppsf.KName_)
00098 {}
00099 
00100 
00101 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
00102 
00103 void Foam::solidWallHeatFluxTemperatureFvPatchScalarField::autoMap
00104 (
00105     const fvPatchFieldMapper& m
00106 )
00107 {
00108     fixedValueFvPatchScalarField::autoMap(m);
00109     q_.autoMap(m);
00110 }
00111 
00112 
00113 void Foam::solidWallHeatFluxTemperatureFvPatchScalarField::rmap
00114 (
00115     const fvPatchScalarField& ptf,
00116     const labelList& addr
00117 )
00118 {
00119     fixedValueFvPatchScalarField::rmap(ptf, addr);
00120 
00121     const solidWallHeatFluxTemperatureFvPatchScalarField& hfptf =
00122         refCast<const solidWallHeatFluxTemperatureFvPatchScalarField>(ptf);
00123 
00124     q_.rmap(hfptf.q_, addr);
00125 }
00126 
00127 
00128 void Foam::solidWallHeatFluxTemperatureFvPatchScalarField::updateCoeffs()
00129 {
00130     if (updated())
00131     {
00132         return;
00133     }
00134 
00135     const scalarField& Kw =
00136         patch().lookupPatchField<volScalarField, scalar>(KName_);
00137 
00138     const fvPatchScalarField& Tw = *this;
00139 
00140     operator==(q_/(patch().deltaCoeffs()*Kw) + Tw.patchInternalField());
00141 
00142     fixedValueFvPatchScalarField::updateCoeffs();
00143 }
00144 
00145 
00146 void Foam::solidWallHeatFluxTemperatureFvPatchScalarField::write
00147 (
00148     Ostream& os
00149 ) const
00150 {
00151     fixedValueFvPatchScalarField::write(os);
00152     q_.writeEntry("q", os);
00153     os.writeKeyword("K") << KName_ << token::END_STATEMENT << nl;
00154 }
00155 
00156 
00157 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00158 
00159 namespace Foam
00160 {
00161     makePatchTypeField
00162     (
00163         fvPatchScalarField,
00164         solidWallHeatFluxTemperatureFvPatchScalarField
00165     );
00166 }
00167 
00168 // ************************************************************************* //
Copyright © 2000-2009 OpenCFD Ltd