From e9418672907ccd5974ac568bd939ddf8880a71b2 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Thu, 25 Nov 2021 06:21:56 +0100 Subject: [PATCH] single source of truth --- src/commercialFEM_fileList.f90 | 1 + src/constants.f90 | 15 +++++++++++++++ src/phase.f90 | 1 + src/phase_mechanical_eigen_thermalexpansion.f90 | 2 +- src/phase_mechanical_plastic_dislotungsten.f90 | 3 --- src/phase_mechanical_plastic_dislotwin.f90 | 5 +---- src/phase_mechanical_plastic_nonlocal.f90 | 3 --- 7 files changed, 19 insertions(+), 11 deletions(-) create mode 100644 src/constants.f90 diff --git a/src/commercialFEM_fileList.f90 b/src/commercialFEM_fileList.f90 index e1d53ca83..e67149dea 100644 --- a/src/commercialFEM_fileList.f90 +++ b/src/commercialFEM_fileList.f90 @@ -4,6 +4,7 @@ !> @details List of files needed by MSC.Marc !-------------------------------------------------------------------------------------------------- #include "parallelization.f90" +#include "constants.f90" #include "IO.f90" #include "YAML_types.f90" #include "YAML_parse.f90" diff --git a/src/constants.f90 b/src/constants.f90 new file mode 100644 index 000000000..5a5f44875 --- /dev/null +++ b/src/constants.f90 @@ -0,0 +1,15 @@ +!-------------------------------------------------------------------------------------------------- +!> @author Martin Diehl, KU Leuven +!> @brief physical constants +!-------------------------------------------------------------------------------------------------- +module constants + use prec + + implicit none + public + + real(pReal), parameter :: & + T_ROOM = 300.0_pReal, & !< Room temperature in K + kB = 1.38e-23_pReal !< Boltzmann constant in J/Kelvin + +end module constants diff --git a/src/phase.f90 b/src/phase.f90 index 22c35416b..214b0f5fa 100644 --- a/src/phase.f90 +++ b/src/phase.f90 @@ -5,6 +5,7 @@ !-------------------------------------------------------------------------------------------------- module phase use prec + use constants use math use rotations use IO diff --git a/src/phase_mechanical_eigen_thermalexpansion.f90 b/src/phase_mechanical_eigen_thermalexpansion.f90 index e48e56672..b62db88ef 100644 --- a/src/phase_mechanical_eigen_thermalexpansion.f90 +++ b/src/phase_mechanical_eigen_thermalexpansion.f90 @@ -58,7 +58,7 @@ module function thermalexpansion_init(kinematics_length) result(myKinematics) associate(prm => param(kinematics_thermal_expansion_instance(p))) kinematic_type => kinematics%get(k) - prm%T_ref = kinematic_type%get_asFloat('T_ref', defaultVal=300.0_pReal) + prm%T_ref = kinematic_type%get_asFloat('T_ref', defaultVal=T_ROOM) prm%A(1,1,1) = kinematic_type%get_asFloat('A_11') prm%A(1,1,2) = kinematic_type%get_asFloat('A_11,T',defaultVal=0.0_pReal) diff --git a/src/phase_mechanical_plastic_dislotungsten.f90 b/src/phase_mechanical_plastic_dislotungsten.f90 index 102e009fe..1db4107e4 100644 --- a/src/phase_mechanical_plastic_dislotungsten.f90 +++ b/src/phase_mechanical_plastic_dislotungsten.f90 @@ -7,9 +7,6 @@ !-------------------------------------------------------------------------------------------------- submodule(phase:plastic) dislotungsten - real(pReal), parameter :: & - kB = 1.38e-23_pReal !< Boltzmann constant in J/Kelvin - type :: tParameters real(pReal) :: & D = 1.0_pReal, & !< grain size diff --git a/src/phase_mechanical_plastic_dislotwin.f90 b/src/phase_mechanical_plastic_dislotwin.f90 index c26dc2a32..304d36345 100644 --- a/src/phase_mechanical_plastic_dislotwin.f90 +++ b/src/phase_mechanical_plastic_dislotwin.f90 @@ -9,9 +9,6 @@ !-------------------------------------------------------------------------------------------------- submodule(phase:plastic) dislotwin - real(pReal), parameter :: & - kB = 1.38e-23_pReal !< Boltzmann constant in J/Kelvin - type :: tParameters real(pReal) :: & Q_cl = 1.0_pReal, & !< activation energy for dislocation climb @@ -31,7 +28,7 @@ submodule(phase:plastic) dislotwin delta_G = 1.0_pReal, & !< Free energy difference between austensite and martensite i_tr = 1.0_pReal, & !< adjustment parameter to calculate MFP for transformation h = 1.0_pReal, & !< Stack height of hex nucleus - T_ref = 300.0_pReal, & + T_ref = T_ROOM, & a_cI = 1.0_pReal, & a_cF = 1.0_pReal real(pReal), dimension(2) :: & diff --git a/src/phase_mechanical_plastic_nonlocal.f90 b/src/phase_mechanical_plastic_nonlocal.f90 index f53a16042..a0199d253 100644 --- a/src/phase_mechanical_plastic_nonlocal.f90 +++ b/src/phase_mechanical_plastic_nonlocal.f90 @@ -19,9 +19,6 @@ submodule(phase:plastic) nonlocal type(tGeometry), dimension(:), allocatable :: geom - real(pReal), parameter :: & - kB = 1.38e-23_pReal !< Boltzmann constant in J/Kelvin - ! storage order of dislocation types integer, dimension(*), parameter :: & sgl = [1,2,3,4,5,6,7,8] !< signed (single)