Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions src/common/m_boundary_conditions.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,13 @@
q_prim_vf(i)%sf(j - 1, k, l)
end do

if (elasticity) then
do i = 1, shear_BC_flip_num
q_prim_vf(shear_BC_flip_indices(1, i))%sf(-j, k, l) = &
-q_prim_vf(shear_BC_flip_indices(1, i))%sf(j - 1, k, l)

Check warning on line 360 in src/common/m_boundary_conditions.fpp

View check run for this annotation

Codecov / codecov/patch

src/common/m_boundary_conditions.fpp#L359-L360

Added lines #L359 - L360 were not covered by tests
end do
end if

if (hyperelasticity) then
q_prim_vf(xibeg)%sf(-j, k, l) = &
-q_prim_vf(xibeg)%sf(j - 1, k, l)
Expand Down Expand Up @@ -404,6 +411,13 @@
q_prim_vf(i)%sf(m - (j - 1), k, l)
end do

if (elasticity) then
do i = 1, shear_BC_flip_num
q_prim_vf(shear_BC_flip_indices(1, i))%sf(m + j, k, l) = &
-q_prim_vf(shear_BC_flip_indices(1, i))%sf(m - (j - 1), k, l)

Check warning on line 417 in src/common/m_boundary_conditions.fpp

View check run for this annotation

Codecov / codecov/patch

src/common/m_boundary_conditions.fpp#L416-L417

Added lines #L416 - L417 were not covered by tests
end do
end if

if (hyperelasticity) then
q_prim_vf(xibeg)%sf(m + j, k, l) = &
-q_prim_vf(xibeg)%sf(m - (j - 1), k, l)
Expand Down Expand Up @@ -457,6 +471,13 @@
q_prim_vf(i)%sf(l, j - 1, k)
end do

if (elasticity) then
do i = 1, shear_BC_flip_num
q_prim_vf(shear_BC_flip_indices(2, i))%sf(l, -j, k) = &
-q_prim_vf(shear_BC_flip_indices(2, i))%sf(l, j - 1, k)

Check warning on line 477 in src/common/m_boundary_conditions.fpp

View check run for this annotation

Codecov / codecov/patch

src/common/m_boundary_conditions.fpp#L476-L477

Added lines #L476 - L477 were not covered by tests
end do
end if

if (hyperelasticity) then
q_prim_vf(xibeg + 1)%sf(l, -j, k) = &
-q_prim_vf(xibeg + 1)%sf(l, j - 1, k)
Expand Down Expand Up @@ -504,6 +525,13 @@
q_prim_vf(i)%sf(l, n - (j - 1), k)
end do

if (elasticity) then
do i = 1, shear_BC_flip_num
q_prim_vf(shear_BC_flip_indices(2, i))%sf(l, n + j, k) = &
-q_prim_vf(shear_BC_flip_indices(2, i))%sf(l, n - (j - 1), k)

Check warning on line 531 in src/common/m_boundary_conditions.fpp

View check run for this annotation

Codecov / codecov/patch

src/common/m_boundary_conditions.fpp#L530-L531

Added lines #L530 - L531 were not covered by tests
end do
end if

if (hyperelasticity) then
q_prim_vf(xibeg + 1)%sf(l, n + j, k) = &
-q_prim_vf(xibeg + 1)%sf(l, n - (j - 1), k)
Expand Down Expand Up @@ -556,6 +584,13 @@
q_prim_vf(i)%sf(k, l, j - 1)
end do

if (elasticity) then
do i = 1, shear_BC_flip_num
q_prim_vf(shear_BC_flip_indices(3, i))%sf(k, l, -j) = &
-q_prim_vf(shear_BC_flip_indices(3, i))%sf(k, l, j - 1)

Check warning on line 590 in src/common/m_boundary_conditions.fpp

View check run for this annotation

Codecov / codecov/patch

src/common/m_boundary_conditions.fpp#L589-L590

Added lines #L589 - L590 were not covered by tests
end do
end if

