BlendedInterfacialModel.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) 2014-2019 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 Class
25  Foam::BlendedInterfacialModel
26 
27 Description
28 
29 SourceFiles
30  BlendedInterfacialModel.C
31 
32 \*---------------------------------------------------------------------------*/
33 
34 #ifndef BlendedInterfacialModel_H
35 #define BlendedInterfacialModel_H
36 
37 #include "blendingMethod.H"
38 #include "phasePair.H"
39 #include "orderedPhasePair.H"
40 
41 #include "geometricZeroField.H"
42 
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 
45 namespace Foam
46 {
47 
48 /*---------------------------------------------------------------------------*\
49  Class BlendedInterfacialModel Declaration
50 \*---------------------------------------------------------------------------*/
51 
52 template<class modelType>
53 class BlendedInterfacialModel
54 {
55  // Private Data
56 
57  //- Unordered phase pair
58  const phasePair& pair_;
59 
60  //- Ordered phase pair for dispersed phase 1 in continuous phase 2
61  const orderedPhasePair& pair1In2_;
62 
63  //- Ordered phase pair for dispersed phase 2 in continuous phase 1
64  const orderedPhasePair& pair2In1_;
65 
66  //- Model for region with no obvious dispersed phase
67  autoPtr<modelType> model_;
68 
69  //- Model for dispersed phase 1 in continuous phase 2
70  autoPtr<modelType> model1In2_;
71 
72  //- Model for dispersed phase 2 in continuous phase 1
73  autoPtr<modelType> model2In1_;
74 
75  //- Blending model
76  const blendingMethod& blending_;
77 
78  //- If true set coefficients and forces to 0 at fixed-flux BCs
79  bool correctFixedFluxBCs_;
80 
81 
82  // Private Member Functions
83 
84  //- Correct coeff/value on fixed flux boundary conditions
85  template<class GeometricField>
86  void correctFixedFluxBCs(GeometricField& field) const;
87 
88 
89 public:
90 
91  // Constructors
92 
93  //- Construct from the model table, dictionary and pairs
95  (
96  const phasePair::dictTable& modelTable,
97  const blendingMethod& blending,
98  const phasePair& pair,
99  const orderedPhasePair& pair1In2,
100  const orderedPhasePair& pair2In1,
101  const bool correctFixedFluxBCs = true
102  );
103 
104  //- Disallow default bitwise copy construction
106  (
107  const BlendedInterfacialModel<modelType>&
108  ) = delete;
109 
110 
111  //- Destructor
113 
114 
115  // Member Functions
116 
117  //- Return true if a model is specified for the supplied phase
118  bool hasModel(const phaseModel& phase) const;
119 
120  //- Return the model for the supplied phase
121  const modelType& phaseModel(const phaseModel& phase) const;
122 
123  //- Return the blended force coefficient
124  tmp<volScalarField> K() const;
125 
126  //- Return the face blended force coefficient
127  tmp<surfaceScalarField> Kf() const;
128 
129  //- Return the blended force
130  template<class Type>
131  tmp<GeometricField<Type, fvPatchField, volMesh>> F() const;
132 
133  //- Return the face blended force
134  tmp<surfaceScalarField> Ff() const;
135 
136  //- Return the blended diffusivity
137  tmp<volScalarField> D() const;
138 
139 
140  // Member Operators
141 
142  //- Disallow default bitwise assignment
143  void operator=(const BlendedInterfacialModel<modelType>&) = delete;
144 };
145 
146 
147 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
148 
149 } // End namespace Foam
150 
151 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
152 
153 #ifdef NoRepository
154  #include "BlendedInterfacialModel.C"
155 #endif
156 
157 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
158 
159 #endif
160 
161 // ************************************************************************* //
HashTable< dictionary, phasePairKey, phasePairKey::hash > dictTable
Dictionary hash table.
Definition: phasePair.H:59
bool hasModel(const phaseModel &phase) const
Return true if a model is specified for the supplied phase.
const modelType & phaseModel(const phaseModel &phase) const
Return the model for the supplied phase.
~BlendedInterfacialModel()
Destructor.
tmp< volScalarField > K() const
Return the blended force coefficient.
tmp< surfaceScalarField > Ff() const
Return the face blended force.
tmp< surfaceScalarField > Kf() const
Return the face blended force coefficient.
tmp< GeometricField< Type, fvPatchField, volMesh > > F() const
Return the blended force.
BlendedInterfacialModel(const phaseModel &phase1, const phaseModel &phase2, const blendingMethod &blending, autoPtr< ModelType > model, autoPtr< ModelType > model1In2, autoPtr< ModelType > model2In1, const bool correctFixedFluxBCs=true)
Construct from two phases, blending method and three models.
tmp< volScalarField > D() const
Return the blended diffusivity.
void operator=(const BlendedInterfacialModel< ModelType > &)=delete
Disallow default bitwise assignment.
Namespace for OpenFOAM.