hyperbolic.C
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-2018 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 \*---------------------------------------------------------------------------*/
25 
26 #include "hyperbolic.H"
28 
29 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
30 
31 namespace Foam
32 {
33 namespace blendingMethods
34 {
35  defineTypeNameAndDebug(hyperbolic, 0);
36 
38  (
39  blendingMethod,
40  hyperbolic,
41  dictionary
42  );
43 }
44 }
45 
46 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
47 
49 (
50  const dictionary& dict,
51  const wordList& phaseNames
52 )
53 :
54  blendingMethod(dict),
55  transitionAlphaScale_
56  (
57  "transitionAlphaScale",
58  dimless,
59  dict.lookup("transitionAlphaScale")
60  )
61 {
62  forAllConstIter(wordList, phaseNames, iter)
63  {
64  const word name(IOobject::groupName("maxDispersedAlpha", *iter));
65 
66  maxDispersedAlpha_.insert
67  (
68  *iter,
70  (
71  name,
72  dimless,
73  dict.lookup(name)
74  )
75  );
76  }
77 }
78 
79 
80 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
81 
83 {}
84 
85 
86 // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
87 
89 (
90  const phaseModel& phase1,
91  const phaseModel& phase2
92 ) const
93 {
94  return
95  (
96  1
97  + tanh
98  (
99  (4/transitionAlphaScale_)
100  *(phase1 - maxDispersedAlpha_[phase1.name()])
101  )
102  )/2;
103 }
104 
105 
107 (
108  const phaseModel& phase1,
109  const phaseModel& phase2
110 ) const
111 {
112  return
113  (
114  1
115  + tanh
116  (
117  (4/transitionAlphaScale_)
118  *(maxDispersedAlpha_[phase2.name()] - phase2)
119  )
120  )/2;
121 }
122 
123 
124 // ************************************************************************* //
hyperbolic(const dictionary &dict, const wordList &phaseNames)
Construct from a dictionary and a list of phase names.
dimensionedScalar tanh(const dimensionedScalar &ds)
virtual tmp< volScalarField > f2(const phaseModel &phase1, const phaseModel &phase2) const
Factor for second phase.
Macros for easy insertion into run-time selection tables.
stressControl lookup("compactNormalStress") >> compactNormalStress
static word groupName(Name name, const word &group)
forAllConstIter(PtrDictionary< phaseModel >, mixture.phases(), phase)
Definition: pEqn.H:29
addToRunTimeSelectionTable(ensightPart, ensightPartCells, istream)
defineTypeNameAndDebug(combustionModel, 0)
word name(const complex &)
Return a string representation of a complex.
Definition: complex.C:47
List< word > wordList
A List of words.
Definition: fileName.H:54
virtual tmp< volScalarField > f1(const phaseModel &phase1, const phaseModel &phase2) const
Factor for first phase.
const dimensionSet dimless(0, 0, 0, 0, 0, 0, 0)
Definition: dimensionSets.H:47
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
phaseModel & phase2
A class for managing temporary objects.
Definition: PtrList.H:53
Namespace for OpenFOAM.