8 module physicalproperties
15 type(c_ptr) :: rhopmodena = c_null_ptr
16 type(c_ptr) :: rhopinputs = c_null_ptr
17 type(c_ptr) :: rhopoutputs = c_null_ptr
18 integer(c_size_t) :: rhoptemppos
19 type(c_ptr) :: kfoammodena = c_null_ptr
20 type(c_ptr) :: kfoaminputs = c_null_ptr
21 type(c_ptr) :: kfoamoutputs = c_null_ptr
22 integer(c_size_t) :: kfoamepspos
23 integer(c_size_t) :: kfoamdcellpos
24 integer(c_size_t) :: kfoamfstrutpos
25 integer(c_size_t) :: kfoamtemppos
26 integer(c_size_t),
allocatable :: kfoamxg(:)
27 type(c_ptr) :: kgasmodena = c_null_ptr
28 type(c_ptr) :: kgasinputs = c_null_ptr
29 type(c_ptr) :: kgasoutputs = c_null_ptr
30 integer(c_size_t) :: kgastemppos
31 integer(c_size_t),
allocatable :: kgasxg(:)
32 type(c_ptr),
dimension(:),
allocatable :: sgmodena
33 type(c_ptr),
dimension(:),
allocatable :: sginputs
34 type(c_ptr),
dimension(:),
allocatable :: sgoutputs
35 integer(c_size_t),
dimension(:),
allocatable :: sgtemppos
36 integer(c_size_t),
dimension(:),
allocatable :: sgxl1pos
37 integer(c_size_t),
dimension(:),
allocatable :: sgxl2pos
38 type(c_ptr),
dimension(:),
allocatable :: dgmodena
39 type(c_ptr),
dimension(:),
allocatable :: dginputs
40 type(c_ptr),
dimension(:),
allocatable :: dgoutputs
41 integer(c_size_t),
dimension(:),
allocatable :: dgtemppos
42 type(c_ptr),
dimension(:),
allocatable :: kgmodena
43 type(c_ptr),
dimension(:),
allocatable :: kginputs
44 type(c_ptr),
dimension(:),
allocatable :: kgoutputs
45 integer(c_size_t),
dimension(:),
allocatable :: kgtemppos
51 subroutine createmodels(ngas)
60 kfoamepspos = modena_model_inputs_argpos(&
61 kfoammodena, c_char_
"eps"//c_null_char);
62 kfoamdcellpos = modena_model_inputs_argpos(&
63 kfoammodena, c_char_
"dcell"//c_null_char);
64 kfoamfstrutpos = modena_model_inputs_argpos(&
65 kfoammodena, c_char_
"fstrut"//c_null_char);
66 kfoamtemppos = modena_model_inputs_argpos(&
67 kfoammodena, c_char_
"T"//c_null_char);
69 kfoamxg(i) = modena_model_inputs_argpos(kfoammodena, &
70 c_char_
"x["//trim(adjustl(gasname(i)))//
"]"//c_null_char);
72 call modena_model_argpos_check(kfoammodena)
74 c_char_
"gasMixtureConductivity"//c_null_char)
80 kgastemppos = modena_model_inputs_argpos(&
81 kgasmodena, c_char_
"T"//c_null_char)
83 kgasxg(i) = modena_model_inputs_argpos(kgasmodena, &
84 c_char_
"x["//trim(adjustl(gasname(i)))//
"]"//c_null_char);
86 call modena_model_argpos_check(kgasmodena)
89 "gas_thermal_conductivity[A="//trim(adjustl(gasname(i)))//
"]"//&
96 kgtemppos(i) = modena_model_inputs_argpos(&
97 kgmodena(i), c_char_
"T"//c_null_char);
98 call modena_model_argpos_check(kgmodena(i))
101 "Solubility[A="//trim(adjustl(gasname(i)))//
",B=2]"//&
108 sgtemppos(i) = modena_model_inputs_argpos(&
109 sgmodena(i), c_char_
"T"//c_null_char);
110 sgxl1pos(i) = modena_model_inputs_argpos(&
111 sgmodena(i), c_char_
"xl1"//c_null_char);
112 sgxl2pos(i) = modena_model_inputs_argpos(&
113 sgmodena(i), c_char_
"xl2"//c_null_char);
114 call modena_model_argpos_check(sgmodena(i))
118 "diffusivityPol[A="//trim(adjustl(gasname(i)))//
"]"//&
125 dgtemppos(i) = modena_model_inputs_argpos(&
126 dgmodena(i), c_char_
"T"//c_null_char);
127 call modena_model_argpos_check(dgmodena(i))
130 end subroutine createmodels
138 subroutine destroymodels(ngas)
139 integer,
intent(in) :: ngas
162 end subroutine destroymodels
170 real(dp) function polymerdensity(temp)
171 real(dp),
intent(in) :: temp
178 end function polymerdensity
186 real(dp) function gasmixtureconductivity(temp,xg,ngas)
187 integer,
intent(in) :: ngas
188 real(dp),
intent(in) :: temp
189 real(dp),
intent(in) :: xg(:)
200 end function gasmixtureconductivity
208 real(dp) function gasconductivity(temp,index)
209 integer,
intent(in) :: index
210 real(dp),
intent(in) :: temp
217 end function gasconductivity
225 real(dp) function solubility(temp,index)
226 integer,
intent(in) :: index
227 real(dp),
intent(in) :: temp
239 end function solubility
247 real(dp) function diffusivity(temp,index)
248 integer,
intent(in) :: index
249 real(dp),
intent(in) :: temp
256 end function diffusivity
264 real(dp) function gasdiffusivity(temp)
266 real(dp),
intent(in) :: temp
267 real(dp) :: pcA, pcB, pcApcB, TcA, TcB, TcATcB
268 real(dp) :: MA, MB, Mterm ,a, b, aToverTcsb
271 pcapcb = (pca*pcb)**(1.0e0_dp/3.0e0_dp)
274 tcatcb = (tca*tcb)**(5.0e0_dp/12.0e0_dp)
277 mterm = dsqrt(1/ma + 1/mb)
280 atovertcsb = a*(temp/dsqrt(tca*tcb))**b
282 gasdiffusivity = (atovertcsb*pcapcb*tcatcb*mterm)*1.0e5_dp/
pressure 283 gasdiffusivity = gasdiffusivity * 1.0e-4_dp
284 end function gasdiffusivity
292 real(dp) function cdheatcapacity(temp)
293 real(dp),
intent(in) :: temp
302 cdheatcapacity=a+b*t+c*t**2+d*t**3+e/t**2
303 end function cdheatcapacity
311 real(dp) function cypheatcapacity(temp)
312 real(dp),
intent(in) :: temp
321 cypheatcapacity=a+b*t+c*t**2+d*t**3+e/t**2
322 end function cypheatcapacity
330 real(dp) function airheatcapacity(temp)
331 real(dp),
intent(in) :: temp
332 airheatcapacity=0.21_dp*oxyheatcapacity(temp)+0.79_dp*nitrheatcapacity(temp)
333 end function airheatcapacity
341 real(dp) function nitrheatcapacity(temp)
342 real(dp),
intent(in) :: temp
351 nitrheatcapacity=a+b*t+c*t**2+d*t**3+e/t**2
352 end function nitrheatcapacity
360 real(dp) function oxyheatcapacity(temp)
361 real(dp),
intent(in) :: temp
370 oxyheatcapacity=a+b*t+c*t**2+d*t**3+e/t**2
371 end function oxyheatcapacity
379 subroutine strutcontent(strut_content,foam_density)
380 real(dp),
intent(out) :: strut_content
381 real(dp),
intent(in) :: foam_density
383 integer(c_size_t) :: fspos
384 integer(c_size_t) :: rhopos
385 type(c_ptr) :: fsModena = c_null_ptr
386 type(c_ptr) :: fsInputs = c_null_ptr
387 type(c_ptr) :: fsOutputs = c_null_ptr
394 rhopos = modena_model_inputs_argpos(&
395 fsmodena, c_char_
"rho"//c_null_char)
396 call modena_model_argpos_check(fsmodena)
406 end subroutine strutcontent
408 end module physicalproperties
integer, dimension(:), allocatable solmodel
solubility model
integer, dimension(:), allocatable diffmodel
diffusivity model
real(dp), dimension(:), allocatable pressure
partial pressure(Pa)
namespace with global variables