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() = vectorField("freestreamValue", dict, p.size());
53 
54  if (dict.found("value"))
55  {
57  (
58  vectorField("value", dict, p.size())
59  );
60  }
61  else
62  {
64  }
65 
66  refGrad() = Zero;
67  valueFraction() = 1;
68 }
69 
70 
72 (
74  const fvPatch& p,
76  const fvPatchFieldMapper& mapper
77 )
78 :
79  mixedFvPatchVectorField(ptf, p, iF, mapper)
80 {}
81 
82 
84 (
86 )
87 :
88  mixedFvPatchVectorField(wbppsf)
89 {}
90 
91 
93 (
96 )
97 :
98  mixedFvPatchVectorField(wbppsf, iF)
99 {}
100 
101 
102 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
103 
105 {
106  if (updated())
107  {
108  return;
109  }
110 
111  const Field<vector>& Up = *this;
112 
113  valueFraction() = 0.5 - 0.5*(Up & patch().nf())/mag(Up);
114 
116 }
117 
118 
120 {
122  freestreamValue().writeEntry("freestreamValue", os);
123  writeEntry("value", os);
124 }
125 
126 
127 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
128 
129 namespace Foam
130 {
132  (
134  freestreamVelocityFvPatchVectorField
135  );
136 }
137 
138 // ************************************************************************* //
Foam::fvPatchField
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
Definition: volSurfaceMapping.H:47
Foam::fvPatchField::write
virtual void write(Ostream &) const
Definition: fvPatchField.C:377
Foam::fvPatchField::operator=
virtual void operator=(const UList< Type > &)
p
volScalarField & p
Definition: createFieldRefs.H:8
freestreamVelocityFvPatchVectorField.H
Foam::Zero
static constexpr const zero Zero
Definition: zero.H:131
Foam::fvPatchField::operator
friend Ostream & operator(Ostream &, const fvPatchField< Type > &)
Foam::vectorField
Field< vector > vectorField
Specialisation of Field<T> for vector.
Definition: primitiveFieldsFwd.H:48
Foam::freestreamVelocityFvPatchVectorField::freestreamVelocityFvPatchVectorField
freestreamVelocityFvPatchVectorField(const fvPatch &, const DimensionedField< vector, volMesh > &)
Definition: freestreamVelocityFvPatchVectorField.C:27
Foam::Field< vector >
Foam::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:61
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:119
Foam::freestreamVelocityFvPatchVectorField::freestreamValue
const vectorField & freestreamValue() const
Definition: freestreamVelocityFvPatchVectorField.H:161
os
OBJstream os(runTime.globalPath()/outputName)
addToRunTimeSelectionTable.H
Macros for easy insertion into run-time selection tables.
Foam
Definition: atmBoundaryLayer.C:26
Foam::fvPatchField< Type >::updateCoeffs
virtual void updateCoeffs()
Definition: fvPatchField.C:314
Foam::fvPatchVectorField
fvPatchField< vector > fvPatchVectorField
Definition: fvPatchFieldsFwd.H:36
Foam::freestreamVelocityFvPatchVectorField::write
virtual void write(Ostream &) const
Definition: freestreamVelocityFvPatchVectorField.C:112
Foam::freestreamVelocityFvPatchVectorField::updateCoeffs
virtual void updateCoeffs()
Definition: freestreamVelocityFvPatchVectorField.C:97
Foam::foamVersion::patch
const std::string patch
Foam::freestreamVelocityFvPatchVectorField
This boundary condition provides a free-stream condition for velocity.
Definition: freestreamVelocityFvPatchVectorField.H:86
Foam::mag
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
Foam::fvPatchFieldMapper
Foam::fvPatchFieldMapper.
Definition: fvPatchFieldMapper.H:41
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:52
Foam::makePatchTypeField
makePatchTypeField(fvPatchScalarField, atmBoundaryLayerInletEpsilonFvPatchScalarField)
Foam::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:50