@@ -1607,34 +1607,34 @@ contains
16071607 cart_z = z_cc(k)
16081608 end if
16091609
1610- if ((x_cc(i) - x_centroid)** 2 &
1611- + (cart_y - y_centroid)** 2 &
1612- + (cart_z - z_centroid)** 2 <= radius** 2 ) &
1613- then
1610+ if (.not. present (ib) .and. patch_icpp(patch_id)%smoothen) then
1611+ eta = tanh (smooth_coeff/ min (dx, dy, dz)* &
1612+ (sqrt ((x_cc(i) - x_centroid)** 2 &
1613+ + (cart_y - y_centroid)** 2 &
1614+ + (cart_z - z_centroid)** 2 ) &
1615+ - radius))* (- 0.5_wp ) + 0.5_wp
1616+ end if
16141617
1615- if (present (ib)) then
1616- ! Updating the patch identities bookkeeping variable
1618+ if (present (ib)) then
1619+ ! Updating the patch identities bookkeeping variable
1620+ if (((x_cc(i) - x_centroid)** 2 &
1621+ + (cart_y - y_centroid)** 2 &
1622+ + (cart_z - z_centroid)** 2 <= radius** 2 )) then
16171623 patch_id_fp(i, j, k) = patch_id
1618- else
1619- if (patch_icpp(patch_id)%alter_patch(patch_id_fp(i, j, k)) .or. &
1620- patch_id_fp(i, j, k) == smooth_patch_id) then
1621-
1622- call s_assign_patch_primitive_variables(patch_id, i, j, k, &
1623- eta, q_prim_vf, patch_id_fp)
1624+ end if
1625+ else
1626+ if ((((x_cc(i) - x_centroid)** 2 &
1627+ + (cart_y - y_centroid)** 2 &
1628+ + (cart_z - z_centroid)** 2 <= radius** 2 ) .and. &
1629+ patch_icpp(patch_id)%alter_patch(patch_id_fp(i, j, k))) .or. &
1630+ patch_id_fp(i, j, k) == smooth_patch_id) then
16241631
1625- @:analytical()
1626- end if
1632+ call s_assign_patch_primitive_variables(patch_id, i, j, k, &
1633+ eta, q_prim_vf, patch_id_fp)
16271634
1628- if (patch_icpp(patch_id)%smoothen) then
1629- eta = tanh (smooth_coeff/ min (dx, dy, dz)* &
1630- (sqrt ((x_cc(i) - x_centroid)** 2 &
1631- + (cart_y - y_centroid)** 2 &
1632- + (cart_z - z_centroid)** 2 ) &
1633- - radius))* (- 0.5_wp ) + 0.5_wp
1634- end if
1635+ @:analytical()
16351636 end if
16361637 end if
1637-
16381638 end do
16391639 end do
16401640 end do
@@ -1812,58 +1812,76 @@ contains
18121812 cart_z = z_cc(k)
18131813 end if
18141814
1815- if ((.not. f_is_default(length_x) .and. &
1816- (cart_y - y_centroid)** 2 &
1817- + (cart_z - z_centroid)** 2 <= radius** 2 .and. &
1818- x_boundary%beg <= x_cc(i) .and. &
1819- x_boundary%end >= x_cc(i)) &
1820- .or. &
1821- (.not. f_is_default(length_y) .and. &
1822- (x_cc(i) - x_centroid)** 2 &
1823- + (cart_z - z_centroid)** 2 <= radius** 2 .and. &
1824- y_boundary%beg <= cart_y .and. &
1825- y_boundary%end >= cart_y) &
1826- .or. &
1827- (.not. f_is_default(length_z) .and. &
1828- (x_cc(i) - x_centroid)** 2 &
1829- + (cart_y - y_centroid)** 2 <= radius** 2 .and. &
1830- z_boundary%beg <= cart_z .and. &
1831- z_boundary%end >= cart_z)) then
1815+ if (.not. present (ib) .and. patch_icpp(patch_id)%smoothen) then
1816+ if (.not. f_is_default(length_x)) then
1817+ eta = tanh (smooth_coeff/ min (dy, dz)* &
1818+ (sqrt ((cart_y - y_centroid)** 2 &
1819+ + (cart_z - z_centroid)** 2 ) &
1820+ - radius))* (- 0.5_wp ) + 0.5_wp
1821+ elseif (.not. f_is_default(length_y)) then
1822+ eta = tanh (smooth_coeff/ min (dx, dz)* &
1823+ (sqrt ((x_cc(i) - x_centroid)** 2 &
1824+ + (cart_z - z_centroid)** 2 ) &
1825+ - radius))* (- 0.5_wp ) + 0.5_wp
1826+ else
1827+ eta = tanh (smooth_coeff/ min (dx, dy)* &
1828+ (sqrt ((x_cc(i) - x_centroid)** 2 &
1829+ + (cart_y - y_centroid)** 2 ) &
1830+ - radius))* (- 0.5_wp ) + 0.5_wp
1831+ end if
1832+ end if
1833+
1834+ if (present (ib)) then
1835+ if (((.not. f_is_default(length_x) .and. &
1836+ (cart_y - y_centroid)** 2 &
1837+ + (cart_z - z_centroid)** 2 <= radius** 2 .and. &
1838+ x_boundary%beg <= x_cc(i) .and. &
1839+ x_boundary%end >= x_cc(i)) &
1840+ .or. &
1841+ (.not. f_is_default(length_y) .and. &
1842+ (x_cc(i) - x_centroid)** 2 &
1843+ + (cart_z - z_centroid)** 2 <= radius** 2 .and. &
1844+ y_boundary%beg <= cart_y .and. &
1845+ y_boundary%end >= cart_y) &
1846+ .or. &
1847+ (.not. f_is_default(length_z) .and. &
1848+ (x_cc(i) - x_centroid)** 2 &
1849+ + (cart_y - y_centroid)** 2 <= radius** 2 .and. &
1850+ z_boundary%beg <= cart_z .and. &
1851+ z_boundary%end >= cart_z))) then
18321852
1833- if (present (ib)) then
18341853 ! Updating the patch identities bookkeeping variable
18351854 patch_id_fp(i, j, k) = patch_id
1836- else
1837- if (patch_icpp(patch_id)%alter_patch(patch_id_fp(i, j, k)) &
1838- .or. patch_id_fp(i, j, k) == smooth_patch_id) then
1855+ end if
18391856
1840- call s_assign_patch_primitive_variables(patch_id, i, j, k, &
1841- eta, q_prim_vf, patch_id_fp)
1857+ else
1858+ if (((.not. f_is_default(length_x) .and. &
1859+ (cart_y - y_centroid)** 2 &
1860+ + (cart_z - z_centroid)** 2 <= radius** 2 .and. &
1861+ x_boundary%beg <= x_cc(i) .and. &
1862+ x_boundary%end >= x_cc(i)) &
1863+ .or. &
1864+ (.not. f_is_default(length_y) .and. &
1865+ (x_cc(i) - x_centroid)** 2 &
1866+ + (cart_z - z_centroid)** 2 <= radius** 2 .and. &
1867+ y_boundary%beg <= cart_y .and. &
1868+ y_boundary%end >= cart_y) &
1869+ .or. &
1870+ (.not. f_is_default(length_z) .and. &
1871+ (x_cc(i) - x_centroid)** 2 &
1872+ + (cart_y - y_centroid)** 2 <= radius** 2 .and. &
1873+ z_boundary%beg <= cart_z .and. &
1874+ z_boundary%end >= cart_z) .and. &
1875+ patch_icpp(patch_id)%alter_patch(patch_id_fp(i, j, k))) .or. &
1876+ patch_id_fp(i, j, k) == smooth_patch_id) then
18421877
1843- @:analytical()
1878+ call s_assign_patch_primitive_variables(patch_id, i, j, k, &
1879+ eta, q_prim_vf, patch_id_fp)
18441880
1845- ! Updating the patch identities bookkeeping variable
1846- if (1._wp - eta < 1e-16_wp ) patch_id_fp(i, j, k) = patch_id
1847- end if
1881+ @:analytical()
18481882
1849- if (patch_icpp(patch_id)%smoothen) then
1850- if (.not. f_is_default(length_x)) then
1851- eta = tanh (smooth_coeff/ min (dy, dz)* &
1852- (sqrt ((cart_y - y_centroid)** 2 &
1853- + (cart_z - z_centroid)** 2 ) &
1854- - radius))* (- 0.5_wp ) + 0.5_wp
1855- elseif (.not. f_is_default(length_y)) then
1856- eta = tanh (smooth_coeff/ min (dx, dz)* &
1857- (sqrt ((x_cc(i) - x_centroid)** 2 &
1858- + (cart_z - z_centroid)** 2 ) &
1859- - radius))* (- 0.5_wp ) + 0.5_wp
1860- else
1861- eta = tanh (smooth_coeff/ min (dx, dy)* &
1862- (sqrt ((x_cc(i) - x_centroid)** 2 &
1863- + (cart_y - y_centroid)** 2 ) &
1864- - radius))* (- 0.5_wp ) + 0.5_wp
1865- end if
1866- end if
1883+ ! Updating the patch identities bookkeeping variable
1884+ if (1._wp - eta < 1e-16_wp ) patch_id_fp(i, j, k) = patch_id
18671885 end if
18681886 end if
18691887 end do
0 commit comments