From 35f20811cbec1dc111ccff6b885fd6841934a930 Mon Sep 17 00:00:00 2001 From: Sharan Roongta Date: Wed, 24 Nov 2021 22:51:14 +0100 Subject: [PATCH] thermal dependent C --- PRIVATE | 2 +- src/phase_mechanical_elastic.f90 | 51 ++++++++++++++++++++++---------- 2 files changed, 36 insertions(+), 17 deletions(-) diff --git a/PRIVATE b/PRIVATE index 76bb51348..7cae6f6fb 160000 --- a/PRIVATE +++ b/PRIVATE @@ -1 +1 @@ -Subproject commit 76bb51348de75207d483d369628670e5ae51dca9 +Subproject commit 7cae6f6fb6daca513fefbce21e4f07ab36fd3c78 diff --git a/src/phase_mechanical_elastic.f90 b/src/phase_mechanical_elastic.f90 index 1b39f51ee..e2999d96f 100644 --- a/src/phase_mechanical_elastic.f90 +++ b/src/phase_mechanical_elastic.f90 @@ -1,7 +1,7 @@ submodule(phase:mechanical) elastic type :: tParameters - real(pReal) :: & + real(pReal),dimension(3) :: & C_11 = 0.0_pReal, & C_12 = 0.0_pReal, & C_13 = 0.0_pReal, & @@ -28,7 +28,7 @@ module subroutine elastic_init(phases) phase, & mech, & elastic - + logical :: thermal_active print'(/,1x,a)', '<<<+- phase:mechanical:elastic init -+>>>' print'(/,1x,a)', '<<<+- phase:mechanical:elastic:Hooke init -+>>>' @@ -45,15 +45,33 @@ module subroutine elastic_init(phases) associate(prm => param(ph)) - prm%C_11 = elastic%get_asFloat('C_11') - prm%C_12 = elastic%get_asFloat('C_12') - prm%C_44 = elastic%get_asFloat('C_44') - + prm%C_11(1) = elastic%get_asFloat('C_11') + prm%C_11(2) = elastic%get_asFloat('C_11,T', defaultVal=0.0_pReal) + prm%C_11(3) = elastic%get_asFloat('C_11,T^2',defaultVal=0.0_pReal) + + prm%C_12(1) = elastic%get_asFloat('C_12') + prm%C_12(2) = elastic%get_asFloat('C_12,T', defaultVal=0.0_pReal) + prm%C_12(3) = elastic%get_asFloat('C_12,T^2',defaultVal=0.0_pReal) + + prm%C_44(1) = elastic%get_asFloat('C_44') + prm%C_44(2) = elastic%get_asFloat('C_44,T', defaultVal=0.0_pReal) + prm%C_44(3) = elastic%get_asFloat('C_44,T^2',defaultVal=0.0_pReal) + if (any(phase_lattice(ph) == ['hP','tI'])) then - prm%C_13 = elastic%get_asFloat('C_13') - prm%C_33 = elastic%get_asFloat('C_33') + prm%C_13(1) = elastic%get_asFloat('C_13') + prm%C_13(2) = elastic%get_asFloat('C_13,T', defaultVal=0.0_pReal) + prm%C_13(3) = elastic%get_asFloat('C_13,T^2',defaultVal=0.0_pReal) + + prm%C_33(1) = elastic%get_asFloat('C_33') + prm%C_33(2) = elastic%get_asFloat('C_33,T', defaultVal=0.0_pReal) + prm%C_33(3) = elastic%get_asFloat('C_33,T^2',defaultVal=0.0_pReal) + end if + + if (phase_lattice(ph) == 'tI') then + prm%C_66(1) = elastic%get_asFloat('C_66') + prm%C_66(2) = elastic%get_asFloat('C_66,T', defaultVal=0.0_pReal) + prm%C_66(3) = elastic%get_asFloat('C_66,T^2',defaultVal=0.0_pReal) end if - if (phase_lattice(ph) == 'tI') prm%C_66 = elastic%get_asFloat('C_66') end associate end do @@ -70,20 +88,21 @@ module function elastic_C66(ph,en) result(C66) ph, & en real(pReal), dimension(6,6) :: C66 - + real(pReal) :: T associate(prm => param(ph)) C66 = 0.0_pReal - C66(1,1) = prm%C_11 - C66(1,2) = prm%C_12 - C66(4,4) = prm%C_44 + T = thermal_T(ph,en) + C66(1,1) = prm%C_11(1) + prm%C_11(2)*T + prm%C_11(3)*T**2 + C66(1,2) = prm%C_12(1) + prm%C_12(2)*T + prm%C_12(3)*T**2 + C66(4,4) = prm%C_44(1) + prm%C_44(2)*T + prm%C_44(3)*T**2 if (any(phase_lattice(ph) == ['hP','tI'])) then - C66(1,3) = prm%C_13 - C66(3,3) = prm%C_33 + C66(1,3) = prm%C_13(1) + prm%C_13(2)*T + prm%C_13(3)*T**2 + C66(3,3) = prm%C_33(1) + prm%C_33(2)*T + prm%C_33(3)*T**2 end if - if (phase_lattice(ph) == 'tI') C66(6,6) = prm%C_66 + if (phase_lattice(ph) == 'tI') C66(6,6) = prm%C_66(1) + prm%C_66(2)*T + prm%C_66(3)*T**2 C66 = lattice_symmetrize_C66(C66,phase_lattice(ph))