FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

PhaseChangeModel.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) 2009-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 \*---------------------------------------------------------------------------*/
00025 
00026 #include "PhaseChangeModel.H"
00027 
00028 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
00029 
00030 template<class CloudType>
00031 const Foam::wordList Foam::PhaseChangeModel<CloudType>::
00032 enthalpyTransferTypeNames
00033 (
00034     IStringStream
00035     (
00036         "("
00037             "latentHeat "
00038             "enthalpyDifference"
00039         ")"
00040     )()
00041 );
00042 
00043 
00044 // * * * * * * * * * * * Protected Member Functions  * * * * * * * * * * * * //
00045 
00046 template<class CloudType>
00047 typename Foam::PhaseChangeModel<CloudType>::enthalpyTransferType
00048 Foam::PhaseChangeModel<CloudType>::wordToEnthalpyTransfer(const word& etName)
00049 const
00050 {
00051     forAll(enthalpyTransferTypeNames, i)
00052     {
00053         if (etName == enthalpyTransferTypeNames[i])
00054         {
00055             return enthalpyTransferType(i);
00056         }
00057     }
00058 
00059     FatalErrorIn
00060     (
00061         "PhaseChangeModel<CloudType>::enthalpyTransferType"
00062         "PhaseChangeModel<CloudType>::wordToEnthalpyTransfer(const word&) const"
00063     )   << "Unknown enthalpyType " << etName << ". Valid selections are:" << nl
00064         << enthalpyTransferTypeNames << exit(FatalError);
00065 
00066     return enthalpyTransferType(0);
00067 }
00068 
00069 
00070 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
00071 
00072 template<class CloudType>
00073 Foam::PhaseChangeModel<CloudType>::PhaseChangeModel
00074 (
00075     CloudType& owner
00076 )
00077 :
00078     dict_(dictionary::null),
00079     owner_(owner),
00080     coeffDict_(dictionary::null),
00081     enthalpyTransfer_(etLatentHeat)
00082 {}
00083 
00084 
00085 template<class CloudType>
00086 Foam::PhaseChangeModel<CloudType>::PhaseChangeModel
00087 (
00088     const dictionary& dict,
00089     CloudType& owner,
00090     const word& type
00091 )
00092 :
00093     dict_(dict),
00094     owner_(owner),
00095     coeffDict_(dict.subDict(type + "Coeffs")),
00096     enthalpyTransfer_
00097     (
00098         wordToEnthalpyTransfer(coeffDict_.lookup("enthalpyTransfer"))
00099     )
00100 {}
00101 
00102 
00103 // * * * * * * * * * * * * * * * * Destructor  * * * * * * * * * * * * * * * //
00104 
00105 template<class CloudType>
00106 Foam::PhaseChangeModel<CloudType>::~PhaseChangeModel()
00107 {}
00108 
00109 
00110 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
00111 template<class CloudType>
00112 const CloudType& Foam::PhaseChangeModel<CloudType>::owner() const
00113 {
00114     return owner_;
00115 }
00116 
00117 
00118 template<class CloudType>
00119 const Foam::dictionary& Foam::PhaseChangeModel<CloudType>::dict() const
00120 {
00121     return dict_;
00122 }
00123 
00124 
00125 template<class CloudType>
00126 const Foam::dictionary& Foam::PhaseChangeModel<CloudType>::coeffDict() const
00127 {
00128     return coeffDict_;
00129 }
00130 
00131 
00132 template<class CloudType>
00133 const typename Foam::PhaseChangeModel<CloudType>::enthalpyTransferType&
00134 Foam::PhaseChangeModel<CloudType>::enthalpyTransfer() const
00135 {
00136     return enthalpyTransfer_;
00137 }
00138 
00139 
00140 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00141 
00142 #include "NewPhaseChangeModel.C"
00143 
00144 // ************************ vim: set sw=4 sts=4 et: ************************ //
00145 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines