Computes bodyforces based on old state.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(cdifs_obj), | intent(inout) | :: | this |
CDIFS solver |
subroutine cdifs_obj_AdvanceSolutionBodyForce(this) !> Computes bodyforces based on old state. implicit none class(cdifs_obj), intent(inout) :: this !! CDIFS solver ! Work variables integer :: dir integer :: i,j,k ! Remove any old forcing do dir=1,3 this%srcV(dir) = 0.0_wp end do ! Update forcing select type(bodyforce=>this%bodyforce) type is (bodyforce_NONE) ! Nothing to do type is (bodyforce_CPG) ! Apply constant pressure gradient forcing associate ( V => this%V, srcV => this%srcV, & lo => this%block%lo, hi => this%block%hi ) do dir=1,3 do k=lo(3),hi(3) do j=lo(2),hi(2) do i=lo(1),hi(1) if (this%maskV(dir)%cell(i,j,k)>0) & srcV(dir)%cell(i,j,k) = srcV(dir)%cell(i,j,k) - bodyforce%CPG(dir)/this%rho end do end do end do end do end associate end select return end subroutine cdifs_obj_AdvanceSolutionBodyForce