Skip to content

Commit 990c3e6

Browse files
committed
clean
1 parent b397cec commit 990c3e6

File tree

3 files changed

+147
-273
lines changed

3 files changed

+147
-273
lines changed

src/post_process/m_global_parameters.fpp

Lines changed: 48 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -572,50 +572,6 @@ contains
572572

573573
end if
574574

575-
if (hypoelasticity .or. hyperelasticity) then
576-
elasticity = .true.
577-
stress_idx%beg = sys_size + 1
578-
stress_idx%end = sys_size + (num_dims*(num_dims + 1))/2
579-
! number of distinct stresses is 1 in 1D, 3 in 2D, 6 in 3D
580-
sys_size = stress_idx%end
581-
582-
! shear stress index is 2 for 2D and 2,4,5 for 3D
583-
if (num_dims == 1) then
584-
shear_num = 0
585-
else if (num_dims == 2) then
586-
shear_num = 1
587-
shear_indices(1) = stress_idx%beg - 1 + 2
588-
shear_BC_flip_num = 1
589-
shear_BC_flip_indices(1:2, 1) = shear_indices(1)
590-
! Both x-dir and y-dir: flip tau_xy only
591-
else if (num_dims == 3) then
592-
shear_num = 3
593-
shear_indices(1:3) = stress_idx%beg - 1 + (/2, 4, 5/)
594-
shear_BC_flip_num = 2
595-
shear_BC_flip_indices(1, 1:2) = shear_indices((/1, 2/))
596-
shear_BC_flip_indices(2, 1:2) = shear_indices((/1, 3/))
597-
shear_BC_flip_indices(3, 1:2) = shear_indices((/2, 3/))
598-
! x-dir: flip tau_xy and tau_xz
599-
! y-dir: flip tau_xy and tau_yz
600-
! z-dir: flip tau_xz and tau_yz
601-
end if
602-
end if
603-
604-
if (hyperelasticity) then
605-
xi_idx%beg = sys_size + 1
606-
xi_idx%end = sys_size + num_dims
607-
! adding three more equations for the \xi field and the elastic energy
608-
sys_size = xi_idx%end + 1
609-
! number of entries in the symmetric btensor plus the jacobian
610-
b_size = (num_dims*(num_dims + 1))/2 + 1
611-
tensor_size = num_dims**2 + 1
612-
end if
613-
614-
if (surface_tension) then
615-
c_idx = sys_size + 1
616-
sys_size = c_idx
617-
end if
618-
619575
! Volume Fraction Model (6-equation model)
620576
else if (model_eqns == 3) then
621577

@@ -634,50 +590,6 @@ contains
634590
sys_size = internalEnergies_idx%end
635591
alf_idx = 1 ! dummy, cannot actually have a void fraction
636592

637-
if (hypoelasticity .or. hyperelasticity) then
638-
elasticity = .true.
639-
stress_idx%beg = sys_size + 1
640-
stress_idx%end = sys_size + (num_dims*(num_dims + 1))/2
641-
! number of stresses is 1 in 1D, 3 in 2D, 6 in 3D
642-
sys_size = stress_idx%end
643-
644-
! shear stress index is 2 for 2D and 2,4,5 for 3D
645-
if (num_dims == 1) then
646-
shear_num = 0
647-
else if (num_dims == 2) then
648-
shear_num = 1
649-
shear_indices(1) = stress_idx%beg - 1 + 2
650-
shear_BC_flip_num = 1
651-
shear_BC_flip_indices(1:2, 1) = shear_indices(1)
652-
! Both x-dir and y-dir: flip tau_xy only
653-
else if (num_dims == 3) then
654-
shear_num = 3
655-
shear_indices(1:3) = stress_idx%beg - 1 + (/2, 4, 5/)
656-
shear_BC_flip_num = 2
657-
shear_BC_flip_indices(1, 1:2) = shear_indices((/1, 2/))
658-
shear_BC_flip_indices(2, 1:2) = shear_indices((/1, 3/))
659-
shear_BC_flip_indices(3, 1:2) = shear_indices((/2, 3/))
660-
! x-dir: flip tau_xy and tau_xz
661-
! y-dir: flip tau_xy and tau_yz
662-
! z-dir: flip tau_xz and tau_yz
663-
end if
664-
end if
665-
666-
if (hyperelasticity) then
667-
xi_idx%beg = sys_size + 1
668-
xi_idx%end = sys_size + num_dims
669-
! adding three more equations for the \xi field and the elastic energy
670-
sys_size = xi_idx%end + 1
671-
! number of entries in the symmetric btensor plus the jacobian
672-
b_size = (num_dims*(num_dims + 1))/2 + 1
673-
tensor_size = num_dims**2 + 1
674-
end if
675-
676-
if (surface_tension) then
677-
c_idx = sys_size + 1
678-
sys_size = c_idx
679-
end if
680-
681593
else if (model_eqns == 4) then
682594
cont_idx%beg = 1 ! one continuity equation
683595
cont_idx%end = 1 !num_fluids
@@ -734,6 +646,54 @@ contains
734646
end if
735647
end if
736648

