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

mixedEnthalpyFvPatchScalarField.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 "mixedEnthalpyFvPatchScalarField.H"
00028 #include "addToRunTimeSelectionTable.H"
00029 #include "fvPatchFieldMapper.H"
00030 #include "volFields.H"
00031 #include "basicThermo.H"
00032 
00033 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00034 
00035 namespace Foam
00036 {
00037 
00038 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
00039 
00040 mixedEnthalpyFvPatchScalarField::mixedEnthalpyFvPatchScalarField
00041 (
00042     const fvPatch& p,
00043     const DimensionedField<scalar, volMesh>& iF
00044 )
00045 :
00046     mixedFvPatchScalarField(p, iF)
00047 {
00048     valueFraction() = 0.0;
00049     refValue() = 0.0;
00050     refGrad() = 0.0;
00051 }
00052 
00053 
00054 mixedEnthalpyFvPatchScalarField::mixedEnthalpyFvPatchScalarField
00055 (
00056     const mixedEnthalpyFvPatchScalarField& ptf,
00057     const fvPatch& p,
00058     const DimensionedField<scalar, volMesh>& iF,
00059     const fvPatchFieldMapper& mapper
00060 )
00061 :
00062     mixedFvPatchScalarField(ptf, p, iF, mapper)
00063 {}
00064 
00065 
00066 mixedEnthalpyFvPatchScalarField::mixedEnthalpyFvPatchScalarField
00067 (
00068     const fvPatch& p,
00069     const DimensionedField<scalar, volMesh>& iF,
00070     const dictionary& dict
00071 )
00072 :
00073     mixedFvPatchScalarField(p, iF, dict)
00074 {}
00075 
00076 
00077 mixedEnthalpyFvPatchScalarField::mixedEnthalpyFvPatchScalarField
00078 (
00079     const mixedEnthalpyFvPatchScalarField& tppsf
00080 )
00081 :
00082     mixedFvPatchScalarField(tppsf)
00083 {}
00084 
00085 
00086 mixedEnthalpyFvPatchScalarField::mixedEnthalpyFvPatchScalarField
00087 (
00088     const mixedEnthalpyFvPatchScalarField& tppsf,
00089     const DimensionedField<scalar, volMesh>& iF
00090 )
00091 :
00092     mixedFvPatchScalarField(tppsf, iF)
00093 {}
00094 
00095 
00096 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
00097 
00098 void mixedEnthalpyFvPatchScalarField::updateCoeffs()
00099 {
00100     if (updated())
00101     {
00102         return;
00103     }
00104 
00105     const basicThermo& thermo = db().lookupObject<basicThermo>
00106     (
00107         "thermophysicalProperties"
00108     );
00109     
00110     const label patchi = patch().index();
00111 
00112     mixedFvPatchScalarField& Tw = refCast<mixedFvPatchScalarField>
00113     (
00114         const_cast<fvPatchScalarField&>(thermo.T().boundaryField()[patchi])
00115     );
00116 
00117     Tw.evaluate();
00118 
00119     valueFraction() = Tw.valueFraction();
00120     refValue() = thermo.h(Tw.refValue(), patchi);
00121     refGrad() = thermo.Cp(Tw, patchi)*Tw.refGrad()
00122       + patch().deltaCoeffs()*
00123         (
00124             thermo.h(Tw, patchi)
00125           - thermo.h(Tw, patch().faceCells())
00126         );
00127 
00128     mixedFvPatchScalarField::updateCoeffs();
00129 }
00130 
00131 
00132 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00133 
00134 makePatchTypeField(fvPatchScalarField, mixedEnthalpyFvPatchScalarField);
00135 
00136 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00137 
00138 } // End namespace Foam
00139 
00140 // ************************************************************************* //
Copyright © 2000-2009 OpenCFD Ltd