From 28eda648937b287435df9b2a7aa75b58d3302032 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Mon, 7 Feb 2022 14:43:32 +0100 Subject: [PATCH] bugfix: change of behavior fraction needed for calculation of homogenized response --- src/homogenization_mechanical.f90 | 13 ++++--------- src/homogenization_thermal.f90 | 18 ++++++------------ src/material.f90 | 8 ++++---- 3 files changed, 14 insertions(+), 25 deletions(-) diff --git a/src/homogenization_mechanical.f90 b/src/homogenization_mechanical.f90 index d2ec08394..1280a9cf3 100644 --- a/src/homogenization_mechanical.f90 +++ b/src/homogenization_mechanical.f90 @@ -131,20 +131,15 @@ module subroutine mechanical_homogenize(Delta_t,ce) integer :: co - homogenization_P(1:3,1:3,ce) = phase_P(1,ce) - homogenization_dPdF(1:3,1:3,1:3,1:3,ce) = phase_mechanical_dPdF(Delta_t,1,ce) + homogenization_P(1:3,1:3,ce) = phase_P(1,ce)*material_v(1,ce) + homogenization_dPdF(1:3,1:3,1:3,1:3,ce) = phase_mechanical_dPdF(Delta_t,1,ce)*material_v(1,ce) do co = 2, homogenization_Nconstituents(material_homogenizationID(ce)) homogenization_P(1:3,1:3,ce) = homogenization_P(1:3,1:3,ce) & - + phase_P(co,ce) + + phase_P(co,ce)*material_v(co,ce) homogenization_dPdF(1:3,1:3,1:3,1:3,ce) = homogenization_dPdF(1:3,1:3,1:3,1:3,ce) & - + phase_mechanical_dPdF(Delta_t,co,ce) + + phase_mechanical_dPdF(Delta_t,co,ce)*material_v(co,ce) end do - homogenization_P(1:3,1:3,ce) = homogenization_P(1:3,1:3,ce) & - / real(homogenization_Nconstituents(material_homogenizationID(ce)),pReal) - homogenization_dPdF(1:3,1:3,1:3,1:3,ce) = homogenization_dPdF(1:3,1:3,1:3,1:3,ce) & - / real(homogenization_Nconstituents(material_homogenizationID(ce)),pReal) - end subroutine mechanical_homogenize diff --git a/src/homogenization_thermal.f90 b/src/homogenization_thermal.f90 index c5490d869..9aa727041 100644 --- a/src/homogenization_thermal.f90 +++ b/src/homogenization_thermal.f90 @@ -105,13 +105,11 @@ module function homogenization_mu_T(ce) result(mu) integer :: co - mu = phase_mu_T(1,ce) + mu = phase_mu_T(1,ce)*material_v(1,ce) do co = 2, homogenization_Nconstituents(material_homogenizationID(ce)) - mu = mu + phase_mu_T(co,ce) + mu = mu + phase_mu_T(co,ce)*material_v(co,ce) end do - mu = mu / real(homogenization_Nconstituents(material_homogenizationID(ce)),pReal) - end function homogenization_mu_T @@ -126,13 +124,11 @@ module function homogenization_K_T(ce) result(K) integer :: co - K = phase_K_T(1,ce) + K = phase_K_T(1,ce)*material_v(1,ce) do co = 2, homogenization_Nconstituents(material_homogenizationID(ce)) - K = K + phase_K_T(co,ce) + K = K + phase_K_T(co,ce)*material_v(co,ce) end do - K = K / real(homogenization_Nconstituents(material_homogenizationID(ce)),pReal) - end function homogenization_K_T @@ -147,13 +143,11 @@ module function homogenization_f_T(ce) result(f) integer :: co - f = phase_f_T(material_phaseID(1,ce),material_phaseEntry(1,ce)) + f = phase_f_T(material_phaseID(1,ce),material_phaseEntry(1,ce))*material_v(1,ce) do co = 2, homogenization_Nconstituents(material_homogenizationID(ce)) - f = f + phase_f_T(material_phaseID(co,ce),material_phaseEntry(co,ce)) + f = f + phase_f_T(material_phaseID(co,ce),material_phaseEntry(co,ce))*material_v(co,ce) end do - f = f/real(homogenization_Nconstituents(material_homogenizationID(ce)),pReal) - end function homogenization_f_T diff --git a/src/material.f90 b/src/material.f90 index 10cf2aa7e..3ff280b0d 100644 --- a/src/material.f90 +++ b/src/material.f90 @@ -145,13 +145,11 @@ subroutine parse() material_homogenizationEntry(ce) = counterHomogenization(ho) end do - v = 0.0_pReal constituents => material%get('constituents') do co = 1, constituents%length constituent => constituents%get(co) - material_v(co,ce) = constituent%get_asFloat('v') - v = v + material_v(co,ce) + v = constituent%get_asFloat('v') ph = phases%getIndex(constituent%get_asString('phase')) do ip = 1, discretization_nIPs @@ -159,10 +157,12 @@ subroutine parse() material_phaseID(co,ce) = ph counterPhase(ph) = counterPhase(ph) + 1 material_phaseEntry(co,ce) = counterPhase(ph) + material_v(co,ce) = v end do end do - if (dNeq(v,1.0_pReal,1.e-12_pReal)) call IO_error(153,ext_msg='constituent') + if (dNeq(sum(material_v(1:constituents%length,ce)),1.0_pReal,1.e-9_pReal)) & + call IO_error(153,ext_msg='constituent') end do