SidedInterfacialModel.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-2025 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::SidedInterfacialModel
26 
27 Description
28  Wrapper class for interfacial models for which two instances of the model
29  are used per interface; one for each side of the interface
30 
31 SourceFiles
32  SidedInterfacialModel.C
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef SidedInterfacialModel_H
37 #define SidedInterfacialModel_H
38 
39 #include "sidedPhaseInterface.H"
40 #include "TypeSet.H"
41 
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
44 namespace Foam
45 {
46 
47 /*---------------------------------------------------------------------------*\
48  Class SidedInterfacialModel Declaration
49 \*---------------------------------------------------------------------------*/
50 
51 template<class ModelType>
53 :
54  public regIOobject
55 {
56  // Private Data
57 
58  //- The interface
59  const phaseInterface interface_;
60 
61  //- Model for within phase 1
62  autoPtr<ModelType> modelInPhase1_;
63 
64  //- Model for within phase 2
65  autoPtr<ModelType> modelInPhase2_;
66 
67 
68 public:
69 
70  //- Public Type Definitions
71 
72  //- The underlying model type
73  typedef ModelType modelType;
74 
75  //- Required phase interface types
77 
78  //- Allowed phase interface types
80 
81 
82  //- Runtime type information
83  TypeName("SidedInterfacialModel");
84 
85 
86  // Constructors
87 
88  //- Construct from a dictionary and an interface
89  template<class ... Args>
91  (
92  const dictionary& dict,
94  const Args& ... args
95  );
96 
97  //- Disallow default bitwise copy construction
99  (
101  ) = delete;
102 
103 
104  //- Destructor
106 
107 
108  // Member Functions
109 
110  //- Access the interface
111  const phaseInterface& interface() const;
112 
113  //- Does a model exist in the given phase?
114  bool haveModelInThe(const phaseModel& phase) const;
115 
116  //- Access the model within the given phase
117  const ModelType& modelInThe(const phaseModel& phase) const;
118 
119  //- Access the model within the given phase
120  ModelType& modelInThe(const phaseModel& phase);
121 
122  //- Dummy write for regIOobject
123  bool writeData(Ostream& os) const;
124 
125 
126  // Member Operators
127 
128  //- Disallow default bitwise assignment
129  void operator=(const SidedInterfacialModel<ModelType>&) = delete;
130 };
131 
132 
133 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
134 
135 #define defineSidedInterfacialModelTypeNameAndDebug(ModelType, DebugSwitch) \
136  \
137  defineTemplateTypeNameAndDebugWithName \
138  ( \
139  SidedInterfacialModel<ModelType>, \
140  ( \
141  word(SidedInterfacialModel<ModelType>::typeName_()) + "<" \
142  + ModelType::typeName + ">" \
143  ).c_str(), \
144  DebugSwitch \
145  );
146 
147 
148 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
149 
150 } // End namespace Foam
151 
152 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
153 
154 #ifdef NoRepository
155  #include "SidedInterfacialModel.C"
156 #endif
157 
158 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
159 
160 #endif
161 
162 // ************************************************************************* //
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:57
Wrapper class for interfacial models for which two instances of the model are used per interface; one...
TypeSet< sidedPhaseInterface > allowedPhaseInterfaces
Allowed phase interface types.
TypeSet< sidedPhaseInterface > requiredPhaseInterfaces
Required phase interface types.
const phaseInterface & interface() const
Access the interface.
bool writeData(Ostream &os) const
Dummy write for regIOobject.
TypeName("SidedInterfacialModel")
Runtime type information.
void operator=(const SidedInterfacialModel< ModelType > &)=delete
Disallow default bitwise assignment.
bool haveModelInThe(const phaseModel &phase) const
Does a model exist in the given phase?
ModelType modelType
Public Type Definitions.
SidedInterfacialModel(const dictionary &dict, const phaseInterface &interface, const Args &... args)
Construct from a dictionary and an interface.
const ModelType & modelInThe(const phaseModel &phase) const
Access the model within the given phase.
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Definition: dictionary.H:162
Class to represent an interface between phases. Derivations can further specify the configuration of ...
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
Definition: regIOobject.H:55
Namespace for OpenFOAM.
dictionary dict
Foam::argList args(argc, argv)
Template meta-programming for operations involving sets of types.
Definition: TypeSet.H:47