Skip to content

Commit f4e7898

Browse files
committed
Merge branch '170-temperature-dependent-heat-capacity' into 'development'
Temperature-dependent heat capacity and thermal conductivity See merge request damask/DAMASK!1028
2 parents 8b7b427 + 453dda1 commit f4e7898

File tree

4 files changed

+39
-15
lines changed

4 files changed

+39
-15
lines changed

PRIVATE

examples/config/phase/thermal/X2CrNi18-10.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ K_11: 12.86
1111
K_11,T: 1.618e-2
1212

1313
C_p: 508.7
14-
C_p,T: 1.347e-1 # not implemented
14+
C_p,T: 1.347e-1
1515

1616
T_ref: 293.15

examples/config/phase/thermal/X2CrNiMo17-12-2.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ K_11: 13.85
1111
K_11,T: 1.571e-2
1212

1313
C_p: 497.7
14-
C_p,T: 1.327e-1 # not implemented
14+
C_p,T: 1.327e-1
1515

1616
T_ref: 293.15

src/phase_thermal.f90

+36-12
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
submodule(phase) thermal
55

66
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
99
character(len=pSTRLEN), allocatable, dimension(:) :: output
1010
end type tThermalParameters
1111

@@ -105,22 +105,23 @@ module subroutine thermal_init(phases)
105105
thermal => phase%get_dict('thermal',defaultVal=emptyDict)
106106
end if
107107

108-
! ToDo: temperature dependency of K and C_p
109108
if (thermal%length > 0) then
110109
thermal_active = .true.
111110

112111
print'(/,1x,a,i0,a)', 'phase ',ph,': '//phases%key(ph)
113112
refs = config_listReferences(thermal,indent=3)
114113
if (len(refs) > 0) print'(/,1x,a)', refs
115114

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
120123

121124
! 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'
124125
if ( phase_rho(ph) <= 0.0_pREAL ) extmsg = trim(extmsg)//' rho'
125126
if (extmsg /= '') call IO_error(211,ext_msg=trim(extmsg))
126127

@@ -223,9 +224,17 @@ module function phase_mu_T(co,ce) result(mu)
223224
integer, intent(in) :: co, ce
224225
real(pREAL) :: mu
225226

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)
226236

227-
mu = phase_rho(material_ID_phase(co,ce)) &
228-
* param(material_ID_phase(co,ce))%C_p
237+
end associate
229238

230239
end function phase_mu_T
231240

@@ -238,8 +247,23 @@ module function phase_K_T(co,ce) result(K)
238247
integer, intent(in) :: co, ce
239248
real(pREAL), dimension(3,3) :: K
240249

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
241266

242-
K = crystallite_push33ToRef(co,ce,param(material_ID_phase(co,ce))%K)
243267

244268
end function phase_K_T
245269

0 commit comments

Comments
 (0)