interstitialInletVelocityFvPatchVectorField.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
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.
15 
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.
20 
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/>.
23 
24 \*---------------------------------------------------------------------------*/
25 
27 #include "volFields.H"
29 #include "fvPatchFieldMapper.H"
30 #include "surfaceFields.H"
31 
32 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
33 
36 (
37  const fvPatch& p,
39 )
40 :
41  fixedValueFvPatchVectorField(p, iF),
42  inletVelocity_(p.size(), Zero),
43  alphaName_("alpha")
44 {}
45 
46 
49 (
51  const fvPatch& p,
53  const fvPatchFieldMapper& mapper
54 )
55 :
56  fixedValueFvPatchVectorField(ptf, p, iF, mapper),
57  inletVelocity_(ptf.inletVelocity_, mapper),
58  alphaName_(ptf.alphaName_)
59 {}
60 
61 
64 (
65  const fvPatch& p,
67  const dictionary& dict
68 )
69 :
70  fixedValueFvPatchVectorField(p, iF, dict),
71  inletVelocity_("inletVelocity", dict, p.size()),
72  alphaName_(dict.lookupOrDefault<word>("alpha", "alpha"))
73 {}
74 
75 
78 (
80 )
81 :
82  fixedValueFvPatchVectorField(ptf),
83  inletVelocity_(ptf.inletVelocity_),
84  alphaName_(ptf.alphaName_)
85 {}
86 
87 
90 (
93 )
94 :
95  fixedValueFvPatchVectorField(ptf, iF),
96  inletVelocity_(ptf.inletVelocity_),
97  alphaName_(ptf.alphaName_)
98 {}
99 
100 
101 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
102 
104 (
105  const fvPatchFieldMapper& m
106 )
107 {
108  fixedValueFvPatchVectorField::autoMap(m);
109  inletVelocity_.autoMap(m);
110 }
111 
112 
114 (
115  const fvPatchVectorField& ptf,
116  const labelList& addr
117 )
118 {
119  fixedValueFvPatchVectorField::rmap(ptf, addr);
120 
122  refCast<const interstitialInletVelocityFvPatchVectorField>(ptf);
123 
124  inletVelocity_.rmap(tiptf.inletVelocity_, addr);
125 }
126 
127 
129 {
130  if (updated())
131  {
132  return;
133  }
134 
135  const fvPatchField<scalar>& alphap =
136  patch().lookupPatchField<volScalarField, scalar>(alphaName_);
137 
138  operator==(inletVelocity_/alphap);
139  fixedValueFvPatchVectorField::updateCoeffs();
140 }
141 
142 
144 {
146  writeEntryIfDifferent<word>(os, "alpha", "alpha", alphaName_);
147  inletVelocity_.writeEntry("inletVelocity", os);
148  writeEntry("value", os);
149 }
150 
151 
152 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
153 
154 namespace Foam
155 {
157  (
160  );
161 }
162 
163 
164 // ************************************************************************* //
Foam::surfaceFields.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:61
void writeEntry(const word &keyword, Ostream &os) const
Write the field as a dictionary entry.
Definition: Field.C:719
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
Definition: fvPatchField.H:65
Macros for easy insertion into run-time selection tables.
interstitialInletVelocityFvPatchVectorField(const fvPatch &, const DimensionedField< vector, volMesh > &)
Construct from patch and internal field.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:52
makePatchTypeField(fvPatchVectorField, SRFFreestreamVelocityFvPatchVectorField)
tmp< fvMatrix< Type > > operator==(const fvMatrix< Type > &, const fvMatrix< Type > &)
A class for handling words, derived from string.
Definition: word.H:59
Foam::fvPatchFieldMapper.
virtual label size() const
Return size.
Definition: fvPatch.H:161
static const zero Zero
Definition: zero.H:91
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:53
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Inlet velocity in which the actual interstitial velocity is calculated by dividing the specified inle...
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
virtual void rmap(const fvPatchVectorField &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
T lookupOrDefault(const word &, const T &, bool recursive=false, bool patternMatch=true) const
Find and return a T,.
Namespace for OpenFOAM.
virtual void write(Ostream &) const
Write.
Definition: fvPatchField.C:363