Skip to content

Commit 775d08d

Browse files
authored
rebase upstream (#814)
1 parent 4298db0 commit 775d08d

File tree

9 files changed

+616
-141
lines changed

9 files changed

+616
-141
lines changed

src/common/m_boundary_conditions.fpp

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -354,6 +354,13 @@ contains
354354
q_prim_vf(i)%sf(j - 1, k, l)
355355
end do
356356

357+
if (elasticity) then
358+
do i = 1, shear_BC_flip_num
359+
q_prim_vf(shear_BC_flip_indices(1, i))%sf(-j, k, l) = &
360+
-q_prim_vf(shear_BC_flip_indices(1, i))%sf(j - 1, k, l)
361+
end do
362+
end if
363+
357364
if (hyperelasticity) then
358365
q_prim_vf(xibeg)%sf(-j, k, l) = &
359366
-q_prim_vf(xibeg)%sf(j - 1, k, l)
@@ -404,6 +411,13 @@ contains
404411
q_prim_vf(i)%sf(m - (j - 1), k, l)
405412
end do
406413

414+
if (elasticity) then
415+
do i = 1, shear_BC_flip_num
416+
q_prim_vf(shear_BC_flip_indices(1, i))%sf(m + j, k, l) = &
417+
-q_prim_vf(shear_BC_flip_indices(1, i))%sf(m - (j - 1), k, l)
418+
end do
419+
end if
420+
407421
if (hyperelasticity) then
408422
q_prim_vf(xibeg)%sf(m + j, k, l) = &
409423
-q_prim_vf(xibeg)%sf(m - (j - 1), k, l)
@@ -457,6 +471,13 @@ contains
457471
q_prim_vf(i)%sf(l, j - 1, k)
458472
end do
459473

474+
if (elasticity) then
475+
do i = 1, shear_BC_flip_num
476+
q_prim_vf(shear_BC_flip_indices(2, i))%sf(l, -j, k) = &
477+
-q_prim_vf(shear_BC_flip_indices(2, i))%sf(l, j - 1, k)
478+
end do
479+
end if
480+
460481
if (hyperelasticity) then
461482
q_prim_vf(xibeg + 1)%sf(l, -j, k) = &
462483
-q_prim_vf(xibeg + 1)%sf(l, j - 1, k)
@@ -504,6 +525,13 @@ contains
504525
q_prim_vf(i)%sf(l, n - (j - 1), k)
505526
end do
506527

528+
if (elasticity) then
529+
do i = 1, shear_BC_flip_num
530+
q_prim_vf(shear_BC_flip_indices(2, i))%sf(l, n + j, k) = &
531+
-q_prim_vf(shear_BC_flip_indices(2, i))%sf(l, n - (j - 1), k)
532+
end do
533+
end if
534+
507535
if (hyperelasticity) then
508536
q_prim_vf(xibeg + 1)%sf(l, n + j, k) = &
509537
-q_prim_vf(xibeg + 1)%sf(l, n - (j - 1), k)
@@ -556,6 +584,13 @@ contains
556584
q_prim_vf(i)%sf(k, l, j - 1)
557585
end do
558586

587+
if (elasticity) then
588+
do i = 1, shear_BC_flip_num
589+
q_prim_vf(shear_BC_flip_indices(3, i))%sf(k, l, -j) = &
590+
-q_prim_vf(shear_BC_flip_indices(3, i))%sf(k, l, j - 1)
591+
end do
592+
end if
593+
559594
if (hyperelasticity) then
560595
q_prim_vf(xiend)%sf(k, l, -j) = &
561596
-q_prim_vf(xiend)%sf(k, l, j - 1)
@@ -603,6 +638,13 @@ contains
603638
q_prim_vf(i)%sf(k, l, p - (j - 1))
604639
end do
605640

641+
if (elasticity) then
642+
do i = 1, shear_BC_flip_num
643+
q_prim_vf(shear_BC_flip_indices(3, i))%sf(k, l, p + j) = &
644+
-q_prim_vf(shear_BC_flip_indices(3, i))%sf(k, l, p - (j - 1))
645+
end do
646+
end if
647+
606648
if (hyperelasticity) then
607649
q_prim_vf(xiend)%sf(k, l, p + j) = &
608650
-q_prim_vf(xiend)%sf(k, l, p - (j - 1))

src/post_process/m_global_parameters.fpp

Lines changed: 57 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,15 @@ module m_global_parameters
150150
type(int_bounds_info) :: bc_x, bc_y, bc_z
151151
!> @}
152152