649+
if (model_eqns == 2 .or. model_eqns == 3) then
650+
651+
if (hypoelasticity .or. hyperelasticity) then
652+
elasticity = .true.
653+
stress_idx%beg = sys_size + 1
654+
stress_idx%end = sys_size + (num_dims*(num_dims + 1))/2
655+
! number of stresses is 1 in 1D, 3 in 2D, 6 in 3D
656+
sys_size = stress_idx%end
657+
658+
! shear stress index is 2 for 2D and 2,4,5 for 3D
659+
if (num_dims == 1) then
660+
shear_num = 0
661+
else if (num_dims == 2) then
662+
shear_num = 1
663+
shear_indices(1) = stress_idx%beg - 1 + 2
664+
shear_BC_flip_num = 1
665+
shear_BC_flip_indices(1:2, 1) = shear_indices(1)
666+
! Both x-dir and y-dir: flip tau_xy only
667+
else if (num_dims == 3) then
668+
shear_num = 3
669+
shear_indices(1:3) = stress_idx%beg - 1 + (/2, 4, 5/)
670+
shear_BC_flip_num = 2
671+
shear_BC_flip_indices(1, 1:2) = shear_indices((/1, 2/))
672+
shear_BC_flip_indices(2, 1:2) = shear_indices((/1, 3/))
673+
shear_BC_flip_indices(3, 1:2) = shear_indices((/2, 3/))
674+
! x-dir: flip tau_xy and tau_xz
675+
! y-dir: flip tau_xy and tau_yz
676+
! z-dir: flip tau_xz and tau_yz
677+
end if
678+
end if
679+
680+
if (hyperelasticity) then
681+
xi_idx%beg = sys_size + 1
682+
xi_idx%end = sys_size + num_dims
683+
! adding three more equations for the \xi field and the elastic energy
684+
sys_size = xi_idx%end + 1
685+
! number of entries in the symmetric btensor plus the jacobian
686+
b_size = (num_dims*(num_dims + 1))/2 + 1
687+
tensor_size = num_dims**2 + 1
688+
end if
689+
690+
if (surface_tension) then
691+
c_idx = sys_size + 1
692+
sys_size = c_idx
693+
end if
694+
695+
end if
696+
737697
if (chemistry) then
738698
species_idx%beg = sys_size + 1
739699
species_idx%end = sys_size + num_species

src/pre_process/m_global_parameters.fpp

Lines changed: 48 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -662,50 +662,6 @@ contains
662662
end if
663663
end if
664664

665-
if (hypoelasticity .or. hyperelasticity) then
666-
elasticity = .true.
667-
stress_idx%beg = sys_size + 1
668-
stress_idx%end = sys_size + (num_dims*(num_dims + 1))/2
669-
! number of stresses is 1 in 1D, 3 in 2D, 6 in 3D
670-
sys_size = stress_idx%end
671-
672-
! shear stress index is 2 for 2D and 2,4,5 for 3D
673-
if (num_dims == 1) then
674-
shear_num = 0
675-
else if (num_dims == 2) then
676-
shear_num = 1
677-
shear_indices(1) = stress_idx%beg - 1 + 2
678-
shear_BC_flip_num = 1
679-
shear_BC_flip_indices(1:2, 1) = shear_indices(1)
680-
! Both x-dir and y-dir: flip tau_xy only
681-
else if (num_dims == 3) then
682-
shear_num = 3
683-
shear_indices(1:3) = stress_idx%beg - 1 + (/2, 4, 5/)
684-
shear_BC_flip_num = 2
685-
shear_BC_flip_indices(1, 1:2) = shear_indices((/1, 2/))
686-
shear_BC_flip_indices(2, 1:2) = shear_indices((/1, 3/))
687-
shear_BC_flip_indices(3, 1:2) = shear_indices((/2, 3/))
688-
! x-dir: flip tau_xy and tau_xz
689-
! y-dir: flip tau_xy and tau_yz
690-
! z-dir: flip tau_xz and tau_yz
691-
end if
692-
end if
693-
694-
if (hyperelasticity) then
695-
! number of entries in the symmetric btensor plus the jacobian
696-
b_size = (num_dims*(num_dims + 1))/2 + 1
697-
tensor_size = num_dims**2 + 1
698-
xi_idx%beg = sys_size + 1
699-
xi_idx%end = sys_size + num_dims
700-
! adding three more equations for the \xi field and the elastic energy
701-
sys_size = xi_idx%end + 1
702-
end if
703-
704-
if (surface_tension) then
705-
c_idx = sys_size + 1
706-
sys_size = c_idx
707-
end if
708-
709665
! Volume Fraction Model (6-equation model)
710666
else if (model_eqns == 3) then
711667

