BUG: UListIO: byteSize overflowing on really big faceLists
[OpenFOAM-2.0.x.git] / src / regionModels / surfaceFilmModels / derivedFvPatchFields / filmHeightInletVelocity / filmHeightInletVelocityFvPatchVectorField.C
blob41fec4b2eb08adfa209383a5bc11e3b72ad03b7b
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 2011 OpenFOAM Foundation
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
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
19     for more details.
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 "filmHeightInletVelocityFvPatchVectorField.H"
27 #include "addToRunTimeSelectionTable.H"
28 #include "volFields.H"
29 #include "surfaceFields.H"
31 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
33 Foam::filmHeightInletVelocityFvPatchVectorField::
34 filmHeightInletVelocityFvPatchVectorField
36     const fvPatch& p,
37     const DimensionedField<vector, volMesh>& iF
40     fixedValueFvPatchVectorField(p, iF),
41     phiName_("phi"),
42     rhoName_("rho"),
43     deltafName_("deltaf")
47 Foam::filmHeightInletVelocityFvPatchVectorField::
48 filmHeightInletVelocityFvPatchVectorField
50     const filmHeightInletVelocityFvPatchVectorField& ptf,
51     const fvPatch& p,
52     const DimensionedField<vector, volMesh>& iF,
53     const fvPatchFieldMapper& mapper
56     fixedValueFvPatchVectorField(ptf, p, iF, mapper),
57     phiName_(ptf.phiName_),
58     rhoName_(ptf.rhoName_),
59     deltafName_(ptf.deltafName_)
63 Foam::filmHeightInletVelocityFvPatchVectorField::
64 filmHeightInletVelocityFvPatchVectorField
66     const fvPatch& p,
67     const DimensionedField<vector, volMesh>& iF,
68     const dictionary& dict
71     fixedValueFvPatchVectorField(p, iF),
72     phiName_(dict.lookupOrDefault<word>("phi", "phi")),
73     rhoName_(dict.lookupOrDefault<word>("rho", "rho")),
74     deltafName_(dict.lookupOrDefault<word>("deltaf", "deltaf"))
76     fvPatchVectorField::operator=(vectorField("value", dict, p.size()));
80 Foam::filmHeightInletVelocityFvPatchVectorField::
81 filmHeightInletVelocityFvPatchVectorField
83     const filmHeightInletVelocityFvPatchVectorField& fhivpvf
86     fixedValueFvPatchVectorField(fhivpvf),
87     phiName_(fhivpvf.phiName_),
88     rhoName_(fhivpvf.rhoName_),
89     deltafName_(fhivpvf.deltafName_)
93 Foam::filmHeightInletVelocityFvPatchVectorField::
94 filmHeightInletVelocityFvPatchVectorField
96     const filmHeightInletVelocityFvPatchVectorField& fhivpvf,
97     const DimensionedField<vector, volMesh>& iF
100     fixedValueFvPatchVectorField(fhivpvf, iF),
101     phiName_(fhivpvf.phiName_),
102     rhoName_(fhivpvf.rhoName_),
103     deltafName_(fhivpvf.deltafName_)
107 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
109 void Foam::filmHeightInletVelocityFvPatchVectorField::updateCoeffs()
111     if (updated())
112     {
113         return;
114     }
116     const fvsPatchField<scalar>& phip =
117         patch().lookupPatchField<surfaceScalarField, scalar>(phiName_);
119     const fvPatchField<scalar>& rhop =
120         patch().lookupPatchField<volScalarField, scalar>(rhoName_);
122     const fvPatchField<scalar>& deltafp =
123         patch().lookupPatchField<volScalarField, scalar>(deltafName_);
125     vectorField n(patch().nf());
126     const scalarField& magSf = patch().magSf();
128     operator==(n*phip/(rhop*magSf*deltafp + ROOTVSMALL));
130     fixedValueFvPatchVectorField::updateCoeffs();
134 void Foam::filmHeightInletVelocityFvPatchVectorField::write(Ostream& os) const
136     fvPatchVectorField::write(os);
137     writeEntryIfDifferent<word>(os, "phi", "phi", phiName_);
138     writeEntryIfDifferent<word>(os, "rho", "rho", rhoName_);
139     writeEntryIfDifferent<word>(os, "deltaf", "deltaf", deltafName_);
140     writeEntry("value", os);
144 // * * * * * * * * * * * * * * * Member Operators  * * * * * * * * * * * * * //
146 void Foam::filmHeightInletVelocityFvPatchVectorField::operator=
148     const fvPatchField<vector>& pvf
151     fvPatchField<vector>::operator=(patch().nf()*(patch().nf() & pvf));
155 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
157 namespace Foam
159     makePatchTypeField
160     (
161         fvPatchVectorField,
162         filmHeightInletVelocityFvPatchVectorField
163     );
167 // ************************************************************************* //