153+
integer :: shear_num !! Number of shear stress components
154+
integer, dimension(3) :: shear_indices !<
155+
!! Indices of the stress components that represent shear stress
156+
integer :: shear_BC_flip_num !<
157+
!! Number of shear stress components to reflect for boundary conditions
158+
integer, dimension(3, 2) :: shear_BC_flip_indices !<
159+
!! Indices of shear stress components to reflect for boundary conditions.
160+
!! Size: (1:3, 1:shear_BC_flip_num) for (x/y/z, [indices])
161+
153162
logical :: parallel_io !< Format of the data files
154163
logical :: sim_data
155164
logical :: file_per_process !< output format
@@ -585,29 +594,6 @@ contains
585594
sys_size = B_idx%end
586595
end if
587596

588-
if (hypoelasticity .or. hyperelasticity) then
589-
elasticity = .true.
590-
stress_idx%beg = sys_size + 1
591-
stress_idx%end = sys_size + (num_dims*(num_dims + 1))/2
592-
! number of distinct stresses is 1 in 1D, 3 in 2D, 6 in 3D
593-
sys_size = stress_idx%end
594-
end if
595-
596-
if (hyperelasticity) then
597-
xi_idx%beg = sys_size + 1
598-
xi_idx%end = sys_size + num_dims
599-
! adding three more equations for the \xi field and the elastic energy
600-
sys_size = xi_idx%end + 1
601-
! number of entries in the symmetric btensor plus the jacobian
602-
b_size = (num_dims*(num_dims + 1))/2 + 1
603-
tensor_size = num_dims**2 + 1
604-
end if
605-
606-
if (surface_tension) then
607-
c_idx = sys_size + 1
608-
sys_size = c_idx
609-
end if
610-
611597
! Volume Fraction Model (6-equation model)
612598
else if (model_eqns == 3) then
613599

@@ -626,29 +612,6 @@ contains
626612
sys_size = internalEnergies_idx%end
627613
alf_idx = 1 ! dummy, cannot actually have a void fraction
628614

629-
if (hypoelasticity .or. hyperelasticity) then
630-
elasticity = .true.
631-
stress_idx%beg = sys_size + 1
632-
stress_idx%end = sys_size + (num_dims*(num_dims + 1))/2
633-
! number of stresses is 1 in 1D, 3 in 2D, 6 in 3D
634-
sys_size = stress_idx%end
635-
end if
636-
637-
if (hyperelasticity) then
638-
xi_idx%beg = sys_size + 1
639-
xi_idx%end = sys_size + num_dims
640-
! adding three more equations for the \xi field and the elastic energy
641-
sys_size = xi_idx%end + 1
642-
! number of entries in the symmetric btensor plus the jacobian
643-
b_size = (num_dims*(num_dims + 1))/2 + 1
644-
tensor_size = num_dims**2 + 1
645-
end if
646-
647-
if (surface_tension) then
648-
c_idx = sys_size + 1
649-
sys_size = c_idx
650-
end if
651-
652615
else if (model_eqns == 4) then
653616
cont_idx%beg = 1 ! one continuity equation
654617
cont_idx%end = 1 !num_fluids
@@ -705,6 +668,54 @@ contains
705668
end if
706669
end if
707670

