polishing
This commit is contained in:
parent
ba9bd9120e
commit
0679fa1713
|
@ -39,7 +39,7 @@ contains
|
||||||
!--------------------------------------------------------------------------------------------------
|
!--------------------------------------------------------------------------------------------------
|
||||||
subroutine source_thermal_dissipation_init
|
subroutine source_thermal_dissipation_init
|
||||||
|
|
||||||
integer :: Ninstance,instance,source,sourceOffset,NofMyPhase,p
|
integer :: Ninstance,source,sourceOffset,NofMyPhase,p
|
||||||
|
|
||||||
write(6,'(/,a)') ' <<<+- source_'//SOURCE_thermal_dissipation_label//' init -+>>>'; flush(6)
|
write(6,'(/,a)') ' <<<+- source_'//SOURCE_thermal_dissipation_label//' init -+>>>'; flush(6)
|
||||||
|
|
||||||
|
@ -59,10 +59,11 @@ subroutine source_thermal_dissipation_init
|
||||||
enddo
|
enddo
|
||||||
|
|
||||||
if (all(phase_source(:,p) /= SOURCE_THERMAL_DISSIPATION_ID)) cycle
|
if (all(phase_source(:,p) /= SOURCE_THERMAL_DISSIPATION_ID)) cycle
|
||||||
associate(config => config_phase(p))
|
associate(prm => param(source_thermal_dissipation_instance(p)), &
|
||||||
|
config => config_phase(p))
|
||||||
|
|
||||||
|
prm%kappa = config%getFloat('dissipation_coldworkcoeff')
|
||||||
|
|
||||||
instance = source_thermal_dissipation_instance(p)
|
|
||||||
param(instance)%kappa = config%getFloat('dissipation_coldworkcoeff')
|
|
||||||
NofMyPhase = count(material_phaseAt==p) * discretization_nIP
|
NofMyPhase = count(material_phaseAt==p) * discretization_nIP
|
||||||
sourceOffset = source_thermal_dissipation_offset(p)
|
sourceOffset = source_thermal_dissipation_offset(p)
|
||||||
|
|
||||||
|
@ -88,13 +89,11 @@ subroutine source_thermal_dissipation_getRateAndItsTangent(TDot, dTDot_dT, Tstar
|
||||||
real(pReal), intent(out) :: &
|
real(pReal), intent(out) :: &
|
||||||
TDot, &
|
TDot, &
|
||||||
dTDot_dT
|
dTDot_dT
|
||||||
integer :: &
|
|
||||||
instance
|
|
||||||
|
|
||||||
instance = source_thermal_dissipation_instance(phase)
|
associate(prm => param(source_thermal_dissipation_instance(phase)))
|
||||||
|
TDot = prm%kappa*sum(abs(Tstar*Lp))
|
||||||
TDot = param(instance)%kappa*sum(abs(Tstar*Lp))
|
|
||||||
dTDot_dT = 0.0_pReal
|
dTDot_dT = 0.0_pReal
|
||||||
|
end associate
|
||||||
|
|
||||||
end subroutine source_thermal_dissipation_getRateAndItsTangent
|
end subroutine source_thermal_dissipation_getRateAndItsTangent
|
||||||
|
|
||||||
|
|
|
@ -43,7 +43,7 @@ contains
|
||||||
!--------------------------------------------------------------------------------------------------
|
!--------------------------------------------------------------------------------------------------
|
||||||
subroutine source_thermal_externalheat_init
|
subroutine source_thermal_externalheat_init
|
||||||
|
|
||||||
integer :: Ninstance,instance,source,sourceOffset,NofMyPhase,p
|
integer :: Ninstance,source,sourceOffset,NofMyPhase,p
|
||||||
|
|
||||||
write(6,'(/,a)') ' <<<+- source_'//SOURCE_thermal_externalheat_label//' init -+>>>'; flush(6)
|
write(6,'(/,a)') ' <<<+- source_'//SOURCE_thermal_externalheat_label//' init -+>>>'; flush(6)
|
||||||
|
|
||||||
|
@ -63,17 +63,16 @@ subroutine source_thermal_externalheat_init
|
||||||
enddo
|
enddo
|
||||||
|
|
||||||
if (all(phase_source(:,p) /= SOURCE_thermal_externalheat_ID)) cycle
|
if (all(phase_source(:,p) /= SOURCE_thermal_externalheat_ID)) cycle
|
||||||
associate(config => config_phase(p))
|
associate(prm => param(source_thermal_externalheat_instance(p)), &
|
||||||
|
config => config_phase(p))
|
||||||
|
|
||||||
|
prm%time = config%getFloats('externalheat_time')
|
||||||
|
prm%nIntervals = size(prm%time) - 1
|
||||||
|
|
||||||
|
prm%heat_rate = config%getFloats('externalheat_rate',requiredSize = size(prm%time))
|
||||||
|
|
||||||
instance = source_thermal_externalheat_instance(p)
|
|
||||||
sourceOffset = source_thermal_externalheat_offset(p)
|
|
||||||
NofMyPhase = count(material_phaseAt==p) * discretization_nIP
|
NofMyPhase = count(material_phaseAt==p) * discretization_nIP
|
||||||
|
sourceOffset = source_thermal_externalheat_offset(p)
|
||||||
param(instance)%time = config%getFloats('externalheat_time')
|
|
||||||
param(instance)%nIntervals = size(param(instance)%time) - 1
|
|
||||||
|
|
||||||
|
|
||||||
param(instance)%heat_rate = config%getFloats('externalheat_rate',requiredSize = size(param(instance)%time))
|
|
||||||
|
|
||||||
call material_allocateSourceState(p,sourceOffset,NofMyPhase,1,1,0)
|
call material_allocateSourceState(p,sourceOffset,NofMyPhase,1,1,0)
|
||||||
|
|
||||||
|
@ -92,6 +91,7 @@ subroutine source_thermal_externalheat_dotState(phase, of)
|
||||||
integer, intent(in) :: &
|
integer, intent(in) :: &
|
||||||
phase, &
|
phase, &
|
||||||
of
|
of
|
||||||
|
|
||||||
integer :: &
|
integer :: &
|
||||||
sourceOffset
|
sourceOffset
|
||||||
|
|
||||||
|
@ -113,25 +113,27 @@ subroutine source_thermal_externalheat_getRateAndItsTangent(TDot, dTDot_dT, phas
|
||||||
real(pReal), intent(out) :: &
|
real(pReal), intent(out) :: &
|
||||||
TDot, &
|
TDot, &
|
||||||
dTDot_dT
|
dTDot_dT
|
||||||
|
|
||||||
integer :: &
|
integer :: &
|
||||||
instance, sourceOffset, interval
|
sourceOffset, interval
|
||||||
real(pReal) :: &
|
real(pReal) :: &
|
||||||
frac_time
|
frac_time
|
||||||
|
|
||||||
instance = source_thermal_externalheat_instance(phase)
|
|
||||||
sourceOffset = source_thermal_externalheat_offset(phase)
|
sourceOffset = source_thermal_externalheat_offset(phase)
|
||||||
|
|
||||||
do interval = 1, param(instance)%nIntervals ! scan through all rate segments
|
associate(prm => param(source_thermal_externalheat_instance(phase)))
|
||||||
frac_time = (sourceState(phase)%p(sourceOffset)%state(1,of) - param(instance)%time(interval)) &
|
do interval = 1, prm%nIntervals ! scan through all rate segments
|
||||||
/ (param(instance)%time(interval+1) - param(instance)%time(interval)) ! fractional time within segment
|
frac_time = (sourceState(phase)%p(sourceOffset)%state(1,of) - prm%time(interval)) &
|
||||||
|
/ (prm%time(interval+1) - prm%time(interval)) ! fractional time within segment
|
||||||
if ( (frac_time < 0.0_pReal .and. interval == 1) &
|
if ( (frac_time < 0.0_pReal .and. interval == 1) &
|
||||||
.or. (frac_time >= 1.0_pReal .and. interval == param(instance)%nIntervals) &
|
.or. (frac_time >= 1.0_pReal .and. interval == prm%nIntervals) &
|
||||||
.or. (frac_time >= 0.0_pReal .and. frac_time < 1.0_pReal) ) &
|
.or. (frac_time >= 0.0_pReal .and. frac_time < 1.0_pReal) ) &
|
||||||
TDot = param(instance)%heat_rate(interval ) * (1.0_pReal - frac_time) + &
|
TDot = prm%heat_rate(interval ) * (1.0_pReal - frac_time) + &
|
||||||
param(instance)%heat_rate(interval+1) * frac_time ! interpolate heat rate between segment boundaries...
|
prm%heat_rate(interval+1) * frac_time ! interpolate heat rate between segment boundaries...
|
||||||
! ...or extrapolate if outside of bounds
|
! ...or extrapolate if outside of bounds
|
||||||
enddo
|
enddo
|
||||||
dTDot_dT = 0.0
|
dTDot_dT = 0.0
|
||||||
|
end associate
|
||||||
|
|
||||||
end subroutine source_thermal_externalheat_getRateAndItsTangent
|
end subroutine source_thermal_externalheat_getRateAndItsTangent
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue