14 integer(c_size_t) :: &
19 soltpos(2),solxgaspos(2),solxmdipos(2),solxpolyolpos(2),&
20 kininputspos(21),kinoutputspos(20)
22 viscmodena = c_null_ptr,&
23 viscinputs = c_null_ptr,&
24 viscoutputs = c_null_ptr,&
25 rhopmodena = c_null_ptr,&
26 rhopinputs = c_null_ptr,&
27 rhopoutputs = c_null_ptr,&
28 itensmodena = c_null_ptr,&
29 itensinputs = c_null_ptr,&
30 itensoutputs = c_null_ptr,&
31 diffmodena(2) = c_null_ptr,&
32 diffinputs(2) = c_null_ptr,&
33 diffoutputs(2) = c_null_ptr,&
34 solmodena(2) = c_null_ptr,&
35 solinputs(2) = c_null_ptr,&
36 soloutputs(2) = c_null_ptr,&
37 kinmodena = c_null_ptr,&
38 kininputs = c_null_ptr,&
39 kinoutputs = c_null_ptr
41 createmodenamodels,destroymodenamodels,&
46 soltpos,solxgaspos,solxmdipos,solxpolyolpos,&
47 kininputspos,kinoutputspos,&
48 viscmodena,viscinputs,viscoutputs,&
49 rhopmodena,rhopinputs,rhopoutputs,&
50 itensmodena,itensinputs,itensoutputs,&
51 diffmodena,diffinputs,diffoutputs,&
52 solmodena,solinputs,soloutputs,&
53 kinmodena,kininputs,kinoutputs
59 subroutine createmodenamodels
61 character(len=3) gasname(2)
69 visctpos = modena_model_inputs_argpos(viscmodena, &
70 c_char_
"T"//c_null_char);
71 viscxpos = modena_model_inputs_argpos(viscmodena, &
72 c_char_
"X"//c_null_char);
73 call modena_model_argpos_check(viscmodena)
77 c_char_
"density_reaction_mixture"//c_null_char);
83 rhoptpos = modena_model_inputs_argpos(rhopmodena, &
84 c_char_
"T"//c_null_char);
85 rhopxohpos = modena_model_inputs_argpos(rhopmodena, &
86 c_char_
"XOH"//c_null_char);
87 call modena_model_argpos_check(rhopmodena)
90 c_char_
"PolymerDensity[A=AIR,B=PU]"//c_null_char);
96 rhoptpos = modena_model_inputs_argpos(rhopmodena, &
97 c_char_
"T"//c_null_char);
98 call modena_model_argpos_check(rhopmodena)
103 "SurfaceTension[A=AIR,B=PU,C=surfactant]"//c_null_char);
106 "SurfaceTension[A=AIR,B=PU,C=no_surfactant]"//c_null_char);
113 itenstpos = modena_model_inputs_argpos(&
114 itensmodena, c_char_
"T"//c_null_char);
115 call modena_model_argpos_check(itensmodena)
124 stop
'CO2 position must be 1 or 2' 129 c_char_
"diffusivityPol[A="//gasname(i)//
"]"//c_null_char);
135 difftpos(i) = modena_model_inputs_argpos(diffmodena(i), &
136 c_char_
"T"//c_null_char);
137 call modena_model_argpos_check(diffmodena(i))
141 c_char_
"SolubilityCO2Baser"//c_null_char);
147 soltpos(i) = modena_model_inputs_argpos(solmodena(i), &
148 c_char_
"T"//c_null_char);
149 call modena_model_argpos_check(solmodena(i))
153 c_char_
"Solubility[A="//gasname(i)//
",B=3]"//c_null_char);
159 soltpos(i) = modena_model_inputs_argpos(solmodena(i), &
160 c_char_
"T"//c_null_char);
161 solxgaspos(i) = modena_model_inputs_argpos(solmodena(i), &
162 c_char_
"xl1"//c_null_char);
163 solxpolyolpos(i) = modena_model_inputs_argpos(solmodena(i), &
164 c_char_
"xl2"//c_null_char);
165 solxmdipos(i) = modena_model_inputs_argpos(solmodena(i), &
166 c_char_
"xl3"//c_null_char);
167 call modena_model_argpos_check(solmodena(i))
171 c_char_
"SolubilityPentGupta"//c_null_char);
177 soltpos(i) = modena_model_inputs_argpos(solmodena(i), &
178 c_char_
"T"//c_null_char);
179 call modena_model_argpos_check(solmodena(i))
183 c_char_
"SolubilityPentWinkler"//c_null_char);
189 soltpos(i) = modena_model_inputs_argpos(solmodena(i), &
190 c_char_
"T"//c_null_char);
191 call modena_model_argpos_check(solmodena(i))
195 c_char_
"SolubilityR11Baser"//c_null_char);
201 soltpos(i) = modena_model_inputs_argpos(solmodena(i), &
202 c_char_
"T"//c_null_char);
203 call modena_model_argpos_check(solmodena(i))
213 kininputspos(1) = modena_model_inputs_argpos(kinmodena, &
214 c_char_
"'kineticTime'"//c_null_char);
215 kininputspos(2) = modena_model_inputs_argpos(kinmodena, &
216 c_char_
"'Catalyst_1'"//c_null_char);
217 kininputspos(3) = modena_model_inputs_argpos(kinmodena, &
218 c_char_
"'CE_A0'"//c_null_char);
219 kininputspos(4) = modena_model_inputs_argpos(kinmodena, &
220 c_char_
"'CE_A1'"//c_null_char);
221 kininputspos(5) = modena_model_inputs_argpos(kinmodena, &
222 c_char_
"'CE_B'"//c_null_char);
223 kininputspos(6) = modena_model_inputs_argpos(kinmodena, &
224 c_char_
"'CE_B2'"//c_null_char);
225 kininputspos(7) = modena_model_inputs_argpos(kinmodena, &
226 c_char_
"'CE_I0'"//c_null_char);
227 kininputspos(8) = modena_model_inputs_argpos(kinmodena, &
228 c_char_
"'CE_I1'"//c_null_char);
229 kininputspos(9) = modena_model_inputs_argpos(kinmodena, &
230 c_char_
"'CE_I2'"//c_null_char);
231 kininputspos(10) = modena_model_inputs_argpos(kinmodena, &
232 c_char_
"'CE_PBA'"//c_null_char);
233 kininputspos(11) = modena_model_inputs_argpos(kinmodena, &
234 c_char_
"'CE_Breac'"//c_null_char);
235 kininputspos(12) = modena_model_inputs_argpos(kinmodena, &
236 c_char_
"'CE_Areac0'"//c_null_char);
237 kininputspos(13) = modena_model_inputs_argpos(kinmodena, &
238 c_char_
"'CE_Areac1'"//c_null_char);
239 kininputspos(14) = modena_model_inputs_argpos(kinmodena, &
240 c_char_
"'CE_Ireac0'"//c_null_char);
241 kininputspos(15) = modena_model_inputs_argpos(kinmodena, &
242 c_char_
"'CE_Ireac1'"//c_null_char);
243 kininputspos(16) = modena_model_inputs_argpos(kinmodena, &
244 c_char_
"'CE_Ireac2'"//c_null_char);
245 kininputspos(17) = modena_model_inputs_argpos(kinmodena, &
246 c_char_
"'Bulk'"//c_null_char);
247 kininputspos(18) = modena_model_inputs_argpos(kinmodena, &
248 c_char_
"'R_1'"//c_null_char);
249 kininputspos(19) = modena_model_inputs_argpos(kinmodena, &
250 c_char_
"'R_1_mass'"//c_null_char);
251 kininputspos(20) = modena_model_inputs_argpos(kinmodena, &
252 c_char_
"'R_1_temp'"//c_null_char);
253 kininputspos(21) = modena_model_inputs_argpos(kinmodena, &
254 c_char_
"'R_1_vol'"//c_null_char);
255 kinoutputspos(1) = modena_model_outputs_argpos(kinmodena, &
256 c_char_
"source_Catalyst_1"//c_null_char);
257 kinoutputspos(2) = modena_model_outputs_argpos(kinmodena, &
258 c_char_
"source_CE_A0"//c_null_char);
259 kinoutputspos(3) = modena_model_outputs_argpos(kinmodena, &
260 c_char_
"source_CE_A1"//c_null_char);
261 kinoutputspos(4) = modena_model_outputs_argpos(kinmodena, &
262 c_char_
"source_CE_B"//c_null_char);
263 kinoutputspos(5) = modena_model_outputs_argpos(kinmodena, &
264 c_char_
"source_CE_B2"//c_null_char);
265 kinoutputspos(6) = modena_model_outputs_argpos(kinmodena, &
266 c_char_
"source_CE_I0"//c_null_char);
267 kinoutputspos(7) = modena_model_outputs_argpos(kinmodena, &
268 c_char_
"source_CE_I1"//c_null_char);
269 kinoutputspos(8) = modena_model_outputs_argpos(kinmodena, &
270 c_char_
"source_CE_I2"//c_null_char);
271 kinoutputspos(9) = modena_model_outputs_argpos(kinmodena, &
272 c_char_
"source_CE_PBA"//c_null_char);
273 kinoutputspos(10) = modena_model_outputs_argpos(kinmodena, &
274 c_char_
"source_CE_Breac"//c_null_char);
275 kinoutputspos(11) = modena_model_outputs_argpos(kinmodena, &
276 c_char_
"source_CE_Areac0"//c_null_char);
277 kinoutputspos(12) = modena_model_outputs_argpos(kinmodena, &
278 c_char_
"source_CE_Areac1"//c_null_char);
279 kinoutputspos(13) = modena_model_outputs_argpos(kinmodena, &
280 c_char_
"source_CE_Ireac0"//c_null_char);
281 kinoutputspos(14) = modena_model_outputs_argpos(kinmodena, &
282 c_char_
"source_CE_Ireac1"//c_null_char);
283 kinoutputspos(15) = modena_model_outputs_argpos(kinmodena, &
284 c_char_
"source_CE_Ireac2"//c_null_char);
285 kinoutputspos(16) = modena_model_outputs_argpos(kinmodena, &
286 c_char_
"source_Bulk"//c_null_char);
287 kinoutputspos(17) = modena_model_outputs_argpos(kinmodena, &
288 c_char_
"source_R_1"//c_null_char);
289 kinoutputspos(18) = modena_model_outputs_argpos(kinmodena, &
290 c_char_
"source_R_1_mass"//c_null_char);
291 kinoutputspos(19) = modena_model_outputs_argpos(kinmodena, &
292 c_char_
"source_R_1_temp"//c_null_char);
293 kinoutputspos(20) = modena_model_outputs_argpos(kinmodena, &
294 c_char_
"source_R_1_vol"//c_null_char);
295 call modena_model_argpos_check(kinmodena)
297 end subroutine createmodenamodels
305 subroutine destroymodenamodels
341 end subroutine destroymodenamodels
343 end module modenastuff
logical surfactantpresent
surfactant is present - pcsaft caluclation (t/f)
integer ngas
number of dissolved gases
integer, dimension(:), allocatable sol_model
solubility model 1=constant,2=modena
integer rhop_model
polymer density model. 1=constant,2=modena
integer, dimension(:), allocatable diff_model
diffusivity model 1=constant,2=modena
integer itens_model
interfacial tension model. 1=constant,2=modena
integer co2_pos
carbon dioxide position
integer kin_model
reaction kinetics model.
namespace with global variables
integer visc_model
viscosity model. 1=constant,2=Castro and Macosko,3=modena