fixed bug in forwarding fields for AL solver

This commit is contained in:
Martin Diehl 2013-01-08 10:12:03 +00:00
parent d90efef535
commit ce7a0571fd
4 changed files with 24 additions and 18 deletions

View File

@ -46,7 +46,8 @@ module DAMASK_spectral_solverAL
F_lambda_lastInc, & !< field of previous incompatible deformation gradient F_lambda_lastInc, & !< field of previous incompatible deformation gradient
Fdot, & !< field of assumed rate of compatible deformation gradient Fdot, & !< field of assumed rate of compatible deformation gradient
F_lambdaDot !< field of assumed rate of incopatible deformation gradient F_lambdaDot !< field of assumed rate of incopatible deformation gradient
real(pReal), private :: temperature !< temperature, no spatial quantity at the moment real(pReal), private :: &
temperature !< temperature, no spatial quantity at the moment
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
! stress, stiffness and compliance average etc. ! stress, stiffness and compliance average etc.
@ -325,10 +326,10 @@ type(tSolutionState) function &
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
! update local deformation gradient ! update local deformation gradient
F = reshape(Utilities_forwardField(timeinc,math_rotate_backward33(F_aim,rotation_BC),& F = reshape(Utilities_forwardField(timeinc,F_lastInc,Fdot, & ! ensure that it matches rotated F_aim
F_lastInc,Fdot),[9,res(1),res(2),res(3)]) math_rotate_backward33(F_aim,rotation_BC)),[9,res(1),res(2),res(3)])
F_lambda = reshape(Utilities_forwardField(timeinc,math_rotate_backward33(F_aim,rotation_BC),& F_lambda = reshape(Utilities_forwardField(timeinc,F_lambda_lastInc,F_lambdadot), & ! does not have any average value as boundary condition
F_lambda_lastInc,F_lambdadot),[9,res(1),res(2),res(3)]) [9,res(1),res(2),res(3)])
call DMDAVecRestoreArrayF90(da,solution_vec,xx_psc,ierr) call DMDAVecRestoreArrayF90(da,solution_vec,xx_psc,ierr)
CHKERRQ(ierr) CHKERRQ(ierr)

View File

@ -261,7 +261,7 @@ type(tSolutionState) function &
F_lastInc = F F_lastInc = F
endif endif
F_aim = F_aim + f_aimDot * timeinc F_aim = F_aim + f_aimDot * timeinc
F = Utilities_forwardField(timeinc,math_rotate_backward33(F_aim,rotation_BC),F_lastInc,Fdot) F = Utilities_forwardField(timeinc,F_lastInc,Fdot,math_rotate_backward33(F_aim,rotation_BC))
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
! update stiffness (and gamma operator) ! update stiffness (and gamma operator)

View File

@ -292,8 +292,8 @@ type(tSolutionState) function &
endif endif
F_aim = F_aim + f_aimDot * timeinc F_aim = F_aim + f_aimDot * timeinc
F = reshape(Utilities_forwardField(timeinc,math_rotate_backward33(F_aim,rotation_BC),F_lastInc,& F = reshape(Utilities_forwardField(timeinc,F_lastInc,Fdot,math_rotate_backward33(F_aim, &
Fdot),[9,res(1),res(2),res(3)]) rotation_BC)),[9,res(1),res(2),res(3)])
call DMDAVecRestoreArrayF90(da,solution_vec,F,ierr) call DMDAVecRestoreArrayF90(da,solution_vec,F,ierr)
CHKERRQ(ierr) CHKERRQ(ierr)

View File

@ -787,26 +787,31 @@ end function utilities_calculateRate
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
!> @brief forwards a field with a pointwise given rate, ensures that the average matches the aim !> @brief forwards a field with a pointwise given rate, if aim is given,
!> ensures that the average matches the aim
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
pure function utilities_forwardField(timeinc,aim,field_lastInc,rate) pure function utilities_forwardField(timeinc,field_lastInc,rate,aim)
use mesh, only: & use mesh, only: &
res, & res, &
wgt wgt
implicit none implicit none
real(pReal), intent(in) :: timeinc !< timeinc of current step real(pReal), intent(in) :: &
real(pReal), intent(in), dimension(3,3) :: aim !< average field value aim timeinc !< timeinc of current step
real(pReal), intent(in), dimension(3,3,res(1),res(2),res(3)) :: & real(pReal), intent(in), dimension(3,3,res(1),res(2),res(3)) :: &
field_lastInc,& !< initial field field_lastInc, & !< initial field
rate !< rate by which to forward rate !< rate by which to forward
real(pReal), intent(in), optional, dimension(3,3) :: &
aim !< average field value aim
real(pReal), dimension(3,3,res(1),res(2),res(3)) :: utilities_forwardField real(pReal), dimension(3,3,res(1),res(2),res(3)) :: utilities_forwardField
real(pReal), dimension(3,3) :: fieldDiff !< <a + adot*t> - aim real(pReal), dimension(3,3) :: fieldDiff !< <a + adot*t> - aim
utilities_forwardField = field_lastInc + rate*timeinc utilities_forwardField = field_lastInc + rate*timeinc
if (present(aim)) then !< correct to match average
fieldDiff = sum(sum(sum(utilities_forwardField,dim=5),dim=4),dim=3)*wgt - aim fieldDiff = sum(sum(sum(utilities_forwardField,dim=5),dim=4),dim=3)*wgt - aim
utilities_forwardField = utilities_forwardField - & utilities_forwardField = utilities_forwardField - &
spread(spread(spread(fieldDiff,3,res(1)),4,res(2)),5,res(3)) spread(spread(spread(fieldDiff,3,res(1)),4,res(2)),5,res(3))
endif
end function utilities_forwardField end function utilities_forwardField