hyperbolic.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-2018 OpenFOAM Foundation
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 \*---------------------------------------------------------------------------*/
27 
28 #include "hyperbolic.H"
30 
31 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
32 
33 namespace Foam
34 {
35 namespace blendingMethods
36 {
38 
40  (
42  hyperbolic,
44  );
45 }
46 }
47 
48 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
49 
51 (
52  const dictionary& dict,
53  const wordList& phaseNames
54 )
55 :
57  transitionAlphaScale_("transitionAlphaScale", dimless, dict)
58 {
59  for (const word& phaseName : phaseNames)
60  {
61  minContinuousAlpha_.insert
62  (
63  phaseName,
65  (
66  IOobject::groupName("minContinuousAlpha", phaseName),
67  dimless,
68  dict
69  )
70  );
71  }
72 }
73 
74 
75 // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
76 
78 (
79  const phaseModel& phase1,
80  const phaseModel& phase2
81 ) const
82 {
83  return
84  (
85  1
86  + tanh
87  (
88  (4/transitionAlphaScale_)
89  *(phase2 - minContinuousAlpha_[phase2.name()])
90  )
91  )/2;
92 }
93 
94 
96 (
97  const phaseModel& phase1,
98  const phaseModel& phase2
99 ) const
100 {
101  return
102  (
103  1
104  + tanh
105  (
106  (4/transitionAlphaScale_)
107  *(phase1 - minContinuousAlpha_[phase1.name()])
108  )
109  )/2;
110 }
111 
112 
113 // ************************************************************************* //
Foam::blendingMethods::hyperbolic::hyperbolic
hyperbolic(const dictionary &dict, const wordList &phaseNames)
Construct from a dictionary and a list of phase names.
Definition: hyperbolic.C:51
Foam::phaseModel
Single incompressible phase derived from the phase-fraction. Used as part of the multiPhaseMixture fo...
Definition: phaseModel.H:54
Foam::blendingMethods::addToRunTimeSelectionTable
addToRunTimeSelectionTable(blendingMethod, hyperbolic, dictionary)
Foam::blendingMethods::hyperbolic::f2
virtual tmp< volScalarField > f2(const phaseModel &phase1, const phaseModel &phase2) const
Factor for second phase.
Definition: hyperbolic.C:96
Foam::blendingMethods::defineTypeNameAndDebug
defineTypeNameAndDebug(hyperbolic, 0)
Foam::blendingMethods::hyperbolic::f1
virtual tmp< volScalarField > f1(const phaseModel &phase1, const phaseModel &phase2) const
Factor for first phase.
Definition: hyperbolic.C:78
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
hyperbolic.H
Foam::tanh
dimensionedScalar tanh(const dimensionedScalar &ds)
Definition: dimensionedScalar.C:272
dict
dictionary dict
Definition: searchingEngine.H:14
phase2
phaseModel & phase2
Definition: setRegionFluidFields.H:6
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
addToRunTimeSelectionTable.H
Macros for easy insertion into run-time selection tables.
Foam::dimensioned
Generic dimensioned Type class.
Definition: dimensionedScalarFwd.H:42
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::blendingMethod
Definition: blendingMethod.H:52
Foam::List< word >
phase1
phaseModel & phase1
Definition: setRegionFluidFields.H:5
Foam::dimless
const dimensionSet dimless
Dimensionless.
Definition: dimensionSets.C:189
Foam::blendingMethods::hyperbolic
Definition: hyperbolic.H:51