Lee.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) 2017-2022 OpenCFD Ltd.
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 "Lee.H"
30 
31 
32 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
33 
34 template<class Thermo, class OtherThermo>
36 (
37  const dictionary& dict,
38  const phasePair& pair
39 )
40 :
41  InterfaceCompositionModel<Thermo, OtherThermo>(dict, pair),
42  C_("C", inv(dimTime), dict),
43  Tactivate_("Tactivate", dimTemperature, dict),
44  alphaMin_(dict.getOrDefault<scalar>("alphaMin", 0))
45 {}
46 
47 
48 // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
49 
50 template<class Thermo, class OtherThermo>
53 (
54  const volScalarField& refValue
55 )
56 {
57  {
58  const volScalarField from
59  (
60  clamp(this->pair().from(), zero_one{})
61  );
62 
63  const volScalarField coeff
64  (
65  C_*from*this->pair().from().rho()*pos(from - alphaMin_)
66  *(refValue - Tactivate_)
67  /Tactivate_
68  );
69 
70  if (sign(C_.value()) > 0)
71  {
72  return
73  (
74  coeff*pos(refValue - Tactivate_)
75  );
76  }
77  else
78  {
79  return
80  (
81  coeff*pos(Tactivate_ - refValue)
82  );
83  }
84  }
85 }
86 
87 
88 template<class Thermo, class OtherThermo>
91 (
92  label variable,
93  const volScalarField& refValue
94 )
95 {
96  if (this->modelVariable_ == variable)
97  {
98  const volScalarField from
99  (
100  clamp(this->pair().from(), zero_one{})
101  );
102 
103  const volScalarField coeff
104  (
105  C_*from*this->pair().from().rho()*pos(from - alphaMin_)
106  /Tactivate_
107  );
108 
109  if (sign(C_.value()) > 0)
110  {
111  return
112  (
113  coeff*pos(refValue - Tactivate_)
114  );
115  }
116  else
117  {
118  return
119  (
120  -coeff*pos(Tactivate_ - refValue)
121  );
122  }
123  }
124  else
125  {
126  return nullptr;
127  }
128 }
129 
130 
131 template<class Thermo, class OtherThermo>
134 (
135  label variable,
136  const volScalarField& refValue
137 )
138 {
139  if (this->modelVariable_ == variable)
140  {
141  const volScalarField from
142  (
143  clamp(this->pair().from(), zero_one{})
144  );
145 
146  const volScalarField coeff
147  (
148  C_*from*this->pair().from().rho()*pos(from - alphaMin_)
149  );
150 
151  if (sign(C_.value()) > 0)
152  {
153  return
154  (
155  -coeff*pos(refValue - Tactivate_)
156  );
157  }
158  else
159  {
160  return
161  (
162  -coeff*pos(Tactivate_ - refValue)
163  );
164  }
165  }
166  else
167  {
168  return nullptr;
169  }
170 }
171 
172 
173 // ************************************************************************* //
dimensionedScalar sign(const dimensionedScalar &ds)
dictionary dict
Lee(const dictionary &dict, const phasePair &pair)
Construct from components.
Definition: Lee.C:29
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:129
dimensionedSphericalTensor inv(const dimensionedSphericalTensor &dt)
Base class for interface composition models, templated on the two thermodynamic models either side of...
virtual tmp< volScalarField > KSp(label modelVariable, const volScalarField &field)
Implicit mass transfer coefficient.
Definition: Lee.C:84
Macros for easy insertion into run-time selection tables.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:81
dimensionedScalar pos(const dimensionedScalar &ds)
const dimensionSet dimTemperature(0, 0, 0, 1, 0, 0, 0)
Definition: dimensionSets.H:52
virtual tmp< volScalarField > KSu(label modelVariable, const volScalarField &field)
Explicit mass transfer coefficient.
Definition: Lee.C:127
Represents 0/1 range or concept. Used for tagged dispatch or clamping.
Definition: pTraits.H:65
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
Definition: dimensionSets.H:51
A class for managing temporary objects.
Definition: HashPtrTable.H:50
Description for mass transfer between a pair of phases. The direction of the mass transfer is from th...
Definition: phasePair.H:49
virtual tmp< volScalarField > Kexp(const volScalarField &field)
Explicit total mass transfer coefficient.
Definition: Lee.C:46
dimensionSet clamp(const dimensionSet &a, const dimensionSet &range)
Definition: dimensionSet.C:271