4
4
submodule(phase) thermal
5
5
6
6
type :: tThermalParameters
7
- real (pREAL ) :: C_p = 0.0_pREAL ! < heat capacity
8
- real (pREAL), dimension ( 3 , 3 ) :: K = 0.0_pREAL ! < thermal conductivity
7
+ type (tpolynomial ) :: C_p ! < heat capacity
8
+ type (tpolynomial) :: K_11, K_33 ! < thermal conductivity
9
9
character (len= pSTRLEN), allocatable , dimension (:) :: output
10
10
end type tThermalParameters
11
11
@@ -105,22 +105,23 @@ module subroutine thermal_init(phases)
105
105
thermal = > phase% get_dict(' thermal' ,defaultVal= emptyDict)
106
106
end if
107
107
108
- ! ToDo: temperature dependency of K and C_p
109
108
if (thermal% length > 0 ) then
110
109
thermal_active = .true.
111
110
112
111
print ' (/,1x,a,i0,a)' , ' phase ' ,ph,' : ' // phases% key(ph)
113
112
refs = config_listReferences(thermal,indent= 3 )
114
113
if (len (refs) > 0 ) print ' (/,1x,a)' , refs
115
114
116
- param(ph)% C_p = thermal% get_asReal(' C_p' )
117
- param(ph)% K(1 ,1 ) = thermal% get_asReal(' K_11' )
118
- if (any (phase_lattice(ph) == [' hP' ,' tI' ])) param(ph)% K(3 ,3 ) = thermal% get_asReal(' K_33' )
119
- param(ph)% K = crystal_symmetrize_33(param(ph)% K,phase_lattice(ph))
115
+ associate(prm = > param(ph))
116
+
117
+ prm% C_p = polynomial(thermal,' C_p' ,' T' )
118
+ prm% K_11 = polynomial(thermal,' K_11' ,' T' )
119
+
120
+ if (any (phase_lattice(ph) == [' hP' ,' tI' ])) prm% K_33 = polynomial(thermal,' K_33' ,' T' )
121
+
122
+ end associate
120
123
121
124
! sanity checks
122
- if ( param(ph)% C_p <= 0.0_pREAL ) extmsg = trim (extmsg)// ' C_p'
123
- if (any (param(ph)% K < 0.0_pREAL )) extmsg = trim (extmsg)// ' K'
124
125
if ( phase_rho(ph) <= 0.0_pREAL ) extmsg = trim (extmsg)// ' rho'
125
126
if (extmsg /= ' ' ) call IO_error(211 ,ext_msg= trim (extmsg))
126
127
@@ -223,9 +224,17 @@ module function phase_mu_T(co,ce) result(mu)
223
224
integer , intent (in ) :: co, ce
224
225
real (pREAL) :: mu
225
226
227
+ real (pREAL) :: T
228
+
229
+
230
+ associate(ph = > material_ID_phase(co,ce), &
231
+ en = > material_entry_phase(co,ce))
232
+
233
+ T = current(ph)% T(en)
234
+ mu = phase_rho(ph) &
235
+ * param(ph)% C_p% at(T)
226
236
227
- mu = phase_rho(material_ID_phase(co,ce)) &
228
- * param(material_ID_phase(co,ce))% C_p
237
+ end associate
229
238
230
239
end function phase_mu_T
231
240
@@ -238,8 +247,23 @@ module function phase_K_T(co,ce) result(K)
238
247
integer , intent (in ) :: co, ce
239
248
real (pREAL), dimension (3 ,3 ) :: K
240
249
250
+ real (pREAL) :: T
251
+
252
+
253
+ associate(ph = > material_ID_phase(co,ce), &
254
+ en = > material_entry_phase(co,ce))
255
+
256
+ T = current(ph)% T(en)
257
+
258
+ K = 0.0_pREAL
259
+ K(1 ,1 ) = param(ph)% K_11% at(T)
260
+ if (any (phase_lattice(ph) == [' hP' ,' tI' ])) K(3 ,3 ) = param(ph)% K_33% at(T)
261
+
262
+ K = crystal_symmetrize_33(K,phase_lattice(ph))
263
+ K = crystallite_push33ToRef(co,ce,K)
264
+
265
+ end associate
241
266
242
- K = crystallite_push33ToRef(co,ce,param(material_ID_phase(co,ce))% K)
243
267
244
268
end function phase_K_T
245
269
0 commit comments