distributing responsibilities

This commit is contained in:
Martin Diehl 2021-04-11 13:21:27 +02:00
parent 8ec2d3a9ce
commit b2292986f4
5 changed files with 95 additions and 48 deletions

View File

@ -114,7 +114,7 @@ module function homogenization_mu_phi(ce) result(mu)
real(pReal) :: mu
mu = lattice_mu_phi(material_phaseID(1,ce))
mu = phase_mu_phi(1,ce)
end function homogenization_mu_phi
@ -128,7 +128,7 @@ module function homogenization_K_phi(ce) result(K)
real(pReal), dimension(3,3) :: K
K = crystallite_push33ToRef(1,ce,lattice_K_phi(1:3,1:3,material_phaseID(1,ce))) \
K = phase_K_phi(1,ce) &
* num_damage%charLength**2
end function homogenization_K_phi

View File

@ -102,8 +102,15 @@ module function homogenization_mu_T(ce) result(mu)
integer, intent(in) :: ce
real(pReal) :: mu
integer :: co
mu = c_P(ce) * rho(ce)
mu = phase_mu_T(1,ce)
do co = 2, homogenization_Nconstituents(material_homogenizationID(ce))
mu = mu + phase_mu_T(co,ce)
enddo
mu = mu / real(homogenization_Nconstituents(material_homogenizationID(ce)),pReal)
end function homogenization_mu_T
@ -119,9 +126,9 @@ module function homogenization_K_T(ce) result(K)
integer :: co
K = crystallite_push33ToRef(1,ce,lattice_K_T(:,:,material_phaseID(1,ce)))
K = phase_K_T(1,ce)
do co = 2, homogenization_Nconstituents(material_homogenizationID(ce))
K = K + crystallite_push33ToRef(co,ce,lattice_K_T(:,:,material_phaseID(co,ce)))
K = K + phase_K_T(co,ce)
enddo
K = K / real(homogenization_Nconstituents(material_homogenizationID(ce)),pReal)
@ -187,46 +194,4 @@ module subroutine thermal_results(ho,group)
end subroutine thermal_results
!--------------------------------------------------------------------------------------------------
!> @brief Homogenize specific heat capacity.
!--------------------------------------------------------------------------------------------------
function c_P(ce)
integer, intent(in) :: ce
real(pReal) :: c_P
integer :: co
c_P = lattice_c_p(material_phaseID(1,ce))
do co = 2, homogenization_Nconstituents(material_homogenizationID(ce))
c_P = c_P + lattice_c_p(material_phaseID(co,ce))
enddo
c_P = c_P / real(homogenization_Nconstituents(material_homogenizationID(ce)),pReal)
end function c_P
!--------------------------------------------------------------------------------------------------
!> @brief Homogenize mass density.
!--------------------------------------------------------------------------------------------------
function rho(ce)
integer, intent(in) :: ce
real(pReal) :: rho
integer :: co
rho = lattice_rho(material_phaseID(1,ce))
do co = 2, homogenization_Nconstituents(material_homogenizationID(ce))
rho = rho + lattice_rho(material_phaseID(co,ce))
enddo
rho = rho / real(homogenization_Nconstituents(material_homogenizationID(ce)),pReal)
end function rho
end submodule thermal

View File

@ -184,7 +184,7 @@ module phase
module subroutine phase_thermal_setField(T,dot_T, co,ce)
real(pReal), intent(in) :: T, dot_T
integer, intent(in) :: ce, co
integer, intent(in) :: co, ce
end subroutine phase_thermal_setField
module subroutine phase_set_phi(phi,co,ce)
@ -192,6 +192,28 @@ module phase
integer, intent(in) :: co, ce
end subroutine phase_set_phi
module function phase_mu_phi(co,ce) result(mu)
integer, intent(in) :: co, ce
real(pReal) :: mu
end function phase_mu_phi
module function phase_K_phi(co,ce) result(K)
integer, intent(in) :: co, ce
real(pReal), dimension(3,3) :: K
end function phase_K_phi
module function phase_mu_T(co,ce) result(mu)
integer, intent(in) :: co, ce
real(pReal) :: mu
end function phase_mu_T
module function phase_K_T(co,ce) result(K)
integer, intent(in) :: co, ce
real(pReal), dimension(3,3) :: K
end function phase_K_T
! == cleaned:end ===================================================================================
module function thermal_stress(Delta_t,ph,me) result(converged_)
@ -297,6 +319,10 @@ module phase
phase_homogenizedC, &
phase_f_phi, &
phase_f_T, &
phase_K_phi, &
phase_K_T, &
phase_mu_phi, &
phase_mu_T, &
phase_results, &
phase_allocateState, &
phase_forward, &

View File

@ -345,6 +345,33 @@ function phase_damage_collectDotState(ph,me) result(broken)
end function phase_damage_collectDotState
!--------------------------------------------------------------------------------------------------
!> @brief Damage viscosity.
!--------------------------------------------------------------------------------------------------
module function phase_mu_phi(co,ce) result(mu)
integer, intent(in) :: co, ce
real(pReal) :: mu
mu = lattice_mu_phi(material_phaseID(co,ce))
end function phase_mu_phi
!--------------------------------------------------------------------------------------------------
!> @brief Damage conductivity/diffusivity in reference configuration.
!--------------------------------------------------------------------------------------------------
module function phase_K_phi(co,ce) result(K)
integer, intent(in) :: co, ce
real(pReal), dimension(3,3) :: K
K = crystallite_push33ToRef(co,ce,lattice_K_phi(1:3,1:3,material_phaseID(co,ce)))
end function phase_K_phi
!--------------------------------------------------------------------------------------------------
!> @brief for constitutive models having an instantaneous change of state

View File

@ -184,6 +184,35 @@ function phase_thermal_collectDotState(ph,me) result(broken)
end function phase_thermal_collectDotState
!--------------------------------------------------------------------------------------------------
!> @brief Damage viscosity.
!--------------------------------------------------------------------------------------------------
module function phase_mu_T(co,ce) result(mu)
integer, intent(in) :: co, ce
real(pReal) :: mu
mu = lattice_c_p(material_phaseID(co,ce)) &
* lattice_rho(material_phaseID(co,ce))
end function phase_mu_T
!--------------------------------------------------------------------------------------------------
!> @brief Damage conductivity/diffusivity in reference configuration.
!--------------------------------------------------------------------------------------------------
module function phase_K_T(co,ce) result(K)
integer, intent(in) :: co, ce
real(pReal), dimension(3,3) :: K
K = crystallite_push33ToRef(co,ce,lattice_K_T(1:3,1:3,material_phaseID(co,ce)))
end function phase_K_T
module function thermal_stress(Delta_t,ph,me) result(converged_) ! ?? why is this called "stress" when it seems closer to "updateState" ??
real(pReal), intent(in) :: Delta_t