if (hyperelasticity) then
q_prim_vf(xiend)%sf(k, l, -j) = &
-q_prim_vf(xiend)%sf(k, l, j - 1)
Expand Down Expand Up @@ -603,6 +638,13 @@
q_prim_vf(i)%sf(k, l, p - (j - 1))
end do

if (elasticity) then
do i = 1, shear_BC_flip_num
q_prim_vf(shear_BC_flip_indices(3, i))%sf(k, l, p + j) = &
-q_prim_vf(shear_BC_flip_indices(3, i))%sf(k, l, p - (j - 1))

Check warning on line 644 in src/common/m_boundary_conditions.fpp

View check run for this annotation

Codecov / codecov/patch

src/common/m_boundary_conditions.fpp#L643-L644

Added lines #L643 - L644 were not covered by tests
end do
end if

if (hyperelasticity) then
q_prim_vf(xiend)%sf(k, l, p + j) = &
-q_prim_vf(xiend)%sf(k, l, p - (j - 1))
Expand Down
103 changes: 57 additions & 46 deletions src/post_process/m_global_parameters.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,15 @@
type(int_bounds_info) :: bc_x, bc_y, bc_z
!> @}

integer :: shear_num !! Number of shear stress components
integer, dimension(3) :: shear_indices !<
!! Indices of the stress components that represent shear stress
integer :: shear_BC_flip_num !<
!! Number of shear stress components to reflect for boundary conditions
integer, dimension(3, 2) :: shear_BC_flip_indices !<
!! Indices of shear stress components to reflect for boundary conditions.
!! Size: (1:3, 1:shear_BC_flip_num) for (x/y/z, [indices])

logical :: parallel_io !< Format of the data files
logical :: sim_data
logical :: file_per_process !< output format
Expand Down Expand Up @@ -585,29 +594,6 @@
sys_size = B_idx%end
end if

if (hypoelasticity .or. hyperelasticity) then
elasticity = .true.
stress_idx%beg = sys_size + 1
stress_idx%end = sys_size + (num_dims*(num_dims + 1))/2
! number of distinct stresses is 1 in 1D, 3 in 2D, 6 in 3D
sys_size = stress_idx%end
end if

if (hyperelasticity) then
xi_idx%beg = sys_size + 1
xi_idx%end = sys_size + num_dims
! adding three more equations for the \xi field and the elastic energy
sys_size = xi_idx%end + 1
! number of entries in the symmetric btensor plus the jacobian
b_size = (num_dims*(num_dims + 1))/2 + 1
tensor_size = num_dims**2 + 1
end if

if (surface_tension) then
c_idx = sys_size + 1
sys_size = c_idx
end if

! Volume Fraction Model (6-equation model)
else if (model_eqns == 3) then

Expand All @@ -626,29 +612,6 @@
sys_size = internalEnergies_idx%end
alf_idx = 1 ! dummy, cannot actually have a void fraction

if (hypoelasticity .or. hyperelasticity) then
elasticity = .true.
stress_idx%beg = sys_size + 1
stress_idx%end = sys_size + (num_dims*(num_dims + 1))/2
! number of stresses is 1 in 1D, 3 in 2D, 6 in 3D
sys_size = stress_idx%end
end if

if (hyperelasticity) then
xi_idx%beg = sys_size + 1
xi_idx%end = sys_size + num_dims
! adding three more equations for the \xi field and the elastic energy
sys_size = xi_idx%end + 1
! number of entries in the symmetric btensor plus the jacobian
b_size = (num_dims*(num_dims + 1))/2 + 1
tensor_size = num_dims**2 + 1
end if

if (surface_tension) then
c_idx = sys_size + 1
sys_size = c_idx
end if

else if (model_eqns == 4) then
cont_idx%beg = 1 ! one continuity equation
cont_idx%end = 1 !num_fluids
Expand Down Expand Up @@ -705,6 +668,54 @@
end if
end if

if (model_eqns == 2 .or. model_eqns == 3) then

if (hypoelasticity .or. hyperelasticity) then
elasticity = .true.
stress_idx%beg = sys_size + 1
stress_idx%end = sys_size + (num_dims*(num_dims + 1))/2
! number of stresses is 1 in 1D, 3 in 2D, 6 in 3D
sys_size = stress_idx%end

