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-2022 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 namespace interfaceCompositionModels
51 {
52 
53 /*---------------------------------------------------------------------------*\
54  Class nonRandomTwoLiquid Declaration
55 \*---------------------------------------------------------------------------*/
56 
58 :
60 {
61  // Private Data
62 
63  //- Activity coefficient for species 1
64  volScalarField gamma1_;
65 
66  //- Activity coefficient for species 2
67  volScalarField gamma2_;
68 
69  //- Name of species 1
70  word species1Name_;
71 
72  //- Name of species 2
73  word species2Name_;
74 
75  //- Index of species 1 within this thermo
76  label species1Index_;
77 
78  //- Index of species 2 within this thermo
79  label species2Index_;
80 
81  //- Non-randomness constant parameter for species 1
82  dimensionedScalar alpha12_;
83 
84  //- Non-randomness constant parameter for species 2
85  dimensionedScalar alpha21_;
86 
87  //- Non-randomness linear parameter for species 1
88  dimensionedScalar beta12_;
89 
90  //- Non-randomness linear parameter for species 2
91  dimensionedScalar beta21_;
92 
93  //- Interaction parameter model for species 1
94  autoPtr<saturationModel> saturationModel12_;
95 
96  //- Interaction parameter model for species 2
97  autoPtr<saturationModel> saturationModel21_;
98 
99  //- Composition model for species 1
100  autoPtr<interfaceCompositionModel> speciesModel1_;
101 
102  //- Composition model for species 2
103  autoPtr<interfaceCompositionModel> speciesModel2_;
104 
105 
106 public:
107 
108  //- Runtime type information
109  TypeName("nonRandomTwoLiquid");
110 
111 
112  // Constructors
113 
114  //- Construct from a dictionary and an interface
116  (
117  const dictionary& dict,
119  );
120 
121 
122  //- Destructor
123  virtual ~nonRandomTwoLiquid();
124 
125 
126  // Member Functions
127 
128  //- Update the composition
129  virtual void update(const volScalarField& Tf);
130 
131  //- The interface species fraction
132  virtual tmp<volScalarField> Yf
133  (
134  const word& speciesName,
135  const volScalarField& Tf
136  ) const;
137 
138  //- The interface species fraction derivative w.r.t. temperature
140  (
141  const word& speciesName,
142  const volScalarField& Tf
143  ) const;
144 };
145 
146 
147 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
148 
149 } // End namespace interfaceCompositionModels
150 } // End namespace Foam
151 
152 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
153 
154 #endif
155 
156 // ************************************************************************* //
dictionary dict
nonRandomTwoLiquid(const dictionary &dict, const phaseInterface &interface)
Construct from a dictionary and an interface.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
Non ideal law for the mixing of two species. A separate composition model is given for each species...
const sidedPhaseInterface & interface() const
Return the interface.
virtual tmp< volScalarField > Yf(const word &speciesName, const volScalarField &Tf) const
The interface species fraction.
TypeName("nonRandomTwoLiquid")
Runtime type information.
Class to represent an interface between phases. Derivations can further specify the configuration of ...
Generic base class for interface composition models. These models describe the composition in phase 1...
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
virtual void update(const volScalarField &Tf)
Update the composition.
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
Namespace for OpenFOAM.