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