JDFTx  1.2.0
Fex_ScalarEOS.h
1 /*-------------------------------------------------------------------
2 Copyright 2011 Ravishankar Sundararaman, Kendra Letchworth Weaver
3 
4 This file is part of JDFTx.
5 
6 JDFTx is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 3 of the License, or
9 (at your option) any later version.
10 
11 JDFTx is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15 
16 You should have received a copy of the GNU General Public License
17 along with JDFTx. If not, see <http://www.gnu.org/licenses/>.
18 -------------------------------------------------------------------*/
19 
20 #ifndef JDFTX_FLUID_FEX_SCALAREOS_H
21 #define JDFTX_FLUID_FEX_SCALAREOS_H
22 
23 #include <fluid/Fex.h>
24 
26 struct ScalarEOS
27 { double sigmaEOS;
28  virtual double vdwRadius() const=0;
29  virtual void evaluate(size_t nData, const double* N, double* Aex, double* Aex_N, double Vhs) const=0;
30  #ifdef GPU_ENABLED
31  virtual void evaluate_gpu(size_t nData, const double* N, double* Aex, double* Aex_N, double Vhs) const=0;
32  #endif
33  ScalarEOS(double sigmaEOS) : sigmaEOS(sigmaEOS) {}
34  virtual ~ScalarEOS() {}
35 };
36 
37 class Fex_ScalarEOS : public Fex
38 {
39 public:
41  Fex_ScalarEOS(const FluidMixture*, const FluidComponent*, const ScalarEOS& eos);
42  virtual ~Fex_ScalarEOS();
43 
44  double compute(const ScalarFieldTilde* Ntilde, ScalarFieldTilde* Phi_Ntilde) const;
45  double computeUniform(const double* N, double* Phi_N) const;
46 
47 private:
48  const ScalarEOS& eos; double Vhs;
49  RadialFunctionG fex_LJatt;
50 };
51 
54 { JeffereyAustinEOS(double T, double sigmaEOS);
55  double vdwRadius() const;
56  void evaluate(size_t nData, const double* N, double* Aex, double* Aex_N, double Vhs) const;
57  #ifdef GPU_ENABLED
58  void evaluate_gpu(size_t nData, const double* N, double* Aex, double* Aex_N, double Vhs) const;
59  #endif
60 private:
61  std::shared_ptr<struct JeffereyAustinEOS_eval> eval;
62 };
63 
65 struct TaoMasonEOS : public ScalarEOS
66 { TaoMasonEOS(double T, double Tc, double Pc, double omega, double sigmaEOS);
67  double vdwRadius() const;
68  void evaluate(size_t nData, const double* N, double* Aex, double* Aex_N, double Vhs) const;
69  #ifdef GPU_ENABLED
70  void evaluate_gpu(size_t nData, const double* N, double* Aex, double* Aex_N, double Vhs) const;
71  #endif
72 private:
73  std::shared_ptr<struct TaoMasonEOS_eval> eval;
74 };
75 
76 #endif // JDFTX_FLUID_FEX_SCALAREOS_H
Tao-Mason equation of state for moderately polar liquids.
Definition: Fex_ScalarEOS.h:65
Mixture of fluids that provides the total free energy functional for minimization Constructing Fex an...
Definition: FluidMixture.h:32
std::shared_ptr< ScalarFieldTildeData > ScalarFieldTilde
A smart reference-counting pointer to ScalarFieldTildeData.
Definition: ScalarField.h:45
Abstract base class for excess functionals.
Definition: Fex.h:29
Abstract base class for the equation of state evaluator for ScalarEOS functionals.
Definition: Fex_ScalarEOS.h:26
Named fluid components for which bulk properties / geometries / excess functionals are available...
Definition: FluidComponent.h:27
G-space radial function stored on a uniform grid (of |G|)
Definition: RadialFunction.h:28
Definition: Fex_ScalarEOS.h:37
Jefferey-Austin equation of state for water.
Definition: Fex_ScalarEOS.h:53