! shear stress index is 2 for 2D and 2,4,5 for 3D
if (num_dims == 1) then
shear_num = 0
else if (num_dims == 2) then
shear_num = 1
shear_indices(1) = stress_idx%beg - 1 + 2
shear_BC_flip_num = 1
shear_BC_flip_indices(1:2, 1) = shear_indices(1)
! Both x-dir and y-dir: flip tau_xy only
else if (num_dims == 3) then
shear_num = 3
shear_indices(1:3) = stress_idx%beg - 1 + (/2, 4, 5/)
shear_BC_flip_num = 2
shear_BC_flip_indices(1, 1:2) = shear_indices((/1, 2/))
shear_BC_flip_indices(2, 1:2) = shear_indices((/1, 3/))
shear_BC_flip_indices(3, 1:2) = shear_indices((/2, 3/))

Check warning on line 695 in src/post_process/m_global_parameters.fpp

View check run for this annotation

Codecov / codecov/patch

src/post_process/m_global_parameters.fpp#L693-L695

Added lines #L693 - L695 were not covered by tests
! x-dir: flip tau_xy and tau_xz
! y-dir: flip tau_xy and tau_yz
! z-dir: flip tau_xz and tau_yz
end if
end if

if (hyperelasticity) then
xi_idx%beg = sys_size + 1
xi_idx%end = sys_size + num_dims

Check warning on line 704 in src/post_process/m_global_parameters.fpp

View check run for this annotation

Codecov / codecov/patch

src/post_process/m_global_parameters.fpp#L703-L704

Added lines #L703 - L704 were not covered by tests
! adding three more equations for the \xi field and the elastic energy
sys_size = xi_idx%end + 1

Check warning on line 706 in src/post_process/m_global_parameters.fpp

View check run for this annotation

Codecov / codecov/patch

src/post_process/m_global_parameters.fpp#L706

Added line #L706 was not covered by tests
! number of entries in the symmetric btensor plus the jacobian
b_size = (num_dims*(num_dims + 1))/2 + 1
tensor_size = num_dims**2 + 1

Check warning on line 709 in src/post_process/m_global_parameters.fpp

View check run for this annotation

Codecov / codecov/patch

src/post_process/m_global_parameters.fpp#L708-L709

Added lines #L708 - L709 were not covered by tests
end if

if (surface_tension) then
c_idx = sys_size + 1
sys_size = c_idx
end if

end if

if (chemistry) then
species_idx%beg = sys_size + 1
species_idx%end = sys_size + num_species
Expand Down
103 changes: 57 additions & 46 deletions src/pre_process/m_global_parameters.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,15 @@
type(int_bounds_info) :: bc_x, bc_y, bc_z !<
!! Boundary conditions in the x-, y- and z-coordinate directions

integer :: shear_num !! Number of shear stress components
integer, dimension(3) :: shear_indices !<
!! Indices of the stress components that represent shear stress
integer :: shear_BC_flip_num !<
!! Number of shear stress components to reflect for boundary conditions
integer, dimension(3, 2) :: shear_BC_flip_indices !<
!! Indices of shear stress components to reflect for boundary conditions.
!! Size: (1:3, 1:shear_BC_flip_num) for (x/y/z, [indices])

logical :: parallel_io !< Format of the data files
logical :: file_per_process !< type of data output
integer :: precision !< Precision of output files
Expand Down Expand Up @@ -677,29 +686,6 @@
sys_size = B_idx%end
end if

if (hypoelasticity .or. hyperelasticity) then
elasticity = .true.
stress_idx%beg = sys_size + 1
stress_idx%end = sys_size + (num_dims*(num_dims + 1))/2
! number of stresses is 1 in 1D, 3 in 2D, 6 in 3D
sys_size = stress_idx%end
end if

if (hyperelasticity) then
! number of entries in the symmetric btensor plus the jacobian
b_size = (num_dims*(num_dims + 1))/2 + 1
tensor_size = num_dims**2 + 1
xi_idx%beg = sys_size + 1
xi_idx%end = sys_size + num_dims
! adding three more equations for the \xi field and the elastic energy
sys_size = xi_idx%end + 1
end if

