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

freestreamFvPatchField.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-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 <finiteVolume/freestreamFvPatchField.H>
00027 
00028 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00029 
00030 namespace Foam
00031 {
00032 
00033 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
00034 
00035 template<class Type>
00036 freestreamFvPatchField<Type>::freestreamFvPatchField
00037 (
00038     const fvPatch& p,
00039     const DimensionedField<Type, volMesh>& iF
00040 )
00041 :
00042     inletOutletFvPatchField<Type>(p, iF)
00043 {}
00044 
00045 
00046 template<class Type>
00047 freestreamFvPatchField<Type>::freestreamFvPatchField
00048 (
00049     const freestreamFvPatchField<Type>& ptf,
00050     const fvPatch& p,
00051     const DimensionedField<Type, volMesh>& iF,
00052     const fvPatchFieldMapper& mapper
00053 )
00054 :
00055     inletOutletFvPatchField<Type>(ptf, p, iF, mapper)
00056 {}
00057 
00058 
00059 template<class Type>
00060 freestreamFvPatchField<Type>::freestreamFvPatchField
00061 (
00062     const fvPatch& p,
00063     const DimensionedField<Type, volMesh>& iF,
00064     const dictionary& dict
00065 )
00066 :
00067     inletOutletFvPatchField<Type>(p, iF)
00068 {
00069     freestreamValue() = Field<Type>("freestreamValue", dict, p.size());
00070 
00071     if (dict.found("value"))
00072     {
00073         fvPatchField<Type>::operator=
00074         (
00075             Field<Type>("value", dict, p.size())
00076         );
00077     }
00078     else
00079     {
00080         fvPatchField<Type>::operator=(freestreamValue());
00081     }
00082 
00083     if (dict.found("phi"))
00084     {
00085         dict.lookup("phi") >> this->phiName_;
00086     }
00087 }
00088 
00089 
00090 template<class Type>
00091 freestreamFvPatchField<Type>::freestreamFvPatchField
00092 (
00093     const freestreamFvPatchField<Type>& ptf
00094 )
00095 :
00096     inletOutletFvPatchField<Type>(ptf)
00097 {}
00098 
00099 
00100 template<class Type>
00101 freestreamFvPatchField<Type>::freestreamFvPatchField
00102 (
00103     const freestreamFvPatchField<Type>& ptf,
00104     const DimensionedField<Type, volMesh>& iF
00105 )
00106 :
00107     inletOutletFvPatchField<Type>(ptf, iF)
00108 {}
00109 
00110 
00111 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
00112 
00113 template<class Type>
00114 void freestreamFvPatchField<Type>::write(Ostream& os) const
00115 {
00116     fvPatchField<Type>::write(os);
00117     if (this->phiName_ != "phi")
00118     {
00119         os.writeKeyword("phi")
00120             << this->phiName_ << token::END_STATEMENT << nl;
00121     }
00122     freestreamValue().writeEntry("freestreamValue", os);
00123     this->writeEntry("value", os);
00124 }
00125 
00126 
00127 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00128 
00129 } // End namespace Foam
00130 
00131 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines