noSlipFvPatchVectorField.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2016-2023 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 "fvcMeshPhi.H"
29 
30 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
31 
33 (
34  const fvPatch& p,
36 )
37 :
38  fixedValueFvPatchVectorField(p, iF)
39 {
41 }
42 
43 
45 (
46  const fvPatch& p,
48  const dictionary& dict
49 )
50 :
51  fixedValueFvPatchVectorField(p, iF, dict, false)
52 {
54 }
55 
56 
58 (
59  const noSlipFvPatchVectorField& ptf,
60  const fvPatch& p,
62  const fieldMapper& mapper
63 )
64 :
65  fixedValueFvPatchVectorField(ptf, p, iF, mapper, false) // Don't map
66 {
67  mapper(*this, ptf, vector::zero);
68 }
69 
70 
72 (
73  const noSlipFvPatchVectorField& mwvpvf,
75 )
76 :
77  fixedValueFvPatchVectorField(mwvpvf, iF)
78 {}
79 
80 
81 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
82 
84 (
85  const fvPatchVectorField& ptf,
86  const fieldMapper& mapper
87 )
88 {
89  mapper(*this, ptf, vector::zero);
90 }
91 
92 
94 {
95  if (updated())
96  {
97  return;
98  }
99 
100  const fvMesh& mesh = patch().boundaryMesh().mesh();
101 
102  if (mesh.moving())
103  {
104  const fvPatch& p = patch();
105 
106  const volVectorField& U =
107  static_cast<const volVectorField&>(internalField());
108 
109  const vectorField n(p.nf());
110  tmp<scalarField> Un = fvc::meshPhi(U, p.index())/(p.magSf() + vSmall);
111 
113  }
114 
115  fixedValueFvPatchVectorField::updateCoeffs();
116 }
117 
118 
120 {
122 }
123 
124 
125 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
126 
127 namespace Foam
128 {
130  (
133  );
134 }
135 
136 // ************************************************************************* //
label n
Macros for easy insertion into run-time selection tables.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
void operator=(const Field< vector > &)
Definition: Field.C:550
Generic GeometricField class.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:57
static const Form zero
Definition: VectorSpace.H:118
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:162
Abstract base class for field mapping.
Definition: fieldMapper.H:48
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:99
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
Definition: fvPatchField.H:88
virtual void write(Ostream &) const
Write.
Definition: fvPatchField.C:229
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:64
This boundary condition fixes the velocity to zero at walls and assumes the walls are stationary.
virtual void write(Ostream &) const
Write.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
noSlipFvPatchVectorField(const fvPatch &, const DimensionedField< vector, volMesh > &)
Construct from patch and internal field.
virtual void map(const fvPatchVectorField &, const fieldMapper &)
Map the given fvPatchField onto this fvPatchField.
const polyMesh & mesh() const
Return the mesh reference.
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
Definition: polyMesh.H:404
bool moving() const
Is mesh moving.
Definition: polyMesh.H:476
A class for managing temporary objects.
Definition: tmp.H:55
Calculate the mesh motion flux and convert fluxes from absolute to relative and back.
U
Definition: pEqn.H:72
tmp< surfaceScalarField > meshPhi(const volVectorField &U)
Definition: fvcMeshPhi.C:34
Namespace for OpenFOAM.
static const zero Zero
Definition: zero.H:97
tmp< fvMatrix< Type > > operator==(const fvMatrix< Type > &, const fvMatrix< Type > &)
makeNullConstructablePatchTypeField(fvPatchVectorField, noSlipFvPatchVectorField)
dictionary dict
volScalarField & p