671+
if (model_eqns == 2 .or. model_eqns == 3) then
672+
673+
if (hypoelasticity .or. hyperelasticity) then
674+
elasticity = .true.
675+
stress_idx%beg = sys_size + 1
676+
stress_idx%end = sys_size + (num_dims*(num_dims + 1))/2
677+
! number of stresses is 1 in 1D, 3 in 2D, 6 in 3D
678+
sys_size = stress_idx%end
679+
680+
! shear stress index is 2 for 2D and 2,4,5 for 3D
681+
if (num_dims == 1) then
682+
shear_num = 0
683+
else if (num_dims == 2) then
684+
shear_num = 1
685+
shear_indices(1) = stress_idx%beg - 1 + 2
686+
shear_BC_flip_num = 1
687+
shear_BC_flip_indices(1:2, 1) = shear_indices(1)
688+
! Both x-dir and y-dir: flip tau_xy only
689+
else if (num_dims == 3) then
690+
shear_num = 3
691+
shear_indices(1:3) = stress_idx%beg - 1 + (/2, 4, 5/)
692+
shear_BC_flip_num = 2
693+
shear_BC_flip_indices(1, 1:2) = shear_indices((/1, 2/))
694+
shear_BC_flip_indices(2, 1:2) = shear_indices((/1, 3/))
695+
shear_BC_flip_indices(3, 1:2) = shear_indices((/2, 3/))
696+
! x-dir: flip tau_xy and tau_xz
697+
! y-dir: flip tau_xy and tau_yz
698+
! z-dir: flip tau_xz and tau_yz
699+
end if
700+
end if
701+
702+
if (hyperelasticity) then
703+
xi_idx%beg = sys_size + 1
704+
xi_idx%end = sys_size + num_dims
705+
! adding three more equations for the \xi field and the elastic energy
706+
sys_size = xi_idx%end + 1
707+
! number of entries in the symmetric btensor plus the jacobian
708+
b_size = (num_dims*(num_dims + 1))/2 + 1
709+
tensor_size = num_dims**2 + 1
710+
end if
711+
712+
if (surface_tension) then
713+
c_idx = sys_size + 1
714+
sys_size = c_idx
715+
end if
716+
717+
end if
718+
708719
if (chemistry) then
709720
species_idx%beg = sys_size + 1
710721
species_idx%end = sys_size + num_species

src/pre_process/m_global_parameters.fpp

Lines changed: 57 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,15 @@ module m_global_parameters
124124
type(int_bounds_info) :: bc_x, bc_y, bc_z !<
125125
!! Boundary conditions in the x-, y- and z-coordinate directions
126126

127+
integer :: shear_num !! Number of shear stress components
128+
integer, dimension(3) :: shear_indices !<
129+
!! Indices of the stress components that represent shear stress
130+
integer :: shear_BC_flip_num !<
131+
!! Number of shear stress components to reflect for boundary conditions
132+
integer, dimension(3, 2) :: shear_BC_flip_indices !<
133+
!! Indices of shear stress components to reflect for boundary conditions.
134+
!! Size: (1:3, 1:shear_BC_flip_num) for (x/y/z, [indices])
135+
127136
logical :: parallel_io !< Format of the data files
128137
logical :: file_per_process !< type of data output
129138
integer :: precision !< Precision of output files
@@ -677,29 +686,6 @@ contains
677686
sys_size = B_idx%end
678687
end if
679688

680-
if (hypoelasticity .or. hyperelasticity) then
681-
elasticity = .true.
682-
stress_idx%beg = sys_size + 1
683-
stress_idx%end = sys_size + (num_dims*(num_dims + 1))/2
684-
! number of stresses is 1 in 1D, 3 in 2D, 6 in 3D
685-
sys_size = stress_idx%end
686-
end if
687-
688-
if (hyperelasticity) then
689-
! number of entries in the symmetric btensor plus the jacobian
690-
b_size = (num_dims*(num_dims + 1))/2 + 1
691-
tensor_size = num_dims**2 + 1
692-
xi_idx%beg = sys_size + 1
693-
xi_idx%end = sys_size + num_dims
694-
! adding three more equations for the \xi field and the elastic energy
695-
sys_size = xi_idx%end + 1
696-
end if
697-
698-
if (surface_tension) then
699-
c_idx = sys_size + 1
700-
sys_size = c_idx
701-
end if
702-
703689
! Volume Fraction Model (6-equation model)
704690
else if (model_eqns == 3) then
705691

