fvCorrectPhi.H
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) 2015-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 Function
25  Foam::fv::correctPhi
26 
27 Description
28  Flux correction functions to ensure continuity.
29 
30  Required during start-up, restart, mesh-motion etc. when non-conservative
31  fluxes may adversely affect the prediction-part of the solution algorithm
32  (the part before the first pressure solution which would ensure continuity).
33  This is particularly important for VoF and other multi-phase solver in
34  which non-conservative fluxes cause unboundedness of the phase-fraction.
35 
36 SourceFiles
37  fvCorrectPhi.C
38  correctUphiBCs.C
39 
40 \*---------------------------------------------------------------------------*/
41 
42 #ifndef fvCorrectPhi_H
43 #define fvCorrectPhi_H
44 
45 #include "volFieldsFwd.H"
46 #include "surfaceFieldsFwd.H"
47 
48 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49 
50 namespace Foam
51 {
52  class pressureReference;
53  class nonOrthogonalSolutionControl;
54 
55  //- If the mesh is moving correct the velocity BCs on the moving walls to
56  // ensure the corrected fluxes and velocity are consistent
57  void correctUphiBCs
58  (
60  surfaceScalarField& phi,
61  const bool evaluateUBCs
62  );
63 
64  //- If the mesh is moving correct the velocity BCs on the moving walls to
65  // ensure the corrected fluxes and velocity are consistent
66  void correctUphiBCs
67  (
68  const volScalarField& rho,
70  surfaceScalarField& phi,
71  const bool evaluateUBCs
72  );
73 
74  namespace fv
75  {
76  void correctPhi
77  (
78  surfaceScalarField& phi,
79  const volVectorField& U,
80  const volScalarField& p,
81  const autoPtr<volScalarField>& rAU,
82  const autoPtr<volScalarField>& divU,
83  const pressureReference& pressureReference,
84  nonOrthogonalSolutionControl& pcorrControl
85  );
86 
87  void correctPhi
88  (
89  surfaceScalarField& phi,
90  const volScalarField& p,
91  const volScalarField& psi,
92  const autoPtr<volScalarField>& rAU,
93  const volScalarField& divRhoU,
94  nonOrthogonalSolutionControl& pcorrControl
95  );
96  }
97 }
98 
99 
100 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
101 
102 #endif
103 
104 // ************************************************************************* //
const volScalarField & psi
volScalarField rAU(1.0/UEqn.A())
U
Definition: pEqn.H:72
void correctPhi(surfaceScalarField &phi, const volVectorField &U, const volScalarField &p, const autoPtr< volScalarField > &rAU, const autoPtr< volScalarField > &divU, const pressureReference &pressureReference, nonOrthogonalSolutionControl &pcorrControl)
Definition: fvCorrectPhi.C:32
Namespace for OpenFOAM.
VolField< vector > volVectorField
Definition: volFieldsFwd.H:62
SurfaceField< scalar > surfaceScalarField
VolField< scalar > volScalarField
Definition: volFieldsFwd.H:61
void correctUphiBCs(volVectorField &U, surfaceScalarField &phi, const bool evaluateUBCs)
If the mesh is moving correct the velocity BCs on the moving walls to.
labelList fv(nPoints)
volScalarField & p