Fluid port initialisation for strands
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(strand_t), | intent(inout), | target | :: | me | ||
| type(krn_t), | intent(inout) | :: | krn | |||
| class(input_t), | intent(in), | pointer | :: | cfg |
subroutine strand_init_part2(me, krn, cfg) !! Fluid port initialisation for strands type(strand_t), target, intent(inout) :: me type(krn_t), intent(inout) :: krn class(input_t), pointer, intent(in) :: cfg integer :: NbSubM,i,idx,PrevRowIdx,PrevColIdx real(dp), pointer :: rhs(:) integer, allocatable :: list_thp_loc(:) type(FS_port_t), pointer :: FS_ports(:) type(SS_flux_port_t), pointer :: SS_flux_ports(:) ! SS_flux ports --> always 2 ports implemented call krn%update(rhs_or_solution_view=rhs,SS_flux_p_loc=[1,me%SC_Prop%NbCells],SS_flux_p_view=SS_flux_ports) me%SC_Prop%in => SS_flux_ports(1) me%SC_Prop%out => SS_flux_ports(2) me%SC_Prop%in%AreaS = sum(me%ct(:)%area) me%SC_Prop%in%rhoMS = me%ro_M me%SC_Prop%in%Sgn4lk = -1.0_dp me%SC_Prop%in%dxLoc = me%SC_Prop%dxLoc(1) me%SC_Prop%in%Flx = 0.0_dp me%SC_Prop%in%derFlx_derCon = 0.0_dp me%SC_Prop%out%AreaS = sum(me%ct(:)%area) me%SC_Prop%out%rhoMS = me%ro_M me%SC_Prop%out%Sgn4lk = 1.0_dp me%SC_Prop%out%dxLoc = me%SC_Prop%dxLoc(me%SC_Prop%NbCells) me%SC_Prop%out%Flx = 0.0_dp me%SC_Prop%out%derFlx_derCon = 0.0_dp me%big%bvS(1:me%SC_Prop%NbCells) => rhs if(me%SC_Prop%FSlink) then allocate(list_thp_loc(me%SC_Prop%NbCells),me%SC_Prop%thermP(me%SC_Prop%NbCells)) list_thp_loc=[(i,i=1,me%SC_Prop%NbCells)] call krn%update(FS_p_loc=list_thp_loc,CompName=cfg%str('id'),FS_p_view=FS_ports) do i=1,me%SC_Prop%NbCells me%SC_Prop%thermP(i)%p => FS_ports(i) me%SC_Prop%thermP(i)%p%typeS = 'strand' me%SC_Prop%thermP(i)%p%AreaS = sum(me%ct(:)%area) me%SC_Prop%thermP(i)%p%rhoMS = me%ro_M enddo endif NbSubM=me%SC_Prop%NbCells allocate(me%bigLS%ValExp(NbSubM),me%bigLS%RowExp(NbSubM),me%bigLS%ColExp(NbSubM)) NbSubM=2*2+(me%SC_Prop%NbCells-2)*3 allocate(me%bigLS%ValImp(NbSubM),me%bigLS%RowImp(NbSubM),me%bigLS%ColImp(NbSubM)) idx=1 PrevColIdx=0 PrevRowIdx=0 do i=1,me%SC_Prop%NbCells me%bigLS%ValExp(idx)%p => me%big%bmS(i) me%bigLS%ColExp(idx)=PrevColIdx+1 me%bigLS%RowExp(idx)=PrevRowIdx+1 me%bigLS%ValImp(idx)%p => me%big%bmS(i) me%bigLS%ColImp(idx)=PrevColIdx+1 me%bigLS%RowImp(idx)=PrevRowIdx+1 idx=idx+1 PrevColIdx=PrevColIdx+1 PrevRowIdx=PrevRowIdx+1 enddo call krn%coo_add(.true.,me%bigLS%ColExp,me%bigLS%RowExp,me%bigLS%ValExp) PrevColIdx=1 PrevRowIdx=0 do i=1,me%SC_Prop%NbCells-1 me%bigLS%ValImp(idx)%p => me%big%cmS(i) me%bigLS%ColImp(idx)=PrevColIdx+1 me%bigLS%RowImp(idx)=PrevRowIdx+1 idx=idx+1 PrevColIdx=PrevColIdx+1 PrevRowIdx=PrevRowIdx+1 enddo PrevColIdx=0 PrevRowIdx=1 do i=1,me%SC_Prop%NbCells-1 me%bigLS%ValImp(idx)%p => me%big%amS(i) me%bigLS%ColImp(idx)=PrevColIdx+1 me%bigLS%RowImp(idx)=PrevRowIdx+1 idx=idx+1 PrevColIdx=PrevColIdx+1 PrevRowIdx=PrevRowIdx+1 enddo call krn%coo_add(.false.,me%bigLS%ColImp,me%bigLS%RowImp,me%bigLS%ValImp) deallocate(me%bigLS%ValExp,me%bigLS%RowExp,me%bigLS%ColExp) deallocate(me%bigLS%ValImp,me%bigLS%RowImp,me%bigLS%ColImp) end subroutine strand_init_part2