noBlending.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) 2014 OpenFOAM Foundation
9  Copyright (C) 2020 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 \*---------------------------------------------------------------------------*/
28 
29 #include "noBlending.H"
31 
32 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
33 
34 namespace Foam
35 {
36 namespace blendingMethods
37 {
38  defineTypeNameAndDebug(noBlending, 0);
39 
41  (
42  blendingMethod,
43  noBlending,
44  dictionary
45  );
46 }
47 }
48 
49 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
50 
52 (
53  const dictionary& dict,
54  const wordList& phaseNames
55 )
56 :
57  blendingMethod(dict),
58  continuousPhase_(dict.get<word>("continuousPhase"))
59 {}
60 
61 
62 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
63 
65 {}
66 
67 
68 // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
69 
71 (
72  const phaseModel& phase1,
73  const phaseModel& phase2
74 ) const
75 {
76  const fvMesh& mesh(phase1.mesh());
77 
78  return
79  tmp<volScalarField>
80  (
81  new volScalarField
82  (
83  IOobject
84  (
85  "f",
86  mesh.time().timeName(),
87  mesh
88  ),
89  mesh,
91  (
92  "f",
93  dimless,
94  phase2.name() != continuousPhase_
95  )
96  )
97  );
98 }
99 
100 
102 (
103  const phaseModel& phase1,
104  const phaseModel& phase2
105 ) const
106 {
107  const fvMesh& mesh(phase1.mesh());
108 
109  return
110  tmp<volScalarField>
111  (
112  new volScalarField
113  (
114  IOobject
115  (
116  "f",
117  mesh.time().timeName(),
118  mesh
119  ),
120  mesh,
122  (
123  "f",
124  dimless,
125  phase1.name() == continuousPhase_
126  )
127  )
128  );
129 }
130 
131 
132 // ************************************************************************* //
List< ReturnType > get(const UPtrList< T > &list, const AccessOp &aop)
List of values generated by applying the access operation to each list item.
dictionary dict
const dimensionSet dimless
Dimensionless.
phaseModel & phase2
Macros for easy insertion into run-time selection tables.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:81
dynamicFvMesh & mesh
phaseModel & phase1
List< word > wordList
List of word.
Definition: fileName.H:58
noBlending(const dictionary &dict, const wordList &phaseNames)
Construct from a dictionary and two phases.
Definition: noBlending.C:45
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
virtual tmp< volScalarField > f2(const phaseModel &phase1, const phaseModel &phase2) const
Factor for secondary phase.
Definition: noBlending.C:81
addToRunTimeSelectionTable(blendingMethod, hyperbolic, dictionary)
A class for managing temporary objects.
Definition: HashPtrTable.H:50
defineTypeNameAndDebug(hyperbolic, 0)
virtual tmp< volScalarField > f1(const phaseModel &phase1, const phaseModel &phase2) const
Factor for primary phase.
Definition: noBlending.C:64
Namespace for OpenFOAM.