1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
11 OpenFOAM is free software: you can redistribute it and/or modify it
12 under the terms of the GNU General Public License as published by
13 the Free Software Foundation, either version 3 of the License, or
14 (at your option) any later version.
16 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 You should have received a copy of the GNU General Public License
22 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
24 \*---------------------------------------------------------------------------*/
26 #include "freestreamFvPatchField.H"
28 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
33 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
36 freestreamFvPatchField<Type>::freestreamFvPatchField
39 const DimensionedField<Type, volMesh>& iF
42 inletOutletFvPatchField<Type>(p, iF)
47 freestreamFvPatchField<Type>::freestreamFvPatchField
49 const freestreamFvPatchField<Type>& ptf,
51 const DimensionedField<Type, volMesh>& iF,
52 const fvPatchFieldMapper& mapper
55 inletOutletFvPatchField<Type>(ptf, p, iF, mapper)
60 freestreamFvPatchField<Type>::freestreamFvPatchField
63 const DimensionedField<Type, volMesh>& iF,
64 const dictionary& dict
67 inletOutletFvPatchField<Type>(p, iF)
69 freestreamValue() = Field<Type>("freestreamValue", dict, p.size());
71 if (dict.found("value"))
73 fvPatchField<Type>::operator=
75 Field<Type>("value", dict, p.size())
80 fvPatchField<Type>::operator=(freestreamValue());
83 dict.readIfPresent("phi", this->phiName_);
88 freestreamFvPatchField<Type>::freestreamFvPatchField
90 const freestreamFvPatchField<Type>& ptf
93 inletOutletFvPatchField<Type>(ptf)
98 freestreamFvPatchField<Type>::freestreamFvPatchField
100 const freestreamFvPatchField<Type>& ptf,
101 const DimensionedField<Type, volMesh>& iF
104 inletOutletFvPatchField<Type>(ptf, iF)
108 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
111 void freestreamFvPatchField<Type>::write(Ostream& os) const
113 fvPatchField<Type>::write(os);
114 if (this->phiName_ != "phi")
116 os.writeKeyword("phi")
117 << this->phiName_ << token::END_STATEMENT << nl;
119 freestreamValue().writeEntry("freestreamValue", os);
120 this->writeEntry("value", os);
124 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
126 } // End namespace Foam
128 // ************************************************************************* //