@@ -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
0 commit comments