if (surface_tension) then
c_idx = sys_size + 1
sys_size = c_idx
end if

! Volume Fraction Model (6-equation model)
else if (model_eqns == 3) then

Expand All @@ -717,29 +703,6 @@
internalEnergies_idx%end = adv_idx%end + num_fluids
sys_size = internalEnergies_idx%end

if (hypoelasticity .or. hyperelasticity) then
elasticity = .true.
stress_idx%beg = sys_size + 1
stress_idx%end = sys_size + (num_dims*(num_dims + 1))/2
! number of stresses is 1 in 1D, 3 in 2D, 6 in 3D
sys_size = stress_idx%end
end if

if (hyperelasticity) then
! number of entries in the symmetric btensor plus the jacobian
b_size = (num_dims*(num_dims + 1))/2 + 1
tensor_size = num_dims**2 + 1
xi_idx%beg = sys_size + 1
xi_idx%end = sys_size + num_dims
! adding three more equations for the \xi field and the elastic energy
sys_size = xi_idx%end + 1
end if

if (surface_tension) then
c_idx = sys_size + 1
sys_size = c_idx
end if

else if (model_eqns == 4) then
! 4 equation model with subgrid bubbles_euler
cont_idx%beg = 1 ! one continuity equation
Expand Down Expand Up @@ -798,6 +761,54 @@
end if
end if

if (model_eqns == 2 .or. model_eqns == 3) then

if (hypoelasticity .or. hyperelasticity) then
elasticity = .true.
stress_idx%beg = sys_size + 1
stress_idx%end = sys_size + (num_dims*(num_dims + 1))/2
! number of stresses is 1 in 1D, 3 in 2D, 6 in 3D
sys_size = stress_idx%end

! shear stress index is 2 for 2D and 2,4,5 for 3D
if (num_dims == 1) then
shear_num = 0
else if (num_dims == 2) then
shear_num = 1
shear_indices(1) = stress_idx%beg - 1 + 2
shear_BC_flip_num = 1
shear_BC_flip_indices(1:2, 1) = shear_indices(1)
! Both x-dir and y-dir: flip tau_xy only
else if (num_dims == 3) then
shear_num = 3
shear_indices(1:3) = stress_idx%beg - 1 + (/2, 4, 5/)
shear_BC_flip_num = 2
shear_BC_flip_indices(1, 1:2) = shear_indices((/1, 2/))
shear_BC_flip_indices(2, 1:2) = shear_indices((/1, 3/))
shear_BC_flip_indices(3, 1:2) = shear_indices((/2, 3/))

Check warning on line 788 in src/pre_process/m_global_parameters.fpp

View check run for this annotation

Codecov / codecov/patch

src/pre_process/m_global_parameters.fpp#L786-L788

Added lines #L786 - L788 were not covered by tests
! x-dir: flip tau_xy and tau_xz
! y-dir: flip tau_xy and tau_yz
! z-dir: flip tau_xz and tau_yz
end if
end if

if (hyperelasticity) then
! number of entries in the symmetric btensor plus the jacobian
b_size = (num_dims*(num_dims + 1))/2 + 1
tensor_size = num_dims**2 + 1
xi_idx%beg = sys_size + 1
xi_idx%end = sys_size + num_dims

Check warning on line 800 in src/pre_process/m_global_parameters.fpp

View check run for this annotation

Codecov / codecov/patch

src/pre_process/m_global_parameters.fpp#L797-L800

Added lines #L797 - L800 were not covered by tests
! adding three more equations for the \xi field and the elastic energy
sys_size = xi_idx%end + 1

Check warning on line 802 in src/pre_process/m_global_parameters.fpp

View check run for this annotation

Codecov / codecov/patch

src/pre_process/m_global_parameters.fpp#L802

Added line #L802 was not covered by tests
end if

if (surface_tension) then
c_idx = sys_size + 1
sys_size = c_idx
end if

end if

if (chemistry) then
species_idx%beg = sys_size + 1
species_idx%end = sys_size + num_species
Expand Down
Loading
Loading