compute_face_areas Subroutine

private subroutine compute_face_areas(Ifaces, Jfaces, Kfaces, bc)

Compute face areas based on area vectors

The face areas are computed using the face area vectors. Prior to using this subroutine, the face area vectors must computed and placed in the face normal variables.

Since the area is given by abs(d1 x d2), the areas are calculated using the normal vectors calculated in compute_face_area_vectors, but before normalising them

Arguments

Type IntentOptional AttributesName
type(facetype), intent(inout), dimension(-2:imx+3,-2:jmx+2,-2:kmx+2):: Ifaces

Store face quantites for I faces: normal and area

type(facetype), intent(inout), dimension(-2:imx+2,-2:jmx+3,-2:kmx+2):: Jfaces

Store face quantites for J faces: normal and area

type(facetype), intent(inout), dimension(-2:imx+2,-2:jmx+2,-2:kmx+3):: Kfaces

Store face quantites for K faces: normal and area

type(boundarytype), intent(in) :: bc

Called by

proc~~compute_face_areas~~CalledByGraph proc~compute_face_areas compute_face_areas proc~compute_face_areas_and_normals compute_face_areas_and_normals proc~compute_face_areas_and_normals->proc~compute_face_areas proc~setup_geometry setup_geometry proc~setup_geometry->proc~compute_face_areas_and_normals proc~setup_solver setup_solver proc~setup_solver->proc~setup_geometry proc~start_run start_run proc~start_run->proc~setup_solver program~main main program~main->proc~start_run

Contents

Source Code


Source Code

        subroutine compute_face_areas(Ifaces, Jfaces, Kfaces, bc)
            !< Compute face areas based on area vectors
            !<
            !< The face areas are computed using the face area vectors. 
            !< Prior to using this subroutine, the face area vectors must
            !< computed and placed in the face normal variables. 
            !<
            !< Since the area is given by abs(d1 x d2), the areas are
            !< calculated using the normal vectors calculated in 
            !< compute_face_area_vectors, but before normalising them
            !-----------------------------------------------------------
            
            implicit none
            type(facetype), dimension(-2:imx+3,-2:jmx+2,-2:kmx+2), intent(inout) :: Ifaces
            !< Store face quantites for I faces: normal and area
            type(facetype), dimension(-2:imx+2,-2:jmx+3,-2:kmx+2), intent(inout) :: Jfaces
            !< Store face quantites for J faces: normal and area
            type(facetype), dimension(-2:imx+2,-2:jmx+2,-2:kmx+3), intent(inout) :: Kfaces
            !< Store face quantites for K faces: normal and area
            type(boundarytype), intent(in) :: bc

            Ifaces(:,:,:)%A = sqrt((Ifaces(:,:,:)%nx)**2 + (Ifaces(:,:,:)%ny)**2 + &
                                  (Ifaces(:,:,:)%nz)**2)

            Jfaces(:,:,:)%A = sqrt((Jfaces(:,:,:)%nx)**2 + (Jfaces(:,:,:)%ny)**2 + &
                                  (Jfaces(:,:,:)%nz)**2)

            Kfaces(:,:,:)%A = sqrt((Kfaces(:,:,:)%nx)**2 + (Kfaces(:,:,:)%ny)**2 + &
                                  (Kfaces(:,:,:)%nz)**2)

            ! Pole boundary conditions
            ! making sure face area is exactly equal zero
            if(bc%imin_id==-7) Ifaces(-2:1     ,  :,  :)%A=0.
            if(bc%imax_id==-7) Ifaces(imx:imx+3,  :,  :)%A=0.
            if(bc%jmin_id==-7) Jfaces(  :,     -2:1,  :)%A=0.
            if(bc%jmax_id==-7) Jfaces(  :,jmx:jmx+3,  :)%A=0.
            if(bc%kmin_id==-7) Kfaces(  :,  :,     -2:1)%A=0.
            if(bc%kmax_id==-7) Kfaces(  :,  :,kmx:kmx+3)%A=0.

        end subroutine compute_face_areas