generateInterfacialValues.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) 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 Namespace
25  Foam
26 
27 Description
28  Functions for generating tables of interfacial values
29 
30 \*---------------------------------------------------------------------------*/
31 
32 #ifndef generateInterfacialValues_H
33 #define generateInterfacialValues_H
34 
35 #include "phaseSystem.H"
36 
37 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
38 
39 namespace Foam
40 {
41 
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
44 template<class ValueType>
46 <
47  ValueType,
51 (
52  const phaseSystem& fluid,
53  const dictionary& dict,
54  const wordHashSet& ignoreKeys = wordHashSet()
55 )
56 {
58 
60  {
61  // Get the keyword name and skip if it is ignored
62  const word& modelName = iter().keyword();
63  if (ignoreKeys.found(modelName)) continue;
64 
65  // Construct the associated interface
66  autoPtr<phaseInterface> interfacePtr =
67  phaseInterface::New(fluid, iter().keyword());
68 
69  // Read the vale and store in the table
70  const ValueType value(pTraits<ValueType>(iter().stream()));
71  values.insert(interfacePtr(), value);
72  }
73 
74  return values;
75 }
76 
77 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
78 
79 } // End namespace Foam
80 
81 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
82 
83 #endif
84 
85 // ************************************************************************* //
#define forAllConstIter(Container, container, iter)
Iterate across all elements in the container object of type.
Definition: UList.H:476
A HashTable with keys but without contents.
Definition: HashSet.H:62
An STL-conforming hash table.
Definition: HashTable.H:127
bool insert(const Key &, const T &newElmt)
Insert a new hashedEntry.
Definition: HashTableI.H:80
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: autoPtr.H:51
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Definition: dictionary.H:162
Traits class for primitives.
Definition: pTraits.H:53
Word-pair based class used for keying interface models in hash tables.
static autoPtr< phaseInterface > New(const phaseSystem &fluid, const word &name)
Select given fluid and name.
Class to represent a system of phases.
Definition: phaseSystem.H:74
A class for handling words, derived from string.
Definition: word.H:62
Namespace for OpenFOAM.
Foam::HashTable< ValueType, Foam::phaseInterfaceKey, Foam::phaseInterfaceKey::hash > generateInterfacialValues(const phaseSystem &fluid, const dictionary &dict, const wordHashSet &ignoreKeys=wordHashSet())
HashSet wordHashSet
A HashSet with word keys.
Definition: HashSet.H:210
dictionary dict