FrontISTR  5.9.0
Large-scale structural analysis program with finit element method
fstr_contact_damping.f90
Go to the documentation of this file.
1 !-------------------------------------------------------------------------------
2 ! Copyright (c) 2019 FrontISTR Commons
3 ! This software is released under the MIT License, see LICENSE.txt
4 !-------------------------------------------------------------------------------
17  use hecmw
18  use elementinfo
19  use mcontactdef
21  implicit none
22 
23  private
24  public :: is_damping_enabled
25  public :: contact_damping_weight
26  public :: getdampingstiffness
27  public :: getdampingnodalforce
28 
29 contains
30 
32  pure logical function is_damping_enabled(contact)
33  type(tcontact), intent(in) :: contact
34  is_damping_enabled = (contact%damp_alpha > 0.0d0 .and. contact%damp_gact > 0.0d0)
35  end function is_damping_enabled
36 
44  pure real(kind=kreal) function contact_damping_weight(g, gact)
45  real(kind=kreal), intent(in) :: g
46  real(kind=kreal), intent(in) :: gact
47  real(kind=kreal) :: t
48 
49  if (g <= 0.0d0) then
51  else if (g >= gact) then
53  else
54  t = g / gact
55  contact_damping_weight = 1.0d0 - 3.0d0*t*t + 2.0d0*t*t*t
56  end if
57  end function contact_damping_weight
58 
63  subroutine getdampingstiffness(cstate, surf, alpha, gact, stiff, smoothing_type)
64  type(tcontactstate), intent(in) :: cstate
65  type(tsurfelement), intent(in) :: surf
66  real(kind=kreal), intent(in) :: alpha
67  real(kind=kreal), intent(in) :: gact
68  real(kind=kreal), intent(out) :: stiff(:,:)
69  integer(kind=kint), optional, intent(in) :: smoothing_type
70 
71  integer(kind=kint) :: nnode, ndof, i, j
72  real(kind=kreal) :: bn(l_max_surface_node*3+3)
73  real(kind=kreal) :: tm(3, 3*(l_max_surface_node+1))
74  real(kind=kreal) :: tt(3, 3*(l_max_surface_node+1))
75  real(kind=kreal) :: w, coeff
76 
77  nnode = size(surf%nodes)
78  ndof = nnode*3 + 3
79 
80  stiff = 0.0d0
81 
82  ! Compute Bn directly via computeTm_Tt (no need for metric/Ht/Gt)
83  call computetm_tt(cstate, surf, 0.0d0, tm, tt, smoothing_type, bn=bn)
84 
85  ! Compute weight from frozen distance
86  w = contact_damping_weight(cstate%distance, gact)
87  coeff = alpha * w
88 
89  if (coeff <= 0.0d0) return
90 
91  ! Build stiffness: K_damp = coeff * Bn (x) Bn
92  do j = 1, ndof
93  do i = 1, ndof
94  stiff(i,j) = coeff * bn(i) * bn(j)
95  enddo
96  enddo
97 
98  end subroutine getdampingstiffness
99 
105  subroutine getdampingnodalforce(cstate, surf, ndDu, alpha, gact, ctNForce, ctTForce, smoothing_type)
106  type(tcontactstate), intent(in) :: cstate
107  type(tsurfelement), intent(in) :: surf
108  real(kind=kreal), intent(in) :: nddu(:)
109  real(kind=kreal), intent(in) :: alpha
110  real(kind=kreal), intent(in) :: gact
111  real(kind=kreal), intent(out) :: ctnforce(:)
112  real(kind=kreal), intent(out) :: cttforce(:)
113  integer(kind=kint), optional, intent(in) :: smoothing_type
114 
115  integer(kind=kint) :: nnode, ndof
116  real(kind=kreal) :: bn(l_max_surface_node*3+3)
117  real(kind=kreal) :: tm(3, 3*(l_max_surface_node+1))
118  real(kind=kreal) :: tt(3, 3*(l_max_surface_node+1))
119  real(kind=kreal) :: w, coeff, delta_gn
120 
121  nnode = size(surf%nodes)
122  ndof = nnode*3 + 3
123 
124  ctnforce = 0.0d0
125  cttforce = 0.0d0
126 
127  ! Compute Bn directly via computeTm_Tt (no need for metric/Ht/Gt/elemcrd)
128  call computetm_tt(cstate, surf, 0.0d0, tm, tt, smoothing_type, bn=bn)
129 
130  ! Compute weight from frozen distance
131  w = contact_damping_weight(cstate%distance, gact)
132  coeff = alpha * w
133 
134  if (coeff <= 0.0d0) return
135 
136  ! Compute normal gap increment: delta_gn = Bn^T * ddu
137  delta_gn = dot_product(bn(1:ndof), nddu(1:ndof))
138 
139  ! Damping force: f_damp = coeff * delta_gn * Bn
140  ctnforce(1:ndof) = coeff * delta_gn * bn(1:ndof)
141 
142  ! Lagrange row (not used, set to 0 for interface compatibility)
143  ctnforce((nnode+1)*3+1) = 0.0d0
144  cttforce((nnode+1)*3+1) = 0.0d0
145 
146  end subroutine getdampingnodalforce
147 
148 end module m_fstr_contact_damping
This module encapsulate the basic functions of all elements provide by this software.
Definition: element.f90:43
Definition: hecmw.f90:6
Contact damping module for CONTACTNEAR state.
subroutine, public getdampingstiffness(cstate, surf, alpha, gact, stiff, smoothing_type)
Compute damping stiffness matrix K_damp = alpha * w(g) * Bn (x) Bn.
subroutine, public getdampingnodalforce(cstate, surf, ndDu, alpha, gact, ctNForce, ctTForce, smoothing_type)
Compute damping nodal force vector f_damp = alpha * w(g) * (Bn^T * ddu) * Bn.
pure real(kind=kreal) function, public contact_damping_weight(g, gact)
Compute smoothstep weight w(g) for contact damping.
pure logical function, public is_damping_enabled(contact)
Check if damping is enabled for a contact pair.
Common utilities for contact element calculations.
subroutine, public computetm_tt(ctState, tSurf, fcoeff, Tm, Tt, smoothing_type, Bn)
Compute Tm (relative displacement mapping) and optionally Tt (tangential mapping) This subroutine con...
This module manages the data structure for contact calculation.
Structure to includes all info needed by contact calculation.
This structure records contact status.