1 #ifndef __CS_LAGR_DLVO_H__
2 #define __CS_LAGR_DLVO_H__
3 
4 /*============================================================================
5  * Functions and types for the clogging modeling
6  *============================================================================*/
7 
8 /*
9   This file is part of Code_Saturne, a general-purpose CFD tool.
10 
11   Copyright (C) 1998-2021 EDF S.A.
12 
13   This program is free software; you can redistribute it and/or modify it under
14   the terms of the GNU General Public License as published by the Free Software
15   Foundation; either version 2 of the License, or (at your option) any later
16   version.
17 
18   This program is distributed in the hope that it will be useful, but WITHOUT
19   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
20   FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
21   details.
22 
23   You should have received a copy of the GNU General Public License along with
24   this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
25   Street, Fifth Floor, Boston, MA 02110-1301, USA.
26 */
27 
28 /*----------------------------------------------------------------------------*/
29 
30 /*----------------------------------------------------------------------------
31  *  Local headers
32  *----------------------------------------------------------------------------*/
33 
34 #include "cs_defs.h"
35 
36 #include "cs_lagr_particle.h"
37 
38 /*----------------------------------------------------------------------------*/
39 
40 BEGIN_C_DECLS
41 
42 /*============================================================================
43  * Type definitions
44  *============================================================================*/
45 
46 typedef struct {
47 
48   cs_real_t   water_permit;
49   cs_real_t   ionic_strength;
50   cs_real_t   phi_p;
51   cs_real_t   phi_s;
52   cs_real_t  *temperature;
53   cs_real_t   valen;
54   cs_real_t  *debye_length;
55   cs_real_t   cstham;
56   cs_real_t   csthpp;
57   cs_real_t   lambda_vdw;
58 
59 } cs_lagr_dlvo_param_t;
60 
61 /*=============================================================================
62  * Function definitions
63  *============================================================================*/
64 
65 /*----------------------------------------------------------------------------
66  * DLVO initialization
67  *----------------------------------------------------------------------------*/
68 
69 void
70 cs_lagr_dlvo_init(const cs_real_t   water_permit,
71                   const cs_real_t   ionic_strength,
72                   const cs_real_t   temperature[],
73                   const cs_real_t   valen,
74                   const cs_real_t   phi_p,
75                   const cs_real_t   phi_s,
76                   const cs_real_t   cstham,
77                   const cs_real_t   csthpp,
78                   const cs_real_t   lambda_vdw);
79 
80 /*----------------------------------------------------------------------------
81  * Deallocate the arrays storing temperature and Debye length.
82  *----------------------------------------------------------------------------*/
83 
84 void
85 cs_lagr_dlvo_finalize(void);
86 
87 /*----------------------------------------------------------------------------
88  * Compute the energy barrier for a smooth wall.
89  *----------------------------------------------------------------------------*/
90 
91 void
92 cs_lagr_barrier(const void                     *particle,
93                 const cs_lagr_attribute_map_t  *attr_map,
94                 cs_lnum_t                       iel,
95                 cs_real_t                      *energy_barrier);
96 
97 /*----------------------------------------------------------------------------
98  * Compute the energy barrier for two spheres.
99  *----------------------------------------------------------------------------*/
100 
101 void
102 cs_lagr_barrier_pp(cs_real_t                       dpart,
103                    cs_lnum_t                       iel,
104                    cs_real_t                      *energy_barrier);
105 
106 /*----------------------------------------------------------------------------
107  * Van der Waals interaction between a sphere and a plane
108  * using formulas from Czarnecki (large distances)
109  *                 and Gregory (small distances)
110  *----------------------------------------------------------------------------*/
111 
112 cs_real_t
113 cs_lagr_van_der_waals_sphere_plane(cs_real_t  distp,
114                                    cs_real_t  rpart,
115                                    cs_real_t  lambda_vdw,
116                                    cs_real_t  cstham);
117 
118 /*----------------------------------------------------------------------------
119  * Calculation of the Van der Waals interaction between two spheres
120  * following the formula from Gregory (1981a)
121  *----------------------------------------------------------------------------*/
122 
123 cs_real_t
124 cs_lagr_van_der_waals_sphere_sphere(cs_real_t    distcc,
125                                     cs_real_t    rpart1,
126                                     cs_real_t    rpart2,
127                                     cs_real_t    lambda_vdw,
128                                     cs_real_t    cstham);
129 
130 /*----------------------------------------------------------------------------
131  * Electric Double Layer (EDL) interaction between a sphere and a plane
132  * using the formula from Bell & al (1970)
133  * based on the McCartney & Levine method
134  *----------------------------------------------------------------------------*/
135 
136 cs_real_t
137 cs_lagr_edl_sphere_plane (cs_real_t  distp,
138                           cs_real_t  rpart,
139                           cs_real_t  valen,
140                           cs_real_t  phi1,
141                           cs_real_t  phi2,
142                           cs_real_t  temp,
143                           cs_real_t  debye_length,
144                           cs_real_t  water_permit);
145 
146 /*----------------------------------------------------------------------------
147  * Calculation of the EDL interaction between two spheres
148  * using the formula from Bell & al (1970)
149  * based on the McCartney & Levine method
150  *----------------------------------------------------------------------------*/
151 
152 cs_real_t
153 cs_lagr_edl_sphere_sphere(cs_real_t  distcc,
154                           cs_real_t  rpart1,
155                           cs_real_t  rpart2,
156                           cs_real_t  valen,
157                           cs_real_t  phi1,
158                           cs_real_t  phi2,
159                           cs_real_t  temp,
160                           cs_real_t  debye_length,
161                           cs_real_t  water_permit);
162 
163 /*----------------------------------------------------------------------------*/
164 
165 END_C_DECLS
166 
167 #endif /* __CS_LAGR_DLVO_H__ */
168 
169