1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
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 "filmHeightInletVelocityFvPatchVectorField.H"
27 #include "addToRunTimeSelectionTable.H"
28 #include "volFields.H"
29 #include "surfaceFields.H"
31 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
33 Foam::filmHeightInletVelocityFvPatchVectorField::
34 filmHeightInletVelocityFvPatchVectorField
37 const DimensionedField<vector, volMesh>& iF
40 fixedValueFvPatchVectorField(p, iF),
47 Foam::filmHeightInletVelocityFvPatchVectorField::
48 filmHeightInletVelocityFvPatchVectorField
50 const filmHeightInletVelocityFvPatchVectorField& ptf,
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
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()
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 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
162 filmHeightInletVelocityFvPatchVectorField
167 // ************************************************************************* //