@@ -723,50 +679,6 @@ contains
723679
internalEnergies_idx%end = adv_idx%end + num_fluids
724680
sys_size = internalEnergies_idx%end
725681

726-
if (hypoelasticity .or. hyperelasticity) then
727-
elasticity = .true.
728-
stress_idx%beg = sys_size + 1
729-
stress_idx%end = sys_size + (num_dims*(num_dims + 1))/2
730-
! number of stresses is 1 in 1D, 3 in 2D, 6 in 3D
731-
sys_size = stress_idx%end
732-
733-
! shear stress index is 2 for 2D and 2,4,5 for 3D
734-
if (num_dims == 1) then
735-
shear_num = 0
736-
else if (num_dims == 2) then
737-
shear_num = 1
738-
shear_indices(1) = stress_idx%beg - 1 + 2
739-
shear_BC_flip_num = 1
740-
shear_BC_flip_indices(1:2, 1) = shear_indices(1)
741-
! Both x-dir and y-dir: flip tau_xy only
742-
else if (num_dims == 3) then
743-
shear_num = 3
744-
shear_indices(1:3) = stress_idx%beg - 1 + (/2, 4, 5/)
745-
shear_BC_flip_num = 2
746-
shear_BC_flip_indices(1, 1:2) = shear_indices((/1, 2/))
747-
shear_BC_flip_indices(2, 1:2) = shear_indices((/1, 3/))
748-
shear_BC_flip_indices(3, 1:2) = shear_indices((/2, 3/))
749-
! x-dir: flip tau_xy and tau_xz
750-
! y-dir: flip tau_xy and tau_yz
751-
! z-dir: flip tau_xz and tau_yz
752-
end if
753-
end if
754-
755-
if (hyperelasticity) then
756-
! number of entries in the symmetric btensor plus the jacobian
757-
b_size = (num_dims*(num_dims + 1))/2 + 1
758-
tensor_size = num_dims**2 + 1
759-
xi_idx%beg = sys_size + 1
760-
xi_idx%end = sys_size + num_dims
761-
! adding three more equations for the \xi field and the elastic energy
762-
sys_size = xi_idx%end + 1
763-
end if
764-
765-
if (surface_tension) then
766-
c_idx = sys_size + 1
767-
sys_size = c_idx
768-
end if
769-
770682
else if (model_eqns == 4) then
771683
! 4 equation model with subgrid bubbles_euler
772684
cont_idx%beg = 1 ! one continuity equation
@@ -825,6 +737,54 @@ contains
825737
end if
826738
end if
827739

740+
if (model_eqns == 2 .or. model_eqns == 3) then
741+
742+
if (hypoelasticity .or. hyperelasticity) then
743+
elasticity = .true.
744+
stress_idx%beg = sys_size + 1
745+
stress_idx%end = sys_size + (num_dims*(num_dims + 1))/2
746+
! number of stresses is 1 in 1D, 3 in 2D, 6 in 3D
747+
sys_size = stress_idx%end
748+
749+
! shear stress index is 2 for 2D and 2,4,5 for 3D
750+
if (num_dims == 1) then
751+
shear_num = 0
752+
else if (num_dims == 2) then
753+
shear_num = 1
754+
shear_indices(1) = stress_idx%beg - 1 + 2
755+
shear_BC_flip_num = 1
756+
shear_BC_flip_indices(1:2, 1) = shear_indices(1)
757+
! Both x-dir and y-dir: flip tau_xy only
758+
else if (num_dims == 3) then
759+
shear_num = 3
760+
shear_indices(1:3) = stress_idx%beg - 1 + (/2, 4, 5/)
761+
shear_BC_flip_num = 2
762+
shear_BC_flip_indices(1, 1:2) = shear_indices((/1, 2/))
763+
shear_BC_flip_indices(2, 1:2) = shear_indices((/1, 3/))
764+
shear_BC_flip_indices(3, 1:2) = shear_indices((/2, 3/))
765+
! x-dir: flip tau_xy and tau_xz
766+
! y-dir: flip tau_xy and tau_yz
767+
! z-dir: flip tau_xz and tau_yz
768+
end if
769+
end if
770+
771+
if (hyperelasticity) then
772+
! number of entries in the symmetric btensor plus the jacobian
773+
b_size = (num_dims*(num_dims + 1))/2 + 1
774+
tensor_size = num_dims**2 + 1
775+
xi_idx%beg = sys_size + 1
776+
xi_idx%end = sys_size + num_dims
777+
! adding three more equations for the \xi field and the elastic energy
778+
sys_size = xi_idx%end + 1
779+
end if
780+
781+
if (surface_tension) then
782+
c_idx = sys_size + 1
783+
sys_size = c_idx
784+
end if
785+
786+
end if
787+
828788
if (chemistry) then
829789
species_idx%beg = sys_size + 1
830790
species_idx%end = sys_size + num_species

0 commit comments

Comments
 (0)