@@ -717,29 +703,6 @@ contains
717703
internalEnergies_idx%end = adv_idx%end + num_fluids
718704
sys_size = internalEnergies_idx%end
719705

720-
if (hypoelasticity .or. hyperelasticity) then
721-
elasticity = .true.
722-
stress_idx%beg = sys_size + 1
723-
stress_idx%end = sys_size + (num_dims*(num_dims + 1))/2
724-
! number of stresses is 1 in 1D, 3 in 2D, 6 in 3D
725-
sys_size = stress_idx%end
726-
end if
727-
728-
if (hyperelasticity) then
729-
! number of entries in the symmetric btensor plus the jacobian
730-
b_size = (num_dims*(num_dims + 1))/2 + 1
731-
tensor_size = num_dims**2 + 1
732-
xi_idx%beg = sys_size + 1
733-
xi_idx%end = sys_size + num_dims
734-
! adding three more equations for the \xi field and the elastic energy
735-
sys_size = xi_idx%end + 1
736-
end if
737-
738-
if (surface_tension) then
739-
c_idx = sys_size + 1
740-
sys_size = c_idx
741-
end if
742-
743706
else if (model_eqns == 4) then
744707
! 4 equation model with subgrid bubbles_euler
745708
cont_idx%beg = 1 ! one continuity equation
@@ -798,6 +761,54 @@ contains
798761
end if
799762
end if
800763

764+
if (model_eqns == 2 .or. model_eqns == 3) then
765+
766+
if (hypoelasticity .or. hyperelasticity) then
767+
elasticity = .true.
768+
stress_idx%beg = sys_size + 1
769+
stress_idx%end = sys_size + (num_dims*(num_dims + 1))/2
770+
! number of stresses is 1 in 1D, 3 in 2D, 6 in 3D
771+
sys_size = stress_idx%end
772+
773+
! shear stress index is 2 for 2D and 2,4,5 for 3D
774+
if (num_dims == 1) then
775+
shear_num = 0
776+
else if (num_dims == 2) then
777+
shear_num = 1
778+
shear_indices(1) = stress_idx%beg - 1 + 2
779+
shear_BC_flip_num = 1
780+
shear_BC_flip_indices(1:2, 1) = shear_indices(1)
781+
! Both x-dir and y-dir: flip tau_xy only
782+
else if (num_dims == 3) then
783+
shear_num = 3
784+
shear_indices(1:3) = stress_idx%beg - 1 + (/2, 4, 5/)
785+
shear_BC_flip_num = 2
786+
shear_BC_flip_indices(1, 1:2) = shear_indices((/1, 2/))
787+
shear_BC_flip_indices(2, 1:2) = shear_indices((/1, 3/))
788+
shear_BC_flip_indices(3, 1:2) = shear_indices((/2, 3/))
789+
! x-dir: flip tau_xy and tau_xz
790+
! y-dir: flip tau_xy and tau_yz
791+
! z-dir: flip tau_xz and tau_yz
792+
end if
793+
end if
794+
795+
if (hyperelasticity) then
796+
! number of entries in the symmetric btensor plus the jacobian
797+
b_size = (num_dims*(num_dims + 1))/2 + 1
798+
tensor_size = num_dims**2 + 1
799+
xi_idx%beg = sys_size + 1
800+
xi_idx%end = sys_size + num_dims
801+
! adding three more equations for the \xi field and the elastic energy
802+
sys_size = xi_idx%end + 1
803+
end if
804+
805+
if (surface_tension) then
806+
c_idx = sys_size + 1
807+
sys_size = c_idx
808+
end if
809+
810+
end if
811+
801812
if (chemistry) then
802813
species_idx%beg = sys_size + 1
803814
species_idx%end = sys_size + num_species

0 commit comments

Comments
 (0)