@@ -907,10 +907,10 @@ contains
907907 type(physical_parameters), dimension (1 :num_fluids), intent (in ) :: fluid_pp
908908 integer :: i, j, k, l, encoded_ib_idx, ib_idx, fluid_idx
909909 real (wp), dimension (num_ibs, 3 ) :: forces, torques
910- real (wp), dimension ( 1 : 3 , 1 : 3 ) :: viscous_stress_div, viscous_stress_div_1, &
911- & viscous_stress_div_2 ! viscous stress tensor with temp vectors to hold divergence calculations
912- real (wp), dimension (1 :3 ) :: local_force_contribution, radial_vector, local_torque_contribution
913- real (wp) :: cell_volume, dx, dy, dz, dynamic_viscosity
910+ ! viscous stress tensor with temp vectors to hold divergence calculations
911+ real (wp), dimension ( 1 : 3 , 1 : 3 ) :: viscous_stress_div, viscous_stress_div_1, viscous_stress_div_2
912+ real (wp), dimension (1 :3 ) :: local_force_contribution, radial_vector, local_torque_contribution
913+ real (wp) :: cell_volume, dx, dy, dz, dynamic_viscosity
914914
915915 #:if not MFC_CASE_OPTIMIZATION and USING_AMD
916916 real (wp), dimension (3 ) :: dynamic_viscosities
@@ -960,19 +960,19 @@ contains
960960 do fluid_idx = 0 , num_fluids - 1
961961 ! Get the pressure contribution to force via a finite difference to compute the 2D components of the
962962 ! gradient of the pressure and cell volume
963- local_force_contribution(1 ) = local_force_contribution(1 ) - (q_prim_vf(eqn_idx%E + fluid_idx) &
964- & %sf(i + 1 , j, k) - q_prim_vf(eqn_idx%E + fluid_idx)%sf(i - 1 , j, &
965- & k))/ (2._wp * dx) ! force is the negative pressure gradient
966- local_force_contribution(2 ) = local_force_contribution(2 ) - (q_prim_vf(eqn_idx%E + fluid_idx) &
967- & %sf(i, j + 1 , k) - q_prim_vf(eqn_idx%E + fluid_idx)%sf(i, j - 1 , &
968- & k))/ (2._wp * dy)
963+ local_force_contribution(1 ) = local_force_contribution(1 ) - (q_prim_vf(eqn_idx%E &
964+ & + fluid_idx)%sf(i + 1 , j, &
965+ & k) - q_prim_vf(eqn_idx%E + fluid_idx)%sf(i - 1 , j, k) )/ (2._wp * dx) ! force is the negative pressure gradient
966+ local_force_contribution(2 ) = local_force_contribution(2 ) - (q_prim_vf(eqn_idx%E &
967+ & + fluid_idx) %sf(i, j + 1 , k) - q_prim_vf(eqn_idx%E + fluid_idx)%sf(i, &
968+ & j - 1 , k))/ (2._wp * dy)
969969 cell_volume = abs (dx* dy)
970970 ! add the 3D component of the pressure gradient, if we are working in 3 dimensions
971971 if (num_dims == 3 ) then
972972 dz = z_cc(k + 1 ) - z_cc(k)
973- local_force_contribution(3 ) = local_force_contribution(3 ) - (q_prim_vf(eqn_idx%E + fluid_idx) &
974- & %sf(i, j, k + 1 ) - q_prim_vf(eqn_idx%E + fluid_idx)%sf(i, j, &
975- & k - 1 ))/ (2._wp * dz)
973+ local_force_contribution(3 ) = local_force_contribution(3 ) - (q_prim_vf(eqn_idx%E &
974+ & + fluid_idx)%sf(i, j, &
975+ & k + 1 ) - q_prim_vf(eqn_idx%E + fluid_idx)%sf(i, j, k - 1 ))/ (2._wp * dz)
976976 cell_volume = abs (cell_volume* dz)
977977 end if
978978 end do
@@ -992,19 +992,19 @@ contains
992992 & j, k)
993993 call s_compute_viscous_stress_tensor(viscous_stress_div_2, q_prim_vf, dynamic_viscosity, i + 1 , &
994994 & j, k)
995- viscous_stress_div( 1 , 1 : 3 ) = (viscous_stress_div_2( 1 , 1 : 3 ) - viscous_stress_div_1( 1 , &
996- & 1 :3 ))/ (2._wp * dx) ! get x derivative of the first - row of viscous stress tensor
997- local_force_contribution( 1 : 3 ) = local_force_contribution( 1 : 3 ) + viscous_stress_div( 1 , &
998- & 1 :3 ) ! add the x components of the divergence to the force
995+ ! get x derivative of the first - row of viscous stress tensor
996+ viscous_stress_div( 1 , 1 : 3 ) = (viscous_stress_div_2( 1 , 1 : 3 ) - viscous_stress_div_1( 1 , 1 :3 ))/ (2._wp * dx)
997+ ! add the x components of the divergence to the force
998+ local_force_contribution( 1 : 3 ) = local_force_contribution( 1 :3 ) + viscous_stress_div( 1 , 1 : 3 )
999999
10001000 call s_compute_viscous_stress_tensor(viscous_stress_div_1, q_prim_vf, dynamic_viscosity, i, &
10011001 & j - 1 , k)
10021002 call s_compute_viscous_stress_tensor(viscous_stress_div_2, q_prim_vf, dynamic_viscosity, i, &
10031003 & j + 1 , k)
1004- viscous_stress_div( 2 , 1 : 3 ) = (viscous_stress_div_2( 2 , 1 : 3 ) - viscous_stress_div_1( 2 , &
1005- & 1 :3 ))/ (2._wp * dy) ! get y derivative of the second - row of viscous stress tensor
1006- local_force_contribution( 1 : 3 ) = local_force_contribution( 1 : 3 ) + viscous_stress_div( 2 , &
1007- & 1 :3 ) ! add the y components of the divergence to the force
1004+ ! get y derivative of the second - row of viscous stress tensor
1005+ viscous_stress_div( 2 , 1 : 3 ) = (viscous_stress_div_2( 2 , 1 : 3 ) - viscous_stress_div_1( 2 , 1 :3 ))/ (2._wp * dy)
1006+ ! add the y components of the divergence to the force
1007+ local_force_contribution( 1 : 3 ) = local_force_contribution( 1 :3 ) + viscous_stress_div( 2 , 1 : 3 )
10081008
10091009 if (num_dims == 3 ) then
10101010 call s_compute_viscous_stress_tensor(viscous_stress_div_1, q_prim_vf, dynamic_viscosity, i, &
@@ -1013,8 +1013,8 @@ contains
10131013 & j, k + 1 )
10141014 viscous_stress_div(3 ,1 :3 ) = (viscous_stress_div_2(3 ,1 :3 ) - viscous_stress_div_1(3 , &
10151015 & 1 :3 ))/ (2._wp * dz)
1016- local_force_contribution( 1 : 3 ) = local_force_contribution( 1 : 3 ) + viscous_stress_div( 3 , &
1017- & 1 :3 ) ! add the z components of the divergence to the force
1016+ ! add the z components of the divergence to the force
1017+ local_force_contribution( 1 : 3 ) = local_force_contribution( 1 :3 ) + viscous_stress_div( 3 , 1 : 3 )
10181018 end if
10191019 end if
10201020
@@ -1072,8 +1072,8 @@ contains
10721072
10731073 ! Offset only needs to be computes for specific geometries
10741074
1075- if (patch_ib(ib_marker)%geometry == 4 .or. patch_ib(ib_marker)%geometry == 5 .or. patch_ib(ib_marker) &
1076- & %geometry == 11 .or. patch_ib(ib_marker)%geometry == 12 ) then
1075+ if (patch_ib(ib_marker)%geometry == 4 .or. patch_ib(ib_marker)%geometry == 5 .or. patch_ib(ib_marker)%geometry == 11 &
1076+ & .or. patch_ib(ib_marker)%geometry == 12 ) then
10771077 center_of_mass_local = [0._wp , 0._wp , 0._wp ]
10781078 num_cells_local = 0
10791079
0 commit comments