correctUphiBCs.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) 2015 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 
26 #include "CorrectPhi.H"
27 
28 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
29 
31 (
32  volVectorField& U,
34 )
35 {
36  const fvMesh& mesh = U.mesh();
37 
38  if (mesh.changing())
39  {
41  {
42  if (U.boundaryField()[patchi].fixesValue())
43  {
44  U.boundaryField()[patchi].initEvaluate();
45  }
46  }
47 
49  {
50  if (U.boundaryField()[patchi].fixesValue())
51  {
52  U.boundaryField()[patchi].evaluate();
53 
54  phi.boundaryField()[patchi] =
56  & mesh.Sf().boundaryField()[patchi];
57  }
58  }
59  }
60 }
61 
62 
64 (
65  const volScalarField& rho,
66  volVectorField& U,
68 )
69 {
70  const fvMesh& mesh = U.mesh();
71 
72  if (mesh.changing())
73  {
75  {
76  if (U.boundaryField()[patchi].fixesValue())
77  {
78  U.boundaryField()[patchi].initEvaluate();
79  }
80  }
81 
83  {
84  if (U.boundaryField()[patchi].fixesValue())
85  {
86  U.boundaryField()[patchi].evaluate();
87 
88  phi.boundaryField()[patchi] =
89  rho.boundaryField()[patchi]
90  *(
92  & mesh.Sf().boundaryField()[patchi]
93  );
94  }
95  }
96  }
97 }
98 
99 
100 // ************************************************************************* //
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
GeometricBoundaryField & boundaryField()
Return reference to GeometricBoundaryField.
const surfaceVectorField & Sf() const
Return cell face area vectors.
bool changing() const
Is mesh changing (topology changing and/or moving)
Definition: polyMesh.H:521
void correctUphiBCs(volVectorField &U, surfaceScalarField &phi)
If the mesh is moving correct the velocity BCs on the moving walls to.
const Mesh & mesh() const
Return mesh.
dynamicFvMesh & mesh
#define forAll(list, i)
Definition: UList.H:421
label patchi