alphatPhaseChangeWallFunctionBase.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) 2015-2023 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 
27 #include "fvPatchFieldMapper.H"
28 #include "volFields.H"
29 #include "phaseInterface.H"
30 #include "phaseSystem.H"
32 
33 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
34 
35 namespace Foam
36 {
37 namespace compressible
38 {
39 
40 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
41 
43 
44 
45 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
46 
48 :
49  phaseName_(word::null),
50  otherPhaseName_(word::null)
51 {}
52 
53 
55 (
56  const fvPatch& p,
58  const dictionary& dict
59 )
60 :
61  phaseName_(iF.group()),
62  otherPhaseName_(dict.lookup("otherPhase"))
63 {
65  {
67  << "otherPhase should be the name of the vapour phase that "
68  << "corresponds to the liquid base or vice versa" << nl
69  << "This phase: " << phaseName_ << nl
70  << "otherPhase: " << otherPhaseName_
71  << abort(FatalError);
72  }
73 }
74 
75 
76 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
77 
79 {}
80 
81 
82 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
83 
85 (
86  const phaseInterface& interface
87 ) const
88 {
89  const phaseSystem& fluid = interface.fluid();
90 
91  return
92  interface.contains(fluid.phases()[phaseName_])
93  && interface.contains(fluid.phases()[otherPhaseName_]);
94 }
95 
96 
98 {
99  writeEntry(os, "otherPhase", otherPhaseName_);
100 }
101 
102 
103 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
104 
105 } // End namespace compressible
106 } // End namespace Foam
107 
108 // ************************************************************************* //
Macros for easy insertion into run-time selection tables.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:57
Abstract base-class for all alphatWallFunctions supporting phase-change.
bool activeInterface(const phaseInterface &) const
Is there phase change mass transfer for this interface?
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:160
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:64
Class to represent an interface between phases. Derivations can further specify the configuration of ...
const phaseSystem & fluid() const
Return the phase system.
bool contains(const phaseModel &phase) const
Return true if this phaseInterface contains the given phase.
Class to represent a system of phases and model interfacial transfers between them.
Definition: phaseSystem.H:73
const phaseModelList & phases() const
Return the phase models.
Definition: phaseSystemI.H:41
A class for handling words, derived from string.
Definition: word.H:62
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:306
defineTypeNameAndDebug(cavitationModel, 0)
const char *const group
Group name for atomic constants.
Namespace for OpenFOAM.
errorManip< error > abort(error &err)
Definition: errorManip.H:131
void writeEntry(Ostream &os, const HashTable< T, Key, Hash > &ht)
Definition: HashTableIO.C:96
error FatalError
static const char nl
Definition: Ostream.H:260
dictionary dict
volScalarField & p