|
4 | 4 | real(kind(0d0)) :: rhoH, rhoL, pRef, pInt, h, lam, wl, amp, intH, alph |
5 | 5 |
|
6 | 6 | real(kind(0d0)) :: eps |
| 7 | + |
| 8 | + real(kind(0d0)) :: rcoord, theta, phi, xi_sph, x_bcen, y_bcen, z_bcen, Rinit |
| 9 | + real(kind(0d0)) :: x_ccs, y_ccs, z_ccs |
| 10 | + real(kind(0d0)), dimension(num_dims) :: xi_cart |
| 11 | + integer :: l |
7 | 12 |
|
8 | 13 | eps = 1e-9 |
9 | 14 | #:enddef |
|
56 | 61 | q_prim_vf(advxe)%sf(i, j, k) = patch_icpp(1)%alpha(2) |
57 | 62 | end if |
58 | 63 |
|
| 64 | + case (302) ! pre_stress for hyperelasticity, bubble in material |
| 65 | + R0ref = 30E-6 ! equilibrium radius |
| 66 | + Rinit = patch_icpp(3)%radius ! initial radius |
| 67 | + x_bcen = patch_icpp(3)%x_centroid |
| 68 | + y_bcen = patch_icpp(3)%y_centroid |
| 69 | + z_bcen = patch_icpp(3)%z_centroid |
| 70 | + x_ccs = x_cc(i) - x_bcen |
| 71 | + y_ccs = y_cc(j) - y_bcen |
| 72 | + z_ccs = z_cc(k) - z_bcen |
| 73 | + rcoord = sqrt(x_ccs**2 + y_ccs**2 + z_ccs**2) |
| 74 | + phi = atan2(y_ccs, x_ccs) |
| 75 | + theta = atan2(sqrt(x_ccs**2 + y_ccs**2), z_ccs) |
| 76 | + !spherical coord, assuming Rmax=1 |
| 77 | + xi_sph = (rcoord**3 - R0ref**3 + Rinit**3)**(1d0/3d0) |
| 78 | + xi_cart(1) = xi_sph*sin(theta)*cos(phi) |
| 79 | + xi_cart(2) = xi_sph*sin(theta)*sin(phi) |
| 80 | + xi_cart(3) = xi_sph*cos(theta) |
| 81 | + ! shift back |
| 82 | + xi_cart(1) = xi_cart(1) + x_bcen |
| 83 | + xi_cart(2) = xi_cart(2) + y_bcen |
| 84 | + xi_cart(3) = xi_cart(3) + z_bcen |
| 85 | +! print *, 'xi_cart(1) ::', xi_cart(1), 'xi_cart(2) ::', xi_cart(2), 'xi_cart(3) ::', xi_cart(3) |
| 86 | + ! assigning the reference map to the q_prim vector field |
| 87 | + do l = 1, 3 |
| 88 | + q_prim_vf(l + xibeg - 1)%sf(i, j, k) = xi_cart(l) |
| 89 | + end do |
| 90 | + |
59 | 91 | ! Put your variable assignments here |
60 | 92 | case default |
61 | 93 | call s_int_to_str(patch_id, iStr) |
|
0 commit comments