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 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(), vector::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::fvPatchField
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
Definition: fvPatchField.H:65
volFields.H
Foam::fvPatchField::write
virtual void write(Ostream &) const
Write.
Definition: fvPatchField.C:349
Foam::interstitialInletVelocityFvPatchVectorField::inletVelocity_
vectorField inletVelocity_
Inlet velocity.
Definition: interstitialInletVelocityFvPatchVectorField.H:66
p
p
Definition: pEqn.H:62
Foam::word
A class for handling words, derived from string.
Definition: word.H:59
interstitialInletVelocityFvPatchVectorField.H
Foam::operator==
tmp< fvMatrix< Type > > operator==(const fvMatrix< Type > &, const fvMatrix< Type > &)
surfaceFields.H
Foam::surfaceFields.
fvPatchFieldMapper.H
Foam::interstitialInletVelocityFvPatchVectorField::rmap
virtual void rmap(const fvPatchVectorField &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
Definition: interstitialInletVelocityFvPatchVectorField.C:114
Foam::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:61
Foam::volScalarField
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:52
Foam::interstitialInletVelocityFvPatchVectorField::alphaName_
word alphaName_
Name of the flux transporting the field.
Definition: interstitialInletVelocityFvPatchVectorField.H:69
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:137
Foam::interstitialInletVelocityFvPatchVectorField::autoMap
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
Definition: interstitialInletVelocityFvPatchVectorField.C:104
addToRunTimeSelectionTable.H
Macros for easy insertion into run-time selection tables.
Foam::interstitialInletVelocityFvPatchVectorField
Inlet velocity in which the actual interstitial velocity is calculated by dividing the specified inle...
Definition: interstitialInletVelocityFvPatchVectorField.H:59
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::makePatchTypeField
makePatchTypeField(fvPatchVectorField, SRFFreestreamVelocityFvPatchVectorField)
Foam::List
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: HashTable.H:59
Foam::fvPatchFieldMapper
Foam::fvPatchFieldMapper.
Definition: fvPatchFieldMapper.H:45
Foam::interstitialInletVelocityFvPatchVectorField::updateCoeffs
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Definition: interstitialInletVelocityFvPatchVectorField.C:128
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:53
Foam::interstitialInletVelocityFvPatchVectorField::write
virtual void write(Ostream &) const
Write.
Definition: interstitialInletVelocityFvPatchVectorField.C:143
Foam::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:51
Foam::interstitialInletVelocityFvPatchVectorField::interstitialInletVelocityFvPatchVectorField
interstitialInletVelocityFvPatchVectorField(const fvPatch &, const DimensionedField< vector, volMesh > &)
Construct from patch and internal field.
Definition: interstitialInletVelocityFvPatchVectorField.C:36