NonRandomTwoLiquid.H
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) 2015-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 Class
27  Foam::interfaceCompositionModels::NonRandomTwoLiquid
28 
29 Description
30  Non ideal law for the mixing of two species. A separate composition model
31  is given for each species. The composition of a species is equal to the
32  value given by the model, scaled by the species fraction in the bulk of the
33  other phase, and multiplied by the activity coefficient for that species.
34  The gas behaviour is assumed ideal; i.e. the fugacity coefficient is taken
35  as equal to 1.
36 
37 SourceFiles
38  NonRandomTwoLiquid.C
39 
40 \*---------------------------------------------------------------------------*/
41 
42 #ifndef NonRandomTwoLiquid_H
43 #define NonRandomTwoLiquid_H
44 
45 #include "InterfaceCompositionModel.H"
46 #include "saturationModel.H"
47 
48 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49 
50 namespace Foam
51 {
52 
53 class phasePair;
54 
55 namespace interfaceCompositionModels
56 {
57 
58 /*---------------------------------------------------------------------------*\
59  Class NonRandomTwoLiquid Declaration
60 \*---------------------------------------------------------------------------*/
61 
62 template<class Thermo, class OtherThermo>
64 :
65  public InterfaceCompositionModel<Thermo, OtherThermo>
66 {
67  // Private data
68 
69  //- Activity coefficient for species 1
70  volScalarField gamma1_;
71 
72  //- Activity coefficient for species 2
73  volScalarField gamma2_;
74 
75  //- Name of species 1
76  word species1Name_;
77 
78  //- Name of species 2
79  word species2Name_;
80 
81  //- Indiex of species 1 within this thermo
82  label species1Index_;
83 
84  //- Indiex of species 2 within this thermo
85  label species2Index_;
86 
87  //- Non-randomness constant parameter for species 1
88  dimensionedScalar alpha12_;
89 
90  //- Non-randomness constant parameter for species 2
91  dimensionedScalar alpha21_;
92 
93  //- Non-randomness linear parameter for species 1
94  dimensionedScalar beta12_;
95 
96  //- Non-randomness linear parameter for species 2
97  dimensionedScalar beta21_;
98 
99  //- Interaction parameter model for species 1
100  autoPtr<saturationModel> saturationModel12_;
101 
102  //- Interaction parameter model for species 2
103  autoPtr<saturationModel> saturationModel21_;
104 
105  //- Composition model for species 1
106  autoPtr<interfaceCompositionModel> speciesModel1_;
107 
108  //- Composition model for species 2
109  autoPtr<interfaceCompositionModel> speciesModel2_;
110 
111 
112 public:
113 
114  //- Runtime type information
115  TypeName("nonRandomTwoLiquid");
116 
117  // Constructors
118 
119  //- Construct from components
121  (
122  const dictionary& dict,
123  const phasePair& pair
124  );
125 
126 
127  //- Destructor
128  virtual ~NonRandomTwoLiquid();
129 
130 
131  // Member Functions
132 
133  //- Update the composition
134  virtual void update(const volScalarField& Tf);
135 
136  //- The interface species fraction
137  virtual tmp<volScalarField> Yf
138  (
139  const word& speciesName,
140  const volScalarField& Tf
141  ) const;
142 
143  //- The interface species fraction derivative w.r.t. temperature
145  (
146  const word& speciesName,
147  const volScalarField& Tf
148  ) const;
149 };
150 
151 
152 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
153 
154 } // End namespace interfaceCompositionModels
155 } // End namespace Foam
156 
157 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
158 
159 #ifdef NoRepository
160  #include "NonRandomTwoLiquid.C"
161 #endif
162 
163 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
164 
165 #endif
166 
167 // ************************************************************************* //
Foam::phasePair
Description for mass transfer between a pair of phases. The direction of the mass transfer is from th...
Definition: phasePair.H:53
Foam::InterfaceCompositionModel
Base class for interface composition models, templated on the two thermodynamic models either side of...
Definition: InterfaceCompositionModel.H:58
Foam::interfaceCompositionModels::NonRandomTwoLiquid::NonRandomTwoLiquid
NonRandomTwoLiquid(const dictionary &dict, const phasePair &pair)
Construct from components.
Definition: NonRandomTwoLiquid.C:35
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
Foam::interfaceCompositionModel::pair
const phasePair & pair() const
The phase pair.
Definition: interfaceCompositionModel.C:122
Foam::interfaceCompositionModels::NonRandomTwoLiquid::Yf
virtual tmp< volScalarField > Yf(const word &speciesName, const volScalarField &Tf) const
The interface species fraction.
Definition: NonRandomTwoLiquid.C:200
Foam::interfaceCompositionModels::NonRandomTwoLiquid
Non ideal law for the mixing of two species. A separate composition model is given for each species....
Definition: NonRandomTwoLiquid.H:62
saturationModel.H
Foam::interfaceCompositionModels::NonRandomTwoLiquid::update
virtual void update(const volScalarField &Tf)
Update the composition.
Definition: NonRandomTwoLiquid.C:137
NonRandomTwoLiquid.C
Foam::interfaceCompositionModels::NonRandomTwoLiquid::TypeName
TypeName("nonRandomTwoLiquid")
Runtime type information.
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam::dimensioned< scalar >
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Foam::interfaceCompositionModels::NonRandomTwoLiquid::YfPrime
virtual tmp< volScalarField > YfPrime(const word &speciesName, const volScalarField &Tf) const
The interface species fraction derivative w.r.t. temperature.
Definition: NonRandomTwoLiquid.C:232
Foam::GeometricField< scalar, fvPatchField, volMesh >
Foam::interfaceCompositionModels::NonRandomTwoLiquid::~NonRandomTwoLiquid
virtual ~NonRandomTwoLiquid()
Destructor.
Definition: NonRandomTwoLiquid.C:127