freestreamVelocityFvPatchVectorField.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 | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2018 OpenFOAM Foundation
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 \*---------------------------------------------------------------------------*/
27 
30 
31 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
32 
34 (
35  const fvPatch& p,
37 )
38 :
39  mixedFvPatchVectorField(p, iF)
40 {}
41 
42 
44 (
45  const fvPatch& p,
47  const dictionary& dict
48 )
49 :
50  mixedFvPatchVectorField(p, iF)
51 {
52  // freestreamValue() and refValue() are identical
53  freestreamValue().assign("freestreamValue", dict, p.size());
54  refGrad() = Zero;
55  valueFraction() = 1;
56 
57  if (!this->readValueEntry(dict))
58  {
60  }
61 }
62 
63 
65 (
66  const freestreamVelocityFvPatchVectorField& ptf,
67  const fvPatch& p,
68  const DimensionedField<vector, volMesh>& iF,
69  const fvPatchFieldMapper& mapper
70 )
71 :
72  mixedFvPatchVectorField(ptf, p, iF, mapper)
73 {}
74 
75 
77 (
79 )
80 :
81  mixedFvPatchVectorField(wbppsf)
82 {}
83 
84 
86 (
89 )
90 :
91  mixedFvPatchVectorField(wbppsf, iF)
92 {}
93 
94 
95 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
96 
98 {
99  if (updated())
100  {
101  return;
102  }
103 
104  const Field<vector>& Up = *this;
106  valueFraction() = 0.5 - 0.5*(Up & patch().nf())/mag(Up);
107 
109 }
110 
111 
113 {
115  freestreamValue().writeEntry("freestreamValue", os);
117 }
118 
119 
120 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
121 
122 namespace Foam
123 {
125  (
127  freestreamVelocityFvPatchVectorField
128  );
129 }
130 
131 // ************************************************************************* //
dictionary dict
fvPatchField< vector > fvPatchVectorField
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:129
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:70
void writeValueEntry(Ostream &os) const
Write *this field as a "value" entry.
Definition: fvPatchField.H:375
virtual void write(Ostream &) const
Write.
Definition: fvPatchField.C:372
Macros for easy insertion into run-time selection tables.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
const vectorField & freestreamValue() const
Same as refValue()
This boundary condition provides a free-stream condition for velocity.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:56
OBJstream os(runTime.globalPath()/outputName)
void assign(const entry &e, const label len)
Assign from a primitive dictionary entry with the following behaviour:
Definition: Field.C:207
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Definition: fvPatchField.C:309
virtual void operator=(const UList< vector > &)
Definition: fvPatchField.C:391
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: areaFieldsFwd.H:42
freestreamVelocityFvPatchVectorField(const fvPatch &, const DimensionedField< vector, volMesh > &)
Construct from patch and internal field.
const std::string patch
OpenFOAM patch number as a std::string.
volScalarField & p
makePatchTypeField(fvPatchScalarField, atmBoundaryLayerInletEpsilonFvPatchScalarField)
Namespace for OpenFOAM.
static constexpr const zero Zero
Global zero (0)
Definition: zero.H:127