MovingPhaseModel.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) 2017 OpenCFD Ltd.
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 
28 #include "MovingPhaseModel.H"
29 
30 #include "phaseSystem.H"
31 
33 #include "slipFvPatchFields.H"
35 
36 #include "fvmDdt.H"
37 #include "fvmDiv.H"
38 
39 #include "fvmSup.H"
40 #include "fvcDdt.H"
41 #include "fvcDiv.H"
42 #include "surfaceInterpolate.H"
43 
44 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
45 
46 template<class BasePhaseModel>
48 (
49  const phaseSystem& fluid,
50  const word& phaseName
51 )
52 :
53  BasePhaseModel(fluid, phaseName),
54  U_(fluid.mesh().lookupObject<volVectorField>("U")),
55  phi_(fluid.mesh().lookupObject<surfaceScalarField>("phi")),
56  alphaPhi_
57  (
58  IOobject
59  (
60  IOobject::groupName("alphaPhi", phaseModel::name()),
61  fluid.mesh().time().timeName(),
62  fluid.mesh()
63  ),
64  fluid.mesh(),
65  dimensionedScalar(dimensionSet(0, 3, -1, 0, 0), Zero)
66  )
67 {}
68 
69 
70 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
71 
72 template<class BasePhaseModel>
74 {
76 }
77 
78 
79 template<class BasePhaseModel>
82 {
83  return tmp<surfaceScalarField>(phi_);
84 }
85 
86 
87 template<class BasePhaseModel>
90 {
91  return phi_;
92 }
93 
94 
95 template<class BasePhaseModel>
98 {
99  return tmp<surfaceScalarField>(alphaPhi_);
100 }
101 
102 
103 template<class BasePhaseModel>
106 {
107  return alphaPhi_;
108 }
109 
110 
111 template<class BasePhaseModel>
114 {
115  return tmp<volVectorField>(U_);
116 }
117 
118 
119 template<class BasePhaseModel>
121 diffNo() const
122 {
124  (
125  IOobject
126  (
127  IOobject::groupName("diffNo", phaseModel::name()),
128  U_.mesh().time().timeName(),
129  U_.mesh()
130  ),
131  U_.mesh(),
133  );
134 }
135 
136 
137 // ************************************************************************* //
Foam::IOobject
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Definition: IOobject.H:169
partialSlipFvPatchFields.H
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
slipFvPatchFields.H
Foam::Zero
static constexpr const zero Zero
Global zero (0)
Definition: zero.H:131
Foam::MovingPhaseModel::alphaPhi
virtual tmp< surfaceScalarField > alphaPhi() const
Constant access the volumetric flux of the phase.
Definition: MovingPhaseModel.C:97
Foam::MovingPhaseModel::diffNo
virtual tmp< surfaceScalarField > diffNo() const
Diffusion number.
Definition: MovingPhaseModel.C:121
fvcDiv.H
Calculate the divergence of the given field.
Foam::dimensionSet
Dimension set for the base types, which can be used to implement rigorous dimension checking for alge...
Definition: dimensionSet.H:108
fluid
twoPhaseSystem & fluid
Definition: setRegionFluidFields.H:3
fvmDiv.H
Calculate the matrix for the divergence of the given field and flux.
MovingPhaseModel.H
Foam::MovingPhaseModel::phi
virtual tmp< surfaceScalarField > phi() const
Constant access the volumetric flux.
Definition: MovingPhaseModel.C:81
correct
fvOptions correct(rho)
Foam::MovingPhaseModel::U
virtual tmp< volVectorField > U() const
Access const reference to U.
Definition: MovingPhaseModel.C:113
Foam::dimensionedScalar
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
Definition: dimensionedScalarFwd.H:42
Foam::MovingPhaseModel::MovingPhaseModel
MovingPhaseModel(const phaseSystem &fluid, const word &phaseName)
Definition: MovingPhaseModel.C:48
fvmSup.H
Calculate the matrix for implicit and explicit sources.
Foam::New
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tdf1, const word &name, const dimensionSet &dimensions)
Global function forwards to reuseTmpDimensionedField::New.
Definition: DimensionedFieldReuseFunctions.H:105
Foam::MovingPhaseModel::correct
virtual void correct()
Correct the phase properties other than the thermo and turbulence.
Definition: MovingPhaseModel.C:73
fixedValueFvPatchFields.H
Foam::name
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
Definition: exprTraits.C:59
fvcDdt.H
Calculate the first temporal derivative.
Foam::phaseSystem
Class to represent a system of phases and model interfacial transfers between them.
Definition: phaseSystem.H:66
Foam::GeometricField< vector, fvPatchField, volMesh >
fvmDdt.H
Calculate the matrix for the first temporal derivative.
Foam::dimless
const dimensionSet dimless
Dimensionless.
Definition: dimensionSets.C:189